/* aidoc.css — the rules of styles/components.css that only aidoc.html uses, moved out of the shared file
   (2026-09-30) in their original order. Loaded right after components.css on aidoc.html only; a rule that another
   page or a prototype in claude-design-blocks/ can use stays in components.css. */

/* hero: the AiDoc figure (components.css .hdoc) stands on the hero's glow here, not on a panel as on Home, so its
   see-through surfaces are made opaque */
.sol-hero-viz .hdoc { --surface: var(--surface-solid); --surface-2: color-mix(in srgb, var(--text) 6%, var(--surface-solid)); }

/* ================================================================
   AIDOC STORY — scrollytelling scene (aidoc.html #story)
   ================================================================ */
.story-track { height: 520vh; }
/* played to the end, the story gives its scroll room back (js/aidoc-story.js collapse(), ZEN-298); the narrow and
   reduced-motion column below undoes it, with the same query the script uses */
.story.is-played .story-track { height: 100vh; }
.story-pin { position: sticky; top: 0; height: 100vh; display: flex; align-items: center; overflow: hidden; padding-top: 88px; box-sizing: border-box; }
.story-pin > .grid-bg { opacity: 0.55; }
.story-pin .wrap { width: 100%; max-width: calc(var(--maxw) + 200px); position: relative; }
.story-head { margin-bottom: 24px; }
.story-head .h-section { margin-top: 14px; max-width: 780px; }
.story-grid { display: grid; grid-template-columns: 1.8fr 1fr; gap: clamp(36px, 4.5vw, 80px); align-items: center; }
/* --- scene (js/aidoc-story.js draws it): one page of MSA.pdf read through, in front of the archive it came from —
   paper, tool cards and a perimeter, not a diagram. Sizes are in the 800 × 560 viewBox, drawn at 0.77–1× between
   1100 and 1440px: the cards' text is set so it stays at least about 9px there; the page's own text is paper texture --- */
.story-stage { position: relative; }
.aid { width: 100%; height: auto; display: block; overflow: visible; font-family: var(--font-body); }   /* inherited, so the mono classes win */
/* paper: the pile's documents and page 7 */
.aid-pg { fill: var(--surface-solid); stroke: var(--border-strong); stroke-width: 0.8; filter: var(--shadow-paper); }
.aid-pg.scan { fill: color-mix(in srgb, var(--text) 4%, var(--surface-solid)); }
.aid-pg.flat { filter: none; }
.aid-veil { fill: var(--bg); }
.aid-rule { stroke: var(--border); stroke-width: 0.8; }
.aid-run, .aid-sm { font-size: 7.5px; fill: var(--text-faint); }
.aid-ph { font-family: var(--font-display); font-size: 12.5px; font-weight: 600; fill: var(--text); }
.aid-pn { font-family: var(--font-mono); font-size: 7.5px; fill: var(--text-faint); }
.aid-dt { font-size: 8px; font-weight: 600; fill: var(--text-muted); }
.aid-dh { font-family: var(--font-display); font-size: 10px; font-weight: 600; fill: var(--text); }
.aid-dk { font-size: 7px; fill: var(--text-faint); }
.aid-lang, .aid-att { fill: var(--surface-2); stroke: var(--border); stroke-width: 0.6; }
.aid-lt { font-family: var(--font-mono); font-size: 7.5px; fill: var(--text-muted); }
.aid-pc { fill: none; stroke: var(--text-faint); stroke-width: 0.9; stroke-linecap: round; }
.aid-stamp { fill: none; stroke: color-mix(in srgb, var(--accent-2) 55%, transparent); stroke-width: 1.2; }
/* words: grey until the band reaches them, lit as it crosses, tinted once read; a value turns into its text */
.aid-l rect { fill: color-mix(in srgb, var(--text) 14%, transparent); transition: fill 0.5s var(--ease); }
.aid-l.hit rect { fill: color-mix(in srgb, var(--accent-soft) 85%, transparent); }
.aid-l.rd rect { fill: color-mix(in srgb, var(--accent-soft) 30%, transparent); }
.aid-kt { font-size: 9.5px; font-weight: 500; fill: var(--text); }
.aid-hl { fill: color-mix(in srgb, var(--accent-soft) 22%, transparent); }
.aid-ib { fill: none; stroke: var(--border-strong); stroke-width: 0.8; }
.aid-ib.warn { stroke: var(--warn); stroke-dasharray: 2 2; }
.aid-sig { fill: none; stroke: var(--text-muted); stroke-width: 1; stroke-linecap: round; stroke-linejoin: round; }
/* the layout, found before the text */
.aid-lay rect { fill: none; stroke: color-mix(in srgb, var(--text) 30%, transparent); stroke-width: 0.8; stroke-dasharray: 2 2; }
.aid-lay .aid-lc { fill: var(--surface-solid); stroke: none; }
.aid-lay text { font-size: 7px; fill: var(--text-faint); }
.aid-b0 { stop-color: var(--accent-soft); stop-opacity: 0; }
.aid-b1 { stop-color: var(--accent-soft); stop-opacity: 0.22; }
.aid-line { stroke: var(--accent-soft); stroke-width: 1.5; }
/* the clauses found, and where they go */
.aid-reg { fill: transparent; stroke: var(--accent-soft); stroke-width: 1.2; transition: fill 0.4s var(--ease), stroke-width 0.4s var(--ease); }
.aid-reg.warn { stroke: var(--warn); }
.aid-reg.cited { fill: color-mix(in srgb, var(--accent-soft) 8%, transparent); stroke-width: 1.8; }
.aid-tag rect { fill: var(--accent-fill); }
.aid-tag text { font-family: var(--font-mono); font-size: 9.5px; font-weight: 500; fill: #fff; }
.aid-tag.warn rect { fill: color-mix(in srgb, var(--warn) 10%, var(--surface-solid)); stroke: color-mix(in srgb, var(--warn) 55%, transparent); stroke-width: 0.8; }
.aid-tag.warn text { font-family: var(--font-body); fill: var(--warn-text); }
.aid-lead path { fill: none; stroke: color-mix(in srgb, var(--accent-soft) 70%, transparent); stroke-width: 1.2; stroke-dasharray: 1; }
.aid-lead circle { fill: var(--accent-soft); }
.aid-lead.warn path { stroke: color-mix(in srgb, var(--warn) 70%, transparent); }
.aid-lead.warn circle { fill: var(--warn); }
/* the record, the reviewer and the conversation: tool cards */
.aid-card { fill: var(--surface-solid); stroke: var(--border); filter: var(--shadow-paper); }
.aid-card.warn { fill: color-mix(in srgb, var(--warn) 6%, var(--surface-solid)); stroke: color-mix(in srgb, var(--warn) 40%, var(--border)); }
.aid-ch { font-size: 14.5px; font-weight: 500; fill: var(--text); }
.aid-chip { fill: var(--surface-2); stroke: var(--border); stroke-width: 0.8; }
.aid-cm { font-family: var(--font-mono); font-size: 11px; fill: var(--text-muted); }
.aid-div { stroke: var(--border); }
.aid-k { font-family: var(--font-mono); font-size: 11.5px; fill: var(--text-faint); }
.aid-c { font-family: var(--font-mono); font-size: 11.5px; fill: var(--text-muted); }
.aid-v { font-size: 14px; fill: var(--text); }
.aid-row.warn .aid-v, .aid-row.warn .aid-c { fill: var(--warn-text); }
.aid-vph { fill: color-mix(in srgb, var(--text) 9%, transparent); }
.aid-mt { fill: color-mix(in srgb, var(--text) 10%, transparent); }
.aid-mf { fill: var(--accent-soft); }
.aid-row.warn .aid-mf { fill: var(--warn); }
.aid-crop { fill: var(--surface-2); }
.aid-rt { font-size: 13px; font-weight: 500; fill: var(--text); }
.aid-rm { font-size: 13px; fill: var(--text-muted); }
.aid-btn rect { fill: transparent; stroke: var(--border-strong); }
.aid-btn text { font-size: 12.5px; font-weight: 500; fill: var(--text); }
.aid-btn.primary rect { fill: var(--accent-fill); stroke: none; }
.aid-btn.primary text { fill: #fff; }
.aid-qb { fill: var(--surface-2); }
.aid-qt { font-size: 13.5px; fill: var(--text); }
.aid-at { font-size: 14px; fill: var(--text); }
.aid-cite rect { fill: var(--surface-2); stroke: var(--border); }
.aid-cite text { font-family: var(--font-mono); font-size: 12px; fill: var(--accent-text); }
.aid-cf { font-size: 12.5px; fill: var(--text-muted); }
.aid-in { fill: transparent; stroke: var(--border); }
.aid-ip { font-size: 13px; fill: var(--text-faint); }
.aid-send circle { fill: var(--surface-2); }
.aid-send path { fill: none; stroke: var(--text-muted); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
/* the perimeter takes the shape of the deployment picked above it */
.aid-per { fill: none; stroke: color-mix(in srgb, var(--text) 30%, transparent); stroke-width: 1; }
.aid-box rect { fill: var(--surface-solid); stroke: color-mix(in srgb, var(--text) 30%, transparent); }
.aid-box circle { fill: var(--text-faint); }
.aid-box .aid-vent { fill: color-mix(in srgb, var(--text) 20%, transparent); stroke: none; }
.aid-seg { fill: var(--surface-solid); stroke: var(--border); }
.aid-segon { fill: color-mix(in srgb, var(--accent) 14%, var(--surface-solid)); stroke: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.aid-st { font-size: 13px; font-weight: 500; fill: var(--text-faint); transition: fill 0.3s var(--ease); }
.aid-st.on { fill: var(--text); }
.aid-ss { font-size: 13px; fill: var(--text-muted); }
/* --- act rail --- */
.story-rail { display: flex; gap: 26px; margin-top: 24px; }
.story-rail button { appearance: none; background: none; border: 0; padding: 8px 0; cursor: pointer; font-family: var(--font-body); font-size: 13px; color: var(--text-faint); border-top: 1px solid var(--border); transition: color 0.25s var(--ease), border-color 0.25s var(--ease); }
.story-rail button:hover { color: var(--text-muted); border-top-color: var(--border-strong); }
.story-rail button.on { color: var(--text); border-top-color: var(--accent-soft); }
/* --- right column: act texts --- */
.story-text { position: relative; display: grid; }
.story-step { grid-area: 1 / 1; opacity: 0; transform: translateY(16px); transition: opacity 0.5s var(--ease), transform 0.5s var(--ease); pointer-events: none; }
.story[data-act="1"] .story-step[data-step="1"], .story[data-act="2"] .story-step[data-step="2"], .story[data-act="3"] .story-step[data-step="3"], .story[data-act="4"] .story-step[data-step="4"] { opacity: 1; transform: none; pointer-events: auto; }
.story-step h3 { font-family: var(--font-display); font-weight: 500; font-size: clamp(20px, 1.9vw, 25px); letter-spacing: -0.015em; color: var(--text); margin-bottom: 12px; }
.story-step > p { color: var(--text-muted); font-size: 14.5px; line-height: 1.6; }
.story-step ul { list-style: none; margin-top: 18px; display: flex; flex-direction: column; gap: 8px; }
.story-step ul li {
  position: relative; isolation: isolate;
  font-size: 13.5px; line-height: 1.5; color: var(--text-muted);
  padding: 12px 16px;
  border: 1px solid var(--border); border-radius: 12px;
  background: var(--surface);
  transition: color 0.35s var(--ease), border-color 0.4s var(--ease), background 0.4s var(--ease), box-shadow 0.5s var(--ease), transform 0.5s var(--ease-spring);
}
/* glow from behind the block (canon — like .sol-card), no left bar */
.story-step ul li::after {
  content: ""; position: absolute; inset: -1px; z-index: -1; pointer-events: none;
  border-radius: inherit;
  background: radial-gradient(130% 130% at 0% 0%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 62%);
  opacity: 0; transition: opacity 0.45s var(--ease);
}
.story-step ul li b { color: var(--text); font-weight: 600; }
.story-step ul li:hover {
  color: var(--text);
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
  box-shadow: 0 16px 44px -28px color-mix(in srgb, var(--accent) 62%, transparent);
}
.story-step ul li:hover::after { opacity: 1; }
/* act 2 theses — active line emphasised (synced to scroll); brand accent, no coloured text */
.story-theses li.on {
  color: var(--text);
  border-color: color-mix(in srgb, var(--accent) 38%, var(--border));
  background: color-mix(in srgb, var(--accent) 6%, var(--surface));
  box-shadow: 0 16px 44px -28px color-mix(in srgb, var(--accent) 60%, transparent);
}
.story-theses li.on::after { opacity: 1; }
.story-theses li.on b { color: var(--text); }
/* mini-scenes: hidden on desktop */
.story-mini { display: none; }
@media (max-width: 1024px), (prefers-reduced-motion: reduce) {
  .story-track, .story.is-played .story-track { height: auto; }
  .story-pin { position: static; height: auto; padding: 80px 0; overflow: visible; }
  .story-grid { display: block; }
  .story-stage { display: none; }
  .story-text { display: block; max-width: 640px; }
  .story-step { opacity: 1; transform: none; pointer-events: auto; position: static; }
  .story-step + .story-step { margin-top: 48px; }
  .story-theses li.on { color: var(--text-muted); border-color: var(--border); background: var(--surface); box-shadow: none; }
  .story-theses li.on::after { opacity: 0; }
  .story-theses li.on b { color: var(--text); }
  .story-mini { display: block; margin-bottom: 18px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); padding: 14px; }
  .story-mini svg { width: 100%; height: auto; display: block; }
  .story-mini svg rect, .story-mini svg circle, .story-mini svg path { stroke: var(--border-strong); stroke-width: 1.4; fill: none; }
  .story-mini-qa .mq { font-family: var(--font-mono); font-size: 12px; color: var(--accent-2-text); margin-bottom: 8px; }
  .story-mini-qa .ma { font-size: 13.5px; line-height: 1.55; color: var(--text-muted); }
  .story-mini-qa .ma span { display: block; margin-top: 6px; font-family: var(--font-mono); font-size: 11px; color: var(--accent-2-text); }
}
