/* One Site, One Night — approved Home application layer, not brand tokens.
   Existing assets, fonts and primitives; no new logo or canonical token edits. */
:root {
  --night-width: 1320px;
  --night-gutter: clamp(20px, 3.34vw, 48px);
  --night-card-radius: 4px;
  --night-field-radius: 8px;
  --night-control-radius: 12px;
  --night-interface-ease: cubic-bezier(.2, 0, 0, 1);
  --night-ground: var(--surface-inverse);
  --night-ink: var(--on-surface-inverse);
  --night-muted: var(--paper-200);
  --night-rule: var(--outline-inverse);
  --night-panel: var(--surface-inverse-alt);
  --header-h: 76px;
  --guide-h: 0px;
}
html { scroll-behavior: auto; }
body { overflow-x: clip; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid currentColor; outline-offset: 4px; }
:where(a, button, summary) { touch-action: manipulation; }
button { font-family: var(--font-body); }
.cta, .quiet, .night-button, .cmp__send { min-height: 44px; border-radius: var(--night-control-radius); }
.quiet { display: inline-flex; align-items: center; padding: 10px 16px; border: 1px solid var(--paper-200); }
:where(.links a, .foot a, .industry-card__link):hover { text-decoration: underline; text-underline-offset: 5px; }
:where(button, .cta, .quiet) { transition: background-color 140ms var(--night-interface-ease), border-color 140ms var(--night-interface-ease); }
:where(button, .cta, .quiet):active { border-style: double; }
.night-button { border: 1px solid currentColor; color: inherit; background: transparent; padding: 10px 14px; cursor: pointer; font-size: 14px; line-height: 1.4; }
.night-button:hover { background: var(--night-ink); color: var(--night-ground); }
.bar { height: auto; min-height: var(--bar-h); padding-block: 8px; padding-inline: max(var(--night-gutter), calc((100vw - var(--night-width)) / 2)); }
.bar__brand { flex-shrink: 0; }
.bar__nav { margin-left: auto; }
.bar__nav a { transition: none; }
.bar__nav a::after { transition-duration: 140ms; }
.night-menu { color: var(--on-surface-inverse); background: var(--surface-inverse); border: 1px solid var(--outline-inverse); border-radius: 12px; width: min(540px, calc(100% - 32px)); max-height: calc(100dvh - 32px); padding: 24px; }
.night-menu::backdrop { background: var(--surface-inverse-alt); }
.night-menu[open] { animation: menu-arrive 220ms var(--night-interface-ease); }
.night-menu .bar__nav { position: static; display: grid; grid-template-columns: 1fr; padding: 20px 0 0; margin: 0; border: 0; gap: 6px; }
.night-menu .bar__nav a { font-size: 20px; min-height: 48px; }
@keyframes menu-arrive { from { transform: translateX(12px); } to { transform: none; } }

/* Broad editorial canvas; text is a stable solid-ground rail. */
.act, .story, .story .act, #act-8 { color: var(--night-ink); background: var(--night-ground); height: auto; min-height: 0; }
.stage, .story .stage { background: var(--night-ground); }
.act .duo, .story .duo, .story .lift > .duo, .lift > .duo {
  width: min(var(--night-width), calc(100% - 2 * var(--night-gutter)));
  margin-inline: auto; padding: 64px 0; min-height: 0;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 4vw, 64px);
  position: relative; inset: auto; align-items: center;
}
.act .rail { width: 100%; max-width: 520px; gap: 24px; }
.act .head { font-size: clamp(32px, 3.3vw, 48px); line-height: 1.14; max-width: 28ch; font-weight: 500; color: var(--night-ink); }
.act .head--md, #act-5 .head { font-size: clamp(30px, 2.8vw, 40px); }
.act .body, .act .lede { font-size: 20px; line-height: 1.6; color: var(--night-ink); max-width: 48ch; }
.act .eyebrow { color: var(--night-muted); font-size: 13px; line-height: 1.5; margin: 0; }
.act .stagecol { width: 100%; min-width: 0; grid-template-columns: minmax(0, 1fr); justify-content: stretch; }
.act .obj, .story .obj, .story .obj--card, .story .obj--results { width: 100%; max-width: none; transform: none; }
.story .stagecol::before { content: none; }
.act .lift, .story .lift { position: relative; inset: auto; transform: none; overflow: visible; will-change: auto; }
.act .stage, .story .stage { position: relative; inset: auto; height: auto; min-height: 0; overflow: visible; }
.act.is-pinned { height: var(--night-track) !important; }
.act.is-pinned > [data-sc-stage], .act.is-pinned > .duo { position: sticky; top: var(--scene-top); }
.act { scroll-margin-top: calc(var(--header-h) + var(--guide-h) + 16px); }
.night-ready .night-unreached { visibility: hidden !important; pointer-events: none; }
.state > *, .reply > *, .frm__state-b { opacity: 1; transform: none; transition: none; }
.res, .res--2, .res--3, .res__tags, .frm--pack { transform: none; transition: none; clip-path: none; visibility: visible; }

/* Opening: all required words and the complete exhibit before any movement. */
.act--hero { overflow: clip; }
#hero .duo { min-height: calc(100svh - var(--header-h)); padding-block: 28px; }
#hero { padding-top: var(--header-h); }
#hero .hero { overflow: clip; }
#hero .hero__title { font-size: clamp(40px, 4.5vw, 68px); line-height: 1.04; font-weight: 500; }
#hero .hero__sub { font-size: 18px; line-height: 1.55; }
#hero .rail { position: relative; z-index: 7; }
#hero .obj--hero { transform: none; }
#hero .frm__plate { filter: none; }
#hero .frm__body { aspect-ratio: 16 / 9; }
#hero .frm__body picture { display: block; height: 100%; }
#hero .frm__body img { height: 100%; max-height: none; object-fit: cover; background: var(--surface-inverse); }
#hero .frm__watch-line { font-size: 18px; line-height: 1.5; }
#hero .frm__watch { padding: 14px 18px; }
#hero .scene { min-height: 100%; }
#hero .plane--sky { transform: translateY(calc(var(--scene-depth, 1) * -12px)); }
#hero .plane--near { transform: translateY(calc(var(--scene-depth, 1) * -24px)); }
#hero .plane--ground { transform: translateY(calc(var(--scene-depth, 1) * -40px)); }
#hero .bldg { transform: none; }
#hero .frm__box { opacity: 1; transform: none; border-color: var(--signal-orange); clip-path: inset(0 calc((1 - var(--frame-resolve, 1)) * 100%) 0 0); border-radius: 0; }
#hero .frm__state-b { color: var(--on-surface-inverse); }
#hero .dot { background: var(--signal-green); animation: none; }
#hero #hero-state .dot, #watch-state.is-on .dot { animation: none; }
#hero .scrim--rail { background: linear-gradient(to right, var(--surface-inverse) 0%, var(--surface-inverse) 41%, transparent 64%); }
#hero .frm, #act-1 .frm { --night-ground: var(--surface-inverse); --night-ink: var(--on-surface-inverse); }

/* Paper marks a useful working surface, not a new visual identity. */
#act-2, #act-4, #detective-story, #act-9 {
  --night-ground: var(--surface); --night-ink: var(--on-surface);
  --night-muted: var(--ink-800); --night-rule: var(--outline);
  --night-panel: var(--surface-bright);
}
#guard-story, #detective-story { background: var(--night-ground); }
.story .story-nav { top: var(--header-h); background: var(--surface-inverse); color: var(--on-surface-inverse); padding: 12px max(var(--night-gutter), calc((100vw - var(--night-width)) / 2)); min-height: 72px; border-bottom: 1px solid var(--outline-inverse); }
.story-nav details { width: 100%; display: flex; align-items: center; gap: 32px; }
.story-nav details[open] { display: flex; }
.story-nav summary { display: inline-flex; align-items: center; font: 600 18px/1.4 var(--font-display); min-height: 44px; list-style: none; }
.story-nav summary::-webkit-details-marker { display: none; }
.story-nav ol { float: right; display: flex; gap: 8px; }
.story-nav ol::after { content: none; }
.story-nav a { color: var(--paper-200); transition: background-color 140ms; }
.story-nav a[aria-current="location"] { background: var(--surface-inverse-alt); color: var(--on-surface-inverse); border-bottom: 2px solid var(--on-surface-inverse); }

/* Shared product anatomy. The dark product band carries the unchanged white glyph. */
.frm, .story .frm { background: var(--night-panel); border: 1px solid var(--night-rule); border-radius: var(--night-control-radius); color: var(--night-ink); }

/* Detective shell unification — align to Guard structural shell (U01/U02) */
#detective-story .frm,
#detective-story .story .frm {
  border-radius: 2px;
  border-color: var(--outline-inverse);
  max-width: 646px;
  width: 100%;
  margin-inline: auto;
  background: rgba(13, 24, 29, .97);
}
#detective-story .frm__band,
#detective-story .story .frm__band {
  background: rgba(8, 16, 21, .96);
  border-color: var(--outline-inverse);
}
.frm__band, .story .frm__band { background: var(--surface-inverse); color: var(--on-surface-inverse); padding: 14px 18px; gap: 8px 14px; border: 0; font-size: 12px; line-height: 1.5; }
.frm__band .frm__prod { font-family: var(--font-body); font-size: 16px; text-transform: none; font-weight: 600; }
/* The product name is now the ONLY place the product is named inside the frame
   (the duplicate line inside each reply/alert card was removed), so it carries
   the identification on its own and sits next to the camera label. */
.frm__band .frm__prod + .frm__cam { padding-left: 14px; border-left: 1px solid var(--outline-inverse); }
.frm__foot, .story .frm__foot { border-color: var(--night-rule); color: var(--night-ink); font-size: 15px; line-height: 1.5; padding: 14px 18px; }
.conv { padding: 20px; gap: 16px; }
.story .cmp, .story .cmp__field { border-radius: var(--night-field-radius); }
.story .cmp__field { background: var(--night-ground); border: 1px solid var(--night-muted); padding: 18px; }
.story .cmp__line { font-size: 20px; color: var(--night-ink); }
.story .cmp__ph { display: block; position: static; visibility: visible; white-space: normal; font-size: 14px; line-height: 1.5; color: var(--night-muted); margin-bottom: 12px; }
.story .ink { display: block; white-space: normal; }
.story .ink__full { clip-path: none; }
.ink__caret { display: none !important; animation: none; }
.demo-example { display: block; width: 100%; padding: 0 0 14px; background: transparent; border: 0; color: var(--night-ink); font: inherit; line-height: 1.5; text-align: left; position: relative; cursor: pointer; }
.demo-example::after { content: ''; position: absolute; bottom: 0; left: 0; width: 100%; height: 3px; background: var(--night-ink); transform-origin: left; transform: scaleX(var(--prompt-progress, 1)); }
.demo-example:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.story .cmp__send { min-height: 44px; font: 600 16px/1.4 var(--font-body); padding: 10px 20px; color: var(--on-primary); background: var(--primary); border: 1px solid var(--on-primary); border-radius: var(--night-control-radius); cursor: pointer; }
.story .cmp__send:hover { background: var(--surface-bright); }
.story .reply__who, .story .reply__q, .story .chipx, #watch-state .state__t, #ask-state .state__t { color: var(--night-ink); }
.story .reply__who { font-size: 13px; }
.story .glyph { background: var(--surface-inverse); padding: 3px; box-sizing: content-box; }
.story .chipx { border-color: var(--night-muted); border-radius: var(--night-card-radius); font-size: 12px; }
#watch-reply, #ask-reply { min-height: 88px; }
#watch-state { margin: 0; }
#watch-state .dot { background: var(--signal-green); animation: none; }
#ask-state { min-height: 52px; }
#ask-state .state__t { font-size: 16px; }
#ask-state .state__t { display: grid; }
#ask-state .state__t > span { grid-area: 1 / 1; }
.search-activity > span, .is-searching .search-activity > span { animation: none; background: var(--night-ink); transform: scaleY(calc(.3 + .7 * var(--search-progress, 1))); }
.story .ask__thumbs { grid-template-columns: repeat(9, 1fr); }
.story .ask__thumbs img { height: 32px; }
.demo-status { margin: 12px 0 0; font-size: 14px; line-height: 1.5; }
.demo-status:empty { display: none; }
.inspection-mode { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; font-size: 14px; padding: 12px 18px; color: var(--night-ink); background: var(--night-panel); }
.cmp .inspection-mode { padding-inline: 0; }
.inline-evidence { display: grid; gap: 16px; margin-top: 20px; }

/* A wall, a full-bleed event, then the quiet corridor. */
#act-1 .duo { padding-block: 80px; }
.tiles { transform: none; }
.tile:nth-child(3n + 1) { transform: translateY(calc((1 - var(--wall-align, 1)) * 16px)); }
.tile:nth-child(3n + 2) { transform: translateY(calc((1 - var(--wall-align, 1)) * 8px)); }
.tile__cam { white-space: normal; overflow: visible; font-size: 11px; line-height: 1.5; }
#act-3 { background: var(--surface-inverse) url('assets/clip-a-poster.webp') center / cover no-repeat; }
#act-3 .stage { background: transparent; }
#act-3 .rail { background: var(--surface-inverse); padding: 24px 0; border-radius: 4px; }
#act-3 .story-media__screen { max-height: 220px; }
#act-3 .story-media__screen > img { transform: translateY(calc((1 - var(--event-frame, 1)) * 24px)); }
#act-3 .card__explanation { border-color: var(--night-rule); }
#act-3 .card__why { font-size: 18px; }
#act-3 .card__title { font-size: 28px; }
#act-3 .card__watch { border-color: var(--signal-orange); }
#act-3 .card__acts .btn, .pack__acts .btn { cursor: default; border-style: dashed; border-radius: var(--night-card-radius); }
.tag { background: var(--night-ground); color: var(--night-ink); border: 1px solid var(--night-muted); border-radius: var(--night-card-radius); }
.mono { color: var(--night-muted); }
#act-4 .obj--plate { max-width: 420px; margin-left: auto; }
.story-media__screen { background: var(--surface-inverse); overflow: hidden; }
.story-media__controls { background: var(--surface-inverse); color: var(--on-surface-inverse); font-size: 13px; line-height: 1.5; }
.story-media button { border-radius: var(--night-control-radius); font-size: 14px; }
.story-media--memory .memory__tag { position: relative; inset: auto; max-width: none; margin: 0; padding: 14px 18px; border: 0; border-radius: 0; transform: none; background: var(--surface-inverse); }
.story-media--memory .memory__tag-a, .story-media--memory .memory__tag-b { font-size: 14px; }

/* Evidence is ordered information, not three competing thumbnails. */
#act-6 .duo { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
#act-6 .results__asked { color: var(--night-ink); border-color: var(--night-rule); padding: 12px 18px; font-size: 15px; }
#act-6 .story-media__screen { max-height: 160px; }
.frm--results { container-type: inline-size; width: 100%; }
.composite-playback { border-top: 1px solid var(--night-rule); }
.composite-playback summary { min-height: 44px; padding: 12px 18px; cursor: pointer; font-size: 14px; line-height: 1.5; }
.composite-playback[open] summary { border-bottom: 1px solid var(--night-rule); }
@container (min-width: 700px) {
  .evidence-layout { display: grid; grid-template-columns: .9fr 1.1fr; }
  .evidence-layout .evidence-viewer { border-bottom: 0; border-right: 1px solid var(--night-rule); padding: 16px; }
  .evidence-layout .result-select { grid-template-columns: 54px minmax(0, 1fr); gap: 6px 10px; padding: 10px; }
  .story .evidence-layout .result-select img { width: 54px; }
  .story .evidence-layout .res__meta { flex-direction: column; }
}
.evidence-viewer { min-height: 280px; padding: 16px 18px; border-bottom: 1px solid var(--night-rule); }
.evidence-viewer.is-empty { background: var(--night-ground); }
.evidence-detail { margin: 0; color: var(--night-ink); }
.evidence-detail img { width: 100%; height: 180px; object-fit: contain; background: var(--surface-inverse); border-radius: var(--night-card-radius); }
.evidence-detail figcaption { display: grid; gap: 4px; margin-top: 12px; font-size: 16px; line-height: 1.5; }
.evidence-detail__meta { font: 400 13px/1.5 var(--font-mono); }
.story .results { grid-template-columns: 1fr; overflow: visible; padding: 12px; gap: 8px; }
.story .res { display: block; padding: 0; background: var(--night-panel); border: 0; }
.result-select { display: grid; grid-template-columns: 88px minmax(0, 1fr); width: 100%; text-align: left; padding: 12px; gap: 6px 14px; color: var(--night-ink); background: var(--night-panel); border: 1px solid var(--night-rule); border-radius: var(--night-card-radius); cursor: pointer; }
.result-select:hover, .result-select[aria-pressed="true"] { border-color: var(--night-ink); background: var(--night-ground); }
.result-select[aria-pressed="true"] { box-shadow: inset 3px 0 0 var(--night-ink); }
.story .result-select img { grid-row: 1 / span 3; width: 88px; aspect-ratio: 16 / 9; height: auto; max-height: none; align-self: center; object-fit: contain; }
.story .res__meta { color: var(--night-ink); font-size: 12px; line-height: 1.5; flex-direction: row; flex-wrap: wrap; gap: 4px 12px; }
.story .res__why { color: var(--night-ink); font-size: 16px; line-height: 1.5; }
.story .res__tags { grid-column: 2; padding: 0; gap: 8px; }
#act-7 .pack__thumbs { padding: 24px; gap: 14px; }
#act-7 .pack__thumbs img { transform: translateY(calc((1 - var(--case-assemble, 1)) * 32px)); }
#act-7 .pack__thumbs img:nth-child(2) { transform: translateY(calc((1 - var(--case-assemble, 1)) * 20px)); }
#act-7 .pack__thumbs img:nth-child(3) { transform: translateY(calc((1 - var(--case-assemble, 1)) * 8px)); }
#act-7 .pack__note, #act-7 .pack__acts .mono { color: var(--night-ink); }
#act-7 .pack__note { border-top: 1px solid var(--night-rule); padding: 20px 24px; }
#act-7 .btn--fill { background: var(--night-ground); color: var(--night-ink); border-color: var(--night-muted); }
#act-8 .obj--unit { max-width: 440px; margin-left: auto; }
#act-8 .rule--unit { width: 70px; transform-origin: right; transform: scaleX(var(--site-connect, 1)); }
#act-8 .site__label-t { background: var(--surface-inverse); font-size: 14px; }
/* both are .duo--wide acts: full-width row, not the 5fr/7fr rail+stage grid
   `.act .duo` sets above. Block, not grid — same escape valve for both. */
#act-9 .duo, #act-10 .duo { display: block; }
#act-10 .rail { width: 100%; max-width: min(680px, calc(52vw - var(--night-gutter))); }
/* act 9's row runs the full width, same left edge as every other act's rail
   (original places-row intent, preserved for the industry stack) — do not
   fold it into the narrower door rail above. */
#act-9 .rail { width: 100%; max-width: none; }
#act-9 .head, #act-10 .head { max-width: 28ch; }
/* .industry-tab already resolves --night-control-radius as its own fallback
   (site.css); the card radius is its own deliberate 20px, set in site.css —
   do not reintroduce the smaller --night-card-radius here. */
#act-10 .door__grid { min-height: 0; padding-block: 96px 64px; }
#act-10 .rail { display: grid; gap: 24px; }
#act-10 .foot { position: relative; inset: auto; width: min(var(--night-width), calc(100% - 2 * var(--night-gutter))); margin: 0 auto; padding: 32px 0; }
#act-10 .foot a { display: inline-flex; min-height: 44px; align-items: center; }

@media (max-width: 1100px) {
  .act .duo, .story .duo, .story .lift > .duo, .lift > .duo, #act-6 .duo { grid-template-columns: 1fr; gap: 32px; padding-block: 44px; }
  .act .rail, .story .rail { max-width: 680px; }
  #act-9 .rail, #act-10 .rail { max-width: 680px; }
  .act .obj, .story .obj { max-width: 680px; }
  .act .stagecol { justify-content: flex-start; }
  .act .body, .act .lede { font-size: 18px; }
  .story .story-nav { position: relative; top: auto; padding-block: 10px; }
  .story-nav details, .story-nav details[open] { display: block; }
  .story-nav summary { display: list-item; cursor: pointer; list-style: disclosure-closed inside; font-size: 16px; }
  .story-nav details[open] summary { list-style-type: disclosure-open; }
  .story-nav ol { float: none; display: flex; flex-wrap: wrap; margin-top: 8px; }
  .night-nav-ready .bar__nav { display: none; }
  .night-menu .bar__nav { display: grid; }
  html:not(.night-nav-ready) .bar { position: relative; flex-wrap: wrap; }
  html:not(.night-nav-ready) .bar__nav { display: flex; position: static; flex-wrap: wrap; order: 5; width: 100%; padding: 10px 0; }
  #hero .duo { padding-block: 24px; }
  #hero .hero__title { font-size: clamp(30px, 5vw, 48px); }
  #hero .obj { max-width: 680px; }
  #hero .frm__body img { max-height: none; }
  #hero .scrim--rail { background: var(--surface-inverse); }
  #act-3 .rail { padding: 20px 0; }
  #act-4 .obj--plate, #act-8 .obj--unit { margin-left: 0; }
}
@media (max-width: 700px) {
  #hero .duo { gap: 18px; padding: 18px 0; }
  #hero .rail { gap: 14px; }
  #hero .hero__title { font-size: 30px; }
  #hero .hero__sub { font-size: 14px; line-height: 1.5; }
  #hero .hero__acts { gap: 12px; flex-wrap: wrap; }
  #hero .frm__band { padding: 10px 12px; font-size: 10px; }
  #hero .frm__band .frm__prod { font-size: 14px; }
  #hero .frm__watch { padding: 10px 12px; gap: 4px; }
  #hero .frm__watch-line { font-size: 14px; line-height: 1.4; }
  #hero .frm__watch-key { font-size: 11px; }
  #hero .frm__body img { max-height: none; }
  #hero .frm__foot { padding: 10px 12px; font-size: 13px; }
  #hero .frm__state { min-height: 36px; padding: 8px 12px; font-size: 12px; }
  #hero .plane { transform: none; }
  .act .head, .story .head, .act .head--md, #act-5 .head { font-size: 30px; }
  .act .eyebrow { font-size: 12px; }
  .act .body { font-size: 18px; line-height: 1.55; }
  .act .rail { gap: 18px; }
  .frm__band, .story .frm__band { padding: 12px; }
  .frm__band .frm__time { margin-left: 0; }
  .frm__band .frm__prod { width: 100%; }
  .story .cmp__line { font-size: 18px; }
  .conv { padding: 12px; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .tile__cam { font-size: 11px; }
  .story-nav ol { gap: 4px; }
  .story-nav a { padding: 8px; }
  .story .result-select { grid-template-columns: 64px minmax(0, 1fr); gap: 6px 10px; padding: 10px; }
  .story .result-select img { width: 64px; }
  .story .res__meta { flex-direction: column; }
  .story .res__why { font-size: 16px; }
  .story .res__tags { flex-wrap: wrap; }
  .evidence-viewer { padding: 12px; }
  .evidence-detail__meta { font-size: 12px; }
  #act-7 .pack__thumbs { padding: 16px; gap: 8px; }
  .door__acts { flex-wrap: wrap; gap: 16px; }
  #act-10 .door__grid { padding-block: 64px 48px; }
}
@media (max-height: 700px) {
  .story .story-nav { position: relative; top: auto; }
  .story-nav details, .story-nav details[open] { display: block; }
  .story-nav summary { display: list-item; cursor: pointer; list-style: disclosure-closed inside; }
  .story-nav ol { float: none; margin-top: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .demo-example::after { transform: none; }
}
