/* Landing page layout. Spec: docs/landing/design-spec.md section 3 */

/* ── Hero ────────────────────────────────────────────── */

.hero {
  min-height: min(calc(100vh - 64px), 680px);
  display: flex; flex-direction: column; justify-content: center;
  padding: 56px 0 40px;
  position: relative;
}

/* particle hero prototype: decorative canvas behind the hero content */
.hero-particles {
  position: absolute; inset: 0; z-index: 0;
  pointer-events: none;
}
.hero > :not(.hero-particles):not(.hero-neural) { position: relative; z-index: 1; }

/* neural hero: 3D point-cloud mark in a square region on the hero's right,
   in the 2D hero's mark position, nudged right and down (83% / 46%) so the
   cloud clears the headline and sub-copy at every viewport width */
.hero-neural {
  position: absolute; z-index: 0;
  left: 83%; top: 46%; transform: translate(-50%, -50%);
  width: min(500px, 32vw); aspect-ratio: 1 / 1;
  pointer-events: none;
}
.hero-neural canvas { display: block; width: 100%; height: 100%; }
@media (max-width: 899px) { .hero-neural { display: none; } }
@media (prefers-reduced-motion: reduce) { .hero-neural { display: none; } }


.hero h1 {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(2.4rem, 5.5vw, 4.25rem);
  letter-spacing: -0.02em; line-height: 1.12;
  max-width: 18ch;
}

.hero .sub { max-width: 62ch; margin-top: 28px; font-size: 17px; }

.hero .cta-block { margin-top: 40px; }

.hero .history-link {
  display: inline-block; margin-top: 18px;
  font-family: var(--font-mono); font-size: 12px;
}

.hero .facts {
  margin-top: auto; padding-top: 48px;
  display: flex; flex-wrap: wrap; gap: 12px 28px;
}
.hero .facts a { color: var(--phosphor); opacity: 0.7; }
.hero .facts a:hover { opacity: 1; }

/* ── Phase sections ──────────────────────────────────── */

.phase { margin-top: var(--section-gap); }

/* hero headline: word-stagger blur reveal, once on load */
.hw { display: inline-block; }
.js .hero h1.hw-ready .hw {
  opacity: 0; animation: hw-in 480ms ease-out forwards;
  animation-delay: calc(var(--w) * 90ms + 120ms);
}
@keyframes hw-in {
  from { opacity: 0; transform: translateY(10px); filter: blur(7px); }
  to { opacity: 1; transform: none; filter: blur(0); }
}
@media (prefers-reduced-motion: reduce) {
  .js .hero h1.hw-ready .hw { opacity: 1; animation: none; }
}

/* hidden-until-played states apply only when JS is running (html.js);
   without JS the sections render fully, per the no-JS floor */
.js .phase .eyebrow { opacity: 0; transform: translateY(4px); filter: blur(4px); }
.js .phase .divider { transform: scaleX(0); transform-origin: left; }
.phase.played .eyebrow { opacity: 1; transform: none; filter: blur(0); transition: opacity 320ms, transform 320ms, filter 320ms; }
.phase.played .divider { transform: scaleX(1); transition: transform 200ms ease-out; }

@media (prefers-reduced-motion: reduce) {
  .phase .eyebrow { opacity: 1; transform: none; }
  .phase .divider { transform: scaleX(1); }
}

.phase .caption { font-size: 15px; opacity: 0.7; margin-top: 16px; max-width: 62ch; }

/* Phase 01: input bar */

.input-bar-panel { max-width: 720px; }
.input-bar {
  display: flex; align-items: center; gap: 12px;
  background: var(--plate); border: 1px solid rgba(231, 235, 244, 0.14);
  border-radius: 10px; padding: 14px 18px;
}
.input-bar .mic { flex: none; stroke: var(--phosphor); opacity: 0.7; }
.input-bar .task { font-size: 16px; }

/* ── Framed demo windows: shared presentation surface ─────────
   Every phase artifact sits in a captioned mini window on a soft
   brand glow; tune per section with --gx/--px (glow centers) and
   --ga/--pa (glow strengths). */

.win-wrap { position: relative; }
.win-wrap::before {
  content: ""; position: absolute; inset: -12% -3%;
  background:
    radial-gradient(44% 48% at var(--gx, 30%) 28%, rgba(69, 114, 253, var(--ga, 0.20)), transparent 68%),
    radial-gradient(40% 44% at var(--px, 76%) 76%, rgba(167, 139, 250, var(--pa, 0.16)), transparent 68%);
  pointer-events: none;
}
.win {
  position: relative; background: #0A0C1A; border-radius: 14px; overflow: hidden;
  box-shadow: 0 0 0 1px rgba(140, 165, 255, 0.15), 0 24px 70px rgba(3, 5, 16, 0.7);
}

/* scroll-driven entrance: windows rise and straighten as they enter view */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .win, .app-window {
      animation: win-rise both ease-out;
      animation-timeline: view();
      animation-range: entry 5% entry 55%;
    }
  }
}
@keyframes win-rise {
  from { opacity: 0.35; transform: perspective(1000px) rotateX(4deg) translateY(28px) scale(0.975); filter: blur(3px); }
  to { opacity: 1; transform: none; filter: blur(0); }
}

/* pointer-tracked glow on window surfaces (hover only) */
.win::after, .app-window::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 2;
  background: radial-gradient(240px circle at var(--mx, 50%) var(--my, 50%), rgba(140, 165, 255, 0.09), transparent 70%);
  opacity: 0; transition: opacity 300ms;
}
.win:hover::after, .app-window:hover::after { opacity: 1; }
.win-bar {
  display: flex; align-items: center; gap: 10px;
  height: 38px; padding: 0 16px; background: #0D1024;
}
.win-title { letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.75; }
.win-controls { margin-left: auto; opacity: 0.4; }
.win-body { padding: 22px 24px; }
@media (max-width: 640px) { .win-body { padding: 16px; } }


/* Capabilities showcase: product-demo presentation (app window on a glow) */

.show { margin-top: 4px; }

.show-menu {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 8px; margin-bottom: 30px;
}
@media (max-width: 720px) {
  .show-menu { flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; padding-bottom: 8px; }
  .show-menu button { white-space: nowrap; }
}
.show-menu button {
  font-family: var(--font-body); font-size: 14px;
  background: var(--substrate); border: 0; color: var(--phosphor); opacity: 0.65;
  padding: 10px 18px; border-radius: 999px; cursor: pointer; min-height: 44px;
  transition: opacity 140ms, background-color 140ms;
}
.show-menu button:hover { opacity: 1; background: var(--plate); }
.show-menu button[aria-selected="true"] { opacity: 1; background: var(--plate); }
.show-menu button[aria-selected="true"] .pk { color: var(--accent); }
.pk { font-family: var(--font-mono); color: var(--annot); margin-right: 8px; }

/* tour progress: a thin bar filling along the active menu item */
.show-menu button { position: relative; }
.show-menu button .prog {
  position: absolute; left: 18px; right: 18px; bottom: 7px; height: 2px;
  border-radius: 1px; overflow: hidden; opacity: 0; background: rgba(231, 235, 244, 0.14);
}
.show-menu button.touring .prog { opacity: 1; }
.show-menu button .prog i {
  display: block; height: 100%; background: var(--accent);
  transform: scaleX(0); transform-origin: left;
}
.show-menu button.touring .prog i {
  animation: prog-fill linear forwards;
  animation-duration: var(--prog-dur, 5s);
}
@keyframes prog-fill { to { transform: scaleX(1); } }

/* the stage: an ADA app window resting on a brand glow */
.show-stage { position: relative; padding: 4px 0 24px; }
.app-frame::before {
  content: ""; position: absolute; inset: -10% 2% -4%;
  background:
    radial-gradient(48% 44% at 30% 28%, rgba(69, 114, 253, 0.38), transparent 68%),
    radial-gradient(44% 40% at 76% 74%, rgba(167, 139, 250, 0.30), transparent 68%);
  pointer-events: none;
}

.app-window {
  position: relative; max-width: 960px; margin: 0 auto;
  background: #0A0C1A; border-radius: 14px; overflow: hidden;
  box-shadow: 0 0 0 1px rgba(140, 165, 255, 0.16), 0 30px 90px rgba(3, 5, 16, 0.75);
}
.app-bar {
  display: flex; align-items: center; gap: 10px;
  height: 44px; padding: 0 18px; background: #0D1024;
}
.app-bar img { display: block; }
.app-title { letter-spacing: 0.08em; }
.task-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 999px; background: rgba(231, 235, 244, 0.07);
  opacity: 0.85;
}
.task-pill i { width: 5px; height: 5px; border-radius: 50%; background: var(--green); }
.app-controls { margin-left: auto; opacity: 0.45; }

/* sidebar + main columns */
.app-cols { display: flex; align-items: stretch; }
.app-side {
  width: 212px; flex: none; background: #090B18;
  padding: 14px 12px 12px; display: flex; flex-direction: column;
  font-size: 13px;
}
@media (max-width: 879px) { .app-side { display: none; } }
.side-top { display: flex; gap: 8px; margin-bottom: 14px; }
.side-sq {
  width: 26px; height: 26px; display: grid; place-items: center;
  background: rgba(231, 235, 244, 0.07); border-radius: 7px; opacity: 0.8; font-size: 13px;
}
.side-nav p { display: flex; align-items: center; gap: 9px; padding: 7px 8px; opacity: 0.85; }
.side-nav svg { flex: none; opacity: 0.8; }
.side-chats { margin-top: 14px; flex: 1; min-height: 0; overflow: hidden; }
.side-h { display: flex; justify-content: space-between; align-items: center; opacity: 0.6; margin-bottom: 8px; }
.side-dd { background: rgba(231, 235, 244, 0.07); border-radius: 999px; padding: 2px 8px; }
.side-g { opacity: 0.45; margin: 10px 0 4px; }
.side-row { display: flex; align-items: center; gap: 7px; padding: 6px 8px; border-radius: 6px; }
.side-row.active-row { background: rgba(69, 114, 253, 0.14); }
.sr-t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; opacity: 0.9; }
.pv {
  flex: none; background: rgba(69, 114, 253, 0.18); color: var(--annot);
  border-radius: 4px; padding: 1px 5px; font-size: 9px; letter-spacing: 0.06em;
}
.sr-a { flex: none; margin-left: auto; opacity: 0.5; }
.side-user {
  display: flex; align-items: center; gap: 9px;
  padding: 10px 6px 2px; font-size: 13px; opacity: 0.9;
}
.td {
  width: 24px; height: 24px; border-radius: 50%; flex: none;
  background: var(--accent); color: #fff; font-size: 10px; font-weight: 500;
  display: grid; place-items: center;
}

.app-main {
  flex: 1; min-width: 0; display: flex; flex-direction: column;
  background-image:
    radial-gradient(1.5px 1.5px at 18% 22%, rgba(140, 165, 255, 0.30), transparent 100%),
    radial-gradient(1.5px 1.5px at 72% 14%, rgba(140, 165, 255, 0.22), transparent 100%),
    radial-gradient(1.5px 1.5px at 88% 46%, rgba(167, 139, 250, 0.25), transparent 100%),
    radial-gradient(1.5px 1.5px at 34% 72%, rgba(140, 165, 255, 0.18), transparent 100%),
    radial-gradient(1.5px 1.5px at 62% 88%, rgba(167, 139, 250, 0.20), transparent 100%),
    radial-gradient(1.5px 1.5px at 9% 55%, rgba(140, 165, 255, 0.16), transparent 100%);
}
.app-body { flex: 1; min-height: 420px; padding: 26px 28px 12px; }
@media (max-width: 640px) { .app-body { padding: 20px 16px 8px; min-height: 380px; } }

.app-input {
  display: flex; align-items: center; gap: 10px;
  margin: 10px 20px 18px; padding: 11px 16px;
  background: #10132B; border-radius: 999px;
}
.ai-ic {
  width: 22px; height: 22px; flex: none; display: grid; place-items: center;
  border-radius: 50%; background: rgba(231, 235, 244, 0.08);
  font-size: 13px; opacity: 0.75;
}
.app-ph { font-size: 14px; opacity: 0.45; flex: 1; }
.ai-spark { flex: none; color: var(--phosphor); opacity: 0.5; }
.ai-send {
  width: 26px; height: 26px; flex: none; display: grid; place-items: center;
  border-radius: 50%; background: var(--accent); color: #fff;
}
.ai-send svg { margin-left: 1px; }

.app-status {
  display: flex; align-items: center; gap: 18px;
  padding: 8px 16px; background: #0D1024; opacity: 0.9;
}
.app-status span { opacity: 0.6; }
.cx { display: inline-flex; align-items: center; gap: 4px; }
.cx i { width: 5px; height: 5px; border-radius: 50%; background: var(--green); display: inline-block; }
.app-ver { margin-left: auto; }

/* chat transcript */
.msg.user { display: flex; justify-content: flex-end; }
.bub-wrap { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
.msg.user p {
  background: var(--accent); color: #fff; border-radius: 12px;
  padding: 10px 16px; max-width: 46ch; font-size: 15px;
}
.msg-time { opacity: 0.5; }
.msg.ada { display: flex; gap: 12px; margin-top: 22px; }
.msg.ada .ava { flex: none; margin-top: 2px; }
.msg-body { flex: 1; min-width: 0; }

/* ── Task panel scenario (faithful to the real Plan & Progress panel) ── */

.task-wrap { display: grid; gap: 20px; }
@media (min-width: 760px) { .task-wrap { grid-template-columns: minmax(0, 1fr) 300px; align-items: start; } }

.ada-line { font-size: 15px; }

.task-panel {
  background: #0D1024; border-radius: 10px; padding: 14px 14px 10px;
  box-shadow: 0 0 0 1px rgba(140, 165, 255, 0.10);
}
.tp-tabs { display: flex; align-items: center; gap: 14px; padding-bottom: 10px; }
.tp-tab { opacity: 0.5; }
.tp-tab.on { opacity: 1; color: var(--accent); }
.tp-x { margin-left: auto; opacity: 0.4; }
.tp-h { letter-spacing: 0.1em; text-transform: uppercase; opacity: 0.55; margin: 4px 0 10px; }

.tp-status { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.tp-run { display: inline-flex; align-items: center; gap: 6px; color: var(--accent); }
.tp-run i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); animation: glyph-pulse 1.4s ease-in-out infinite; }
.tp-run.done { color: var(--green); }
.tp-run.done i { background: var(--green); animation: none; }
.tp-count, .tp-time { opacity: 0.7; font-variant-numeric: tabular-nums; }
.tp-stop {
  margin-left: auto; color: var(--red);
  background: rgba(239, 68, 68, 0.12); border-radius: 5px; padding: 3px 8px;
}
.tp-run.done ~ .tp-stop { display: none; }

.tp-plan { opacity: 0.9; margin-bottom: 6px; }
.tp-check { color: var(--green); }
.tp-sum { font-style: italic; opacity: 0.55; margin-bottom: 12px; line-height: 1.5; }

.tp-steps { display: grid; gap: 4px; }
.tstep {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 8px 8px; border-radius: 7px; opacity: 0.45;
  transition: opacity 260ms, background-color 260ms;
}
.tstep.running { opacity: 1; background: rgba(69, 114, 253, 0.10); }
.tstep.done { opacity: 0.85; }
.ts-ico { flex: none; margin-top: 2px; color: var(--annot); opacity: 0.9; }
.ts-main { min-width: 0; }
.ts-t { font-size: 13px; }
.ts-th { font-style: italic; opacity: 0.55; margin-top: 2px; line-height: 1.45; display: none; }
.tstep.running .ts-th, .tstep.done .ts-th { display: block; }
.ts-tags { display: flex; gap: 5px; margin-top: 5px; }
.tag {
  background: rgba(231, 235, 244, 0.07); border-radius: 4px;
  padding: 1px 6px; font-size: 10px; color: var(--annot);
}
.ts-state { flex: none; margin-left: auto; margin-top: 3px; position: relative; width: 14px; height: 14px; }
.ts-state .dot {
  position: absolute; inset: 3px; border-radius: 50%;
  background: var(--accent); opacity: 0; transform: scale(0.6);
}
.tstep.running .ts-state .dot { opacity: 1; animation: glyph-pulse 1s ease-in-out infinite; }
.ts-state .ok { position: absolute; inset: 0; color: var(--green); font-size: 12px; line-height: 14px; opacity: 0; }
.tstep.done .ts-state .ok { opacity: 1; }
.tstep.done .ts-state .dot { opacity: 0; animation: none; }

/* plan check lines + sources row, matching the real app */
.ck-row { display: flex; align-items: center; gap: 9px; font-size: 13.5px; opacity: 0.85; }
.vig-plan { display: grid; gap: 9px; }
.ck { color: var(--green); font-size: 12px; }
.vig.play .ck { animation: ck-go 900ms ease-out forwards; animation-delay: calc(var(--d) * 380ms + var(--lead, 0ms)); }
@keyframes ck-go { 0%, 65% { color: var(--accent); } 100% { color: var(--green); } }

.src-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 16px; }
.src-lbl { opacity: 0.55; letter-spacing: 0.08em; text-transform: uppercase; }
.chip-src {
  background: transparent; border: 1px solid rgba(231, 235, 244, 0.16);
  border-radius: 999px; padding: 4px 12px; color: var(--phosphor); opacity: 0.85;
}

.out-card {
  margin-top: 16px; max-width: 560px;
  background: #10132B; border-radius: 10px; padding: 18px;
}
.attach-h { color: var(--annot); letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 12px; }

.replay {
  position: absolute; bottom: -14px; right: max(0px, calc(50% - 440px));
  background: none; border: 0; cursor: pointer;
  color: var(--phosphor); opacity: 0.5;
  padding: 10px 12px; display: none; z-index: 1;
}
.replay:hover { opacity: 1; color: var(--accent); }
.js .replay { display: block; }

/* plan glyphs execute (accent) then complete (green) as each line lands */
.vig.play .vig-plan .glyph .done {
  animation: glyph-go 900ms ease-out forwards;
  animation-delay: calc(var(--d) * 380ms);
}
@keyframes glyph-go {
  0%, 65% { fill: var(--accent); }
  100% { fill: var(--green); }
}

/* run player animation: everything marked .anim appears in --d order,
   offset by --lead (the input-bar typing time) */
.js .vig .anim { opacity: 0; }
.vig.play .anim {
  animation: vig-in 280ms ease-out forwards;
  animation-delay: calc(var(--d) * 380ms + var(--lead, 0ms));
}
@keyframes vig-in {
  from { opacity: 0; transform: translateY(5px); filter: blur(5px); }
  to { opacity: 1; transform: none; filter: blur(0); }
}
.vig.play .reticle.anim {
  animation: ret-in 150ms ease-out forwards;
  animation-delay: calc(var(--d) * 380ms + var(--lead, 0ms));
}

/* typing ghost in the input bar */
.type-ghost { flex: 1; font-size: 14px; display: none; white-space: nowrap; overflow: hidden; }
.app-input.typing .type-ghost { display: block; }
.app-input.typing .app-ph { display: none; }
.type-ghost::after {
  content: ""; display: inline-block; width: 1px; height: 13px;
  background: var(--phosphor); margin-left: 2px; vertical-align: -2px;
}

/* ADA's cursor performing the clicks */
.app-main { position: relative; }
.ada-cur {
  position: absolute; z-index: 6; width: 16px; height: 16px;
  opacity: 0; pointer-events: none; color: #fff;
  transition: left 460ms cubic-bezier(0.3, 0.8, 0.3, 1), top 460ms cubic-bezier(0.3, 0.8, 0.3, 1), opacity 220ms;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.65));
}
.ada-cur.on { opacity: 1; }
.ada-cur .ring {
  position: absolute; left: -8px; top: -8px; width: 30px; height: 30px;
  border-radius: 50%; border: 2px solid var(--accent); opacity: 0;
}
.ada-cur.click .ring { animation: cur-click 380ms ease-out 1; }
@keyframes cur-click {
  0% { transform: scale(0.4); opacity: 0.9; }
  100% { transform: scale(1.25); opacity: 0; }
}

.fx-burst { position: absolute; inset: 0; pointer-events: none; z-index: 5; }

.vig-ask { font-size: 17px; max-width: 52ch; }
.vig-plan { margin-top: 20px; display: grid; gap: 10px; }
.vig-plan p { display: flex; align-items: center; gap: 10px; font-family: var(--font-mono); font-size: 13px; }
.vig-out { margin-top: 26px; }
.vig-done { margin-top: 18px; color: var(--annot); }

/* research: report snippet */
.rep-h { font-weight: 500; font-size: 17px; margin-bottom: 12px; }
.tbar { height: 10px; border-radius: 4px; background: var(--plate); margin-bottom: 8px; }

/* files: artifact card + save dialog */
.art {
  display: flex; align-items: center; gap: 14px;
  background: var(--plate); border-radius: 8px; padding: 14px 16px; max-width: 460px;
}
.art-ic { color: var(--annot); flex: none; }
.art-n { font-size: 15px; }
.art-m { opacity: 0.7; margin-top: 2px; }
.art-act { margin-left: auto; color: var(--accent); }
.savebox {
  background: var(--plate); border-radius: 8px; padding: 14px 16px;
  max-width: 380px; margin: 14px 0 0 40px;
}
.save-t { opacity: 0.7; letter-spacing: 0.08em; text-transform: uppercase; }
.save-p { font-family: var(--font-mono); font-size: 13px; margin-top: 8px; }
.save-ok { color: var(--green); margin-top: 8px; }

/* excel: mini sheet */
.sheet { border-collapse: collapse; font-family: var(--font-mono); font-size: 13px; }
.sheet td { padding: 8px 18px; background: var(--plate); min-width: 84px; }
.sheet tr td { border: 1px solid var(--void); }
.sheet .sh { background: var(--substrate); opacity: 0.7; min-width: 36px; text-align: center; }
.sheet .num { text-align: right; font-variant-numeric: tabular-nums; }
.sheet .total { color: var(--accent); font-weight: 500; }

/* web: mini browser */
.mini-browser { background: var(--plate); border-radius: 8px; overflow: hidden; max-width: 460px; }
.mb-bar { display: flex; align-items: center; gap: 6px; padding: 10px 14px; background: var(--substrate); }
.mb-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--phosphor); opacity: 0.25; }
.mb-url { margin-left: 8px; opacity: 0.7; }
.mb-body { padding: 16px; display: grid; gap: 12px; }
.mb-row { display: flex; align-items: center; gap: 14px; }
.mb-l { opacity: 0.7; min-width: 70px; letter-spacing: 0.08em; text-transform: uppercase; }
.mb-select { font-family: var(--font-mono); font-size: 13px; background: var(--substrate); border-radius: 4px; padding: 5px 10px; }
.mb-check { color: var(--green); font-size: 13px; }
.mb-dl { display: flex; justify-content: space-between; gap: 12px; background: var(--substrate); border-radius: 4px; padding: 8px 10px; }
.mb-ok { color: var(--green); }

/* system: recent files */
.flist { display: grid; gap: 6px; max-width: 460px; }
.flist p { display: flex; justify-content: space-between; gap: 16px; padding: 9px 12px; border-radius: 6px; }
.flist .fm { opacity: 0.6; }
.flist .fsel { background: var(--plate); color: var(--accent); }
.vig-done { display: block; }

/* the small things */
.cap-list {
  list-style: none; display: flex; flex-wrap: wrap;
  gap: 12px 28px; margin-top: 36px;
}
.cap-list li { opacity: 0.85; }
.cap-list li::before { content: "· "; color: var(--annot); }

/* Phase 02: manifest */

.manifest { max-width: 720px; display: grid; gap: 14px; }
.manifest .row { display: flex; align-items: center; gap: 12px; font-family: var(--font-mono); font-size: 13px; }

/* Phase 03: specimen */

.specimen { font-family: var(--font-mono); font-size: 13px; line-height: 1.7; overflow-x: auto; }
.specimen .root { margin: 0; white-space: pre; }
.specimen .root + .engine-note { margin-top: 12px; }
.engine-note { font-size: 15px; opacity: 0.7; max-width: 62ch; }
.engine-note + .root { margin-top: 32px; }
.specimen .note-line { color: var(--purple); }

.tree-office .tl { display: block; opacity: 1; }
#specimen-office.armed .tl { opacity: 0; }
#specimen-office.played .tl {
  animation: tl-in 220ms ease-out forwards;
  animation-delay: calc(var(--i) * 70ms);
}
@keyframes tl-in { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }

.hit { position: relative; display: inline-block; padding: 0 3px; }
.reticle { position: absolute; inset: -3px -5px; opacity: 0; transform: scale(1.4); pointer-events: none; }
#specimen-office.played .reticle {
  animation: ret-in 150ms ease-out forwards;
  animation-delay: calc(var(--lines) * 70ms + 250ms);
}
@keyframes ret-in { to { opacity: 1; transform: scale(1); } }
.reticle b { position: absolute; width: 8px; height: 8px; border: 0 solid var(--accent); }
.reticle b:nth-child(1) { top: 0; left: 0; border-top-width: 2px; border-left-width: 2px; }
.reticle b:nth-child(2) { top: 0; right: 0; border-top-width: 2px; border-right-width: 2px; }
.reticle b:nth-child(3) { bottom: 0; left: 0; border-bottom-width: 2px; border-left-width: 2px; }
.reticle b:nth-child(4) { bottom: 0; right: 0; border-bottom-width: 2px; border-right-width: 2px; }

@media (prefers-reduced-motion: reduce) {
  #specimen-office.armed .tl { opacity: 1; animation: none; }
  .reticle { opacity: 1; transform: none; animation: none; }
}

.specimen-close { margin-top: 24px; font-size: 15px; opacity: 0.7; max-width: 62ch; }

/* Phase 04: act */

.act-grid { display: grid; gap: 32px; }
@media (min-width: 900px) { .act-grid { grid-template-columns: 1fr 1fr; align-items: center; } }
.exec-log { font-family: var(--font-mono); font-size: 13px; line-height: 1.9; white-space: pre; overflow-x: auto; }
.exec-log .t { opacity: 0.7; }
.exec-log .xl { display: block; }
.js .scene .exec-log .xl { opacity: 0; }
.scene.on .exec-log .xl {
  animation: tl-in 220ms ease-out forwards;
  animation-delay: calc(var(--i) * 300ms + 300ms);
}
@media (prefers-reduced-motion: reduce) { .js .scene .exec-log .xl { opacity: 1; animation: none; } }

/* inspector scan sweep */
.scene.specimen { position: relative; }
.insp-scan {
  position: absolute; left: 0; right: 0; top: 0; height: 46px;
  opacity: 0; pointer-events: none;
  background: linear-gradient(to bottom, transparent, rgba(69, 114, 253, 0.11), transparent);
}
.scene.on .insp-scan { animation: insp-sweep 1.7s ease-in-out 1 0.4s; }
@keyframes insp-sweep {
  0% { opacity: 0; transform: translateY(0); }
  12% { opacity: 1; }
  88% { opacity: 1; }
  100% { opacity: 0; transform: translateY(300px); }
}

/* ── How ADA works: scrollytelling steps + sticky stage ── */

.steps-grid { display: grid; gap: 32px; }
@media (min-width: 980px) {
  /* stretch (default) matters: the stage column must span the full row
     height or the sticky window has no room to travel */
  .steps-grid { grid-template-columns: minmax(0, 1fr) 560px; gap: 64px; }
}

.step { padding: 20px 0; opacity: 0.35; transition: opacity 320ms; }
@media (min-width: 980px) { .step { min-height: 300px; display: flex; flex-direction: column; justify-content: center; } }
.step.active { opacity: 1; }
.step-k { color: var(--annot); letter-spacing: 0.08em; text-transform: uppercase; }
.step h3 { font-size: 24px; font-weight: 500; margin: 10px 0 12px; }
.step-cap { font-size: 15px; opacity: 0.7; max-width: 44ch; }

.stage-col { min-width: 0; }
.stage-sticky { position: sticky; top: 88px; }
@media (max-width: 979px) { .stage-sticky { position: static; margin-top: 8px; } }

.stage-body { display: grid; min-height: 380px; padding: 24px; align-items: center; }
.scene {
  grid-area: 1 / 1; min-width: 0;
  opacity: 0; transform: translateY(12px); filter: blur(5px);
  transition: opacity 380ms ease-out, transform 380ms ease-out, filter 380ms ease-out;
  pointer-events: none;
}
.scene.on { opacity: 1; transform: none; filter: blur(0); }

.scene .root { font-family: var(--font-mono); font-size: 12.5px; line-height: 1.65; white-space: pre; overflow-x: auto; margin: 0; }
.scene .root-web { margin-top: 18px; opacity: 0.85; }
.scene.manifest { display: grid; gap: 14px; align-content: center; }
.scene.manifest .row { display: flex; align-items: center; gap: 12px; font-family: var(--font-mono); font-size: 13px; }

/* Get ADA */
.get-grid { display: grid; gap: 36px; align-items: center; }
@media (min-width: 900px) { .get-grid { grid-template-columns: 1fr 1fr; } }
.get-grid .report-cta { margin-top: 0; }
.act-say p { font-size: 17px; max-width: 44ch; }
.act-say p + p { margin-top: 18px; }

/* Phase 05: report */

.report-grid { display: grid; gap: 32px; }
@media (min-width: 900px) { .report-grid { grid-template-columns: 1fr 1fr; align-items: start; } }

.report-card .row { display: flex; align-items: center; gap: 12px; font-family: var(--font-mono); font-size: 13px; }
.report-card .row + .row { margin-top: 12px; }
.report-card .elapsed { margin-top: 20px; font-family: var(--font-mono); font-size: 11px; opacity: 0.7; }
.report-card .next { margin-top: 6px; font-family: var(--font-mono); font-size: 13px; color: var(--annot); }

.install-facts { display: grid; grid-template-columns: auto 1fr; gap: 10px 18px; align-items: baseline; }
.install-facts dd { font-family: var(--font-mono); font-size: 13px; }
.report-cta { margin-top: 36px; }
.report-cta .history-link { display: inline-block; margin-left: 20px; font-family: var(--font-mono); font-size: 12px; }

/* ── Ground overlay (signature) ──────────────────────── */

#ground-overlay {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 50;
}
#ground-overlay .go-grid {
  position: fixed; inset: 0; opacity: 0; transition: opacity 500ms;
  background-image:
    repeating-linear-gradient(to right, rgba(140, 165, 255, 0.55) 0 1px, transparent 1px 64px),
    repeating-linear-gradient(to bottom, rgba(140, 165, 255, 0.55) 0 1px, transparent 1px 64px);
}
#ground-overlay.grid-on .go-grid { opacity: 0.04; }

.go-box {
  position: absolute; border: 1px solid var(--annot);
  opacity: 0; transform: scale(0.98); transform-origin: top left;
  transition: opacity 260ms ease-out, transform 260ms ease-out;
}
.go-box.on { opacity: 1; transform: none; }
.go-box.dim { opacity: 0.25; transition: opacity 600ms; }
.go-box .go-label {
  position: absolute; left: 0; bottom: 100%; margin-bottom: 7px;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.02em;
  color: var(--annot); white-space: nowrap;
}
.go-box.label-below .go-label { bottom: auto; top: 100%; margin-bottom: 0; margin-top: 7px; }

@keyframes go-pulse { 0% { background: rgba(140, 165, 255, 0); } 40% { background: rgba(140, 165, 255, 0.16); } 100% { background: rgba(140, 165, 255, 0); } }
.go-box.pulse { animation: go-pulse 300ms ease-out 1; }

/* ── It shows its thinking: execution-tree stage ──────── */

.tree-stage {
  position: relative; margin-top: 8px;
  height: clamp(420px, 60vh, 640px);
  background: var(--void); border-radius: 14px; overflow: hidden;
  box-shadow: 0 0 0 1px rgba(140, 165, 255, 0.15), 0 24px 70px rgba(3, 5, 16, 0.7);
}
.tree-canvas {
  position: absolute; inset: 0; width: 100%; height: 100%;
  display: block; cursor: grab; touch-action: none;
}
.tree-canvas.dragging { cursor: grabbing; }

/* projected labels: HTML overlay moved per frame with the render matrix */
.tree-labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.tree-labels .lbl {
  position: absolute; left: 0; top: 0;
  transform: translate(-9999px, -9999px);
  white-space: nowrap; will-change: transform;
}
.tree-labels .lbl .name {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.04em;
  color: var(--phosphor); text-shadow: 0 0 8px rgba(6, 7, 15, 0.9);
}
.tree-labels .lbl .row { display: flex; gap: 5px; align-items: center; margin-top: 2px; }
.tree-labels .lbl .tag, .tree-labels .lbl .badge, .tree-labels .lbl .sub {
  font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.14em; line-height: 1;
  padding: 2px 4px; border-radius: 3px;
}
.tree-labels .lbl .tag { color: var(--annot); background: rgba(140, 165, 255, 0.10); }
.tree-labels .lbl .badge { color: var(--purple); background: rgba(167, 139, 250, 0.12); }
.tree-labels .lbl .sub { color: rgba(140, 165, 255, 0.72); padding-left: 0; }
.tree-labels .lbl.fruit .name { color: var(--purple); }
.tree-labels .lbl.crown .name {
  color: #F0EBFF;
  animation: crown-pulse 2.8s ease-in-out infinite;
}
@keyframes crown-pulse {
  0%, 100% { text-shadow: 0 0 6px rgba(167, 139, 250, 0.5); }
  50%      { text-shadow: 0 0 18px rgba(167, 139, 250, 0.95), 0 0 34px rgba(69, 114, 253, 0.5); }
}

.tree-hint { margin-top: 14px; color: var(--annot); opacity: 0.6; }

@media (prefers-reduced-motion: reduce) {
  .tree-hint { display: none; }
  .tree-labels .lbl.crown .name { animation: none; }
}
