/* Zachery Eng Portfolio — shared stylesheet for index.html + every project HTML page. */
  @font-face {
    font-family: "Haffer";
    src: url("uploads/Haffer-Medium.woff2") format("woff2"),
         url("uploads/Haffer-Medium.woff") format("woff");
    font-weight: 400 600;
    font-style: normal;
    font-display: swap;
  }
  :root {
    --bg: #ffffff;
    --bg-soft: #f4f3ef;
    --fg: #111111;
    --muted: #8a8a86;
    --chip-bg: #f1f1ee;
    --chip-fg: #1a1a1a;
    --hairline: #e7e7e3;
    --placeholder-bg: #efefec;
    --placeholder-fg: #9b9b96;
    --accent: #111111;
    --gap-x: 24px;
    --gap-y: 96px;
    --pad: 24px;
    --type: "Haffer", "Neue Haas Grotesk Display Pro", "Helvetica Neue", Helvetica, Arial, sans-serif;
    --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
    --base: 14px;
    --line: 1.45;
    --marquee-dur: 60s;
    --chrome-h: 90px; /* marquee + header height for sticky offsets */

    /* Fluid type — scales linearly between a 1440px and a 1900px viewport,
       then clamps flat outside that range. Expressed in rem so it tracks the
       root size. (100vw - 1440px) / 460 == 1px of headroom per px of viewport
       past 1440, up to 460px of headroom at 1900. */
    --fluid-body: clamp(0.875rem, calc(0.875rem + 5 * (100vw - 1440px) / 460), 1.1875rem); /* 14 → 19px (paragraphs) */
    --fluid-meta: clamp(0.875rem, calc(0.875rem + 2 * (100vw - 1440px) / 460), 1rem);       /* 14 → 16px (meta rows) */
    --fluid-card-title: clamp(0.875rem, calc(0.875rem + 2 * (100vw - 1440px) / 460), 1rem); /* 14 → 16px (card title/client) */
    --fluid-tag: clamp(0.6875rem, calc(0.6875rem + 3 * (100vw - 1440px) / 460), 0.875rem);  /* 11 → 14px (card tags) */
    --fluid-tag-rail: clamp(0.75rem, calc(0.75rem + 2 * (100vw - 1440px) / 460), 0.875rem); /* 12 → 14px (rail tags) */
  }

  html[data-theme="dark"] {
    --bg: #0f0f0e;
    --bg-soft: #1a1a18;
    --fg: #f3f2ed;
    --muted: #7a7a74;
    --chip-bg: #1d1d1b;
    --chip-fg: #e7e6e1;
    --hairline: #232321;
    --placeholder-bg: #1a1a18;
    --placeholder-fg: #5a5a55;
    --accent: #f3f2ed;
  }
  html[data-theme="sand"] {
    --bg: #f1ece2;
    --bg-soft: #e6dfcf;
    --fg: #1d1b14;
    --muted: #837e6e;
    --chip-bg: #e6dfcf;
    --chip-fg: #1d1b14;
    --hairline: #d8d1bf;
    --placeholder-bg: #e6dfcf;
    --placeholder-fg: #9b9684;
    --accent: #1d1b14;
  }

  * { box-sizing: border-box; }
  html, body { margin: 0; padding: 0; background: var(--bg); color: var(--fg); }
  body {
    font-family: var(--type);
    font-size: var(--base);
    line-height: var(--line);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
  }
  a { color: inherit; text-decoration: none; }
  button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }

  /* ── Sticky top chrome (marquee + header) ─────────────────────────── */
  .chrome {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: var(--bg);
  }
  /* #swup is the only Swup-swapped container; the persistent chrome is fixed
     above it, so the page content is offset down by the chrome height. */
  #swup {
    padding-top: var(--chrome-h);
  }

  /* ── Marquee ────────────────────────────────────────────────────────── */
  .marquee {
    overflow: hidden;
    border-bottom: 1px solid var(--hairline);
    height: 36px;
    display: flex;
    align-items: center;
    background: #0f0f0e;
    cursor: pointer;
    text-decoration: none;
  }
  .marquee-track {
    display: flex;
    gap: 28px;
    white-space: nowrap;
    width: max-content;
    animation: marquee var(--marquee-dur) linear infinite;
    will-change: transform;
  }
  .marquee[data-paused="true"] .marquee-track { animation-play-state: paused; }
  .marquee-item {
    font-size: 13px;
    letter-spacing: 0.04em;
    color: #f7f7f5;
    user-select: none;
  }
  .marquee-dot { color: #f7f7f5; font-size: 13px; }
  @keyframes marquee {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
  }

  /* ── Header ────────────────────────────────────────────────────────── */
  .header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 11px var(--pad);
    height: auto;
    background: var(--bg);
    color: var(--fg);
  }
  .header a, .header button { font-size: var(--fluid-body); letter-spacing: 0.01em; color: inherit; }
  .header .right { display: flex; gap: 18px; align-items: center; }
  .info-link {
    position: relative;
    padding-bottom: 1px;
  }
  .info-link::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: -2px;
    height: 1px;
    background: currentColor;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .25s ease;
  }
  .info-link:hover::after { transform: scaleX(1); }

  /* ── Intro ─────────────────────────────────────────────────────────── */
  /* Intro fills the full 8-col grid up to a 1440-cap reading width. */
  .intro {
    padding: 20px var(--pad) 0;
    margin-bottom: 80px;
    max-width: none;
    min-height: clamp(280px, 40vh, 460px);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    overflow: hidden;
  }
  @media (max-width: 1023px) {
    .intro {
      min-height: clamp(220px, 32vh, 360px);
    }
  }
  @media (max-width: 639px) {
    .intro {
      min-height: 0;
      padding-bottom: 0;
      margin-bottom: 56px;
    }
  }
  .intro p { flex: 0 0 auto; }
  .bio {
    font-size: clamp(28px, 2.6vw, 40px);
    line-height: 1.15;
    letter-spacing: -0.015em;
    font-weight: 500;
    margin: 0;
    text-wrap: pretty;
  }
  .bio-trigger {
    padding: 1px 8px;
    border-radius: 4px;
    -webkit-box-decoration-break: clone;
            box-decoration-break: clone;
    background: var(--fg);
    color: var(--bg);
    cursor: pointer;
    user-select: none;
    transition: background-color .25s ease;
  }
  .bio-trigger:hover { background: #333; }
  .bio-link {
    color: inherit;
    text-decoration: underline;
    text-decoration-thickness: 0.11em;
    text-underline-offset: 0.16em;
    cursor: pointer;
  }
  .bio-text {
    background-color: transparent;
    transition: background-color .55s cubic-bezier(.2, .7, .2, 1);
    -webkit-box-decoration-break: clone;
            box-decoration-break: clone;
  }
  .bio-text[data-highlighted="true"] {
    background-color: rgba(17, 17, 17, 0.08);
    animation: bioReveal .55s cubic-bezier(.2, .7, .2, 1);
  }
  html[data-theme="dark"] .bio-text[data-highlighted="true"] {
    background-color: rgba(243, 242, 237, 0.10);
  }
  html[data-theme="sand"] .bio-text[data-highlighted="true"] {
    background-color: rgba(29, 27, 20, 0.10);
  }
  @keyframes bioReveal {
    from { background-color: rgba(17, 17, 17, 0.22); }
    to   { background-color: rgba(17, 17, 17, 0.08); }
  }
  /* (legacy .intro p / .intro .signature rules removed; .bio governs type) */

  /* ── Filter bar ────────────────────────────────────────────────────── */
  .filter-bar {
    padding: 0 var(--pad) 24px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
  }
  .filter-bar .label {
    font-size: 11px;
    color: var(--muted);
    margin-right: 8px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
  }
  .filter-chip {
    font-size: 12px;
    line-height: 1;
    padding: 5px 10px;
    border-radius: 999px;
    background: var(--chip-bg);
    color: var(--chip-fg);
    border: 1px solid transparent;
    transition: background .15s ease, color .15s ease, border-color .15s ease;
    cursor: pointer;
  }
  .filter-chip:hover { background: transparent; border-color: var(--hairline); }
  .filter-chip[data-active="true"] { background: var(--fg); color: var(--bg); }
  .filter-chip .count { margin-left: 6px; opacity: .55; font-variant-numeric: tabular-nums; }
  .filter-clear { font-size: 11px; color: var(--muted); margin-left: 6px; text-decoration: underline; text-underline-offset: 3px; }

  /* ── Home grid ─────────────────────────────────────────────────────── */
  .work { padding: 8px var(--pad) 80px; }
  .grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: var(--gap-y) var(--gap-x);
    align-items: start;
  }
  @media (max-width: 1023px) {
    .grid { grid-template-columns: repeat(6, 1fr); }
    :root { --gap-y: 72px; }
  }
  @media (max-width: 639px) {
    :root { --pad: 16px; --gap-x: 16px; --gap-y: 56px; }
    .grid { grid-template-columns: repeat(4, 1fr); }
  }

  .card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: opacity .3s ease, filter .3s ease;
    text-decoration: none;
    color: inherit;
  }
  .card[data-dim="true"] { opacity: 0.25; filter: saturate(0.4); pointer-events: none; }

  .card .tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    overflow: hidden;
  }
  .card .tags-inner {
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    width: 100%;
    min-width: 0;
  }
  .card .tag {
    font-size: var(--fluid-body);
    line-height: 1;
    padding: 5px 14px;
    border-radius: 999px;
    background: var(--bg);
    color: var(--fg);
    border: 2px solid var(--fg);
    user-select: none;
    white-space: nowrap;
    flex: 0 0 auto;
    max-width: 100%;
  }
  .card .tag.tag-clip {
    flex: 0 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .card .frame {
    width: 100%;
    background: transparent;
    overflow: hidden;
    position: relative;
    border-radius: 5px;
  }
  .card[data-empty="true"] .frame { background: var(--placeholder-bg); }
  .card .frame > .frame-fill { position: absolute; inset: 0; }
  .card .frame :is(image-slot, img, video) {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }
  .card .frame :is(image-slot, img, video).frame-secondary {
    clip-path: inset(0 100% 0 0);
    transform: scale(1.2);
    transform-origin: center;
    transition:
      clip-path 1.1s cubic-bezier(.2, .7, .2, 1),
      transform 1.1s cubic-bezier(.2, .7, .2, 1);
    z-index: 2;
  }
  .card:hover .frame :is(image-slot, img, video).frame-secondary {
    clip-path: inset(0 0 0 0);
    transform: scale(1);
  }

  .card .meta { margin-top: 4px; overflow: hidden; }
  .card .title { font-size: var(--fluid-body); line-height: 1.3; margin: 0; }
  .card .client { font-size: var(--fluid-card-title); line-height: 1.3; margin: 0; color: var(--muted); }

  .card[data-empty="true"] .frame .empty-mark {
    position: absolute; inset: 0;
    display: grid; place-items: center;
    font-size: 11px; color: var(--placeholder-fg);
    letter-spacing: 0.08em; text-transform: uppercase;
  }

  /* ── Project page ──────────────────────────────────────────────────── */
  .project {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 0 var(--gap-x);
    padding: 24px var(--pad) 80px;
  }
  .project-left {
    grid-column: 1 / span 5;
    display: flex;
    flex-direction: column;
    gap: var(--gap-x);
  }
  .project-rail {
    grid-column: 6 / span 3;
    align-self: start;
    position: sticky;
    /* Pinned to the top of the column. Natural height (no min-height) so it
       stays put while scrolling and does not lurch when the page bottom is
       reached. */
    top: calc(var(--chrome-h) + 24px);
    padding: 4px 24px 0 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    /* Fill most of the sticky viewport so the "Next" row (margin-top:auto)
       pins to a consistent spot on every project page — but stop short of the
       floor so it sits between the copy and the bottom, not jammed against it. */
    min-height: calc(100vh - var(--chrome-h) - 200px);
  }
  /* "Next" pinned to the bottom of the rail so it lands in the same place
     from page to page regardless of summary/meta length. */
  .rail-row--next { margin-top: auto; }
  /* Each rail row reveals from below via a mask, staggered by source order */
  .rail-row { overflow: hidden; }
  .rail-row-inner {
    transform: translateY(100%);
    transition: transform 1100ms cubic-bezier(.2, .7, .2, 1);
  }
  .project-rail[data-revealed="true"] .rail-row .rail-row-inner { transform: translateY(0); }
  .project-rail[data-revealed="true"] .rail-row:nth-child(1) .rail-row-inner { transition-delay: 0ms; }
  .project-rail[data-revealed="true"] .rail-row:nth-child(2) .rail-row-inner { transition-delay: 90ms; }
  .project-rail[data-revealed="true"] .rail-row:nth-child(3) .rail-row-inner { transition-delay: 180ms; }
  .project-rail[data-revealed="true"] .rail-row:nth-child(4) .rail-row-inner { transition-delay: 280ms; }
  .project-rail[data-revealed="true"] .rail-row:nth-child(5) .rail-row-inner { transition-delay: 360ms; }
  .project-rail[data-revealed="true"] .rail-row:nth-child(6) .rail-row-inner { transition-delay: 460ms; }
  .project-left .gallery-row { width: 100%; }
  .project-left .gallery-row.full > .gallery-item { width: 100%; }
  .project-left .gallery-row.pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--gap-x);
  }
  .gallery-item {
    position: relative;
    background: transparent;
    overflow: hidden;
    border-radius: 5px;
  }
  /* The gallery column rises as one block on entry — a single transform on
     the whole section, instead of each image clipping/sliding in its own
     frame (which read as flicker). */
  .project-left {
    transform: translateY(48px);
    opacity: 0;
    transition: transform 900ms cubic-bezier(.2, .7, .2, 1), opacity 700ms ease;
    will-change: transform, opacity;
  }
  .project-left[data-revealed="true"] {
    transform: translateY(0);
    opacity: 1;
  }
  .gallery-item .gi-fill {
    position: absolute;
    inset: 0;
  }
  /* The slot lives inside .gi-fill (the reveal mask), so size it as a
     descendant — a direct-child selector misses it and the slot collapses
     to its intrinsic 240×160. Fill the whole frame. */
  .gallery-item image-slot { width: 100%; height: 100%; display: block; }
  .gallery-item img,
  .gallery-item video {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
  }
  /* Items flagged fit="contain" show the whole image, letterboxed against the
     gallery-item's background colour (set per item to match the artwork). */
  .gallery-item[data-fit="contain"] img,
  .gallery-item[data-fit="contain"] video { object-fit: contain; }
  /* Carousel: horizontal scroll-snap strip inside the reveal mask */
  .gallery-carousel .carousel-track {
    position: absolute;
    inset: 0;
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .gallery-carousel .carousel-track::-webkit-scrollbar { display: none; }
  .gallery-carousel .carousel-slide {
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
    scroll-snap-align: start;
  }
  .gallery-carousel .carousel-dots {
    position: absolute;
    left: 0; right: 0; bottom: 14px;
    display: flex;
    gap: 8px;
    justify-content: center;
    z-index: 3;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.35));
  }
  .gallery-carousel .carousel-dot {
    width: 7px; height: 7px;
    padding: 0;
    border: none;
    border-radius: 999px;
    background: rgba(255,255,255,0.55);
    cursor: pointer;
    transition: background .25s ease, transform .25s ease;
  }
  .gallery-carousel .carousel-dot[data-active="true"] {
    background: #fff;
    transform: scale(1.3);
  }
  .gallery-item .gi-cta {
    position: absolute;
    top: 12px; right: 12px;
    background: var(--bg);
    color: var(--fg);
    border-radius: 999px;
    padding: 7px 12px;
    font-size: 11px;
    letter-spacing: 0.02em;
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity .25s ease, transform .25s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    z-index: 2;
    cursor: pointer;
    display: inline-flex; align-items: center; gap: 6px;
  }
  .gallery-item:hover .gi-cta { opacity: 1; transform: none; }
  .gallery-item .gi-cta:hover { background: var(--fg); color: var(--bg); }
  .gallery-item .gi-caption {
    position: absolute;
    left: 12px; bottom: 12px;
    background: rgba(255,255,255,0.94);
    color: #111;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 11px;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity .25s ease, transform .25s ease;
    z-index: 2;
    max-width: 60%;
  }
  .gallery-item:hover .gi-caption { opacity: 1; transform: none; }

  .project-rail h1 {
    font-size: clamp(28px, 2.6vw, 40px);
    line-height: 1.1;
    margin: 0;
    font-weight: 500;
    letter-spacing: -0.015em;
  }
  .project-rail .tags { display: flex; gap: 6px; flex-wrap: wrap; }
  .project-rail .tag {
    font-size: var(--fluid-body);
    line-height: 1;
    padding: 5px 14px;
    border-radius: 999px;
    background: var(--bg);
    color: var(--fg);
    border: 2px solid var(--fg);
  }
  .project-rail .summary {
    font-size: var(--fluid-body);
    line-height: 1.55;
    color: var(--fg);
    margin: 0;
    text-wrap: pretty;
    white-space: pre-line;
  }
  /* Simple rows separated by hairlines: [label] ... [value]. */
  .project-meta {
    display: flex;
    flex-direction: column;
    margin-top: 4px;
  }
  .project-meta .meta-row {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: start;
    gap: 24px;
    padding: 20px 0;
    border-top: 1px solid var(--hairline);
    font-size: var(--fluid-body);
    line-height: 1.45;
  }
  .project-meta .meta-row:last-child { border-bottom: 1px solid var(--hairline); }
  .project-meta .meta-row .k { color: var(--fg); font-weight: 500; }
  .project-meta .meta-row .v {
    color: var(--muted);
    text-align: right;
    display: flex;
    flex-direction: column;
    gap: 4px;
  }
  .project-meta .meta-row .v > span { display: block; }

  .project-next { margin-top: 0; }
  .project-next a {
    display: block;
    font-size: clamp(28px, 2.6vw, 40px);
    font-weight: 500;
    letter-spacing: -0.015em;
    line-height: 1.1;
    color: var(--fg);
  }
  .project-next .next-label,
  .project-next .next-title { display: block; color: var(--fg); }

  /* Tablet / mobile sign-off: the "Next project" link relocates to the very
     bottom of the page, after all the gallery images, as a hand-off. */
  .project-next-signoff {
    overflow: hidden;
    margin-top: 24px;
    padding-top: 24px;
  }
  .project-next-signoff[data-revealed="true"] .rail-row-inner { transform: translateY(0); }
  .project-next-signoff .project-next { margin-top: 0; }

  .site-nav {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 40;
    display: flex;
    gap: 6px;
    flex-wrap: nowrap;
  }
  .site-nav .nav-pill {
    background: #0f0f0e;
    color: #f3f2ed;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: opacity .15s ease, transform .15s ease;
    white-space: nowrap;
  }
  .site-nav .nav-pill:hover { opacity: 0.85; }
  .site-nav .nav-pill:active { transform: translateY(1px); }
  .site-nav .nav-pill .key {
    font-size: 0.78em;
    opacity: 0.55;
    letter-spacing: 0.04em;
  }
  @media (max-width: 639px) {
    .site-nav {
      right: auto;
      left: 50%;
      transform: translateX(-50%);
      bottom: 16px;
    }
  }

  /* Project page responsive */
  @media (max-width: 1023px) {
    .project { grid-template-columns: repeat(6, 1fr); }
    .project-left { grid-column: 1 / span 6; order: 2; }
    .project-rail {
      grid-column: 1 / span 6;
      padding: 24px 0 56px;
      min-height: 0;
      position: static;
      top: auto;
      order: 1;
    }
  }
  @media (max-width: 639px) {
    .project { grid-template-columns: repeat(4, 1fr); }
    .project-left { grid-column: 1 / span 4; }
    .project-rail { grid-column: 1 / span 4; padding: 24px 0 44px; min-height: 0; position: static; top: auto; order: 1; }
    .project-left .gallery-row.pair { grid-template-columns: 1fr; }
  }

  /* Image preview overlay removed (lightbox disabled) */
  @keyframes fade { from { opacity: 0; } to { opacity: 1; } }

  /* Info drawer (slides in from right over a dimmed scrim) */
  .info-scrim {
    position: fixed;
    inset: 0;
    background: rgba(17, 17, 17, 0.55);
    z-index: 200;
    opacity: 0;
    pointer-events: none;
    transition: opacity .45s cubic-bezier(.2, .7, .2, 1);
  }
  body[data-info-open="true"] .info-scrim {
    opacity: 1;
    pointer-events: auto;
  }
  .info-panel {
    /* Dark, inset drawer with rounded corners. Slides in from the right.
       Translation includes an extra 24px so the panel is fully off-screen
       when closed (no leaking shadow / edge). */
    position: fixed;
    top: 16px;
    right: 16px;
    bottom: 16px;
    width: min(540px, calc(100vw - 32px));
    background: #1d1d1b;
    color: #f3f2ed;
    border-radius: 12px;
    z-index: 220;
    overflow: hidden;
    transform: translateX(calc(100% + 24px));
    transition: transform .55s cubic-bezier(.2, .7, .2, 1);
  }
  body[data-info-open="true"] .info-panel { transform: translateX(0); }
  /* From ~1630px up, hold the same proportional width the drawer has at
     1440px (≈37.5% of viewport) so it doesn't read narrow on wide screens. */
  @media (min-width: 1630px) {
    .info-panel { width: min(30vw, 600px); }
  }
  .info-panel .info-inner {
    height: 100%;
    box-sizing: border-box;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: #3a3a37 transparent;
    padding: 64px 32px 48px;
  }
  /* "Information" close-toggle in top-right of the drawer — aligned with
     the page header button so it appears static when the drawer arrives. */
  /* Close control: an X inside a circle that spins a quarter turn on hover. */
  .info-close {
    position: absolute;
    top: 24px;
    right: 24px;
    width: 46px;
    height: 46px;
    padding: 0;
    background: #1d1d1b;
    border: 1px solid rgba(243, 242, 237, 0.3);
    border-radius: 50%;
    cursor: pointer;
    z-index: 1;
    transition: background-color .3s ease, border-color .3s ease;
  }
  .info-close:hover { background: #2a2a27; border-color: rgba(243, 242, 237, 0.55); }
  .info-close::before,
  .info-close::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 18px;
    height: 1.5px;
    background: #f3f2ed;
    border-radius: 2px;
    transition: transform .4s cubic-bezier(.2, .7, .2, 1);
  }
  .info-close::before { transform: translate(-50%, -50%) rotate(45deg); }
  .info-close::after  { transform: translate(-50%, -50%) rotate(-45deg); }
  .info-close:hover::before { transform: translate(-50%, -50%) rotate(135deg); }
  .info-close:hover::after  { transform: translate(-50%, -50%) rotate(45deg); }
  .info-title {
    font-size: clamp(34px, 3.2vw, 52px);
    line-height: 1.05;
    font-weight: 500;
    letter-spacing: -0.02em;
    color: #f3f2ed;
    margin: 0 0 48px;
  }
  .info-section {
    display: grid;
    grid-template-columns: 100px 1fr;
    gap: 32px;
    align-items: start;
    padding: 28px 0;
    border-top: 1px solid #2c2c29;
  }
  .info-section:first-of-type { border-top: 0; padding-top: 4px; }
  @media (max-width: 639px) { .info-section { grid-template-columns: 1fr; gap: 12px; } }
  .info-section .k {
    font-size: var(--fluid-body);
    font-weight: 500;
    color: #f3f2ed;
    letter-spacing: -0.005em;
  }
  .info-section .v { font-size: var(--fluid-body); line-height: 1.55; color: #8a8a86; }

  .info-row { padding: 2px 0; }
  .info-row + .info-row { margin-top: 10px; }
  .info-row-title {
    font-size: var(--fluid-body);
    color: #f3f2ed;
    font-weight: 500;
    margin-bottom: 1px;
  }
  .info-row-value {
    display: block;
    font-size: var(--fluid-body);
    color: #8a8a86;
    text-decoration: none;
  }
  .info-row-value:hover { color: #f3f2ed; }

  .info-pill {
    display: inline-block;
    padding: 8px 18px;
    border-radius: 999px;
    background: #2c2c29;
    color: #f3f2ed;
    font-size: var(--fluid-body);
    text-decoration: none;
    transition: background .25s cubic-bezier(.2, .7, .2, 1);
  }
  .info-pill:hover { background: #3a3a37; }

  .info-colophon {
    margin: 0;
    color: #8a8a86;
    font-size: var(--fluid-body);
    line-height: 1.55;
    max-width: 38ch;
  }

  /* ── Project credits (dark card, styled after the Information drawer) ──
     Closes out each project page: muted role labels on the left, the people
     worked with in white on the right. Reveals on scroll like .project-left. */
  .project-credits-wrap {
    padding: 0 var(--pad) 96px;
  }
  .project-credits {
    background: #1d1d1b;
    color: #f3f2ed;
    border-radius: 12px;
    padding: clamp(40px, 4.5vw, 72px) clamp(28px, 5vw, 80px);
    transform: translateY(48px);
    opacity: 0;
    transition: transform 1100ms cubic-bezier(.2, .7, .2, 1), opacity 1100ms cubic-bezier(.2, .7, .2, 1);
    will-change: transform, opacity;
  }
  .project-credits[data-revealed="true"] { transform: translateY(0); opacity: 1; }
  .credits-head {
    font-size: var(--fluid-body);
    font-weight: 500;
    color: #f3f2ed;
    letter-spacing: -0.01em;
    padding-bottom: 28px;
    margin-bottom: 28px;
    border-bottom: 1px solid #2c2c29;
  }
  .credits-grid {
    display: flex;
    flex-direction: column;
    gap: 18px;
  }
  .credits-row {
    display: grid;
    grid-template-columns: minmax(160px, 1fr) 1.5fr;
    gap: 32px;
    align-items: baseline;
  }
  .credits-role {
    font-size: var(--fluid-body);
    line-height: 1.4;
    color: #8a8a86;
    letter-spacing: -0.005em;
  }
  .credits-name {
    font-size: var(--fluid-body);
    line-height: 1.4;
    color: #f3f2ed;
    font-weight: 500;
  }
  @media (max-width: 639px) {
    .credits-row { grid-template-columns: 1fr; gap: 4px; }
  }
  /* Tablet / mobile: tighten last-image→credits to the image-to-image gap,
     and halve the credits→next-project spacing. */
  @media (max-width: 1023px) {
    .project { padding-bottom: var(--gap-x); }
    .project-credits-wrap { padding-bottom: 24px; }
  }
  .credits-note {
    margin-top: 24px;
    font-size: var(--fluid-body);
    line-height: 1.5;
    color: #8a8a86;
  }
  .project-next-signoff-wrap {
    padding: 0 var(--pad) 96px;
  }
  @media (max-width: 639px) {
    .project-next-signoff { margin-top: 8px; padding-top: 8px; }
    .project-next-signoff-wrap { padding-bottom: 56px; }
    .bio { font-size: clamp(18px, 6.5vw, 26px) !important; }
  }
  @media (max-width: 1023px) {
    .project-meta .meta-row { font-size: var(--base); }
  }

  /* ── Footer ────────────────────────────────────────────────────────── */
  .footer {
    padding: 24px var(--pad);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--muted);
    flex-wrap: wrap;
    gap: 12px;
  }
  .footer a:hover { color: var(--fg); }

  body[data-overlay="true"] { overflow: hidden; }

  /* ── Reveal-on-scroll ───────────────────────────────────────────────
     Each container has overflow:hidden + an inner element that starts
     translated 100% below its container, then slides up to translateY(0)
     once the container is intersected by the viewport. No fade, solid —
     the overflow:hidden parent provides the wipe. On a card, the image
     reveals first; tags + meta wait their turn via transition-delay. */
  .reveal-ease { --reveal-dur: 1100ms; --reveal-ease: cubic-bezier(.2, .7, .2, 1); }

  .intro-inner {
    flex: 1 1 auto;
    transform: translateY(100%);
    transition: transform 1100ms cubic-bezier(.2, .7, .2, 1);
  }
  .intro[data-revealed="true"] .intro-inner { transform: translateY(0); }

  /* Card image reveal — cascades left-to-right via --cascade-col (1-8). */
  .card .frame-fill {
    position: absolute;
    inset: 0;
    transform: translateY(100%);
    transition: transform 950ms cubic-bezier(.2, .7, .2, 1);
    transition-delay: calc(var(--cascade-col, 1) * 55ms);
  }
  .card[data-revealed="true"] .frame-fill { transform: translateY(0); }

  .card .tags-inner,
  .card .meta-inner {
    transform: translateY(100%);
    transition: transform 700ms cubic-bezier(.2, .7, .2, 1);
  }
  .card[data-revealed="true"] .tags-inner {
    transform: translateY(0);
    transition-delay: calc(var(--cascade-col, 1) * 55ms + 540ms);
  }
  .card[data-revealed="true"] .meta-inner {
    transform: translateY(0);
    transition-delay: calc(var(--cascade-col, 1) * 55ms + 660ms);
  }

  /* Page exit: when [data-phase="out"], every reveal target slides back
     down uniformly at 700ms with no per-element delay so the swap into
     the new route doesn't have stragglers. The data-revealed attribute
     also flips to false during exit (driven by the React phase
     context), so the base translateY(100%) rule retakes — these rules
     just normalize timing. */
  body[data-phase="out"] .intro-inner,
  body[data-phase="out"] .frame-fill,
  body[data-phase="out"] .tags-inner,
  body[data-phase="out"] .meta-inner,
  body[data-phase="out"] .rail-row-inner,
  body[data-phase="out"] .project-left,
  body[data-phase="out"] .project-credits,
  body[data-phase="out"] .gi-fill {
    transition-delay: 0ms !important;
    transition-duration: 700ms !important;
  }

  /* ── Custom cursor ──────────────────────────────────────────────────────
     Black dot that follows the pointer and morphs into a labelled pill over
     [data-cursor-label] targets. Fine-pointer only (set via data-custom-cursor
     on <body>); touch keeps the native cursor. */
  .cursor {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 100000;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    min-width: 14px;
    height: 14px;
    overflow: hidden;
    background: #0b0b0b;
    color: #fff;
    border-radius: 999px;
    transition: height .34s cubic-bezier(.2, .7, .2, 1), min-width .34s cubic-bezier(.2, .7, .2, 1), background-color .34s ease;
    will-change: transform;
  }
  .cursor[data-mode="pill"] {
    min-width: 116px;
    height: 116px;
    background: #0b0b0b;
    color: #fff;
  }
  .cursor[data-mode="expand"] {
    min-width: 52px;
    height: 52px;
    background: #0b0b0b;
  }
  /* Inverted: over the dark Information drawer the dot flips to light so it
     reads against #1d1d1b, keeping the same expand/pill motion. */
  .cursor[data-invert="true"] {
    background: #f3f2ed;
    color: #0b0b0b;
  }
  .cursor .cursor-label {
    max-width: 0;
    padding: 0;
    overflow: hidden;
    white-space: nowrap;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.04em;
    line-height: 1;
    text-transform: uppercase;
    opacity: 0;
    /* Exit: width + height shrink together so it stays a circle. */
    transition:
      max-width .34s cubic-bezier(.2, .7, .2, 1) 0s,
      padding .34s cubic-bezier(.2, .7, .2, 1) 0s,
      opacity .14s ease 0s;
  }
  .cursor[data-mode="pill"] .cursor-label {
    max-width: 104px;
    padding: 0 10px;
    opacity: 1;
    white-space: nowrap;
    text-align: center;
    font-size: 13px;
    letter-spacing: 0.04em;
    line-height: 1.1;
    /* Enter: width grows in sync with height, then the text fades in. */
    transition:
      max-width .34s cubic-bezier(.2, .7, .2, 1) 0s,
      padding .34s cubic-bezier(.2, .7, .2, 1) 0s,
      opacity .24s ease .18s;
  }
  @media (prefers-reduced-motion: reduce) {
    .cursor { transition: none; }
    .cursor .cursor-label { transition: opacity .2s ease; }
  }

