/* ==========================================================================
   Image to Prompt — site
   Design system: warm ivory / charcoal / stone, one grotesk + serif italic accents,
   12-column editorial grid, hairline rules, slow ease-out motion.
   ========================================================================== */

:root {
  /* palette */
  --ivory: #f1ede6;
  --bone: #e8e2d8;
  --stone: #d7cfc1;
  --ink: #191714;
  --ink-soft: #3a3631;
  --muted: #696257;
  --faint: #9a9285;
  --clay: #a4512f;
  --clay-soft: #c9845f;
  --night: #141310;
  --night-2: #1d1b17;
  --on-night: #eee9e0;
  --on-night-muted: #a59e91;

  /* contextual tokens (flip inside dark sections) */
  --bg: var(--ivory);
  --fg: var(--ink);
  --fg-muted: var(--muted);
  --rule: rgba(25, 23, 20, 0.15);
  --rule-soft: rgba(25, 23, 20, 0.07);
  --surface: var(--bone);

  /* type */
  --sans: "Inter Tight", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --serif: "Instrument Serif", "Times New Roman", serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;

  /* layout */
  --pad: clamp(16px, 2.2vw, 32px);
  --gap: clamp(12px, 1.4vw, 20px);
  --nav-h: 64px;
  --section-y: clamp(80px, 9vw, 144px);

  /* motion */
  --ease: cubic-bezier(0.25, 1, 0.5, 1);
  --ease-io: cubic-bezier(0.65, 0, 0.35, 1);

  color-scheme: light;
}

[data-theme="dark"] {
  --bg: var(--night);
  --fg: var(--on-night);
  --fg-muted: var(--on-night-muted);
  --rule: rgba(238, 233, 224, 0.16);
  --rule-soft: rgba(238, 233, 224, 0.07);
  --surface: var(--night-2);
  background: var(--bg);
  color: var(--fg);
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }
body {
  margin: 0;
  background: var(--ivory);
  color: var(--ink);
  font: 400 16px/1.5 var(--sans);
  letter-spacing: -0.006em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
::selection { background: var(--clay); color: var(--ivory); }
:focus-visible { outline: 1.5px solid var(--clay); outline-offset: 4px; }
p { margin: 0; }
ol, ul { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 400; }
code {
  font: 400 0.86em/1 var(--mono);
  padding: 3px 6px;
  background: var(--surface);
  border: 1px solid var(--rule-soft);
  border-radius: 2px;
  white-space: nowrap;
}

.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: fixed; left: var(--pad); top: 12px; z-index: 300;
  padding: 10px 14px; background: var(--ink); color: var(--ivory);
  font-size: 13px; text-decoration: none; transform: translateY(-200%);
  transition: transform 0.4s var(--ease);
}
.skip:focus { transform: none; }

.icon { width: 18px; height: 18px; flex: none; }

/* ---------- grid ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gap);
  padding-inline: var(--pad);
}
.grid > * { grid-column: 1 / -1; min-width: 0; }

/* ---------- type ---------- */
.display {
  font-size: clamp(60px, 9.4vw, 172px);
  line-height: 0.86;
  letter-spacing: -0.052em;
  font-weight: 400;
}
.h2 {
  font-size: clamp(42px, 6.3vw, 112px);
  line-height: 0.9;
  letter-spacing: -0.048em;
}
.h3 {
  font-size: clamp(26px, 2.4vw, 40px);
  line-height: 1.02;
  letter-spacing: -0.032em;
}
.lead {
  font-size: clamp(21px, 1.95vw, 30px);
  line-height: 1.14;
  letter-spacing: -0.028em;
}
.body-lg { font-size: 17px; line-height: 1.5; letter-spacing: -0.012em; color: var(--fg-muted); }
.meta {
  font-size: 12px;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -0.004em;
  color: var(--fg);
}
.meta--muted { color: var(--fg-muted); }
.idx {
  font: 400 11px/1 var(--mono);
  letter-spacing: 0;
  color: var(--fg-muted);
}
.display em, .h2 em, .lead em, .footer__closing em {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.015em;
  font-size: 1.08em;
  padding-right: 0.04em;
}

/* masked lines for reveals */
.ln { display: block; overflow: hidden; padding: 0.02em 0.08em 0.14em 0; margin: -0.02em 0 -0.14em; }
.ln > span { display: inline-block; will-change: transform; }

/* ---------- interactive primitives ---------- */
.roll { position: relative; display: inline-block; overflow: hidden; vertical-align: top; line-height: 1.25; }
.roll > span { position: relative; display: inline-block; transition: transform 0.65s var(--ease); }
.roll > span::after { content: attr(data-text); position: absolute; left: 0; top: 100%; }
a:hover .roll > span, button:hover .roll > span, .roll:hover > span { transform: translateY(-100%); }

.btn {
  position: relative; isolation: isolate; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: space-between; gap: 28px;
  height: 56px; padding: 0 20px 0 22px;
  background: var(--ink); color: var(--ivory);
  font-size: 15px; font-weight: 500; letter-spacing: -0.01em;
  text-decoration: none; border-radius: 2px;
}
.btn::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: var(--clay); transform: scaleY(0); transform-origin: 50% 100%;
  transition: transform 0.7s var(--ease);
}
.btn:hover::before { transform: scaleY(1); }
.btn__icon { position: relative; width: 18px; height: 18px; overflow: hidden; }
.btn__icon .icon { position: absolute; inset: 0; transition: transform 0.7s var(--ease); }
.btn__icon .icon + .icon { transform: translateY(-120%); }
.btn:hover .btn__icon .icon:first-child { transform: translateY(120%); }
.btn:hover .btn__icon .icon + .icon { transform: none; }
.btn__icon--diag .icon + .icon { transform: translate(-120%, 120%); }
.btn:hover .btn__icon--diag .icon:first-child { transform: translate(120%, -120%); }
.btn--sm { height: 38px; gap: 14px; padding: 0 12px 0 14px; font-size: 13px; }
.btn--sm .btn__icon, .btn--sm .icon { width: 15px; height: 15px; }
[data-theme="dark"] .btn { background: var(--on-night); color: var(--ink); }
[data-theme="dark"] .btn:hover { color: var(--ivory); }

.link {
  position: relative; display: inline-flex; align-items: center; gap: 8px;
  padding-bottom: 4px; text-decoration: none;
  font-size: 15px; font-weight: 500; letter-spacing: -0.01em;
}
.link::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: currentColor; transform-origin: 100% 50%;
}
.link:hover::after { animation: rule-redraw 0.9s var(--ease); }
@keyframes rule-redraw {
  0% { transform: scaleX(1); transform-origin: 100% 50%; }
  45% { transform: scaleX(0); transform-origin: 100% 50%; }
  46% { transform: scaleX(0); transform-origin: 0 50%; }
  100% { transform: scaleX(1); transform-origin: 0 50%; }
}
.link--quiet::after { transform: scaleX(0); transform-origin: 0 50%; transition: transform 0.6s var(--ease); }
.link--quiet:hover::after { animation: none; transform: scaleX(1); }

/* ---------- preloader ---------- */
.preloader { display: none; }
html.is-loading { overflow: hidden; }
html.is-loading .preloader {
  position: fixed; inset: 0; z-index: 400; display: flex; flex-direction: column;
  justify-content: space-between; background: var(--ivory); color: var(--ink);
  padding: calc(var(--pad) + 6px) var(--pad);
}
.preloader__cols {
  position: absolute; inset: 0; display: grid; grid-template-columns: repeat(4, 1fr);
  padding-inline: var(--pad); pointer-events: none;
}
.preloader__cols span { border-left: 1px solid var(--rule-soft); }
.preloader__cols span:last-child { border-right: 1px solid var(--rule-soft); }
.preloader__row { position: relative; display: flex; justify-content: space-between; align-items: baseline; }
.preloader__line {
  position: absolute; left: var(--pad); right: var(--pad); top: 50%; transform: translateY(-50%);
  display: flex; justify-content: center; gap: 0.32em; flex-wrap: wrap;
}
.preloader__line .lead { color: var(--fg); }
.preloader__line .lead em { color: var(--muted); }
.preloader__bar { position: relative; height: 1px; background: var(--rule); overflow: hidden; }
.preloader__bar span { position: absolute; inset: 0; background: var(--ink); transform: scaleX(0); transform-origin: 0 50%; }
.preloader__count { font-variant-numeric: tabular-nums; }

/* ---------- scroll progress + cursor ---------- */
.progress {
  position: fixed; left: 0; right: 0; top: 0; z-index: 120; height: 2px; pointer-events: none;
}
.progress span { display: block; height: 100%; background: var(--clay); transform: scaleX(0); transform-origin: 0 50%; }

.cursor { display: none; }
html.has-cursor .cursor {
  display: block; position: fixed; left: 0; top: 0; z-index: 350; pointer-events: none;
  width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%;
  background: #fff; mix-blend-mode: difference;
  transition: width 0.5s var(--ease), height 0.5s var(--ease), margin 0.5s var(--ease), opacity 0.3s;
}
html.has-cursor .cursor.is-hover { width: 46px; height: 46px; margin: -23px 0 0 -23px; }
html.has-cursor .cursor.is-hidden { opacity: 0; }

/* ---------- navigation ---------- */
.nav {
  --fg: var(--ink); --fg-muted: var(--muted); --rule: rgba(25, 23, 20, 0.12);
  position: fixed; inset: 0 0 auto; z-index: 100; height: var(--nav-h); color: var(--fg);
  transition: transform 0.8s var(--ease), background-color 0.5s var(--ease), color 0.5s var(--ease), box-shadow 0.5s var(--ease);
}
.nav.is-scrolled {
  background: color-mix(in srgb, var(--ivory) 86%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(1.1);
  backdrop-filter: blur(14px) saturate(1.1);
  box-shadow: inset 0 -1px 0 var(--rule);
}
.nav.is-dark { --fg: var(--on-night); --fg-muted: var(--on-night-muted); --rule: rgba(238, 233, 224, 0.14); }
.nav.is-dark.is-scrolled { background: color-mix(in srgb, var(--night) 80%, transparent); }
.nav.is-hidden { transform: translateY(-101%); }
html.menu-open .nav { transform: none; background: transparent; box-shadow: none; --fg: var(--ink); --fg-muted: var(--muted); -webkit-backdrop-filter: none; backdrop-filter: none; }

.nav__inner { height: 100%; align-items: center; }
.brand {
  grid-column: 1 / 7; justify-self: start;
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 14px; font-weight: 500; letter-spacing: -0.015em; text-decoration: none; color: var(--fg);
}
.brand__mark { width: 11px; height: 11px; background: var(--clay); border-radius: 1px; transition: transform 0.7s var(--ease); }
.brand:hover .brand__mark { transform: rotate(90deg); }
.nav__links { display: none; }
.nav__cta { display: none; }
.nav__toggle {
  grid-column: 7 / 13; justify-self: end;
  display: inline-flex; align-items: center; gap: 10px; height: 40px;
  font-size: 13px; font-weight: 500; letter-spacing: -0.01em;
}
.nav__toggle-lines { position: relative; width: 18px; height: 8px; }
.nav__toggle-lines::before, .nav__toggle-lines::after {
  content: ""; position: absolute; left: 0; right: 0; height: 1.5px; background: currentColor;
  transition: transform 0.6s var(--ease), top 0.6s var(--ease);
}
.nav__toggle-lines::before { top: 0; }
.nav__toggle-lines::after { top: 6.5px; }
html.menu-open .nav__toggle-lines::before { top: 3.25px; transform: rotate(45deg); }
html.menu-open .nav__toggle-lines::after { top: 3.25px; transform: rotate(-45deg); }

@media (min-width: 900px) {
  .brand { grid-column: 1 / 4; }
  .nav__links {
    grid-column: 4 / 11; display: flex; justify-content: space-between; padding-right: 8%;
  }
  .nav__link {
    position: relative; display: inline-flex; align-items: baseline; gap: 8px;
    font-size: 13px; font-weight: 500; letter-spacing: -0.012em; text-decoration: none; color: var(--fg);
  }
  .nav__link .idx { transition: color 0.4s var(--ease); }
  .nav__link::before {
    content: ""; position: absolute; left: -12px; top: 50%; width: 5px; height: 5px; margin-top: -2px;
    background: var(--clay); border-radius: 50%; transform: scale(0); transition: transform 0.5s var(--ease);
  }
  .nav__link.is-active::before { transform: scale(1); }
  .nav__link.is-active .idx { color: var(--fg); }
  .nav__cta { grid-column: 11 / 13; justify-self: end; display: inline-flex; }
  .nav.is-dark .nav__cta { background: var(--on-night); color: var(--ink); }
  .nav.is-dark .nav__cta:hover { color: var(--ivory); }
  .nav__toggle { display: none; }
}

/* mobile menu */
.menu {
  position: fixed; inset: 0; z-index: 90; background: var(--ivory); color: var(--ink);
  display: flex; flex-direction: column; justify-content: space-between;
  padding: calc(var(--nav-h) + 32px) var(--pad) calc(var(--pad) + 8px);
  visibility: hidden; clip-path: inset(0 0 100% 0);
  transition: clip-path 0.9s var(--ease-io), visibility 0s linear 0.9s;
}
.menu.is-open { visibility: visible; clip-path: inset(0 0 0 0); transition: clip-path 0.9s var(--ease-io), visibility 0s; }
.menu__links li { border-top: 1px solid var(--rule); overflow: hidden; }
.menu__links li:last-child { border-bottom: 1px solid var(--rule); }
.menu__links a {
  display: flex; align-items: baseline; gap: 16px; padding: 14px 0;
  font-size: clamp(36px, 10vw, 56px); line-height: 1; letter-spacing: -0.045em; text-decoration: none;
  transform: translateY(105%); transition: transform 0.9s var(--ease);
}
.menu.is-open .menu__links a { transform: none; transition-delay: calc(0.18s + var(--i) * 0.06s); }
.menu__foot { display: grid; gap: 20px; opacity: 0; transition: opacity 0.6s var(--ease); }
.menu.is-open .menu__foot { opacity: 1; transition-delay: 0.45s; }
.menu__foot .btn { width: 100%; }
.menu__meta { display: flex; justify-content: space-between; }
@media (min-width: 900px) { .menu { display: none; } }

/* ---------- hero ---------- */
.hero { position: relative; min-height: 100svh; display: flex; flex-direction: column; padding-bottom: var(--pad); }
.hero__cols {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  display: grid; grid-template-columns: repeat(4, 1fr); padding-inline: var(--pad);
}
.hero__cols span { border-left: 1px solid var(--rule-soft); }
.hero__cols span:last-child { border-right: 1px solid var(--rule-soft); }
.hero > .grid { position: relative; z-index: 1; }
.hero__meta { padding-top: calc(var(--nav-h) + 16px); row-gap: 6px; }
.hero__meta .meta:nth-child(n + 3) { display: none; }
.hero__body { margin-top: clamp(48px, 9vh, 104px); row-gap: clamp(28px, 4.5vh, 48px); align-items: start; }
.hero__title { font-size: clamp(52px, 15vw, 172px); }
.hero__intro { display: grid; gap: 32px; max-width: 34rem; }
.hero__cta { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 28px; }
.hero__figure { margin: 0; }
.hero__foot { margin-top: clamp(40px, 6vh, 72px); align-items: end; row-gap: 6px; }
.hero__foot .meta:nth-child(n + 2) { display: none; }
.scroll-cue { display: inline-flex; align-items: center; gap: 10px; }
.scroll-cue__line { position: relative; width: 1px; height: 28px; background: var(--rule); overflow: hidden; }
.scroll-cue__line::after {
  content: ""; position: absolute; left: 0; top: 0; width: 1px; height: 100%; background: var(--fg);
  animation: cue 2.4s var(--ease-io) infinite;
}
@keyframes cue { 0% { transform: translateY(-100%); } 55% { transform: translateY(0); } 100% { transform: translateY(100%); } }

.frame { position: relative; overflow: hidden; background: var(--bone); }
.frame img { width: 100%; height: 100%; object-fit: cover; }
.hero__figure .frame { aspect-ratio: 4 / 5; }
.figcap { display: flex; justify-content: space-between; gap: 16px; margin-top: 10px; }

@media (min-width: 600px) {
  .hero__meta .meta:nth-child(n + 3) { display: block; }
  .hero__meta .meta:nth-child(1) { grid-column: 1 / 7; }
  .hero__meta .meta:nth-child(2) { grid-column: 7 / 13; }
  .hero__meta .meta:nth-child(3) { display: none; }
  .hero__meta .meta:nth-child(4) { display: none; }
  .hero__figure { grid-column: 5 / 13; }
}
@media (min-width: 900px) {
  .hero__meta .meta:nth-child(1) { grid-column: 1 / 4; }
  .hero__meta .meta:nth-child(2) { grid-column: 4 / 7; }
  .hero__meta .meta:nth-child(3) { grid-column: 7 / 10; display: block; }
  .hero__meta .meta:nth-child(4) { grid-column: 10 / 13; display: block; justify-self: end; text-align: right; }
  .hero__body { row-gap: clamp(28px, 4vh, 48px); }
  .hero__title { grid-column: 1 / 10; grid-row: 1; font-size: clamp(60px, 9.4vw, 172px); }
  .hero__figure { grid-column: 10 / 13; grid-row: 1 / 3; align-self: start; margin-top: 0.4vw; }
  .hero__intro { grid-column: 1 / 6; grid-row: 2; }
  .hero__foot .meta:nth-child(n + 2) { display: block; }
  .hero__foot .meta:nth-child(1) { grid-column: 1 / 4; }
  .hero__foot .meta:nth-child(2) { grid-column: 4 / 7; }
  .hero__foot .meta:nth-child(3) { grid-column: 7 / 10; }
  .hero__foot .meta:nth-child(4) { grid-column: 10 / 13; justify-self: end; text-align: right; }
}
@media (min-width: 1200px) {
  .hero__figure { grid-column: 9 / 13; }
}

/* ---------- section scaffolding ---------- */
.section { position: relative; padding-block: var(--section-y); }
.section-head { row-gap: 22px; margin-bottom: clamp(48px, 6vw, 88px); }
.section-head .h2 { max-width: 15ch; }
.section-head .body-lg { max-width: 32rem; }
.label { display: inline-flex; align-items: baseline; gap: 10px; }
@media (min-width: 900px) {
  .section-head .label { grid-column: 1 / 4; }
  .section-head .h2 { grid-column: 4 / 13; }
  .section-head .body-lg { grid-column: 4 / 9; margin-top: 16px; }
  .section-head--split .body-lg { grid-column: 9 / 13; grid-row: 2; align-self: end; margin-top: 0; }
  .section-head--split .h2 { grid-column: 4 / 9; }
}

/* reveal states (only when motion is on) */
.motion [data-fade] { opacity: 0; transform: translateY(26px); transition: opacity 1.1s var(--ease), transform 1.3s var(--ease); transition-delay: calc(var(--d, 0) * 1s); }
.motion [data-fade].is-in { opacity: 1; transform: none; }
.motion [data-lines] .ln > span { transform: translateY(112%); transition: transform 1.35s var(--ease); }
.motion [data-lines].is-in .ln > span { transform: none; }
.motion [data-lines] .ln:nth-child(2) > span { transition-delay: 0.09s; }
.motion [data-lines] .ln:nth-child(3) > span { transition-delay: 0.18s; }
.motion [data-rule]::before { transform: scaleX(0); }
.motion [data-rule].is-in::before { transform: scaleX(1); transition: transform 1.4s var(--ease); }

/* hero intro states, released by .is-ready */
.motion .hero [data-hero] { opacity: 0; transform: translateY(18px); transition: opacity 1s var(--ease), transform 1.2s var(--ease); transition-delay: calc(0.35s + var(--d, 0) * 1s); }
.motion.is-ready .hero [data-hero] { opacity: 1; transform: none; }
.motion .hero__title .ln > span { transform: translateY(112%); transition: transform 1.5s var(--ease); }
.motion .hero__title .ln:nth-child(2) > span { transition-delay: 0.12s; }
.motion.is-ready .hero__title .ln > span { transform: none; }
.motion .hero__figure .frame { clip-path: inset(100% 0 0 0); transition: clip-path 1.7s var(--ease-io) 0.1s; }
.motion .hero__figure img { transform: scale(1.28); transition: transform 2.2s var(--ease) 0.25s; }
.motion.is-ready .hero__figure .frame { clip-path: inset(0 0 0 0); }
.motion.is-ready .hero__figure img { transform: scale(1.12); }

/* ---------- 02 demonstration ---------- */
.demo { padding-top: var(--section-y); padding-bottom: clamp(72px, 8vw, 120px); }
.demo__stage { position: relative; }
.demo__bar { align-items: end; row-gap: 14px; margin-bottom: 28px; }
.demo__steps { display: flex; gap: clamp(16px, 3vw, 44px); flex-wrap: wrap; }
.demo__steps li { display: inline-flex; gap: 8px; align-items: baseline; font-size: 13px; font-weight: 500; letter-spacing: -0.01em; }
.demo__count { justify-self: start; font-variant-numeric: tabular-nums; }
.demo__track { position: relative; grid-column: 1 / -1; height: 1px; background: var(--rule); margin-top: 4px; }
.demo__track span { position: absolute; inset: 0; background: var(--fg); transform: scaleX(1); transform-origin: 0 50%; }
.demo__body { row-gap: 40px; align-items: center; }
.demo__figure { margin: 0; }
.demo__figure .frame { aspect-ratio: 4 / 5; width: 100%; }
.demo__figure .figcap { color: var(--fg-muted); }

.thirds { position: absolute; inset: 0; pointer-events: none; }
.thirds span { position: absolute; background: rgba(25, 23, 20, 0.28); }
.thirds span:nth-child(1), .thirds span:nth-child(2) { top: 0; bottom: 0; width: 1px; }
.thirds span:nth-child(1) { left: 33.333%; }
.thirds span:nth-child(2) { left: 66.666%; }
.thirds span:nth-child(3), .thirds span:nth-child(4) { left: 0; right: 0; height: 1px; }
.thirds span:nth-child(3) { top: 33.333%; }
.thirds span:nth-child(4) { top: 66.666%; }

.marker { position: absolute; left: var(--x); top: var(--y); width: 0; height: 0; }
.marker__ring {
  position: absolute; left: -11px; top: -11px; width: 22px; height: 22px; border-radius: 50%;
  border: 1px solid var(--ink); background: rgba(241, 237, 230, 0.35);
}
.marker__ring::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 5px; height: 5px; margin: -2.5px 0 0 -2.5px;
  border-radius: 50%; background: var(--clay);
}
.marker__ring::before {
  content: ""; position: absolute; left: 50%; top: 50%; width: 38px; height: 38px; margin: -19px 0 0 -19px;
  border-radius: 50%; border: 1px solid rgba(25, 23, 20, 0.25);
}
.marker__tag {
  position: absolute; top: -9px; left: 22px; white-space: nowrap;
  display: inline-flex; gap: 6px; align-items: baseline;
  padding: 4px 7px; background: var(--ivory); color: var(--ink);
  font: 500 10.5px/1 var(--sans); letter-spacing: 0;
}
.marker__tag .idx { color: var(--clay); font-size: 10px; }
.marker--left .marker__tag { left: auto; right: 22px; }

.demo__panel { display: grid; gap: 48px; }
.fields { border-bottom: 1px solid var(--rule); }
.field { display: grid; grid-template-columns: 1fr; gap: 6px; padding: 16px 0 18px; border-top: 1px solid var(--rule); }
.field__label { display: inline-flex; gap: 10px; align-items: baseline; }
.field__text { font-size: 16px; line-height: 1.45; letter-spacing: -0.012em; color: var(--fg); }
@media (min-width: 600px) {
  .field { grid-template-columns: 9.5rem 1fr; gap: 20px; }
}

.output__head { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--rule); }
.tabs { display: inline-flex; gap: 22px; }
.tab {
  position: relative; padding: 6px 0; font-size: 13px; font-weight: 500; letter-spacing: -0.01em;
  color: var(--fg-muted); transition: color 0.4s var(--ease);
}
.tab::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: currentColor;
  transform: scaleX(0); transform-origin: 0 50%; transition: transform 0.6s var(--ease);
}
.tab[aria-selected="true"] { color: var(--fg); }
.tab[aria-selected="true"]::after { transform: scaleX(1); }
.tab:hover { color: var(--fg); }
.copy {
  display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px;
  border: 1px solid var(--rule); border-radius: 2px; font-size: 12px; font-weight: 500;
  transition: border-color 0.4s var(--ease), background-color 0.4s var(--ease), color 0.4s var(--ease);
}
.copy:hover { border-color: var(--fg); }
.copy .icon { width: 14px; height: 14px; }
.copy .icon--done { display: none; }
.copy.is-done { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.copy.is-done .icon--copy { display: none; }
.copy.is-done .icon--done { display: block; }
.output__body { padding-top: 22px; }
.output__prompt {
  font-size: clamp(19px, 1.55vw, 24px); line-height: 1.32; letter-spacing: -0.02em; color: var(--fg);
}
.output__prompt .w { transition: opacity 0.4s; }
.output__json {
  margin: 0; max-height: 22rem; overflow: auto; font: 400 12.5px/1.65 var(--mono); color: var(--fg-muted);
  white-space: pre-wrap; word-break: break-word; overscroll-behavior: contain;
}
.output__json .k { color: var(--clay-soft); }
.output__note { margin-top: 18px; color: var(--fg-muted); }

@media (min-width: 900px) {
  .demo__bar .demo__steps { grid-column: 1 / 9; }
  .demo__bar .demo__count { grid-column: 9 / 13; justify-self: end; }
  .demo__figure { grid-column: 1 / 6; }
  .demo__panel { grid-column: 7 / 13; }
}

/* pinned state (desktop, motion on) */
.demo.is-pinned .demo__stage {
  height: 100svh; display: flex; flex-direction: column;
  padding-top: calc(var(--nav-h) + 20px); padding-bottom: var(--pad);
}
.demo.is-pinned .demo__body { flex: 1; min-height: 0; }
.demo.is-pinned .demo__figure .frame { width: auto; height: min(calc(100svh - var(--nav-h) - 170px), 46vw); aspect-ratio: 4 / 5; }
.demo.is-pinned .demo__panel { display: grid; gap: 0; align-self: center; }
.demo.is-pinned .demo__panel > * { grid-area: 1 / 1; }
.demo.is-pinned .demo__steps li { opacity: 0.35; transition: opacity 0.5s var(--ease); }
.demo.is-pinned .demo__steps li.is-active { opacity: 1; }
.demo.is-pinned .demo__steps li.is-done { opacity: 0.6; }
.demo.is-pinned .demo__track span { transform: scaleX(0); }

/* ---------- 03 how it works ---------- */
.how__row { position: relative; padding-block: clamp(28px, 3.6vw, 52px); row-gap: 18px; align-items: start; }
.how__row::before {
  content: ""; position: absolute; left: var(--pad); right: var(--pad); top: 0; height: 1px; background: var(--rule);
  transform-origin: 0 50%;
}
.how__list { border-bottom: 1px solid var(--rule); margin-inline: var(--pad); }
.how__list .how__row { padding-inline: 0; }
.how__list .how__row::before { left: 0; right: 0; }
.how__num {
  font-size: clamp(56px, 7vw, 120px); line-height: 0.8; letter-spacing: -0.06em; font-weight: 400;
  transition: color 0.6s var(--ease);
}
.how__row:hover .how__num { color: var(--clay); }
.how__text { font-size: 17px; line-height: 1.5; letter-spacing: -0.012em; color: var(--fg-muted); max-width: 30rem; }
.how__text em { font-style: normal; color: var(--fg); }
.how__art { aspect-ratio: 4 / 3; background: var(--bone); border: 1px solid var(--rule-soft); overflow: hidden; max-width: 22rem; }
.how__art svg { width: 100%; height: 100%; transition: transform 1s var(--ease); }
.how__row:hover .how__art svg { transform: scale(1.04); }
@media (min-width: 900px) {
  .how__num { grid-column: 1 / 3; }
  .how__row .h3 { grid-column: 3 / 6; padding-top: 6px; }
  .how__text { grid-column: 6 / 10; padding-top: 10px; }
  .how__art { grid-column: 10 / 13; max-width: none; }
}
.how__foot { margin-top: 40px; }
.how__foot p { max-width: 36rem; }
@media (min-width: 900px) { .how__foot p { grid-column: 6 / 11; } }

/* ---------- 04 features: five lenses ---------- */
.lenses { position: relative; }
.lenses__stage { position: relative; }
.lenses__top { align-items: baseline; padding-bottom: 18px; }
.lenses__top .meta:last-child { justify-self: start; font-variant-numeric: tabular-nums; }
.lens { position: relative; padding: 26px var(--pad) 40px; border-top: 1px solid var(--rule); }
.lens__idx { display: block; margin-bottom: 16px; }
.lens__word { overflow: hidden; padding: 0.02em 0.06em 0.1em 0; margin-bottom: 18px; }
.lens__word span {
  display: inline-block; font-size: clamp(64px, 17vw, 300px); line-height: 0.82; letter-spacing: -0.065em; will-change: transform;
}
.lens__body { display: grid; gap: 10px; max-width: 30rem; }
.lens__desc { font-size: clamp(17px, 1.5vw, 22px); line-height: 1.3; letter-spacing: -0.02em; }
.lens__eg { color: var(--fg-muted); }
@media (min-width: 900px) {
  .lenses__top .meta:last-child { grid-column: 10 / 13; justify-self: end; }
}
.lenses.is-pinned .lenses__stage {
  height: 100svh; display: grid; grid-template-rows: auto 1fr; padding-top: calc(var(--nav-h) + 20px); padding-bottom: var(--pad);
}
.lenses.is-pinned .lenses__list { position: relative; border-top: 1px solid var(--rule); margin-inline: var(--pad); }
.lenses.is-pinned .lens {
  position: absolute; inset: 0; padding: 0; border: 0;
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap);
  grid-template-rows: 1fr auto; align-items: end;
}
.lenses.is-pinned .lens__idx { position: absolute; left: 0; top: 22px; }
.lenses.is-pinned .lens__word { grid-column: 1 / -1; grid-row: 1; align-self: center; margin: 0; }
.lenses.is-pinned .lens__word span { font-size: clamp(96px, 17.5vw, 320px); }
.lenses.is-pinned .lens__body { grid-column: 8 / 13; grid-row: 2; padding-bottom: 6px; }

.caps { margin-top: clamp(96px, 11vw, 168px); row-gap: 28px; }
.caps__list { display: grid; grid-template-columns: 1fr; column-gap: var(--gap); }
.cap { position: relative; display: grid; grid-template-columns: 2.25rem 1fr; gap: 6px 12px; padding: 22px 0 30px; }
.cap::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px; background: var(--rule); transform-origin: 0 50%; }
.cap .idx { padding-top: 6px; }
.cap h3 { font-size: 21px; line-height: 1.15; letter-spacing: -0.025em; }
.cap p { grid-column: 2; color: var(--fg-muted); font-size: 15px; line-height: 1.5; max-width: 26rem; }
@media (min-width: 700px) { .caps__list { grid-template-columns: 1fr 1fr; } }
@media (min-width: 900px) {
  .caps__label { grid-column: 1 / 4; }
  .caps__list { grid-column: 4 / 13; }
}

/* ---------- 05 generators ---------- */
.gens { overflow: hidden; }
.gens__rows { display: grid; gap: clamp(6px, 1vw, 14px); margin-top: clamp(8px, 2vw, 24px); }
.gens__row {
  display: flex; gap: 0.3em; white-space: nowrap; width: max-content;
  font-size: clamp(54px, 9.6vw, 176px); line-height: 1; letter-spacing: -0.05em; will-change: transform;
}
.gens__row .sep { color: var(--faint); font-weight: 300; }
.gens__row--serif { font-family: var(--serif); font-style: italic; letter-spacing: -0.02em; color: var(--muted); }
.gens__row--serif .sep { font-family: var(--sans); font-style: normal; }
.gens__foot { margin-top: clamp(40px, 5vw, 72px); row-gap: 16px; }
@media (min-width: 900px) {
  .gens__foot .meta { grid-column: 1 / 4; }
  .gens__foot .body-lg { grid-column: 4 / 9; }
}

/* ---------- 06 install ---------- */
.install__wrap { row-gap: 56px; align-items: start; }
.install__aside { display: grid; gap: 26px; align-content: start; }
.install__aside .h2 { max-width: 10ch; }
.install__aside .body-lg { max-width: 28rem; }
.specs { display: grid; grid-template-columns: auto 1fr; border-top: 1px solid var(--rule); max-width: 30rem; }
.specs dt, .specs dd { margin: 0; padding: 11px 0; border-bottom: 1px solid var(--rule); font-size: 13px; }
.specs dt { color: var(--fg-muted); padding-right: 32px; }
.specs dd { font-weight: 500; }
.steps { counter-reset: step; }
.step { position: relative; display: grid; grid-template-columns: 3.5rem 1fr; gap: 8px 16px; padding: 28px 0 38px; }
.step::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px; background: var(--rule); transform-origin: 0 50%; }
.step:last-child { border-bottom: 1px solid var(--rule); }
.step__num { font-size: clamp(32px, 3vw, 44px); line-height: 0.9; letter-spacing: -0.05em; color: var(--clay); }
.step h3 { font-size: clamp(22px, 2vw, 30px); line-height: 1.1; letter-spacing: -0.03em; }
.step p { grid-column: 2; color: var(--fg-muted); font-size: 16px; max-width: 30rem; }
.step a { color: var(--fg); }
.notes { margin-top: clamp(72px, 9vw, 128px); row-gap: 24px; }
.notes__list { display: grid; gap: 24px; }
.note { position: relative; padding-top: 18px; color: var(--fg-muted); font-size: 15px; line-height: 1.5; }
.note::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px; background: var(--rule); transform-origin: 0 50%; }
.note strong { display: block; color: var(--fg); font-weight: 500; margin-bottom: 6px; }
@media (min-width: 700px) { .notes__list { grid-template-columns: repeat(3, 1fr); gap: var(--gap); } }
@media (min-width: 900px) {
  .install__aside { grid-column: 1 / 6; position: sticky; top: calc(var(--nav-h) + 32px); }
  .steps { grid-column: 7 / 13; }
  .notes__label { grid-column: 1 / 4; }
  .notes__list { grid-column: 4 / 13; }
}

/* ---------- 07 technology ---------- */
.stats { row-gap: 0; margin-bottom: clamp(56px, 7vw, 96px); }
.stat { position: relative; padding: 18px 0 28px; display: grid; gap: 14px; }
.stat::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px; background: var(--rule); transform-origin: 0 50%; }
.stat__num { font-size: clamp(64px, 8.4vw, 150px); line-height: 0.8; letter-spacing: -0.06em; font-variant-numeric: tabular-nums; }
.stat__label { color: var(--fg-muted); max-width: 14rem; }
@media (min-width: 600px) { .stat { grid-column: span 6; } }
@media (min-width: 900px) { .stat { grid-column: span 3; } }

.arch { position: relative; margin-bottom: clamp(88px, 10vw, 152px); }
.arch__head { margin-bottom: 28px; row-gap: 10px; }
@media (min-width: 900px) {
  .arch__head .meta:first-child { grid-column: 1 / 4; }
  .arch__head .meta:last-child { grid-column: 4 / 13; }
}
.arch__map { position: relative; display: grid; gap: 14px; padding-inline: var(--pad); }
.arch__lines { display: none; }
.node { position: relative; padding: 18px 18px 20px; border: 1px solid var(--rule); background: var(--night-2); }
.node__tag { display: flex; justify-content: space-between; margin-bottom: 26px; }
.node h3 { font-size: 21px; line-height: 1.1; letter-spacing: -0.025em; margin-bottom: 8px; }
.node p { color: var(--fg-muted); font-size: 14px; line-height: 1.45; }
.node--hub { border-color: color-mix(in srgb, var(--clay-soft) 70%, transparent); }
.node--hub .node__tag .idx:first-child { color: var(--clay-soft); }
@media (min-width: 900px) {
  .arch__map { grid-template-columns: repeat(12, minmax(0, 1fr)); grid-template-rows: auto auto; column-gap: var(--gap); row-gap: 20px; }
  .node--a { grid-column: 1 / 4; grid-row: 1 / 3; align-self: center; }
  .node--b { grid-column: 5 / 8; grid-row: 1 / 3; align-self: center; }
  .node--c { grid-column: 9 / 13; grid-row: 1; }
  .node--d { grid-column: 9 / 13; grid-row: 2; }
  .arch__lines { display: block; position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
  .arch__lines path { fill: none; stroke: var(--on-night-muted); stroke-width: 1; }
  .motion .arch__lines path { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 1.6s var(--ease-io); }
  .motion .arch.is-in .arch__lines path { stroke-dashoffset: 0; }
  .motion .arch.is-in .arch__lines path:nth-child(2) { transition-delay: 0.5s; }
  .motion .arch.is-in .arch__lines path:nth-child(3) { transition-delay: 0.65s; }
}

.decisions { row-gap: 0; margin-bottom: clamp(88px, 10vw, 152px); }
.decisions__label { margin-bottom: 24px; }
.decision { position: relative; display: grid; grid-template-columns: 2.5rem 1fr; gap: 8px 12px; padding: 24px 0 34px; }
.decision::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px; background: var(--rule); transform-origin: 0 50%; }
.decision .idx { padding-top: 7px; }
.decision h3 { font-size: clamp(21px, 1.8vw, 26px); line-height: 1.12; letter-spacing: -0.028em; }
.decision p { grid-column: 2; color: var(--fg-muted); font-size: 15px; line-height: 1.5; max-width: 30rem; }
@media (min-width: 900px) {
  .decisions__label { grid-column: 1 / 4; }
  .decision { grid-column: span 6; padding-right: 8%; }
  .decision:nth-of-type(odd) { grid-column: 4 / 8; }
  .decision:nth-of-type(even) { grid-column: 9 / 13; }
}

.stack { row-gap: 0; }
.stack__label { margin-bottom: 24px; }
.stack__row { position: relative; display: grid; gap: 6px; padding: 18px 0 20px; }
.stack__row::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px; background: var(--rule); transform-origin: 0 50%; }
.stack__row:last-child { border-bottom: 1px solid var(--rule); }
.stack__row dt { color: var(--fg-muted); font-size: 13px; }
.stack__row dd { margin: 0; font-size: clamp(18px, 1.7vw, 24px); letter-spacing: -0.02em; line-height: 1.25; }
.stack__row dd span { color: var(--faint); padding-inline: 0.35em; }
@media (min-width: 900px) {
  .stack__label { grid-column: 1 / 4; }
  .stack__list { grid-column: 4 / 13; }
  .stack__row { grid-template-columns: 9rem 1fr; gap: 20px; align-items: baseline; }
}

/* ---------- footer ---------- */
.footer { position: relative; padding-top: var(--section-y); overflow: hidden; }
.footer__top { row-gap: 40px; align-items: end; }
.footer__closing { font-size: clamp(40px, 5.2vw, 90px); line-height: 0.92; letter-spacing: -0.048em; }
.footer__cta { display: flex; flex-wrap: wrap; gap: 16px 28px; align-items: center; }
.footer__links { display: grid; gap: 10px; }
.footer__links a { font-size: 15px; }
.footer__base { margin-top: clamp(72px, 9vw, 128px); padding-block: 18px; row-gap: 8px; border-top: 1px solid var(--rule); }
.footer__base .meta { color: var(--fg-muted); }
.footer__base a { text-decoration: none; }
.footer__word {
  display: flex; justify-content: space-between; white-space: nowrap;
  padding-inline: var(--pad); margin-top: 10px; margin-bottom: -0.17em;
  font-size: 12.4vw; line-height: 0.9; letter-spacing: -0.06em; font-weight: 500; color: var(--ink);
  user-select: none;
}
.footer__word span { display: inline-block; }
.motion .footer__word span { transform: translateY(105%); transition: transform 1.3s var(--ease); transition-delay: calc(var(--i) * 0.035s); }
.motion .footer__word.is-in span { transform: none; }
.footer__word-mask { overflow: hidden; }
@media (min-width: 900px) {
  .footer__closing { grid-column: 1 / 10; }
  .footer__cta { grid-column: 1 / 8; }
  .footer__links { grid-column: 10 / 13; grid-row: 1 / 3; align-self: end; justify-items: start; }
  .footer__base .meta:nth-child(1) { grid-column: 1 / 4; }
  .footer__base .meta:nth-child(2) { grid-column: 4 / 10; }
  .footer__base .meta:nth-child(3) { grid-column: 10 / 13; justify-self: end; }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; transition-delay: 0s !important; }
  .scroll-cue__line::after { animation: none; transform: none; }
}

.caps--tight { margin-top: 0; }
