
/* ---------------------------------------------------------------------------
   Tokens
   One warm paper world, one signal green, and one glass recipe reused by every
   floating surface. Anything that needs a new colour reads it from here.
--------------------------------------------------------------------------- */
:root {
  color: #171713;
  background: #f3f1eb;
  font-family: 'Manrope', Arial, sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;

  --ink: #171713;
  --muted: #4a4941;
  --line: #c9c4b6;
  --paper: #f3f1eb;
  --panel: #ebe9e1;
  --signal: #b6e56d;
  --on-ink: #f3f1eb;
  --ink-soft: #22221e;
  --ink-edge: #3a3a34;
  --on-ink-muted: #b4b3a9;
  --on-ink-quiet: #a5a49a;
  --danger: #e38d77;
  --focus-ring: #2a3a12;
  --max: 1300px;

  /* Glass: brighter body, white top edge, offset shadow. */
  --glass-bg: rgba(255, 255, 255, .40);
  --glass-bg-strong: rgba(255, 255, 255, .58);
  --glass-bg-active: rgba(255, 255, 255, .66);
/* --- Work Stage: full-screen project gallery --------------------------- */
  --work-paper: #eef2ee;
  --work-ink: #20211e;
  --work-muted: #72746d;
  --work-blue: #cbdfe7;
  --work-green: #dce9bd;
  --work-lilac: #ded8ed;
  --work-peach: #f4d4c0;

  --work-page-h: 100dvh;
  --work-nav-h: 76px;
  --work-max: 1440px;
  --work-pad: clamp(24px, 6vw, 96px);
  --work-head-w: 100%;
  --work-card-w: min(64vw, 960px);
  --work-card-h: min(66vh, 700px);
  --work-gap: 24px;
  --work-radius: 28px;
  --work-peek: 14%;
  --glass-line: rgba(255, 255, 255, .68);
  --glass-hairline: rgba(23, 23, 19, .10);
  --glass-shadow: 0 24px 48px -30px rgba(23, 23, 19, .44), 0 2px 8px -5px rgba(23, 23, 19, .16);
  --glass-lift: inset 0 1px 0 rgba(255, 255, 255, .88);
  --glass-blur: blur(30px) saturate(165%);

  /* Ambient field. The accent follows whichever project is on stage. */
  --ambient-bg: #f3f1eb;
  --ambient-accent: #b6e56d;
  --ambient-accent-soft: #bfe6cf;
  --ambient-pointer-x: 0;
  --ambient-pointer-y: 0;
  --ambient-blob-a-x: -7vw;
  --ambient-blob-a-y: -5vh;
  --ambient-blob-b-x: 6vw;
  --ambient-blob-b-y: 7vh;
  --ambient-blob-c-x: -4vw;
  --ambient-blob-c-y: 4vh;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body { margin: 0; min-width: 320px; background: var(--paper); }

::selection { background: var(--signal); color: var(--ink); }

/* ---------------------------------------------------------------------------
   Ambient background
   Decorative and non-interactive. Scroll picks the base colour; the pointer
   drifts the blobs; the active project tints the fourth blob.
--------------------------------------------------------------------------- */
.ambient-background {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background-color: var(--ambient-bg);
  transition: background-color .45s linear;
  isolation: isolate;
}

.ambient-background,
.ambient-background * { pointer-events: none; }

.ambient-background__slot {
  position: absolute;
  display: block;
  transform: translate3d(var(--ambient-blob-a-x), var(--ambient-blob-a-y), 0);
  will-change: transform;
}

.ambient-background__slot--a { top: 6vh; left: -9vw; width: 46vw; height: 46vw; }
.ambient-background__slot--b {
  top: 26vh; right: -13vw; width: 52vw; height: 52vw;
  transform: translate3d(var(--ambient-blob-b-x), var(--ambient-blob-b-y), 0);
}
.ambient-background__slot--c {
  bottom: -18vh; left: 26vw; width: 41vw; height: 41vw;
  transform: translate3d(var(--ambient-blob-c-x), var(--ambient-blob-c-y), 0);
}
.ambient-background__slot--d {
  bottom: -14vh;
  right: 10vw;
  width: 36vw;
  height: 36vw;
  transform: translate3d(
    calc(var(--ambient-pointer-x) * -46vw),
    calc(var(--ambient-pointer-y) * -30vh),
    0
  );
  transition: transform .9s cubic-bezier(.22, .8, .28, 1);
}

.ambient-background__blob {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 46% 54% 58% 42% / 52% 43% 57% 48%;
  filter: blur(72px);
  opacity: .28;
  animation: ambient-blob-drift 42s ease-in-out infinite alternate;
}

.ambient-background__blob--apricot { background: #f2c8ab; }
.ambient-background__blob--blue { background: #c8d9ee; opacity: .24; }
.ambient-background__blob--mint { background: #c9e5d4; opacity: .22; animation-duration: 51s; }
.ambient-background__blob--accent {
  background: var(--ambient-accent);
  opacity: .20;
  animation-duration: 58s;
  transition: background .9s ease;
}

@keyframes ambient-blob-drift {
  from { transform: translate3d(-2%, -1%, 0) scale(1); border-radius: 46% 54% 58% 42% / 52% 43% 57% 48%; }
  to { transform: translate3d(3%, 2%, 0) scale(1.06); border-radius: 55% 45% 43% 57% / 46% 56% 44% 54%; }
}

a { color: inherit; text-decoration: none; }

button, textarea { font: inherit; }

h1, h2, h3, p, dl, dt, dd, ul, li { margin: 0; }

ul { padding: 0; list-style: none; }

/* ---------------------------------------------------------------------------
   Shell and header
   The header is the one piece of glass that stays on screen everywhere.
--------------------------------------------------------------------------- */
.site-shell {
  position: relative;
  z-index: 1;
  max-width: var(--max);
  margin: 0 auto;
  padding: 14px 40px 0;
}

.site-header {
  position: sticky;
  top: 14px;
  z-index: 30;
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 12px 0 22px;
  border-radius: 999px;
  background: var(--glass-bg-strong);
  border: 1px solid var(--glass-line);
  box-shadow: var(--glass-shadow), var(--glass-lift);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
}

.wordmark,
.site-nav,
.status,
.tag,
.section-count,
.demo-endpoint,
.result-meta,
.result-footer,
.note-state,
.back-link,
.link-label,
.doc-link,
.tab-idx,
.tab-tag,
.card-kicker,
.plate-kicker,
.foot-note,
.proof dt,
.button,
.door {
  font-family: 'DM Mono', monospace;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: 11px;
}

.wordmark { font-weight: 500; }
.wordmark span { color: var(--muted); }
.site-nav { display: flex; gap: 4px; }
.site-nav a {
  color: var(--muted);
  padding: 9px 14px;
  border-radius: 999px;
  transition: color .2s ease, background .2s ease;
}
.site-nav a:hover,
.site-nav a:focus-visible { color: var(--ink); background: rgba(255, 255, 255, .62); }
/* Current chapter: one deliberate step darker than the resting links, plus
   aria-current so screen readers hear it too. The scene controller toggles
   both as the track slides. */
.site-nav a[aria-current='true'],
.site-nav a.is-active { color: var(--ink); background: rgba(255, 255, 255, .68); }

.section { padding: 104px 0; }

/* ---------------------------------------------------------------------------
   Home hero
   A promise on the left, three facts on the right. No status readouts.
--------------------------------------------------------------------------- */
.hero { padding: 78px 0 70px; }
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, .75fr);
  gap: 64px;
  align-items: end;
}
h1 {
  font-size: clamp(52px, 6.2vw, 92px);
  line-height: .94;
  letter-spacing: -.04em;
  font-weight: 600;
  text-wrap: balance;
}
h1 em { font-style: normal; color: var(--muted); }
h2 { font-size: clamp(30px, 3.6vw, 48px); line-height: 1; letter-spacing: -.03em; font-weight: 600; }
h3 { font-size: 23px; line-height: 1.1; letter-spacing: -.03em; font-weight: 600; }
.lede { margin-top: 28px; max-width: 52ch; font-size: 19px; line-height: 1.62; color: var(--muted); }

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; margin-top: 36px; }
.button {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 15px 22px;
  border-radius: 999px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  cursor: pointer;
  transition: background .22s ease, color .22s ease, transform .22s ease;
}
.button:hover,
.button:focus-visible { background: rgba(255, 255, 255, .9); border-color: var(--ink); color: var(--ink); transform: translateY(-2px); }
.button--quiet {
  background: var(--glass-bg-strong);
  color: var(--ink);
  border-color: var(--glass-line);
  box-shadow: var(--glass-lift);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
}
.button--quiet:hover,
.button--quiet:focus-visible { background: rgba(255, 255, 255, .78); color: var(--ink); }
.button--dark { color: var(--paper); background: var(--ink); border-color: var(--ink); }

.proof { display: grid; border-top: 1px solid var(--glass-hairline); }
.proof div {
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 16px;
  align-items: baseline;
  padding: 15px 0;
  border-bottom: 1px solid var(--glass-hairline);
}
.proof dt { color: var(--muted); }
.proof dd { font-size: 14.5px; line-height: 1.5; }

/* ---------------------------------------------------------------------------
   Project switcher
   One glass rail, one project on stage. The active tab is a soft glass
   highlight: brighter body, white top edge, tinted bloom underneath.
--------------------------------------------------------------------------- */
.work { padding: 20px 0 96px; }
.section-heading { margin-bottom: 22px; }
.section-heading--row { display: flex; align-items: baseline; justify-content: space-between; gap: 24px; }
.section-count { color: var(--muted); }

.switcher {
  position: relative;
  isolation: isolate;
  padding: 14px;
  border-radius: 26px;
  background: rgba(255, 255, 255, .26);
  border: 1px solid var(--glass-line);
  box-shadow: var(--glass-shadow), var(--glass-lift);
  -webkit-backdrop-filter: blur(26px) saturate(160%);
  backdrop-filter: blur(26px) saturate(160%);
}
.switcher::after {
  content: '';
  position: absolute;
  inset: -6vh 0 -8vh;
  z-index: -1;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(52% 62% at 50% 52%, color-mix(in srgb, var(--active) 38%, transparent) 0%, transparent 72%);
  transition: background .9s ease;
}

.rail { display: flex; gap: 8px; padding: 0 2px 12px; }
.tab {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  border-radius: 16px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  text-align: left;
  transition: background .32s ease, color .32s ease, border-color .32s ease, box-shadow .32s ease, transform .32s ease;
}
.tab:hover { background: rgba(255, 255, 255, .42); color: var(--ink); }
.tab-idx { opacity: .8; }
.tab-name {
  font-family: 'Manrope', Arial, sans-serif;
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: -.01em;
  text-transform: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tab-tag { color: var(--muted); white-space: nowrap; }

.tab[aria-selected='true'] {
  background: var(--glass-bg-active);
  border-color: rgba(255, 255, 255, .9);
  color: var(--ink);
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .95),
    0 -1px 0 rgba(255, 255, 255, .55),
    0 18px 26px -20px color-mix(in srgb, var(--active) 92%, rgba(23, 23, 19, .3)),
    0 10px 22px -16px rgba(217, 207, 242, .95),
    var(--glass-shadow);
}
.tab[aria-selected='true'] .tab-tag { color: var(--ink); }

.panes { position: relative; }
.pane {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: translateY(10px) scale(.994);
  visibility: hidden;
  pointer-events: none;
  transition: opacity .48s cubic-bezier(.22, .8, .28, 1), transform .48s cubic-bezier(.22, .8, .28, 1), visibility 0s linear .48s;
}
.pane.is-active {
  position: relative;
  opacity: 1;
  transform: none;
  visibility: visible;
  pointer-events: auto;
  transition: opacity .48s cubic-bezier(.22, .8, .28, 1), transform .48s cubic-bezier(.22, .8, .28, 1), visibility 0s linear 0s;
}

.card {
  display: grid;
  grid-template-columns: minmax(0, .78fr) minmax(0, 1.22fr);
  border-radius: 20px;
  overflow: hidden;
  background: rgba(255, 255, 255, .34);
  border: 1px solid rgba(255, 255, 255, .6);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8);
}
.plate {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
  padding: 26px;
  background: color-mix(in srgb, var(--accent) 44%, transparent);
  border-right: 1px solid rgba(255, 255, 255, .5);
  overflow: hidden;
}
.plate-kicker { display: flex; justify-content: space-between; gap: 14px; }
.plate-kicker b { font-weight: 500; }
.plate-kicker span { color: var(--muted); }
.plate-note { font-size: 13px; line-height: 1.6; color: var(--muted); max-width: 30ch; }
.plate-num {
  position: absolute;
  right: 2px;
  bottom: -30px;
  font-size: clamp(96px, 10vw, 148px);
  line-height: 1;
  font-weight: 700;
  letter-spacing: -.05em;
  color: var(--ink);
  opacity: .12;
  pointer-events: none;
}

.card-main { display: flex; flex-direction: column; min-width: 0; padding: 24px 28px 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.card-kicker { color: var(--muted); }
.status {
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid rgba(23, 23, 19, .28);
  background: rgba(255, 255, 255, .66);
  color: var(--ink);
}
.status--signal,
.status--live { background: color-mix(in srgb, var(--active) 78%, #fff); border-color: rgba(23, 23, 19, .34); }
.card-copy { padding: 20px 0 0; }
.card-copy h3 { font-size: clamp(27px, 2.9vw, 42px); line-height: 1.02; }
.card-copy h3 a:hover { text-decoration: underline; text-underline-offset: 6px; }
.card-copy p { margin-top: 13px; max-width: 48ch; color: var(--muted); font-size: 15.5px; line-height: 1.62; }
.card-copy .tag-row { margin-top: 18px; }
.tag {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(23, 23, 19, .16);
  color: var(--muted);
}

.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: auto;
  padding: 18px 0 24px;
  border-top: 1px solid var(--glass-hairline);
}
.foot-note { color: var(--muted); }
.doors { display: flex; flex-wrap: wrap; gap: 10px; }
.door {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  border-radius: 999px;
  border: 1px solid rgba(23, 23, 19, .18);
  background: rgba(255, 255, 255, .5);
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
  transition: background .22s ease, border-color .22s ease, transform .22s ease;
}
.door:hover,
.door:focus-visible { background: rgba(255, 255, 255, .82); border-color: rgba(23, 23, 19, .34); transform: translateY(-1px); }
.door--primary { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.door--primary:hover,
.door--primary:focus-visible { background: var(--signal); border-color: var(--ink); color: var(--ink); }
.door--soon { opacity: .62; cursor: default; }
.door--soon:hover { background: rgba(255, 255, 255, .5); border-color: rgba(23, 23, 19, .18); transform: none; }

/* A rail with nothing to switch is a title bar, not a tablist. */
.rail--single { padding-bottom: 12px; }
.tab--static { cursor: default; }
.tab--static:hover { background: transparent; color: var(--muted); }

.empty-state { padding: 40px 0; color: var(--muted); }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------------------------------------------------------------------------
   Notes and contact
--------------------------------------------------------------------------- */
.notes-section { display: grid; grid-template-columns: .9fr 1.4fr; gap: 60px; padding: 0 0 96px; }
.notes-list { border-top: 1px solid var(--glass-hairline); }
.note-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 24px;
  padding: 20px 0;
  border-bottom: 1px solid var(--glass-hairline);
}
.note-item h3 { font-size: 18px; }
.note-item p { grid-column: 1 / -1; color: var(--muted); font-size: 14px; line-height: 1.55; max-width: 68ch; }
.note-state { justify-self: end; color: var(--muted); }

.contact-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  padding: 62px 0 86px;
  border-top: 1px solid var(--glass-hairline);
}
.contact-links { border-top: 1px solid var(--glass-hairline); }
.contact-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 17px 0;
  border-bottom: 1px solid var(--glass-hairline);
  font-family: 'DM Mono', monospace;
  font-size: 13px;
}
.contact-link span { color: var(--muted); }
.contact-link strong { font-weight: 500; }
.contact-link--muted { color: var(--muted); }

/* ---------------------------------------------------------------------------
   Project detail page
--------------------------------------------------------------------------- */
.project-hero { padding: 34px 0 56px; }
.back-link { display: inline-block; color: var(--muted); margin-bottom: 44px; }
.back-link:hover { color: var(--ink); }
.project-title-row { display: flex; align-items: end; justify-content: space-between; gap: 48px; }
.project-title-row h1 { font-size: clamp(44px, 5.6vw, 82px); max-width: 760px; }
.project-title-row p { width: 300px; color: var(--muted); line-height: 1.6; font-size: 15px; }
.project-hero .tag-row { margin-top: 26px; }

.demo-shell { padding: 40px; background: var(--ink); color: var(--paper); border-radius: 20px; }
.demo-header { display: flex; align-items: start; justify-content: space-between; gap: 24px; padding-bottom: 34px; border-bottom: 1px solid var(--ink-edge); }
.demo-header h2 { font-size: clamp(28px, 3.2vw, 42px); }
.demo-endpoint { color: var(--on-ink-muted); }
.demo-form { padding: 34px 0; border-bottom: 1px solid var(--ink-edge); }
.demo-form label { display: block; color: var(--on-ink-muted); font-family: 'DM Mono', monospace; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 14px; }
.demo-form textarea { width: 100%; resize: vertical; border: 0; border-bottom: 1px solid var(--on-ink-quiet); color: var(--paper); background: transparent; padding: 0 0 16px; outline: none; font-size: 20px; line-height: 1.45; }
.demo-form textarea:focus { border-color: var(--signal); }
.demo-actions { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-top: 22px; }
.demo-hint { color: var(--on-ink-quiet); font-size: 12px; }
.demo-shell .button--dark { color: var(--ink); background: var(--signal); border-color: var(--signal); }
.demo-shell .button--dark:hover,
.demo-shell .button--dark:focus-visible { background: transparent; color: var(--signal); transform: none; }
.demo-result { padding: 26px; margin-top: 34px; background: var(--ink-soft); border: 1px solid var(--ink-edge); border-radius: 14px; }
.demo-result[data-state='success'] { border-color: var(--signal); }
.demo-result[data-state='error'] { border-color: var(--danger); }
.demo-result[data-state='loading'] { opacity: .6; }
.result-meta,
.result-footer { display: flex; justify-content: space-between; gap: 20px; color: var(--on-ink-muted); }
.result-footer { color: var(--on-ink-quiet); }
.demo-result p { min-height: 60px; margin: 34px 0; max-width: 700px; font-size: 19px; line-height: 1.55; }

/* Wiki demo (second project): knowledge-base picker, status badge, sources.
   Reuses the dark demo shell and the existing tokens; only the control that
   does not exist in the chat demo gets its own rules. */
.demo-shell--wiki .kb-picker { border: 0; padding: 0; margin: 0 0 26px; min-width: 0; }
.demo-shell--wiki .kb-picker legend { padding: 0; margin-bottom: 14px; color: var(--on-ink-muted); font-family: 'DM Mono', monospace; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.kb-options { display: flex; flex-wrap: wrap; gap: 10px; }
.demo-form .kb-option {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin-bottom: 0;
  padding: 10px 18px;
  border: 1px solid var(--ink-edge);
  border-radius: 999px;
  background: rgba(255, 255, 255, .05);
  color: var(--on-ink-muted);
  font-family: 'Manrope', Arial, sans-serif;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: normal;
  text-transform: none;
  cursor: pointer;
  transition: color .18s ease, border-color .18s ease, background-color .18s ease;
}
.demo-form .kb-option input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.demo-form .kb-option:hover { color: var(--paper); border-color: var(--on-ink-quiet); }
.demo-form .kb-option:focus-within { outline: 2px solid var(--signal); outline-offset: 2px; }
.demo-form .kb-option:has(input:checked) { color: var(--ink); background: var(--signal); border-color: var(--signal); }

.wiki-badge {
  padding: 4px 10px;
  border: 1px solid var(--ink-edge);
  border-radius: 999px;
  color: var(--on-ink-muted);
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  letter-spacing: .04em;
  text-transform: uppercase;
}
[data-wiki-result][data-state='success'] .wiki-badge { color: var(--ink); background: var(--signal); border-color: var(--signal); }
[data-wiki-result][data-state='error'] .wiki-badge { color: var(--ink); background: var(--danger); border-color: var(--danger); }
[data-wiki-result][data-state='loading'] .wiki-badge { animation: wiki-pulse 1.2s ease-in-out infinite; }
@keyframes wiki-pulse { 50% { opacity: .45; } }

.wiki-sources { list-style: none; margin: -14px 0 30px; padding: 18px 0 0; border-top: 1px dashed var(--ink-edge); display: grid; gap: 10px; }
.wiki-sources[hidden] { display: none; }
.wiki-sources li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 18px; font-size: 13px; }
.wiki-source-page { color: var(--paper); }
.wiki-source-ids { color: var(--on-ink-quiet); font-family: 'DM Mono', monospace; font-size: 11px; word-break: break-all; }

@media (prefers-reduced-motion: reduce) {
  .kb-option { transition: none; }
  [data-wiki-result][data-state='loading'] .wiki-badge { animation: none; }
}

@media (max-width: 720px) {
  .kb-options { display: grid; grid-template-columns: 1fr; }
  .kb-option { justify-content: center; }
  .wiki-sources li { display: block; }
}

.project-foot { display: grid; grid-template-columns: 1.2fr .8fr; gap: 60px; padding: 64px 0 0; }
.project-foot h2 { margin-bottom: 16px; }
.limitation { max-width: 68ch; color: var(--muted); line-height: 1.65; font-size: 15px; }
.project-links { border-top: 1px solid var(--glass-hairline); padding-top: 4px; }
.doc-link {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 15px 0;
  border-bottom: 1px solid var(--glass-hairline);
  color: var(--muted);
}
.doc-link:hover,
.doc-link:focus-visible { color: var(--ink); }

.not-found { min-height: 70vh; display: flex; flex-direction: column; align-items: start; justify-content: center; gap: 32px; }
.not-found h1 { font-size: clamp(48px, 7vw, 108px); }

/* ---------------------------------------------------------------------------
   Interaction states and accessibility
   Kept at the end of the file so the layout rules above stay readable.
--------------------------------------------------------------------------- */

/* One visible focus treatment for keyboard users, on every interactive element. */
:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 3px;
}

#app:focus-visible { outline: none; }

.button:focus-visible,
.door:focus-visible,
.tab:focus-visible { outline-offset: 3px; }

/* The dark demo panel needs a light ring, not the default dark one. */
.demo-shell :focus-visible { outline-color: var(--signal); }
.demo-form textarea:focus-visible { outline: none; }

.back-link:focus-visible,
.site-nav a:focus-visible,
.contact-link:focus-visible,
.doc-link:focus-visible { outline-offset: 6px; }

/* Skip link stays out of the layout until it is focused. */
.skip-link {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 40;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
  background: var(--ink);
  color: var(--on-ink);
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.skip-link:focus-visible {
  width: auto;
  height: auto;
  clip-path: none;
  padding: 12px 16px;
  border-radius: 999px;
  left: 16px;
  outline-offset: 3px;
}


.button:disabled { opacity: .65; cursor: progress; }
.button:disabled:hover { opacity: .65; transform: none; }

/* Anchored sections should not hug the very top of the viewport. */
.section,
.work { scroll-margin-top: 96px; }

/* Browser surfaces belong to the design too. */
::selection { background: var(--signal); color: var(--ink); }
textarea { caret-color: var(--signal); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  .ambient-background { transition: none; }
  .ambient-background__slot--d { transition: none; }
  .ambient-background__blob { animation: none !important; }
  .switcher::after,
  .tab,
  .pane,
  .ambient-background__blob--accent { transition: none !important; }
  .pane { transform: none; }

  *, *::before, *::after {
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
  }
}

/* ---------------------------------------------------------------------------
   Responsive
--------------------------------------------------------------------------- */
@media (max-width: 1000px) {
  .site-shell { padding: 12px 24px 0; }
  .hero { padding: 60px 0 52px; }
  .hero-grid { grid-template-columns: 1fr; gap: 42px; align-items: start; }
  .card { grid-template-columns: 1fr; }
  .plate { border-right: 0; border-bottom: 1px solid rgba(255, 255, 255, .5); padding: 20px; gap: 16px; }
  .plate-note,
  .plate-num { display: none; }
  .card-main { padding: 20px 22px 0; }
  .notes-section,
  .contact-section,
  .project-foot { grid-template-columns: 1fr; gap: 34px; }
  .demo-header { display: block; }
  .demo-endpoint { display: block; margin-top: 20px; }
  .project-title-row { display: block; }
  .project-title-row h1 { margin-top: 16px; }
  .project-title-row p { width: auto; max-width: 420px; margin-top: 20px; }
}

@media (max-width: 720px) {
  .site-shell { padding: 10px 16px 0; }
  .site-header {
    top: 10px;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 12px 14px;
    border-radius: 22px;
  }
  .wordmark { padding: 2px 8px; }
  .site-nav { justify-content: space-between; gap: 0; }
  .site-nav a { padding: 8px 10px; font-size: 11px; }
  .hero { padding: 42px 0 38px; }
  h1 { font-size: clamp(40px, 12vw, 56px); }
  .lede { font-size: 17px; margin-top: 22px; }
  .proof div { grid-template-columns: 72px 1fr; gap: 12px; }
  .section { padding: 72px 0; }
  .work { padding: 12px 0 72px; }
  .switcher { padding: 10px; border-radius: 22px; }
  .rail { gap: 6px; padding-bottom: 10px; }
  .tab { grid-template-columns: auto minmax(0, 1fr); gap: 8px; padding: 11px 12px; border-radius: 14px; }
  .tab-tag { display: none; }
  .tab-name { font-size: 13px; }
  .card-copy h3 { font-size: 25px; }
  .card-foot { flex-direction: column; align-items: flex-start; gap: 12px; }
  .doors { gap: 8px; }
  .door { padding: 10px 14px; font-size: 10.5px; }
  .demo-shell { padding: 24px 18px; margin-left: -16px; margin-right: -16px; border-radius: 0; }
  .demo-actions { display: block; }
  .demo-hint { display: block; margin-bottom: 18px; line-height: 1.5; }
  .demo-shell .button--dark { width: 100%; justify-content: center; min-height: 48px; }
  .demo-result p { font-size: 17px; }

}

/* ---------------------------------------------------------------------------
   Horizontal scene (four chapters) and its components
--------------------------------------------------------------------------- */

/* --- language switcher (header, top right) --- */
.locale-switch {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  background: rgba(23, 23, 19, .06);
  flex: 0 0 auto;
}
.locale-switch__btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  padding: 8px 11px;
  border-radius: 999px;
  cursor: pointer;
  transition: background-color .18s ease, color .18s ease;
}
.locale-switch__btn:hover { color: var(--ink); }
.locale-switch__btn[aria-pressed='true'] { background: var(--ink); color: var(--paper); }
.locale-switch__btn:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }

/* --- scene shell: full-bleed viewport window, clipped track --- */
.scene {
  position: relative;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  /* The stage fills the viewport below the 76px header (spec: page height
     100dvh). dvh keeps mobile browser chrome from leaving a dead strip; the
     vh line is the fallback for engines without dvh support. */
  height: calc(100vh - 76px);
  height: calc(100dvh - 76px);
  min-height: 500px;
  overflow: hidden;
}

/* One persistent background layer spans every chapter; the orchestrator only
   rewrites custom properties on it, so a project switch never recreates it.
   Six surfaces stack in the order the stage specifies: paper, three radial
   glows, the optional project image, then the pointer light.
   It is fixed to the viewport so the same sheet continues behind the sticky
   header: the glass pill then blurs one continuous paper instead of sitting
   on the seam between two background systems. */
.scene-background {
  position: fixed;
  inset: -6%;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  transform: scale(var(--scene-scale, 1));
  filter: blur(var(--scene-blur, 0px));
  transition: transform .55s ease, filter .55s ease;
  will-change: transform;
}
.scene-background > span {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}
/* 1. base paper */
.work-base {
  inset: 0;
  border-radius: 0;
  background: var(--scene-bg-color, var(--work-paper));
  transition: background-color .55s linear;
}

/* 1b. terrain — the structural layer that keeps the paper from reading as
      empty space. Two densities swap with the scene progress; the whole
      group drifts on the same 820ms curve as the chapter transition. */
.scene-terrain {
  position: absolute;
  inset: -12%;
  pointer-events: none;
  transform: translateX(calc(var(--scene-progress, 0) * -3%))
             scale(calc(1 + var(--scene-progress, 0) * .015));
  transition: transform .82s cubic-bezier(.22, .8, .2, 1);
  will-change: transform;
}
.scene-terrain svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  transition: opacity .62s ease;
}
.terrain-sparse {
  opacity: calc(.38 - var(--scene-progress, 0) * .24);
}
.terrain-dense {
  opacity: calc(.34 * var(--scene-progress, 0));
}

/* 1c. grain — paper tooth. Static by design; it must never move. */
.scene-grain {
  inset: 0;
  border-radius: 0;
  opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
}
/* 2. blue radial glow — far plane: drifts least, so the scene gains depth. */
.work-blue {
  width: 62vw;
  height: 62vw;
  left: calc(var(--scene-glow-x, -7vw) - 18vw);
  top: calc(var(--scene-glow-y, -5vh) - 22vw);
  background: radial-gradient(circle, var(--work-blue) 0%, transparent 70%);
  opacity: calc(.35 + var(--scene-progress, 0) * .2);
  filter: blur(90px);
  transform: translateX(calc(var(--scene-progress, 0) * 3vw)) scale(calc(.9 + var(--scene-progress, 0) * .07));
  transition: transform .82s cubic-bezier(.22, .8, .2, 1), opacity .62s ease;
}
/* 3. green radial glow — mid plane. */
.work-green {
  width: 48vw;
  height: 48vw;
  left: calc(-14vw + var(--scene-glow-x, 0) * .5);
  top: calc(6vh + var(--scene-glow-y, 0) * .5);
  background: radial-gradient(circle, var(--work-green) 0%, transparent 70%);
  opacity: calc(.4 - var(--scene-progress, 0) * .1 + .18 * max(0, 2 - var(--scene-progress, 0)) * max(0, var(--scene-progress, 0) - 1));
  filter: blur(96px);
  transform: translateX(calc(var(--scene-progress, 0) * -5vw)) translateY(calc(var(--scene-progress, 0) * 1.5vh));
  transition: transform .82s cubic-bezier(.22, .8, .2, 1), opacity .62s ease;
}
/* 4. lavender radial glow — near plane: follows the pointer through the
      existing --parallax-* variables, so it moves most. */
.work-lilac {
  width: 40vw;
  height: 40vw;
  right: calc(2vw - var(--scene-glow-x, 0) * .25);
  bottom: calc(-16vh - var(--scene-glow-y, 0) * .25);
  background: radial-gradient(circle, var(--work-lilac) 0%, transparent 70%);
  opacity: calc(.3 + var(--scene-progress, 0) * .18);
  filter: blur(90px);
  transform: translateX(calc(var(--scene-progress, 0) * 6vw)) translateY(calc(var(--scene-progress, 0) * -1vh));
  transition: transform .82s cubic-bezier(.22, .8, .2, 1), opacity .62s ease;
}
/* 5. project image layer — hidden until an image actually resolves, so a
      missing asset degrades to the three CSS gradients instead of a hole. */
.work-image {
  inset: 0;
  border-radius: 0;
  background-image: var(--scene-image, none);
  background-size: cover;
  background-position: center;
  opacity: 0;
  mix-blend-mode: multiply;
  transition: opacity .5s ease;
}
.scene-background[data-image-ready='true'] .work-image { opacity: .28; }
.scene-background[data-background-fallback='true'] .work-image { opacity: 0; }

/* 5b. light ribbon — a directional beam that rotates with the chapter. */
.scene-ribbon {
  position: absolute;
  top: -12%;
  right: -8%;
  width: calc(14vw + var(--scene-progress, 0) * 2vw);
  height: 130%;
  border-radius: 0;
  background: linear-gradient(
    105deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, .34) 42%,
    rgba(255, 255, 255, .12) 68%,
    rgba(255, 255, 255, 0) 100%
  );
  transform: rotate(calc(18deg - var(--scene-progress, 0) * 2deg))
             translateX(calc(var(--scene-progress, 0) * -2.5vw));
  filter: blur(34px);
  mix-blend-mode: soft-light;
  opacity: calc(.45 + var(--scene-progress, 0) * .08);
  transition: transform .82s cubic-bezier(.22, .8, .2, 1),
              opacity .62s ease,
              width .82s cubic-bezier(.22, .8, .2, 1);
  will-change: transform;
}
/* 6. pointer light layer */
.work-light {
  inset: 0;
  border-radius: 0;
  background: radial-gradient(
    circle at calc(50% + var(--parallax-shift-x, 0px)) calc(50% + var(--parallax-shift-y, 0px)),
    rgba(255, 255, 255, .5) 0%,
    transparent 55%
  );
  opacity: .45;
}
.scene-track {
  position: relative;
  z-index: 1;
  display: flex;
  width: 400vw;
  height: 100%;
  transform: translate3d(0, 0, 0);
  transition-property: transform;
  transition-timing-function: cubic-bezier(.65, .05, .36, 1);
  will-change: transform;
}

.scene-slide {
  flex: 0 0 100vw;
  width: 100vw;
  height: 100%;
  box-sizing: border-box;
  padding: 26px clamp(20px, 6vw, 90px) 92px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.chapter-kicker {
  margin: 0 0 18px;
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
}


/* --- cover chapter --- */
.cover-chapter__inner { max-width: 900px; }
.cover-title {
  margin: 0 0 26px;
  font-size: clamp(38px, 6vw, 84px);
  line-height: 1.04;
  letter-spacing: -.015em;
}
.cover-title__line { display: block; }
.cover-title__line--accent { font-style: italic; color: var(--muted); }
.cover-lede { margin: 0 0 34px; max-width: 54ch; color: var(--muted); font-size: clamp(15px, 1.4vw, 18px); line-height: 1.7; white-space: pre-line; }
.cover-actions { display: flex; gap: 14px; flex-wrap: wrap; }

/* --- chapter nav (arrows + dots) --- */
.scene-nav {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 7px 12px;
  border-radius: 999px;
  background: var(--glass-bg-strong);
  border: 1px solid var(--glass-line);
  box-shadow: var(--glass-shadow);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
}
.scene-nav__btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--glass-hairline);
  background: rgba(255, 255, 255, .5);
  color: var(--ink);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  transition: background-color .18s ease, transform .18s ease;
}
.scene-nav__btn:hover { background: var(--ink); color: var(--paper); transform: none; }
.scene-nav__btn:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.scene-dots { display: flex; gap: 8px; }
.scene-dot {
  width: 9px;
  height: 9px;
  padding: 0;
  border-radius: 50%;
  border: 0;
  background: rgba(23, 23, 19, .22);
  cursor: pointer;
  transition: background-color .18s ease, transform .18s ease;
}
.scene-dot.is-active { background: var(--ink); transform: scale(1.25); }
.scene-dot:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 3px; }

/* --- Work Stage: full-screen project gallery ----------------------------
   Three rows inside one full-height slide: head (kicker/title/subtitle),
   the deck (main card plus two neighbour peeks), and the footer counter.
   The main card is the only interactive card; peeks are decoration. */
.scene-slide.work-stage {
  height: 100%;
  padding: 28px var(--work-pad) 36px;
  justify-content: stretch;
  overflow: hidden;
}
.work-stage__inner {
  width: 100%;
  max-width: var(--work-max);
  margin-inline: auto;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: var(--work-gap);
  min-height: 0;
}

/* head ------------------------------------------------------------------- */
.work-stage__head {
  width: var(--work-head-w);
  min-width: 260px;
  flex: 0 0 auto;
  text-align: center;
}
.work-stage__kicker {
  margin: 0 0 12px;
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--work-muted);
}
.work-stage__title {
  margin: 0;
  font-size: clamp(44px, 4.6vw, 76px);
  line-height: 1.02;
  letter-spacing: -.02em;
  font-weight: 600;
  color: var(--work-ink);
  white-space: nowrap;
}
.work-stage__sub {
  margin: 16px auto 0;
  font-size: clamp(16px, 1.5vw, 21px);
  line-height: 1.55;
  font-weight: 500;
  color: rgba(32, 33, 30, .74);
  max-width: 58ch;
}

/* deck ------------------------------------------------------------------- */
.work-shelf {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  --work-shelf-h: 100%;
}
/* The cards box spans the shelf so the 22% edge zones measure the shelf
   itself; the deck inside is the exact card-sized box shared by the cards
   and the neighbour peeks, so a peek percentage is always relative to the
   card. */
.work-stage__cards {
  --work-peek: 14%;
  position: relative;
  width: 100%;
  height: 100%;
}
.work-deck {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: var(--work-card-w);
  height: min(var(--work-card-h), var(--work-shelf-h, 100%));
}

/* Hit zones for switching projects: the outer 22% on each side. They sit
   above the deck so a hover there always beats the chapter wheel. */
.work-shelf__edge {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 22%;
  z-index: 4;
}
.work-shelf__edge--prev { left: -18px; cursor: w-resize; }
.work-shelf__edge--next { right: -18px; cursor: e-resize; }
.work-shelf__edge::after {
  content: '';
  position: absolute;
  inset: 18% 0;
  opacity: 0;
  transition: opacity .2s ease;
}
.work-shelf__edge--prev::after {
  background: linear-gradient(90deg, rgba(32, 33, 30, .12), transparent);
  border-radius: 18px 0 0 18px;
}
.work-shelf__edge--next::after {
  background: linear-gradient(270deg, rgba(32, 33, 30, .12), transparent);
  border-radius: 0 18px 18px 0;
}
.work-shelf__edge:hover::after { opacity: 1; }

/* Neighbour peeks: the deck's other cards parked behind the active one so
   only --work-peek of their width shows. The rest offsets are derived from
   the approved 76% slide plus the .92 scale, so the visible strip stays
   exactly --work-peek (14% desktop, 10% tablet) instead of drifting. */
.work-peek {
  position: absolute;
  top: 0;
  height: 100%;
  width: 100%;
  z-index: 2;
  pointer-events: none;
  box-sizing: border-box;
  display: flex;
  align-items: flex-end;
  padding: clamp(16px, 2vw, 28px);
  border: 1px solid rgba(255, 255, 255, .62);
  border-radius: var(--work-radius);
  background: rgba(255, 255, 255, .30);
  -webkit-backdrop-filter: blur(24px) saturate(120%);
  backdrop-filter: blur(24px) saturate(120%);
  box-shadow: 0 24px 70px rgba(53, 57, 52, .12);
  color: var(--work-muted);
  font-family: 'DM Mono', monospace;
  font-size: 13px;
  letter-spacing: .1em;
  transition:
    transform 760ms cubic-bezier(.22, .8, .2, 1),
    opacity 620ms ease,
    filter 620ms ease;
}
.work-peek--prev {
  left: calc(72% - var(--work-peek));
  transform: translateX(-76%) scale(0.92);
  opacity: 0.58;
  z-index: 2;
  filter: blur(1px);
  justify-content: flex-end;
  text-align: right;
}
.work-peek--next {
  left: calc(var(--work-peek) - 72%);
  transform: translateX(76%) scale(0.92);
  opacity: 0.68;
  z-index: 2;
  filter: blur(1px);
  justify-content: flex-start;
}
/* the spec's glass card -------------------------------------------------- */
.work-card {
  position: absolute;
  inset: 0;
  z-index: 3;
  box-sizing: border-box;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: clamp(10px, 1.4vw, 18px);
  padding: clamp(24px, 3vw, 44px);
  text-align: left;
  color: var(--work-ink);
  background: rgba(255, 255, 255, 0.38);
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 28px;
  backdrop-filter: blur(24px) saturate(120%);
  -webkit-backdrop-filter: blur(24px) saturate(120%);
  box-shadow:
    0 24px 70px rgba(53, 57, 52, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.72);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px) scale(.98);
  filter: blur(1px);
  transition:
    transform 760ms cubic-bezier(.22, .8, .2, 1),
    opacity 620ms ease,
    filter 620ms ease,
    box-shadow .4s ease,
    visibility 0s linear 760ms;
}
.work-card[data-stack-pos="0"],
.work-card.active {
  z-index: 3;
  opacity: 1;
  visibility: visible;
  transform: translateX(0) scale(1);
  filter: blur(0);
  transition:
    transform 760ms cubic-bezier(.22, .8, .2, 1),
    opacity 620ms ease,
    filter 620ms ease,
    box-shadow .4s ease,
    visibility 0s linear 0s;
}
.work-card[data-stack-pos="0"]:hover {
  transform: translateY(-6px) scale(1.004);
  box-shadow:
    0 34px 84px rgba(53, 57, 52, .18),
    inset 0 1px 0 rgba(255, 255, 255, .9);
}
.work-card:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 4px; }

/* layer 1: metadata ------------------------------------------------------- */
.work-card__meta {
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--work-muted);
}
.work-card__index { color: var(--work-ink); font-weight: 600; }
.work-card__kicker { opacity: .85; }
.work-card__status {
  margin-left: auto;
  padding: 3px 9px;
  border: 1px solid rgba(32, 33, 30, .16);
  border-radius: 999px;
  background: rgba(255, 255, 255, .55);
}

/* layer 2: static product preview ---------------------------------------- */
.work-preview {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  padding: clamp(12px, 1.4vw, 20px);
  border: 1px solid rgba(255, 255, 255, .6);
  border-radius: 18px;
  background: rgba(255, 255, 255, .34);
  overflow: hidden;
}
.work-preview__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  min-height: 0;
  flex: 1 1 auto;
}
.work-preview__pane {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
  padding: clamp(9px, 1vw, 14px);
  border: 1px solid rgba(32, 33, 30, .1);
  border-radius: 12px;
  background: rgba(255, 255, 255, .58);
}
.work-preview__label {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--work-muted);
}
.work-preview__line {
  display: block;
  height: 7px;
  border-radius: 999px;
  background: rgba(32, 33, 30, .14);
}
.work-preview__line--mid { width: 68%; }
.work-preview__line--short { width: 44%; }
.work-preview__timeline { display: flex; flex-direction: column; gap: 7px; }
/* Planning card preview: a short roadmap, no pretend UI. */
.work-preview__roadmap { display: flex; flex-direction: column; gap: 9px; }
.work-roadmap__item {
  position: relative;
  padding-left: 17px;
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  letter-spacing: .05em;
  color: var(--work-muted);
}
.work-roadmap__item::before {
  content: '';
  position: absolute;
  left: 0;
  top: .4em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: 1px solid rgba(32, 33, 30, .3);
  background: transparent;
}
.work-roadmap__item[data-state='next']::before {
  background: var(--work-lilac);
  border-color: rgba(32, 33, 30, .4);
}
.work-roadmap__item[data-state='next'] { color: var(--work-ink); }
.work-preview__steps,
.work-preview__states { display: flex; gap: 8px; flex-wrap: wrap; }
.work-preview__tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.work-preview__tab {
  padding: 5px 11px;
  border: 1px solid rgba(32, 33, 30, .14);
  border-radius: 999px;
  background: rgba(255, 255, 255, .5);
  font-family: 'DM Mono', monospace;
  font-size: 10.5px;
  letter-spacing: .06em;
}
.work-preview__tab.is-on {
  background: var(--work-ink);
  border-color: var(--work-ink);
  color: var(--work-paper);
}
.work-step {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--work-muted);
}
.work-step::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(32, 33, 30, .28);
}
.work-step[data-state="received"]::before { background: var(--work-blue); }
.work-step[data-state="processing"]::before { background: var(--work-peach); }
.work-step[data-state="complete"]::before,
.work-step[data-state="answered"]::before { background: var(--work-green); }

/* layer 3: title and entry ------------------------------------------------ */
.work-card__foot { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.work-card__title {
  font-size: clamp(24px, 2.6vw, 40px);
  line-height: 1.06;
  letter-spacing: -.015em;
  font-weight: 600;
  text-transform: uppercase;
}
.work-card__summary {
  font-size: clamp(14px, 1.1vw, 17px);
  line-height: 1.55;
  color: var(--work-muted);
  max-width: 56ch;
}
.work-card__row {
  display: flex;
  align-items: center;
  gap: var(--work-gap);
  flex-wrap: wrap;
  margin-top: 4px;
}
.work-card__tags { display: flex; gap: 8px; flex-wrap: wrap; }
.work-card__tag {
  font-family: 'DM Mono', monospace;
  font-size: 10.5px;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 5px 10px;
  border: 1px solid rgba(32, 33, 30, .14);
  border-radius: 999px;
  background: rgba(255, 255, 255, .5);
}
.work-card__cta {
  margin-left: auto;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.work-card[data-stack-pos="0"]:hover .work-card__cta {
  text-decoration: underline;
  text-underline-offset: 5px;
}

/* footer ----------------------------------------------------------------- */
.work-stage__footer {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: var(--work-gap);
  color: var(--work-muted);
}
.work-stage__counter {
  margin: 0;
  min-width: 8ch;
  font-family: 'DM Mono', monospace;
  font-size: 13px;
  letter-spacing: .14em;
  color: var(--work-ink);
}
.work-stage__dots {
  display: flex;
  gap: 10px;
  align-items: center;
}
.work-stage__dot {
  width: 9px;
  height: 9px;
  padding: 0;
  border: 1px solid rgba(32, 33, 30, .35);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  transition: background-color .2s ease, transform .2s ease;
}
.work-stage__dot.is-active {
  background: var(--work-ink);
  transform: scale(1.25);
}
.work-stage__arrow {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(32, 33, 30, .18);
  border-radius: 50%;
  background: rgba(255, 255, 255, .45);
  color: var(--work-ink);
  font-size: 17px;
  cursor: pointer;
  transition: background-color .2s ease, border-color .2s ease;
}
.work-stage__arrow:hover {
  background: rgba(255, 255, 255, .8);
  border-color: rgba(32, 33, 30, .4);
}
.work-stage__arrow:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.work-stage__hint {
  margin: 0 0 0 auto;
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: lowercase;
  color: var(--work-muted);
}
/* --- contact chapter --- */
.contact-slide,
.contact-chapter.scene-slide { justify-content: center; }
.contact-chapter { gap: 0; }
.contact-chapter__intro { max-width: 560px; margin-bottom: 30px; }
.contact-chapter__intro h2 { margin: 0 0 14px; font-size: clamp(30px, 3.6vw, 52px); line-height: 1.1; }
.contact-chapter__blurb { margin: 0; color: var(--muted); line-height: 1.7; }
.contact-chapter__card { padding: clamp(20px, 2.6vw, 34px); border-radius: 22px; }
.glass-panel {
  background: var(--glass-bg-strong);
  border: 1px solid var(--glass-line);
  box-shadow: var(--glass-shadow), var(--glass-lift);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
}
.contact-rows { display: grid; gap: 4px; }
.contact-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  padding: 15px 4px;
  border-bottom: 1px solid var(--glass-hairline);
  text-decoration: none;
  color: var(--ink);
  transition: padding-left .18s ease, background-color .18s ease;
}
.contact-row:last-child { border-bottom: 0; }
a.contact-row:hover,
a.contact-row:focus-visible { padding-left: 10px; background: rgba(255, 255, 255, .4); }
.contact-row__label { font-family: 'DM Mono', monospace; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.contact-row__value { font-size: clamp(15px, 1.5vw, 18px); word-break: break-all; text-align: right; }
.contact-row--empty { color: var(--muted); }
.contact-row--empty .contact-row__value { color: var(--on-ink-quiet, #a5a49a); font-style: italic; }

/* --- private chapter --- */
.private-chapter h2 { margin: 0 0 12px; font-size: clamp(30px, 3.6vw, 52px); }
.private-chapter__note { margin: 0 0 26px; color: var(--muted); font-size: 14px; }
.private-chapter__panel { padding: clamp(20px, 2.6vw, 34px); border-radius: 22px; }
.private-empty { margin: 0; color: var(--muted); font-style: italic; }
.private-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-bottom: 22px; }
.private-stat {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 16px;
  border: 1px solid var(--glass-hairline);
  border-radius: 14px;
  background: rgba(255, 255, 255, .45);
}
.private-stat__type { font-family: 'DM Mono', monospace; font-size: 11px; letter-spacing: .06em; color: var(--muted); word-break: break-all; }
.private-stat__count { font-size: 26px; font-weight: 600; }
.private-columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 26px; }
.private-columns h3 { margin: 0 0 12px; font-size: 15px; text-transform: uppercase; letter-spacing: .08em; font-family: 'DM Mono', monospace; color: var(--muted); }
.private-recent { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.private-recent__item { display: flex; gap: 10px; align-items: baseline; font-size: 13px; color: var(--muted); }
.private-recent__item code { background: rgba(23, 23, 19, .07); padding: 2px 7px; border-radius: 6px; color: var(--ink); }
.private-recent__item time { margin-left: auto; font-family: 'DM Mono', monospace; font-size: 11px; }

/* --- glass effect switch: <html data-glass="off"> turns frosted glass off --- */
html[data-glass='off'] .scene-nav,
html[data-glass='off'] .work-card,
html[data-glass='off'] .glass-panel,
html[data-glass='off'] .site-header {
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  background: rgba(248, 246, 241, .97);
  border-color: rgba(23, 23, 19, .16);
  box-shadow: 0 14px 34px -26px rgba(23, 23, 19, .5);
}
html[data-glass='off'] .work-card[data-stack-pos="0"] { background: #ffffff; }

/* --- responsive --- */
@media (max-width: 980px) {
  .work-stage__head { min-width: 0; }
  .work-stage__title { font-size: clamp(34px, 6vw, 56px); white-space: normal; }
  .contact-chapter__intro { margin-bottom: 22px; }
}

/* tablet 768: wider card, tighter reveal, title steps down to 56px -------- */
@media (max-width: 768px) {
  .work-stage__cards {
    --work-peek: 10%;
    --work-card-w: 70vw;
    --work-card-h: 60vh;
  }
  .work-stage__title { font-size: 56px; }
  .work-stage__head { width: 100%; }
  .work-stage__sub { max-width: 46ch; }
}

/* phone 360: no hover zones, touch + buttons only, never wider than the
   viewport (padding 16px each side leaves calc(100vw - 32px) for the card). */
@media (max-width: 360px) {
  .scene-slide.work-stage { --work-pad: 16px; padding: 16px; }
  .work-stage__cards {
    --work-card-w: calc(100vw - 32px);
    --work-card-h: 70vh;
    --work-peek: 0%;
  }
  .work-stage__title { font-size: clamp(30px, 9vw, 40px); }
  /* One column on a phone: the card, the head and the footer bar share the
     slide, so the card's inner layers tighten instead of squeezing the
     preview out of its grid row. */
  .work-card { padding: 18px; gap: 8px; }
  .work-card__summary {
    font-size: 13px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .work-preview { padding: 8px; gap: 8px; }
  .work-preview__row { gap: 8px; }
  .work-preview__pane { padding: 8px; }
  .work-peek { display: none; }
  .work-shelf__edge { pointer-events: none; opacity: 0; }
  .work-shelf { touch-action: pan-y; }
  .work-stage__footer { flex-wrap: wrap; justify-content: center; gap: 14px; }
  .work-stage__counter { min-width: 0; }
  .work-stage__hint { margin-left: 0; width: 100%; text-align: center; }
}

@media (max-width: 720px) {
  .site-header { flex-wrap: wrap; row-gap: 8px; padding: 10px 12px; border-radius: 22px; }
  .site-nav { order: 3; width: 100%; justify-content: space-between; }
  .scene { height: calc(100vh - 130px); height: calc(100dvh - 130px); min-height: 440px; }
  .scene-slide { padding: 18px 16px 86px; justify-content: flex-start; }
  .scene-nav { bottom: 10px; gap: 10px; padding: 6px 10px; }
  .scene-nav__btn { width: 30px; height: 30px; }
  .cover-title { font-size: clamp(30px, 9vw, 44px); }
  .work-card__summary { font-size: 13px; }
  .contact-row { flex-direction: column; gap: 4px; }
  .contact-row__value { text-align: left; }
  .private-stats { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
}

/* --- reduced motion: state changes stay, movement goes --- */
@media (prefers-reduced-motion: reduce) {
  .scene-track { transition-duration: 0ms !important; }
  .scene-background { transition: none !important; transform: none !important; filter: none !important; }
  .scene-terrain,
  .scene-ribbon { transition: none !important; transform: none !important; }
  .terrain-sparse,
  .terrain-dense { transition: none !important; }
  .work-blue,
  .work-green,
  .work-lilac { transition: none !important; transform: none !important; }
  /* Rear cards keep their resting offset: that is layout, not motion. Only
     the front card's hover lift is an animation, so it is what gets cut. */
  .work-card,
  .scene-nav__btn,
  .scene-dot,
  .locale-switch__btn,
  .contact-row { transition: none !important; }
  .work-card[data-stack-pos="0"]:hover { transform: none !important; }
}

/* --- pointer follow: the scene layer and cover drift with the cursor.
      Values come from effects/pointer-parallax.js (--parallax-*). --- */
.scene-background {
  translate: var(--parallax-shift-x, 0px) var(--parallax-shift-y, 0px);
}
.cover-chapter__inner {
  transform: translate3d(
    calc(var(--parallax-shift-x, 0px) * .5),
    calc(var(--parallax-shift-y, 0px) * .5),
    0
  );
  transition: transform .25s ease-out;
}
@media (prefers-reduced-motion: reduce) {
  .scene-background { translate: none; }
  .cover-chapter__inner { transform: none; transition: none; }
}
