:root {
  --bg: #070b12;
  --bg2: #0b111b;
  --land: #10151d;
  --glass: rgba(10, 15, 24, 0.74);
  --glass-2: rgba(18, 25, 38, 0.82);
  --line: rgba(255, 255, 255, 0.09);
  --line-2: rgba(255, 255, 255, 0.16);
  --text: #eef1f5;
  --text-2: #b6bfcc;
  --muted: #7f8a99;
  --accent: #f4d58d;      /* moonlight: crest line, moon */
  --blue: #3987e5;        /* atlas prediction */
  --orange: #d95926;      /* gauge harmonic prediction */
  --aqua: #199e70;        /* residual */
  --obs: #d9d6cc;         /* observations */
  --violet: #9085e9;
  --radius: 14px;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font-family: "Pretendard Variable", Pretendard, -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  font-size: 15px; line-height: 1.55; -webkit-font-smoothing: antialiased; overflow-x: hidden; word-break: keep-all; overflow-wrap: anywhere; }
.mono { font-family: var(--mono); font-feature-settings: "tnum"; }
b { font-weight: 650; color: #fff; }
a { color: #8fc1ff; }
button, select, input { font: inherit; color: inherit; }
#errbar { position: fixed; z-index: 99; top: 0; left: 0; right: 0; background: #b3261e; color: #fff; padding: 6px 12px; font: 12px var(--mono); white-space: pre-wrap; }

/* ------------------------------------------------------------------ hero */
#hero { position: relative; height: 100vh; height: 100svh; min-height: 560px; overflow: hidden; background: var(--bg); }
#map { position: absolute; inset: 0; }
#particles { position: absolute; inset: 0; pointer-events: none; z-index: 1; }
.maplibregl-canvas { outline: none; }
.maplibregl-ctrl-attrib { background: rgba(7, 11, 18, 0.6) !important; color: var(--muted) !important; font-size: 10px; }
.maplibregl-ctrl-attrib a { color: var(--text-2) !important; }
.maplibregl-ctrl-group { background: var(--glass) !important; border: 1px solid var(--line); box-shadow: none !important; }
.maplibregl-ctrl-group button { width: 32px; height: 32px; }
.maplibregl-ctrl-group button + button { border-top: 1px solid var(--line) !important; }
.maplibregl-ctrl button .maplibregl-ctrl-icon { filter: invert(1) opacity(.8); }

.glass { position: absolute; z-index: 5; background: var(--glass); border: 1px solid var(--line);
  border-radius: var(--radius); backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35); }

.brand { top: 16px; left: 16px; width: 380px; padding: 14px 16px 12px; }
.brand-row { display: flex; gap: 12px; align-items: center; }
.brand-mark { width: 40px; height: 40px; flex: none; }
.brand-mark path { fill: none; stroke: #5fa8ff; stroke-width: 5; stroke-linecap: round; }
.brand-mark circle { fill: var(--accent); }
.brand h1 { margin: 0; font-size: 22px; letter-spacing: -0.02em; font-weight: 750; }
.brand .sub { margin: 1px 0 0; font-size: 12px; color: var(--text-2); }
.lede { margin: 10px 0 0; font-size: 13px; color: var(--text-2); line-height: 1.6; }
.lede .hint { color: var(--accent); }

.layers { top: 16px; right: 16px; width: 300px; padding: 12px; transition: opacity .2s; }
body.panel-open .layers { opacity: 0; pointer-events: none; }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.seg button { border: 1px solid var(--line); background: rgba(255, 255, 255, 0.03); border-radius: 9px;
  padding: 7px 4px; font-size: 12.5px; cursor: pointer; color: var(--text-2); transition: all .15s; white-space: nowrap; }
.seg button:hover { color: var(--text); border-color: var(--line-2); }
.seg button.on { background: rgba(95, 168, 255, 0.16); border-color: rgba(95, 168, 255, 0.55); color: #fff; }
.toggles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px 6px; margin: 10px 2px 4px; }
.toggles label { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-2); cursor: pointer; padding: 3px 0; }
.toggles input { accent-color: #5fa8ff; width: 14px; height: 14px; margin: 0; }
.toggles label.dis { opacity: .35; pointer-events: none; }
.legend { margin-top: 8px; }
.legend .ltitle { font-size: 12px; color: var(--text-2); display: flex; justify-content: space-between; margin-bottom: 5px; }
.legend .ltitle span:last-child { color: var(--muted); }
.legend .bar { height: 10px; border-radius: 5px; position: relative; }
.legend .ticks { position: relative; height: 16px; font: 10.5px var(--mono); color: var(--muted); }
.legend .ticks span { position: absolute; transform: translateX(-50%); top: 3px; white-space: nowrap; }
.legend .ticks span:first-child { transform: translateX(-2px); }
.legend .ticks span:last-child { transform: translateX(calc(-100% + 2px)); }
.legend .ticks span:first-child::before { left: 2px; }
.legend .ticks span:last-child::before { left: calc(100% - 2px); }
.legend .ticks span::before { content: ""; position: absolute; left: 50%; top: -5px; width: 1px; height: 4px; background: var(--muted); }
.legend .cats { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 10px; font-size: 11.5px; color: var(--text-2); }
.legend .cats i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.modenote { margin: 8px 2px 0; font-size: 11.5px; color: var(--muted); line-height: 1.5; }

.timebar { left: 50%; transform: translateX(-50%); bottom: 18px; display: flex; align-items: center; gap: 16px;
  padding: 10px 16px; width: min(980px, calc(100% - 32px)); }
.play { width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line-2); background: rgba(95, 168, 255, 0.18); cursor: pointer; flex: none; display: grid; place-items: center; }
.play svg { width: 20px; height: 20px; fill: #fff; }
.clock { min-width: 128px; }
.clock-date { font-size: 11.5px; color: var(--text-2); white-space: nowrap; }
.clock-time { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; }
.clock-time small { font-size: 11px; color: var(--muted); font-weight: 400; margin-left: 4px; }
.moon { display: flex; align-items: center; gap: 8px; min-width: 128px; }
.moon svg { width: 30px; height: 30px; flex: none; }
.moon-dark { fill: #1c2433; stroke: rgba(255, 255, 255, .15); stroke-width: .6; }
.moon-lit { fill: var(--accent); }
.moon-name { font-size: 12px; white-space: nowrap; }
.moon-age { font-size: 11px; color: var(--muted); white-space: nowrap; }
.scrub { flex: 1; min-width: 120px; }
.scrub input { width: 100%; accent-color: var(--accent); margin: 0; }
.scrub-labels { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--muted); margin-top: 2px; }
.scrub-labels #scrubNow { color: var(--text-2); }
.speed { display: flex; gap: 6px; align-items: center; }
select, .ghost { background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line); border-radius: 8px; padding: 5px 8px; font-size: 12.5px; cursor: pointer; }
select option { background: #111824; }
.ghost:hover { border-color: var(--line-2); }
.probe { font-size: 11.5px; color: var(--text-2); min-width: 108px; text-align: right; line-height: 1.35; }
.probe b { font-size: 15px; color: #fff; font-weight: 600; }

.panel { top: 16px; right: 16px; bottom: 96px; width: 440px; padding: 16px 16px 20px; overflow-y: auto; z-index: 7;
  background: var(--glass-2); scrollbar-width: thin; scrollbar-color: #2a3446 transparent; }
.panel .close { position: sticky; top: 0; float: right; margin: -6px -6px 0 0; width: 30px; height: 30px; border-radius: 50%;
  border: 1px solid var(--line); background: rgba(0, 0, 0, .3); font-size: 18px; line-height: 1; cursor: pointer; z-index: 2; }
.panel h2 { font-size: 19px; margin: 0 0 2px; letter-spacing: -0.01em; }
.panel .coords { font-size: 12px; color: var(--muted); font-feature-settings: "tnum"; }
.panel h3 { font-size: 13px; margin: 18px 0 8px; color: var(--text-2); font-weight: 600; letter-spacing: .01em; }
.kv { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 12px; }
.kv > div { background: rgba(255, 255, 255, .035); border: 1px solid var(--line); border-radius: 10px; padding: 7px 9px; }
.kv .k { font-size: 11px; color: var(--muted); }
.kv .v { font: 600 16px var(--mono); margin-top: 1px; white-space: nowrap; }
.kv .v small { font-size: 11px; color: var(--muted); font-weight: 400; margin-left: 2px; }
.kv .s { font-size: 11px; color: var(--text-2); }
.srcswitch { display: flex; gap: 4px; margin-top: 12px; flex-wrap: wrap; }
.srcswitch button { border: 1px solid var(--line); background: rgba(255,255,255,.03); border-radius: 999px; padding: 4px 11px; font-size: 12px; color: var(--text-2); cursor: pointer; }
.srcswitch button.on { border-color: rgba(95,168,255,.6); background: rgba(95,168,255,.16); color: #fff; }
.srcswitch .note { font-size: 11.5px; color: var(--muted); align-self: center; margin-left: 4px; }
.daterow { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 10px; font-size: 12px; color: var(--text-2); }
.daterow input[type=date] { background: rgba(255,255,255,.05); border: 1px solid var(--line); border-radius: 8px; padding: 4px 6px; font-size: 12px; color-scheme: dark; }
.chart { position: relative; margin-top: 8px; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart .axis text { fill: var(--muted); font: 10.5px var(--mono); }
.chart .axis text.lab { font: 11.5px "Pretendard Variable", Pretendard, sans-serif; fill: var(--text-2); }
.chart .axis line, .chart .grid line { stroke: rgba(255, 255, 255, .07); }
.chart .zero { stroke: rgba(255, 255, 255, .22); }
.chart .daysep { stroke: rgba(255, 255, 255, .10); stroke-dasharray: 2 3; }
.chart .nowline { stroke: var(--accent); stroke-width: 1.2; }
.chart .hover-line { stroke: rgba(255, 255, 255, .45); stroke-width: 1; }
.chart .cap { font-size: 11px; color: var(--muted); display: flex; gap: 12px; flex-wrap: wrap; margin-top: 4px; }
.chart .cap i { display: inline-block; width: 14px; height: 2px; vertical-align: 3px; margin-right: 5px; border-radius: 1px; }
.ctip { position: absolute; pointer-events: none; background: rgba(8, 12, 20, .94); border: 1px solid var(--line-2); border-radius: 8px;
  padding: 6px 8px; font-size: 11.5px; white-space: nowrap; z-index: 3; transform: translate(-50%, -100%); }
.ctip .t { color: var(--muted); font: 10.5px var(--mono); }
.ctip .r { display: flex; gap: 6px; align-items: center; }
.ctip .r i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.ctip .r b { font-family: var(--mono); font-weight: 600; }
.hl { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.hl td { padding: 4px 4px; border-bottom: 1px solid var(--line); }
.hl td.d { color: var(--text-2); white-space: nowrap; width: 88px; vertical-align: top; }
.hl .ev { display: inline-flex; gap: 4px; align-items: baseline; margin: 1px 10px 1px 0; font-family: var(--mono); font-size: 12px; white-space: nowrap; }
.hl .ev .ty { font-family: inherit; font-size: 10.5px; padding: 0 4px; border-radius: 4px; }
.hl .ev.high .ty { background: rgba(95, 168, 255, .2); color: #a9cffc; }
.hl .ev.low .ty { background: rgba(255, 255, 255, .07); color: var(--text-2); }
.hl tr.today td.d { color: var(--accent); }
.sn { margin-top: 6px; }
.sn .snbar { position: relative; height: 26px; border-radius: 8px; overflow: hidden; background: rgba(255,255,255,.03); border: 1px solid var(--line); }
.sn svg { display: block; width: 100%; height: 100%; }
.sn .snlab { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--text-2); margin-top: 5px; gap: 8px; flex-wrap: wrap; }
.ctab { width: 100%; border-collapse: collapse; font: 12px var(--mono); }
.ctab th { font: 600 11px inherit; color: var(--muted); text-align: right; padding: 3px 4px; border-bottom: 1px solid var(--line-2); }
.ctab th:first-child, .ctab td:first-child { text-align: left; }
.ctab td { text-align: right; padding: 3px 4px; border-bottom: 1px solid var(--line); }
.ctab td.w { color: #ffb4a2; }
details summary { cursor: pointer; font-size: 13px; color: var(--text-2); margin-top: 16px; }
.muted { color: var(--muted); }
.badge { display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--text-2); margin-left: 6px; vertical-align: 2px; }
.btn { display: inline-block; border: 1px solid rgba(95,168,255,.55); background: rgba(95,168,255,.14); color: #fff; border-radius: 9px; padding: 6px 12px; font-size: 12.5px; cursor: pointer; }
.btn:hover { background: rgba(95,168,255,.24); }
.warnbox { margin-top: 10px; font-size: 12px; color: #ffd8a8; background: rgba(217, 89, 38, .10); border: 1px solid rgba(217, 89, 38, .35); border-radius: 10px; padding: 8px 10px; }
.tip { position: absolute; z-index: 8; pointer-events: none; background: rgba(8, 12, 20, .92); border: 1px solid var(--line-2);
  border-radius: 8px; padding: 5px 8px; font-size: 12px; transform: translate(12px, -50%); white-space: nowrap; }
.tip .mono { color: var(--text-2); font-size: 11px; }
.scrollcue { position: absolute; left: 16px; bottom: 26px; z-index: 4; font-size: 12px; color: var(--text-2); text-decoration: none;
  background: var(--glass); border: 1px solid var(--line); padding: 6px 12px; border-radius: 999px; }
.scrollcue:hover { color: #fff; }

/* map labels (DOM markers) */
.amlabel { pointer-events: auto; cursor: pointer; display: flex; align-items: center; gap: 6px; transform: translateY(0); }
.amdot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--accent); position: relative; flex: none; background: rgba(7,11,18,.6); }
.amdot::after { content: ""; position: absolute; inset: -8px; border-radius: 50%; border: 1px solid rgba(244, 213, 141, .5); animation: pulse 2.6s ease-out infinite; }
.amdot.minor { width: 10px; height: 10px; border-width: 1.5px; }
.amdot.minor::after { display: none; }
@keyframes pulse { from { transform: scale(.5); opacity: 1; } to { transform: scale(1.6); opacity: 0; } }
.amtext { font-size: 11.5px; color: var(--accent); text-shadow: 0 0 4px #000, 0 0 8px #000; white-space: nowrap; }
.amtext small { color: #d8c79a; opacity: .8; }
.sealabel { font-size: 15px; letter-spacing: .5em; color: rgba(230, 238, 250, .55); text-shadow: 0 0 6px #000; pointer-events: none; font-weight: 500; white-space: nowrap; }
.sealabel.sm { font-size: 11.5px; letter-spacing: .25em; }
.clickmark { width: 18px; height: 18px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 3px rgba(95,168,255,.6); background: rgba(95,168,255,.35); }

/* ------------------------------------------------------------------ story */
#story { background: linear-gradient(180deg, var(--bg) 0%, var(--bg2) 30%, var(--bg) 100%); }
.wrap { max-width: 1160px; margin: 0 auto; padding: 72px 24px 24px; }
.kicker { color: var(--accent); font-size: 12.5px; letter-spacing: .12em; margin: 0 0 6px; }
#story h2 { font-size: 30px; letter-spacing: -0.02em; margin: 0 0 22px; font-weight: 750; }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.card { background: rgba(255,255,255,.025); border: 1px solid var(--line); border-radius: 18px; padding: 18px 20px 20px; }
.card h3 { margin: 14px 0 8px; font-size: 18px; letter-spacing: -0.01em; }
.card p { margin: 0 0 10px; color: var(--text-2); font-size: 14px; }
.card-fig { background: rgba(0,0,0,.25); border-radius: 12px; border: 1px solid var(--line); overflow: hidden; }
.card-fig svg { display: block; width: 100%; height: auto; }
.fact { font-size: 13px !important; color: var(--text) !important; border-left: 2px solid var(--accent); padding-left: 10px; }
.fact .mono { color: var(--accent); }
.flyrow { display: flex; gap: 6px; flex-wrap: wrap; }
.flyrow button { font-size: 12px; border: 1px solid var(--line-2); background: rgba(244,213,141,.08); border-radius: 999px; padding: 4px 10px; cursor: pointer; color: var(--accent); }
.prose { color: var(--text-2); max-width: 880px; margin: 0 0 18px; }
.valgrid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 18px; align-items: start; }
.valfig { margin: 0; background: rgba(255,255,255,.025); border: 1px solid var(--line); border-radius: 18px; padding: 16px; position: relative; }
.valfig figcaption { font-size: 13.5px; color: var(--text); margin-bottom: 6px; }
.legend-inline { font-size: 12px; color: var(--text-2); display: flex; gap: 16px; flex-wrap: wrap; margin-top: 6px; }
.legend-inline i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }
.valsum { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat { background: rgba(255,255,255,.025); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.stat .n { font: 600 26px var(--mono); letter-spacing: -0.02em; }
.stat .n small { font-size: 13px; color: var(--muted); margin-left: 3px; font-weight: 400; }
.stat .l { font-size: 12.5px; color: var(--text-2); line-height: 1.45; }
.tablewrap { margin-top: 18px; overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; }
.vtable { width: 100%; border-collapse: collapse; font-size: 13px; }
.vtable th { position: sticky; top: 0; background: #0f1520; text-align: left; font-weight: 600; font-size: 12px; color: var(--text-2); padding: 8px 10px; cursor: pointer; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
.vtable th span { font-weight: 400; color: var(--muted); font-size: 11px; }
.vtable th.sorted { color: #fff; }
.vtable td { padding: 6px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.vtable td.num { text-align: right; font-family: var(--mono); }
.vtable th.num { text-align: right; }
.vtable tbody tr { cursor: pointer; }
.vtable tbody tr:hover { background: rgba(255,255,255,.03); }
.vtable .sw { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 8px; vertical-align: 0; }
.vtable .code { color: var(--muted); font: 11px var(--mono); margin-left: 6px; }
.method { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; color: var(--text-2); font-size: 14px; }
.method h4 { color: var(--text); margin: 0 0 6px; font-size: 15px; }
.method p { margin: 0 0 18px; }
.method ul { margin: 0; padding-left: 18px; }
.method li { margin-bottom: 8px; }
.foot { padding-top: 32px; padding-bottom: 48px; font-size: 12.5px; color: var(--text-2); border-top: 1px solid var(--line); margin-top: 48px; }
.foot p { margin: 4px 0; }

/* ------------------------------------------------------------------ responsive */
@media (max-width: 1100px) {
  .cards { grid-template-columns: 1fr; max-width: 640px; }
  .valgrid, .method { grid-template-columns: 1fr; }
}
@media (max-width: 980px) {
  .probe { display: none; }
  .brand { width: 330px; }
  .layers { width: 272px; }
}
@media (max-width: 720px) {
  body { font-size: 14px; }
  .brand { top: 10px; left: 10px; right: 10px; width: auto; padding: 10px 12px; }
  .brand-mark { width: 32px; height: 32px; }
  .brand h1 { font-size: 18px; }
  .brand .sub { font-size: 11px; }
  .lede { display: none; }
  .layers { top: auto; bottom: 108px; left: 10px; right: 10px; width: auto; padding: 8px; }
  .seg { grid-template-columns: repeat(6, auto); overflow-x: auto; scrollbar-width: none; }
  .seg::-webkit-scrollbar { display: none; }
  .seg button { font-size: 12px; padding: 6px 8px; }
  .toggles { grid-template-columns: repeat(3, 1fr); margin: 6px 2px 2px; }
  .toggles label { font-size: 11.5px; }
  .modenote { display: none; }
  .legend { margin-top: 4px; }
  .timebar { bottom: 10px; width: calc(100% - 20px); gap: 8px; padding: 8px 10px; flex-wrap: wrap; }
  .play { width: 36px; height: 36px; }
  .clock { min-width: 0; }
  .clock-time { font-size: 18px; }
  .moon { min-width: 0; }
  .moon-age, .moon-name { display: none; }
  .speed select { padding: 5px 4px; }
  .scrub { order: 5; flex-basis: 100%; }
  .scrub-labels { display: none; }
  .speed { margin-left: auto; }
  .panel { top: auto; left: 0; right: 0; bottom: 0; width: auto; max-height: 72svh; border-radius: 18px 18px 0 0; padding: 14px 14px 28px; }
  .scrollcue { display: none; }
  .wrap { padding: 48px 16px 16px; }
  #story h2 { font-size: 24px; }
  .valsum { grid-template-columns: 1fr 1fr; }
  .stat .n { font-size: 21px; }
  .kv .v { font-size: 14px; }
  .maplibregl-ctrl-top-right { display: none; }
}
