/* M1Agentur foundation 2.3.0
   Canonical contract: /design/m1agentur/M1_DESIGN.md
   Colors come only from /m1-design/m1-tokens.css (load it first). */

:root {
  --m1-font-sans: Arial, Helvetica, sans-serif;
  --m1-font-header: "M1 Header Manrope", Arial, Helvetica, sans-serif;
  --m1-weight-setup: 400;
  --m1-weight-decision: 600;
  --m1-weight-meta: 700;

  --m1-shell-max: 1400px;
  --m1-shell-gutter: 16px;
  --m1-section-space: 72px;
  --m1-editorial-grid-gap: 16px;
  --m1-patch-frame-inset: clamp(20px, 3vw, 44px);
  --m1-patch-frame-line: rgb(var(--m1-rgb-slate) / .14);
  --m1-layout-grid-gap: clamp(16px, 2vw, 30px);
  --m1-radius-control: 10px;
  --m1-radius-button: 12px;
  --m1-radius-panel: 24px;

  --m1-type-hero: 50px;
  --m1-type-hero-thesis: 26px;
  --m1-type-hero-category: 30px;
  --m1-type-section: 42px;
  --m1-type-stage: 36px;
  --m1-type-section-subline: 18px;
  --m1-type-stage-subline: 16px;
  --m1-type-service-subline: 16px;
  --m1-type-body: 16px;
  --m1-type-body-lead: 18px;
  --m1-type-row-title: 18px;
  --m1-type-button: 15px;
  --m1-type-meta: 11px;
  --m1-line-hero: .92;

  --m1-variant-bar-height: 40px;
  --m1-header-height: 88px;
  --m1-header-breathing-space: 24px;
  --m1-header-clearance: calc(var(--m1-variant-bar-height) + var(--m1-header-height) + var(--m1-header-breathing-space));
}

@font-face {
  font-family: "M1 Header Manrope";
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url("/fonts/manrope-300.woff2") format("woff2");
}

/* manrope-*.woff2 are one variable font file (wght axis), so 400 reuses the
   already cached file at no extra transfer. */
@font-face {
  font-family: "M1 Header Manrope";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/manrope-500.woff2") format("woff2");
}

@font-face {
  font-family: "M1 Header Manrope";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/manrope-500.woff2") format("woff2");
}

@font-face {
  font-family: "M1 Header Manrope";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/manrope-600.woff2") format("woff2");
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  overflow-x: clip;
}

.m1-page {
  min-width: 320px;
  margin: 0;
  overflow-x: clip;
  background: var(--m1-color-surface-warm);
  color: var(--m1-color-ink);
  font: var(--m1-weight-setup) var(--m1-type-body)/1.55 var(--m1-font-sans);
  text-rendering: optimizeLegibility;
}

.m1-page :where(img, svg, video) {
  display: block;
  max-width: 100%;
}

.m1-page :where(button, input, textarea, select) {
  font: inherit;
}

.m1-page :where(a) {
  color: inherit;
}

.m1-page ::selection {
  background: var(--m1-color-selection);
  color: var(--m1-color-navy);
}

.m1-page :where(button, a) {
  -webkit-tap-highlight-color: transparent;
}

.m1-shell {
  width: min(calc(100% - (2 * var(--m1-shell-gutter))), var(--m1-shell-max));
  margin-inline: auto;
}

.m1-section {
  padding-block: var(--m1-section-space);
}

.m1-attention-patch {
  border: 1px solid var(--m1-color-line);
  border-radius: var(--m1-radius-panel);
  background: var(--m1-color-patch);
}

.m1-patch-frame {
  position: relative;
  isolation: isolate;
  padding: clamp(20px, 3vw, 44px);
}

.m1-patch-frame::before {
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: var(--m1-radius-panel);
  background: var(--m1-color-frame);
  content: "";
}

.m1-patch-frame > .m1-attention-patch {
  padding: clamp(28px, 5vw, 72px);
}

.m1-heading {
  margin: 0;
  color: var(--m1-color-ink);
  font-size: var(--m1-type-section);
  font-weight: var(--m1-weight-setup);
  letter-spacing: -.045em;
  line-height: .98;
}

.m1-hero__title {
  margin: 0;
  font-size: var(--m1-type-hero);
  font-weight: var(--m1-weight-setup);
  letter-spacing: -.055em;
  line-height: var(--m1-line-hero);
}

.m1-hero__thesis {
  margin: 0;
  font-size: var(--m1-type-hero-thesis);
  font-weight: var(--m1-weight-setup);
  letter-spacing: -.035em;
  line-height: 1.04;
}

.m1-hero__category {
  margin: 0;
  font-size: var(--m1-type-hero-category);
  font-weight: var(--m1-weight-setup);
  letter-spacing: -.03em;
  line-height: 1.05;
}

.m1-stage__title {
  margin: 0;
  font-size: var(--m1-type-stage);
  font-weight: var(--m1-weight-setup);
  letter-spacing: -.035em;
  line-height: 1;
}

.m1-stage__number {
  display: block;
  width: fit-content;
  margin: 0 0 20px;
  color: color-mix(in srgb, var(--m1-color-teal-text) 24%, transparent);
  font-size: clamp(48px, 6vw, 56px);
  font-weight: var(--m1-weight-setup);
  letter-spacing: -.045em;
  line-height: .82;
  pointer-events: none;
  user-select: none;
}

.m1-eyebrow {
  margin: 0;
  color: var(--m1-color-teal-text);
  font-size: 11px;
  font-weight: var(--m1-weight-meta);
  letter-spacing: .12em;
  line-height: 1.3;
  text-transform: uppercase;
}

.m1-row-title {
  font-size: var(--m1-type-row-title);
  font-weight: var(--m1-weight-decision);
  letter-spacing: -.015em;
  line-height: 1.22;
}

.m1-heading__decision {
  font-weight: var(--m1-weight-decision);
}

.m1-subline {
  max-width: 70ch;
  margin-block: 24px 0;
  color: var(--m1-color-body);
  font-size: var(--m1-type-section-subline);
  line-height: 1.5;
}

.m1-body-lead {
  color: var(--m1-color-body);
  font-size: var(--m1-type-body-lead);
  font-weight: var(--m1-weight-setup);
  line-height: 1.5;
}

.m1-stage__subline {
  color: var(--m1-color-body);
  font-size: var(--m1-type-stage-subline);
  font-weight: var(--m1-weight-setup);
  line-height: 1.5;
}

.m1-service__subline {
  color: var(--m1-color-body);
  font-size: var(--m1-type-service-subline);
  font-weight: var(--m1-weight-setup);
  line-height: 1.5;
}

.m1-page :where(a, button, input, textarea, select):focus-visible {
  outline: 3px solid var(--m1-color-teal-text);
  outline-offset: 3px;
}

@media (max-width: 920px) {
  :root {
    --m1-header-height: 88px;
  }

  html {
    scroll-padding-top: calc(var(--m1-header-height) + 12px);
  }
}

@media (max-width: 620px) {
  :root {
    --m1-header-height: 72px;
    --m1-patch-frame-inset: 10px;
  }
}

@media (min-width: 621px) {
  :root {
    --m1-shell-gutter: 20px;
    --m1-section-space: 88px;
    --m1-type-hero: 60px;
    --m1-type-hero-thesis: 30px;
    --m1-type-section: 48px;
    --m1-type-stage: 40px;
    --m1-type-section-subline: 20px;
    --m1-type-stage-subline: 17px;
  }
}

@media (min-width: 821px) {
  :root {
    --m1-section-space: 104px;
    --m1-type-hero: 72px;
    --m1-type-hero-thesis: 32px;
    --m1-type-hero-category: 32px;
    --m1-type-section: 54px;
    --m1-type-stage: 42px;
  }
}

@media (min-width: 1200px) {
  :root {
    --m1-section-space: 128px;
    --m1-type-hero: 92px;
    --m1-type-hero-thesis: 36px;
    --m1-type-hero-category: 36px;
    --m1-type-section: 64px;
    --m1-type-stage: 48px;
    --m1-type-section-subline: 22px;
    --m1-type-stage-subline: 18px;
    --m1-type-service-subline: 17px;
    --m1-type-meta: 12px;
    --m1-type-body: 17px;
    --m1-type-body-lead: 20px;
    --m1-type-row-title: 21px;
  }
}

/* Cross-document page transitions (View Transitions API): a soft crossfade
   between same-origin pages; unsupported browsers navigate normally. */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
}
