/* Wåhlin Arkitekter — site stylesheet.
   Layer order: a later layer wins whatever its selectors weigh, so a utility
   always beats a component rule without !important. Component stylesheets
   (components/<name>/<name>.css) join the "components" layer.

   Tokens are ported from the Claude Design system (tokens/*.css) with the
   same names. Where a design pairing failed WCAG AA, only the SEMANTIC token
   changed (see "Accessibility adjustments" below); the swatches are intact.

   Breakpoints (rem, reused everywhere — custom properties cannot be used in
   query conditions): 30rem · 48rem · 64rem. Components use container
   queries; only the page shell uses viewport media queries. */
@layer reset, tokens, base, layout, components, utilities;

/* ---- Fonts (self-hosted, no third-party requests) -------------------- */
@font-face {
  font-family: "Be Vietnam Pro";
  src: url("/assets/fonts/be-vietnam-pro-latin-700.a193dd87699bd2e1.woff2") format("woff2");
  font-weight: 600 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Metropolis";
  src: url("/assets/fonts/metropolis-latin-500.f3a738735a2c006f.woff2") format("woff2");
  font-weight: 400 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Metropolis";
  src: url("/assets/fonts/metropolis-latin-700.9a712a2c31daff2a.woff2") format("woff2");
  font-weight: 600 800;
  font-style: normal;
  font-display: swap;
}

@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  * { margin: 0; }
  html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
  img, picture, svg, video { display: block; max-width: 100%; height: auto; }
  /* <source> is never rendered, but under a picture set to display: contents
     it would become an empty flex/grid item and take a gap. */
  picture > source { display: none; }
  input, button, textarea, select { font: inherit; color: inherit; }
  button { background: none; border: 0; padding: 0; cursor: pointer; }
  ul[role="list"], ol[role="list"] { list-style: none; padding: 0; }
  [hidden] { display: none !important; }
}

@layer tokens {
  /* ---- Primitive swatches: cream + one bold orange ------------------- */
  :root {
    --swatch--cream: #F6F0E6;
    --swatch--cream-light: #FBF7F0;
    --swatch--cream-deep: #EBE2D3;
    --swatch--orange: #E1521B;
    --swatch--orange-deep: #B23C10;
    --swatch--orange-bright: #F2701F;
    --swatch--orange-tint: #F7D8C6;
    /* Accessibility adjustment: the brand orange reads 3.6:1 under cream
       text. This step toward orange-deep reaches 4.6:1 and is used wherever
       orange is a BACKGROUND behind text (brand band, button fill). */
    --swatch--orange-a11y: #C64515;
    --swatch--ink: #131212;
    --swatch--ink-raised: #1C1A19;
    --swatch--ink-secondary: #4C4848;
    /* Accessibility adjustment: design value #7A7373 read 4.1:1 on cream. */
    --swatch--ink-muted: #686262;
    --swatch--sand: #B6A793;
    --swatch--stone: #CFC4B4;
    --swatch--line: #DED3C2;
    --swatch--line-dark: #363230;

    /* ---- Type ---------------------------------------------------------- */
    --font--display-family: "Be Vietnam Pro", Arial, sans-serif;
    --font--body-family: Metropolis, Helvetica, Arial, sans-serif;
    --font-weight--medium: 500;
    --font-weight--bold: 700;

    --letter-spacing--tight: -.03em;
    --letter-spacing--heading: .15em;
    --letter-spacing--eyebrow: .3em;
    --letter-spacing--label: .08em;

    /* Fluid scale from the design (375 → 1440 viewport). */
    --display--font-size: clamp(2.03rem, 1.182rem + 4.24vw, 5rem);
    --h1--font-size: clamp(1.7rem, 1.2rem + 2.5vw, 3.4rem);
    --h2--font-size: clamp(1.6rem, 1.158rem + 2.21vw, 3.15rem);
    --h3--font-size: clamp(1.42rem, 1.112rem + 1.54vw, 2.5rem);
    --h4--font-size: clamp(1.27rem, 1.068rem + 1.01vw, 1.98rem);
    --h5--font-size: clamp(1.13rem, 1.004rem + .63vw, 1.57rem);
    --h6--font-size: clamp(1rem, .928rem + .36vw, 1.25rem);
    --text-large--font-size: clamp(1.15rem, 1.04rem + .45vw, 1.51rem);
    --text-main--font-size: clamp(1rem, .986rem + .07vw, 1.05rem);
    --text-small--font-size: .875rem;
    --text-micro--font-size: .75rem;
    --line-height--heading: 1.05;
    --line-height--body: 1.5;

    /* ---- Space: fluid ramp (mobile → 1440+) ---------------------------- */
    --size--0-25rem: .25rem;
    --size--0-5rem: .5rem;
    --size--0-75rem: .75rem;
    --size--1rem: 1rem;
    --size--1-25rem: 1.25rem;
    --size--1-5rem: 1.5rem;
    --size--2rem: clamp(1.75rem, 1.678rem + .36vw, 2rem);
    --size--2-5rem: clamp(2rem, 1.858rem + .71vw, 2.5rem);
    --size--3rem: clamp(2.25rem, 2.036rem + 1.07vw, 3rem);
    --size--4rem: clamp(2.5rem, 2.072rem + 2.14vw, 4rem);
    --size--5rem: clamp(3rem, 2.428rem + 2.86vw, 5rem);
    --size--6rem: clamp(3.5rem, 2.786rem + 3.57vw, 6rem);
    --size--7rem: clamp(4rem, 3.142rem + 4.29vw, 7rem);
    --size--8rem: clamp(4.5rem, 3.5rem + 5vw, 8rem);
    --size--10rem: clamp(5.5rem, 4.214rem + 6.43vw, 10rem);

    --padding-vertical--small: var(--size--5rem);
    --padding-vertical--main: var(--size--7rem);
    --padding-vertical--large: var(--size--10rem);
    /* Edge-to-edge: media runs full-bleed, only text is inset. */
    --padding-horizontal--main: clamp(1rem, .428rem + 2.86vw, 3rem);
    --padding-horizontal--edge: clamp(1rem, .5rem + 1.5vw, 2rem);
    --header-height: clamp(4rem, 3.4rem + 2.4vw, 5.5rem);

    --max-width--main: 90rem;
    --max-width--text: 46rem;
    --grid-gap--main: var(--size--1rem);

    /* ---- Shape ---------------------------------------------------------- */
    /* Sharp corners everywhere: buttons, fields, tags and panels. Only true
       circles (portraits, dots) use --radius--circle. */
    --radius--none: 0;
    --radius--extra-small: 0;
    --radius--main: 0;
    --radius--round: 0;
    --radius--circle: 50%;
    --border-width--main: 1px;
    --border-width--thick: 2px;
    --svg-stroke-width--main: 1.5px;

    /* ---- Elevation: floating UI only ------------------------------------ */
    --shadow--soft: 0 1px 2px #1312120A, 0 8px 24px #13121214;
    --shadow--supersoft: 0 2px 40px #13121212;
    --shadow--lifted: 0 18px 60px -12px #1312122E;

    /* ---- Motion: long, calm, architectural. Nothing bounces. ----------- */
    --ease--out: cubic-bezier(.22, 1, .36, 1);
    --ease--in-out: cubic-bezier(.65, 0, .35, 1);
    --ease--slide: cubic-bezier(.76, 0, .24, 1);
    --duration--fast: 180ms;
    --duration--main: 400ms;
    --duration--slow: 800ms;
    --duration--reveal: 1200ms;
    --duration--slide: 1400ms;
    --duration--zoom: 1600ms;
    --duration--kenburns: 8000ms;
    --stagger--step: 80ms;
    --reveal--distance: 2rem;
    --image--zoom-hover: 1.06;

    color-scheme: light;
  }

  /* ---- Semantic tokens: what every rule and component uses ------------ */
  :root, [data-theme="light"] {
    --theme--background: var(--swatch--cream);
    --theme--background-alt: var(--swatch--cream-deep);
    --theme--surface: var(--swatch--cream-light);
    --theme--text: var(--swatch--ink);
    --theme--text-secondary: var(--swatch--ink-secondary);
    --theme--text-muted: var(--swatch--ink-muted);
    --theme--brand: var(--swatch--orange);            /* fills, rules, UI */
    --theme--brand-text: var(--swatch--orange-deep);  /* orange TEXT, AA 5.2:1 */
    --theme--brand-fill: var(--swatch--orange-a11y);  /* orange behind text */
    --theme--on-brand: var(--swatch--cream-light);
    --theme--border: var(--swatch--line);
    --theme--border-strong: var(--swatch--ink);
    --theme--field-border: #8C8579; /* 3.4:1 on cream-light: WCAG 1.4.11 */
    --theme--focus: var(--swatch--orange);
    --theme--overlay: #131212B8;
    --theme--scrim: linear-gradient(180deg, #13121200 0%, #13121266 55%, #131212CC 100%);
    --theme--button-rest: var(--swatch--cream-deep);
    --theme--button-text: var(--swatch--ink);
  }
  [data-theme="dark"] {
    --theme--background: var(--swatch--ink);
    --theme--background-alt: var(--swatch--ink-raised);
    --theme--surface: var(--swatch--ink-raised);
    --theme--text: var(--swatch--cream-light);
    --theme--text-secondary: #C9BFB2;
    --theme--text-muted: #A39A8E;
    --theme--brand: var(--swatch--orange-bright);
    --theme--brand-text: var(--swatch--orange-bright);
    --theme--brand-fill: var(--swatch--orange-a11y);
    --theme--on-brand: var(--swatch--cream-light);
    --theme--border: var(--swatch--line-dark);
    --theme--border-strong: var(--swatch--cream-light);
    --theme--focus: var(--swatch--orange-bright);
    --theme--button-rest: var(--swatch--cream-deep);
    --theme--button-text: var(--swatch--ink);
  }
  [data-theme="brand"] {
    --theme--background: var(--swatch--orange-a11y);
    --theme--background-alt: var(--swatch--orange-deep);
    --theme--surface: var(--swatch--orange-deep);
    --theme--text: var(--swatch--cream-light);
    --theme--text-secondary: var(--swatch--cream-light);
    --theme--text-muted: var(--swatch--cream-light);
    --theme--brand: var(--swatch--cream-light);
    --theme--brand-text: var(--swatch--cream-light);
    --theme--brand-fill: var(--swatch--ink);
    --theme--on-brand: var(--swatch--cream-light);
    --theme--border: #F0A87F66;
    --theme--border-strong: var(--swatch--cream-light);
    --theme--focus: var(--swatch--cream-light);
    --theme--button-rest: var(--swatch--ink);
    --theme--button-text: var(--swatch--cream-light);
  }

  /* One switch for every transition and animation on the site. */
  @media (prefers-reduced-motion: reduce) {
    :root {
      --duration--fast: 1ms;
      --duration--main: 1ms;
      --duration--slow: 1ms;
      --duration--reveal: 1ms;
      --duration--slide: 1ms;
      --duration--zoom: 1ms;
      --duration--kenburns: 1ms;
      --stagger--step: 0ms;
      --reveal--distance: 0rem;
      --image--zoom-hover: 1;
    }
  }
}

@layer base {
  html {
    scroll-padding-top: calc(var(--header-height) + 1rem);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }
  @media (prefers-reduced-motion: no-preference) {
    html { scroll-behavior: smooth; }
  }
  body {
    min-height: 100svh;
    background: var(--theme--background);
    color: var(--theme--text);
    font-family: var(--font--body-family);
    font-size: var(--text-main--font-size);
    font-weight: var(--font-weight--medium);
    line-height: var(--line-height--body);
  }
  [data-theme] { background: var(--theme--background); color: var(--theme--text); }

  /* Headings: Be Vietnam Pro, wide .15em tracking, set in caps by CSS.
     Source copy stays in sentence case. */
  h1, h2, h3, h4, h5, h6 {
    font-family: var(--font--display-family);
    font-weight: var(--font-weight--bold);
    line-height: var(--line-height--heading);
    letter-spacing: var(--letter-spacing--heading);
    text-transform: uppercase;
    text-wrap: balance;
    color: inherit;
  }
  h1 { font-size: var(--h1--font-size); }
  h2 { font-size: var(--h2--font-size); }
  h3 { font-size: var(--h3--font-size); line-height: 1.1; }
  h4 { font-size: var(--h4--font-size); line-height: 1.2; }
  h5 { font-size: var(--h5--font-size); line-height: 1.2; }
  h6 { font-size: var(--h6--font-size); line-height: 1.3; }
  p, li, dd { text-wrap: pretty; }
  strong, b { font-weight: var(--font-weight--bold); }

  a { color: inherit; text-underline-offset: .2em; transition: color var(--duration--fast) var(--ease--out); }
  a:hover { color: var(--theme--brand-text); }

  :focus-visible {
    outline: 2px solid var(--theme--focus);
    outline-offset: 2px;
  }
  ::selection { background: var(--swatch--orange-a11y); color: var(--swatch--cream-light); }

  img { object-fit: cover; }
  hr { border: 0; border-top: 1px solid var(--theme--border); }
  address { font-style: normal; }
}

@layer layout {
  /* Text-led content: capped and inset. Media sections skip this. */
  .container {
    width: 100%;
    max-width: var(--max-width--main);
    margin-inline: auto;
    padding-inline: var(--padding-horizontal--main);
  }
  /* Edge-to-edge band with inset text but no width cap. */
  .gutter { padding-inline: var(--padding-horizontal--main); }

  .section { padding-block: var(--padding-vertical--main); }
  .section[data-pad="small"] { padding-block: var(--padding-vertical--small); }
  .section[data-pad="large"] { padding-block: var(--padding-vertical--large); }
  .section[data-pad="none"] { padding-block: 0; }
  /* First section on a page without a hero image clears the fixed header. */
  .section[data-pad="page-top"] {
    padding-block: calc(var(--header-height) + var(--size--5rem)) var(--padding-vertical--small);
  }

  .stack { display: flex; flex-direction: column; gap: var(--stack-gap, var(--size--1-5rem)); }
  .flow > * + * { margin-block-start: var(--flow-space, 1em); }
  .cluster { display: flex; flex-wrap: wrap; align-items: center; gap: var(--cluster-gap, var(--size--1rem)); }
  .grid-auto {
    display: grid;
    gap: var(--grid-gap, var(--size--4rem));
    grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--grid-min, 18rem)), 1fr));
  }
  .measure { max-width: var(--max-width--text); }
  /* Any wrapper whose children should respond to its width. */
  .cq { container-type: inline-size; }
}

@layer components {
  /* ---- Floating-label field ----------------------------------------------
     Shared by the form-field component and the search forms. The label rests
     inside the empty field like a placeholder and lifts above it on focus or
     once there is a value. Needs a non-empty placeholder attribute, which is
     only shown (as a hint) while the field has focus. */
  .float-field {
    --field-x: 1rem;
    --field-y: .875rem;
    --field-lift: 1.5rem;
    position: relative;
    display: block;
    padding-top: var(--field-lift);
  }
  .float-field > label {
    position: absolute;
    inset-block-start: 0;
    inset-inline-start: 0;
    z-index: 1;
    max-width: calc(100% - 2 * var(--field-x));
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: var(--text-main--font-size);
    line-height: 1.5;
    color: var(--theme--text-muted);
    transform-origin: 0 0;
    transform: translate(var(--field-x), calc(var(--field-lift) + var(--field-y) + 1px));
    transition: transform var(--duration--fast) var(--ease--out), color var(--duration--fast) var(--ease--out);
    pointer-events: none;
  }
  .float-field:is(:focus-within, :has(:is(input, textarea):not(:placeholder-shown)), :has(:autofill), :has(option:checked:not([value=""]))) > label {
    transform: translate(0, 0) scale(.8);
    color: var(--theme--text-secondary);
  }
  .float-field :is(input, textarea, select) {
    display: block;
    width: 100%;
    min-width: 0;
    padding: var(--field-y) var(--field-x);
    border: 1px solid var(--theme--field-border);
    border-radius: 0;
    background: var(--theme--surface);
    color: var(--theme--text);
    font-size: var(--text-main--font-size);
    line-height: 1.5;
    transition: border-color var(--duration--fast) var(--ease--out), box-shadow var(--duration--fast) var(--ease--out);
  }
  .float-field textarea { resize: vertical; }
  .float-field ::placeholder { color: transparent; transition: color var(--duration--fast) var(--ease--out); }
  .float-field :focus::placeholder { color: var(--theme--text-muted); }
  .float-field :is(input, textarea, select):hover { border-color: var(--theme--text-secondary); }
  .float-field :is(input, textarea, select):focus-visible {
    outline: none;
    border-color: var(--swatch--orange);
    box-shadow: inset 0 0 0 1px var(--swatch--orange);
  }
  .float-field [aria-invalid="true"] { border-color: var(--swatch--orange-deep); }

  /* Select: square box with the site chevron. Where the browser supports a
     stylable picker (appearance: base-select) the open list matches too. */
  .float-field .select { position: relative; display: block; }
  .float-field select {
    appearance: none;
    /* Same height as a text input even while no option is chosen. */
    min-height: calc(var(--field-y) * 2 + 1.5em + 2px);
    padding-inline-end: 3rem;
    cursor: pointer;
  }
  .float-field .select .icon {
    position: absolute;
    inset-inline-end: var(--field-x);
    top: 50%;
    transform: translateY(-50%);
    transition: transform var(--duration--fast) var(--ease--out);
    pointer-events: none;
    color: var(--theme--text-secondary);
    --icon-size: .875rem;
  }
  @supports (appearance: base-select) {
    .float-field select, .float-field ::picker(select) { appearance: base-select; }
    .float-field select { display: flex; align-items: center; }
    .float-field select::picker-icon { display: none; }
    .float-field .select:has(select:open) .icon { transform: translateY(-50%) rotate(180deg); }
    .float-field ::picker(select) {
      margin-block-start: -1px;
      padding: 0;
      border: 1px solid var(--theme--border-strong);
      background: var(--theme--surface);
      box-shadow: var(--shadow--soft);
    }
    .float-field option { padding: .75rem var(--field-x); border-bottom: 1px solid var(--theme--border); }
    .float-field option:last-child { border-bottom: 0; }
    .float-field option[value=""] { display: none; }
    .float-field option::checkmark { display: none; }
    .float-field option:is(:hover, :focus-visible) { background: var(--swatch--orange-tint); outline: none; }
    .float-field option:checked { color: var(--theme--brand-text); font-weight: var(--font-weight--medium); }
  }
}

@layer components {
  /* Rich text from the CMS and the legal pages. */
  .prose { max-width: var(--max-width--text); }
  .prose > * + * { margin-block-start: 1em; }
  .prose :is(h2, h3, h4) {
    margin-block-start: 1.8em;
    text-transform: none;
    letter-spacing: .04em;
  }
  .prose h2 { font-size: var(--h4--font-size); }
  .prose h3 { font-size: var(--h5--font-size); }
  .prose h4 { font-size: var(--h6--font-size); }
  .prose :is(ul, ol) { padding-inline-start: 1.25em; }
  .prose li + li { margin-block-start: .4em; }
  /* Body links keep a faint rule at rest (never colour alone) and draw a
     full-strength underline in from the left on hover and focus. */
  .prose a {
    color: var(--theme--brand-text);
    text-decoration: none;
    background-image:
      linear-gradient(currentColor, currentColor),
      linear-gradient(color-mix(in srgb, currentColor 35%, transparent), color-mix(in srgb, currentColor 35%, transparent));
    background-repeat: no-repeat;
    background-position: 0 100%, 0 100%;
    background-size: 0% 1px, 100% 1px;
    padding-bottom: .08em;
    transition: background-size var(--duration--main) var(--ease--out), color var(--duration--fast) var(--ease--out);
  }
  .prose a:is(:hover, :focus-visible) { background-size: 100% 1px, 100% 1px; }
  .prose p:empty { display: none; }
  .prose .draft-note { padding: 1rem 1.25rem; border: 1px solid var(--theme--brand); border-radius: var(--radius--main); background: var(--theme--surface); }
}

/* ---- One-off page sections (marked with data-wl-component, used once) ----
   Shared, repeated blocks live in components/<name>/. */
@layer components {
  /* Project page: full-bleed hero with breadcrumb, title over a scrim. */
  .project-hero {
    position: relative;
    height: 86vh;
    height: 86svh;
    min-height: 30rem;
    overflow: hidden;
    background: var(--swatch--ink);
    color: var(--swatch--cream-light);
  }
  .project-hero::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    z-index: 1;
    height: calc(var(--header-height) * 1.8);
    background: linear-gradient(180deg, #131212A6, #13121200);
  }
  .project-hero .media { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
  .project-hero .scrim { position: absolute; inset: 0; background: var(--theme--scrim); }
  .project-hero .caption {
    position: absolute;
    inset: auto 0 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding-block: clamp(1.5rem, 4vw, 4rem);
  }
  .project-hero .category { --eyebrow-color: var(--swatch--orange-bright); }
  .project-hero .title { font-size: var(--h1--font-size); max-width: 20ch; }
  .breadcrumb ol { display: flex; flex-wrap: wrap; gap: .25rem .5rem; padding: 0; list-style: none; font-size: var(--text-small--font-size); color: var(--swatch--stone); }
  .breadcrumb li + li::before { content: "/"; margin-inline-end: .5rem; opacity: .6; }
  .breadcrumb a { color: inherit; text-decoration: none; }
  .breadcrumb a:hover { color: var(--swatch--cream-light); text-decoration: underline; }

  .project-facts { container: project-facts / inline-size; }
  .project-facts .layout { display: grid; gap: var(--size--4rem); align-items: start; }
  .project-facts .facts { display: grid; gap: .75rem 2rem; grid-template-columns: auto 1fr; margin: 0; font-size: var(--text-small--font-size); }
  .project-facts .fact { display: contents; }
  .project-facts dt { letter-spacing: .18em; text-transform: uppercase; color: var(--theme--text-muted); }
  .project-facts dd { margin: 0; }
  .project-facts .facts-other { margin-top: 1.25rem; font-size: var(--text-small--font-size); }
  .project-facts .intro { font-size: var(--text-large--font-size); line-height: 1.45; }
  @container project-facts (min-width: 56rem) {
    .project-facts .layout { grid-template-columns: minmax(16rem, 1fr) minmax(0, 2fr); }
  }

  .project-story { display: flex; flex-direction: column; gap: var(--size--5rem); padding-bottom: var(--padding-vertical--small); container: project-story / inline-size; }
  .project-story .row { display: grid; gap: var(--size--3rem); align-items: center; }
  .project-story .media-col img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
  .project-story .prose { color: var(--theme--text-secondary); }
  .project-story .outro { padding-top: 0; }
  @container project-story (min-width: 56rem) {
    .project-story .row:first-child .media-col { width: 70%; }
    .project-story .row.flip { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .project-story .row.flip .media-col { order: 2; }
  }

  /* Om oss: company facts beside the client directory. */
  .about-directory { container: about-directory / inline-size; }
  .about-directory .layout { display: grid; gap: var(--size--5rem); }
  @container about-directory (min-width: 64rem) {
    .about-directory .layout { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
  }

  /* Kontakt: details and image beside the form. */
  .contact { container: contact / inline-size; }
  .contact .layout { display: grid; gap: var(--size--5rem); align-items: start; }
  @container contact (min-width: 56rem) {
    .contact .layout { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  }

  /* Search results and 404. */
  .search-page .inner, .not-found .inner { display: flex; flex-direction: column; gap: var(--size--1-5rem); max-width: 52rem; }
  .search-page .inner { margin-inline: auto; box-sizing: content-box; }
  .not-found .inner { align-items: flex-start; }
  .not-found .search-form { align-self: stretch; }
  .search-page .inner:has([data-wl-search-empty]:not([hidden])) .count { display: none; }
  .search-page .title, .not-found .title { font-size: var(--h1--font-size); }
  .search-row { display: flex; flex-wrap: wrap; gap: .75rem; align-items: flex-end; }
  .search-row .float-field { flex: 1 1 16rem; min-width: 0; }
  .search-page .count { color: var(--theme--text-muted); }
  .search-page .results { display: flex; flex-direction: column; padding: 0; border-top: 1px solid var(--theme--border); }
  .search-page .result { display: flex; flex-direction: column; gap: .35rem; padding-block: 1.25rem; border-bottom: 1px solid var(--theme--border); }
  .search-page .section-label { font-size: var(--text-small--font-size); letter-spacing: var(--letter-spacing--eyebrow); text-transform: uppercase; color: var(--theme--brand-text); }
  .search-page .section-label:empty { display: none; }
  .search-page .result-title { font-size: var(--text-large--font-size); text-decoration: none; }
  .search-page .result-title:hover { text-decoration: underline; }
  .search-page .excerpt { color: var(--theme--text-secondary); }
  .search-page mark { background: var(--swatch--orange-tint); color: inherit; padding-inline: .1em; }
  .not-found .symbol { width: clamp(5rem, 4rem + 5vw, 8rem); color: var(--swatch--orange); fill: currentColor; }

  /* HTML sitemap. */
  .html-sitemap .layout { display: grid; gap: var(--size--4rem); grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr)); align-items: start; }
  .html-sitemap .col-title { font-size: var(--h5--font-size); margin-bottom: 1rem; }
  .html-sitemap ul { display: flex; flex-direction: column; gap: .4rem; padding: 0; list-style: none; }
  .html-sitemap .projects { display: block; columns: 14rem; }
  .html-sitemap .projects li { padding-block: .2rem; }
}

/* ---- Styleguide page ------------------------------------------------ */
@layer components {
  .sg-title { font-size: var(--h4--font-size); margin-bottom: var(--size--2rem); }
  .sg-swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 13rem), 1fr)); gap: 1.5rem; padding: 0; list-style: none; }
  .sg-swatch { display: flex; flex-direction: column; gap: .35rem; }
  .sg-swatch .chip { display: block; aspect-ratio: 3 / 2; border: 1px solid var(--theme--border); background: var(--chip); }
  .sg-name { font-size: var(--text-small--font-size); font-weight: var(--font-weight--bold); }
  .sg-meta { font-size: var(--text-small--font-size); color: var(--theme--text-muted); }
  [data-swatch="cream"] { --chip: var(--swatch--cream); }
  [data-swatch="cream-light"] { --chip: var(--swatch--cream-light); }
  [data-swatch="cream-deep"] { --chip: var(--swatch--cream-deep); }
  [data-swatch="orange"] { --chip: var(--swatch--orange); }
  [data-swatch="orange-a11y"] { --chip: var(--swatch--orange-a11y); }
  [data-swatch="orange-deep"] { --chip: var(--swatch--orange-deep); }
  [data-swatch="orange-bright"] { --chip: var(--swatch--orange-bright); }
  [data-swatch="ink"] { --chip: var(--swatch--ink); }
  [data-swatch="ink-secondary"] { --chip: var(--swatch--ink-secondary); }
  [data-swatch="ink-muted"] { --chip: var(--swatch--ink-muted); }
  [data-swatch="sand"] { --chip: var(--swatch--sand); }
  [data-swatch="stone"] { --chip: var(--swatch--stone); }
  [data-swatch="line"] { --chip: var(--swatch--line); }
  .sg-themes { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); gap: 1rem; margin-top: var(--size--3rem); }
  .sg-theme { display: flex; flex-direction: column; gap: .5rem; padding: 1.5rem; }
  .sg-type-list { display: flex; flex-direction: column; gap: 1.5rem; padding: 0; list-style: none; }
  .sg-type { font-family: var(--font--display-family); font-weight: var(--font-weight--bold); letter-spacing: var(--letter-spacing--heading); text-transform: uppercase; line-height: 1.05; }
  .sg-type[data-size="display"] { font-size: var(--display--font-size); }
  .sg-type[data-size="h1"] { font-size: var(--h1--font-size); }
  .sg-type[data-size="h2"] { font-size: var(--h2--font-size); }
  .sg-type[data-size="h3"] { font-size: var(--h3--font-size); }
  .sg-type[data-size="h4"] { font-size: var(--h4--font-size); }
  .sg-type[data-size="h5"] { font-size: var(--h5--font-size); }
  .sg-type[data-size="h6"] { font-size: var(--h6--font-size); }
  .sg-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr)); gap: 2px; padding: 0; list-style: none; }
  .styleguide .pull-quote { margin-top: var(--size--3rem); }
}

@layer utilities {
  .eyebrow {
    font-family: var(--font--body-family);
    font-size: var(--text-small--font-size);
    font-weight: var(--font-weight--medium);
    letter-spacing: var(--letter-spacing--eyebrow);
    line-height: 1.3;
    text-transform: uppercase;
    color: var(--eyebrow-color, var(--theme--text-muted)); /* components set --eyebrow-color */
  }
  .eyebrow[data-tone="brand"] { color: var(--theme--brand-text); }
  .eyebrow[data-tone="ink"] { color: var(--theme--text); }
  .eyebrow:empty { display: none; }

  .lead {
    font-size: var(--text-large--font-size);
    line-height: 1.45;
    color: var(--theme--text-secondary);
  }
  .text-secondary { color: var(--theme--text-secondary); }
  .text-muted { color: var(--theme--text-muted); }
  .text-small { font-size: var(--text-small--font-size); }
  .display { font-size: var(--display--font-size); }

  .visually-hidden {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
  }
  /* Consent preferences: the Weblooks runtime flags its wrapper, which sits
     outside the consent-banner component, so the swap lives here. */
  [data-wl-consent-open] > .consent-banner {
    inset: 0;
    justify-content: center;
    align-items: center;
    padding: var(--padding-horizontal--main);
    background: var(--theme--overlay);
    pointer-events: auto;
  }
  [data-wl-consent-open] > .consent-banner .bar { display: none; }
  [data-wl-consent-open] > .consent-banner .dialog { display: block; }

  /* Header wordmark: with JS the static logo waits for the Lottie intro
     (site-header.js), but shows after 2.5s regardless, so it never goes
     missing. Reduced motion always gets the static logo at once. */
  .js .site-header .brand:not([data-anim]) .logo { opacity: 0; animation: brand-failsafe 1ms 2.5s forwards; }
  @keyframes brand-failsafe { to { opacity: 1; } }
  @media (prefers-reduced-motion: reduce) {
    .js .site-header .brand:not([data-anim]) .logo { opacity: 1; animation: none; }
  }

  .skip-link {
    position: fixed;
    z-index: 200;
    inset-inline-start: var(--size--1rem);
    inset-block-start: var(--size--1rem);
    padding: .75rem 1.25rem;
    border-radius: var(--radius--round);
    background: var(--swatch--ink);
    color: var(--swatch--cream-light);
    transform: translateY(-200%);
    transition: transform var(--duration--fast) var(--ease--out);
  }
  .skip-link:focus-visible { transform: none; color: var(--swatch--cream-light); }

  /* ---- Motion library -------------------------------------------------
     One set for the whole site, driven by /assets/js/site.js. Content is
     visible without JavaScript: the hidden start state only applies once
     the script has marked <html class="js">. */
  .js [data-reveal] {
    opacity: 0;
    transform: translateY(var(--reveal--distance));
    transition:
      opacity var(--duration--reveal) var(--ease--out) var(--reveal-delay, 0ms),
      transform var(--duration--reveal) var(--ease--out) var(--reveal-delay, 0ms);
  }
  .js [data-reveal].is-revealed { opacity: 1; transform: none; }
  /* Photo tiles and cards only fade: sliding a large image up leaves an
     empty strip for it to travel into. */
  .js [data-reveal]:has(img) { transform: none; }
  [data-reveal="1"] { --reveal-delay: calc(var(--stagger--step) * 1); }
  [data-reveal="2"] { --reveal-delay: calc(var(--stagger--step) * 2); }
  [data-reveal="3"] { --reveal-delay: calc(var(--stagger--step) * 3); }
  [data-reveal="4"] { --reveal-delay: calc(var(--stagger--step) * 4); }
  /* Items in a revealed list stagger by position. */
  [data-reveal-list] > :nth-child(2) { --reveal-delay: calc(var(--stagger--step) * 1); }
  [data-reveal-list] > :nth-child(3) { --reveal-delay: calc(var(--stagger--step) * 2); }
  [data-reveal-list] > :nth-child(4) { --reveal-delay: calc(var(--stagger--step) * 3); }
  [data-reveal-list] > :nth-child(5) { --reveal-delay: calc(var(--stagger--step) * 4); }
  [data-reveal-list] > :nth-child(n + 6) { --reveal-delay: calc(var(--stagger--step) * 5); }

  /* Letter-by-letter heading fill (each character rests at 25%). */
  .letters-word { display: inline-block; white-space: nowrap; }
  .letters-char {
    display: inline-block;
    transition: opacity 1100ms var(--ease--out) calc(160ms + var(--i, 0) * 22ms);
  }
  .js [data-letters]:not(.is-revealed) .letters-char { opacity: .25; }

  @media (prefers-reduced-motion: reduce) {
    .letters-char { transition: none; }
    .js [data-letters]:not(.is-revealed) .letters-char { opacity: 1; }
  }
  @media print {
    .js [data-reveal] { opacity: 1; transform: none; }
    .js [data-letters] .letters-char { opacity: 1; }
  }
}
