
:root {
  --ink-19:   #303030;   /* deepest ink — headings, footer */
  --ink-28:   #474747;   /* primary ink — body, H1 */
  --ink-deep: #1d2026;   /* deepest slate — hero, disciplines, nav */
  --ink-mid:  #2f343c;   /* mid slate — work section */
  --paper:    #FFFFFF;
  --bone:     #F5F4F2;
  --stone:    #E8E7E4;
  --grey-500: #757575;
  --border:   #DEDCD7;

  --tint-blue:    #A8BAC4;
  --tint-magenta: #E91E63;

  --fg-on-dark:      rgba(255, 255, 255, 0.96);
  --fg-on-dark-soft: rgba(255, 255, 255, 0.82);
  --fg-on-dark-mute: rgba(255, 255, 255, 0.62);
  --line-on-dark:    rgba(255, 255, 255, 0.16);
  --surface-on-dark: rgba(255, 255, 255, 0.06);
  --scrim:           rgba(37, 40, 45, 0.62);
  --scrim-strong:    rgba(37, 40, 45, 0.82);

  --font-display: "Novecento Sans Wide", "Futura PT", Futura, "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-body:    "Sofia Pro", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-sub:     "Montserrat", "Helvetica Neue", Helvetica, Arial, sans-serif;

  --text-caption:  .6875rem;
  --text-body:     1rem;
  --text-h3:       1.875rem;
  --text-h2:       2.75rem;
  --text-h1:       3.375rem;
  --text-h1-fluid: clamp(2.25rem, 6vw, var(--text-h1));
  --text-h2-fluid: clamp(1.75rem, 3.5vw, var(--text-h2));
  --text-h3-fluid: clamp(1.25rem, 2.2vw, var(--text-h3));

  --track-tight:  -0.02em;
  --track-h1:      0.02em;
  --track-wide:    0.08em;
  --track-h2:      0.14em;
  --track-wider:   0.22em;

  --lead-snug:   1.2;
  --lead-normal: 1.55;
  --lead-loose:  1.72;

  --sp-1: .25rem;  --sp-2: .5rem;   --sp-3: .75rem;  --sp-4: 1rem;
  --sp-5: 1.5rem;  --sp-6: 2rem;    --sp-7: 3rem;    --sp-8: 4rem;
  --sp-9: 6rem;    --sp-10: 8rem;

  --radius-full: 62.4375rem;
  --line:        1px solid var(--border);
  --line-ink:    1px solid var(--ink-19);
  --pill-fill:   rgba(48, 48, 48, .06); /* subtle ink tint — borderless pills/buttons */

  --ease:        cubic-bezier(0.4, 0.0, 0.2, 1);
  --ease-out:    cubic-bezier(0.0, 0.0, 0.2, 1);
  --ease-immersive: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-2: 200ms;  --dur-3: 320ms;  --dur-4: 500ms;  --dur-5: 900ms;
  --dur-reveal: 1100ms; /* scroll-reveal entrance — independent of --dur-4 (carousel uses that) */
  --dur-draw:   3200ms; /* hero-bird stroke-draw */

  --col-max:  72rem;
  --col-text: 42rem;
  --z-nav:    100;
  --nav-h:    3.75rem;
  --reveal-shift: .4rem;
  --reveal-blur:  28px;

  --fg:         var(--ink-28);
  --fg-strong:  var(--ink-19);
  --fg-muted:   var(--grey-500);
  --eyedrop-fg: var(--grey-500);
  --line-col:   var(--border);
  --surface:    var(--bone);

  --gutter: clamp(1.5rem, 10vw, 12rem);

  --blur-media:       40px;
  --blur-card:        12px;
  --blur-card-hover:  3px;
  --media-scale:      1.24;
  --card-lift:        3px;
  --shadow-card:      0 14px 36px -14px rgba(0, 0, 0, .45);
  --scrim-top:        14%;  /* card/slide scrim gradient stops */
  --scrim-bottom:     82%;
}

/* Declare layer order up front (low → high precedence). */
@layer ui.base, ui.layout, components, composites;

/* ════════════════════════════ ui.base ════════════════════════════ */
@layer ui.base {
  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

  html {
    font-size: 100%; scroll-behavior: smooth;
    scroll-padding-top: var(--nav-h); scroll-snap-type: y proximity;
    interpolate-size: allow-keywords; /* lets <details> animate to/from auto */
    /* expose each section's scroll progress to the (non-descendant) nav links */
    timeline-scope: --ts-resume, --ts-ai, --ts-disciplines, --ts-work, --ts-graphics, --ts-contact;
  }

  html, body {
    min-width: 20rem; min-height: 100%; overflow-x: clip; background: var(--paper);
    color: var(--ink-28); font-family: var(--font-body);
    font-weight: 300; -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }

  body { font-size: var(--text-body); line-height: var(--lead-normal); }

  a { color: inherit; text-decoration: none; transition: color var(--dur-2) var(--ease); }

  button { background: none; border: 0; font: inherit; color: inherit; cursor: pointer; }
  ul, ol { list-style: none; }

  img, svg { display: block; }
  img { max-width: 100%; height: auto; }
  svg[hidden] { position: absolute; width: 0; height: 0; }

  ::selection { background: var(--ink-19); color: var(--paper); }
  :focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }

  h1, h2, h3, h4 {
    color: var(--fg-strong); font-family: var(--font-display);
    font-weight: 600; line-height: var(--lead-snug);
    letter-spacing: var(--track-h2); text-transform: uppercase; text-wrap: balance;
  }
  h1, h2 { font-size: var(--text-h2-fluid); }
  h3 { font-size: var(--text-h3-fluid); }
  h4 { font-size: 1rem; letter-spacing: var(--track-wide); }

  p, li, blockquote { text-wrap: pretty; }
  strong { font-weight: 600; }
  em { font-style: italic; }
  address { font-style: normal; } /* semantic contact blocks, not italics */

  .skip-link {
    position: fixed; inset-block-start: var(--sp-3);
    inset-inline-start: var(--sp-3); z-index: 1000;
    padding: var(--sp-2) var(--sp-4); background: var(--paper);
    color: var(--ink-19); font-family: var(--font-display);
    font-size: var(--text-caption); font-weight: 600;
    letter-spacing: var(--track-wide); text-transform: uppercase;
    text-decoration: none; border: 1px solid currentColor;
    transform: translateY(calc(-100% - var(--sp-5)));
    transition: transform var(--dur-2) var(--ease);
  }
  .skip-link:focus-visible { transform: translateY(0); }

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

/* ════════════════════════ ui.layout ════════════════════════
   Layout-ONLY primitives: they position, size and space. No colour, no type
   decoration — those are component concerns. Every section's content lines up
   on the shared --gutter + --col-max column, matching #ai-proof. */
@layer ui.layout {
  .panel {
    position: relative; min-height: 100vh;
    padding: clamp(5.5rem, 14vh, 10rem) var(--gutter); display: flex;
    flex-direction: column; justify-content: center; gap: clamp(2.5rem, 6vw, var(--sp-8));
  }

  .snap { scroll-snap-align: start; }

  .section-head {
    display: flex; flex-direction: column; align-items: center; text-align: center;
    gap: var(--sp-4); max-width: var(--col-max); margin-inline: auto;
    & .eyedrop + h2 { margin-top: calc(-1 * var(--sp-2)); }
    & .cta-download { margin-top: var(--sp-4); align-self: center; }
  }

  .card-grid {
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--sp-5); max-width: var(--col-max); margin-inline: auto;
    & > li { display: flex; }
  }

  .feature-grid {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--sp-5); max-width: var(--col-max); margin-inline: auto;
  }

  .approach {
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--sp-7); max-width: var(--col-max); margin-inline: auto;
  }
}

/* ════════════════════════ components ════════════════════════ */
@layer components {
  .eyedrop {
    display: inline-flex; align-items: center;
    gap: .875rem; font-family: var(--font-display);
    font-weight: 450; font-size: var(--text-caption);
    letter-spacing: var(--track-wider); line-height: var(--lead-snug);
    text-transform: uppercase; color: var(--eyedrop-fg);
    :is(.section-head, .hero, .resume-aside, .contact-info) &::before,
    :is(.section-head, .hero, .resume-aside, .contact-info) &::after {
      content: ""; width: 2.125rem; height: 1px; flex: 0 0 auto;
      background: currentColor; opacity: .55;
    }
    .section-head &,
    .hero & { font-size: .9375rem; letter-spacing: .3em; justify-content: center; }
  }

  .ingress {
    max-width: var(--col-text); margin-inline: auto;
    color: var(--fg); font-size: clamp(1rem, 1.3vw, 1.125rem);
    line-height: var(--lead-loose); text-align: center; text-wrap: balance;
  }

  .button {
    display: inline-flex; align-items: center;
    gap: var(--sp-2); font-family: var(--font-display);
    font-weight: 500; font-size: var(--text-caption);
    letter-spacing: var(--track-h2); text-transform: uppercase;
    color: var(--fg-strong); background: var(--pill-fill); padding: var(--sp-4) var(--sp-6);
    transition: background var(--dur-2) var(--ease), color var(--dur-2) var(--ease);
    &:hover,
    &:focus-visible { background: var(--fg-strong); color: var(--paper); }
  }

  .button[data-variant="outline"] {
    align-self: flex-start; margin-top: var(--sp-2);
    color: var(--fg-on-dark-soft); background: transparent;
    padding: var(--sp-3) var(--sp-5); border: 1px solid rgba(255, 255, 255, .25);
    transition: background var(--dur-2) var(--ease), color var(--dur-2) var(--ease), border-color var(--dur-2) var(--ease);
    &:hover,
    &:focus-visible { background: var(--paper); color: var(--ink-deep); border-color: var(--paper); }
  }

  /* ── Reveal — staggered fade-up, opted into with the class (no JS without it,
       no structural selectors). reveal.ts adds .is-concealed then peels it. ── */
  .reveal {
    transition: opacity var(--dur-reveal) var(--ease-immersive), transform var(--dur-reveal) var(--ease-immersive), filter var(--dur-reveal) var(--ease-immersive);
    &.is-concealed {
      opacity: 0;
      transform: perspective(600px) translateY(var(--reveal-shift)) rotateX(0.3deg);
      filter: blur(var(--reveal-blur));
    }
  }

  .card {
    --eyedrop-fg: var(--fg-on-dark-mute); position: relative;
    isolation: isolate; display: flex; flex-direction: column; justify-content: flex-end;
    width: 100%; height: 100%; z-index: 4; min-height: 17rem;
    padding: var(--sp-5); gap: var(--sp-2);
    color: var(--fg-on-dark); background: var(--ink-deep); overflow: hidden;
    transition: box-shadow var(--dur-2) var(--ease), transform var(--dur-3) var(--ease);
    /* Same flat ink scrim the slides use — keeps the copy legible over the photo
       and makes every tile read in one consistent visual language. */
    &::after {
      content: ""; position: absolute; inset: 0; z-index: -1;
      background: linear-gradient(to top, var(--scrim-strong) var(--scrim-top), var(--scrim) var(--scrim-bottom));
    }
    &:hover { box-shadow: var(--shadow-card); transform: translateY(calc(-1 * var(--card-lift))); }
    & img {
      position: absolute; inset: 0; z-index: -2; width: 100%;
      height: 100%; object-fit: cover; background: var(--stone); opacity: .42;
      filter: blur(var(--blur-card)) brightness(.55) saturate(1.05); transform: scale(1.12);
      transition: opacity calc(var(--dur-3) * 2) var(--ease), filter calc(var(--dur-3) * 2) var(--ease), transform calc(var(--dur-3) * 2) var(--ease);
    }
    &:hover img {
      opacity: .72; filter: blur(var(--blur-card-hover)) brightness(.7) saturate(1.1);
      transform: scale(1.16); transition-duration: var(--dur-3);
    }
    & > .eyedrop { padding: 0; }
    & h3 { padding: 0; font-size: 1.0625rem; letter-spacing: var(--track-wide); }
    & p:not(.eyedrop) {
      padding: 0; color: var(--fg-on-dark-soft);
      font-size: .9375rem; line-height: var(--lead-normal);
    }
  }

  .tag-list {
    display: flex; flex-wrap: wrap; gap: var(--sp-2); padding: 0;
    & li {
      font-family: var(--font-display); font-size: .625rem;
      letter-spacing: var(--track-wide); text-transform: uppercase;
      color: var(--fg-on-dark-soft); background: rgba(255, 255, 255, .14);
      border-radius: var(--radius-full); padding: .3rem .6rem;
    }
  }

  .carousel {
    position: relative; width: 100vw; margin-inline: calc(50% - 50vw); overflow: hidden;
    background: var(--ink-deep); color: var(--fg-on-dark);
    --fg: var(--fg-on-dark); --fg-strong: var(--fg-on-dark);
    --eyedrop-fg: var(--fg-on-dark-mute); --controls-bottom: clamp(1.5rem, 4vw, 3rem);
    & .slideshow {
      display: flex; transition: transform var(--dur-4) var(--ease-immersive);
      html:not(.js) & { overflow-x: auto; scroll-snap-type: x mandatory; }
    }
    & .slide {
      position: relative; flex: 0 0 100%;
      min-height: clamp(30rem, 82vh, 50rem); display: flex;
      align-items: center; scroll-snap-align: start; isolation: isolate; overflow: hidden;
      /* Per-slide index, read alongside --current (published by carousel.ts) so the
         photo layer can parallax horizontally against the content track. */
      &:nth-child(1) { --i: 0 } &:nth-child(2) { --i: 1 } &:nth-child(3) { --i: 2 }
      &:nth-child(4) { --i: 3 } &:nth-child(5) { --i: 4 } &:nth-child(6) { --i: 5 }
      &::after {
        /* Flat ink scrim (not a decorative gradient) for legibility over photography. */
        content: ""; position: absolute; inset: 0; z-index: -1;
        background: var(--scrim-strong);
      }
      /* Blurred parallax photo — the slide's only <img>. Lags the content track by
         --media-parallax per slide of distance from the active one; heavy blur +
         scale overscan hide the travelled edges. carousel.ts sets --current. */
      & > img {
        position: absolute; inset: 0; z-index: -2; width: 100%;
        height: 100%; object-fit: cover;
        filter: blur(var(--blur-media)); --media-parallax: 7%;
        transform: translateX(calc((var(--i, 0) - var(--current, 0)) * var(--media-parallax))) scale(var(--media-scale));
        @media (prefers-reduced-motion: no-preference) {
          transition: transform var(--dur-4) var(--ease-immersive);
        }
      }
      & > div {
        max-width: 44rem; margin: clamp(2rem, 6vw, 5rem);
        display: flex; flex-direction: column; gap: var(--sp-3);
        & h3 { font-size: clamp(1.375rem, 2.6vw, 2rem); font-weight: 500; letter-spacing: var(--track-wide); }
        & p:not(.eyedrop) {
          max-width: 38rem; color: var(--fg-on-dark-soft);
          font-size: clamp(1rem, 1.4vw, 1.1875rem); line-height: var(--lead-loose);
        }
        & a {
          align-self: flex-start; margin-top: var(--sp-2);
          font-family: var(--font-display); font-size: var(--text-caption);
          letter-spacing: var(--track-h2); text-transform: uppercase;
          border-bottom: 1px solid var(--line-on-dark); padding-bottom: var(--sp-1);
          transition: border-color var(--dur-2) var(--ease);
          &:hover { border-color: var(--fg-on-dark); }
        }
      }
    }
    & .slide-nav {
      position: absolute; inset-block-end: var(--controls-bottom);
      inset-inline-end: clamp(1.5rem, 5vw, 4rem); z-index: 3;
      display: flex; gap: var(--sp-3);
      & button {
        width: 3rem; height: 3rem; display: grid; place-items: center;
        background: rgba(255, 255, 255, .12); border-radius: var(--radius-full);
        backdrop-filter: blur(4px); font-size: 1.125rem;
        transition: background var(--dur-2) var(--ease), transform var(--dur-2) var(--ease);
        &:hover { background: rgba(255, 255, 255, .28); transform: scale(1.06); }
      }
    }
    & .slide-dots {
      position: absolute; inset-block-end: var(--controls-bottom);
      inset-inline-start: clamp(1.5rem, 5vw, 4rem); z-index: 3;
      display: flex; gap: var(--sp-3);
      & button {
        width: 2rem; height: 2px; background: var(--line-on-dark);
        transition: background var(--dur-2) var(--ease);
        &[aria-selected="true"] { background: var(--fg-on-dark); }
      }
    }
  }

  .feature {
    border-top: 1px solid var(--line-col); padding-top: var(--sp-5);
    display: flex; flex-direction: column; gap: var(--sp-3);
    & h3 { font-size: 1.125rem; letter-spacing: var(--track-h2); }
    & p { color: var(--fg-muted); line-height: var(--lead-loose); }
  }

  .approach-item {
    display: flex; flex-direction: column; align-items: center; text-align: center;
    gap: var(--sp-4);
    & > span {
      width: 3.5rem; height: 3.5rem; display: grid; place-items: center;
      border-radius: var(--radius-full); background: var(--pill-fill);
      color: var(--fg-strong);
      transition: background var(--dur-2) var(--ease), color var(--dur-2) var(--ease);
      & svg { width: 1.5rem; height: 1.5rem; }
    }
    &:hover > span { background: var(--fg-strong); color: var(--paper); }
    & h3 { font-size: 1.1875rem; letter-spacing: var(--track-h2); }
    & p { color: var(--fg-muted); line-height: var(--lead-loose); }
  }

  .badge {
    display: flex; flex-wrap: wrap; gap: var(--sp-2);
    & li {
      font-size: .8125rem; letter-spacing: var(--track-h1);
      color: var(--fg-muted); background: var(--pill-fill);
      border-radius: var(--radius-full); padding: .3rem .7rem;
      transition: background var(--dur-2) var(--ease), color var(--dur-2) var(--ease);
      &.hot { color: var(--paper); background: var(--fg-strong); }
      &.dim { opacity: .6; }
    }
  }

  /* ── Animated <details> — pure CSS, no JS. The native open state drives the
       caret + the ::details-content height animation (interpolate-size: allow-
       keywords, set in ui.base, lets block-size animate to/from auto). ── */
  details {
    & summary {
      cursor: pointer; list-style: none; display: flex; align-items: center;
      justify-content: space-between; gap: var(--sp-3);
      transition: color var(--dur-2) var(--ease);
      &::-webkit-details-marker { display: none; }
      &::after {
        content: ""; flex: 0 0 auto; width: .5rem; height: .5rem;
        border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
        transform: rotate(45deg); opacity: .55;
        transition: transform var(--dur-3) var(--ease);
      }
      &:hover { color: var(--fg-strong); }
    }
    &[open] > summary::after { transform: rotate(-135deg); }
    /* The open/close box, nested with its element. Degrades to an instant native
       toggle where ::details-content is unsupported (older Firefox) — content
       stays accessible and the rail dot on details::before is never clipped. */
    &::details-content {
      block-size: 0; overflow: clip;
      transition: block-size var(--dur-3) var(--ease), content-visibility var(--dur-3) var(--ease) allow-discrete;
    }
    &[open]::details-content { block-size: auto; }
  }

  .more-projects {
    display: flex; flex-direction: column; align-items: center;
    & > summary {
      display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
      margin: 0 auto;
      transition: background var(--dur-2) var(--ease), color var(--dur-2) var(--ease);
      &:hover { background: var(--fg-strong); color: var(--ink-deep); }
    }
    &[open] > summary { margin-bottom: var(--sp-6); }
  }

  .duties {
    display: flex; flex-direction: column; gap: var(--sp-2); margin-top: var(--sp-4);
    padding-left: var(--sp-5);
    & li {
      position: relative; color: var(--fg-muted); line-height: var(--lead-loose);
      &::before {
        content: ""; position: absolute; left: calc(-1 * var(--sp-5)); top: .75em;
        width: var(--sp-3); height: 1px; background: var(--fg-muted);
      }
    }
  }

  .role-summary { margin-top: var(--sp-2); color: var(--fg-muted); line-height: var(--lead-normal); }

  .related-projects {
    display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--sp-2) var(--sp-4);
    margin-top: var(--sp-4);
    & a {
      font-size: .8125rem; color: var(--fg-strong); border-bottom: 1px solid transparent;
      transition: border-color var(--dur-2) var(--ease);
      &:hover { border-color: currentColor; }
    }
  }

  .map {
    --fg: var(--fg-on-dark); position: relative; overflow: hidden;
    background: transparent; /* let the contact gradient show through */
    color: var(--fg-on-dark); min-height: 22rem;
    &::before {
      content: ""; position: absolute; inset: 0; opacity: .5;
      background: url("/map.svg") center / cover no-repeat;
      -webkit-mask-image: linear-gradient(to right, transparent, #000 42%);
      mask-image: linear-gradient(to right, transparent, #000 42%);
    }
    & > span {
      position: absolute; left: 46%; top: 44%; z-index: 1;
      width: .75rem; height: .75rem;
      border-radius: var(--radius-full); background: currentColor;
      box-shadow: 0 0 0 .4rem rgba(255, 255, 255, .14);
      @media (prefers-reduced-motion: no-preference) {
        animation: pin-pulse var(--dur-5) var(--ease) infinite; transform-origin: center;
      }
    }
    & figcaption {
      position: absolute; inset-block-start: clamp(1.5rem, 6vh, 3rem);
      inset-inline-end: clamp(1.5rem, 5vw, 3rem); z-index: 2;
      display: inline-flex; align-items: center;
      gap: var(--sp-2); font-family: var(--font-display);
      font-size: var(--text-caption); font-weight: 500;
      letter-spacing: var(--track-wide); text-transform: uppercase;
      color: var(--fg-on-dark-soft);
      &::before {
        content: ""; width: var(--sp-2);
        height: var(--sp-2); border-radius: var(--radius-full); background: currentColor;
      }
    }
  }

  @keyframes pin-pulse {
    0%   { opacity: .3; transform: scale(.92); }
    60%  { opacity: .08; transform: scale(1.08); }
    100% { opacity: .3; transform: scale(.92); }
  }

  .nav {
    position: fixed; inset-block-start: 0; inset-inline: 0; z-index: var(--z-nav);
    height: var(--nav-h); display: flex;
    align-items: center; gap: clamp(.75rem, 2vw, 1.75rem);
    padding-inline: clamp(1.25rem, 5vw, 3.5rem); color: var(--ink-19);
    background: transparent;
    transition: background var(--dur-3) var(--ease), color var(--dur-3) var(--ease);
    & .logo { width: 1.75rem; height: 1.75rem; flex: 0 0 auto; }
    & .nav-links { display: flex; align-items: center; gap: inherit; min-width: 0; }
    & a {
      position: relative; font-family: var(--font-display);
      font-size: .6875rem; font-weight: 600;
      letter-spacing: var(--track-wide); text-transform: uppercase;
      color: inherit; opacity: .72;
      padding-block: var(--sp-1); transition: opacity var(--dur-2) var(--ease);
      &:hover { opacity: 1; }
      &:not(.nav-brand)::before, &:not(.nav-brand)::after {
        content: ""; position: absolute; inset: auto 0 0; height: 2px;
        background: currentColor; transform: scaleX(0); transform-origin: left;
      }
      &:not(.nav-brand)::after { transition: transform var(--dur-2) var(--ease-out); }
      &:not(.nav-brand):hover::after,
      &:not(.nav-brand):focus-visible::after { transform: scaleX(1); }
      @supports (animation-timeline: view()) {
        &[href="#ai-proof"]::before    { animation: nav-track linear both; animation-timeline: --ts-ai; }
        &[href="#work"]::before        { animation: nav-track linear both; animation-timeline: --ts-work; }
        &[href="#resume"]::before      { animation: nav-track linear both; animation-timeline: --ts-resume; }
        &[href="#disciplines"]::before { animation: nav-track linear both; animation-timeline: --ts-disciplines; }
        &[href="#graphics"]::before    { animation: nav-track linear both; animation-timeline: --ts-graphics; }
        &[href="#contact"]::before     { animation: nav-track linear both; animation-timeline: --ts-contact; }
      }
      @supports not (animation-timeline: view()) {
        &[aria-current="true"]::after { transform: scaleX(1); }
      }
    }
    & .nav-brand {
      margin-inline-end: auto; font-size: .8125rem;
      font-weight: 700; letter-spacing: var(--track-h2); opacity: 1;
    }
  }

  @keyframes nav-track {
    0%, 100% { transform: scaleX(0); }
    40%, 60% { transform: scaleX(1); }
  }

  /* Nav is always transparent — only the text colour flips to stay legible over
     whichever section sits beneath it. */
  html[data-nav-theme="hero"] .nav,
  html[data-nav-theme="dark"] .nav { color: var(--fg-on-dark); }
  html[data-nav-theme="light"] .nav { color: var(--ink-19); }

  .footer {
    display: flex; flex-direction: column; align-items: center; gap: var(--sp-3);
    padding: var(--sp-9) var(--sp-5); background: var(--ink-19);
    color: var(--fg-on-dark-soft); text-align: center;
    & > span {
      display: inline-flex; align-items: center;
      gap: var(--sp-3); font-family: var(--font-display);
      font-size: .8125rem; letter-spacing: var(--track-h2);
      text-transform: uppercase; color: var(--fg-on-dark);
      & svg { width: 1.75rem; height: 1.75rem; }
    }
    & p { font-size: .75rem; color: var(--fg-on-dark-mute); letter-spacing: var(--track-h1); }
  }
}

/* ════════════════════════ composites ════════════════════════ */
@layer composites {
  #work, #disciplines {
    min-height: 100svh; padding: 0; justify-content: flex-start;
    & .slide {
      min-height: 100svh;
      /* Reserve space so centered slide content clears the overlaid section
         head (top) and the nav arrows + page dots (bottom). */
      --slide-head-clear: clamp(13rem, 22vh, 17rem);
      padding-block: var(--slide-head-clear) clamp(6rem, 13vh, 8rem);
    }
    & > .section-head {
      position: absolute; inset-block-start: calc(var(--nav-h) + clamp(.75rem, 4vh, 2rem));
      inset-inline: 0; z-index: 3;
      margin-inline: auto; /* centre the max-width head box within the full-bleed section */
      padding-inline: var(--gutter);
      pointer-events: none; /* let swipes / clicks fall through to the carousel */
    }
  }

  #work {
    padding-block: 0 clamp(4rem, 10vh, 7rem);
    & > .card-grid,
    & > .more-projects { width: min(var(--col-max), 100% - 2 * var(--gutter)); margin-inline: auto; }
  }

  #resume, #graphics { background: var(--bone); }
  #work     { background: var(--ink-mid); }
  #contact  {
    background: radial-gradient(60% 80% at 0% 0%, color-mix(in oklab, var(--tint-blue) 22%, transparent), transparent 70%), radial-gradient(55% 75% at 100% 100%, color-mix(in oklab, var(--tint-magenta) 18%, transparent), transparent 70%), var(--ink-19);
  }

  /* Each nav-linked section exposes its scroll progress to the nav underline. */
  @supports (animation-timeline: view()) {
    #ai-proof    { view-timeline: --ts-ai; }
    #work        { view-timeline: --ts-work; }
    #resume      { view-timeline: --ts-resume; }
    #disciplines { view-timeline: --ts-disciplines; }
    #graphics    { view-timeline: --ts-graphics; }
    #contact     { view-timeline: --ts-contact; }
  }

  .panel[data-nav-theme="dark"] {
    background: var(--ink-deep); color: var(--fg-on-dark);
    --fg: var(--fg-on-dark-soft); --fg-strong: var(--fg-on-dark);
    --fg-muted: var(--fg-on-dark-mute); --eyedrop-fg: var(--fg-on-dark-mute);
    --line-col: var(--line-on-dark); --surface: var(--surface-on-dark);
  }

  .hero {
    --fg: var(--fg-on-dark-soft); --fg-strong: var(--fg-on-dark);
    --eyedrop-fg: var(--fg-on-dark-mute);
    /* Cinematic intro: each hero .reveal fades over this duration; reveal.ts
       spaces them 2.9s apart, so the last line settles ~12s after load. */
    --dur-reveal: 3300ms; min-height: 100svh; justify-content: center; align-items: center;
    text-align: center; gap: var(--sp-5);
    padding-top: calc(var(--nav-h) + var(--sp-7)); color: var(--fg-on-dark);
    background: var(--ink-deep); isolation: isolate;
    overflow: clip; /* contain the parallax photo layer so it can't spill onto the next section */
    &::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--scrim); }
    &::after {
      /* Parallax photo layer — pinned to the viewport so the page scrolls over
         it. Pure CSS, works identically in Firefox, Chrome and Safari via
         background-attachment: fixed (no scroll-driven animation needed);
         mobile browsers that ignore `fixed` simply degrade to a static cover. */
      content: ""; position: absolute; inset: 0; z-index: -2;
      background: url("/assets/bg-mountain-dark.jpg") center / cover no-repeat fixed;
    }
    & > * { position: relative; }
    & .eyedrop { color: var(--fg-on-dark-mute); }
    & h1 { color: var(--fg-on-dark); font-size: clamp(2.25rem, 7.5vw, 4.5rem); }
  }

  /* ════════ Hummingbird marks — nav + hero. All bird animation lives here now;
     it used to be split between an inline <svg><style> and this file. ════════ */

  .cb-wing-back, .cb-wing-front, .cb-body,
  .cb-head { transform-box: view-box; will-change: transform; }

  @keyframes cbh-flap-back  { from { transform: rotate(-9deg) translate(2px, 2px) scaleY(.98); }  to { transform: rotate(4.7deg) translate(-1px, -1px) scaleY(1.04); } }
  @keyframes cbh-flap-front { from { transform: rotate(9deg) translate(-1px, 2px) scaleY(.98); }  to { transform: rotate(-5.4deg) translate(2px, -1px) scaleY(1.05); } }
  @keyframes cbh-bob        { 0%, 100% { transform: translateY(0) rotate(2.72deg); } 50% { transform: translateY(-11px) rotate(-4.95deg); } }
  @keyframes cbh-nod        { 0%, 5%, 100% { transform: rotate(0deg) translateY(0); } 8% { transform: rotate(-1.75deg) translateY(0); } 11% { transform: rotate(3.5deg) translateY(1.2px); } 14% { transform: rotate(-1.225deg) translateY(0); } 18% { transform: rotate(0deg) translateY(0); } 60% { transform: rotate(.2deg) translateY(0); } }

  @keyframes hero-bird-draw  { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
  @keyframes hero-bird-fill  { from { fill-opacity: 0; } to { fill-opacity: 1; } }
  @keyframes hero-flap-back  { 0%, 100% { transform: rotate(0deg); } 50% { transform: rotate(7deg) translate(-1px, -1px) scaleY(.95); } }
  @keyframes hero-flap-front { 0%, 100% { transform: rotate(0deg); } 50% { transform: rotate(-6deg) translate(2px, -1px) scaleY(.95); } }
  @keyframes hero-bob        { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }

  @media (prefers-reduced-motion: no-preference) {
    .nav-bird .cb-wing-back  { transform-origin: 132px 169px; animation: cbh-flap-back .28s ease-in-out infinite alternate; }
    .nav-bird .cb-wing-front { transform-origin: 151px 147px; animation: cbh-flap-front .28s ease-in-out infinite alternate; }
    .nav-bird .cb-body       { transform-origin: 147px 212px; animation: cbh-bob 4.5s ease-in-out infinite; }
    .nav-bird .cb-head       { transform-origin: 130px 154px; animation: cbh-nod 8s cubic-bezier(.45, .02, .2, 1) infinite; }
  }

  .hero-bird { width: clamp(5rem, 12vw, 8rem); height: auto; color: var(--fg-on-dark); --hero-intro: 5.6s; }
  .hero-bird path { fill: currentColor; }

  @media (prefers-reduced-motion: no-preference) {
    .hero-bird path {
      stroke: currentColor; stroke-width: 1.6;
      stroke-dasharray: 1; /* paths carry pathLength="1", so 1 == the full outline */
      animation: hero-bird-draw 3.5s var(--ease-out) .4s both, hero-bird-fill 1.7s var(--ease) 3.9s both;
    }
    .hero-bird .cb-wing-back  { transform-origin: 132px 169px; animation: hero-flap-back var(--dur-draw) ease-in-out var(--hero-intro) infinite; }
    .hero-bird .cb-wing-front { transform-origin: 140px 140px; animation: hero-flap-front var(--dur-draw) ease-in-out var(--hero-intro) infinite; }
    .hero-bird .cb-body       { transform-origin: 147px 212px; animation: hero-bob var(--dur-draw) ease-in-out var(--hero-intro) infinite; }
    .hero-bird .cb-head       { transform-origin: 130px 154px; animation: cbh-nod var(--dur-draw) cubic-bezier(.45, .02, .2, 1) var(--hero-intro) infinite; }
  }

  .hero-statement {
    max-width: 36rem; color: var(--fg-on-dark-soft);
    font-family: var(--font-sub); font-weight: 300;
    font-size: clamp(1.125rem, 2.6vw, 1.625rem); letter-spacing: var(--track-tight);
    line-height: var(--lead-snug); text-wrap: balance;
  }

  .hero-foot {
    margin-top: var(--sp-7); display: flex;
    align-items: center; gap: clamp(1rem, 4vw, 2.5rem);
    font-family: var(--font-display); font-size: .625rem;
    letter-spacing: var(--track-wide); text-transform: uppercase;
    color: var(--fg-on-dark-mute);
  }

  .resume-body {
    display: grid; grid-template-columns: minmax(0, 1fr) 17rem;
    gap: clamp(2rem, 5vw, var(--sp-8)); max-width: var(--col-max);
    margin-inline: auto; width: 100%;
  }

  .resume-heading {
    font-size: 1rem; letter-spacing: var(--track-h2);
    padding-bottom: var(--sp-3); border-bottom: 1px solid var(--line-col);
    margin-top: var(--sp-7);
  }

  .resume-main > .timeline { margin-top: var(--sp-5); }

  .timeline {
    display: flex; flex-direction: column;
    & > li { display: grid; grid-template-columns: 9.5rem minmax(0, 1fr); gap: var(--sp-5); }
    & .timeline-dates {
      grid-column: 1; text-align: right; display: flex; flex-direction: column;
      justify-content: space-between; padding-top: .4rem; padding-bottom: var(--sp-7);
    }
    & :is(time, span) {
      font-family: var(--font-body); font-size: .8125rem;
      font-weight: 300; letter-spacing: normal;
      text-transform: none; color: var(--fg-muted);
    }
    & > li > details {
      grid-column: 2; position: relative;
      padding: 0 0 var(--sp-7) var(--sp-6); border-left: 2px solid var(--line-col);
      transition: border-color var(--dur-2) var(--ease);
      &::before {
        content: ""; position: absolute; left: -.5rem; top: .4rem;
        width: .85rem; height: .85rem;
        border-radius: var(--radius-full); background: var(--line-col);
        box-shadow: 0 0 0 .3rem var(--bone);
        transition: background-color var(--dur-2) var(--ease), transform var(--dur-2) var(--ease);
      }
    }
    & > li:last-child > details { padding-bottom: var(--sp-2); }
    & > li.is-active {
      & > details {
        border-left-color: var(--fg-strong);
        &::before { background: var(--fg-strong); transform: scale(1.25); }
      }
      & time { color: var(--fg-strong); }
    }
    & h4 span { display: block; }
  }

  :is(.timeline, .history) h4 {
    font-size: 1.0625rem; letter-spacing: var(--track-tight);
    text-transform: none; font-family: var(--font-sub); font-weight: 500;
  }

  .history {
    display: flex; flex-direction: column; max-width: var(--col-text);
    & > li {
      padding: var(--sp-4) 0; border-top: 1px solid var(--line-col);
      &:last-child { border-bottom: 1px solid var(--line-col); }
    }
  }

  .resume-aside {
    display: flex; flex-direction: column; gap: var(--sp-6); align-self: start;
    position: sticky; top: calc(var(--nav-h) + var(--sp-4));
    & > section { display: flex; flex-direction: column; gap: var(--sp-3); }
  }

  .aside-list {
    display: flex; flex-direction: column; gap: var(--sp-1); color: var(--fg-muted);
    font-size: .9375rem;
    & a:hover { text-decoration: underline; }
  }

  .aside-note { color: var(--fg-muted); font-size: .9375rem; line-height: var(--lead-normal); }

  .contact {
    display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
    align-items: stretch; gap: 0; padding: 0; color: var(--fg-on-dark);
  }

  .contact-info {
    --fg: var(--fg-on-dark-soft); --fg-strong: var(--fg-on-dark);
    --eyedrop-fg: var(--fg-on-dark-mute); display: flex;
    flex-direction: column; gap: var(--sp-4);
    padding: clamp(4rem, 12vh, 8rem) clamp(1.5rem, 6vw, 3.5rem);
    & h2 { color: var(--fg-on-dark); }
    & .ingress { color: var(--fg-on-dark-mute); }
  }

  .contact-list {
    margin-top: var(--sp-5); display: flex; flex-direction: column; gap: var(--sp-3);
    & li {
      display: flex; align-items: center; gap: var(--sp-3); color: var(--fg-on-dark-mute);
      font-size: .9375rem;
    }
    & svg { width: 1.125rem; height: 1.125rem; flex: 0 0 auto; color: var(--fg-on-dark-mute); }
    & a:hover { text-decoration: underline; }
  }

  @media (max-width: 64rem) {
    .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .approach { grid-template-columns: 1fr; gap: var(--sp-6); }
    .resume-body { grid-template-columns: minmax(0, 1fr); }
    .resume-aside { position: static; }
    .contact { grid-template-columns: minmax(0, 1fr); }
    .map { min-height: 18rem; }
  }

  @media (max-width: 40rem) {
    .card-grid, .feature-grid { grid-template-columns: minmax(0, 1fr); }
    .carousel { --controls-bottom: calc(clamp(3rem, 12vh, 5rem) + env(safe-area-inset-bottom, 0px)); }
    #work .slide, #disciplines .slide { --slide-head-clear: 42vh; }
    .panel { --gutter: clamp(1.25rem, 6vw, 2rem); padding-block: clamp(4rem, 11vh, 6rem); }
    /* Timeline: stack the date above the entry in a single column (reset the
       desktop grid-column placement so nothing lands in a phantom 2nd column);
       date left-aligned and indented to sit over the rail. */
    .timeline {
      & > li { grid-template-columns: minmax(0, 1fr); gap: 0; }
      & .timeline-dates {
        flex-direction: row; text-align: left; padding-left: var(--sp-6); gap: var(--sp-2);
        margin-bottom: var(--sp-2);
      }
      & .timeline-dates :first-child::after { content: " – "; }
      & > li > details { grid-column: 1; }
    }
    .nav { gap: var(--sp-3); overflow-x: auto; }
  }
}