/* ==========================================================================
   Manikant Mudgil — static portfolio
   One stylesheet. Sections: tokens · base · links · navigation · home ·
   cards · case study · about · cursor · intro · reveal card · transitions.
   Desktop frame (>768px): the window never scrolls; only content panes do.
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
  --ink: #262626;
  --muted: #737373;
  --line: #dedede;
  --line-soft: #ededed;
  --canvas: #f2f2f2;
  --paper: #ffffff;
  /* One accent, from the V1/V2 brand: #465fff for fills, #4058ed for text (AA on white). */
  --accent: #465fff;
  --accent-text: #4058ed;
  --accent-soft: #f4f6ff;
  --accent-tint: rgb(70 95 255 / .16);
  --font-sans: "Hanken Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease-out: cubic-bezier(.22, 1, .36, 1);

  --fs-page: clamp(2rem, calc(1.6892265193rem + 1.3259668508vw), 2.75rem);
  --fs-section: clamp(1.5rem, calc(1.3964088398rem + .4419889503vw), 1.75rem);
  --fs-sub: 1.25rem;
  --fs-body: 1rem;
  --fs-small: .875rem;
  --fs-meta: .75rem;
  --fs-label: .75rem; /* uppercase labels */

  --frame-max: 1600px;
  --edge: 28px;
  --gap: 24px;
  --nav-h: 88px;
  --radius: 8px;

  color: var(--ink);
  background: var(--paper);
  font-family: var(--font-sans);
  font-size: 100%;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; font-style: normal; }
body { margin: 0; background: var(--paper); font-size: var(--fs-body); font-weight: 400; line-height: 1.7; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
strong, b { font-weight: 600; }
[hidden] { display: none !important; }
img, video { -webkit-user-drag: none; user-select: none; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 2px; }
::selection { background: var(--accent-tint); color: var(--ink); }

/* Metadata: tags, labels, counters, years, fact names. Same family, aligned numerals. */
.tag, .eyebrow, .gallery-count, .iter-count, .zoom-count, .facts dt, .facts-row dt, .tldr dt,
.fig-label, .slide-label, .status, .note span, .job time, .portrait figcaption, .iter-result span, .intro-skip {
  font-variant-numeric: tabular-nums;
}

h1, .t-page { font-size: var(--fs-page); font-weight: 500; line-height: 1.15; letter-spacing: -.035em; overflow-wrap: anywhere; }
h2, .t-section { font-size: var(--fs-section); font-weight: 500; line-height: 1.25; letter-spacing: -.025em; overflow-wrap: anywhere; }
h3, h4, .t-sub { font-size: var(--fs-sub); font-weight: 500; line-height: 1.3; letter-spacing: -.015em; overflow-wrap: anywhere; }
.t-small { font-size: var(--fs-small); line-height: 1.5; }
.t-meta { font-size: var(--fs-meta); line-height: 1.5; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip { position: fixed; left: 20px; top: -100px; z-index: 100; background: var(--paper); padding: 12px; }
.skip:focus { top: 10px; }

/* Scrolling stays available everywhere; scrollbar chrome never shows. */
html, body, body * { scrollbar-width: none !important; }
html::-webkit-scrollbar, body::-webkit-scrollbar, body *::-webkit-scrollbar { display: none; width: 0; height: 0; }

/* Shared 1600px frame with a 28px minimum edge. */
.frame { max-width: var(--frame-max); margin-inline: max(var(--edge), calc((100vw - var(--frame-max)) / 2)); }

/* ---------- Links ---------- */
/* A rolling link: the label slides up and an identical copy follows it. */
a.roll { color: var(--muted); max-width: 100%; }
.roll-window { display: inline-grid; overflow: hidden; vertical-align: bottom; max-width: 100%; }
.roll-window > span { grid-area: 1 / 1; min-width: 0; transition: transform 360ms var(--ease-out); }
.roll-window > span:last-child { transform: translateY(100%); }
a.roll:focus-visible { color: var(--ink); }
a.roll:focus-visible .roll-window > span:first-child { transform: translateY(-100%); }
a.roll:focus-visible .roll-window > span:last-child { transform: translateY(0); }
.arrow { display: inline-block; width: 1em; height: 1em; vertical-align: -.125em; flex-shrink: 0; }
.ext { white-space: nowrap; }
.new-tab { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Inline prose links (and the name easter egg) use a quiet underline. */
:is(a, button).inline { color: inherit; text-decoration: underline; text-decoration-color: #b8b8b8; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.inline > .ext { display: none; }
:is(a, button).inline:focus-visible { color: var(--ink); text-decoration-color: currentColor; }

@media (hover: hover) {
  a.roll:hover { color: var(--ink); }
  a.roll:hover .roll-window > span:first-child { transform: translateY(-100%); }
  a.roll:hover .roll-window > span:last-child { transform: translateY(0); }
  :is(a, button).inline:hover { color: var(--accent-text); text-decoration-color: currentColor; }
}
@media (prefers-reduced-motion: reduce), (hover: none) {
  .roll-window > span { transition: none; }
  .roll-window > span:last-child { display: none; }
  a.roll:is(:hover, :focus-visible) .roll-window > span:first-child { transform: none; }
}

/* ---------- Navigation ---------- */
.topbar {
  min-height: var(--nav-h);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 40px;
  font-size: var(--fs-small);
  line-height: 1.5;
}
.topbar a { color: var(--muted); }
.topbar a:hover, .topbar a[aria-current="page"], .topbar a:focus-visible { color: var(--ink); }
.topbar .brand { justify-self: start; color: var(--ink); font-weight: 500; white-space: nowrap; }
.topbar-links { display: flex; gap: 32px; align-items: center; justify-content: center; }
.topbar-links a { padding-block: 12px; }
.menu-toggle { display: none; }

@media (max-width: 768px) {
  .topbar { margin-inline: 22px; position: relative; z-index: 100; padding-block: 16px; gap: 0 12px; }
  .topbar-links { justify-content: flex-end; gap: 8px; }
  .topbar-links a { display: flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: 12px 8px; }
  .topbar.has-menu .brand { position: relative; z-index: 2; }
  .topbar.has-menu .menu-toggle {
    position: relative; z-index: 2;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
    width: 44px; height: 44px; padding: 10px; border: 0; background: transparent; color: var(--ink); cursor: pointer;
  }
  .menu-toggle span { width: 20px; height: 1.5px; background: currentColor; transition: transform 280ms var(--ease-out), opacity 180ms ease; }
  .menu-open .menu-toggle span:first-child { transform: translateY(6.5px) rotate(45deg); }
  .menu-open .menu-toggle span:nth-child(2) { opacity: 0; }
  .menu-open .menu-toggle span:last-child { transform: translateY(-6.5px) rotate(-45deg); }
  .topbar.has-menu .topbar-links {
    position: absolute; top: 100%; left: -22px; right: -22px; z-index: 1;
    flex-direction: column; align-items: center; justify-content: center; gap: 16px;
    padding: 32px 22px 40px; max-height: calc(100dvh - var(--nav-h));
    background: var(--paper); overflow-y: auto; overscroll-behavior: contain;
    box-shadow: 0 16px 24px -24px rgb(0 0 0 / .2);
  }
  .topbar.has-menu .topbar-links a { padding: 8px 16px; min-height: 44px; font-size: var(--fs-body); font-weight: 500; line-height: 1.5; }
}
@media (max-width: 360px) {
  .topbar { margin-inline: 16px; }
  .topbar.has-menu .topbar-links { left: -16px; right: -16px; }
}
@media (prefers-reduced-motion: reduce) { .menu-toggle span { transition: none; } }

/* ---------- Shared page grid (desktop) ---------- */
@media (min-width: 769px) {
  body.page-home, body.page-about, body.page-case { height: 100dvh; overflow: hidden; }
  .grid12 { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--gap); }
  .aside { grid-column: 1 / span 3; grid-row: 1; }
  .pane { grid-column: 4 / -1; grid-row: 1; }
}
@media (min-width: 769px) and (max-width: 1024px) {
  .aside { grid-column: 1 / span 4; }
  .pane { grid-column: 5 / -1; }
}

/* Contact block: links first, then a quiet credit line. */
.contact { display: flex; flex-direction: column; gap: 16px; font-size: var(--fs-small); line-height: 1.5; }
.contact nav { order: -1; display: flex; flex-wrap: wrap; gap: 20px; align-items: start; }
.contact p { margin: 0; color: var(--muted); }
.contact .credit { font-size: var(--fs-meta); }

/* ---------- Home ---------- */
.home-intro { padding: 0 0 24px; }
.home-intro h1 { margin: 0 0 24px; max-width: 100%; text-wrap: balance; }
/* The headline scales with the sidebar, not the window: at 1440 the sidebar is 328px and
   the headline 44px; narrower laptop sidebars keep that proportion instead of breaking ragged. */
.home-profile { container-type: inline-size; }
.home-intro h1 { font-size: min(var(--fs-page), 13.4cqi); }
.home-intro p { margin: 0; color: var(--muted); }
.home-intro p + p { margin-top: 14px; }
.home .contact { padding: 28px 0 32px; }
#work:focus { outline: none; }

@media (min-width: 769px) {
  .home { height: calc(100dvh - var(--nav-h)); padding: 40px 0 24px; overflow: hidden; align-items: stretch; }
  .home-profile { display: flex; flex-direction: column; align-self: stretch; min-width: 0; height: 100%; min-height: 0; overflow-y: auto; }
  .home .contact { margin: auto 0 0; flex-shrink: 0; }
  .home #work { min-width: 0; height: 100%; overflow-y: auto; overscroll-behavior-y: contain; }
}
@media (max-width: 768px) {
  .home { display: flex; flex-direction: column; margin-inline: 22px; padding-top: 36px; }
  .home-profile { display: contents; }
  .home-intro { order: 0; max-width: 768px; }
  .home #work { order: 1; width: 100%; }
  .home .contact { order: 2; width: 100%; margin: 0; }
}

/* Filter: a pill group with one dark indicator that slides between options. */
.filter {
  position: relative; isolation: isolate;
  display: flex; flex-wrap: wrap; gap: 2px;
  width: fit-content; max-width: 100%;
  padding: 3px; margin-bottom: 28px;
  border: 1px solid var(--line); border-radius: 28px; background: var(--paper);
}
.filter button {
  position: relative; z-index: 1; appearance: none; border: 0; border-radius: 24px;
  padding: 5px 12px; min-height: 36px; background: transparent; color: var(--muted); cursor: pointer;
  font-size: var(--fs-small); line-height: 1.5; transition: color 220ms ease;
}
.filter button[aria-pressed="true"] { color: #fff; }
.filter button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.filter::before {
  content: ""; position: absolute; z-index: 0; top: 0; left: 0;
  width: var(--fx-w, 0px); height: var(--fx-h, 0px);
  transform: translate(var(--fx-x, 0px), var(--fx-y, 0px));
  border-radius: 24px; background: var(--accent);
  transition: transform 280ms var(--ease-out), width 280ms var(--ease-out), height 280ms var(--ease-out);
}
@media (max-width: 768px) {
  .filter { width: 100%; }
  .filter button { flex: 1 1 0; min-width: max-content; min-height: 44px; padding: 5px 4px; text-align: center; }
}

/* ---------- Cards ---------- */
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); align-items: start; padding-bottom: 80px; }
@media (min-width: 769px) and (max-width: 1024px) { .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 768px) { .cards { grid-template-columns: minmax(0, 1fr); } }

.card { display: block; min-width: 0; }
.card:focus-visible { outline: 2px solid var(--accent); outline-offset: 6px; border-radius: var(--radius); }
.card-title { margin: 0; font-size: var(--fs-body); font-weight: 500; line-height: 1.35; letter-spacing: normal; }
.card-body { padding-top: 16px; }

/* One neutral canvas for every preview: artwork scales inside, never crops. */
.media {
  width: 100%; margin: 0; padding: 0; overflow: hidden;
  aspect-ratio: 4 / 3; background: var(--canvas); border-radius: var(--radius);
  display: grid; place-items: center;
}
.media > img, .media > video {
  display: block; width: 100%; height: 100%; min-width: 0; min-height: 0;
  padding: 10%; object-fit: contain; object-position: center; background: transparent;
}

.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 0; }
.tag {
  display: inline-flex; max-width: 100%; white-space: normal;
  color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 3px 7px;
  font-size: var(--fs-meta); line-height: 1.6;
}

/* ---------- Case study ---------- */
.case { margin-top: 40px; }
.case-aside { min-width: 0; padding: 0 8px 24px 0; }
.case-back { display: inline-block; color: var(--muted); margin-bottom: 26px; font-size: var(--fs-small); line-height: 1.5; }
.case-aside > .tags { margin: 0 0 20px; }
.case-head h1 { margin: 0; overflow-wrap: break-word; }
.case-lede { color: var(--muted); margin: 22px 0 26px; font-size: var(--fs-small); line-height: 1.5; }
.case-nav { display: flex; flex-direction: column; border-left: 2px solid var(--line); font-size: var(--fs-small); line-height: 1.5; }
.case-nav a { margin-left: -2px; border-left: 2px solid transparent; padding: 10px 0 10px 16px; color: var(--muted); }
.case-nav a:hover, .case-nav a[aria-current] { color: var(--ink); }
.case-nav a[aria-current] { border-color: var(--accent); font-weight: 500; }
.case-main { min-width: 0; padding: 0 4px 0 0; scroll-behavior: smooth; }
.case-main section[id] { scroll-margin-top: 24px; }

.gallery-track {
  display: flex; overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain;
  border: 1px solid var(--line); border-radius: var(--radius);
}
.gallery-track:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.slide { flex: 0 0 100%; min-width: 0; aspect-ratio: 8 / 5; margin: 0; overflow: hidden; scroll-snap-align: start; scroll-snap-stop: always; background: var(--canvas); }
.slide > img, .slide > video { display: block; width: 100%; height: 100%; padding: 10%; object-fit: contain; object-position: center; background: transparent; }
.gallery-bar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding-top: 12px; }
.gallery-caption { margin: 0; color: var(--muted); font-size: var(--fs-meta); line-height: 1.5; }
.gallery-controls { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.gallery-controls button { cursor: pointer; background: white; color: inherit; border: 1px solid var(--line); border-radius: 50%; width: 32px; height: 32px; }
.gallery-controls button:disabled { opacity: .35; cursor: default; }
.gallery-dots { display: flex; }
.gallery-controls .gallery-dot { border: 0; display: grid; place-items: center; width: 24px; padding: 0; background: none; }
.gallery-dot::after { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--line); }
.gallery-dot[aria-current="true"]::after { background: var(--ink); }
.gallery-count { color: var(--muted); font-size: var(--fs-label); font-variant-numeric: tabular-nums; }

.story { padding: 40px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.story h2, .story h3, .story h4 { margin: 0 0 24px; }
.story h4 { font-size: var(--fs-body); font-weight: 500; line-height: 1.35; letter-spacing: normal; }
/* Plain paragraphs only: classed ones (labels, notes, captions) keep their own styles. */
.story p:not([class]), .story li { margin: 0 0 20px; color: var(--muted); font-size: var(--fs-body); line-height: 1.7; }
.story ul { margin: 0 0 20px; padding-left: 1.2em; }
.story li { margin-bottom: 8px; }
.story p:not([class]):last-child { margin-bottom: 0; }
.story a:not(.roll) { text-decoration: underline; text-underline-offset: 4px; }
.facts { margin: 24px 0 0; }
.facts dt { color: var(--muted); font-size: var(--fs-label); font-weight: 400; line-height: 1.5; text-transform: uppercase; letter-spacing: .05em; }
.facts dd { margin: 6px 0 20px; color: var(--muted); }
.facts div:last-child dd { margin-bottom: 0; }
.facts + p { margin-top: 20px; }
.highlights dl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; margin: 0; }
.highlights dt { font-size: var(--fs-section); font-weight: 500; line-height: 1.25; letter-spacing: -.025em; }
.highlights dd { margin: 8px 0 0; color: var(--muted); }

/* Story figures keep the whole recording or screenshot at its natural ratio. */
.story > figure.media { aspect-ratio: auto; display: block; }
.story > figure.media:has(> img) { padding: clamp(16px, 3vw, 40px); }
.story > figure.media > img { width: auto; height: auto; max-width: 100%; max-height: 640px; margin-inline: auto; padding: 0; }
.story > figure.media > video { width: 100%; height: auto; padding: 0; object-fit: contain; }
.story > figure + figure { margin-top: 20px; }
.story > figure + h4, .story > figure + p { margin-top: 36px; }
.story > figure figcaption { margin-top: 12px; color: var(--muted); font-size: var(--fs-meta); line-height: 1.5; text-align: center; }

/* ---------- Structured case-study blocks ---------- */
.eyebrow { margin: 0 0 12px; color: var(--accent-text); font-size: var(--fs-label); line-height: 1.5; text-transform: uppercase; letter-spacing: .06em; }
.chapter > h2 { margin: 0 0 24px; max-width: 30ch; }
.block + .block { margin-top: 32px; }
.prose p { margin: 0 0 20px; color: var(--muted); }
.prose p:last-child { margin-bottom: 0; }
.prose + .facts-row { margin-top: 28px; }

.facts-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; margin: 0; padding: 20px 0 0; border-top: 1px solid var(--line); }
.facts-row dt { color: var(--muted); font-size: var(--fs-label); font-weight: 400; line-height: 1.5; text-transform: uppercase; letter-spacing: .05em; }
.facts-row dd { margin: 6px 0 0; color: var(--ink); font-size: var(--fs-small); line-height: 1.5; }
.facts-row + p { margin-top: 24px; }
.case-links { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; margin-top: 24px; font-size: var(--fs-small); line-height: 1.5; }

/* The short version: a quiet summary card read before the long version. */
.tldr { margin-top: 32px; padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); }
.tldr > dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 32px; margin: 0; }
.tldr dt { color: var(--muted); font-size: var(--fs-label); font-weight: 400; line-height: 1.5; text-transform: uppercase; letter-spacing: .05em; }
.tldr dd { margin: 6px 0 0; color: var(--ink); font-size: var(--fs-small); line-height: 1.6; }
.tldr .metrics { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }

.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; margin: 0; }
.metrics dt { font-size: var(--fs-section); font-weight: 500; line-height: 1.25; letter-spacing: -.025em; color: var(--ink); }
.metrics dd { margin: 8px 0 0; color: var(--muted); font-size: var(--fs-small); line-height: 1.5; }

/* Figures: the shared neutral canvas, artwork contained, optional label and caption. */
.fig { margin: 0; }
.fig .media { aspect-ratio: auto; display: block; padding: clamp(16px, 3vw, 40px); }
.fig .media > img { width: auto; height: auto; max-width: 100%; max-height: 640px; margin-inline: auto; padding: 0; }
.fig .media > video { display: block; width: auto; max-width: 100%; height: auto; max-height: 640px; margin-inline: auto; padding: 0; border-radius: 4px; }
.fig figcaption { margin-top: 12px; color: var(--muted); font-size: var(--fs-small); line-height: 1.5; }
.fig-label { display: inline-flex; margin-top: 12px; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 3px 7px; font-size: var(--fs-meta); line-height: 1.6; }
.fig-label + figcaption { margin-top: 8px; }
.yt-embed { margin: 0; }
.yt-frame { position: relative; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 8px; background: #111; }
.yt-frame iframe, .yt-play { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.yt-play { padding: 0; background: none; cursor: pointer; }
.yt-play img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 400ms cubic-bezier(.22,1,.36,1); }
.yt-play:hover img { transform: scale(1.015); }
.yt-icon { position: absolute; left: 50%; top: 50%; display: grid; place-items: center; width: 72px; height: 72px; margin: -36px 0 0 -36px; border-radius: 50%; background: rgba(255,255,255,.92); color: var(--ink); box-shadow: 0 6px 24px rgba(0,0,0,.25); transition: transform 200ms ease, background-color 200ms ease; }
.yt-icon svg { width: 26px; height: 26px; margin-left: 3px; }
.yt-play:hover .yt-icon { transform: scale(1.06); background: #fff; }
.yt-play:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.fig-grid { display: grid; grid-template-columns: repeat(var(--cols, 2), minmax(0, 1fr)); gap: var(--gap); }
/* Grid frames share one ratio so mixed screens (phone + desktop) line up. */
.fig-grid .fig .media { display: grid; place-items: center; aspect-ratio: var(--ratio, 4 / 3); padding: 16px; }
.fig-grid .fig .media > img, .fig-grid .fig .media > video { width: 100%; height: 100%; max-height: none; object-fit: contain; }
/* Scroll frames: very tall sheets keep full width and scroll inside a fixed frame. */
.fig-grid.is-scroll .fig .media { display: block; padding: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin !important; }
.fig-grid.is-scroll .fig .media > img { width: 100%; height: auto; padding: 0; object-fit: initial; }
.fig-grid.is-scroll .fig .media::-webkit-scrollbar { display: block; width: 6px; }
.fig-grid.is-scroll .fig .media::-webkit-scrollbar-thumb { background: #cfcfcf; border-radius: 3px; }
.fig-grid.is-scroll .fig-label::after { content: " · scroll"; }
.fig-grid-caption { margin: 16px 0 0; color: var(--muted); font-size: var(--fs-small); line-height: 1.5; }
/* Scope notes: what the work does and does not claim, kept visible but quiet. */
.note { margin: 0; padding-top: 14px; border-top: 1px dashed var(--line); color: var(--muted); font-size: var(--fs-small); line-height: 1.6; }
.note span { display: block; margin-bottom: 4px; color: var(--ink); font-size: var(--fs-label); text-transform: uppercase; letter-spacing: .05em; }

.callout { padding: 20px 24px; border-left: 2px solid var(--accent); background: var(--accent-soft); border-radius: 0 var(--radius) var(--radius) 0; }
.callout > p:not(.eyebrow) { margin: 0; color: var(--ink); font-size: var(--fs-sub); font-weight: 500; line-height: 1.4; letter-spacing: -.015em; }
.callout .eyebrow { margin-bottom: 8px; }

.quote { margin: 0; padding-left: 24px; border-left: 2px solid var(--line); }
.quote p { margin: 0; color: var(--ink); font-size: var(--fs-sub); line-height: 1.4; }
.quote footer { margin-top: 12px; color: var(--muted); font-size: var(--fs-small); }

.info-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.info-card { padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); }
.info-card h4 { margin: 0 0 8px; }
.info-card p { margin: 0; color: var(--muted); font-size: var(--fs-small); line-height: 1.6; }

.pairs { border-top: 1px solid var(--line); }
.pairs-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.pairs-row p { margin: 0; color: var(--muted); font-size: var(--fs-small); line-height: 1.6; }
.pairs-head span { color: var(--ink); font-size: var(--fs-meta); font-weight: 500; }

.learnings { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 32px; }
.learnings .eyebrow { margin-bottom: 8px; }
.learnings h4 { margin: 0 0 8px; }
.learnings p { margin: 0; color: var(--muted); font-size: var(--fs-small); line-height: 1.6; }

/* Iterations: versions side by side in a snap carousel; the next one peeks in. */
.iter-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.iter-head .eyebrow { margin: 0; }
.iter-controls { display: flex; align-items: center; gap: 10px; }
.iter-controls button { display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--ink); border-radius: 50%; background: var(--paper); color: var(--ink); cursor: pointer; transition: opacity 180ms ease; }
.iter-controls button:disabled { border-color: var(--line); color: var(--line); cursor: default; }
.iter-next .arrow { transform: scaleX(-1); }
.iter-count { color: var(--muted); font-size: var(--fs-label); font-variant-numeric: tabular-nums; min-width: 44px; text-align: center; }
.iter-track { display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; scroll-behavior: smooth; }
.iter-track:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.iter-card { flex: 0 0 86%; min-width: 0; scroll-snap-align: start; display: flex; flex-direction: column; gap: 16px; padding: 20px; background: #fafafa; border: 1px solid var(--line-soft); border-radius: 12px; }
.iter-card .media { aspect-ratio: var(--ratio, 8 / 5); background: var(--canvas); }
.iter-pair .iter-card { flex-basis: calc(50% - 8px); }
.iter.is-portrait .iter-card { flex-basis: calc((100% - 32px) / 3); padding: 16px; }
/* Carousel: labelled screens on the iterations track. Phones show ~3 with a peek. */
.carousel .slide-card { margin: 0; padding: 0; background: none; border: 0; border-radius: 0; gap: 10px; flex-basis: calc(31% - 8px); }
.carousel.is-wide .slide-card { flex-basis: 86%; }
/* A phone slide inside a wide carousel keeps the same height as its desktop neighbours. */
.carousel.is-wide .slide-card.is-narrow { flex-basis: calc(86% * var(--k)); }
.carousel .slide-card .media { display: grid; place-items: center; padding: 16px; }
.carousel .slide-card .media > img, .carousel .slide-card .media > video { width: 100%; height: 100%; padding: 0; object-fit: contain; }
.carousel figcaption { color: var(--muted); font-size: var(--fs-small); line-height: 1.5; }
.slide-label { display: block; color: var(--ink); font-size: var(--fs-meta); margin-bottom: 2px; }
.iter-pair .iter-controls { display: none; }
.iter-meta h4 { margin: 10px 0 6px; font-size: var(--fs-body); line-height: 1.35; letter-spacing: normal; }
.iter-meta p { margin: 0; color: var(--muted); font-size: var(--fs-small); line-height: 1.6; }
.iter-result { margin: 0; color: var(--ink); font-size: var(--fs-small); line-height: 1.6; }
.iter-result span { display: block; color: var(--muted); font-size: var(--fs-label); text-transform: uppercase; letter-spacing: .05em; }
.status { display: inline-flex; padding: 3px 9px; border-radius: 999px; font-size: var(--fs-meta); line-height: 1.5; border: 1px solid var(--line); color: var(--muted); background: var(--paper); }
.status.is-explored { border-style: dashed; }
.status.is-shipped { background: var(--accent); border-color: var(--accent); color: #fff; }

/* Key features: a list that drives one pinned visual (desktop); stacked pairs on mobile. */
.features { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 32px; align-items: start; }
.feature-list { list-style: none; margin: 0; padding: 0; }
.feature { padding: 18px 0; border-top: 1px solid var(--line); min-height: 34vh; }
.feature:last-child { min-height: max(50vh, var(--feature-stage-height, 34vh)); }
.feature-head { display: flex; align-items: baseline; gap: 12px; width: 100%; padding: 0; border: 0; background: none; color: inherit; text-align: left; cursor: pointer; }
.feature-head .eyebrow { margin: 0; }
.feature-title { font-size: var(--fs-sub); font-weight: 500; line-height: 1.3; letter-spacing: -.015em; color: #a3a3a3; transition: color 220ms ease; }
.feature p { margin: 10px 0 0 30px; color: #a3a3a3; font-size: var(--fs-small); line-height: 1.6; transition: color 220ms ease; }
.feature.is-active .feature-title { color: var(--ink); }
.feature.is-active p { color: var(--muted); }
.feature-inline { display: none; }
.feature-stage { position: sticky; top: 24px; display: grid; }
.stage-item { grid-area: 1 / 1; aspect-ratio: 4 / 3; opacity: 0; pointer-events: none; transition: opacity 320ms ease; }
.stage-item.is-active { opacity: 1; pointer-events: auto; }
.stage-item > img, .stage-item > video { padding: 6%; }

@media (max-width: 768px) {
  .facts-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tldr > dl, .metrics, .info-cards, .pairs-row, .learnings { grid-template-columns: minmax(0, 1fr); }
  .pairs-row { gap: 8px; }
  .pairs-head { display: none; }
  .pairs-row p::before { content: attr(data-label); display: block; margin-bottom: 2px; color: var(--muted); font-size: var(--fs-label); letter-spacing: .05em; text-transform: uppercase; }
  .pairs-row { padding-block: 12px; }
  .fig-grid { grid-template-columns: minmax(0, 1fr); }
  .iter-card, .iter-pair .iter-card { flex-basis: 92%; padding: 16px; }
  .iter-pair .iter-controls { display: flex; }
  .iter.is-portrait .iter-card { flex-basis: 78%; }
  .carousel .slide-card { flex-basis: 70%; padding: 0; }
  .carousel.is-wide .slide-card { flex-basis: 88%; }
  .carousel.is-wide .slide-card.is-narrow { flex-basis: calc(88% * var(--k)); }
  .features { display: block; }
  .feature, .feature:last-child { min-height: 0; padding: 20px 0; }
  .feature-title, .feature p { color: inherit; }
  .feature p { margin-left: 0; color: var(--muted); }
  .feature-inline { display: grid; margin-top: 16px; aspect-ratio: 4 / 3; }
  .feature-stage { display: none; }
}
@media (prefers-reduced-motion: reduce) { .iter-track { scroll-behavior: auto; } }

/* ---------- Visual viewer ---------- */
.zoomable { position: relative; }
.zoom-open {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  display: grid; place-items: center; width: 34px; height: 34px; padding: 0;
  border: 1px solid var(--line); border-radius: 50%; background: rgb(255 255 255 / .92); color: var(--ink); cursor: pointer;
  opacity: 0; transform: scale(.9); transition: opacity 180ms ease, transform 220ms var(--ease-out);
}
.zoom-open svg { width: 16px; height: 16px; }
.zoomable:hover .zoom-open, .zoom-open:focus-visible { opacity: 1; transform: none; }
@media (hover: none) { .zoom-open { opacity: .92; transform: none; } }

html.viewer-open { overflow: hidden; }
.zoom { position: fixed; inset: 0; z-index: 9000; }
.zoom-bg { position: absolute; inset: 0; background: rgb(250 250 250 / .84); -webkit-backdrop-filter: blur(18px) saturate(1.1); backdrop-filter: blur(18px) saturate(1.1); }
.zoom-count { position: absolute; top: 24px; left: 24px; z-index: 2; margin: 0; padding: 4px 10px; border-radius: 999px; background: rgb(255 255 255 / .8); color: var(--muted); font-size: var(--fs-label); line-height: 1.5; font-variant-numeric: tabular-nums; }
.zoom-btn {
  display: grid; place-items: center; width: 44px; height: 44px; padding: 0;
  border: 1px solid var(--ink); border-radius: 50%; background: var(--paper); color: var(--ink); cursor: pointer;
  transition: background 180ms ease, color 180ms ease;
}
.zoom-btn svg { width: 20px; height: 20px; }
@media (hover: hover) { .zoom-btn:hover { background: var(--ink); color: var(--paper); } }
.zoom-close { position: absolute; top: 20px; right: 20px; z-index: 2; }

/* The stage takes every pointer and wheel event; the visual is placed by script. */
.zoom-stage { position: absolute; inset: 0; z-index: 1; overflow: hidden; touch-action: none; overscroll-behavior: contain; }
/* Live element mode (the contract workbench): no gesture stage, just a centred, scrollable area. */
.zoom-element { display: none; position: absolute; inset: 72px 28px 92px; z-index: 1; overflow: auto; overscroll-behavior: contain; }
.zoom.is-element .zoom-element { display: block; }
.zoom.is-element .zoom-stage, .zoom.is-element .zoom-count { display: none; }
@media (max-width: 768px) { .zoom-element { inset: 64px 12px 84px; } }
.zoom-frame { position: absolute; inset: 0; }
.zoom-pan { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform; }
.zoom-pan > img, .zoom-pan > video {
  display: block; width: 100%; height: 100%; border-radius: 8px; background: var(--paper);
  box-shadow: 0 30px 70px -30px rgb(0 0 0 / .28), 0 0 0 1px rgb(0 0 0 / .04);
  user-select: none; -webkit-user-drag: none;
}
@media (hover: hover) and (pointer: fine) {
  .zoom-pan > img { cursor: zoom-in; }
  .zoom.can-pan .zoom-pan > img { cursor: grab; }
  .zoom.is-dragging, .zoom.is-dragging * { cursor: grabbing !important; }
}
.zoom-vctl { position: absolute; top: 12px; right: 12px; display: flex; gap: 8px; }
.zoom-vbtn { display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%; background: rgb(38 38 38 / .72); color: #fff; cursor: pointer; }
.zoom-vbtn svg { width: 18px; height: 18px; }

/* Controls float above the visual; only the buttons and caption take pointer input. */
.zoom-bar { position: absolute; left: 28px; right: 28px; bottom: 24px; z-index: 2; display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; align-items: center; gap: 20px; pointer-events: none; }
.zoom-bar > * { pointer-events: auto; }
.zoom-bar .zoom-btn[hidden] { display: block !important; visibility: hidden; }
.zoom-caption {
  justify-self: center; max-width: 100%; margin: 0; padding: 8px 16px; border-radius: 18px;
  background: rgb(255 255 255 / .82); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  text-align: center; color: var(--ink); font-size: var(--fs-small); line-height: 1.5;
}
.zoom-hint { display: block; color: var(--muted); font-size: var(--fs-meta); }
.zoom-hint:empty { display: none; }
@media (max-width: 768px) {
  .zoom-close { top: 14px; right: 14px; }
  .zoom-count { top: 22px; left: 14px; }
  .zoom-bar { left: 14px; right: 14px; bottom: 18px; gap: 12px; }
}

.case-more { padding: 28px 0 24px; }
.case-more > p { margin: 0 0 16px; color: var(--muted); }
.strip { display: flex; flex-wrap: nowrap; overflow-x: auto; gap: 12px; }
.thumb { position: relative; display: block; flex: 0 0 100px; width: 100px; border-radius: 6px; }
.thumb .media { aspect-ratio: 8 / 5; border-radius: 6px; }
.thumb:focus-visible { outline: none; }
.thumb:focus-visible .media { outline: 2px solid var(--accent); outline-offset: -2px; }
/* Names reveal inside the thumbnail without changing either rail's layout. */
.thumb-name { position: absolute; inset: 0; display: grid; align-content: center; padding: 4px; border-radius: 6px; background: rgb(255 255 255 / .92); font-size: 12px; line-height: 16px; color: var(--ink); text-align: center; overflow-wrap: anywhere; visibility: hidden; opacity: 0; pointer-events: none; transition: opacity 180ms ease-out, visibility 0s linear 180ms; }
.thumb:focus-visible .thumb-name { visibility: visible; opacity: 1; transition-delay: 0s; outline: 2px solid var(--accent); outline-offset: -2px; }
@media (hover: hover) and (pointer: fine) {
  .thumb:hover .thumb-name { visibility: visible; opacity: 1; transition-delay: 0s; }
}
@media (prefers-reduced-motion: reduce) {
  .thumb-name { transition: none; }
}

@media (min-width: 769px) {
  html:has(body.page-case), body.page-case { overflow: clip; }
  body.page-case { position: fixed; inset: 0; width: 100%; }
  .case { height: calc(100dvh - 128px); overflow: clip; align-items: stretch; }
  .case-aside, .case-main { height: 100%; overflow-y: auto; overscroll-behavior-y: contain; min-height: 0; }
}
@media (max-width: 768px) {
  .case { display: block; margin: 36px 22px 0; }
  .case-aside { padding: 0 0 32px; }
  .case-nav { display: none; }
  .case-main { padding-right: 0; }
  .story { padding: 32px 0; }
  .highlights dl { grid-template-columns: 1fr; }
  .gallery-dots { display: none; }
}
@media (prefers-reduced-motion: reduce) { .case-main { scroll-behavior: auto; } }

/* ---------- About ---------- */
.about { margin-top: 40px; --heading-space: clamp(150px, 15vw, 210px); }
.about-aside { min-width: 0; display: flex; flex-direction: column; animation: settle 500ms ease-out both; }
.about-aside h1 { margin: 0; flex-shrink: 0; }
.about-aside .beyond-heading { display: none; }
.portrait { margin: 0; width: min(100%, 260px); min-width: 0; flex-shrink: 0; }
.portrait img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 4; object-fit: cover; border-radius: var(--radius); }
.portrait figcaption { margin-top: 10px; color: var(--muted); font-size: var(--fs-label); line-height: 1.5; }
.about-aside .contact { width: 100%; flex-shrink: 0; padding: 24px 0 8px; }
.about-main { min-width: 0; animation: settle 600ms 100ms ease-out both; }
.about-main p { color: var(--muted); }
.bio { padding: 0 0 64px; }
.bio p { margin: 0 0 20px; }
.about-section { margin-bottom: 110px; padding-top: 36px; }
.about-section > header { margin-bottom: 30px; }
.about-section > header h2 { margin: 12px 0 18px; }
.history > header { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 32px; }
.history > header h2 { margin: 0; }
.jobs { display: flex; flex-direction: column; gap: 28px; }
.job { display: grid; grid-template-columns: 56px 1fr auto; align-items: start; gap: 20px; }
.job + .job { border-top: 1px solid var(--line-soft); padding-top: 28px; }
.job h3 { margin: 0; }
.job-logo { width: 56px; height: 56px; border-radius: 12px; background: #000; color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 1.25rem; letter-spacing: -.02em; }
.job-logo-brand { background: #fff; border: 1px solid var(--border); overflow: hidden; }
.job-logo-brand img { width: 100%; height: 100%; object-fit: contain; }
.job-role { color: var(--muted); margin-top: 5px; font-size: var(--fs-small); line-height: 1.5; }
.about-main .job p { margin: 10px 0 0; max-width: 440px; font-size: var(--fs-small); line-height: 1.5; }
.job time { color: var(--muted); padding-top: 3px; font-size: var(--fs-label); line-height: 1.5; white-space: nowrap; }
.education { margin: 28px 0 0; font-size: var(--fs-small); line-height: 1.5; }
.process p { margin: 0 0 16px; }
.process strong { color: var(--ink); font-weight: 500; }
.stack-row { display: flex; flex-wrap: nowrap; overflow-x: auto; align-items: center; gap: 20px; list-style: none; margin: 0; padding: 6px; width: 100%; min-width: 0; }
.stack-item { display: flex; align-items: center; justify-content: center; flex: 0 0 56px; width: 56px; height: 56px; background: #f5f5f5; border: 1px solid var(--line-soft); border-radius: 12px; }
.stack-item img { display: block; width: 38px; height: 38px; object-fit: contain; }
.stack-item img:is([alt="Framer"], [alt="ShapesXR"]) { filter: brightness(0); }
.beyond { position: relative; }
.beyond-copy { max-width: 650px; margin-bottom: 35px; }
.beyond-copy h3 { margin: 0 0 24px; }
.beyond-copy p { margin: 0 0 16px; }
.about-main .footnote { color: var(--ink); margin: 0 0 90px; font-size: var(--fs-sub); font-weight: 500; line-height: 1.3; letter-spacing: -.015em; }

/* Project rail: a narrow column of covers that keeps the work in reach. */
.rail { display: flex; flex-direction: column; gap: 10px; min-width: 0; padding: 4px; }
.rail .thumb { width: 100%; flex: 0 0 auto; border-radius: var(--radius); }
.rail .media { aspect-ratio: 1.6; border-radius: 6px; }

@media (min-width: 769px) {
  .about { height: calc(100dvh - 128px); overflow: hidden; align-items: stretch; padding-bottom: 24px; }
  /* The aside sits 28px below the pane's top edge (matches the reference composition). */
  .about-aside { position: relative; top: 28px; height: 100%; max-height: 100%; min-height: 0; overflow-y: auto; padding-bottom: 24px; }
  .about-aside h1 { min-height: var(--heading-space); }
  .about-aside .beyond-heading { display: block; position: absolute; top: 0; left: 0; margin: 0; opacity: 0; pointer-events: none; }
  .portrait { width: min(100%, 260px, calc((100dvh - 330px) * .75)); will-change: transform; }
  .about-aside .contact { margin-top: auto; }
  .about-aside { grid-row: 1; }
  .about-main { grid-column: 4 / span 8; grid-row: 1; height: 100%; min-height: 0; overflow-y: auto; overscroll-behavior-y: contain; padding-right: 4px; }
  .bio { padding-top: var(--heading-space); }
  .beyond { display: flow-root; padding-bottom: 0; margin-bottom: 0; }
  .beyond > h2 { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); }
  .rail { grid-column: 12; grid-row: 1; align-self: stretch; height: 100%; max-height: 100%; min-height: 0; padding: 0; gap: 24px; overflow-y: auto; overscroll-behavior-y: contain; justify-content: flex-start; }
}
@media (min-width: 769px) and (max-width: 1024px) {
  .about-main { grid-column: 5 / span 6; }
  .rail { grid-column: 11 / span 2; width: 100px; justify-self: end; }
}
@media (max-width: 768px) {
  .about { display: flex; flex-direction: column; margin: 36px 22px 0; }
  .about-aside { padding-bottom: 32px; }
  .about-aside h1 { margin-bottom: 32px; }
  .portrait { max-width: 280px; }
  .about-aside .contact { margin-top: 24px; }
  .about-main { width: 100%; }
  .about-section { margin-bottom: 64px; padding-top: 24px; }
  .about-main .footnote { margin-bottom: 0; }
  .rail { order: 2; flex-direction: row; overflow-x: auto; margin: 28px 0 24px; padding: 0 0 8px; }
  .rail .thumb { flex: 0 0 100px; width: 100px; }
}
@media (max-width: 540px) {
  .history > header { flex-wrap: wrap; }
  .job { grid-template-columns: 48px 1fr; gap: 4px 16px; }
  .job-logo { width: 48px; height: 48px; grid-row: 1; }
  .job time { grid-column: 2; }
  .stack-row { gap: 16px; }
  .stack-item { flex-basis: 48px; width: 48px; height: 48px; }
}
@keyframes settle { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
html.vt-arrived .about-aside, html.vt-arrived .about-main { animation: none; }

/* ---------- Cursor ---------- */
.cursor { position: fixed; top: 0; left: 0; z-index: 2147483647; pointer-events: none; opacity: 0; mix-blend-mode: normal; will-change: transform; }
.cursor::before {
  content: ""; display: block; width: 12px; height: 12px; margin: -6px; border-radius: 50%; background: var(--accent);
  transform: scale(var(--dot-scale, 1)); transition: transform 220ms cubic-bezier(.2, .8, .2, 1);
}
.cursor-label {
  display: none; position: absolute; top: 0; left: 0; padding: 12px 20px; border-radius: 999px;
  background: var(--accent); color: #fff; white-space: nowrap; font-size: var(--fs-body); line-height: 1.7;
  transform: translate(-50%, -50%) scale(var(--pill-scale, 1)); transition: transform 220ms cubic-bezier(.2, .8, .2, 1);
}
.cursor.on-control { mix-blend-mode: difference; }
.cursor.on-control::before { background: #fff; }
.cursor.on-card { mix-blend-mode: normal; }
.cursor.on-card::before { display: none; }
.cursor.on-card .cursor-label { display: block; }
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) and (forced-colors: none) {
  html.cursor-on, html.cursor-on * { cursor: none !important; }
  html.cursor-on .cursor { opacity: 1; }
}

/* ---------- First-visit intro ---------- */
html.intro-wait::before { content: ""; position: fixed; inset: 0; background: var(--paper); z-index: 10000; }
html.intro-play { overflow: hidden; }
html.intro-play .topbar .brand, html.intro-play [data-intro-target] { visibility: hidden; }
.intro[hidden] { display: none; }
.intro { position: fixed; inset: 0; z-index: 10001; overflow: hidden; color: var(--ink); }
.intro-bg { position: absolute; inset: 0; background: var(--paper); }
.intro-name { position: absolute; top: 0; left: 0; z-index: 3; margin: 0; white-space: nowrap; transform-origin: top left; pointer-events: none; font-size: var(--fs-small); font-weight: 500; line-height: 1.5; }
.intro-photo { position: absolute; --w: clamp(105px, 13vw, 190px); width: var(--w); aspect-ratio: 4 / 3; height: auto; border: 1px solid var(--line); border-radius: var(--radius); z-index: 2; opacity: 0; background: var(--canvas); transform-origin: top left; overflow: hidden; }
.intro-photo[hidden] { display: none; }
.intro-photo > img { display: block; width: 100%; height: 100%; padding: 10%; object-fit: contain; }
.intro-skip { position: absolute; top: 28px; right: 28px; z-index: 4; padding: 10px 4px; border: 0; background: var(--paper); color: var(--muted); cursor: pointer; font-size: var(--fs-meta); line-height: 1.5; }
@media (max-width: 600px) {
  .intro-photo { --w: 100px; }
  .intro-skip { top: 17px; right: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  html.intro-wait::before, .intro { display: none; }
  html.intro-play { overflow: visible; }
  html.intro-play .topbar .brand { visibility: visible; }
}

/* ---------- Hover reveal card (name easter egg) ---------- */
.reveal-trigger { display: inline-block; margin: 0; padding: 0; border: 0; border-radius: 0; background: none; color: inherit; vertical-align: baseline; cursor: pointer; transition: transform 220ms var(--ease-out); }
.reveal-trigger:focus-visible { transform: translateY(-2px) rotate(-2deg); }
@media (hover: hover) { .reveal-trigger:hover { transform: translateY(-2px) rotate(-2deg); } }
.reveal-card[hidden] { display: none; }
.reveal-card {
  position: fixed; z-index: 10002; width: min(240px, calc(100vw - 32px)); margin: 0; overflow: visible;
  border-radius: 8px; background: transparent; color: #fff; pointer-events: none; opacity: 0;
  transform: translateY(8px) rotate(-4deg) scale(.9); transform-origin: 50% 50%;
  transition: opacity 180ms ease, transform 260ms var(--ease-out); box-shadow: 0 8px 28px rgb(0 0 0 / .10);
}
.reveal-card.is-on { opacity: 1; transform: none; animation: pop 280ms both; }
.reveal-card img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 8px; }
.reveal-card.is-project { width: min(280px, calc(100vw - 32px)); }
.reveal-card.is-project img { aspect-ratio: 4 / 3; object-fit: contain; padding: 10%; background: var(--canvas); }
.reveal-card figcaption {
  position: absolute; top: 100%; left: 50%; transform: translate(-50%, -50%);
  width: max-content; max-width: calc(100vw - 32px); padding: 12px 20px; border-radius: 999px;
  background: #000; color: #fff; text-align: center; font-size: var(--fs-small); line-height: 1.5;
}
@keyframes pop {
  0% { opacity: 0; transform: translateY(8px) rotate(-4deg) scale(.9); }
  70% { opacity: 1; transform: translateY(-2px) rotate(1deg) scale(1.015); }
  100% { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .reveal-card, .reveal-card.is-on, .reveal-trigger:is(:hover, :focus-visible) { animation: none; transition: none; transform: none; }
}

/* ---------- Page transitions ---------- */
/* Native cross-document transitions: links and history stay ordinary. */
@view-transition { navigation: auto; }

::view-transition-old(root) { animation: leave 180ms ease-out both; }
::view-transition-new(root) { animation: arrive 500ms 100ms var(--ease-out) both; }
::view-transition-image-pair(root) { isolation: isolate; }

/* The navigation bar holds still while everything else changes. */
.topbar { view-transition-name: topbar; }
::view-transition-group(topbar) { animation: none; z-index: 5; }
::view-transition-old(topbar) { animation: none; opacity: 0; }
::view-transition-new(topbar) { animation: none; }

/* Going back: the gallery settles into its card (names are set inline per project). */
::view-transition-group(*.project) { animation-duration: 720ms; animation-timing-function: var(--ease-out); z-index: 2; overflow: clip; border-radius: 16px; }
::view-transition-old(*.project) { height: 100%; object-fit: cover; animation: fade-out 480ms ease both; }
::view-transition-new(*.project) { height: 100%; object-fit: cover; animation: fade-in 560ms 100ms ease both; }

.case-head { view-transition-name: case-head; }
::view-transition-new(case-head) { animation: rise 600ms 180ms var(--ease-out) both; }
::view-transition-old(case-head) { animation: leave 180ms ease-out both; }

.portrait { view-transition-name: portrait; }
.about-main { view-transition-name: about-main; }
::view-transition-group(portrait), ::view-transition-group(about-main) { animation-duration: 720ms; }
::view-transition-new(portrait) { animation: rise 600ms 100ms var(--ease-out) both; }
::view-transition-new(about-main) { animation: rise 600ms 180ms var(--ease-out) both; }
::view-transition-old(portrait), ::view-transition-old(about-main) { animation: leave 180ms ease-out both; }

/* The cursor never drifts with a page snapshot. */
.cursor { view-transition-name: cursor; }
::view-transition-old(cursor), ::view-transition-new(cursor) { animation: none; opacity: 0; }

/* Travel: project frames fly to their new positions, then the page appears. */
html.traveling::view-transition-old(root) { animation: leave 160ms ease-out both; }
html.traveling::view-transition-new(root) { animation: appear 240ms 520ms ease-out both; }
html:active-view-transition .card, html.traveling .about-aside, html.traveling .about-main { animation: none; }

@keyframes leave { to { opacity: 0; transform: translateY(-8px); } }
@keyframes arrive { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes rise { from { opacity: 0; transform: translateY(32px); filter: blur(5px); } to { opacity: 1; transform: translateY(0); filter: blur(0); } }
@keyframes fade-out { to { opacity: 0; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes appear { from { opacity: 0; } to { opacity: 1; } }
@keyframes hold-then-fade { 0%, 68.42% { opacity: 1; } 100% { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}

/* Expand a live element into the viewer (same-document view transition, see zoom.js). */
html.vt-expand::view-transition-old(root) { animation: fade-out 260ms ease both; }
html.vt-expand::view-transition-new(root) { animation: fade-in 260ms ease both; }
html.vt-expand::view-transition-group(live-expand) { animation-duration: 520ms; animation-timing-function: var(--ease-out); z-index: 10; overflow: clip; border-radius: 18px; }
html.vt-expand::view-transition-old(live-expand), html.vt-expand::view-transition-new(live-expand) { height: 100%; object-fit: cover; object-position: top left; }
html.vt-expand::view-transition-old(live-expand) { animation: fade-out 260ms ease both; }
html.vt-expand::view-transition-new(live-expand) { animation: fade-in 320ms 120ms ease both; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .86em; padding: .1em .35em; border-radius: 4px; background: var(--canvas); color: var(--ink); overflow-wrap: anywhere; }

/* Diagrams (storyboard panels) */
.dgm { margin: 0; }
.dgm figcaption { margin-top: 12px; color: var(--muted); font-size: var(--fs-small); line-height: 1.5; }
.dgm-panel { display: flex; flex-direction: column; gap: 6px; min-width: 0; padding: 20px; background: #fafafa; border: 1px solid var(--line-soft); border-radius: 12px; }
.dgm-panel .eyebrow { margin: 0; }
.dgm-panel h4 { margin: 0; font-size: var(--fs-body); font-weight: 500; line-height: 1.35; }
.dgm-panel > p { margin: 0 0 8px; color: var(--muted); font-size: var(--fs-small); line-height: 1.5; }
.dgm-steps { display: grid; grid-template-columns: minmax(0, 1fr) 28px minmax(0, 1fr) 28px minmax(0, 1fr); align-items: stretch; margin: 0; padding: 0; list-style: none; }
.dgm-arrow { display: grid; place-items: center; color: var(--muted); }
.dgm-arrow-icon { width: 18px; height: 18px; }
/* Wireframe screen */
.sk { display: flex; flex-direction: column; gap: 8px; margin-top: auto; padding: 14px; background: var(--paper); border: 1px solid var(--line); border-radius: 8px; font-size: var(--fs-meta); line-height: 1.4; color: var(--ink); }
.sk b { font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sk-field span, .sk-line span, .sk-total span { min-width: 0; }
.sk-choice { display: flex; flex-direction: column; gap: 6px; margin: 0 0 4px; padding: 0; list-style: none; color: var(--muted); }
.sk-choice li { display: flex; align-items: center; gap: 8px; }
.sk-choice li.on { color: var(--ink); }
.sk-radio { width: 12px; height: 12px; border: 1px solid var(--muted); border-radius: 50%; flex: none; }
.on .sk-radio { border-color: var(--accent); box-shadow: inset 0 0 0 3px var(--paper); background: var(--accent); }
.sk-field, .sk-line, .sk-total { display: flex; justify-content: space-between; gap: 12px; }
.sk-field { color: var(--muted); }
.sk-field b { color: var(--ink); padding: 2px 8px; border: 1px solid var(--line); border-radius: 4px; }
.sk-line { padding-bottom: 6px; border-bottom: 1px dashed var(--line); }
.sk-total { padding: 6px 8px; border-radius: 4px; background: var(--ink); color: var(--paper); }
.sk-asset { display: flex; align-items: center; gap: 10px; }
.sk-asset > span:last-child { display: flex; flex-direction: column; }
.sk-asset small { color: var(--muted); font-size: inherit; }
.sk-asset-icon { display: grid; place-items: center; width: 32px; height: 32px; flex: none; border-radius: 6px; background: var(--accent-soft); color: var(--accent-text); }
.sk-icon { width: 18px; height: 18px; }
/* Shared collateral */
.dgm-loans, .dgm-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.dgm-links { gap: 24px; }
.dgm-link { display: flex; flex-direction: column; align-items: center; }
.dgm-link::before { content: ""; height: 20px; border-left: 1px solid var(--accent); }
.dgm-link span { padding: 4px 10px; border: 1px solid var(--accent); border-radius: 999px; background: var(--accent-soft); color: var(--accent-text); font-size: var(--fs-meta); font-variant-numeric: tabular-nums; }
.dgm-join { display: block; width: 100%; height: 32px; overflow: visible; }
.dgm-join path { fill: none; stroke: var(--accent); stroke-width: 1; }
.dgm-asset { width: min(100%, 320px); margin: 0 auto; }
@media (max-width: 768px) {
  .dgm-steps { grid-template-columns: minmax(0, 1fr); }
  .dgm-arrow { height: 32px; }
  .dgm-arrow-icon { transform: rotate(90deg); }
  .dgm-panel { padding: 14px; }
  .dgm-loans, .dgm-links { gap: 12px; }
  .sk { padding: 10px; }
  .dgm-shared .dgm-panel { padding: 10px; }
  .dgm-shared .sk { padding: 8px; gap: 6px; }
  .dgm-shared .sk-field, .dgm-shared .sk-line, .dgm-shared .sk-total { gap: 6px; }
  .dgm-shared .sk-total { padding: 5px 6px; }
  .dgm-link span { padding: 3px 8px; white-space: nowrap; }
}

/* Bento photo grid */
.bento-wrap { container-type: inline-size; }
.bento { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: calc((100cqi - 36px) / 4); gap: 12px; grid-auto-flow: dense; }
.bento-item { margin: 0; min-width: 0; }
.bento-item .media { aspect-ratio: auto; height: 100%; }
.bento-item .media > img { padding: 0; object-fit: cover; transition: transform 600ms cubic-bezier(.22,1,.36,1); }
.bento-item .media:hover > img { transform: scale(1.03); }
.bento-item.s-2x2 { grid-column: span 2; grid-row: span 2; }
.bento-item.s-1x2 { grid-row: span 2; }
.bento-item.s-2x1 { grid-column: span 2; }
@media (max-width: 768px) {
  .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: calc((100cqi - 8px) / 2); gap: 8px; }
  .bento-item.s-1x2 { grid-row: span 1; }
}
@media (prefers-reduced-motion: reduce) { .bento-item .media > img { transition: none; } }


/* Compact iteration comparisons, with every version visible together. */
.iter-grid-track { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.iter-grid .iter-card { padding: 16px; }
.iter-grid .iter-meta { flex: 1; }
@media (max-width: 768px) { .iter-grid-track { grid-template-columns: minmax(0, 1fr); } }

/* Reference footer engine, adapted to the portfolio's light palette. */
.cycle-game { --cycle-paper: var(--paper); --cycle-ink: var(--ink); --cycle-grey: #8c8c8c; --cycle-sky: #d4d4d4; position: relative; width: 100%; margin-top: 96px; }
.cycle-stage { position: relative; width: 100%; height: 116px; overflow: hidden; touch-action: pan-y; user-select: none; -webkit-tap-highlight-color: transparent; cursor: pointer; }
.cycle-stage:focus { outline: none; }
.cycle-stage.is-highlighted::after { content: ""; position: absolute; inset: 0; z-index: 10; pointer-events: none; border: 1px solid var(--accent); }
@media (forced-colors: active) { .cycle-stage.is-highlighted::after { border-color: Highlight; } }
.cycle-game svg { display: block; max-width: none; }
.cycle-game [hidden] { display: none !important; }
.cycle-game [data-part="band"] { fill: var(--cycle-paper); }
.cycle-game [data-part="grey"] { fill: var(--cycle-grey); }
.cycle-game [data-part="ink"] { fill: var(--cycle-ink); }
.cycle-sky { position: absolute; left: 0; bottom: 12px; background: var(--cycle-sky); will-change: transform; }
.cycle-road { position: absolute; left: 0; bottom: 0; will-change: transform; }
.cycle-road-grey, .cycle-road-ink { position: absolute; inset: 0; }
.cycle-road-grey { background: var(--cycle-grey); }
.cycle-road-ink { background: var(--cycle-ink); }
.cycle-rider { position: absolute; left: 24px; bottom: 12px; will-change: transform; }
.cycle-obstacle { display: none; position: absolute; left: 0; bottom: 12px; will-change: transform; }
.cycle-obstacle[data-kind] { display: block; }
.cycle-flag { position: absolute; left: 0; bottom: 12px; will-change: transform; }
.cycle-fade { position: absolute; top: 0; bottom: 0; width: 24px; pointer-events: none; }
.cycle-fade-left { left: 0; background: linear-gradient(to right,var(--cycle-paper),transparent); }
.cycle-fade-right { right: 0; background: linear-gradient(to left,var(--cycle-paper),transparent); }
.cycle-scores { position: absolute; top: 2px; left: 0; display: flex; gap: 12px; height: 20px; align-items: center; }
.cycle-score svg, .cycle-best svg { height: 12px; width: auto; }
.cycle-score { fill: var(--cycle-ink); }
.cycle-best { fill: var(--cycle-grey); }
.cycle-prompt { position: absolute; top: 24px; left: 0; right: 0; margin: 0; display: flex; align-items: center; justify-content: center; gap: 8px; pointer-events: none; font-size: 12px; line-height: 20px; color: var(--ink); }
.cycle-key { border: 1px solid var(--line); border-radius: 3px; padding: 0 5px; font-size: 12px; }
.cycle-touch { display: none; }
.cycle-caption { min-height: 36px; margin-top: 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cycle-caption p { margin: 0; color: var(--muted); font-size: 12px; }
.cycle-pause { border: 0; background: none; color: var(--muted); padding: 8px 0 8px 12px; font: inherit; font-size: 12px; cursor: pointer; }
.cycle-pause:focus, .cycle-pause:focus-visible { outline: none; }
@media (min-width: 769px) {
  /* Align the closing helper row with the aside's contact links. */
  .cycle-caption { min-height: 28px; }
  .cycle-pause { padding-block: 4px; line-height: 20px; }
}
@media (pointer: coarse) { .cycle-desktop-help { display: none; } .cycle-key { display: none; } .cycle-touch { display: inline; } }
@media (max-width: 768px) { .cycle-game { margin-top: 64px; } .cycle-desktop-help { display: none; } .cycle-key { display: none; } .cycle-touch { display: inline; } }

/* A project-thumbnail zero between two typographic fours. */
.page-not-found { overflow-y: auto; }
.lost-main { min-height: calc(100svh - var(--nav-h)); display: flex; flex-direction: column; align-items: center; justify-content: center; padding-block: 32px 64px; }
.lost-composition { width: min(800px, 100%); display: grid; grid-template-columns: .85fr 1.3fr .85fr; align-items: center; }
.lost-digit { font-size: clamp(120px, 25vw, 320px); font-weight: 500; line-height: 1; text-align: center; letter-spacing: -.06em; }
.lost-ring { position: relative; height: clamp(220px, 30vw, 360px); }
.lost-project { position: absolute; left: var(--x); top: var(--y); width: clamp(68px, 7vw, 96px); aspect-ratio: 8 / 5; border-radius: 6px; background: var(--canvas); transform: translate(-50%, -50%) rotate(var(--tilt)); transition: transform 180ms var(--ease-out); }
.lost-project-media { display: block; width: 100%; height: 100%; border-radius: inherit; background: var(--canvas); overflow: hidden; }
.lost-project img { width: 100%; height: 100%; object-fit: contain; padding: 10%; border-radius: inherit; }
.lost-project-name { position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%); width: max-content; max-width: 180px; padding: 4px 8px; background: var(--ink); color: var(--paper); font-size: 12px; line-height: 1.4; text-align: center; border-radius: 3px; visibility: hidden; opacity: 0; pointer-events: none; }
.lost-project:is(:hover, :focus-visible) { z-index: 2; transform: translate(-50%, -50%) rotate(0deg); }
.lost-project:is(:hover, :focus-visible) .lost-project-name { visibility: visible; opacity: 1; }
.lost-copy { text-align: center; margin-top: 40px; }
.lost-copy .lost-code { font-size: 12px; color: var(--muted); margin: 0 0 12px; }
.lost-copy h1 { font-size: clamp(24px, 3vw, 32px); font-weight: 500; line-height: 1.3; margin: 0 0 12px; }
.lost-copy > p { color: var(--muted); margin: 0; }
.lost-home { color: var(--accent-text); margin-top: 24px; display: inline-flex; }
.lost-home .arrow { margin-left: 4px; }
@media (max-width: 600px) {
  .lost-main { padding-block: 24px 40px; }
  .lost-ring { height: 190px; }
  .lost-project { width: 60px; left: var(--mx); top: var(--my); min-height: 44px; }
  .lost-project:nth-of-type(n + 9) { display: none; }
  .lost-copy { margin-top: 32px; max-width: 300px; }
  .lost-project-name { max-width: 130px; }
}
@media (prefers-reduced-motion: reduce) { .lost-project { transition: none; } }

/* Impact results: prominent figures with their sample and task context. */
.chapter#impact .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px 40px; }
.chapter#impact .metrics dt { font-size: clamp(30px, 3vw, 44px); }
@media (max-width: 600px) { .chapter#impact .metrics { grid-template-columns: minmax(0, 1fr); gap: 24px; } }
