/* IPO GMP Today — minimalist market terminal. Mobile-first, no webfonts, both themes. */

/* ---------------------------------------------------------------- tokens */
:root {
  --bg: #F7F6F3;
  --surface: #FFFFFF;
  --ink: #1C2530;
  --muted: #5F6C79;
  --line: #E5E3DC;
  --line-soft: #EFEDE7;
  --hover: rgba(28, 37, 48, 0.03);
  --accent: #D97400;
  --accent-ink: #B35F00;
  --pos: #177E5B;
  --neg: #C24444;
  --high-bg: #E2F2EB; --high-ink: #0E6B4C;
  --med-bg: #FAEFD8;  --med-ink: #8A5A00;
  --low-bg: #EAECEF;  --low-ink: #5F6C79;
  --open-ink: #0E6B4C;
  --tip-bg: #1C2530;
  --tip-ink: #F2F1EC;
  --shadow: 0 1px 2px rgba(28, 37, 48, 0.05);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0C1219; --surface: #141C26; --ink: #E7ECF1; --muted: #8FA0B0;
    --line: #243140; --line-soft: #1A2431; --hover: rgba(231, 236, 241, 0.035);
    --accent: #F0A03C; --accent-ink: #F0A03C;
    --pos: #43C495; --neg: #E37F7F;
    --high-bg: #123529; --high-ink: #4CC499;
    --med-bg: #38290F;  --med-ink: #E8B45C;
    --low-bg: #1C2733;  --low-ink: #93A1B0;
    --open-ink: #4CC499;
    --tip-bg: #E7ECF1; --tip-ink: #131C26;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  }
}

/* ---------------------------------------------------------------- base */
* { box-sizing: border-box; }
html { background: var(--bg); scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  font-size: 16px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
.shell { max-width: 1060px; margin: 0 auto; padding: 0 16px; }
a { color: var(--accent-ink); }
h1 { font-size: clamp(1.55rem, 1.2rem + 1.8vw, 2.15rem); line-height: 1.15; margin: 0.35em 0; letter-spacing: -0.022em; font-weight: 800; }
h2 { font-size: 1.2rem; margin: 0 0 0.5em; letter-spacing: -0.012em; font-weight: 700; }
p { margin: 0.6em 0; }
main > section, main > article > section { margin: 44px 0; }
.num { font-family: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
.ic { width: 20px; height: 20px; flex: none; color: var(--accent); }

/* ---------------------------------------------------------------- header */
.site-head { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.site-head .shell { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 54px; flex-wrap: wrap; }
.brand { font-weight: 800; font-size: 1.12rem; color: var(--ink); text-decoration: none; letter-spacing: -0.015em; }
.brand-hi { color: var(--accent); }
.nav { display: flex; gap: 2px; flex-wrap: wrap; }
.nav a { color: var(--muted); text-decoration: none; font-size: 0.85rem; font-weight: 600; padding: 6px 10px; border-radius: 6px; }
.nav a:hover { color: var(--ink); background: var(--hover); }

/* ---------------------------------------------------------------- hero */
.hero { padding: 26px 0 4px; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 28px; align-items: end; }
.hero-sub { color: var(--muted); max-width: 58ch; font-size: 1.02rem; }
.live-wrap { white-space: nowrap; }
.live { color: var(--pos); font-size: 0.62em; font-weight: 800; vertical-align: middle; letter-spacing: 0.1em; }
.live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--pos); margin: 0 5px 2px 12px; animation: pulse 2s infinite; }
@keyframes pulse { 50% { opacity: 0.35; } }

.hero-art { min-width: 0; }
.hero-viz { width: 100%; height: auto; display: block; }
.hero-viz .hb { fill: var(--accent); opacity: 0.55; }
.hero-viz .hb:hover { opacity: 0.95; }
.hero-viz .hb-zero { fill: var(--muted); opacity: 0.25; }
.hero-viz .hv-base { stroke: var(--line); stroke-width: 1; }
.hero-viz .hv-lab { fill: var(--muted); font-size: 9.5px; font-family: inherit; letter-spacing: 0.04em; }

/* stat strip */
.stat-strip { display: flex; flex-wrap: wrap; gap: 10px; margin: 22px 0 6px; }
.ss { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 11px 16px; min-width: 128px; box-shadow: var(--shadow); }
.ss, .ss > a { display: flex; align-items: center; gap: 11px; text-decoration: none; }
.ss > a { padding: 0; margin: -2px 0; }
.ss-v { display: block; font-size: 1.28rem; font-weight: 700; color: var(--ink); line-height: 1.2; }
.ss-l { display: block; font-size: 0.68rem; color: var(--muted); font-weight: 650; text-transform: uppercase; letter-spacing: 0.06em; }

/* ---------------------------------------------------------------- market pulse */
.pulse { margin: 30px 0 24px; }
.pulse-title { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 700; margin-bottom: 10px; }
.pulse-note { font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--muted); margin-left: 6px; }
.pulse-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); gap: 6px; }
.pcell { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 7px 9px; text-decoration: none; color: var(--ink); min-width: 0; }
@supports (background: color-mix(in srgb, red 10%, white)) {
  .pcell { background: color-mix(in srgb, var(--pos) calc(var(--heat, 0) * 26%), var(--surface));
           border-color: color-mix(in srgb, var(--pos) calc(var(--heat, 0) * 38%), var(--line)); }
}
.pcell:hover { border-color: var(--accent); }
.pcell-name { display: block; font-size: 0.68rem; font-weight: 600; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pcell-v { display: block; font-size: 0.86rem; font-weight: 700; margin-top: 1px; }
.pcell-cold .pcell-v { color: var(--muted); font-weight: 500; }

/* ---------------------------------------------------------------- filters */
.filters { display: flex; gap: 8px; margin: 18px 0 12px; flex-wrap: wrap; }
.chip { font: inherit; font-size: 0.84rem; font-weight: 700; color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 7px 15px; cursor: pointer; }
.chip:hover { color: var(--ink); border-color: var(--muted); }
.chip.active { color: var(--surface); background: var(--ink); border-color: var(--ink); }

/* ---------------------------------------------------------------- the board */
.board { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 28px; box-shadow: var(--shadow); overflow: hidden; }
.row { display: grid; grid-template-columns: 2fr 0.8fr 1fr 0.8fr 0.75fr 0.55fr 1fr 0.75fr; gap: 10px; align-items: center;
  padding: 12px 16px; text-decoration: none; color: var(--ink); border-bottom: 1px solid var(--line-soft); }
.board > .row:last-child { border-bottom: none; }
a.row { transition: background 120ms ease, box-shadow 120ms ease; }
a.row:hover { background: var(--hover); box-shadow: inset 2px 0 0 var(--accent); }
.row-head { padding: 10px 16px 8px; font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); border-bottom: 1px solid var(--line); background: transparent; }
.c-name strong { display: block; font-size: 0.95rem; line-height: 1.3; letter-spacing: -0.008em; }
.c-name small { color: var(--muted); font-size: 0.75rem; }
.c-gmp { font-weight: 700; font-size: 1.02rem; }
.c-range, .c-est, .c-sub { font-size: 0.85rem; color: var(--muted); }
.c-est.pos { color: var(--pos); font-weight: 700; }
.c-conf small { display: block; color: var(--muted); font-size: 0.7rem; margin-top: 3px; }
.c-spark { min-width: 0; }

/* sparkline */
.spark { width: 88px; max-width: 100%; height: 26px; display: block; }
.spark polyline { stroke: var(--muted); stroke-width: 1.6; }
.spark circle { fill: var(--muted); }
.spark.sp-up polyline { stroke: var(--pos); } .spark.sp-up circle { fill: var(--pos); }
.spark.sp-down polyline { stroke: var(--neg); } .spark.sp-down circle { fill: var(--neg); }
.spark-none { display: block; width: 18px; border-top: 1px solid var(--line); }

/* trend arrows, badges, status */
.tr { font-style: normal; font-size: 0.68em; margin-left: 4px; vertical-align: middle; }
.tr-up { color: var(--pos); } .tr-down { color: var(--neg); }
.badge { font-style: normal; font-size: 0.7rem; font-weight: 750; text-transform: uppercase; letter-spacing: 0.05em; padding: 3px 8px; border-radius: 5px; cursor: help; }
.badge-high { background: var(--high-bg); color: var(--high-ink); }
.badge-medium { background: var(--med-bg); color: var(--med-ink); }
.badge-low { background: var(--low-bg); color: var(--low-ink); }
.status { font-style: normal; font-size: 0.8rem; font-weight: 700; }
.status-open { color: var(--open-ink); }
.status-upcoming { color: var(--accent-ink); }
.status-closed, .status-na { color: var(--muted); }
.muted-note { color: var(--muted); font-size: 0.85rem; }

/* ---------------------------------------------------------------- tooltips */
.th-tip { font-style: normal; border-bottom: 1px dotted var(--muted); cursor: help; }
.bf-mark { font-style: normal; font-size: 0.72rem; color: var(--muted); border-bottom: 1px dotted var(--muted); cursor: help; }
.tipbox { position: fixed; z-index: 60; max-width: 300px; background: var(--tip-bg); color: var(--tip-ink);
  font-size: 0.8rem; line-height: 1.45; padding: 8px 11px; border-radius: 8px; box-shadow: 0 4px 16px rgba(0,0,0,0.22);
  pointer-events: none; opacity: 0; transform: translateY(2px); transition: opacity 100ms ease, transform 100ms ease; }
.tipbox.on { opacity: 1; transform: none; }

/* ---------------------------------------------------------------- pillars + FAQ */
.pillars { margin: 44px 0; }
.pillar-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 12px; }
.pillar { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 8px 18px 14px; box-shadow: var(--shadow); }
.pillar h3 { font-size: 0.98rem; margin: 12px 0 4px; display: flex; align-items: center; gap: 8px; letter-spacing: -0.008em; }
.pillar h3 .ic { width: 18px; height: 18px; }
.pillar p { font-size: 0.9rem; color: var(--muted); }
.faq { margin: 44px 0; max-width: 74ch; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; margin: 8px 0; }
.faq summary { font-weight: 700; font-size: 0.95rem; cursor: pointer; }
.faq details p { color: var(--muted); font-size: 0.92rem; margin: 8px 0 2px; }

/* ---------------------------------------------------------------- charts */
.chart-wrap { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px; max-width: 680px; box-shadow: var(--shadow); }
.chart { width: 100%; height: auto; display: block; touch-action: pan-y; }
.ch-grid { stroke: var(--line-soft); stroke-width: 1; }
.ch-lab { fill: var(--muted); font-size: 11px; font-family: inherit; }
.ch-band { fill: var(--accent); opacity: 0.12; }
.ch-line { stroke: var(--accent); stroke-width: 2.25; }
.ch-dot { fill: var(--accent); }
.ch-pt { fill: var(--accent); opacity: 0.85; }
.ch-pt-bf { fill: var(--surface); stroke: var(--accent); stroke-width: 1.4; }
.ch-cross { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; }
.ch-cross-dot { fill: var(--ink); stroke: var(--surface); stroke-width: 1.5; }
.chart-tip { position: absolute; z-index: 5; background: var(--tip-bg); color: var(--tip-ink); font-size: 0.78rem;
  line-height: 1.4; padding: 7px 10px; border-radius: 8px; pointer-events: none; white-space: nowrap;
  box-shadow: 0 4px 16px rgba(0,0,0,0.22); display: none; }
.chart-tip small { display: block; opacity: 0.75; }

/* ---------------------------------------------------------------- per-IPO page */
.crumbs { font-size: 0.82rem; color: var(--muted); margin-top: 16px; }
.crumbs a { text-decoration: none; }
.ipo-head { margin-bottom: 6px; }
.updated { color: var(--muted); font-size: 0.85rem; margin-top: -2px; }
.ipo-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(175px, 1fr)); gap: 10px; margin: 18px 0; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 13px 15px; box-shadow: var(--shadow); }
.stat-main { border-color: var(--accent); box-shadow: inset 0 2px 0 var(--accent), var(--shadow); }
.stat-label { display: block; font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); }
.stat-value { display: block; font-size: 1.5rem; font-weight: 700; margin: 3px 0 2px; line-height: 1.2; }
.stat-value.pos { color: var(--pos); }
.stat-sub { display: block; font-size: 0.78rem; color: var(--muted); }

/* confidence panel */
.conf-panel { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px 14px; box-shadow: var(--shadow); max-width: 680px; }
.conf-grid { display: grid; grid-template-columns: 176px 1fr; gap: 20px; align-items: center; }
.conf-dial { text-align: center; }
.conf-dial .badge { margin-top: 6px; display: inline-block; }
.dial { width: 100%; max-width: 168px; height: auto; }
.dial-track { stroke: var(--line-soft); }
.dial-high .dial-value { stroke: var(--pos); }
.dial-medium .dial-value { stroke: var(--accent); }
.dial-low .dial-value { stroke: var(--muted); }
.dial-num { fill: var(--ink); font-size: 30px; font-weight: 700; font-family: ui-monospace, Menlo, Consolas, monospace; }
.dial-cap { fill: var(--muted); font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.07em; font-family: inherit; }
.cbar { display: grid; grid-template-columns: 88px 1fr 36px; gap: 10px; align-items: center; margin: 9px 0; }
.cbar-label { font-size: 0.78rem; font-weight: 650; color: var(--muted); }
.cbar-track { display: block; height: 7px; background: var(--line-soft); border-radius: 999px; overflow: hidden; }
.cbar-fill { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.cbar-v { font-size: 0.8rem; text-align: right; color: var(--ink); }
.conf-bars .muted-note { margin: 10px 0 0; font-size: 0.78rem; }

/* tracker comparison bars */
.src-chart { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px 8px; max-width: 680px; box-shadow: var(--shadow); }
.src-row { display: grid; grid-template-columns: minmax(104px, 148px) 1fr 58px 46px; gap: 12px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--line-soft); }
.src-row:last-of-type { border-bottom: none; }
.src-name a { font-size: 0.86rem; font-weight: 650; text-decoration: none; color: var(--ink); }
.src-name a:hover { color: var(--accent-ink); }
.src-name small { display: block; color: var(--muted); font-size: 0.68rem; }
.src-track { position: relative; display: block; height: 20px; background: var(--line-soft); border-radius: 5px; }
.src-fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--accent); opacity: 0.7; border-radius: 5px; min-width: 2px; }
.src-median { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; background: var(--ink); opacity: 0.65; border-radius: 1px; }
.src-v { font-size: 0.88rem; font-weight: 700; text-align: right; }
.src-delta { font-size: 0.78rem; text-align: right; color: var(--muted); }
.src-legend { font-size: 0.75rem; color: var(--muted); margin: 10px 0 6px; }
.src-median-key { display: inline-block; width: 2px; height: 11px; background: var(--ink); opacity: 0.65; vertical-align: -1px; margin-right: 4px; }

/* ---------------------------------------------------------------- tables */
.tbl-scroll { overflow-x: auto; margin: 12px 0; }
.mini-table { border-collapse: collapse; width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; font-size: 0.88rem; }
.mini-table th { text-align: left; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); padding: 9px 12px; border-bottom: 1px solid var(--line); background: var(--bg); }
.mini-table td { padding: 8px 12px; border-bottom: 1px solid var(--line-soft); font-variant-numeric: tabular-nums; }
.mini-table tr:last-child td { border-bottom: none; }
.pos { color: var(--pos); } .neg { color: var(--neg); }

/* ---------------------------------------------------------------- prose + explain */
.prose { max-width: 68ch; padding-bottom: 10px; }
.prose h2 { margin-top: 1.7em; }
.prose pre { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 12px; overflow-x: auto; }
.explain { background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 10px; padding: 6px 18px; margin: 24px 0; max-width: 74ch; }
.explain h2 { margin-top: 0.7em; }

/* ---------------------------------------------------------------- footer */
.site-foot { border-top: 1px solid var(--line); margin-top: 48px; padding: 22px 0 32px; background: var(--surface); }
.foot-brand { font-weight: 700; }
.foot-links { font-size: 0.85rem; }
.disclaimer { font-size: 0.76rem; color: var(--muted); line-height: 1.5; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin: 12px 0; }
.foot-meta { font-size: 0.76rem; color: var(--muted); }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 860px) {
  .row { grid-template-columns: 1.8fr 0.8fr 1fr 0.9fr 1fr 0.8fr; }
  .c-range, .c-sub { display: none; }
  .row-head span:nth-child(3), .row-head span:nth-child(6) { display: none; }
}
@media (max-width: 760px) {
  .hero-grid { grid-template-columns: 1fr; gap: 10px; }
  .hero-art { max-width: 420px; }
  .stat-strip { display: grid; grid-template-columns: 1fr 1fr; }
  .ss { min-width: 0; }
  .row-head { display: none; }
  .row { grid-template-columns: 1fr 1fr; gap: 10px 14px; padding: 14px 16px; }
  .c-name { grid-column: 1 / -1; }
  .c-range, .c-sub { display: block; }
  .c-gmp::before, .c-range::before, .c-est::before, .c-sub::before, .c-conf::before, .c-status::before, .c-spark::before {
    content: attr(data-label); display: block; font-size: 0.64rem; text-transform: uppercase;
    letter-spacing: 0.07em; color: var(--muted); font-weight: 700; margin-bottom: 2px; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
  .c-gmp, .c-est { font-size: 1rem; }
  .c-spark-empty { display: none; }
  .conf-grid { grid-template-columns: 1fr; gap: 8px; }
  .conf-dial { margin: 0 auto; }
  .cbar { grid-template-columns: 76px 1fr 32px; }
  .src-row { grid-template-columns: minmax(86px, 110px) 1fr 52px 42px; gap: 8px; }
}

/* ---------------------------------------------------------------- motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .live-dot { animation: none; }
  a.row, .tipbox { transition: none; }
}
