/* ============================================================
 * 3D Design page — local stylesheet (td- prefix)
 * Design vocabulary: rendered · studio · deep-teal primary · PBR
 * Mirrors the Illustration (il-) conventions so the Graphics
 * discipline reads as one studio. LIME stays the site-wide primary
 * accent; teal (--td-teal) flavors the 3D demo surfaces only.
 * ============================================================ */

.td-page {
  --td-teal: #0F766E;
  --td-pine: #0B5A54;
  --td-copper: #C8743C;
  --td-ceramic: #D4E6E2;
  --td-paper: #E9F5F3;
  --td-ink: #08100F;
  --td-lime: #d4ff3a;
  --td-paper-soft: rgba(233, 245, 243, 0.04);
  --td-line: rgba(233, 245, 243, 0.12);
  --td-line-strong: rgba(233, 245, 243, 0.22);
  --td-mono: 'JetBrains Mono', ui-monospace, monospace;
  --td-display: 'Fraunces', 'Bodoni Moda', serif;
  --td-sans: 'Space Grotesk', system-ui, sans-serif;
  background: var(--td-ink);
  color: var(--td-paper);
}

/* ===== shared atoms ===== */
.td-eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--td-mono);
  font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase;
  color: rgba(233, 245, 243, 0.62);
  padding: 8px 12px;
  border: 1px solid var(--td-line);
  border-radius: 999px;
  background: var(--td-paper-soft);
}
.td-eyebrow .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 12px var(--lime);
  animation: tdPulse 2.4s ease-in-out infinite;
}
@keyframes tdPulse { 0%, 100% { opacity: 1 } 50% { opacity: 0.45 } }

.td-btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--td-sans);
  font-size: 14px; font-weight: 500;
  letter-spacing: 0.04em;
  padding: 14px 22px;
  border: 1px solid var(--td-line-strong);
  border-radius: 999px;
  color: var(--td-paper);
  background: transparent;
  text-decoration: none;
  transition: background-color 0.35s cubic-bezier(0.16,1,0.3,1),
              color 0.35s cubic-bezier(0.16,1,0.3,1),
              border-color 0.35s cubic-bezier(0.16,1,0.3,1);
}
.td-btn:hover {
  background: var(--td-paper);
  color: var(--td-ink);
  border-color: var(--td-paper);
}
/* Primary CTA — LIME per site convention (matches .v2-btn--lime, .il-btn--lime).
 * Reserve teal for hover-state backgrounds, demo art, and warnings.
 * --td-teal alias kept so existing markup can opt into a "teal" name
 * without ever colouring a primary CTA teal. */
.td-btn--lime,
.td-btn--teal {
  background: var(--td-lime);
  color: var(--td-ink);
  border-color: var(--td-lime);
}
.td-btn--lime:hover,
.td-btn--teal:hover {
  background: transparent;
  color: var(--td-lime);
  border-color: var(--td-lime);
}
.td-btn .arr { transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1); }
.td-btn:hover .arr { transform: translateX(4px); }

.td-section {
  position: relative;
  padding: 140px 6vw 160px;
  z-index: 2;
}
/* Interactive sections sit above the rich.js ambient layer + any leftover
 * stacking context from earlier sticky sections (td-pass__pin, td-process
 * are 460–600vh tall with sticky children that make their own stacking
 * contexts). Belt-and-braces pointer-events on the interactive children. */
.td-style, .td-tools, .td-sys, .td-ledger, .td-cta {
  z-index: 5;
  isolation: isolate;
}
/* Keep the tall sticky-pin sections strictly below the live interactive
 * sections so a released sticky child can never intercept their clicks. */
.td-pass, .td-process { z-index: 1; }
.td-pass__sticky, .td-process__sticky { z-index: 1; }
.td-style__stage,
.td-style__panel,
.td-style__tab-row,
.td-style__tab,
.td-style__slider-wrap,
.td-style__slider,
.td-style__tokens,
.td-tools__grid,
.td-tool {
  pointer-events: auto;
  position: relative;
  z-index: 1;
}
.td-section__head {
  max-width: 880px;
  margin: 0 auto 80px;
  text-align: center;
}
.td-section__title {
  font-family: var(--td-display);
  font-weight: 400;
  font-size: clamp(40px, 5.6vw, 92px);
  line-height: 1.04;
  letter-spacing: -0.02em;
  margin: 24px 0 24px;
  font-variation-settings: 'opsz' 144, 'SOFT' 30, 'WONK' 1;
}
.td-section__title em {
  font-style: italic;
  color: var(--td-lime);
}
.td-section__lede {
  font-family: var(--td-sans);
  font-size: 17px;
  line-height: 1.62;
  color: rgba(233, 245, 243, 0.70);
  max-width: 640px;
  margin: 0 auto;
}
.td-section__lede em {
  font-family: var(--td-display);
  font-style: italic;
  color: var(--td-paper);
  font-weight: 500;
}

/* ============================================================
 * 01 — HERO (material lab)
 * ============================================================ */
.td-hero {
  position: relative;
  min-height: 100vh;
  padding: 120px 6vw 60px;
  overflow: hidden;
  z-index: 1;
}
.td-hero__grain {
  position: absolute; inset: 0;
  pointer-events: none;
  opacity: 0.06;
  background-image:
    radial-gradient(rgba(233, 245, 243, 0.6) 1px, transparent 1px),
    radial-gradient(rgba(233, 245, 243, 0.6) 1px, transparent 1px);
  background-size: 4px 4px, 6px 6px;
  background-position: 0 0, 2px 3px;
  mix-blend-mode: overlay;
}
.td-hero__inner {
  position: relative; z-index: 2;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
  min-height: calc(100vh - 240px);
}
.td-hero__left { padding-right: 20px; }
.td-hero__title {
  font-family: var(--td-display);
  font-weight: 400;
  font-size: clamp(48px, 6.4vw, 108px);
  line-height: 1.0;
  letter-spacing: -0.025em;
  margin: 28px 0 28px;
  font-variation-settings: 'opsz' 144, 'wght' 400, 'SOFT' 30, 'WONK' 1;
}
.td-hero__title em {
  font-style: italic;
  color: var(--td-lime);
}
.td-hero__lede {
  font-family: var(--td-sans);
  font-size: 18px;
  line-height: 1.62;
  color: rgba(233, 245, 243, 0.72);
  max-width: 540px;
}
.td-hero__cta-row {
  margin-top: 32px;
  display: flex; gap: 14px; flex-wrap: wrap;
}
.td-hero__caption {
  margin-top: 38px;
  font-family: var(--td-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(233, 245, 243, 0.45);
  display: flex; gap: 14px; align-items: baseline;
}
.td-hero__caption .n {
  font-family: var(--td-display);
  font-style: italic;
  font-size: 16px;
  color: var(--td-lime);
}

/* material lab chrome — dark viewport (3D studio, not a paper pad) */
.td-hero__lab {
  position: relative;
  width: 100%;
  height: min(620px, 70vh);
  background:
    radial-gradient(120% 90% at 50% 18%, #16302c 0%, #0a1816 55%, #06100f 100%);
  border-radius: 12px;
  box-shadow:
    0 30px 80px -20px rgba(0, 0, 0, 0.65),
    0 0 0 1px rgba(233, 245, 243, 0.06);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.td-lab__chrome {
  flex: 0 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(233, 245, 243, 0.10);
  background: rgba(8, 16, 15, 0.55);
  backdrop-filter: blur(8px);
  z-index: 3;
}
.td-lab__title {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--td-mono);
  font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase;
  color: rgba(233, 245, 243, 0.72);
}
.td-lab__pulse {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 10px var(--lime);
  animation: tdPulse 1.6s ease-in-out infinite;
}
.td-lab__counter {
  font-family: var(--td-display);
  font-style: italic;
  font-size: 13px;
  color: rgba(233, 245, 243, 0.55);
}
.td-lab__counter span { font-weight: 600; color: var(--td-teal); margin-right: 4px; }

#td-lab-canvas {
  flex: 1 1 auto;
  display: block;
  width: 100%;
  min-height: 0;
  z-index: 1;
  cursor: grab;
  touch-action: none;
}
#td-lab-canvas:active { cursor: grabbing; }
.td-lab__hint {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--td-display);
  font-style: italic;
  font-size: 22px;
  color: rgba(233, 245, 243, 0.30);
  pointer-events: none;
  transition: opacity 0.4s ease;
  z-index: 2;
}
.td-lab__hint.is-hidden { opacity: 0; }

.td-lab__hud {
  flex: 0 0 auto;
  padding: 12px 14px;
  display: flex; gap: 16px; flex-wrap: wrap; justify-content: space-between;
  border-top: 1px solid rgba(233, 245, 243, 0.10);
  background: rgba(8, 16, 15, 0.55);
  backdrop-filter: blur(8px);
  z-index: 3;
}
.td-lab__seg {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.td-lab__seg-k {
  font-family: var(--td-mono);
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(233, 245, 243, 0.4);
  margin-right: 2px;
}
.td-lab__btn {
  font-family: var(--td-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 7px 11px;
  border: 1px solid var(--td-line-strong);
  background: transparent;
  color: var(--td-paper);
  border-radius: 999px;
  cursor: pointer;
  transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}
.td-lab__btn:hover { border-color: var(--td-teal); color: var(--td-teal); }
.td-lab__btn.is-on {
  background: var(--lime);
  border-color: var(--lime);
  color: var(--td-ink);
}

/* hero metrics row */
.td-hero__metrics {
  position: relative; z-index: 2;
  margin-top: 36px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border-top: 1px solid var(--td-line);
}
.td-hero__metric {
  padding: 22px 24px;
  border-right: 1px solid var(--td-line);
  display: flex; flex-direction: column; gap: 8px;
}
.td-hero__metric:last-child { border-right: 0; }
.td-hero__metric .k {
  font-family: var(--td-mono);
  font-size: 11px; letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(233, 245, 243, 0.5);
}
.td-hero__metric .v {
  font-family: var(--td-display);
  font-size: 38px; font-weight: 500;
  color: var(--td-paper);
  font-variation-settings: 'opsz' 96, 'wght' 500;
}
.td-hero__metric .v em {
  font-style: italic;
  color: var(--td-lime);
}

/* ============================================================
 * 02 — LEDGER
 * ============================================================ */
.td-ledger__table {
  max-width: 1200px;
  margin: 0 auto;
  border-top: 1px solid var(--td-line-strong);
}
.td-ledger__row {
  display: grid;
  grid-template-columns: 1.2fr 1fr 2.4fr 1fr;
  gap: 30px;
  padding: 26px 18px;
  border-bottom: 1px solid var(--td-line);
  transition: background 0.3s ease, padding 0.3s ease;
  align-items: baseline;
}
.td-ledger__row:hover {
  background: rgba(233, 245, 243, 0.03);
  padding-left: 28px;
}
.td-ledger__name {
  font-family: var(--td-display);
  font-style: italic;
  font-size: 28px;
  font-variation-settings: 'opsz' 96, 'wght' 500, 'SOFT' 30, 'WONK' 1;
  color: var(--td-paper);
}
.td-ledger__type {
  font-family: var(--td-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(233, 245, 243, 0.55);
}
.td-ledger__beat {
  font-family: var(--td-sans);
  font-size: 14px;
  line-height: 1.55;
  color: rgba(233, 245, 243, 0.72);
}
.td-ledger__metric {
  text-align: right;
  display: flex; flex-direction: column; gap: 4px;
}
.td-ledger__metric em {
  font-family: var(--td-display);
  font-style: italic;
  font-size: 32px;
  font-weight: 500;
  color: var(--td-lime);
  font-variation-settings: 'opsz' 96, 'wght' 500;
}
.td-ledger__metric span {
  font-family: var(--td-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(233, 245, 243, 0.45);
}

/* ============================================================
 * 03 — FOUR PASSES (sticky scroll: wireframe → flat → textured → render)
 * ============================================================ */
.td-pass__intro { max-width: 880px; margin: 0 auto 60px; text-align: center; }
.td-pass__pin {
  position: relative;
  height: 460vh;
}
.td-pass__stage {
  position: relative;
  width: 100%;
  height: 100%;
}
.td-pass__sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.td-pass__rail {
  position: absolute;
  bottom: 6vh;
  left: 50%;
  transform: translateX(-50%);
  display: flex; align-items: center; gap: 18px;
  padding: 10px 20px;
  background: rgba(233, 245, 243, 0.05);
  border: 1px solid var(--td-line);
  border-radius: 999px;
  backdrop-filter: blur(12px);
  z-index: 5;
}
.td-pass__counter {
  font-family: var(--td-mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  display: flex; gap: 6px;
}
.td-pass__counter span:first-child { color: var(--td-lime); font-weight: 600; }
.td-pass__counter .sep { color: rgba(233, 245, 243, 0.3); }
.td-pass__progress {
  width: 240px;
  height: 2px;
  background: rgba(233, 245, 243, 0.12);
  border-radius: 1px;
  overflow: hidden;
}
.td-pass__progress-fill {
  height: 100%;
  width: 0%;
  background: var(--td-lime);
  transition: width 0.3s ease;
}
.td-pass__label {
  font-family: var(--td-display);
  font-style: italic;
  font-size: 13px;
  color: rgba(233, 245, 243, 0.78);
  min-width: 180px;
}
.td-pass__art {
  position: relative;
  width: min(640px, 84vw);
  display: flex; flex-direction: column; align-items: center;
  gap: 22px;
}
#td-pass-canvas {
  width: 100%;
  aspect-ratio: 600 / 460;
  border-radius: 10px;
  overflow: hidden;
  display: block;
  background: #081210;
  box-shadow:
    0 40px 90px -30px rgba(0, 0, 0, 0.7),
    0 0 0 1px rgba(233, 245, 243, 0.06);
}
.td-pass__caption {
  font-family: var(--td-display);
  font-style: italic;
  font-size: 16px;
  color: rgba(233, 245, 243, 0.66);
  text-align: center;
  max-width: 520px;
  min-height: 24px;
  transition: opacity 0.4s ease;
}

/* ============================================================
 * 04 — PROCESS (sticky pinned scenes)
 * ============================================================ */
.td-process {
  position: relative;
  padding: 0;
  background: linear-gradient(180deg, transparent, rgba(233, 245, 243, 0.02), transparent);
}
.td-process__inner {
  position: relative;
  height: 600vh;
}
.td-process__sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.td-process__num {
  position: absolute;
  top: 8vh; right: 6vw;
  font-family: var(--td-display);
  font-style: italic;
  font-size: clamp(120px, 18vw, 280px);
  line-height: 1;
  color: rgba(233, 245, 243, 0.05);
  font-variation-settings: 'opsz' 144, 'wght' 400, 'SOFT' 30, 'WONK' 1;
  pointer-events: none;
}
.td-process__scene {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
  padding: 0 6vw;
}
.td-process__scene.is-active {
  opacity: 1;
  transform: translateY(0);
}
.td-process__scene-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
  width: 100%;
  max-width: 1200px;
}
.td-process__copy h3 {
  font-family: var(--td-display);
  font-size: clamp(40px, 5.6vw, 88px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 24px 0 20px;
  font-variation-settings: 'opsz' 144, 'wght' 500, 'SOFT' 30, 'WONK' 1;
}
.td-process__copy h3 em {
  font-style: italic;
  color: var(--td-lime);
}
.td-process__copy p {
  font-family: var(--td-sans);
  font-size: 17px;
  line-height: 1.62;
  color: rgba(233, 245, 243, 0.72);
  max-width: 480px;
}
.td-process__step {
  margin-top: 24px;
  font-family: var(--td-mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--lime);
}
.td-process__visual {
  position: relative;
  height: 56vh;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(233, 245, 243, 0.03);
  border: 1px solid var(--td-line);
}

.td-process__rail {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  width: 200px;
  height: 2px;
  background: rgba(233, 245, 243, 0.12);
  border-radius: 1px;
  overflow: hidden;
  z-index: 50;
  opacity: 0;
  transition: opacity 0.4s ease;
}
.td-process__rail.is-on { opacity: 1; }
.td-process__rail-fill {
  height: 100%;
  width: 0%;
  background: var(--td-lime);
  transition: width 0.2s linear;
}

/* process visual variants */
.td-pv {
  position: absolute; inset: 0;
  padding: 28px;
  display: flex; flex-direction: column;
  gap: 12px;
  overflow: auto;
}
.td-pv--brief { gap: 16px; }
.td-pv__note {
  padding: 18px 22px;
  background: rgba(233, 245, 243, 0.04);
  border-left: 2px solid var(--td-teal);
  border-radius: 0 6px 6px 0;
}
.td-pv__note em {
  display: block;
  font-family: var(--td-display);
  font-style: italic;
  font-size: 22px;
  line-height: 1.3;
  color: var(--td-paper);
  font-variation-settings: 'opsz' 96, 'SOFT' 30, 'WONK' 1;
}
.td-pv__note span {
  display: block;
  margin-top: 6px;
  font-family: var(--td-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(233, 245, 243, 0.5);
}
.td-pv__tags {
  margin-top: auto;
  display: flex; gap: 10px; flex-wrap: wrap;
}
.td-pv__tags span {
  padding: 6px 12px;
  border: 1px solid var(--td-line);
  border-radius: 999px;
  font-family: var(--td-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(233, 245, 243, 0.6);
}

.td-pv--thumbs { padding: 18px; }
.td-pv__thumb-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  height: 100%;
}
.td-pv__thumb {
  background: rgba(233, 245, 243, 0.03);
  border: 1px solid var(--td-line);
  border-radius: 6px;
  display: grid; place-items: center;
  position: relative;
  transition: border-color 0.3s ease, background-color 0.3s ease;
}
.td-pv__thumb.is-pick {
  background: rgba(15, 118, 110, 0.14);
  border-color: var(--td-teal);
  box-shadow: 0 0 0 1px var(--td-teal);
}
.td-pv__thumb svg { width: 64%; height: 64%; color: rgba(233, 245, 243, 0.7); }
.td-pv__thumb.is-pick svg { color: var(--td-teal); }
.td-pv__thumb-num {
  position: absolute; top: 6px; left: 8px;
  font-family: var(--td-mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  color: rgba(233, 245, 243, 0.4);
}

.td-pv--line, .td-pv--color { padding: 22px 26px; }
.td-pv__sys-row {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 18px;
  padding: 12px 0;
  border-bottom: 1px solid var(--td-line);
  align-items: center;
}
.td-pv__sys-row:last-child { border-bottom: 0; }
.td-pv__sys-row .k {
  font-family: var(--td-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(233, 245, 243, 0.5);
}
.td-pv__sys-row .v {
  font-family: var(--td-sans);
  font-size: 14px;
  color: rgba(233, 245, 243, 0.9);
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.td-pv__sys-row .v i {
  width: 22px; height: 22px;
  border-radius: 50%;
  display: inline-block;
  border: 1px solid rgba(233, 245, 243, 0.18);
}

.td-pv--render {
  flex-direction: row; flex-wrap: wrap;
  align-content: center;
  justify-content: center;
  gap: 8px;
  padding: 28px;
}
.td-pv__chip {
  padding: 8px 14px;
  border: 1px solid var(--td-line);
  border-radius: 999px;
  font-family: var(--td-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(233, 245, 243, 0.7);
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}
.td-pv__chip:hover {
  background: var(--td-teal);
  color: var(--td-paper);
  border-color: var(--td-teal);
}

.td-pv--deliver { padding: 22px 26px; gap: 0; }
.td-pv__defense {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 18px;
  padding: 14px 0;
  border-bottom: 1px solid var(--td-line);
  align-items: baseline;
}
.td-pv__defense:last-child { border-bottom: 0; }
.td-pv__defense .k {
  font-family: var(--td-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--td-lime);
}
.td-pv__defense .v {
  font-family: var(--td-display);
  font-style: italic;
  font-size: 17px;
  color: rgba(233, 245, 243, 0.92);
  font-variation-settings: 'opsz' 96, 'SOFT' 30, 'WONK' 1;
}

/* ============================================================
 * 05 — STYLE (live finish morph)
 * ============================================================ */
.td-style__stage {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  max-width: 1200px;
  margin: 0 auto;
  align-items: center;
}
.td-style__board {
  position: relative;
  width: min(460px, 92%);
  margin: 0 auto;
  background: #0a1816;
  border: 1px solid var(--td-line);
  border-radius: 14px;
  overflow: hidden;
  box-shadow:
    0 40px 80px -20px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(233, 245, 243, 0.05);
}
.td-style__board-bar,
.td-style__board-foot {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  font-family: var(--td-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(233, 245, 243, 0.6);
}
.td-style__board-bar { border-bottom: 1px solid var(--td-line); }
.td-style__board-foot { border-top: 1px solid var(--td-line); }
.td-style__board-dims, .td-style__board-mood { color: rgba(233, 245, 243, 0.4); }
.td-style__canvas { position: relative; }
#td-style-canvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  background: radial-gradient(120% 90% at 50% 30%, #12241f, #0a1816 70%);
}
.td-style__panel {
  display: flex; flex-direction: column;
  gap: 22px;
  padding: 28px;
  background: rgba(233, 245, 243, 0.03);
  border: 1px solid var(--td-line);
  border-radius: 12px;
}
.td-style__tab-row { display: flex; gap: 14px; }
.td-style__tab {
  flex: 1;
  padding: 14px 16px;
  border: 1px solid var(--td-line);
  border-radius: 8px;
  cursor: pointer;
  /* Specific transitions only — `transition: all` on a clickable card can
   * drop mid-click activation when the page bg-tone is also transitioning. */
  transition: border-color 0.3s ease, background-color 0.3s ease;
  position: relative;
  z-index: 1;
}
.td-style__tab.is-on {
  border-color: var(--lime);
  background: rgba(212, 255, 58, 0.05);
}
.td-style__tab-name {
  font-family: var(--td-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(233, 245, 243, 0.7);
  margin-bottom: 4px;
}
.td-style__tab-name em {
  font-family: var(--td-display);
  font-style: italic;
  font-size: 16px;
  text-transform: none;
  letter-spacing: 0;
  color: var(--td-paper);
  margin-left: 4px;
  font-variation-settings: 'opsz' 96, 'SOFT' 30, 'WONK' 1;
}
.td-style__tab-line {
  font-family: var(--td-sans);
  font-size: 12px;
  color: rgba(233, 245, 243, 0.55);
}
.td-style__slider-wrap { display: flex; flex-direction: column; gap: 8px; }
.td-style__slider {
  appearance: none;
  width: 100%; height: 4px;
  background: var(--td-line);
  border-radius: 2px;
  outline: none;
  cursor: ew-resize;
}
.td-style__slider::-webkit-slider-thumb {
  appearance: none;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--lime);
  cursor: ew-resize;
  box-shadow: 0 4px 12px rgba(212, 255, 58, 0.5);
}
.td-style__slider::-moz-range-thumb {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--lime);
  cursor: ew-resize;
  border: 0;
  box-shadow: 0 4px 12px rgba(212, 255, 58, 0.5);
}
.td-style__slider-rail {
  display: flex; justify-content: space-between;
  font-family: var(--td-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(233, 245, 243, 0.55);
}
.td-style__tokens {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border-top: 1px solid var(--td-line);
  border-left: 1px solid var(--td-line);
}
.td-style__token {
  padding: 12px 14px;
  border-right: 1px solid var(--td-line);
  border-bottom: 1px solid var(--td-line);
  display: flex; flex-direction: column; gap: 4px;
}
.td-style__token .k {
  font-family: var(--td-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(233, 245, 243, 0.5);
}
.td-style__token .v {
  font-family: var(--td-sans);
  font-size: 13px;
  color: var(--td-paper);
}

/* ============================================================
 * 06 — SYSTEM
 * ============================================================ */
.td-sys__grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 24px;
  max-width: 1200px;
  margin: 0 auto;
}
.td-sys__panel {
  padding: 28px;
  background: rgba(233, 245, 243, 0.03);
  border: 1px solid var(--td-line);
  border-radius: 12px;
  position: relative;
  overflow: hidden;
}
.td-sys__panel-head {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--td-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(233, 245, 243, 0.55);
  margin-bottom: 22px;
}
.td-sys__panel-head .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 10px var(--lime);
}

.td-sys__mat-row {
  display: grid;
  grid-template-columns: 110px 40px 1fr;
  gap: 16px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--td-line);
  color: var(--td-paper);
}
.td-sys__mat-row:last-child { border-bottom: 0; }
.td-sys__mat-row .bn {
  font-family: var(--td-display);
  font-style: italic;
  font-size: 18px;
  font-variation-settings: 'opsz' 96, 'wght' 500, 'SOFT' 30, 'WONK' 1;
}
.td-sys__mat-sw {
  width: 40px; height: 40px;
  border-radius: 8px;
  border: 1px solid rgba(233, 245, 243, 0.18);
  display: block;
}
.td-sys__mat-row .mm {
  font-family: var(--td-mono);
  font-size: 10px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: rgba(233, 245, 243, 0.5);
}

.td-sys__sw-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--td-line);
  border: 1px solid var(--td-line);
  border-radius: 8px;
  overflow: hidden;
}
.td-sys__sw {
  aspect-ratio: 2 / 1;
  padding: 12px 14px;
  display: flex; flex-direction: column;
  justify-content: space-between;
  color: var(--td-paper);
  position: relative;
}
.td-sys__sw-name {
  font-family: var(--td-display);
  font-style: italic;
  font-size: 22px;
  font-variation-settings: 'opsz' 96, 'wght' 500, 'SOFT' 30, 'WONK' 1;
}
.td-sys__sw-meta {
  font-family: var(--td-mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.85;
}

.td-sys__rule {
  padding: 14px 0;
  border-bottom: 1px solid var(--td-line);
  font-family: var(--td-sans);
  font-size: 14px;
  line-height: 1.5;
  color: rgba(233, 245, 243, 0.78);
}
.td-sys__rule:last-child { border-bottom: 0; }
.td-sys__rule em {
  font-family: var(--td-display);
  font-style: italic;
  color: var(--td-paper);
  font-size: 15px;
  font-variation-settings: 'opsz' 96, 'SOFT' 30, 'WONK' 1;
}
.td-sys__rule .ok, .td-sys__rule .no {
  display: inline-block;
  padding: 3px 9px;
  margin-right: 10px;
  font-family: var(--td-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  border-radius: 999px;
}
.td-sys__rule .ok { background: var(--td-teal); color: var(--td-paper); }
.td-sys__rule .no { background: rgba(200, 116, 60, 0.15); color: var(--td-copper); border: 1px solid var(--td-copper); }

.td-sys__jar { padding: 0; }
.td-sys__jar .td-sys__panel-head {
  position: absolute; top: 18px; left: 22px;
  margin: 0;
  z-index: 2;
  /* The head + readout float over the canvas where chips pile up. Let pointer
   * events pass through so every chip stays draggable, not just the ones in
   * the clear middle band. */
  pointer-events: none;
}
.td-sys__jar-readout { pointer-events: none; }
#td-sys-jar {
  width: 100%;
  aspect-ratio: 1.4 / 1;
  display: block;
  background: rgba(233, 245, 243, 0.02);
}
.td-sys__jar-readout {
  position: absolute; bottom: 14px; left: 22px; right: 22px;
  padding: 10px 14px;
  background: rgba(8, 16, 15, 0.65);
  border: 1px solid var(--td-line);
  border-radius: 6px;
  font-family: var(--td-mono);
  font-size: 11px;
  letter-spacing: 0.10em;
  color: rgba(233, 245, 243, 0.85);
  backdrop-filter: blur(8px);
}

/* ============================================================
 * 07 — TOOLS
 * ============================================================ */
.td-tools__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  max-width: 1200px;
  margin: 0 auto;
  background: var(--td-line);
  border: 1px solid var(--td-line);
  border-radius: 12px;
  overflow: hidden;
}
.td-tool {
  background: var(--td-ink);
  padding: 22px 24px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  cursor: pointer;
  /* Specific transitions only — `transition: all` collides with rich.js's
   * stagger-list animation-fill-mode: forwards. */
  transition: background-color 0.3s ease, color 0.3s ease;
  min-height: 110px;
  position: relative;
}
.td-tool:hover {
  background: var(--td-teal);
  color: var(--td-paper);
}
.td-tool .cat {
  font-family: var(--td-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(233, 245, 243, 0.45);
  margin-bottom: 6px;
}
.td-tool:hover .cat { color: rgba(233, 245, 243, 0.75); }
.td-tool .nm {
  font-family: var(--td-display);
  font-style: italic;
  font-size: 22px;
  font-variation-settings: 'opsz' 96, 'wght' 500, 'SOFT' 30, 'WONK' 1;
}
.td-tool .glyph svg {
  width: 28px; height: 28px;
  fill: none;
  stroke: var(--lime);
  stroke-width: 1.4;
  transition: stroke 0.3s ease, transform 0.3s ease;
}
.td-tool:hover .glyph svg {
  stroke: var(--td-paper);
  transform: rotate(8deg);
}

/* ============================================================
 * 08 — CTA
 * ============================================================ */
.td-cta {
  position: relative;
  padding: 160px 6vw 200px;
  text-align: center;
  overflow: hidden;
}
.td-cta canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
}
.td-cta__inner {
  position: relative; z-index: 1;
  max-width: 880px;
  margin: 0 auto;
}
.td-cta__title {
  font-family: var(--td-display);
  font-weight: 400;
  font-size: clamp(48px, 7vw, 112px);
  line-height: 1.04;
  letter-spacing: -0.025em;
  margin: 24px 0 24px;
  font-variation-settings: 'opsz' 144, 'wght' 400, 'SOFT' 30, 'WONK' 1;
}
.td-cta__title em {
  font-style: italic;
  color: var(--td-lime);
}
.td-cta__lede {
  font-family: var(--td-sans);
  font-size: 18px;
  line-height: 1.6;
  color: rgba(233, 245, 243, 0.7);
  max-width: 580px;
  margin: 0 auto 36px;
}

/* ============================================================
 * Tweaks panel + sound toggle — hidden on production-facing pages.
 * ============================================================ */
.td-page .v2-tweaks,
.td-page .v2-sound { display: none !important; }

/* ============================================================
 * Responsive
 * ============================================================ */
@media (max-width: 1024px) {
  .td-hero__inner { grid-template-columns: 1fr; gap: 40px; }
  .td-hero__metrics { grid-template-columns: repeat(2, 1fr); }
  .td-hero__metric { border-bottom: 1px solid var(--td-line); }
  .td-hero__metric:nth-child(2) { border-right: 0; }
  .td-process__scene-inner { grid-template-columns: 1fr; gap: 30px; }
  .td-process__visual { height: 38vh; }
  .td-style__stage { grid-template-columns: 1fr; gap: 30px; }
  .td-tools__grid { grid-template-columns: repeat(2, 1fr); }
  .td-sys__grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .td-section { padding: 80px 5vw 100px; }
  .td-hero { padding: 100px 5vw 40px; }
  .td-ledger__row { grid-template-columns: 1fr; gap: 8px; padding: 18px 12px; }
  .td-ledger__metric { text-align: left; }
  .td-pass__pin { height: auto; }
  .td-pass__sticky { position: static; height: auto; padding: 40px 0; }
  .td-process__inner { height: auto; }
  .td-process__sticky { position: static; height: auto; padding: 60px 0; }
  .td-process__scene { position: relative; opacity: 1; transform: none; padding: 30px 5vw; height: auto; }
  .td-process__visual { height: 40vh; }
  .td-style__tokens { grid-template-columns: 1fr; }
  .td-process__rail { display: none; }
  .td-sys__mat-row { grid-template-columns: 90px 32px 1fr; gap: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .td-process__scene { transition: none; }
  .td-pad__pulse, .td-eyebrow .dot, .td-lab__pulse { animation: none; }
}
