/* Motion Lexicon — 四层动效词典
   Dark, warm, restrained. One primary motion per block. */

:root {
  --bg: #0b0b0a;
  --bg-2: #111110;
  --bg-elev: #161613;
  --bg-elev-2: #1d1d18;
  --ink: #f3f0e7;
  --ink-soft: #c8c3b6;
  --ink-dim: #8f8a7d;
  --line: rgba(243, 240, 231, 0.1);
  --line-strong: rgba(243, 240, 231, 0.18);
  --accent: #cbb892;
  --accent-deep: #9a845e;
  --accent-soft: rgba(203, 184, 146, 0.14);
  --ok: #8fa57a;
  --err: #c56a58;
  --warn: #c4a15a;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in: cubic-bezier(0.64, 0, 0.78, 0);
  --ease-io: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-spring: cubic-bezier(0.22, 1.35, 0.36, 1);
  --d-xs: 160ms;
  --d-sm: 280ms;
  --d-md: 520ms;
  --d-lg: 880ms;
  --d-xl: 1400ms;
  --stagger: 80ms;
  --nav-h: 64px;
  --pad: clamp(20px, 4.2vw, 64px);
  --max: 1180px;
  --radius: 18px;
  --font-serif: "Instrument Serif", "Songti SC", "Noto Serif SC", serif;
  --font-sans: "Instrument Sans", "PingFang SC", "Noto Sans SC", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  background: var(--bg);
  color: var(--ink);
  scroll-behavior: smooth;
  scrollbar-color: #3a3832 var(--bg);
}

html.reduce-motion { scroll-behavior: auto; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

body.has-custom-cursor,
body.has-custom-cursor a,
body.has-custom-cursor button { cursor: none; }

::selection {
  background: var(--accent);
  color: #1a160f;
}

img { max-width: 100%; display: block; }
button, input { font: inherit; color: inherit; }
a { color: inherit; }

button {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: 12px;
  top: -40px;
  z-index: 100;
  background: var(--ink);
  color: var(--bg);
  padding: 8px 12px;
  border-radius: 8px;
}
.skip:focus { top: 12px; }

/* ---------- grain / cursor / progress ---------- */

.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 80;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 180 180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

.progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0%;
  background: var(--accent);
  z-index: 90;
  transform-origin: left;
}

.cursor {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 95;
  display: none;
  opacity: 0;
}
body.has-custom-cursor .cursor { display: block; }

.cursor-dot,
.cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  border-radius: 50%;
  translate: -50% -50%;
  will-change: transform;
}
.cursor-dot {
  width: 5px;
  height: 5px;
  background: var(--ink);
  mix-blend-mode: difference;
}
.cursor-ring {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(243, 240, 231, 0.45);
  transition: width var(--d-sm) var(--ease-out), height var(--d-sm) var(--ease-out),
    background var(--d-sm) var(--ease-out), border-color var(--d-sm);
}
.cursor.is-hover .cursor-ring {
  width: 52px;
  height: 52px;
  border-color: var(--accent);
}
.cursor.is-press .cursor-ring {
  width: 22px;
  height: 22px;
  background: rgba(203, 184, 146, 0.18);
}

/* ---------- type ---------- */

.kicker {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 500;
}

h1, h2, h3, .display {
  font-family: var(--font-serif);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.08;
  margin: 0;
}

.display {
  font-size: clamp(44px, 7.2vw, 96px);
}

h2 {
  font-size: clamp(32px, 4.8vw, 58px);
}

h3 { font-size: 22px; }

.lede {
  font-size: clamp(17px, 1.6vw, 20px);
  color: var(--ink-soft);
  max-width: 36em;
}

.muted { color: var(--ink-dim); }
.soft { color: var(--ink-soft); }

.mono {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
}

.wrap {
  width: min(var(--max), calc(100% - var(--pad) * 2));
  margin-inline: auto;
}

.section {
  padding: clamp(72px, 12vw, 140px) 0;
  position: relative;
  scroll-margin-top: var(--nav-h);
}

.section-head {
  display: grid;
  gap: 16px;
  margin-bottom: clamp(36px, 6vw, 64px);
  max-width: 720px;
}

.section-head p { margin: 0; color: var(--ink-soft); }

/* ---------- nav ---------- */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-h);
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--pad);
  color: var(--ink);
  background: rgba(11, 11, 10, 0.28);
  backdrop-filter: blur(14px);
  transition: background var(--d-md) var(--ease-out), border-color var(--d-md);
  border-bottom: 1px solid transparent;
}
.nav.is-solid {
  background: rgba(11, 11, 10, 0.82);
  border-bottom-color: var(--line);
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
  text-decoration: none;
  font-family: var(--font-serif);
  font-size: 20px;
}
.brand small {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.6;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 22px;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 13px;
}
.nav-links a {
  text-decoration: none;
  opacity: 0.72;
  transition: opacity var(--d-sm);
}
.nav-links a:hover,
.nav-links a.is-active { opacity: 1; }

.nav-tools {
  display: flex;
  align-items: center;
  gap: 10px;
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  color: inherit;
  background: transparent;
}
.toggle[aria-pressed="true"] {
  background: var(--accent);
  color: #1a160f;
  border-color: var(--accent);
}

.nav-menu {
  display: none;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 20px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--ink);
  text-decoration: none;
  font-size: 14px;
  transition: transform var(--d-xs) var(--ease-out), background var(--d-sm), border-color var(--d-sm);
}
.btn:hover { background: var(--bg-elev-2); }
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}
.btn-primary:hover { background: #fff; }

.btn-ghost { border-color: transparent; opacity: 0.75; }
.btn-ghost:hover { opacity: 1; }

.replay {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-dim);
  padding: 6px 0;
}
.replay:hover { color: var(--accent); }

/* ---------- hero ---------- */

.hero {
  min-height: 100svh;
  display: grid;
  align-items: center;
  padding: calc(var(--nav-h) + 16px) 0 28px;
  position: relative;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: -10%;
  background:
    radial-gradient(ellipse 50% 40% at 50% 0%, rgba(203, 184, 146, 0.12), transparent 55%),
    radial-gradient(circle at 80% 70%, rgba(90, 70, 40, 0.18), transparent 40%);
  pointer-events: none;
  transition: transform 0.6s var(--ease-out);
}

.hero-inner {
  position: relative;
  display: grid;
  gap: 22px;
}

.line-reveal .line {
  display: block;
  overflow: hidden;
}
.line-reveal .line-inner {
  display: block;
  transform: translateY(110%);
  animation: rise var(--d-xl) var(--ease-out) forwards;
}
.line-reveal .line:nth-child(2) .line-inner { animation-delay: 0.12s; }
.line-reveal .line:nth-child(3) .line-inner { animation-delay: 0.22s; }

@keyframes rise {
  to { transform: translateY(0); }
}

.hero .lede {
  opacity: 0;
  animation: fade-up var(--d-lg) var(--ease-out) 0.55s forwards;
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  opacity: 0;
  animation: fade-up var(--d-lg) var(--ease-out) 0.75s forwards;
}

.hero-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 8px;
}

.hero-card {
  border: 1px solid var(--line);
  background: rgba(22, 22, 19, 0.55);
  backdrop-filter: blur(10px);
  border-radius: var(--radius);
  padding: 22px 22px 20px;
  min-height: 132px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  opacity: 0;
  transform: translateY(24px);
  animation: fade-up var(--d-lg) var(--ease-out) forwards;
  text-decoration: none;
  transition: border-color var(--d-sm), transform var(--d-md) var(--ease-out), background var(--d-sm);
}
.hero-card:nth-child(1) { animation-delay: 0.85s; }
.hero-card:nth-child(2) { animation-delay: 0.95s; }
.hero-card:nth-child(3) { animation-delay: 1.05s; }
.hero-card:hover {
  border-color: var(--line-strong);
  background: var(--bg-elev);
  transform: translateY(-4px);
}
.hero-card .n {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 0.12em;
}
.hero-card h3 {
  font-size: clamp(20px, 2vw, 26px);
  margin: 12px 0 6px;
}
.hero-card p {
  margin: 0;
  color: var(--ink-dim);
  font-size: 14px;
}

.scroll-hint {
  margin-top: 8px;
  font-size: 12px;
  color: var(--ink-dim);
  display: flex;
  align-items: center;
  gap: 10px;
  opacity: 0;
  animation: fade-up var(--d-lg) var(--ease-out) 1.2s forwards;
}
.scroll-hint i {
  width: 1px;
  height: 36px;
  background: linear-gradient(var(--accent), transparent);
  display: block;
}

/* ---------- four layers ---------- */

.layers {
  display: grid;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.layer-row {
  display: grid;
  grid-template-columns: 88px 1fr auto;
  gap: 24px;
  align-items: center;
  padding: 28px 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  transition: background var(--d-sm), padding var(--d-md) var(--ease-out);
}
.layer-row:last-child { border-bottom: 0; }
.layer-row:hover { background: rgba(203, 184, 146, 0.04); }
.layer-row .idx {
  font-family: var(--font-serif);
  font-size: 42px;
  color: var(--ink-dim);
}
.layer-row h3 { font-size: clamp(26px, 3vw, 36px); }
.layer-row p {
  margin: 6px 0 0;
  color: var(--ink-dim);
  font-size: 14px;
}
.layer-row .ask {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  opacity: 0;
  transform: translateX(8px);
  transition: opacity var(--d-sm), transform var(--d-md) var(--ease-out);
}
.layer-row:hover .ask,
.layer-row:focus-visible .ask {
  opacity: 1;
  transform: none;
}

/* ---------- tools ---------- */

.tools {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.tool {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px;
  background: var(--bg-elev);
  min-height: 132px;
}
.tool b {
  display: block;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
  color: var(--accent);
}
.tool p { margin: 0; color: var(--ink-soft); font-size: 14px; }

/* ---------- labs ---------- */

.labs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.lab {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.lab--wide { grid-column: 1 / -1; }
.lab-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 14px;
}
.lab-head .idx {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 0.14em;
}
.lab-head h3 {
  font-size: 22px;
  margin-top: 4px;
}
.lab-head .en {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-dim);
  letter-spacing: 0.06em;
  margin-top: 2px;
}
.lab-note {
  margin: 12px 0 0;
  font-size: 13px;
  color: var(--ink-dim);
  line-height: 1.55;
}

.stage {
  position: relative;
  flex: 1;
  min-height: 230px;
  background: #0e0e0c;
  border-radius: 14px;
  overflow: hidden;
  display: grid;
  place-items: center;
  isolation: isolate;
}
.stage.tall { min-height: 300px; }
.stage.left { place-items: stretch; }

/* shared demo pieces */
.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font-size: 14px;
}
.panel {
  width: min(78%, 280px);
  background: var(--bg-elev-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
  color: var(--ink);
}
.ghost-card {
  width: min(86%, 260px);
  aspect-ratio: 4/3;
  border-radius: 12px;
  background: #2a2824 center/cover no-repeat;
  border: 1px solid var(--line);
}

/* ---------- trigger tiles ---------- */

.trigger-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.t-hover {
  width: min(88%, 280px);
  padding: 22px;
  border-radius: 16px;
  background: var(--bg-elev-2);
  border: 1px solid var(--line);
  transition: transform var(--d-md) var(--ease-out), box-shadow var(--d-md), border-color var(--d-sm);
}
.t-hover:hover,
.t-hover.is-on {
  transform: translateY(-8px);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  border-color: var(--line-strong);
}
.t-hover h4 { margin: 0 0 6px; font-size: 18px; }
.t-hover p { margin: 0; font-size: 13px; color: var(--ink-dim); }
.link-demo {
  color: var(--ink);
  text-decoration: none;
  background-image: linear-gradient(var(--accent), var(--accent));
  background-size: 0 1px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition: background-size var(--d-md) var(--ease-out);
}
.t-hover:hover .link-demo,
.t-hover.is-on .link-demo { background-size: 100% 1px; }

.proximity {
  width: 72%;
  height: 72px;
  border-radius: 14px;
  border: 1px dashed var(--line-strong);
  display: grid;
  place-items: center;
  color: var(--ink-dim);
  font-size: 13px;
  transition: transform var(--d-md) var(--ease-out), background var(--d-sm), color var(--d-sm);
}
.proximity.is-near {
  background: var(--accent-soft);
  color: var(--ink);
  transform: scale(1.04);
}

.focus-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}
.focus-row .btn { min-width: 88px; }

.press-btn {
  min-width: 140px;
  min-height: 48px;
  border-radius: 12px;
  background: var(--ink);
  color: var(--bg);
  font-weight: 500;
  transition: transform var(--d-xs) var(--ease-out);
}
.press-btn:active,
.press-btn.is-down { transform: scale(0.94); }

.toggle-demo[aria-pressed="true"] {
  background: var(--ok);
  color: #111;
  border-color: var(--ok);
}

.pointer-pad {
  width: 86%;
  height: 160px;
  border-radius: 14px;
  background:
    linear-gradient(rgba(243,240,231,0.06) 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(90deg, rgba(243,240,231,0.06) 1px, transparent 1px) 0 0 / 24px 24px,
    #121210;
  position: relative;
  overflow: hidden;
}
.pointer-blob {
  position: absolute;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(203,184,146,0.55), transparent 70%);
  translate: -50% -50%;
  pointer-events: none;
  filter: blur(2px);
}

.viewport-box {
  width: 70%;
  padding: 28px 18px;
  text-align: center;
  border-radius: 12px;
  background: var(--bg-elev-2);
  opacity: 0;
  transform: translateY(16px);
}
.viewport-box.in { opacity: 1; transform: none; transition: 700ms var(--ease-out); }

.scrub-bar {
  width: 80%;
}
.scrub-bar .track {
  height: 4px;
  background: var(--line-strong);
  border-radius: 99px;
  overflow: hidden;
}
.scrub-bar .fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
}
.scrub-bar .pct {
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 22px;
  color: var(--accent);
}

.drag-tile {
  width: 92px;
  height: 92px;
  border-radius: 16px;
  background: var(--ink);
  color: var(--bg);
  display: grid;
  place-items: center;
  font-size: 13px;
  touch-action: none;
  cursor: grab;
  user-select: none;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}
.drag-tile:active { cursor: grabbing; }

.mount-stage .panel { transform-origin: 50% 50%; }
.mount-stage.is-play .panel {
  animation: scale-in var(--d-lg) var(--ease-out) both;
}

.state-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 78%;
}
.state-row .slot {
  height: 42px;
  border-radius: 10px;
  background: var(--bg-elev-2);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  padding: 0 12px;
  font-size: 13px;
  overflow: hidden;
}
.state-row .slot b { margin-left: auto; color: var(--accent); }

.idle-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2.4s var(--ease-io) infinite;
}
@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(0.7); opacity: 0.5; }
}

/* ---------- hand feel ---------- */

.ease-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  width: 92%;
}
.ease-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  color: var(--ink-dim);
  font-family: var(--font-mono);
}
.ease-ball {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--ink);
}
.ease-row.is-play .ease-col .ease-ball { animation: drop 1.4s both; }
.ease-row.is-play .ease-col[data-ease="linear"] .ease-ball { animation-timing-function: linear; }
.ease-row.is-play .ease-col[data-ease="in"] .ease-ball { animation-timing-function: var(--ease-in); }
.ease-row.is-play .ease-col[data-ease="out"] .ease-ball { animation-timing-function: var(--ease-out); }
.ease-row.is-play .ease-col[data-ease="io"] .ease-ball { animation-timing-function: var(--ease-io); }
@keyframes drop {
  from { transform: translateY(-70px); }
  to { transform: translateY(70px); }
}

.dur-row {
  display: flex;
  gap: 16px;
  align-items: flex-end;
}
.dur-col { text-align: center; font-size: 12px; color: var(--ink-dim); }
.dur-box {
  width: 54px;
  height: 54px;
  border-radius: 12px;
  background: var(--accent);
  margin-bottom: 8px;
}
.dur-row.is-play .dur-col .dur-box { animation: pop both; }
.dur-row.is-play .dur-col[data-d="xs"] .dur-box { animation-duration: 160ms; }
.dur-row.is-play .dur-col[data-d="sm"] .dur-box { animation-duration: 280ms; }
.dur-row.is-play .dur-col[data-d="md"] .dur-box { animation-duration: 520ms; }
.dur-row.is-play .dur-col[data-d="lg"] .dur-box { animation-duration: 900ms; }
@keyframes pop {
  from { transform: scale(0.4); opacity: 0; }
  to { transform: none; opacity: 1; }
}

.delay-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 70%;
}
.delay-stack span {
  height: 28px;
  border-radius: 8px;
  background: var(--bg-elev-2);
  opacity: 0;
  transform: translateX(-12px);
}
.delay-stack.is-play span {
  animation: slide-in var(--d-md) var(--ease-out) forwards;
}
.delay-stack.is-play span:nth-child(2) { animation-delay: 0.16s; }
.delay-stack.is-play span:nth-child(3) { animation-delay: 0.32s; }
@keyframes slide-in {
  to { opacity: 1; transform: none; }
}

.stagger-cards {
  display: flex;
  gap: 10px;
}
.stagger-cards i {
  width: 52px;
  height: 72px;
  border-radius: 10px;
  background: var(--ink);
  opacity: 0;
  transform: translateY(18px);
}
.stagger-cards.is-play i {
  animation: fade-up var(--d-md) var(--ease-out) forwards;
}
.stagger-cards.is-play i:nth-child(2) { animation-delay: 70ms; }
.stagger-cards.is-play i:nth-child(3) { animation-delay: 140ms; }
.stagger-cards.is-play i:nth-child(4) { animation-delay: 210ms; }
.stagger-cards.is-play i:nth-child(5) { animation-delay: 280ms; }

.spring-dot {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent);
}
.spring-dot.is-play {
  animation: springy 900ms var(--ease-spring) both;
}
@keyframes springy {
  0% { transform: scale(0.2); }
  60% { transform: scale(1.12); }
  100% { transform: scale(1); }
}

/* ---------- enter / leave ---------- */

.fade-box.is-play { animation: just-fade var(--d-lg) var(--ease-out) both; }
@keyframes just-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.crossfade {
  width: min(86%, 260px);
  aspect-ratio: 4/3;
  border-radius: 12px;
  position: relative;
  overflow: hidden;
}
.crossfade img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 700ms var(--ease-io);
}
.crossfade img:last-child { opacity: 0; }
.crossfade.is-b img:first-child { opacity: 0; }
.crossfade.is-b img:last-child { opacity: 1; }

.slide-sheet {
  position: absolute;
  left: 12%;
  right: 12%;
  bottom: 0;
  background: var(--bg-elev-2);
  border: 1px solid var(--line);
  border-radius: 16px 16px 0 0;
  padding: 18px;
  transform: translateY(110%);
}
.slide-sheet.is-play {
  animation: sheet-up 520ms var(--ease-out) forwards;
}
@keyframes sheet-up {
  to { transform: none; }
}

.scale-modal {
  width: min(70%, 220px);
  padding: 22px;
  border-radius: 16px;
  background: var(--bg-elev-2);
  border: 1px solid var(--line);
  text-align: center;
  transform: scale(0.84);
  opacity: 0;
}
.scale-modal.is-play {
  animation: scale-in 480ms var(--ease-out) forwards;
}
@keyframes scale-in {
  to { transform: none; opacity: 1; }
}

.blur-title {
  font-family: var(--font-serif);
  font-size: 36px;
  filter: blur(12px);
  opacity: 0;
}
.blur-title.is-play {
  animation: unblur 900ms var(--ease-out) forwards;
}
@keyframes unblur {
  to { filter: blur(0); opacity: 1; }
}

.clip-photo {
  width: min(86%, 280px);
  aspect-ratio: 4/3;
  object-fit: cover;
  border-radius: 4px;
  clip-path: inset(0 100% 0 0);
}
.clip-photo.is-play {
  animation: clip-open 900ms var(--ease-out) forwards;
}
@keyframes clip-open {
  to { clip-path: inset(0 0 0 0); }
}

.mask-photo {
  width: min(86%, 280px);
  aspect-ratio: 4/3;
  object-fit: cover;
  -webkit-mask-image: linear-gradient(90deg, #000 0%, transparent 0%);
  mask-image: linear-gradient(90deg, #000 0%, transparent 0%);
}
.mask-photo.is-play {
  animation: mask-sweep 1.1s var(--ease-out) forwards;
}
@keyframes mask-sweep {
  to {
    -webkit-mask-image: linear-gradient(90deg, #000 100%, transparent 100%);
    mask-image: linear-gradient(90deg, #000 100%, transparent 100%);
  }
}

.wipe {
  position: absolute;
  inset: 0;
  background: var(--accent);
  transform: translateX(-101%);
}
.wipe.is-play { animation: wipe 700ms var(--ease-io) forwards; }
.wipe-label {
  position: relative;
  z-index: 1;
  font-family: var(--font-serif);
  font-size: 28px;
  mix-blend-mode: difference;
}
@keyframes wipe {
  to { transform: none; }
}

/* ---------- text ---------- */

.split-word,
.split-char { display: inline-flex; flex-wrap: wrap; gap: 0.28em; justify-content: center; }
.split-word span,
.split-char span {
  display: inline-block;
  opacity: 0;
  transform: translateY(0.6em);
}
.split-word.is-play span,
.split-char.is-play span {
  animation: fade-up 520ms var(--ease-out) forwards;
}
.line-box {
  font-family: var(--font-serif);
  font-size: clamp(26px, 3vw, 34px);
  text-align: center;
  line-height: 1.2;
}
.line-box .line { overflow: hidden; display: block; }
.line-box .line-inner {
  display: block;
  transform: translateY(110%);
}
.line-box.is-play .line-inner {
  animation: rise 800ms var(--ease-out) forwards;
}
.line-box.is-play .line:nth-child(2) .line-inner { animation-delay: 0.1s; }
.line-box.is-play .line:nth-child(3) .line-inner { animation-delay: 0.2s; }

.type-line {
  font-family: var(--font-mono);
  font-size: 15px;
  min-height: 1.6em;
}
.type-line::after {
  content: "";
  display: inline-block;
  width: 7px;
  height: 1em;
  background: var(--accent);
  margin-left: 2px;
  vertical-align: text-bottom;
  animation: blink 1s steps(1) infinite;
}
@keyframes blink {
  50% { opacity: 0; }
}

.scramble {
  font-family: var(--font-mono);
  font-size: 28px;
  letter-spacing: 0.12em;
}

.morph {
  font-family: var(--font-serif);
  font-size: 40px;
  min-width: 7ch;
  text-align: center;
}

/* ---------- scroll chapters ---------- */

.parallax {
  position: relative;
  min-height: 140vh;
  overflow: hidden;
  display: grid;
  place-items: center;
}
.parallax::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(11, 11, 10, 0.4), transparent 28%, rgba(11, 11, 10, 0.5));
  pointer-events: none;
}
.parallax-img {
  position: absolute;
  inset: -18%;
  background: url("../assets/hills.jpg") center/cover no-repeat;
  will-change: transform;
}
.parallax-mid {
  position: absolute;
  inset: 20% 10%;
  border: 1px solid rgba(243,240,231,0.12);
  pointer-events: none;
}
.parallax-copy {
  position: relative;
  text-align: center;
  z-index: 2;
  padding: 40px;
  text-shadow: 0 10px 40px rgba(0, 0, 0, 0.55);
}
.parallax-copy h2 { font-size: clamp(40px, 7vw, 84px); }
.parallax-copy p { color: var(--ink-soft); }

.mlayer {
  height: 100vh;
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: #0e0f0c;
}
.mlayer span {
  position: absolute;
  font-family: var(--font-serif);
  color: rgba(243,240,231,0.08);
  white-space: nowrap;
  will-change: transform;
  user-select: none;
}
.mlayer .fg {
  position: relative;
  z-index: 2;
  text-align: center;
}

.hscroll {
  height: 280vh;
  position: relative;
}
.hscroll-pin {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  display: flex;
  align-items: center;
}
.hscroll-track {
  display: flex;
  gap: 28px;
  padding-left: var(--pad);
  will-change: transform;
}
.h-card {
  flex: 0 0 min(72vw, 520px);
  aspect-ratio: 4/3;
  border-radius: 18px;
  overflow: hidden;
  position: relative;
  background: #1a1a16;
}
.h-card img { width: 100%; height: 100%; object-fit: cover; }
.h-card figcaption {
  position: absolute;
  left: 16px;
  bottom: 16px;
  font-size: 13px;
  background: rgba(11,11,10,0.55);
  backdrop-filter: blur(8px);
  padding: 6px 10px;
  border-radius: 999px;
}

.zoom-sec {
  height: 240vh;
  position: relative;
}
.zoom-pin {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  overflow: hidden;
  background: #0c0c0b;
}
.zoom-stage {
  width: min(38vw, 320px);
  aspect-ratio: 4 / 3;
  position: relative;
  z-index: 1;
}
.zoom-frame {
  position: absolute;
  inset: 0;
  margin: 0;
  overflow: hidden;
  border-radius: 16px;
  transform-origin: center center;
  background: #1a1a16;
  will-change: transform, border-radius;
}
.zoom-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.zoom-kicker,
.zoom-caption {
  position: relative;
  z-index: 2;
  text-align: center;
  margin: 0;
  max-width: 28em;
  padding: 0 20px;
}
html.reduce-motion .zoom-sec { height: auto; }
html.reduce-motion .zoom-pin {
  position: relative;
  height: auto;
  min-height: 100vh;
  padding: 80px 0;
}
html.reduce-motion .zoom-stage { width: min(72vw, 640px); }

.story {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
}
.story-steps { padding: 20vh var(--pad) 40vh 8vw; }
.story-step {
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 420px;
  opacity: 0.28;
  transition: opacity var(--d-md);
}
.story-step.is-on { opacity: 1; }
.story-step h3 { font-size: 32px; margin-bottom: 10px; }
.story-visual {
  position: sticky;
  top: 0;
  height: 100vh;
  display: grid;
  place-items: center;
  background: #0e0e0c;
  overflow: hidden;
}
.story-visual img {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(70%, 420px);
  aspect-ratio: 4/3;
  object-fit: cover;
  border-radius: 16px;
  opacity: 0;
  transform: translate(-50%, -50%);
  transition: opacity 500ms var(--ease-io);
}
.story-visual img.is-on { opacity: 1; }

.seq {
  height: 220vh;
  position: relative;
}
.seq-pin {
  position: sticky;
  top: 0;
  height: 100vh;
  display: grid;
  place-items: center;
  background: #0c0c0b;
}
.seq-pin canvas {
  width: min(72vw, 520px);
  height: min(72vw, 520px);
  max-height: 70vh;
}

.snap-wrap {
  height: 100vh;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  border-radius: 18px;
  border: 1px solid var(--line);
}
.snap-panel {
  height: 100%;
  scroll-snap-align: start;
  display: grid;
  place-items: center;
  padding: 24px;
  text-align: center;
}
.snap-panel:nth-child(1) { background: #141410; }
.snap-panel:nth-child(2) { background: #19160f; }
.snap-panel:nth-child(3) { background: #10140f; }
.snap-panel h3 { font-size: 36px; }

.progress-demo {
  width: 80%;
}
.progress-demo .ring {
  width: 88px;
  height: 88px;
  margin: 0 auto 12px;
}
.chapter-dots {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 16px;
}
.chapter-dots i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--line-strong);
}
.chapter-dots i.on { background: var(--accent); }

/* ---------- pointer atelier ---------- */

.atelier {
  position: relative;
  min-height: 100vh;
  padding: 80px var(--pad);
  overflow: hidden;
  background: #0c0c0b;
}
.atelier-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(420px 320px at 50% 50%, rgba(203,184,146,0.16), transparent 60%);
  pointer-events: none;
}
.atelier-spot {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(220px 220px at var(--sx, 50%) var(--sy, 50%), rgba(243,240,231,0.1), transparent 55%);
  mix-blend-mode: screen;
}
.atelier-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 28px;
  align-items: start;
}

.mag-btn {
  min-width: 180px;
  min-height: 56px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font-size: 15px;
  will-change: transform;
}

.tilt {
  position: relative;
  width: 100%;
  aspect-ratio: 4/3;
  border-radius: 18px;
  overflow: hidden;
  transform-style: preserve-3d;
  background: #1a1a16;
  border: 1px solid var(--line);
  will-change: transform;
}
.tilt img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: translateZ(18px) scale(1.06);
}
.tilt .shine {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at var(--tx, 50%) var(--ty, 50%), rgba(255,255,255,0.28), transparent 42%);
  mix-blend-mode: soft-light;
  pointer-events: none;
}
.tilt figcaption {
  position: absolute;
  left: 16px;
  bottom: 16px;
  transform: translateZ(28px);
  font-size: 14px;
}

.eyes {
  width: 220px;
  height: 90px;
  display: flex;
  justify-content: space-between;
}
.eye {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: #efe8d8;
  position: relative;
  overflow: hidden;
}
.pupil {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #1a160f;
  position: absolute;
  top: 50%;
  left: 50%;
  translate: -50% -50%;
}
.pupil::after {
  content: "";
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
  top: 6px;
  left: 8px;
}

.cube-wrap {
  perspective: 700px;
  width: 140px;
  height: 140px;
}
.cube {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transform: rotateX(-16deg) rotateY(22deg);
}
.cube i {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(243,240,231,0.28);
  background: rgba(203,184,146,0.08);
  backdrop-filter: blur(2px);
}
.cube i:nth-child(1) { transform: rotateY(0) translateZ(70px); }
.cube i:nth-child(2) { transform: rotateY(90deg) translateZ(70px); }
.cube i:nth-child(3) { transform: rotateY(180deg) translateZ(70px); }
.cube i:nth-child(4) { transform: rotateY(-90deg) translateZ(70px); }
.cube i:nth-child(5) { transform: rotateX(90deg) translateZ(70px); }
.cube i:nth-child(6) { transform: rotateX(-90deg) translateZ(70px); }

.trail-canvas {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.7;
}

/* ---------- components ---------- */

.acc {
  width: 88%;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.acc-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-elev-2);
  overflow: hidden;
}
.acc-item button {
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  font-size: 14px;
}
.acc-item button::after {
  content: "+";
  color: var(--accent);
  transition: transform var(--d-sm);
}
.acc-item.is-open button::after { transform: rotate(45deg); }
.acc-panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 320ms var(--ease-out);
}
.acc-item.is-open .acc-panel { grid-template-rows: 1fr; }
.acc-panel > div {
  overflow: hidden;
  min-height: 0;
  font-size: 13px;
  color: var(--ink-dim);
  padding: 0 14px;
}
.acc-item.is-open .acc-panel > div { padding-bottom: 12px; }

.anchor-wrap { position: relative; }
.popover {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  translate: -50% 6px;
  opacity: 0;
  pointer-events: none;
  background: var(--bg-elev-2);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  padding: 10px;
  min-width: 160px;
  transition: opacity var(--d-sm), translate var(--d-sm) var(--ease-out);
}
.popover.is-open {
  opacity: 1;
  translate: -50% 0;
  pointer-events: auto;
}

.modal-root { width: 100%; height: 100%; display: grid; place-items: center; }
.modal-back {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--d-sm);
}
.modal-card {
  position: relative;
  z-index: 1;
  width: min(78%, 260px);
  padding: 22px;
  border-radius: 16px;
  background: var(--bg-elev-2);
  border: 1px solid var(--line);
  transform: scale(0.92) translateY(8px);
  opacity: 0;
  pointer-events: none;
  transition: 380ms var(--ease-out);
}
.modal-root.is-open > .btn { visibility: hidden; }
.modal-root.is-open .modal-back { opacity: 1; pointer-events: auto; }
.modal-root.is-open .modal-card {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.stage.drawer-stage {
  display: grid;
  place-items: center;
  min-height: 280px;
  height: 280px;
}
.drawer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  padding: 12px;
  position: relative;
  z-index: 1;
}
.drawer-layer {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}
.drawer-layer.is-open { pointer-events: auto; }
.drawer-back {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.46);
  opacity: 0;
  transition: opacity 320ms var(--ease-out);
}
.drawer-layer.is-open .drawer-back { opacity: 1; }
.drawer-panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 68%;
  background: var(--bg-elev-2);
  border-left: 1px solid var(--line);
  padding: 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transform: translateX(104%);
  transition: transform 420ms var(--ease-out);
}
.drawer-panel .drawer-title {
  font-family: var(--font-serif);
  font-size: 22px;
  margin: 0;
}
.drawer-panel .muted { margin: 0; font-size: 13px; }
.drawer-panel .btn { margin-top: auto; align-self: flex-start; }
.drawer-panel[data-mode="sheet"] {
  top: auto;
  left: 0;
  right: 0;
  width: 100%;
  height: 64%;
  border-left: 0;
  border-top: 1px solid var(--line);
  border-radius: 16px 16px 0 0;
  transform: translateY(110%);
}
.drawer-layer.is-open .drawer-panel { transform: none; }

.tabs { width: 88%; }
.tab-list {
  display: flex;
  gap: 4px;
  position: relative;
  background: #121210;
  padding: 4px;
  border-radius: 999px;
}
.tab-list button {
  flex: 1;
  height: 34px;
  border-radius: 999px;
  font-size: 13px;
  position: relative;
  z-index: 1;
  color: var(--ink-dim);
}
.tab-ink {
  position: absolute;
  top: 4px;
  bottom: 4px;
  width: calc(33.333% - 4px);
  border-radius: 999px;
  background: var(--ink);
  z-index: 0;
  transition: transform 320ms var(--ease-out);
}
.tab-list button.is-on { color: var(--bg); }
.tab-panels { margin-top: 14px; min-height: 72px; font-size: 14px; color: var(--ink-soft); }

.carousel {
  width: 88%;
  overflow: hidden;
  border-radius: 12px;
  position: relative;
}
.carousel-track {
  display: flex;
  width: 100%;
  transition: transform 480ms var(--ease-out);
}
.carousel-track img {
  flex: 0 0 100%;
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
}
.carousel-nav {
  position: absolute;
  inset: auto 8px 8px;
  display: flex;
  justify-content: space-between;
}
.carousel-nav button {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(11,11,10,0.55);
  border: 1px solid var(--line);
}

.toast-stage { width: 100%; height: 100%; }
.toast {
  position: absolute;
  right: 14px;
  bottom: 14px;
  background: var(--ink);
  color: var(--bg);
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  transform: translateY(16px);
  opacity: 0;
  pointer-events: none;
}
.toast.is-on {
  animation: toast-in 420ms var(--ease-out) forwards, toast-out 420ms var(--ease-in) 2.1s forwards;
}
@keyframes toast-in { to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(12px); } }

/* ---------- feedback ---------- */

.counter {
  font-family: var(--font-serif);
  font-size: 56px;
  letter-spacing: -0.03em;
}
.counter small {
  font-size: 16px;
  color: var(--ink-dim);
  margin-left: 4px;
}

.skeleton {
  width: 82%;
  display: grid;
  gap: 10px;
}
.sk {
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(90deg, #222 0%, #333 40%, #222 80%);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
}
.sk.img { height: 92px; }
.sk.w2 { width: 62%; }
@keyframes shimmer {
  to { background-position: -200% 0; }
}

.loader {
  width: 28px;
  height: 28px;
  border: 2px solid var(--line-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.dots { display: flex; gap: 6px; }
.dots i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: bounce 1s var(--ease-io) infinite;
}
.dots i:nth-child(2) { animation-delay: 0.12s; }
.dots i:nth-child(3) { animation-delay: 0.24s; }
@keyframes bounce {
  0%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-8px); }
}

.form-mini {
  width: 82%;
  display: grid;
  gap: 10px;
}
.form-mini input {
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: #121210;
  padding: 0 12px;
}
.form-mini input.is-err {
  border-color: var(--err);
  animation: shake 360ms var(--ease-out);
}
@keyframes shake {
  20%, 60% { transform: translateX(-5px); }
  40%, 80% { transform: translateX(5px); }
}
.check {
  width: 22px;
  height: 22px;
  display: none;
}
.form-mini.is-ok .check { display: block; }
.form-mini.is-ok button { background: var(--ok); border-color: var(--ok); color: #111; }

.icon-morph {
  width: 48px;
  height: 48px;
  position: relative;
}
.icon-morph span {
  position: absolute;
  left: 10px;
  right: 10px;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: 280ms var(--ease-out);
}
.icon-morph span:nth-child(1) { top: 15px; }
.icon-morph span:nth-child(2) { top: 23px; }
.icon-morph span:nth-child(3) { top: 31px; }
.icon-morph.is-x span:nth-child(1) { top: 23px; transform: rotate(45deg); }
.icon-morph.is-x span:nth-child(2) { opacity: 0; }
.icon-morph.is-x span:nth-child(3) { top: 23px; transform: rotate(-45deg); }

/* ---------- layout ---------- */

.filter-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.filter-bar button {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 12px;
}
.filter-bar button.is-on {
  background: var(--ink);
  color: var(--bg);
}
.flip-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  width: 92%;
}
.flip-grid .tile {
  aspect-ratio: 1;
  border-radius: 10px;
  background: var(--bg-elev-2);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  font-size: 12px;
  color: var(--ink-dim);
}

.shared {
  display: flex;
  gap: 10px;
}
.shared button {
  width: 88px;
  height: 88px;
  border-radius: 12px;
  overflow: hidden;
}
.shared img { width: 100%; height: 100%; object-fit: cover; }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 96;
  background: rgba(0,0,0,0.72);
  display: none;
  place-items: center;
}
.lightbox.is-open { display: grid; }
.lightbox img {
  width: min(72vw, 640px);
  border-radius: 16px;
}

.page-stage {
  width: 88%;
  height: 180px;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  background: #121210;
}
.page-stage .pg {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--font-serif);
  font-size: 28px;
}
.page-stage .pg-b { transform: translateX(100%); }
.page-stage.is-b .pg-a {
  animation: out-left 480ms var(--ease-io) forwards;
}
.page-stage.is-b .pg-b {
  animation: in-right 480ms var(--ease-io) forwards;
}
.page-stage:not(.is-b).played .pg-a {
  animation: in-right 480ms var(--ease-io) reverse forwards;
}
@keyframes out-left { to { transform: translateX(-24%); opacity: 0.4; } }
@keyframes in-right { from { transform: translateX(100%); } to { transform: none; } }

/* ---------- ux / composer ---------- */

.ux-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.ux-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 22px;
  background: var(--bg-elev);
}
.ux-card h3 { margin-bottom: 8px; }
.ux-card p { margin: 0; color: var(--ink-soft); font-size: 14px; }
.ux-card .idx { font-family: var(--font-mono); font-size: 11px; color: var(--accent); letter-spacing: 0.12em; }

.composer {
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: clamp(20px, 3vw, 32px);
  background: var(--bg-elev);
  display: grid;
  gap: 22px;
}
.composer-row h4 {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 10px;
  font-weight: 500;
}
.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.pills button {
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 13px;
  color: var(--ink-soft);
}
.pills button.is-on {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}
.prompt-out {
  background: #0e0e0c;
  border-radius: 14px;
  padding: 18px;
  font-size: 15px;
  line-height: 1.7;
  color: var(--ink-soft);
  min-height: 7em;
}

/* ---------- footer ---------- */

.footer {
  padding: 80px var(--pad) 48px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 24px;
}
.footer a { color: var(--accent); }
.sources {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 14px;
}

/* ---------- reduced motion ---------- */

html.reduce-motion *,
html.reduce-motion *::before,
html.reduce-motion *::after {
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 80ms !important;
  scroll-behavior: auto !important;
}
html.reduce-motion .hero .lede,
html.reduce-motion .hero-actions,
html.reduce-motion .hero-card,
html.reduce-motion .line-reveal .line-inner {
  opacity: 1 !important;
  transform: none !important;
  animation: none !important;
}
html.reduce-motion .cursor { display: none !important; }
html.reduce-motion .idle-dot,
html.reduce-motion .sk { animation: none !important; }

/* ---------- responsive ---------- */

@media (max-width: 960px) {
  .hero-cards,
  .tools,
  .labs,
  .trigger-grid,
  .ux-grid,
  .story,
  .atelier-grid { grid-template-columns: 1fr; }
  .nav-links { display: none; }
  .nav-menu { display: grid; }
  .layer-row { grid-template-columns: 56px 1fr; }
  .layer-row .ask { display: none; }
  .h-card { flex-basis: 78vw; }
  .hscroll { height: auto; }
  .hscroll-pin {
    position: relative;
    height: auto;
    overflow-x: auto;
    overscroll-behavior-x: contain;
  }
  .hscroll-track { transform: none !important; padding: 24px var(--pad) 40px; }
}

@media (max-width: 640px) {
  .ease-row { grid-template-columns: repeat(2, 1fr); }
  .flip-grid { grid-template-columns: repeat(2, 1fr); }
  .display { font-size: 42px; }
  .story-visual { display: none; }
  .zoom-stage { width: min(72vw, 280px); }
  .drawer-actions { flex-direction: column; align-items: center; }
}

@media (hover: none), (max-width: 800px) {
  body.has-custom-cursor,
  body.has-custom-cursor a,
  body.has-custom-cursor button { cursor: auto; }
  .cursor { display: none !important; }
}

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