/* SolarScan AI · live demo page (v2 design system, self-contained).
   Paper white page, ink type, one volt accent, dark night bands. */
:root {
  --paper: #f4f4f0;
  --paper-2: #e9e9e2;
  --surface: #ffffff;
  --ink: #0b0c0a;
  --ink-2: #1b1d18;
  --night: #0d100c;
  --night-2: #161a14;
  --night-line: #2a3026;
  --volt: #c8ff2e;
  --line: #d6d6cc;
  --muted: #55584f;          /* 6.6:1 on paper */
  --muted-night: #a4aa9a;    /* 7.9:1 on night */
  --sev-high: #ff3b30;
  --sev-medium: #ff8a00;
  --sev-low: #ffd400;

  --font-display: "Bricolage Grotesque", "Arial Black", system-ui, sans-serif;
  --font-body: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --font-script: "Yellowtail", "Brush Script MT", cursive;

  --text-display: clamp(3.4rem, 0.6rem + 6.6vw, 8rem);
  --text-h2: clamp(2.6rem, 1rem + 5vw, 5.5rem);

  --radius-xl: 28px;
  --radius-l: 20px;
  --radius-m: 14px;
  --gutter: clamp(16px, 3vw, 40px);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --dur: 220ms;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; background: var(--paper); color: var(--ink); font: 400 16px/1.5 var(--font-body);
  -webkit-font-smoothing: antialiased; }
a { color: inherit; }
.mono { font-family: var(--font-mono); }
.script { font-family: var(--font-script); font-weight: 400; letter-spacing: 0; }
.volt { color: var(--volt); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--ink); color: var(--volt);
  padding: 10px 16px; border-radius: 999px; font-weight: 600; text-decoration: none; }
.skip:focus { top: 12px; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; border-radius: 6px; }

/* ---------- nav ---------- */
.site-nav { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; justify-content: space-between;
  padding: 14px var(--gutter); background: var(--paper); border-bottom: 1px solid transparent; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none;
  font: 800 19px/1 var(--font-display); letter-spacing: -0.03em; }
.brand-mark { width: 26px; height: 26px; border-radius: 8px; background: var(--ink); position: relative; }
.brand-mark::after { content: ""; position: absolute; inset: 7px; border-radius: 50%; background: var(--volt); }
.nav-links { display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--surface);
  border: 1px solid var(--line); }
.nav-links a { text-decoration: none; padding: 8px 16px; border-radius: 999px; font-weight: 500; font-size: 15px;
  color: var(--muted); transition: color var(--dur) var(--ease), background-color var(--dur) var(--ease); }
.nav-links a:hover { color: var(--ink); background: var(--paper-2); }
.nav-links a[aria-current="page"] { color: var(--volt); background: var(--ink); }

/* ---------- intro ---------- */
.intro { padding: clamp(18px, 2.4vw, 36px) var(--gutter) clamp(18px, 2vw, 28px);
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(240px, 360px); column-gap: 40px; align-items: end; }
.kicker { grid-column: 1 / -1; margin: 0 0 8px; font-size: 13px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); display: inline-flex; align-items: center; gap: 10px; }
.kicker-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink); box-shadow: 0 0 0 3px var(--volt); }
.display { margin: 0; font: 800 var(--text-display)/0.86 var(--font-display); letter-spacing: -0.05em; }
.display-break { position: relative; display: inline-block; }
.script-tag { position: absolute; right: -0.1em; top: -0.32em; transform: rotate(-6deg);
  background: var(--ink); color: var(--volt); border-radius: 999px; padding: 0.02em 0.5em 0.12em;
  font-size: 0.3em; line-height: 1; letter-spacing: 0; white-space: nowrap; }
.script-tag .script { font-size: 1.25em; }
.intro-sub { margin: 0 0 0.6em; color: var(--muted); font-size: 17px; max-width: 36ch; }

/* ---------- console ---------- */
.console { display: grid; grid-template-columns: minmax(0, 1fr) clamp(320px, 30vw, 440px); gap: 16px;
  padding: 0 var(--gutter) var(--gutter); }

.stage { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius-xl); overflow: hidden;
  background: var(--night); isolation: isolate;
  box-shadow: 0 0 0 1px var(--ink), 0 40px 80px -40px rgb(11 12 10 / .55); }
#feedvid, #feed { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
#feedvid { background: var(--night); }
.brackets i { position: absolute; width: 30px; height: 30px; border: 2px solid rgb(244 244 240 / .55); pointer-events: none; }
.brackets i:nth-child(1) { top: 20px; left: 20px; border-right: 0; border-bottom: 0; border-top-left-radius: 10px; }
.brackets i:nth-child(2) { top: 20px; right: 20px; border-left: 0; border-bottom: 0; border-top-right-radius: 10px; }
.brackets i:nth-child(3) { bottom: 34px; left: 20px; border-right: 0; border-top: 0; border-bottom-left-radius: 10px; }
.brackets i:nth-child(4) { bottom: 34px; right: 20px; border-left: 0; border-top: 0; border-bottom-right-radius: 10px; }

.hud { position: absolute; left: 62px; right: 62px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  font-size: 12.5px; pointer-events: none; z-index: 2; }
.hud-top { top: 22px; justify-content: space-between; }
.hud-bottom { bottom: 36px; color: var(--muted-night); }
.hud-group { display: inline-flex; gap: 8px; align-items: center; min-width: 0; }
.phase { display: inline-flex; align-items: center; gap: 10px; min-width: 0; max-width: 46ch; color: var(--paper);
  background: rgb(11 12 10 / .82); border: 1px solid rgb(244 244 240 / .14); border-radius: 999px; padding: 3px 12px 3px 3px; }
.phase[hidden] { display: none; }
.phase b { font-weight: 600; letter-spacing: .12em; padding: 3px 9px; border-radius: 999px;
  background: rgb(244 244 240 / .16); color: var(--paper); }
.phase.is-inspect b { background: var(--volt); color: var(--ink); }
.phase span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hud-bottom > span, .chip, .rec { background: rgb(11 12 10 / .82); border: 1px solid rgb(244 244 240 / .14);
  padding: 6px 12px; border-radius: 999px; }
.hud-bottom b { color: var(--paper); font-weight: 500; }
.hud-bottom em { color: var(--volt); font-style: normal; font-size: 11px; letter-spacing: .05em; }
.chip { color: var(--paper); letter-spacing: .02em; }
.rec { display: inline-flex; align-items: center; gap: 8px; color: var(--paper);
  font: 600 12.5px var(--font-mono); letter-spacing: .12em; }
.rec-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted-night); }
.live .rec-dot { background: var(--sev-high); box-shadow: 0 0 0 3px rgb(255 59 48 / .25); animation: blink 1.1s steps(2) infinite; }
@keyframes blink { 50% { opacity: .3; } }

/* start overlay */
.start { position: absolute; inset: 0; z-index: 5; display: flex; flex-direction: column; justify-content: center;
  align-items: flex-start; padding: clamp(24px, 7%, 96px); color: var(--paper);
  background:
    radial-gradient(60% 80% at 88% 110%, rgb(200 255 46 / .22), transparent 60%),
    linear-gradient(rgb(244 244 240 / .05) 1px, transparent 1px) 0 0 / 48px 48px,
    linear-gradient(90deg, rgb(244 244 240 / .05) 1px, transparent 1px) 0 0 / 48px 48px,
    var(--night);
  transition: opacity .5s var(--ease), transform .6s var(--ease); }
.start.gone { opacity: 0; transform: scale(1.03); pointer-events: none; }
.start h2 { margin: 10px 0 14px; font: 800 clamp(2.2rem, 1rem + 5.2vw, 6.4rem)/0.9 var(--font-display);
  letter-spacing: -0.045em; max-width: 12ch; }
.start h2 .volt { white-space: nowrap; }
.start-sub { margin: 0 0 28px; max-width: 42ch; color: var(--muted-night); font-size: clamp(15px, 1.2vw, 18px); }
.start-note { margin: 18px 0 0; font-size: 12px; letter-spacing: .06em; color: var(--muted-night); }
.eyebrow { margin: 0; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--volt); }

/* buttons */
.btn { display: inline-flex; align-items: center; gap: 12px; border: 0; border-radius: 999px; cursor: pointer;
  font: 600 16px/1 var(--font-body); padding: 15px 24px; text-decoration: none;
  transition: transform var(--dur) var(--ease), background-color var(--dur) var(--ease), color var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease); }
.btn-volt { background: var(--volt); color: var(--ink); box-shadow: 0 0 0 0 rgb(200 255 46 / .5); }
.btn-volt:hover { transform: translateY(-2px); box-shadow: 0 14px 34px -12px rgb(200 255 46 / .7); }
.btn-volt:active { transform: translateY(0) scale(.98); }
.btn-line { background: transparent; color: var(--paper); box-shadow: inset 0 0 0 1.5px rgb(244 244 240 / .4); }
.btn-line:hover { box-shadow: inset 0 0 0 1.5px var(--paper); background: rgb(244 244 240 / .06); }
.btn-xl { font-size: clamp(16px, 1.3vw, 19px); padding: 10px 28px 10px 10px; }
.btn-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: var(--ink); color: var(--volt); }
.start :focus-visible, .report :focus-visible { outline-color: var(--volt); }

/* timeline */
.timeline { position: absolute; left: 0; right: 0; bottom: 0; height: 8px; background: rgb(244 244 240 / .16); z-index: 3; }
.timeline-fill { height: 100%; width: 0; background: var(--volt); box-shadow: 0 0 12px rgb(200 255 46 / .6); }
.timeline-marks i { position: absolute; bottom: 0; width: 4px; height: 16px; border-radius: 2px 2px 0 0;
  transform: translateX(-2px); box-shadow: 0 0 0 1px var(--night); }

/* ---------- rail ---------- */
.rail { display: flex; flex-direction: column; min-height: 0; contain: size; } /* height follows the stage */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 16px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); padding: 12px 14px 12px; min-width: 0; }
.stat-k { display: block; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; }
.stat b { display: block; margin: 4px 0 0; font: 500 clamp(26px, 2.3vw, 36px)/1.1 var(--font-mono); letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; }
.stat small { color: var(--muted); font-size: 12px; }
.stat-hot { background: var(--ink); border-color: var(--ink); }
.stat-hot .stat-k, .stat-hot small { color: var(--muted-night); }
.stat-hot b { color: var(--volt); }
.rail-title { margin: 0 0 10px; display: flex; justify-content: space-between; align-items: baseline;
  font: 800 22px/1 var(--font-display); letter-spacing: -0.03em; }
.rail-title span { font-size: 11px; font-weight: 400; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.alerts { list-style: none; margin: 0; padding: 0 4px 4px 0; overflow-y: auto; flex: 1; min-height: 0;
  display: flex; flex-direction: column; gap: 8px; scrollbar-width: thin; }
.alerts .empty { color: var(--muted); border: 1.5px dashed var(--line); border-radius: var(--radius-l); padding: 28px 20px; text-align: center; }
.alert { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 12px; align-items: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); padding: 8px;
  animation: pop .5s var(--ease); }
.alert:first-child { border-color: var(--ink); }
@keyframes pop { from { opacity: 0; transform: translateY(-8px) scale(.98); } to { opacity: 1; transform: none; } }
.alert-photo { position: relative; }
.alert-photo img { width: 112px; height: 76px; object-fit: cover; border-radius: 12px; display: block; }
.alert-photo::after { content: ""; position: absolute; left: 6px; top: 6px; width: 10px; height: 10px; border-radius: 50%;
  background: var(--sev, var(--sev-medium)); box-shadow: 0 0 0 2px var(--ink); }
.alert h3 { margin: 0 0 4px; font: 700 17px/1.1 var(--font-display); letter-spacing: -0.02em; text-transform: capitalize; }
.alert-meta { margin: 0 0 4px; display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.alert-pos { margin: 0; font-size: 11.5px; color: var(--muted); letter-spacing: -0.01em; }
.sev { display: inline-block; font: 600 10.5px/1 var(--font-mono); letter-spacing: .1em; padding: 4px 8px 4px;
  border-radius: 999px; color: var(--ink); background: var(--sev, var(--sev-medium)); }

/* ---------- report (night band) ---------- */
.report { background: var(--night); color: var(--paper); border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  margin-top: clamp(16px, 2.4vw, 32px); scroll-margin-top: 64px; }
.report-inner { max-width: 1440px; margin: 0 auto; padding: clamp(40px, 6vw, 88px) var(--gutter) clamp(48px, 6vw, 80px); }
.report-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap;
  margin-bottom: clamp(24px, 3vw, 40px); }
.report-head h2 { margin: 8px 0 10px; font: 800 var(--text-h2)/0.9 var(--font-display); letter-spacing: -0.05em; }
.report-head h2 .script { color: var(--volt); font-size: 1.05em; letter-spacing: 0; margin-left: .05em; }
.report-sub { margin: 0; color: var(--muted-night); font-size: 16px; }
.report-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.report-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) minmax(0, 2fr); gap: 12px; }
.card { background: var(--night-2); border: 1px solid var(--night-line); border-radius: var(--radius-xl); padding: 24px; min-width: 0; }
.card-k { display: block; font-size: 11.5px; color: var(--muted-night); text-transform: uppercase; letter-spacing: .1em; }
.card-k em { font-style: normal; color: var(--volt); margin-left: 6px; text-transform: none; letter-spacing: 0; }
.big-num { display: flex; flex-direction: column; }
.big-num > b { display: block; margin: 8px 0 auto; padding-bottom: 18px; font: 800 clamp(6rem, 3rem + 7vw, 11rem)/0.85 var(--font-display);
  letter-spacing: -0.06em; color: var(--volt); }
.sev-bars { display: flex; gap: 3px; height: 12px; border-radius: 999px; overflow: hidden; background: var(--night-line); }
.sev-bars i { display: block; height: 100%; }
.sev-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 12px; font: 500 12px var(--font-mono); color: var(--muted-night); }
.sev-legend span { display: inline-flex; align-items: center; gap: 6px; }
.sev-legend i { width: 10px; height: 10px; border-radius: 3px; background: var(--sev); }
.sev-legend b { color: var(--paper); font-weight: 600; }
.type-list { list-style: none; padding: 0; margin: 14px 0 0; }
.type-list li { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 14px 0;
  border-bottom: 1px solid var(--night-line); text-transform: capitalize; font-size: 17px; }
.type-list li:last-child { border-bottom: 0; }
.type-list b { font: 500 32px/1 var(--font-mono); letter-spacing: -0.04em; color: var(--paper); }
#r-map { display: block; width: 100%; height: auto; margin-top: 14px; border-radius: var(--radius-m);
  background:
    linear-gradient(rgb(244 244 240 / .06) 1px, transparent 1px) 0 0 / 26px 26px,
    linear-gradient(90deg, rgb(244 244 240 / .06) 1px, transparent 1px) 0 0 / 26px 26px,
    var(--night); border: 1px solid var(--night-line); }
.report h3 { margin: clamp(36px, 5vw, 64px) 0 16px; font: 800 clamp(1.6rem, 1rem + 1.8vw, 2.6rem)/1 var(--font-display); letter-spacing: -0.04em; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.gallery figure { margin: 0; background: var(--night-2); border: 1px solid var(--night-line); border-radius: var(--radius-l); overflow: hidden;
  transition: transform var(--dur) var(--ease), border-color var(--dur) var(--ease); }
.gallery figure:hover { transform: translateY(-3px); border-color: var(--muted-night); }
.gallery img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; display: block; }
.gallery figcaption { padding: 12px 14px 14px; font-size: 13px; color: var(--muted-night); display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.gallery figcaption b { color: var(--paper); text-transform: capitalize; font: 700 15px var(--font-display); letter-spacing: -0.01em; flex-basis: 100%; }
.fine { margin: 32px 0 0; padding-top: 20px; border-top: 1px solid var(--night-line); color: var(--muted-night); font-size: 13px; max-width: 80ch; }

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .intro { grid-template-columns: 1fr; }
  .intro-sub { margin-top: 18px; }
  .console { grid-template-columns: 1fr; }
  .rail { contain: none; }
  .alerts { max-height: 60vh; }
  .report-grid { grid-template-columns: 1fr 1fr; }
  .map-card { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .script-tag { position: static; display: inline-block; margin: 0.3em 0 0; transform: rotate(-3deg); font-size: 0.34em; }
  .display-break { display: inline; }
  .stage { aspect-ratio: auto; height: 420px; border-radius: 22px; }
  #feedvid, #feed { object-fit: contain; }
  .brackets { display: none; }
  .hud { left: 12px; right: 12px; font-size: 11px; gap: 6px; }
  .hud-top { top: 12px; }
  .phase span { display: none; }
  .phase { padding-right: 3px; }
  .hud-bottom { bottom: 20px; }
  .hud-group { display: inline-flex; gap: 8px; align-items: center; min-width: 0; }
.phase { display: inline-flex; align-items: center; gap: 10px; min-width: 0; max-width: 46ch; color: var(--paper);
  background: rgb(11 12 10 / .82); border: 1px solid rgb(244 244 240 / .14); border-radius: 999px; padding: 3px 12px 3px 3px; }
.phase[hidden] { display: none; }
.phase b { font-weight: 600; letter-spacing: .12em; padding: 3px 9px; border-radius: 999px;
  background: rgb(244 244 240 / .16); color: var(--paper); }
.phase.is-inspect b { background: var(--volt); color: var(--ink); }
.phase span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hud-bottom > span, .chip, .rec { padding: 5px 9px; }
  .start { padding: 24px 22px; }
  .stats { gap: 6px; }
  .stat { padding: 10px; border-radius: var(--radius-m); }
  .stat small { font-size: 11px; }
  .alert { grid-template-columns: 92px minmax(0, 1fr); }
  .alert-photo img { width: 92px; height: 66px; }
  .report-grid { grid-template-columns: 1fr; }
  .nav-links a { padding: 7px 12px; font-size: 14px; }
  .brand { font-size: 17px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
