@layer tokens, base, layout, components, states;

@layer tokens {
  @font-face {
    font-family: "Cabinet Grotesk";
    src: url("/assets/fonts/CabinetGrotesk-Variable.woff2") format("woff2");
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
  }

  @font-face {
    font-family: "General Sans";
    src: url("/assets/fonts/GeneralSans-Variable.woff2") format("woff2");
    font-weight: 200 700;
    font-style: normal;
    font-display: swap;
  }

  @font-face {
    font-family: "General Sans";
    src: url("/assets/fonts/GeneralSans-VariableItalic.woff2") format("woff2");
    font-weight: 200 700;
    font-style: italic;
    font-display: swap;
  }

  :root,
  html[data-theme="light"] {
    color-scheme: light;

    --canvas: #f6f7f4;
    --canvas-muted: #e8ece8;
    --surface: #fff;
    --text: #101617;
    --text-strong: #20282a;
    --text-muted: #5e696c;
    --line: color-mix(in srgb, var(--text) 18%, transparent);
    --signal-surface: #ff5733;
    --signal-text: #c92f12;
    --signal-on-surface: #101617;
    --on-dark: #fff;
    --on-dark-muted: #c0c7c8;
    --on-dark-subtle: #a8b1b3;
    --dark: #101617;
    --dark-raised: #20282a;
    --mint: #b9f2cf;
    --font-display: "Cabinet Grotesk", sans-serif;
    --font-sans: "General Sans", sans-serif;
    --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    --content-max: 90rem;
    --measure: 68ch;
    --gutter: clamp(1.25rem, 4vi, 4.5rem);
    --section-space: clamp(3.5rem, 3.5rem + 4vi, 7rem);
    --space-xs: clamp(0.5rem, 0.45rem + 0.2vi, 0.75rem);
    --space-s: clamp(0.875rem, 0.75rem + 0.5vi, 1.25rem);
    --space-m: clamp(1.25rem, 1rem + 1vi, 2rem);
    --space-l: clamp(2.25rem, 1.75rem + 2vi, 4rem);
    --space-xl: clamp(3.5rem, 2.5rem + 4vi, 7rem);
    --text-body: clamp(1rem, 0.96rem + 0.2vi, 1.125rem);
    --text-meta: clamp(0.75rem, 0.72rem + 0.1vi, 0.8125rem);
    --text-section: clamp(2.5rem, 1.8rem + 2.6vi, 4.25rem);
    --text-subsection: clamp(1.9rem, 1.5rem + 1.4vi, 2.9rem);
  }

  html[data-theme="dark"] {
    color-scheme: dark;

    --canvas: #101617;
    --canvas-muted: #192123;
    --surface: #20282a;
    --text: #fff;
    --text-strong: #fff;
    --text-muted: #c0c7c8;
    --line: color-mix(in srgb, #fff 22%, transparent);
    --signal-text: #ff6a4a;
  }
}

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

  html {
    scroll-behavior: smooth;
    background: var(--canvas);
  }

  body {
    margin: 0;
    color: var(--text);
    background: var(--canvas);
    font-family: var(--font-sans);
    font-size: var(--text-body);
    font-kerning: normal;
    font-optical-sizing: auto;
    line-height: 1.45;
    text-rendering: optimizeLegibility;
  }

  :where(h1, h2, h3, h4, p, figure, blockquote) {
    margin-block-start: 0;
  }

  /* figure keeps a 40px inline margin from the UA sheet if only the block
     axis is reset, which insets .project__media inside its card. */
  :where(figure, ul, ol) {
    margin: 0;
  }

  :where(img, picture, svg) {
    display: block;
    max-inline-size: 100%;
  }

  :where(button, input, textarea) {
    font: inherit;
  }

  a {
    color: inherit;
  }

  :where(h1, h2, h3, h4) {
    font-family: var(--font-display);
    text-wrap: balance;
    hyphens: none;
    overflow-wrap: normal;
  }

  :where(p, li, figcaption) {
    text-wrap: pretty;
    hyphens: auto;
  }

  :focus-visible {
    outline: 3px solid var(--signal-surface);
    outline-offset: 4px;
  }
}

@layer layout {
  .shell {
    inline-size: 100%;
    max-inline-size: var(--content-max);
    margin-inline: auto;
    padding-inline: var(--gutter);
  }

  main :where(section[id]) {
    scroll-margin-block-start: 6rem;
  }

  .section-index {
    margin-block: 0;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: var(--text-meta);
    font-weight: 650;
    letter-spacing: 0.08em;
    line-height: 1.4;
    text-transform: uppercase;
  }

  .section-index span {
    color: var(--signal-text);
    font-weight: 800;
  }
}

@layer components {
  .skip-link {
    position: fixed;
    z-index: 100;
    inset-block-start: 0.75rem;
    inset-inline-start: 0.75rem;
    padding: 0.625rem 0.875rem;
    color: var(--dark);
    background: #fff;
    transform: translateY(-160%);
  }

  .skip-link:focus {
    transform: none;
  }

  .brand {
    flex: 0 0 auto;
    font-family: var(--font-display);
    font-size: clamp(1.15rem, 1.05rem + 0.4vi, 1.35rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    text-decoration: none;
  }

  .brand::after {
    margin-inline-start: 0.12em;
    color: var(--signal-surface);
    content: "/";
  }

  .button {
    min-block-size: 2.75rem;
    padding-inline: clamp(0.875rem, 0.75rem + 0.5vi, 1.375rem);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid currentcolor;
    border-radius: 999px;
    color: inherit;
    font-size: var(--text-meta);
    font-weight: 700;
    letter-spacing: 0.06em;
    line-height: 1;
    text-align: center;
    text-decoration: none;
    text-transform: uppercase;
  }

  .button--light {
    border-color: color-mix(in srgb, currentcolor 48%, transparent);
  }

  .button--signal {
    border-color: var(--signal-surface);
    color: var(--signal-on-surface);
    background: var(--signal-surface);
  }

  .button--dark {
    color: #fff;
    background: var(--dark);
  }

  .topbar {
    position: fixed;
    z-index: 10;
    inset: 0 0 auto;
    border-block-end: 1px solid var(--line);
    color: var(--text);
    background: transparent;
    container: site-header / inline-size;
  }

  /* Opaque rather than translucent: a blurred bar smears the colour of
     full-bleed sections (proofbar, contact) as they scroll underneath. */
  .topbar:is(.is-scrolled, :has(.nav[data-open="true"])) {
    background: var(--canvas);
    box-shadow: 0 0.75rem 1.75rem color-mix(in srgb, var(--text) 8%, transparent);
  }

  .topbar__inner {
    position: relative;
    min-block-size: 6rem;
    display: flex;
    align-items: center;
    gap: clamp(0.75rem, 2vi, 2.25rem);
  }

  .topbar .brand {
    margin-inline-end: auto;
  }

  .nav {
    display: flex;
    align-items: center;
    gap: clamp(1.125rem, 2.3vi, 2.375rem);
  }

  .nav a {
    position: relative;
    padding-block: 0.75rem;
    color: var(--text-muted);
    font-size: var(--text-meta);
    font-weight: 650;
    letter-spacing: 0.09em;
    text-decoration: none;
    text-transform: uppercase;
  }

  .nav a::after {
    position: absolute;
    inset: auto 0 0.25rem;
    block-size: 2px;
    content: "";
    background: var(--signal-surface);
    transform: scaleX(0);
    transform-origin: left;
  }

  .nav a:is(:hover, [aria-current="true"]) {
    color: var(--text);
  }

  /* Only shown inside the mobile sheet, where the topbar CTA is hidden. */
  .nav a.nav__cta {
    display: none;
    color: var(--signal-text);
  }

  .nav a[aria-current="true"]::after {
    transform: scaleX(1);
  }

  .menu-toggle {
    min-block-size: 2.75rem;
    padding-inline: 0.875rem;
    display: none;
    align-items: center;
    border: 1px solid currentcolor;
    border-radius: 999px;
    color: inherit;
    background: transparent;
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: var(--text-meta);
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  @container site-header (inline-size < 58rem) {
    .topbar__inner {
      min-block-size: 4.75rem;
      gap: 0.625rem;
    }

    .js .menu-toggle {
      display: inline-flex;
    }

    /* Full-bleed sheet flush under the bar, padded by --gutter so its links
       share the left edge of the brand and of the page content. */
    .js .nav {
      position: absolute;
      inset: 100% 0 auto;
      padding: 0 var(--gutter) 0.5rem;
      display: none;
      grid-template-columns: 1fr;
      gap: 0;
      border-block-end: 1px solid var(--line);
      color: var(--text);
      background: var(--canvas);
      box-shadow: 0 1.125rem 2.8125rem rgb(16 22 23 / 0.14);
    }

    .js .nav[data-open="true"] {
      display: grid;
    }

    .nav a {
      padding: 0.95rem 0;
      border-block-end: 1px solid var(--line);
    }

    .nav a:last-child {
      border-block-end: 0;
    }

    html:not(.js) .topbar__inner {
      padding-block: 0.75rem;
      flex-wrap: wrap;
    }

    html:not(.js) .nav {
      flex: 1 0 100%;
      justify-content: space-between;
      order: 2;
    }
  }

  /* Brand + toggle + CTA do not fit a phone bar; the CTA moves into the sheet. */
  @container site-header (inline-size < 30rem) {
    .topbar .button {
      display: none;
    }

    .js .nav a.nav__cta {
      display: block;
    }
  }
}

@layer components {
  .hero {
    min-block-size: min(60rem, 100svh);
    padding-block: min(clamp(7.5rem, 7rem + 4vi, 10rem), 14svh) min(clamp(4rem, 3rem + 3vi, 6rem), 9svh);
    color: var(--text);
    background:
      radial-gradient(circle at 76% 44%, rgb(255 91 53 / 0.18), transparent 25%),
      var(--canvas);
    container: hero / inline-size;
  }

  .hero__grid {
    min-block-size: min(44rem, calc(100svh - 13rem));
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: center;
    gap: clamp(3rem, 3rem + 4vi, 7.5rem);
  }

  /* The message carries the fold; the principle card is the second voice. */
  @container hero (inline-size >= 68rem) {
    .hero__grid {
      grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.65fr);
    }
  }

  .eyebrow {
    margin-block-end: 1.75rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-family: var(--font-mono);
    font-size: var(--text-meta);
    font-weight: 650;
    letter-spacing: 0.1em;
    line-height: 1.35;
    text-transform: uppercase;
  }

  .eyebrow::before {
    inline-size: 1.625rem;
    block-size: 0.5rem;
    flex: 0 0 auto;
    content: "";
    background: var(--signal-surface);
  }

  .hero__lead {
    min-inline-size: 0;
    container: hero-lead / inline-size;
  }

  /* Sized against its own column, not the full-bleed hero: the old 5cqi read
     the whole viewport while the text sits in half of it, so long compounds
     broke one word per line. svh additionally caps it on flat windows. */
  .hero h1 {
    max-inline-size: 18ch;
    margin-block-end: 0;
    font-size: min(clamp(3rem, 9.5cqi, 5.5rem), 12svh);
    font-weight: 700;
    letter-spacing: -0.032em;
    line-height: 0.94;
  }

  .hero h1 em {
    color: var(--signal-text);
    font-family: var(--font-sans);
    font-weight: 500;
    font-style: italic;
  }

  .hero__bottom {
    max-inline-size: 45rem;
    margin-block-start: clamp(2rem, 1.5rem + 2vi, 3rem);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1.75rem;
  }

  .hero__intro {
    max-inline-size: 42ch;
    margin-block-end: 0;
    color: var(--text-muted);
    font-size: clamp(1.05rem, 1rem + 0.35vi, 1.3rem);
    line-height: 1.5;
  }

  .hero-principle {
    /* vi, not cqi: the ::before below resolves cqi against this element once
       it becomes a container, which would desync the rule from the padding. */
    --card-pad: min(clamp(1.5rem, 1rem + 1.6vi, 2.75rem), 5svh);

    position: relative;
    padding: var(--card-pad);
    border: 1px solid var(--line);
    background: color-mix(in srgb, var(--surface) 72%, transparent);
    container: hero-principle / inline-size;
  }

  .hero-principle::before {
    position: absolute;
    inset-block-start: 0;
    inset-inline-start: var(--card-pad);
    inline-size: 4.75rem;
    block-size: 0.4375rem;
    content: "";
    background: var(--signal-surface);
    transform: translateY(-1px);
  }

  .hero-principle__label,
  .hero-principle__foot {
    display: block;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: var(--text-meta);
    font-weight: 650;
    letter-spacing: 0.08em;
    line-height: 1.45;
    text-transform: uppercase;
  }

  .hero-principle p {
    max-inline-size: none;
    margin-block: min(clamp(1.75rem, 1.25rem + 2vi, 2.75rem), 4svh);
    font-family: var(--font-display);
    font-size: min(clamp(1.25rem, 10cqi, 2.25rem), 4svh);
    font-weight: 700;
    hyphens: manual;
    letter-spacing: -0.022em;
    line-height: 0.98;
  }

  .hero-principle p em {
    color: var(--signal-text);
    font-family: var(--font-sans);
    font-weight: 500;
    font-style: italic;
  }

  .proofbar {
    color: var(--signal-on-surface);
    background: var(--signal-surface);
    container: proofbar / inline-size;
  }

  .proofbar__inner {
    min-block-size: 5.375rem;
    display: grid;
    grid-template-columns: minmax(12rem, 0.85fr) minmax(0, 2.15fr);
    align-items: stretch;
  }

  .proofbar__label {
    margin-block: 0;
    padding-block: 1.25rem;
    display: flex;
    align-items: center;
    font-family: var(--font-mono);
    font-size: var(--text-meta);
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .proofbar__list {
    padding-inline-start: 0;
    display: grid;
    grid-template-columns:
      repeat(auto-fit, minmax(min(100%, 8rem), 1fr));
    list-style: none;
  }

  .proofbar__name {
    min-block-size: 5.375rem;
    padding: 1.25rem clamp(1rem, 2cqi, 2rem);
    display: grid;
    place-items: center;
    border-inline-start: 1px solid rgb(17 22 26 / 0.24);
  }

  .proofbar__logo {
    inline-size: 100%;
    block-size: 2rem;
    object-fit: contain;
    filter: grayscale(1) brightness(0.12);
  }

  .proofbar__name--abus .proofbar__logo {
    block-size: 2.375rem;
    filter: grayscale(1) contrast(1.2);
    mix-blend-mode: multiply;
  }

  @container proofbar (inline-size < 46rem) {
    .proofbar__inner {
      grid-template-columns: 1fr;
    }

    .proofbar__label {
      padding-block-end: 0.5rem;
    }

    .proofbar__name {
      border-block-start: 1px solid rgb(17 22 26 / 0.24);
      border-inline-start: 0;
    }
  }
}

@layer components {
  .statement {
    padding-block: var(--section-space);
    container: statement / inline-size;
  }

  .statement__grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: clamp(2rem, 1.75rem + 2.5cqi, 4.5rem);
  }

  .statement h2,
  .case h2 {
    margin-block-end: clamp(2.25rem, 1.75rem + 2vi, 3.75rem);
    font-size: var(--text-section);
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 0.98;
  }

  .statement h2 {
    max-inline-size: 15ch;
  }

  .triggers {
    border-block-start: 1px solid var(--line);
    container: triggers / inline-size;
  }

  .trigger {
    min-inline-size: 0;
    padding-block: clamp(1.5rem, 1rem + 1.5cqi, 2rem);
    display: grid;
    grid-template-columns: 3rem minmax(0, 1fr);
    gap: 0.875rem 1.5rem;
    border-block-end: 1px solid var(--line);
  }

  .trigger__number {
    color: var(--signal-text);
    font-family: var(--font-mono);
    font-size: var(--text-meta);
    font-weight: 800;
  }

  .trigger h3 {
    max-inline-size: 22ch;
    margin-block-end: 0;
    font-size: clamp(1.45rem, 1.15rem + 1.2cqi, 2.2rem);
    letter-spacing: -0.018em;
    line-height: 1.08;
  }

  .trigger p {
    grid-column: 2;
    max-inline-size: 42ch;
    margin-block-end: 0;
    color: var(--text-muted);
  }

  @container triggers (inline-size >= 44rem) {
    .trigger {
      grid-template-columns: 3rem minmax(13rem, 1fr) minmax(16rem, 0.8fr);
      gap: 1.875rem;
    }

    .trigger p {
      grid-column: auto;
    }
  }

  @container statement (inline-size >= 52rem) {
    .statement__grid {
      grid-template-columns: minmax(9rem, 0.55fr) minmax(0, 2fr);
    }
  }

  .case {
    --case-bg: var(--canvas-muted);
    --case-surface: var(--surface);
    --case-text: var(--text);
    --case-muted: var(--text-muted);
    --case-border: color-mix(in srgb, var(--case-text) 22%, transparent);
    --case-accent: var(--signal-text);

    padding-block: var(--section-space);
    color: var(--case-text);
    background: var(--case-bg);
    container: projects / inline-size;
  }

  /* Two content columns, stated explicitly: auto-fit derived a third, empty
     track from the available width and pushed the pair off centre. */
  .case__head {
    margin-block-end: clamp(2.25rem, 1.75rem + 2vi, 3.5rem);
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1.75rem clamp(1.25rem, 3cqi, 4rem);
    align-items: end;
  }

  .case__head .section-index {
    grid-column: 1 / -1;
  }

  .case h2 {
    max-inline-size: 14ch;
    margin-block-end: 0;
  }

  .case h2 span {
    display: block;
  }

  .case__lead {
    max-inline-size: 42ch;
    margin-block-end: 0;
    color: var(--case-muted);
    font-size: clamp(1rem, 0.95rem + 0.25cqi, 1.125rem);
    line-height: 1.5;
  }

  .projects {
    display: grid;
    grid-template-columns:
      repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
    gap: 0.875rem;
  }

  .project {
    min-inline-size: 0;
    display: grid;
    align-content: start;
    border: 1px solid var(--case-border);
    color: var(--case-text);
    background: var(--case-surface);
    container-type: inline-size;
  }

  /* Own container so the caption scales against the media column, not the card. */
  .project__media {
    position: relative;
    inline-size: 100%;
    min-inline-size: 0;
    min-block-size: 0;
    aspect-ratio: 4 / 3;
    overflow: clip;
    color: var(--dark);
    container-type: inline-size;
  }

  .project__media-caption {
    inline-size: 100%;
    block-size: 100%;
    padding: clamp(1.5rem, 1rem + 3cqi, 2.625rem);
    display: grid;
    align-content: space-between;
    hyphens: manual;
  }

  .project__media--fazua {
    background:
      radial-gradient(circle at 72% 30%, rgb(255 255 255 / 0.75) 0 7%, transparent 7.5%),
      radial-gradient(circle at 72% 30%, transparent 0 17%, rgb(17 22 26 / 0.18) 17.5% 18%, transparent 18.5%),
      var(--signal-surface);
  }

  .project__media--ideematec {
    background:
      linear-gradient(24deg, transparent 49.6%, rgb(17 22 26 / 0.25) 50%, transparent 50.4%),
      linear-gradient(156deg, transparent 49.6%, rgb(17 22 26 / 0.25) 50%, transparent 50.4%),
      var(--mint);
  }

  .project__media:not(.project__media--image)::after {
    position: absolute;
    inset: auto clamp(1.5rem, 1rem + 3cqi, 2.75rem) clamp(1.5rem, 1rem + 3cqi, 2.625rem) auto;
    inline-size: clamp(6.875rem, 38cqi, 13.125rem);
    aspect-ratio: 0.62;
    content: "";
    border: 2px solid currentcolor;
    border-radius: 1.375rem;
    opacity: 0.7;
    transform: rotate(6deg);
  }

  .project__media--ideematec::after {
    aspect-ratio: 1.5;
    border-radius: 2px;
    transform: rotate(-5deg);
  }

  .project__media-label,
  .project__tag,
  .project__status {
    position: relative;
    z-index: 1;
    font-family: var(--font-mono);
    font-size: var(--text-meta);
    font-weight: 650;
    letter-spacing: 0.07em;
    line-height: 1.35;
    text-transform: uppercase;
  }

  .project__media strong {
    position: relative;
    z-index: 1;
    max-inline-size: 7ch;
    font-family: var(--font-display);
    font-size: clamp(1.75rem, 1.4rem + 5cqi, 4.8rem);
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 0.92;
  }

  .project__status {
    align-self: end;
  }

  .project__picture,
  .project__image {
    inline-size: 100%;
    block-size: 100%;
  }

  .project__image {
    object-fit: cover;
  }

  .project__body {
    padding: clamp(1.375rem, 1.05rem + 1.9cqi, 2.25rem);
    display: flex;
    flex-direction: column;
  }

  .project__tag {
    color: var(--case-accent);
  }

  .project h3 {
    max-inline-size: 18ch;
    margin: clamp(1.125rem, 0.9rem + 1.1cqi, 1.75rem) 0 0.75rem;
    font-size: clamp(1.75rem, 1.35rem + 3cqi, 3.2rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1;
  }

  .project p {
    max-inline-size: 45ch;
    margin-block-end: 0;
    color: var(--case-muted);
    font-size: clamp(1rem, 0.97rem + 0.15cqi, 1.0625rem);
  }

  .project__facts {
    margin-block-start: auto;
    padding: clamp(1rem, 0.75rem + 1cqi, 1.5rem) 0 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4375rem;
    list-style: none;
  }

  .project__facts li {
    padding: 0.3rem 0.5625rem;
    border: 1px solid var(--case-border);
    border-radius: 999px;
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    font-weight: 650;
    hyphens: manual;
    letter-spacing: 0.06em;
    line-height: 1.35;
    text-transform: uppercase;
  }

  @container projects (inline-size >= 56rem) {
    .case__head {
      grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    }
  }

  @container projects (inline-size >= 68rem) {
    .projects {
      grid-template-columns: minmax(0, 1.1fr) minmax(22rem, 0.9fr);
    }

    .project--fazua {
      grid-row: span 2;
    }

    /* The lead card fills whatever height the two side cards stack to; a
       flatter ratio keeps that stack inside one screen. */
    .project--fazua .project__media {
      aspect-ratio: 16 / 10;
    }

    .project--ideematec,
    .project--faecherpunkt {
      grid-column: 2;
      grid-template-columns: minmax(9.5rem, 0.6fr) minmax(0, 1.4fr);
    }

    .project--ideematec .project__media,
    .project--faecherpunkt .project__media {
      aspect-ratio: auto;
    }

    .project--ideematec h3,
    .project--faecherpunkt h3 {
      font-size: clamp(1.5rem, 1.15rem + 1.5cqi, 2.1rem);
    }
  }
}

@layer components {
  .method {
    padding-block: var(--section-space);
    container: method / inline-size;
  }

  .method__head {
    margin-block-end: clamp(2.5rem, 2rem + 2vi, 4rem);
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1.75rem clamp(1.25rem, 3cqi, 4rem);
    align-items: end;
  }

  .method__head .section-index {
    grid-column: 1 / -1;
  }

  .method h2 {
    max-inline-size: 16ch;
    margin-block-end: 0;
    font-size: var(--text-section);
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 0.98;
  }

  .method__intro {
    max-inline-size: 48ch;
    margin-block-end: 0;
    color: var(--text-muted);
    font-size: clamp(1.05rem, 1rem + 0.3cqi, 1.28rem);
    line-height: 1.45;
  }

  .cycle-layout {
    display: grid;
    grid-template-columns:
      repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
    gap: clamp(2.5rem, 1.75rem + 3.5cqi, 5.5rem);
    align-items: center;
  }

  .cycle-layout__copy {
    max-inline-size: 36ch;
    hyphens: manual;
    color: var(--text-muted);
    font-family: var(--font-display);
    font-size: clamp(1.7rem, 1.35rem + 1.7cqi, 2.8rem);
    font-weight: 650;
    letter-spacing: -0.018em;
    line-height: 1.06;
  }

  .mvp-cycle {
    position: relative;
    isolation: isolate;
    min-inline-size: 0;
  }

  .mvp-cycle__core {
    inline-size: 5.5rem;
    aspect-ratio: 1;
    margin: 0 auto 1.5rem;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: var(--signal-on-surface);
    background: var(--signal-surface);
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 800;
  }

  .mvp-cycle__steps {
    padding-inline-start: 0;
    display: grid;
    grid-template-columns:
      repeat(auto-fit, minmax(min(100%, 13rem), 1fr));
    gap: 1rem;
    list-style: none;
    counter-reset: product-cycle;
  }

  .mvp-cycle__node {
    min-inline-size: 0;
    padding: 1.125rem 1.25rem;
    border: 1px solid var(--line);
    background: var(--surface);
    box-shadow: 0 0.75rem 2.125rem color-mix(in srgb, var(--text) 10%, transparent);
    counter-increment: product-cycle;
  }

  .mvp-cycle__node::before {
    display: block;
    margin-block-end: 0.75rem;
    color: var(--signal-text);
    content: counter(product-cycle, decimal-leading-zero);
    font-family: var(--font-mono);
    font-size: var(--text-meta);
    font-weight: 800;
  }

  .mvp-cycle__node strong {
    display: block;
    font-family: var(--font-display);
    font-size: clamp(1.35rem, 1.1rem + 1.5cqi, 1.9rem);
    hyphens: manual;
    letter-spacing: -0.015em;
    line-height: 1;
  }

  .mvp-cycle__node span {
    display: block;
    margin-block-start: 0.5rem;
    color: var(--text-muted);
    font-size: 0.9375rem;
    line-height: 1.4;
  }

  @container method (inline-size >= 56rem) {
    .cycle-layout {
      grid-template-columns: minmax(15rem, 0.7fr) minmax(0, 1.3fr);
    }

    .mvp-cycle {
      max-inline-size: 34rem;
      margin-inline: auto;
      display: grid;
      place-items: center;
    }

    .mvp-cycle::before {
      position: absolute;
      z-index: -1;
      inset: 5%;
      content: "";
      border: 1px solid var(--line);
      border-radius: 50%;
    }

    .mvp-cycle__core {
      position: absolute;
      z-index: 1;
      inset: 50% auto auto 50%;
      margin: 0;
      transform: translate(-50%, -50%);
    }

    .mvp-cycle__steps {
      inline-size: 100%;
      aspect-ratio: 1;
      display: grid;
      grid-template:
        "decide decide empty" 1fr
        "empty-two center build" 1fr
        "learn learn empty-three" 1fr
        / 1fr 1fr 1fr;
      align-items: center;
      gap: 1rem;
    }

    .mvp-cycle__node--decide {
      grid-area: decide;
      justify-self: start;
    }

    .mvp-cycle__node--build {
      grid-area: build;
      justify-self: end;
    }

    .mvp-cycle__node--learn {
      grid-area: learn;
      justify-self: start;
    }
  }

  /* A rule plus a full step of space: the offers are a second block inside
     the cycle section, and without the break the two heads compete. */
  .offers {
    margin-block-start: clamp(4rem, 3rem + 4.5vi, 7.5rem);
    padding-block-start: clamp(3rem, 2.25rem + 3vi, 5rem);
    border-block-start: 1px solid var(--line);
    container: offers / inline-size;
  }

  .offer-tree__head {
    margin-block-end: clamp(2rem, 1.5rem + 1.5vi, 2.75rem);
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1.25rem;
    align-items: end;
  }

  /* Sits above the pair, like .section-index in the other section heads,
     instead of claiming a column of its own. */
  .offer-tree__head > span {
    grid-column: 1 / -1;
    color: var(--signal-text);
    font-family: var(--font-mono);
    font-size: var(--text-meta);
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
  }

  /* One step below the section h2 so the eye keeps its order. */
  .offer-tree__head h3 {
    max-inline-size: 18ch;
    margin-block-end: 0;
    font-size: var(--text-subsection);
    font-weight: 700;
    letter-spacing: -0.022em;
    line-height: 1;
  }

  .offer-tree__head p {
    max-inline-size: 42ch;
    margin-block-end: 0;
    color: var(--text-muted);
    font-size: 1.05rem;
  }

  /* The hinge between both branches: one band over the full measure instead
     of a box floating between the columns. */
  .offer-tree__question {
    margin-block-end: clamp(1.5rem, 1.25rem + 1vi, 2.25rem);
    padding-block: clamp(0.875rem, 0.75rem + 0.5vi, 1.25rem);
    border-block: 1px solid var(--text);
    font-family: var(--font-display);
    font-size: clamp(1.15rem, 1rem + 0.6vi, 1.6rem);
    font-weight: 700;
  }

  .offer-tree {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 2.5rem;
  }

  .offer-branch {
    display: grid;
    align-content: start;
    container-type: inline-size;
  }

  .offer-branch__label {
    padding-block-end: 1rem;
    color: var(--signal-text);
    font-family: var(--font-mono);
    font-size: var(--text-meta);
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .offer-option {
    padding-block: clamp(1rem, 0.85rem + 0.6vi, 1.375rem);
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.5rem 1.5rem;
    align-content: start;
    border-block-start: 1px solid var(--line);
  }

  .offer-option h4 {
    margin-block-end: 0;
    font-size: clamp(1.2rem, 1.05rem + 0.7cqi, 1.55rem);
    line-height: 1.05;
  }

  .offer-option p {
    margin-block-end: 0;
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.45;
  }

  @container (inline-size >= 24rem) {
    .offer-option {
      grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
    }
  }

  @container method (inline-size >= 56rem) {
    .method__head {
      grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    }
  }

  @container offers (inline-size >= 56rem) {
    .offer-tree__head {
      grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    }

    /* Subgrid rows: both branches share one row rhythm, so entries stay on a
       line across the gap even though one branch has fewer of them. */
    .offer-tree {
      grid-template-columns: repeat(2, minmax(0, 1fr));
      grid-template-rows: auto repeat(3, auto);
      column-gap: clamp(2.5rem, 4cqi, 5rem);
      row-gap: 0;
    }

    .offer-branch {
      grid-row: span 4;
      grid-template-rows: subgrid;
      row-gap: 0;
    }
  }
}

@layer components {
  .team {
    --text: #fff;
    --text-muted: #c0c7c8;
    --line: rgb(255 255 255 / 0.24);
    --signal-text: #ff6a4a;

    padding-block: var(--section-space);
    color: var(--text);
    background:
      radial-gradient(circle at 78% 22%, rgb(255 87 51 / 0.14), transparent 28%),
      var(--dark);
    container: team / inline-size;
  }

  .team__head {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1.75rem clamp(1.25rem, 3cqi, 4rem);
    align-items: end;
  }

  .team__head .section-index {
    grid-column: 1 / -1;
    color: var(--on-dark-muted);
  }

  .team h2 {
    max-inline-size: 14ch;
    margin-block-end: 0;
    color: #fff;
    font-size: var(--text-section);
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 0.98;
  }

  .team__intro {
    max-inline-size: 42ch;
    margin-block-end: 0;
    color: var(--on-dark-muted);
    font-size: clamp(1.05rem, 1rem + 0.25cqi, 1.2rem);
    line-height: 1.48;
  }

  .partner-relay {
    margin-block-start: clamp(3rem, 2.5rem + 2.5vi, 4.75rem);
    padding-inline-start: 0;
    display: grid;
    grid-template-columns:
      repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
    gap: clamp(2rem, 1.5rem + 2cqi, 3.5rem);
  }

  .relay-person {
    position: relative;
    min-inline-size: 0;
    padding-block-start: 3.875rem;
    border-block-start: 1px solid rgb(255 255 255 / 0.34);
  }

  .relay-person::before {
    position: absolute;
    inset-block-start: -0.625rem;
    inset-inline-start: 0;
    inline-size: 1.125rem;
    block-size: 1.125rem;
    content: "";
    border: 0.375rem solid var(--dark);
    border-radius: 50%;
    background: var(--signal-surface);
    outline: 1px solid rgb(255 255 255 / 0.52);
  }

  .relay-person__role {
    margin-block-end: 0.875rem;
    color: var(--on-dark-muted);
    font-family: var(--font-mono);
    font-size: var(--text-meta);
    font-weight: 650;
    letter-spacing: 0.065em;
    text-transform: uppercase;
  }

  .relay-person h3 {
    margin-block-end: 0.625rem;
    font-size: clamp(1.55rem, 1.25rem + 1.4cqi, 2.2rem);
    letter-spacing: -0.015em;
    line-height: 1;
  }

  .relay-person__focus {
    max-inline-size: 30ch;
    margin-block-end: 0;
    color: #d1d6d7;
    font-size: 0.95rem;
    line-height: 1.44;
  }

  .relay-person__evidence {
    max-inline-size: 34ch;
    margin: 1.5rem 0 0;
    color: var(--on-dark-muted);
    font-family: var(--font-mono);
    font-size: var(--text-meta);
    font-weight: 600;
    hyphens: manual;
    letter-spacing: 0.035em;
    line-height: 1.5;
    text-transform: uppercase;
  }

  .contact {
    background: var(--canvas);
    container: contact / inline-size;
  }

  .fit-manifesto {
    padding-block: clamp(4rem, 3.5rem + 3.5vi, 7rem);
    background: var(--surface);
  }

  .fit-manifesto__statement {
    max-inline-size: 21ch;
    margin-block-end: 0;
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 1.9rem + 3.2vi, 5rem);
    font-weight: 700;
    hyphens: manual;
    letter-spacing: -0.03em;
    line-height: 0.94;
    overflow-wrap: anywhere;
  }

  /* Marker sweep instead of a solid block: the band covers the x-height and
     leaves ascenders free, the ink is translucent so the type reads through it,
     and the angled gradient stops give the stroke slanted caps like a pen
     rather than a rectangle. */
  .fit-manifesto__statement mark {
    --mark-ink: color-mix(in srgb, var(--signal-surface) 80%, transparent);

    padding-inline: 0.1em;
    color: inherit;
    background:
      linear-gradient(
        96deg,
        transparent 0.02em,
        var(--mark-ink) 0.15em,
        var(--mark-ink) calc(100% - 0.15em),
        transparent calc(100% - 0.02em)
      )
      no-repeat 0 60% / 100% 0.55em;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
  }

  .contact-letter {
    padding-block: clamp(4.5rem, 4rem + 4vi, 8rem);
    color: var(--signal-on-surface);
    background: var(--signal-surface);
  }

  .contact-letter__grid {
    display: grid;
    grid-template-columns:
      repeat(auto-fit, minmax(min(100%, 26rem), 1fr));
    gap: clamp(3.5rem, 2.5rem + 5cqi, 8.75rem);
    align-items: center;
  }

  .contact-letter h2 {
    max-inline-size: 10ch;
    margin-block-end: 0;
    font-size: clamp(3rem, 2.25rem + 3.4cqi, 6rem);
    font-weight: 700;
    letter-spacing: -0.035em;
    line-height: 0.9;
    overflow-wrap: anywhere;
  }

  .letter {
    padding: clamp(1.875rem, 1.25rem + 3cqi, 3.875rem);
    color: var(--text);
    background: var(--surface);
    box-shadow: 0 1.5rem 4.375rem rgb(17 22 26 / 0.18);
  }

  .letter__intro {
    max-inline-size: 28ch;
    margin-block-end: 0;
    font-family: var(--font-display);
    font-size: clamp(1.65rem, 1.25rem + 2cqi, 3rem);
    font-weight: 650;
    hyphens: manual;
    letter-spacing: -0.018em;
    line-height: 1.08;
  }

  .letter__prompts {
    padding-inline-start: 0;
    list-style: none;
  }

  .letter__line {
    padding-block: 0.875rem;
    border-block-end: 1px solid var(--text);
    color: var(--text-muted);
    font-size: 1rem;
  }

  .letter__line:first-child {
    margin-block-start: 1.5rem;
  }

  .letter .button {
    margin-block-start: 2.125rem;
  }

  @container team (inline-size >= 56rem) {
    .team__head {
      grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    }
  }

  @container contact (inline-size >= 58rem) {
    .letter {
      transform: rotate(-1deg);
    }
  }
}

@layer components {
  .footer {
    padding-block: 2.375rem;
    color: #fff;
    background: var(--dark);
  }

  .footer__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.25rem 2.25rem;
  }

  .footer .brand {
    margin-inline-end: auto;
  }

  .footer p {
    margin-block-end: 0;
    color: var(--on-dark-muted);
    font-size: var(--text-meta);
  }

  .footer nav {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 1.5rem;
  }

  .footer nav a {
    color: #d1d6d7;
    font-size: var(--text-meta);
    text-decoration: none;
  }

  .theme-toggle {
    min-block-size: 2.875rem;
    padding-inline: 1.125rem;
    display: none;
    align-items: center;
    gap: 0.625rem;
    border: 1px solid rgb(255 255 255 / 0.28);
    border-radius: 999px;
    color: #fff;
    background: transparent;
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: var(--text-meta);
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }

  .js .theme-toggle {
    display: inline-flex;
  }

  .theme-toggle::before {
    inline-size: 0.75rem;
    block-size: 0.75rem;
    content: "";
    border: 1px solid currentcolor;
    border-radius: 50%;
    background: linear-gradient(90deg, currentcolor 50%, transparent 50%);
  }

  .legal-page {
    color: var(--text);
    background: var(--canvas);
  }

  .legal-header {
    color: #fff;
    background: var(--dark);
  }

  .legal-header__inner {
    min-block-size: 5.5rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem 1.5rem;
  }

  .legal-hero {
    padding-block: clamp(4.5rem, 3.5rem + 5vi, 8.125rem);
    color: #fff;
    background: var(--dark);
  }

  .legal-hero h1 {
    max-inline-size: 15ch;
    margin-block-end: 0;
    font-size: clamp(2.5rem, 1.75rem + 4.5vi, 7rem);
    font-weight: 700;
    letter-spacing: -0.032em;
    line-height: 0.94;
    hyphens: auto;
    overflow-wrap: anywhere;
  }

  .legal-hero > .shell > p:last-child {
    max-inline-size: 48ch;
    margin: 1.875rem 0 0;
    color: var(--on-dark-muted);
    font-size: clamp(1.05rem, 1rem + 0.25vi, 1.3rem);
  }

  .legal-content {
    max-inline-size: 72ch;
    padding-block: clamp(4.5rem, 3.5rem + 4vi, 7.5rem);
  }

  .legal-content > :first-child {
    margin-block-start: 0;
  }

  .legal-content h2 {
    margin: 3em 0 0.7em;
    font-size: clamp(1.75rem, 1.4rem + 1.5vi, 2.6rem);
    letter-spacing: -0.018em;
    line-height: 1.05;
    overflow-wrap: anywhere;
  }

  .legal-content p,
  .legal-content li {
    max-inline-size: 68ch;
    line-height: 1.5;
  }

  .legal-content p + p {
    margin-block-start: 0.75em;
  }

  .legal-content a {
    text-decoration-color: var(--signal-text);
    text-decoration-thickness: 2px;
    text-underline-offset: 0.18em;
  }
}

@layer states {
  html[data-theme="dark"] .case {
    --case-bg: var(--dark);
    --case-surface: var(--dark-raised);
    --case-text: #fff;
    --case-muted: #c0c7c8;
    --case-border: rgb(255 255 255 / 0.24);
    --case-accent: #ff6a4a;
  }

  html[data-theme="dark"] .project__media {
    color: var(--dark);
  }

  .button:is(:hover, :focus-visible) {
    border-color: var(--signal-surface);
  }

  .button--light:hover {
    color: var(--canvas);
    background: var(--text);
  }

  .button--signal:hover {
    border-color: var(--text);
    background: var(--surface);
  }

  .menu-toggle[aria-expanded="true"],
  .button--dark:hover,
  .theme-toggle:hover {
    border-color: var(--signal-surface);
    color: var(--signal-on-surface);
    background: var(--signal-surface);
  }

  @media (prefers-reduced-motion: no-preference) {
    .topbar,
    .button,
    .nav a::after,
    .skip-link,
    .theme-toggle {
      transition:
        color 180ms ease,
        background-color 180ms ease,
        border-color 180ms ease,
        box-shadow 180ms ease,
        transform 180ms ease;
    }

    .button:hover {
      transform: translateY(-2px);
    }
  }

  @media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
      scroll-behavior: auto !important;
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: 0.01ms !important;
    }
  }
}

