/* YKH Labs brand */
:root {
  color-scheme: dark;
  --page: #0A0A0B;
  --surface: #121215;
  --raised: #0F0F12;
  --ink: #EDEDEF;
  --ink-2: #8B8B95;
  --dim: #5C5C66;
  --hair: #222228;
  --axis: #2E2E36;
  --accent: #3DF5C1;
  --accent-soft: rgba(61, 245, 193, 0.14);
  --window: rgba(61, 245, 193, 0.07);
  --head: #0A0A0B;
  --head-ink: #EDEDEF;
  --head-ink-2: #8B8B95;
  --warn: #fbb315;
  --serious: #f18a59;
  --critical: #ff5a5f;
  --good: #3DF5C1;
  --radius: 16px;
  --font: Geist, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 64px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 16px/1.5 var(--font);
  padding-bottom: env(safe-area-inset-bottom);
}
a { color: var(--accent); text-underline-offset: 2px; }
h1, h2, h3 { margin: 0; line-height: 1.25; }
h2 { font-size: 1.2rem; font-weight: 650; letter-spacing: -0.02em; }
h3 { font: 500 0.72rem/1.3 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-2); margin: 22px 0 12px; }
h3 .muted { text-transform: none; letter-spacing: 0; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--ink-2); font-weight: 400; }
.note { color: var(--ink-2); font-size: 0.82rem; margin: 10px 0 0; }
.sub { color: var(--ink-2); font-size: 0.88rem; margin: 4px 0 8px; }

/* Header */
.top {
  position: relative;
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(61,245,193,0.10), transparent 60%),
    linear-gradient(var(--hair) 1px, transparent 1px) 0 0 / 44px 44px,
    linear-gradient(90deg, var(--hair) 1px, transparent 1px) 0 0 / 44px 44px,
    var(--page);
  color: var(--head-ink);
  padding: calc(16px + env(safe-area-inset-top)) 0 18px;
  border-bottom: 1px solid var(--hair);
}
.top::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 40%, var(--page)); pointer-events: none; }
.top > * { position: relative; z-index: 1; }
.brand-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 22px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-size: 1.05rem; }
.brand img { width: 34px; height: 34px; display: block; }
.brand b { font-weight: 700; letter-spacing: 0.01em; }
.brand span { color: var(--ink-2); font-weight: 400; }
.top-inner { display: flex; gap: 14px; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; }
.eyebrow { margin: 0 0 10px; font: 500 0.74rem/1 var(--mono); letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-2); display: flex; align-items: center; gap: 8px; }
.eyebrow::before { content: ""; width: 8px; height: 8px; background: var(--accent); display: inline-block; }
h1 { font-size: 2.1rem; font-weight: 700; letter-spacing: -0.035em; line-height: 1.02; }
h1 .dates { display: block; color: var(--ink-2); font-weight: 700; }
.phase {
  background: rgba(61,245,193,0.06);
  border: 1px solid rgba(61,245,193,0.35);
  color: var(--accent);
  border-radius: 999px;
  padding: 7px 14px;
  font: 500 0.8rem/1.2 var(--mono);
  white-space: nowrap;
}
.phase .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 8px; background: var(--accent); vertical-align: 0; }
.phase.now { color: var(--critical); border-color: rgba(255,90,95,0.45); background: rgba(255,90,95,0.08); }
.phase.now .dot { background: var(--critical); animation: pulse 1.6s infinite; }
.phase.over { color: var(--ink-2); border-color: var(--axis); background: none; }
.phase.over .dot { background: var(--ink-2); }
@keyframes pulse { 50% { opacity: 0.35; } }
@media (prefers-reduced-motion: reduce) { .phase.now .dot { animation: none; } }
.updated { display: flex; gap: 12px; align-items: center; margin-top: 14px; font: 0.76rem/1.3 var(--mono); color: var(--ink-2); }
.link-btn {
  background: none; border: 1px solid var(--axis); border-radius: 999px; padding: 5px 12px; color: var(--ink); font: inherit;
  cursor: pointer; min-height: 32px;
}
.link-btn:hover { border-color: var(--accent); color: var(--accent); }

/* Sticky section tabs */
.tabs {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--hair);
}
.tabs-inner { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.tabs-inner::-webkit-scrollbar { display: none; }
.tabs a {
  flex: 1 0 auto; text-align: center;
  padding: 12px 12px; min-height: 44px;
  color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: 0.9rem;
}
.tabs a { font-family: var(--mono); font-weight: 500; font-size: 0.8rem; letter-spacing: 0.04em; }
.tabs a:hover, .tabs a:focus-visible { color: var(--accent); }

/* Layout */
.grid { display: grid; grid-template-columns: 1fr; gap: 14px; padding-top: 14px; padding-bottom: 14px; }
@media (min-width: 860px) {
  .grid { grid-template-columns: 1fr 1fr; gap: 18px; padding-top: 18px; }
  .span-2 { grid-column: span 2; }
  h1 { font-size: 3rem; }
  h1 .dates { display: inline; margin-left: 10px; }
}
.card {
  background: var(--surface);
  border: 1px solid var(--hair);
  border-radius: var(--radius);
  padding: 16px;
  min-width: 0;
}
@media (min-width: 860px) { .card { padding: 20px 22px; } }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.lead { margin: 8px 0 14px; font-size: 1rem; }

/* Now stats */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
@media (max-width: 559px) { .stat:last-child { grid-column: span 2; } }
@media (min-width: 560px) { .stats { grid-template-columns: repeat(5, 1fr); } }
.stat { background: var(--raised); border: 1px solid var(--hair); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; }
.stat-k { font: 0.7rem/1.4 var(--mono); color: var(--ink-2); text-transform: uppercase; letter-spacing: 0.06em; }
.stat-v { font-size: 1.15rem; font-weight: 650; }
.stat-v small { font-size: 0.75rem; font-weight: 500; color: var(--ink-2); }
.official { margin: 0; padding-left: 18px; }
.official li { margin: 4px 0; }
.links { font-size: 0.88rem; margin: 12px 0 0; }

/* Map */
.seg { display: inline-flex; background: var(--raised); border: 1px solid var(--hair); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button {
  border: 0; background: none; color: var(--ink-2); font: inherit; font-size: 0.85rem; font-weight: 600;
  padding: 8px 12px; border-radius: 8px; cursor: pointer; min-height: 36px;
}
.seg button[aria-selected="true"] { background: var(--accent); color: #08080A; }
.map-frame { margin: 12px -16px 0; height: 62vh; min-height: 360px; max-height: 620px; background: #0b1d2a; }
@media (min-width: 860px) { .map-frame { margin: 14px 0 0; border-radius: 10px; overflow: hidden; height: 520px; } }
.map-frame iframe { width: 100%; height: 100%; border: 0; display: block; }

/* Meters */
.meters { display: flex; flex-direction: column; gap: 12px; }
.meter-top { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.meter-label { font-size: 0.9rem; }
.meter-val { font-family: var(--mono); font-weight: 500; color: var(--accent); font-variant-numeric: tabular-nums; white-space: nowrap; }
.meter-sub { font-size: 0.78rem; color: var(--ink-2); }
.track { position: relative; height: 8px; background: var(--raised); border: 1px solid var(--hair); border-radius: 999px; margin-top: 5px; overflow: hidden; }
.fill { position: absolute; top: 0; bottom: 0; left: 0; background: var(--accent); border-radius: 999px; transition: width 0.6s ease; }
.band { position: absolute; top: -1px; bottom: -1px; background: var(--accent-soft); border: 1px solid var(--accent); border-radius: 999px; }

/* Money */
.hero { display: flex; flex-direction: column; margin: 10px 0 14px; }
.hero-k { font: 0.72rem/1.4 var(--mono); text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-2); }
.hero-v { font-size: 2.6rem; font-weight: 700; letter-spacing: -0.04em; line-height: 1.1; color: var(--ink); }
.hero-s { color: var(--ink-2); font-size: 0.9rem; }

/* Tables */
.scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tbl { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.tbl th { text-align: left; font: 500 0.7rem/1.3 var(--mono); text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-2); padding: 6px 8px 6px 0; border-bottom: 1px solid var(--hair); }
.tbl td { padding: 9px 8px 9px 0; border-bottom: 1px solid var(--hair); vertical-align: top; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .num { font-family: var(--mono); text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; padding-right: 0; padding-left: 8px; }

/* Chart */
.chart { position: relative; width: 100%; height: 240px; touch-action: pan-y; }
.chart svg { width: 100%; height: 100%; display: block; overflow: visible; }
.chart .grid-line { stroke: var(--hair); stroke-width: 1; }
.chart .axis-line { stroke: var(--axis); stroke-width: 1; }
.chart .tick { fill: var(--ink-2); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .win { fill: var(--window); }
.chart .win-label { fill: var(--ink-2); font-size: 11px; font-weight: 600; }
.chart .ref { stroke: var(--warn); stroke-width: 1.5; stroke-dasharray: 4 3; }
.chart .ref-label { fill: var(--ink-2); font-size: 11px; }
.chart .whisker { stroke: var(--accent); stroke-width: 2; stroke-linecap: round; }
.chart .pt { fill: var(--accent); stroke: var(--surface); stroke-width: 2; }
.chart .hit { fill: transparent; cursor: pointer; }
.chart g.on .pt { r: 7; }
.chart g.on .whisker { stroke-width: 3; }
.tooltip {
  position: fixed; z-index: 20; pointer-events: none;
  background: var(--surface); color: var(--ink); border: 1px solid var(--hair);
  box-shadow: 0 4px 14px rgba(0,0,0,0.15); border-radius: 8px; padding: 8px 10px; font-size: 0.82rem; max-width: 220px;
}
.tooltip strong { font-size: 0.95rem; }
details { margin-top: 8px; font-size: 0.88rem; }
summary { cursor: pointer; color: var(--accent); padding: 6px 0; }

/* News */
.news { list-style: none; margin: 10px 0 0; padding: 0; }
.news li { border-bottom: 1px solid var(--hair); }
.news li:last-child { border-bottom: 0; }
.news a { display: block; padding: 12px 0; text-decoration: none; color: var(--ink); }
.news a:hover .n-title { text-decoration: underline; }
.n-title { font-weight: 600; display: block; }
.n-meta { font: 0.72rem/1.4 var(--mono); color: var(--ink-2); }
.n-new { display: inline-block; font: 600 0.64rem/1.5 var(--mono); color: #08080A; background: var(--accent); border-radius: 4px; padding: 0 5px; margin-right: 6px; vertical-align: 1px; }
@media (min-width: 860px) {
  .news { display: grid; grid-template-columns: 1fr 1fr; column-gap: 24px; }
}

.foot { color: var(--ink-2); font-size: 0.8rem; padding-top: 6px; padding-bottom: 32px; }
.foot-brand { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; border-top: 1px solid var(--hair); padding-top: 18px; margin-bottom: 14px; font-family: var(--mono); }
.foot-brand a { color: var(--accent); text-decoration: none; }
.foot-brand .wa { color: var(--ink-2); }
.foot-cta { background: var(--surface); border: 1px solid var(--hair); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; }
.foot-cta h2 { font-size: 1.35rem; letter-spacing: -0.03em; color: var(--ink); }
.foot-cta h2 span { color: var(--ink-2); }
.foot-cta p { margin: 6px 0 12px; color: var(--ink-2); font-size: 0.9rem; }
.btn { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 10px 18px; border-radius: 999px; background: var(--accent); color: #08080A; font-weight: 600; text-decoration: none; }
.btn.ghost { background: none; color: var(--ink); border: 1px solid var(--axis); margin-left: 8px; }
