:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --ink: #0b1b2b;
  --ink-2: #3d4b5c;
  --muted: #667383;
  --line: #e2e7ee;
  --header: #0b1b2b;
  --header-ink: #ffffff;
  --mark: #2fd075;
  --up: #067a3e;
  --up-line: #0a9a4f;
  --up-bg: #e6f6ed;
  --down: #c4262e;
  --down-line: #d93a40;
  --down-bg: #fdebec;
  --flat: #5b6776;
  --flat-bg: #eef1f5;
  --grid: #e9edf2;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(11, 27, 43, .06), 0 4px 16px rgba(11, 27, 43, .05);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a111c;
    --surface: #111a28;
    --ink: #e9eef4;
    --ink-2: #b9c4d0;
    --muted: #8e9aa8;
    --line: #223043;
    --header: #060c15;
    --up: #44d483;
    --up-line: #3cc87a;
    --up-bg: rgba(68, 212, 131, .12);
    --down: #ff7a7f;
    --down-line: #ff6268;
    --down-bg: rgba(255, 98, 104, .13);
    --flat: #a3aebb;
    --flat-bg: rgba(163, 174, 187, .12);
    --grid: #1c2838;
    --shadow: none;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0a111c; --surface: #111a28; --ink: #e9eef4; --ink-2: #b9c4d0; --muted: #8e9aa8;
  --line: #223043; --header: #060c15; --up: #44d483; --up-line: #3cc87a; --up-bg: rgba(68, 212, 131, .12);
  --down: #ff7a7f; --down-line: #ff6268; --down-bg: rgba(255, 98, 104, .13); --flat: #a3aebb;
  --flat-bg: rgba(163, 174, 187, .12); --grid: #1c2838; --shadow: none; color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-variant-numeric: tabular-nums;
}
a { color: inherit; }
h1, h2, h3 { line-height: 1.15; margin: 0; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 8px; background: #fff; color: #000; padding: 8px 12px; z-index: 10; }

/* Header */
.site-header { background: var(--header); color: var(--header-ink); }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 60px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-size: 22px; letter-spacing: -.02em; font-weight: 600; }
.brand b { font-weight: 800; color: var(--mark); }
.brand-mark { width: 30px; height: 30px; color: var(--mark); }
.nav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.nav a { text-decoration: none; padding: 8px 12px; border-radius: 8px; font-size: 15px; font-weight: 600; white-space: nowrap; color: #c9d4e0; }
.nav a:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.nav a[aria-current="page"] { color: #fff; box-shadow: inset 0 -3px 0 var(--mark); border-radius: 8px 8px 0 0; }

/* Ticker tape */
.tape { background: var(--surface); border-bottom: 1px solid var(--line); }
.tape-row { display: flex; gap: 22px; overflow-x: auto; scrollbar-width: none; padding-top: 9px; padding-bottom: 9px; font-size: 14px; white-space: nowrap; }
.tape-row::-webkit-scrollbar, .nav::-webkit-scrollbar { display: none; }
.tape-item b { font-weight: 600; color: var(--ink-2); }
.tape-item [data-f] { font-weight: 700; }

/* Direction colors */
.dir-up { --dir: var(--up); --dir-line: var(--up-line); --dir-bg: var(--up-bg); }
.dir-down { --dir: var(--down); --dir-line: var(--down-line); --dir-bg: var(--down-bg); }
.dir-flat, .dir-mixed, .dir-none { --dir: var(--flat); --dir-line: var(--flat); --dir-bg: var(--flat-bg); }
.tape-item [data-f], .card-move, .big { color: var(--dir); }
.arrow::before { content: ""; }
.dir-up .arrow::before { content: "▲"; }
.dir-down .arrow::before { content: "▼"; }
.dir-mixed .big .arrow::before { content: "◆"; }

/* Hero */
.hero { background: linear-gradient(180deg, var(--dir-bg), transparent 85%); border-bottom: 1px solid var(--line); }
.hero-grid { display: grid; gap: 28px; padding-top: 28px; padding-bottom: 32px; }
@media (min-width: 960px) { .hero-grid { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); align-items: center; padding-top: 40px; padding-bottom: 44px; } }
.hero-meta { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; color: var(--ink-2); font-size: 15px; font-weight: 500; }
.status { display: inline-flex; align-items: center; gap: 7px; padding: 4px 11px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 14px; font-weight: 600; color: var(--ink); }
.status .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.status-open .dot { background: var(--up-line); box-shadow: 0 0 0 0 var(--up-line); animation: pulse 2s infinite; }
.status-pre .dot, .status-after .dot { background: #d99a12; }
.countdown { color: var(--muted); font-weight: 500; }
.countdown:not(:empty)::before { content: "· "; }
@keyframes pulse { 70% { box-shadow: 0 0 0 7px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
@media (prefers-reduced-motion: reduce) { .status-open .dot { animation: none; } }

.hero h1 { font-size: clamp(26px, 4.2vw, 38px); font-weight: 700; letter-spacing: -.02em; margin-top: 18px; }
.verdict { margin: 6px 0 4px; display: flex; flex-direction: column; }
.eyebrow { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.big { font-size: clamp(72px, 15vw, 136px); font-weight: 900; letter-spacing: -.045em; line-height: .95; display: inline-flex; align-items: center; gap: .12em; }
.big .arrow { font-size: .5em; }
.answer { font-size: clamp(18px, 2.2vw, 21px); font-weight: 500; margin: 14px 0 10px; max-width: 34em; }
.summary { margin: 0 0 6px; color: var(--ink-2); font-weight: 600; }
.asof { margin: 0; color: var(--muted); font-size: 14px; }

/* Main chart */
.chart-panel { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 16px 10px; box-shadow: var(--shadow); min-width: 0; }
.chart-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 6px; }
.chart-head figcaption { font-weight: 700; font-size: 17px; }
.tabs { display: inline-flex; background: var(--bg); border-radius: 10px; padding: 3px; }
.tabs button { font: inherit; font-size: 14px; font-weight: 600; border: 0; background: none; color: var(--ink-2); padding: 6px 12px; border-radius: 8px; cursor: pointer; }
.tabs button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.chart { position: relative; height: 280px; }
.chart svg { display: block; width: 100%; height: 100%; overflow: visible; }
.chart text { fill: var(--muted); font-size: 12px; }
.chart .gridline { stroke: var(--grid); stroke-width: 1; }
.chart .prev { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 4 4; }
.chart .line { fill: none; stroke: var(--dir-line); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { fill: var(--dir-line); opacity: .1; }
.chart .cross { stroke: var(--ink-2); stroke-width: 1; }
.chart .dot { fill: var(--dir-line); stroke: var(--surface); stroke-width: 2; }
.tip { position: absolute; top: 0; pointer-events: none; background: var(--ink); color: var(--surface); font-size: 13px; padding: 6px 9px; border-radius: 8px; white-space: nowrap; transform: translateX(-50%); }
.tip b { display: block; font-size: 14px; }
.chart-note { margin: 4px 0 0; font-size: 12px; color: var(--muted); }
.chart-empty { display: grid; place-items: center; height: 100%; color: var(--muted); }

/* Cards */
.majors { display: grid; gap: 14px; margin-top: 22px; }
@media (min-width: 720px) { .majors { grid-template-columns: repeat(3, 1fr); } }
.card { position: relative; display: grid; grid-template-columns: 1fr auto; grid-template-areas: "name spark" "full spark" "price spark" "move spark"; column-gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; text-decoration: none; box-shadow: var(--shadow); overflow: hidden; }
.card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--dir-line); }
a.card:hover { border-color: var(--dir-line); }
.card-name { grid-area: name; font-weight: 800; font-size: 18px; }
.card-full { grid-area: full; font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.card-price { grid-area: price; font-size: 26px; font-weight: 700; letter-spacing: -.01em; }
.card-move { grid-area: move; font-weight: 700; font-size: 15px; }
.spark { grid-area: spark; width: 110px; height: 64px; align-self: center; overflow: visible; }
.spark .line { fill: none; stroke: var(--dir-line); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.spark .prev { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; opacity: .7; }

.ad { margin: 26px auto; min-height: 90px; text-align: center; }

.glance h2, .faq h2, .about h2 { font-size: 24px; letter-spacing: -.01em; margin: 34px 0 14px; }
.glance-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); }
.tile { padding: 14px 16px; }
.tile .card-name { font-size: 15px; color: var(--ink-2); font-weight: 700; }
.tile .card-price { font-size: 21px; }
.tile .card-move { font-size: 14px; }
.tile .spark { width: 84px; height: 44px; }
.card.dir-none .spark { display: none; }

/* FAQ + about */
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 10px; }
.faq summary { cursor: pointer; padding: 15px 18px; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 22px; line-height: 1; color: var(--muted); }
.faq details[open] summary::after { content: "–"; }
.faq h3 { font-size: 17px; font-weight: 700; }
.faq details p { margin: 0; padding: 0 18px 16px; color: var(--ink-2); max-width: 46em; }
.about p { color: var(--ink-2); max-width: 46em; }

.site-footer { margin-top: 48px; background: var(--header); color: #c9d4e0; padding: 28px 0 36px; font-size: 14px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-bottom: 14px; }
.footer-links a { color: #fff; font-weight: 600; text-decoration: none; }
.site-footer .fine { margin: 6px 0; color: #9aa8b8; }

/* Plain text pages */
.prose { max-width: 760px; padding-top: 32px; }
.prose h1 { font-size: 34px; margin-bottom: 10px; }
.prose h2 { font-size: 21px; margin: 28px 0 8px; }
.prose p, .prose li { color: var(--ink-2); }
.dir-none .big { display: none; }
