/* =============================================================================
   TauDesignWorks — shared product-page composition (product.css)
   Loaded after base.css by iris/ and clair/. Accent comes from
   <html data-product="iris|clair"> (set in base.css). This file is the shared
   anatomy: hero, voice demo, features, steps, FAQ, waitlist.
   ============================================================================= */

/* ---- Iris runs on true OLED black + white (its brand); Clair uses base ---- */
:root[data-product="iris"] {
  --bg: #000000; --bg-tint-a: rgba(255,176,32,.08); --bg-tint-b: rgba(255,122,60,.05);
  --surface: #0E0E12; --surface-2: #17171C;
  --text: #FFFFFF; --text-muted: #C9C7D2;
  --border: #2A2A31; --border-strong: #3A3A42;
}
:root[data-product="clair"][data-theme="dark"],
:root[data-product="clair"]:not([data-theme="light"]) {
  --bg: #12101C; --surface: #1C1930; --surface-2: #232040; --border: #363150;
}
/* ---- Umbra plum-shifts its dark surfaces (like Clair). text/muted/brand-text
   verified >=7:1 against all three surfaces (worst 8.05:1). ---- */
:root[data-product="umbra"][data-theme="dark"],
:root[data-product="umbra"]:not([data-theme="light"]) {
  --bg: #100A14; --surface: #181022; --surface-2: #211631;
  --border: #332440; --border-strong: #453259;
}

/* ---- Product-page header brand sub-label ---- */
.brand-sub { display: inline-flex; }
@media (max-width: 860px) { .brand-sub { display: none; } }

/* ---- Back-to-studio pill in product nav ---- */
.nav-home {
  display: inline-flex; align-items: center; gap: .4rem; color: var(--text-muted) !important;
  font-size: .95rem;
}
.nav-home svg { width: 16px; height: 16px; }

/* ---- Product hero ---- */
.product-hero { padding-block: clamp(2.75rem, 7vw, 5.5rem) clamp(2rem, 5vw, 3.5rem); }
.product-hero-grid { display: grid; grid-template-columns: 1fr; gap: clamp(2.25rem, 5vw, 3.75rem); align-items: center; }
.product-hero-copy { max-width: 36ch; }
.product-hero h1 { margin-bottom: .3em; }
.product-hero .sub { font-size: var(--t-lead); color: var(--text-muted); margin-bottom: 1.75rem; max-width: 40ch; }
.product-hero-actions { display: flex; flex-wrap: wrap; gap: .85rem; margin-bottom: 1.4rem; }
.product-hero .note { font-size: 1rem; color: var(--text-muted); margin: 0; }
@media (min-width: 1000px) { .product-hero-grid { grid-template-columns: 1.02fr .98fr; } }

/* ---- Voice demo panel (shared) ---- */
.demo-panel {
  position: relative; overflow: hidden; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: clamp(1.5rem, 4vw, 2.4rem); box-shadow: var(--shadow-lg);
}
.demo-panel::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--spectrum); }
.demo-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.demo-label { display: inline-flex; align-items: center; gap: .55rem; font-family: var(--font-display); font-weight: 600; font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; color: var(--text-muted); }
.demo-controls { display: flex; gap: .6rem; }
.btn-demo {
  display: inline-flex; align-items: center; gap: .5rem; min-height: 44px; padding: .6rem 1.1rem;
  border-radius: var(--radius-sm); font-family: var(--font-display); font-weight: 600; font-size: 1rem;
  cursor: pointer; border: 2px solid transparent; touch-action: manipulation;
}
.btn-demo.play { background: var(--brand); color: var(--on-brand); }
.btn-demo.pause { background: transparent; color: var(--text); border-color: var(--border-strong); }
.btn-demo svg { width: 18px; height: 18px; }

.demo-wave { display: flex; align-items: center; gap: 5px; height: 52px; margin-bottom: 1.5rem; }
.demo-wave .bar { flex: 1 1 auto; max-width: 7px; min-width: 4px; height: 16%; border-radius: 3px; background: var(--brand); transform-origin: center; opacity: .55; }
@media (prefers-reduced-motion: no-preference) {
  .demo-wave.is-speaking .bar { animation: talk 660ms var(--ease) infinite alternate; opacity: 1; }
  .demo-wave.is-speaking .bar:nth-child(3n) { animation-duration: 520ms; }
  .demo-wave.is-speaking .bar:nth-child(4n) { animation-duration: 780ms; }
  .demo-wave.is-speaking .bar:nth-child(5n) { animation-duration: 460ms; }
}
@keyframes talk { from { transform: scaleY(.4); } to { transform: scaleY(2.6); } }

/* Demo steps: always readable (screen readers + no-JS + failure-safe). Play
   drives the "speaking" waveform and a caret on the voiced turn; the step being
   spoken lifts subtly so the eye can follow along. Steps are addressed by their
   [data-demo-step] attribute — the same hook tdw.js sequences — because the
   voiced turn IS the step element, not a descendant of it. */
[data-demo-step] { transition: transform var(--dur) var(--ease); }
[data-demo-step].is-speaking .bubble,
[data-demo-step].is-speaking.verdict { color: var(--text); }
.turn-bot[data-demo-step].is-speaking .bubble { border-color: color-mix(in srgb, var(--brand) 55%, var(--border)); }
@media (prefers-reduced-motion: no-preference) {
  [data-demo-step].is-speaking { transform: translateX(2px); }
}

/* Iris verdict line — the defining moment */
.verdict {
  font-family: var(--font-display); font-weight: 700; letter-spacing: -.02em;
  font-size: clamp(1.8rem, 1.2rem + 3vw, 2.9rem); line-height: 1.2; color: var(--text);
  min-height: 2.4em; margin: 0; max-width: none;
}
.verdict .amt { color: var(--brand-text); }
.verdict .due { color: var(--warn); }
.demo-hint { margin: 1.4rem 0 0; font-size: .98rem; color: var(--text-muted); }

/* Clair transcript */
.transcript { display: flex; flex-direction: column; gap: 1rem; min-height: 8em; }
.turn { display: flex; flex-direction: column; gap: .35rem; margin: 0; max-width: 100%; }
.turn-who { font-family: var(--font-display); font-weight: 600; font-size: .76rem; letter-spacing: .07em; text-transform: uppercase; color: var(--text-muted); }
.bubble { padding: .85rem 1.1rem; border-radius: var(--radius); font-size: 1.1rem; line-height: 1.55; max-width: 56ch; margin: 0; }
.turn-user { align-items: flex-end; }
.turn-user .bubble { background: var(--brand); color: var(--on-brand); border-bottom-right-radius: 4px; }
.turn-bot .bubble { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.turn-bot[data-demo-step].is-speaking .bubble::after { content: ""; display: inline-block; width: .5ch; height: 1.05em; margin-left: 2px; vertical-align: text-bottom; background: var(--brand-text); border-radius: 1px; }
@media (prefers-reduced-motion: no-preference) { .turn-bot[data-demo-step].is-speaking .bubble::after { animation: caret 1s steps(2) infinite; } }
@keyframes caret { 50% { opacity: 0; } }

/* ---- Feature grid ---- */
.feature-grid { list-style: none; display: grid; grid-template-columns: 1fr; gap: var(--gap); margin-top: clamp(1.75rem,4vw,2.5rem); }
@media (min-width: 720px) { .feature-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1024px) { .feature-grid { grid-template-columns: repeat(3, 1fr); } }
.feature { display: flex; flex-direction: column; gap: .85rem; }
.feature h3 { margin: .3rem 0 0; font-size: 1.28rem; }
.feature p { margin: 0; color: var(--text-muted); font-size: 1.03rem; }

/* ---- Steps ---- */
.steps { list-style: none; display: grid; grid-template-columns: 1fr; gap: var(--gap); margin-top: clamp(1.75rem,4vw,2.5rem); counter-reset: step; }
@media (min-width: 820px) { .steps { grid-template-columns: repeat(3, 1fr); } }
.step { position: relative; display: flex; flex-direction: column; gap: .8rem; }
.step-num { position: absolute; top: clamp(1.4rem,3vw,2rem); right: clamp(1.4rem,3vw,2rem); font-family: var(--font-display); font-weight: 800; font-size: 2.5rem; line-height: 1; color: color-mix(in srgb, var(--brand) 32%, transparent); }
.step h3 { margin: .2rem 0 0; font-size: 1.28rem; }
.step p { margin: 0; color: var(--text-muted); font-size: 1.03rem; }

/* ---- Split / positioning band ---- */
.band { background: var(--surface); border-block: 1px solid var(--border); }
.band .prose p { color: var(--text-muted); font-size: 1.12rem; }
.band .prose strong { color: var(--text); }

/* ---- FAQ ---- */
.faq-list { display: grid; gap: .8rem; margin-top: clamp(1.5rem,4vw,2.25rem); max-width: 800px; }
.faq-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; }
.faq-item summary { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 44px; padding: 1.15rem 1.4rem; cursor: pointer; font-family: var(--font-display); font-weight: 600; font-size: 1.14rem; color: var(--text); list-style: none; touch-action: manipulation; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary:hover { color: var(--brand-text); }
.faq-item .chevron { flex: 0 0 auto; width: 22px; height: 22px; color: var(--text-muted); transition: transform var(--dur) var(--ease); }
.faq-item[open] .chevron { transform: rotate(180deg); }
.faq-answer { padding: 0 1.4rem 1.3rem; }
.faq-answer p { margin: 0; color: var(--text-muted); }

/* ---- Waitlist ---- */
.waitlist-panel { position: relative; overflow: hidden; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: clamp(1.7rem,5vw,3rem); box-shadow: var(--shadow-lg); max-width: 680px; margin-inline: auto; }
.waitlist-panel::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--spectrum); }
.waitlist-form { max-width: 460px; }
.field { margin-bottom: 1.2rem; }
.field label { display: block; font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; margin-bottom: .45rem; }
.field .req { color: var(--brand-text); font-weight: 500; font-size: .95rem; }
.field input { width: 100%; min-height: 50px; padding: .7rem 1rem; font-family: var(--font-body); font-size: 1.0625rem; color: var(--text); background: var(--bg); border: 2px solid var(--border-strong); border-radius: var(--radius-sm); transition: border-color var(--dur) var(--ease); }
.field input::placeholder { color: color-mix(in srgb, var(--text-muted) 85%, transparent); }
.field input:hover { border-color: color-mix(in srgb, var(--brand) 50%, var(--border-strong)); }
.field input:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-color: var(--brand); }
.field input[aria-invalid="true"] { border-color: var(--warn); }
.field-hint { margin: .5rem 0 0; font-size: .98rem; color: var(--text-muted); }
.field-error { margin: .5rem 0 0; font-family: var(--font-display); font-weight: 600; font-size: .98rem; color: var(--warn); display: flex; align-items: center; gap: .45rem; }
.field-error::before { content: "!"; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; width: 1.15rem; height: 1.15rem; border-radius: 50%; background: var(--warn); color: var(--bg); font-size: .8rem; }
.form-fine { margin: 1rem 0 0; font-size: .92rem; color: var(--text-muted); }
.waitlist-success { text-align: center; padding: .5rem 0; }
.success-icon { display: inline-flex; align-items: center; justify-content: center; width: 60px; height: 60px; margin-bottom: 1rem; border-radius: 50%; color: var(--on-brand); background: var(--brand); }
.waitlist-success h3 { font-size: 1.5rem; }
.waitlist-success p { margin-inline: auto; color: var(--text-muted); }

/* ---- Product cross-link (to the other app) ---- */
.crosslink { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; padding: clamp(1.4rem,3vw,1.9rem); border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.crosslink p { margin: 0; max-width: none; }
.crosslink .cl-kicker { font-family: var(--font-display); font-weight: 600; font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); }
.crosslink .cl-title { font-family: var(--font-display); font-weight: 700; font-size: 1.3rem; color: var(--text); margin-top: .15rem; }

/* =============================================================================
   Six-products expansion — shared components + demo choreography.
   Text colors are only --text / --text-muted / --brand-text, so AAA holds by
   construction. Every animation lives under prefers-reduced-motion: no-preference
   (or is neutralized by the base.css kill switch); dimmed/hidden initial states
   are gated so JS-off pages stay fully visible.
   ============================================================================= */

/* ---- Marginalia aside (Gloss "a margin note in ink") ---- */
.note-grid { display: grid; grid-template-columns: 1fr; gap: clamp(1.5rem, 4vw, 2.5rem); align-items: start; }
@media (min-width: 1000px) { .note-grid { grid-template-columns: minmax(0, 1fr) 15rem; } }
.margin-note { border-left: 3px solid var(--brand); padding-left: 1.1rem; }
@media (min-width: 1000px) { .margin-note { border-left: 0; padding-left: 0; } }  /* the right rail is the signal at wide */
.mn-kicker {
  display: block; font-family: var(--font-display); font-weight: 600;
  font-size: .8rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--text-muted); margin-bottom: .5rem;
}
.mn-body { margin: 0; font-style: italic; color: var(--brand-text); font-size: 1.05rem; line-height: 1.55; max-width: none; }

/* ---- Provenance chip row (where a fact came from) ---- */
.prov-row { list-style: none; display: flex; flex-wrap: wrap; gap: .6rem; margin: 0; padding: 0; }
.prov {
  display: inline-flex; align-items: center; font-family: var(--font-display);
  font-weight: 600; font-size: .78rem; letter-spacing: .06em; text-transform: uppercase;
  padding: .35rem .7rem; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
}
.prov-key { border: 2px solid var(--brand); color: var(--brand-text); font-weight: 700; }
.prov-later { border-style: dashed; }

/* ---- Node chain (a reasoning path; Umbra/Facet trace their steps) ---- */
.node-chain { list-style: none; display: flex; flex-wrap: wrap; align-items: center; gap: .55rem 1.7rem; margin: 0; padding: 0; }
.node {
  position: relative; display: inline-flex; align-items: center;
  font-family: var(--font-display); font-weight: 600; font-size: .82rem; letter-spacing: .04em;
  padding: .45rem .8rem; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
}
.node + .node::before {
  content: "\2192"; position: absolute; right: 100%; margin-right: .5rem; top: 50%;
  transform: translateY(-50%); color: var(--text-muted); font-weight: 700;
}
.node-key { border-color: var(--brand); color: var(--brand-text); }
/* Demo: nodes dim until spoken, then light up. Gated on html.js AND no-preference
   exactly like base.css gates .reveal — so JS-off and reduced-motion both leave
   every node fully visible (opacity 1), keeping AAA intact. */
.node.is-spoken { border-color: var(--brand); color: var(--brand-text); }
@media (prefers-reduced-motion: no-preference) {
  html.js .node {
    opacity: .45;
    transition: opacity var(--dur) var(--ease), border-color var(--dur) var(--ease), color var(--dur) var(--ease);
  }
  html.js .node.is-spoken { opacity: 1; }
}

/* ---- Provenance / source line ---- */
.demo-src {
  font-family: var(--font-display); font-weight: 600; font-size: .8rem;
  letter-spacing: .1em; text-transform: uppercase; color: var(--brand-text);
}

/* ---- "Part of the TauDesignWorks suite" band ---- */
.suite-band { position: relative; }
.suite-band::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--spectrum-suite); }
.suite-grid {
  list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: var(--gap); margin-top: clamp(1.75rem, 4vw, 2.5rem);
}
.suite-grid > li { display: flex; }
.suite-item {
  display: flex; flex-direction: column; gap: .55rem; width: 100%;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: clamp(1.3rem, 3vw, 1.8rem); box-shadow: var(--shadow-sm);
  color: var(--text); text-decoration: none;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
a.suite-item:hover { color: var(--text); }
@media (prefers-reduced-motion: no-preference) {
  a.suite-item:hover {
    transform: translateY(-3px); box-shadow: var(--shadow-md);
    border-color: color-mix(in srgb, var(--brand) 42%, var(--border));
  }
}
.suite-item[aria-current="true"] { border: 2px solid var(--brand); }
.suite-name { margin: .15rem 0 0; font-family: var(--font-display); font-weight: 700; font-size: 1.25rem; letter-spacing: -.02em; color: var(--text); }
.suite-line { margin: 0; color: var(--text-muted); font-size: 1rem; max-width: none; }
.suite-here {
  display: inline-flex; align-items: center; gap: .4rem; font-family: var(--font-display);
  font-weight: 600; font-size: .74rem; letter-spacing: .09em; text-transform: uppercase; color: var(--brand-text);
}

/* ---- Price grid (Gloss) — 3-up .card tiles ---- */
.price-grid { list-style: none; display: grid; grid-template-columns: 1fr; gap: var(--gap); margin-top: clamp(1.75rem, 4vw, 2.5rem); }
@media (min-width: 820px) { .price-grid { grid-template-columns: repeat(3, 1fr); } }
.price-term { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: 2rem; line-height: 1.1; letter-spacing: -.02em; color: var(--text); }
.price-sub { margin: .3rem 0 .85rem; font-family: var(--font-display); font-weight: 600; font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: var(--text-muted); }
.price-body { margin: 0; color: var(--text-muted); font-size: 1.03rem; }

/* ---- Facet demo: a beam pans across the scene ---- */
.pan-scene { position: relative; overflow: hidden; }
.pan-beam {
  position: absolute; top: 0; bottom: 0; left: 0; width: 12%; opacity: 0; pointer-events: none;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--brand) 55%, transparent), transparent);
}
@media (prefers-reduced-motion: no-preference) {
  .demo-panel.is-playing .pan-beam { animation: pan-sweep 3.5s var(--ease) 2; }
}
@keyframes pan-sweep {
  0%   { transform: translateX(0);    opacity: 0; }
  10%  { opacity: 1; }
  90%  { opacity: 1; }
  100% { transform: translateX(733%); opacity: 0; }
}

/* ---- Umbra demo: an inverted region scans a bright toolbar ----
   Two stacked layers; the region reveals the dark (inverted) layer through a
   clip-path window, with a crisp 2px --brand leading edge. --u-split (registered
   so it can interpolate) drives clip + edge from one animation, no counter-move.
   Reduced-motion AND no-JS park the split mid-toolbar: a static, intentional
   invert-on-bright split. */
@property --u-split { syntax: "<percentage>"; inherits: true; initial-value: 42%; }
.umbra-mock { position: relative; overflow: hidden; border-radius: var(--radius-sm); --u-split: 42%; }
.umbra-bright { position: relative; z-index: 0; }
.umbra-dark { position: absolute; inset: 0; }
.umbra-region {
  position: absolute; inset: 0; z-index: 1;
  border: 2px solid var(--brand); border-radius: var(--radius-sm);
  clip-path: inset(0 calc(100% - var(--u-split)) 0 0);
}
.umbra-mock::after {
  content: ""; position: absolute; top: 0; bottom: 0; left: var(--u-split);
  width: 2px; background: var(--brand); z-index: 2;
}
@media (prefers-reduced-motion: no-preference) {
  .demo-panel.is-playing .umbra-mock { animation: umbra-scan 4s var(--ease) forwards; }
}
@keyframes umbra-scan { from { --u-split: 8%; } to { --u-split: 72%; } }

/* ---- Gloss demo: the answer rule draws down beside the voiced answer ---- */
.answer-rule { position: relative; padding-left: 1.1rem; }
.answer-rule::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  border-radius: 3px; background: var(--brand); transform-origin: top;
}
@media (prefers-reduced-motion: no-preference) {
  [data-demo-step].is-spoken .answer-rule::before { animation: draw 520ms var(--ease); }
}
@keyframes draw { from { transform: scaleY(0); } }
