/* ═══════════════════════════════════════════════════════════
   TYPOGRAPHY OVERRIDES
   1. Modular type scale (1.25 ramp, 8 steps + mono micro)
   2. Mono labels unified to 11px / 0.16em
   3. CJK font stacks for hero / serif accents

   Loaded LAST so these rules win.
   ═══════════════════════════════════════════════════════════ */

:root {
  --fs-mono-print: 9px;     /* edge marks only */
  --fs-mono:       11px;    /* all mono labels */
  --fs-12:         12px;
  --fs-14:         14px;
  --fs-16:         16px;
  --fs-20:         20px;
  --fs-24:         24px;
  --fs-32:         32px;
  --fs-48:         48px;
  --fs-72:         72px;
  --fs-120:       120px;

  --tracking-mono: 0.16em;
  --tracking-mono-tight: 0.08em;
  --tracking-mono-loose: 0.32em; /* edge marks only */
}

/* ─── Font stacks: include system CJK fallback BEFORE Noto SC
       so Chinese never tofus during Google Fonts loading ─── */
:root {
  --font-display: 'Sora', 'Noto Sans SC', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', -apple-system, sans-serif;
  --font-mono:    'JetBrains Mono', 'PingFang SC', 'Noto Sans SC', 'Hiragino Sans GB', 'Microsoft YaHei', ui-monospace, SFMono-Regular, Menlo, monospace;
  --font-serif:   'Instrument Serif', 'Noto Serif SC', 'Songti SC', Georgia, serif;
}

/* ─── Layout tokens ─── */
:root {
  --container: 1480px;
  --pad-x: clamp(56px, 6vw, 96px);
}

/* ─── LIGHT theme — bump accent saturation so purple pops on cream ─── */
:root {
  --accent: #5b48e8;
  --accent-2: #06b6d4;
}

/* ─── DARK theme — warm cream's nighttime counterpart ─── */
[data-theme="dark"] {
  --bg: #14130f;
  --bg-soft: #1d1c18;
  --ink: #f2efe6;
  --ink-soft: #c4bfb2;
  --ink-faint: #7d7972;
  --line: rgba(242, 239, 230, 0.10);
  --line-strong: rgba(242, 239, 230, 0.22);
  --accent: #8b7eef;
  --accent-2: #38d4e8;
  --grid: rgba(242, 239, 230, 0.045);
}
[data-theme="dark"] body { background: var(--bg); color: var(--ink); }
[data-theme="dark"] html { background: var(--bg); }
html, body { transition: background 0s, color 0s; }

/* ─── HERO Quiet-Rise: drop CN to 600 weight (避免 PingFang 700 厚重感) ─── */
.hqr-big,
.hqr-char {
  font-weight: 600;
}
/* keep hero-title (legacy variant) at 700 since it's Sora-only Latin */

/* ─── Mono labels — unify to 11px / 0.16em ─── */
/* (Print marks intentionally excluded — keep 9px / 0.32em as edge decoration) */
.eyebrow,
.mono,
.lang-switch button,
.hero-stat .label,
.case-chip,
.case-num,
.case-year,
.kpi-cap,
.num-cap,
.tier-name,
.testi-author,
#studio .studio-stat .label,
.contact-meta-row .key,
.form-row label,
.form-foot,
.foot-col h5,
.foot-brand .tagline,
.foot-bottom,
.footer-mono,
.footer-row .footer-mono,
.cta-meta,
.cta-mail-label,
.interlude-eyebrow,
.interlude-foot,
.pin-step-tag,
.cap-num,
.cap-tag,
.case-meta .case-num,
.kpi .kpi-cap {
  font-size: var(--fs-mono);
  letter-spacing: var(--tracking-mono);
}
/* tighter spacing where the mono label sits over imagery (case art) */
.case-year,
.case-chip {
  letter-spacing: var(--tracking-mono-tight);
}
/* keep print-marks separate */
.print-marks { font-size: var(--fs-mono-print); letter-spacing: var(--tracking-mono-loose); }

/* ─── Type scale — collapse near-duplicates onto the 1.25 ramp ─── */

/* 14 — small body / footer / case meta lines */
.foot-col a,
.foot-col li,
.foot-bottom span,
.contact-meta-row,
.tier-blurb,
.tier-features li,
.testi-quote,
.case-line,
.faq-a {
  font-size: var(--fs-14);
}
/* keep faq-a comfortable line-height (already inherits fine) */

/* 15 → 16 — body, form input, manifesto body, marquee mono */
.form-row input,
.form-row select,
.form-row textarea,
.contact-left p,
.testi-quote {
  font-size: var(--fs-16);
}

/* 16 → 16, but studio body bumped down to 16 from 18 for tighter rhythm */
#studio .studio-text {
  font-size: var(--fs-16);
  line-height: 1.75;
}

/* 18 → 20 ramp (cap-arrow stays as accent) */
.cap-arrow,
.faq-icon { font-size: var(--fs-20); }

/* 22 → 20 (case-name, kpi-num) — closer to scale, less competing weights */
.case-name { font-size: var(--fs-20); }
.kpi-num   { font-size: var(--fs-20); }

/* 22 → 24 (cap-name max) */
.cap-name { font-size: clamp(var(--fs-20), 2.4vw, var(--fs-24)); }

/* 28 → 32 (mostly already 32 — pin-step-big stays 32) */
/* 36 → 32 (hero-stat num — quieter under big hero) */
.hero-stat .num {
  font-size: var(--fs-32);
}

/* 40 → 48 (tier-price) */
.tier-price { font-size: var(--fs-48); }

/* 48 → 48 stays */
/* 56 → 48 (contact h2 — match big-cta scale) */
.contact-left h2 {
  font-size: clamp(var(--fs-32), 5vw, var(--fs-48));
}

/* 64 → 72 (big-cta h2 max) */
section.big-cta h2 {
  font-size: clamp(var(--fs-32), 5vw, var(--fs-72));
}

/* 120 / 128 → 120 (interlude-line, num-big top end) */
.interlude-line {
  font-size: clamp(var(--fs-48), 7.5vw, var(--fs-120));
  line-height: 1.05;
}
.num-big {
  font-size: clamp(var(--fs-48), 7vw, var(--fs-120));
}

/* Hero quiet-rise stays as a deliberate outlier at 220px clamp — don't flatten it */

/* ─── Body line-height normalization ─── */
body { line-height: 1.6; }
.tier-blurb,
.testi-quote,
.contact-left p,
.faq-a { line-height: 1.7; }

/* Manifesto interlude — leave to handoff styles.css (display 700 + system CJK fallback). Don't override. */

/* ═══════════════════════════════════════════════════════════
   NAV BRAND — letter-by-letter ripple on hover
   ═══════════════════════════════════════════════════════════ */
.brand .brand-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -0.02em;
  color: var(--ink);
  display: inline-flex;
}
.brand .brand-text > span {
  display: inline-block;
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}
.brand:hover .brand-text > span {
  animation: brand-ripple 0.7s var(--ease-out);
  animation-delay: calc(var(--i) * 0.04s);
}
@keyframes brand-ripple {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-3px); }
}
.brand:hover ~ .sig-mark.spin::after { animation-duration: 1.4s; }
@media (prefers-reduced-motion: reduce) {
  .brand:hover .brand-text > span { animation: none; }
}

/* ═══════════════════════════════════════════════════════════
   HERO CANVAS — hide for split-quiet-rise variant (it doesn't use blobs)
   ═══════════════════════════════════════════════════════════ */
.hero[data-hero="split-quiet-rise"] .hero-canvas { display: none !important; }

/* ═══════════════════════════════════════════════════════════
   READING RAIL — fixed TOC ruler + scroll cursor that glides along it
   ═══════════════════════════════════════════════════════════ */
.reading-rail {
  position: fixed;
  top: 50%;
  left: 18px;
  transform: translateY(-50%);
  z-index: 36;
  display: flex;
  flex-direction: column;
  gap: 30px;
  pointer-events: none;
}
.reading-rail .rr-line {
  position: absolute;
  left: 3px;
  top: -16px;
  bottom: -16px;
  width: 1px;
  background: var(--line-strong);
  opacity: 0.4;
}
.reading-rail .rr-progress {
  position: absolute;
  left: 3px;
  top: -16px;
  width: 1px;
  height: var(--rr-progress, 0%);
  background: var(--accent);
  opacity: 0.55;
  transition: height 0.18s linear;
  pointer-events: none;
}
.reading-rail .rr-cursor {
  position: absolute;
  left: -2px;
  top: -16px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg);
  z-index: 2;
  pointer-events: none;
  transform: translateY(-50%);
  box-shadow: 0 0 16px rgba(108, 92, 231, 0.5);
  transition: top 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}
.reading-rail .rr-mark {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  pointer-events: auto;
  cursor: pointer;
  text-decoration: none;
  color: var(--ink-faint);
  transition: color 0.4s var(--ease-out);
}
.reading-rail .rr-mark:hover,
.reading-rail .rr-mark.active { color: var(--ink); }

.reading-rail .rr-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--ink-faint);
  flex-shrink: 0;
  transition: transform 0.4s var(--ease-out), background 0.4s var(--ease-out);
}
.reading-rail .rr-mark.active .rr-dot {
  background: var(--accent);
  transform: scale(1.5);
}
.reading-rail .rr-roman {
  font-size: 10px;
  letter-spacing: 0.18em;
  font-family: var(--font-mono);
  opacity: 0.7;
  transition: opacity 0.3s var(--ease-out);
}
.reading-rail .rr-mark.active .rr-roman { opacity: 1; }

.reading-rail .rr-label {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 14px;
  white-space: nowrap;
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 0.4s var(--ease-out), transform 0.4s var(--ease-out);
  pointer-events: none;
  letter-spacing: 0;
}
.reading-rail .rr-mark.active .rr-label,
.reading-rail .rr-mark:hover .rr-label {
  opacity: 1;
  transform: translateX(0);
}
@media (max-width: 1200px) { .reading-rail { display: none; } }

/* ═══════════════════════════════════════════════════════════
   SELECTION — brushed accent stripe instead of default highlight
   ═══════════════════════════════════════════════════════════ */
::selection {
  background: color-mix(in oklab, var(--accent) 35%, transparent);
  color: var(--ink);
  text-shadow: 0 0.5px 0 color-mix(in oklab, var(--accent) 20%, transparent);
}
::-moz-selection {
  background: color-mix(in oklab, var(--accent) 35%, transparent);
  color: var(--ink);
}

/* ═══════════════════════════════════════════════════════════
   PAGE FOLD — top-right dog-ear page corner
   ═══════════════════════════════════════════════════════════ */
.page-fold {
  position: fixed;
  top: 0;
  right: 0;
  width: 36px;
  height: 36px;
  padding: 0;
  background: transparent;
  border: 0;
  cursor: pointer;
  z-index: 95;
  opacity: 0;
  transform: rotate(0deg);
  transform-origin: top right;
  transition: opacity 0.6s var(--ease-out) 1.4s, transform 0.4s var(--ease-out);
  filter: drop-shadow(-1px 1px 2px rgba(0,0,0,0.08));
}
body.has-scrolled .page-fold,
.page-fold:hover { opacity: 0.85; }
.page-fold:hover { transform: rotate(-2deg); }
.page-fold svg { width: 100%; height: 100%; display: block; }
@media (max-width: 600px) { .page-fold { display: none; } }

/* ═══════════════════════════════════════════════════════════
   COLOPHON MODAL — design system info card (opens from page fold)
   ═══════════════════════════════════════════════════════════ */
.colophon {
  position: fixed;
  inset: 0;
  z-index: 110;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s var(--ease-out);
}
.colophon.open { opacity: 1; pointer-events: auto; }
.colophon-backdrop {
  position: absolute;
  inset: 0;
  background: color-mix(in oklab, var(--bg) 35%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.colophon-card {
  position: absolute;
  top: 60px;
  right: 60px;
  width: min(360px, calc(100vw - 80px));
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  padding: 28px 28px 24px;
  box-shadow: 0 32px 80px -24px rgba(0,0,0,0.22);
  transform: translate(16px, -16px) scale(0.94);
  transform-origin: top right;
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
.colophon.open .colophon-card { transform: translate(0,0) scale(1); }
.colophon-close {
  position: absolute;
  top: 14px; right: 14px;
  width: 30px; height: 30px;
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  display: grid;
  place-items: center;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  color: var(--ink-soft);
  transition: color 0.3s var(--ease-out), border-color 0.3s var(--ease-out);
}
.colophon-close:hover { color: var(--ink); border-color: var(--ink); }
.colophon-eyebrow {
  font-size: 9px;
  letter-spacing: 0.32em;
  color: var(--ink-faint);
  margin-bottom: 12px;
}
.colophon-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
  color: var(--ink);
}
.colophon-tag {
  font-family: var(--font-serif);
  font-size: 14px;
  color: var(--ink-soft);
  margin: 0 0 20px;
  font-style: normal;
}
.colophon-tag em { font-style: italic; }
.colophon-row {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 14px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  align-items: center;
}
.colophon-row .cl-key {
  font-size: 9px;
  letter-spacing: 0.22em;
  color: var(--ink-faint);
  align-self: start;
  padding-top: 2px;
}
.colophon-row .cl-val {
  font-size: 12px;
  color: var(--ink);
  line-height: 1.55;
}
.cl-swatches { display: inline-flex; gap: 6px; }
.cl-swatches .sw {
  display: inline-block;
  width: 16px; height: 16px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
}
.colophon-rule { height: 1px; background: var(--line-strong); margin: 14px 0 12px; }
.colophon-sig {
  font-family: var(--font-serif);
  font-size: 14px;
  color: var(--ink-soft);
  margin: 0;
  text-align: right;
}
.colophon-sig em { font-style: italic; }

/* ═══════════════════════════════════════════════════════════
   CORNER CROP MARKS — fixed at viewport corners, drawn on load
   ═══════════════════════════════════════════════════════════ */
.corner-crops { position: fixed; inset: 0; pointer-events: none; z-index: 40; }
.corner-crops .cc {
  position: absolute;
  width: 24px; height: 24px;
  color: var(--accent);
  opacity: 0.55;
}
.corner-crops .cc-tl { top: 28px; left: 28px; }
.corner-crops .cc-tr { top: 28px; right: 28px; }
.corner-crops .cc-bl { bottom: 28px; left: 28px; }
.corner-crops .cc-br { bottom: 28px; right: 28px; }
.corner-crops .cc path {
  stroke-dasharray: 16;
  stroke-dashoffset: 16;
  animation: cc-draw 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.corner-crops .cc-tl path { animation-delay: 0.4s; }
.corner-crops .cc-tr path { animation-delay: 0.55s; }
.corner-crops .cc-bl path { animation-delay: 0.7s; }
.corner-crops .cc-br path { animation-delay: 0.85s; }
@keyframes cc-draw { to { stroke-dashoffset: 0; } }
@media (max-width: 600px) { .corner-crops { display: none; } }
@media (prefers-reduced-motion: reduce) {
  .corner-crops .cc path { stroke-dashoffset: 0; animation: none; }
}

/* ═══════════════════════════════════════════════════════════
   NAV STAMP — live editorial date / time masthead
   ═══════════════════════════════════════════════════════════ */
.nav-stamp {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.18em;
  color: var(--ink-faint);
  white-space: nowrap;
  margin-right: 6px;
  align-self: center;
  font-variant-numeric: tabular-nums;
}
@media (max-width: 1100px) { .nav-stamp { display: none; } }

/* ═══════════════════════════════════════════════════════════
   CURTAIN CONTINUE — Enter plate (rectangular framed button)
   Manual dismiss only — no auto-progress to give user time to read
   ═══════════════════════════════════════════════════════════ */
.curtain-continue {
  position: relative;
  margin-top: 12px;            /* extra breathing above natural 28px flex gap */
  display: inline-flex;
  align-items: center;
  gap: 16px;
  padding: 16px 36px 16px 40px;
  background: transparent;
  border: 1px solid rgba(242, 239, 230, 0.55);
  border-radius: 2px;
  color: rgba(242, 239, 230, 0.95);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  cursor: pointer;
  overflow: hidden;
  opacity: 0;
  /* Auto-appear right after counter reaches 100 (counter dur = 3.6s),
     then text color settles to dark in sync with the cream slab filling */
  animation: cc-rise 0.7s cubic-bezier(0.22, 1, 0.36, 1) 3.7s forwards,
             cc-text-flash 0.9s cubic-bezier(0.4, 0, 0.2, 1) 4.0s forwards;
  transition: color 0.4s var(--ease-out), border-color 0.4s var(--ease-out);
  /* Outer frame — double-line editorial plate */
  box-shadow: 0 0 0 4px transparent, 0 0 0 5px rgba(242, 239, 230, 0.18);
  align-self: center;
}
.curtain-continue::before {
  content: "";
  position: absolute;
  inset: 0;
  background: #f2efe6;
  transform: translateX(-101%);
  transition: transform 0.55s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 0;
  /* One-shot auto sweep: in → freeze filled (cream slab stays put) */
  animation: cc-auto-sweep 0.9s cubic-bezier(0.4, 0, 0.2, 1) 4.0s forwards;
}
@keyframes cc-auto-sweep {
  0%   { transform: translateX(-101%); }
  100% { transform: translateX(0); }       /* slide in and stay filled */
}
@keyframes cc-text-flash {
  0%, 30%   { color: rgba(242, 239, 230, 0.95); }
  100%      { color: #14130f; }            /* settle to dark on cream */
}
.curtain-continue:hover {
  color: #14130f;
  border-color: #f2efe6;
  box-shadow: 0 0 0 4px transparent, 0 0 0 5px rgba(242, 239, 230, 0.45);
}
.curtain-continue:hover::before { transform: translateX(0); }
.curtain-continue:hover .cc-arrow { transform: translate(3px, 3px); }
.curtain-continue .cc-text,
.curtain-continue .cc-arrow {
  position: relative;
  z-index: 1;
}
.curtain-continue .cc-arrow {
  font-size: 13px;
  letter-spacing: 0;
  transition: transform 0.4s var(--ease-out);
}
.curtain-continue:focus-visible {
  outline: 1px solid #f2efe6;
  outline-offset: 8px;
}
@keyframes cc-rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .curtain-continue { animation: none; opacity: 1; }
  .curtain-continue::before { transition: none; }
}

/* ═══════════════════════════════════════════════════════════
   CURTAIN — kinetic letter reveal for "DittoMud"
   ═══════════════════════════════════════════════════════════ */
.curtain-name.kinetic { display: inline-flex; }
.curtain-name.kinetic > span {
  display: inline-block;
  clip-path: inset(0 100% 0 0);
  transform: translateY(10px);
  animation: cn-reveal 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: calc(var(--i) * 0.085s + 0.45s);
}
@keyframes cn-reveal {
  to {
    clip-path: inset(0 0 0 0);
    transform: translateY(0);
  }
}
@media (prefers-reduced-motion: reduce) {
  .curtain-name.kinetic > span {
    animation: none;
    clip-path: none;
    transform: none;
  }
}

/* ═══════════════════════════════════════════════════════════
   HERO 3D PARALLAX — perspective on the inner stage
   ═══════════════════════════════════════════════════════════ */
.hero {
  perspective: 1400px;
  perspective-origin: 50% 50%;
}
.hero-inner,
.hero .hero-quiet-rise {
  transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}
@media (prefers-reduced-motion: reduce) {
  .hero-inner,
  .hero .hero-quiet-rise { transition: none; transform: none !important; }
}
@media (hover: none), (pointer: coarse) {
  .hero-inner,
  .hero .hero-quiet-rise { transform: none !important; }
}

/* ═══════════════════════════════════════════════════════════
   HERO SPOTLIGHT — cursor-following warm reading lamp
   ═══════════════════════════════════════════════════════════ */
.hero {
  position: relative;
  --hx: 50%;
  --hy: 50%;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background: radial-gradient(circle 360px at var(--hx) var(--hy),
    rgba(255, 248, 232, 0.55),
    transparent 65%);
  mix-blend-mode: soft-light;
  opacity: 0;
  transition: opacity 0.5s var(--ease-out);
}
.hero.spotlight-on::after { opacity: 1; }
[data-theme="dark"] .hero::after {
  background: radial-gradient(circle 360px at var(--hx) var(--hy),
    rgba(220, 230, 250, 0.10),
    transparent 65%);
  mix-blend-mode: screen;
}
.hero > .wrap, .hero > .hero-bg, .hero > .hero-canvas, .hero > * { position: relative; }
@media (prefers-reduced-motion: reduce) {
  .hero::after { display: none; }
}

/* ═══════════════════════════════════════════════════════════
   HERO LEDE — italic serif intro paragraph above hero-desc
   ═══════════════════════════════════════════════════════════ */
.hero-meta { display: flex; flex-direction: column; gap: 24px; }
.hero-lede {
  font-family: var(--font-serif);
  font-style: normal;
  font-weight: 400;
  font-size: clamp(20px, 2.2vw, 28px);
  line-height: 1.5;
  color: var(--ink);
  max-width: 540px;
  letter-spacing: -0.005em;
  margin: 0;
}
.hero-lede em {
  font-style: italic;
  color: var(--ink-soft);
  font-weight: 400;
}

/* ═══════════════════════════════════════════════════════════
   CHAPTER OPENER — editorial section intro: hairline + italic lede
   ═══════════════════════════════════════════════════════════ */
.chapter-opener {
  position: relative;
  padding: 80px var(--pad-x) 56px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  z-index: 1;
}
.chapter-opener .co-rule {
  display: block;
  height: 1px;
  background: var(--accent);
  width: 0;
  transform-origin: left center;
  transition: width 1.1s cubic-bezier(0.22, 1, 0.36, 1);
}
.chapter-opener.in .co-rule { width: 100%; }
.chapter-opener .co-lede {
  font-family: var(--font-serif);
  font-style: normal;
  font-weight: 400;
  font-size: clamp(20px, 2.4vw, 30px);
  line-height: 1.45;
  color: var(--ink-soft);
  max-width: 640px;
  margin: 0;
  letter-spacing: -0.005em;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.7s var(--ease-out) 0.5s, transform 0.7s var(--ease-out) 0.5s;
}
.chapter-opener.in .co-lede { opacity: 1; transform: translateY(0); }
.chapter-opener .co-lede em {
  font-style: italic;
  color: var(--ink);
  font-weight: 500;
}
@media (prefers-reduced-motion: reduce) {
  .chapter-opener .co-rule { width: 100%; transition: none; }
  .chapter-opener .co-lede { opacity: 1; transform: none; transition: none; }
}

/* ═══════════════════════════════════════════════════════════
   CHAPTER GHOST — giant italic serif Roman numerals per section
   (handoff sets the base; we strengthen the editorial feel)
   ═══════════════════════════════════════════════════════════ */
.chapter {
  top: 50% !important;
  right: 6% !important;
  font-size: clamp(200px, 28vw, 420px) !important;
  opacity: 0.09 !important;
  color: color-mix(in oklab, var(--accent) 55%, var(--ink)) !important;
  transform: translateY(-50%);
  transition: opacity 0.4s var(--ease-out);
}
[data-theme="dark"] .chapter { opacity: 0.09 !important; }
@media (max-width: 900px) {
  .chapter {
    right: 16px !important;
    top: 50% !important;
    font-size: clamp(120px, 32vw, 220px) !important;
    opacity: 0.05 !important;
  }
}

/* ═══════════════════════════════════════════════════════════
   THEME TOGGLE BUTTON
   ═══════════════════════════════════════════════════════════ */
.theme-toggle {
  width: 34px; height: 34px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  display: grid;
  place-items: center;
  color: var(--ink-soft);
  cursor: pointer;
  background: transparent;
  transition: color 0.3s var(--ease-out), border-color 0.3s var(--ease-out), transform 0.4s var(--ease-out);
}
.theme-toggle:hover {
  color: var(--ink);
  border-color: var(--ink);
  transform: rotate(20deg);
}
.theme-toggle svg { width: 16px; height: 16px; }
[data-theme="dark"] .icon-moon { display: none; }
:not([data-theme="dark"]) .icon-sun { display: none; }

/* ═══════════════════════════════════════════════════════════
   THEME-TRANSITION — iris reveal via View Transitions API
   ═══════════════════════════════════════════════════════════ */
::view-transition-old(root),
::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
}
::view-transition-old(root) { z-index: 1; }
::view-transition-new(root) {
  z-index: 999;
  animation: iris-in 0.85s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes iris-in {
  from { clip-path: circle(0% at var(--vt-x, 50%) var(--vt-y, 50%)); }
  to   { clip-path: circle(150vmax at var(--vt-x, 50%) var(--vt-y, 50%)); }
}
@media (prefers-reduced-motion: reduce) {
  ::view-transition-new(root) { animation: none; }
}

/* ═══════════════════════════════════════════════════════════
   CUSTOM CURSOR — blend-mode dot + trailing ring
   ═══════════════════════════════════════════════════════════ */
@media (hover: hover) and (pointer: fine) {
  body.has-cursor,
  body.has-cursor * { cursor: none !important; }

  .custom-cursor {
    position: fixed;
    top: 0; left: 0;
    width: 0; height: 0;
    pointer-events: none;
    z-index: 10001;          /* above curtain (z-index 9999) so it works on intro too */
    mix-blend-mode: difference;
    opacity: 0;
    transition: opacity 0.3s var(--ease-out);
  }
  body.has-cursor .custom-cursor { opacity: 1; }

  .cc-dot, .cc-ring {
    position: absolute;
    top: 0; left: 0;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    will-change: transform, width, height;
  }
  .cc-dot {
    width: 8px; height: 8px;
    background: #fff;
    transition: width 0.3s var(--ease-out), height 0.3s var(--ease-out);
  }
  .cc-ring {
    width: 36px; height: 36px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    transition: width 0.4s var(--ease-out), height 0.4s var(--ease-out), border-color 0.4s var(--ease-out);
  }
  body.cursor-hover .cc-dot { width: 0; height: 0; }
  body.cursor-hover .cc-ring { width: 56px; height: 56px; border-color: rgba(255, 255, 255, 0.85); }
}
@media (hover: none), (pointer: coarse) {
  .custom-cursor, .cursor-label { display: none !important; }
}

/* Context-aware cursor label (separate stacking context, no blend) */
@media (hover: hover) and (pointer: fine) {
  .cursor-label {
    position: fixed;
    top: 0; left: 0;
    transform: translate(-50%, -50%) scale(0.6);
    pointer-events: none;
    z-index: 10002;          /* above curtain so it works on intro too */
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--bg);
    background: var(--ink);
    padding: 9px 16px;
    border-radius: 999px;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.25s var(--ease-out), transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: transform, opacity;
    box-shadow: 0 6px 20px -6px rgba(0,0,0,0.25);
  }
  body.cursor-labeled .cursor-label {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  body.cursor-labeled .cc-dot,
  body.cursor-labeled .cc-ring {
    opacity: 0;
    transition: opacity 0.2s var(--ease-out);
  }
}

/* ═══════════════════════════════════════════════════════════
   HERO QUIET-RISE — magnetic chars (mouse-follow displacement)
   ═══════════════════════════════════════════════════════════ */
.hqr-char { will-change: transform; }

/* ═══════════════════════════════════════════════════════════
   MARGINALIA — superscript footnote markers with hover note
   ═══════════════════════════════════════════════════════════ */
.m-note {
  font-family: var(--font-mono);
  font-size: 0.65em;
  font-weight: 500;
  color: var(--accent);
  cursor: help;
  position: relative;
  display: inline;
  vertical-align: super;
  letter-spacing: 0;
  margin: 0 1px;
  text-decoration: none;
  font-variant-numeric: lining-nums;
  transition: color 0.3s var(--ease-out);
}
.m-note:hover { color: var(--ink); }
/* Larger invisible hit area for easier hover */
.m-note::before {
  content: "";
  position: absolute;
  inset: -6px -4px;
  z-index: 1;
}
.m-note::after {
  content: attr(data-note);
  position: absolute;
  bottom: calc(100% + 14px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  width: 260px;
  padding: 14px 18px;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s var(--ease-out), transform 0.3s var(--ease-out);
  z-index: 60;
  box-shadow: 0 16px 40px -16px rgba(0,0,0,0.22), 0 2px 6px rgba(0,0,0,0.04);
  letter-spacing: 0;
  text-transform: none;
  font-weight: 400;
  white-space: normal;
  text-align: left;
  font-variant-numeric: oldstyle-nums;
}
.m-note:hover::after,
.m-note:focus::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
/* If the note overflows right edge, anchor right instead */
.m-note.m-note-right::after {
  left: auto;
  right: 0;
  transform: translateX(0) translateY(4px);
}
.m-note.m-note-right:hover::after {
  transform: translateX(0) translateY(0);
}
/* Mobile: notes positioned below + wider */
@media (max-width: 768px) {
  .m-note::after {
    width: min(280px, calc(100vw - 48px));
    font-size: 13px;
    padding: 12px 14px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .m-note::after { transition: opacity 0.15s; }
}

/* ═══════════════════════════════════════════════════════════
   CUSTOM SCROLLBAR — thin accent thumb + light track
   ═══════════════════════════════════════════════════════════ */
html {
  scrollbar-width: thin;
  scrollbar-color: var(--accent) transparent;
}
html::-webkit-scrollbar {
  width: 6px;
  height: 6px;
  background: transparent;
}
html::-webkit-scrollbar-track {
  background: transparent;
}
html::-webkit-scrollbar-thumb {
  background: color-mix(in oklab, var(--accent) 70%, transparent);
  border-radius: 999px;
  transition: background 0.3s ease;
}
html::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
  width: 8px;
}
html::-webkit-scrollbar-corner {
  background: transparent;
}
/* Hide scrollbar on touch devices (they have native overlay) */
@media (hover: none) {
  html::-webkit-scrollbar { display: none; }
  html { scrollbar-width: none; }
}

/* ─── Hero / Curtain ink trail — calligraphic dots fade out behind cursor ─── */
.hero-ink,
.curtain-ink {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  overflow: hidden;
}
.curtain-ink { z-index: 1; }
.hero-ink-dot {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  filter: blur(2px);
  opacity: 0.6;
  animation: ink-fade 0.7s ease-out forwards;
  pointer-events: none;
}
@keyframes ink-fade {
  0%   { opacity: 0.55; transform: scale(1); }
  100% { opacity: 0;    transform: scale(0.4); }
}
@media (prefers-reduced-motion: reduce) { .hero-ink { display: none; } }

/* ─── Hero quiet-rise label/num accents — purple touches in light mode ─── */
.hero-quiet-rise .hqr-num { color: var(--accent); }
.hero-quiet-rise .hqr-label::before {
  content: "● ";
  color: var(--accent);
  margin-right: 4px;
  font-size: 8px;
  vertical-align: 1px;
}

/* ─── Hero "echo" — italic serif English ghosted behind 设计/交付 ─── */
.hqr-big { position: relative; }
.hqr-echo {
  position: absolute;
  inset: auto 0 -8% 0;
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(72px, 11vw, 168px);
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--ink);
  opacity: 0.04;
  pointer-events: none;
  user-select: none;
  white-space: nowrap;
  text-transform: lowercase;
  z-index: 0;
  will-change: transform;
}
.hqr-right .hqr-echo { right: 0; left: auto; text-align: right; }
.hqr-mask, .hqr-char { position: relative; z-index: 1; }
[data-theme="dark"] .hqr-echo { opacity: 0.06; }
@media (max-width: 600px) { .hqr-echo { display: none; } }

/* ═══════════════════════════════════════════════════════════
   PROCESS — connector line drawn between active card & right step
   ═══════════════════════════════════════════════════════════ */
.pin-frame { position: relative; }
.pin-connector {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 80px;          /* matches pin-frame gap */
  height: 1px;
  background: var(--accent);
  transform: translate(-50%, -50%) scaleX(0);
  transform-origin: left center;
  pointer-events: none;
  z-index: 1;
}
.pin-frame.draw .pin-connector {
  animation: pin-draw 0.8s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
@keyframes pin-draw {
  0%   { transform: translate(-50%, -50%) scaleX(0); }
  100% { transform: translate(-50%, -50%) scaleX(1); }
}
@media (max-width: 900px) { .pin-connector { display: none; } }

/* ═══════════════════════════════════════════════════════════
   SCROLL PROGRESS — top 1px ribbon
   ═══════════════════════════════════════════════════════════ */
.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 0;
  background: var(--accent);
  z-index: 100;
  pointer-events: none;
  will-change: width;
  transition: opacity 0.3s var(--ease-out);
  opacity: 0;
}
body.has-scrolled .scroll-progress { opacity: 1; }

/* ═══════════════════════════════════════════════════════════
   DROP CAP — magazine-style first-letter on long-paragraph blocks
   ═══════════════════════════════════════════════════════════ */
#studio .studio-text::first-letter {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  font-size: 4.4em;
  line-height: 0.85;
  float: left;
  margin: 0.06em 0.14em -0.04em 0;
  color: var(--accent);
}

/* ═══════════════════════════════════════════════════════════
   PAPER VIGNETTE — subtle inset shadow at page edges
   ═══════════════════════════════════════════════════════════ */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 50;
  box-shadow: inset 0 0 240px rgba(0, 0, 0, 0.06);
}
[data-theme="dark"] body::after {
  box-shadow: inset 0 0 240px rgba(0, 0, 0, 0.5);
}

/* ═══════════════════════════════════════════════════════════
   NUMERIC FIGURES — tabular + oldstyle for editorial polish
   ═══════════════════════════════════════════════════════════ */
.tier-price,
.kpi-num,
.num-big,
.num,
.hero-stat .num,
.print-marks,
.foot-sign-stamp,
.scroll-progress,
.statusbar,
.cap-num,
.case-num,
.case-year,
.case-chip,
.t-num,
.hqr-num,
.tier-features li,
time {
  font-variant-numeric: tabular-nums oldstyle-nums;
  font-feature-settings: "tnum" 1, "onum" 1;
}
/* Big display numbers stay lining (cleaner at large sizes) */
.tier-price,
.num-big,
.kpi-num {
  font-variant-numeric: tabular-nums lining-nums;
  font-feature-settings: "tnum" 1, "lnum" 1;
}

/* ═══════════════════════════════════════════════════════════
   SERVICES CAP-ROW — abstract SVG marks + line draw on hover
   ═══════════════════════════════════════════════════════════ */
.cap-row {
  position: relative;
  overflow: hidden;
  grid-template-columns: 80px 56px 1fr auto auto !important;
}
.cap-mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  color: var(--ink-soft);
  transition: color 0.4s var(--ease-out), transform 0.4s var(--ease-out);
}
.cap-mark svg { width: 36px; height: 36px; }
.cap-row:hover .cap-mark {
  color: var(--accent);
  transform: rotate(-3deg);
}
.cap-row::after {
  content: "";
  position: absolute;
  left: var(--pad-x, 56px);
  right: var(--pad-x, 56px);
  bottom: 0;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
.cap-row:hover::after { transform: scaleX(1); }
@media (prefers-reduced-motion: reduce) {
  .cap-row::after, .cap-mark { transition: none; }
}
@media (max-width: 768px) {
  .cap-row { grid-template-columns: 56px 40px 1fr auto !important; }
  .cap-row .cap-tags { display: none; }
  .cap-mark { width: 36px; height: 36px; }
  .cap-mark svg { width: 28px; height: 28px; }
}

/* ═══════════════════════════════════════════════════════════
   AMBIENT — slow film-grain breathing
   (handoff styles.css already has body::before noise at 4% opacity;
    here we just nudge it with a 30s drift)
   ═══════════════════════════════════════════════════════════ */
body::before {
  animation: grain-drift 30s linear infinite;
  will-change: transform;
}
@keyframes grain-drift {
  0%   { transform: translate(0, 0); }
  20%  { transform: translate(-3px, 2px); }
  40%  { transform: translate(2px, -3px); }
  60%  { transform: translate(-2px, -2px); }
  80%  { transform: translate(3px, 1px); }
  100% { transform: translate(0, 0); }
}

/* ═══════════════════════════════════════════════════════════
   A11Y — respect prefers-reduced-motion
   ═══════════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  /* Stop infinite cycling animations entirely (snap-to-end would jump them off-screen) */
  .marquee-track,
  .sig-mark.spin::after,
  .blink,
  .hqr-dot,
  .hero-eyebrow .blink,
  .hero-canvas {
    animation: none !important;
  }
  /* Hero metaball canvas — motion-heavy, hide for sensitive users */
  .hero-canvas { display: none !important; }
  /* Skip the curtain intro */
  .curtain { display: none !important; }
  html { scroll-behavior: auto !important; }
}
