:root {
  --bg: #060b14;
  --bg2: #0b1422;
  --ink: #e8eef7;
  --ink2: #9fb0c6;
  --ink3: #62748c;
  --line: rgba(160, 190, 230, .14);
  --glass: rgba(10, 18, 32, .72);
  --accent: #5fd3e8;
  --warm: #ffb36b;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: "Pretendard Variable", Pretendard, -apple-system, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  font-size: 16px; line-height: 1.6; -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; }
.eyebrow { font: 600 12px/1 var(--mono); letter-spacing: .14em; color: var(--accent); margin: 0 0 14px; }
h1, h2, h3 { letter-spacing: -.02em; line-height: 1.2; margin: 0; }

/* ── header ─────────────────────────────── */
.top {
  position: fixed; inset: 0 0 auto 0; z-index: 20; height: 60px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; background: linear-gradient(var(--bg) 0%, rgba(6,11,20,.0) 100%);
  pointer-events: none;
}
.top > * { pointer-events: auto; }
.brand { display: flex; gap: 10px; align-items: center; text-decoration: none; font-weight: 700; }
.brand svg { width: 30px; height: 30px; fill: none; stroke: var(--accent); stroke-width: 2.2; stroke-linecap: round; }
.brand svg circle { fill: var(--warm); stroke: none; }
.brand small { display: block; font: 500 10px/1 var(--mono); color: var(--ink3); letter-spacing: .1em; margin-top: 3px; }
.top nav { display: flex; gap: 4px; }
.top nav a { text-decoration: none; font-size: 14px; color: var(--ink2); padding: 6px 12px; border-radius: 99px; }
.top nav a:hover { color: var(--ink); background: rgba(255,255,255,.06); }

/* ── hero map ───────────────────────────── */
.hero { position: relative; height: 100vh; height: 100svh; min-height: 620px; overflow: hidden; }
#map { position: absolute; inset: 0; }
.hero::after { /* 왼쪽 글 뒤를 어둡게 */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, rgba(6,11,20,.92) 0%, rgba(6,11,20,.55) 30%, rgba(6,11,20,0) 55%),
              linear-gradient(0deg, var(--bg) 0%, rgba(6,11,20,0) 18%);
}
.hero-copy { position: absolute; z-index: 5; left: 48px; top: 50%; transform: translateY(-50%); max-width: 420px; }
.hero-copy h1 { font-size: clamp(38px, 5vw, 60px); font-weight: 800; }
.lede { color: var(--ink2); font-size: 17px; margin: 16px 0 26px; }
.lede b { color: var(--ink); font-family: var(--mono); }
.var-tabs { display: inline-flex; background: rgba(255,255,255,.05); border: 1px solid var(--line); border-radius: 99px; padding: 4px; gap: 2px; }
.var-tabs button {
  all: unset; cursor: pointer; font-size: 14px; font-weight: 600; color: var(--ink2);
  padding: 7px 16px; border-radius: 99px; transition: .2s;
}
.var-tabs button.on { background: var(--ink); color: var(--bg); }
.var-tabs button:not(.on):hover { color: var(--ink); }
.legend { margin-top: 18px; width: 300px; max-width: 100%; }
.legend .bar { height: 8px; border-radius: 4px; }
.legend .ticks { display: flex; justify-content: space-between; font: 11px var(--mono); color: var(--ink3); margin-top: 6px; }
.legend .ttl { font-size: 12px; color: var(--ink2); margin-bottom: 6px; }

.ticker {
  position: absolute; z-index: 5; left: 48px; right: 48px; bottom: 34px;
  display: flex; gap: 12px; flex-wrap: wrap;
}
.tick {
  background: var(--glass); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--line); border-radius: 14px; padding: 10px 16px; min-width: 150px; cursor: pointer;
}
.tick:hover { border-color: rgba(95,211,232,.5); }
.tick .k { font-size: 12px; color: var(--ink3); }
.tick .v { font: 700 22px/1.2 var(--mono); }
.tick .v small { font-size: 12px; color: var(--ink2); font-weight: 500; margin-left: 2px; }
.tick .s { font-size: 13px; color: var(--ink2); }

.scroll-cue {
  position: absolute; z-index: 5; right: 28px; bottom: 36px; width: 40px; height: 40px;
  border: 1px solid var(--line); border-radius: 50%; display: grid; place-items: center;
  text-decoration: none; color: var(--ink2); animation: bob 2.4s ease-in-out infinite;
}
@keyframes bob { 50% { transform: translateY(6px); } }

/* station popup panel */
.panel {
  position: absolute; z-index: 8; right: 24px; top: 80px; width: 340px; max-height: calc(100% - 180px); overflow: auto;
  background: var(--glass); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--line); border-radius: 18px; padding: 18px 18px 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,.45);
}
.hero.focus .hero-copy, .hero.focus .ticker { opacity: 0; pointer-events: none; }
.hero-copy, .ticker { transition: opacity .3s; }
.panel .x { all: unset; cursor: pointer; position: absolute; right: 14px; top: 10px; font-size: 22px; color: var(--ink3); }
.panel .x:hover { color: var(--ink); }
.p-net { font: 600 11px var(--mono); color: var(--accent); letter-spacing: .08em; margin: 0 0 4px; }
.panel h3 { font-size: 22px; }
.p-vals { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0; }
.p-vals > div { background: rgba(255,255,255,.04); border-radius: 10px; padding: 8px 10px; }
.p-vals .k { font-size: 11px; color: var(--ink3); }
.p-vals .v { font: 600 16px var(--mono); }
.p-vals .v small { font-size: 10px; color: var(--ink2); }
.spark { margin-top: 8px; }
.spark .k { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink2); }
.spark .k span:last-child { font-family: var(--mono); color: var(--ink3); }
.spark svg { width: 100%; height: 54px; display: block; }

/* maplibre tweaks */
.maplibregl-ctrl-attrib { background: rgba(6,11,20,.6) !important; color: var(--ink3) !important; font-size: 10px; }
.maplibregl-ctrl-attrib a { color: var(--ink3) !important; }
.maplibregl-ctrl-group { background: var(--glass) !important; border: 1px solid var(--line); }
.maplibregl-ctrl-group button span { filter: invert(1); }
.maplibregl-popup-content { background: var(--glass); color: var(--ink); border-radius: 10px; padding: 6px 10px; font-size: 13px; border: 1px solid var(--line); }
.maplibregl-popup-tip { display: none; }

/* ── site cards ─────────────────────────── */
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.sites { padding: 110px 0 60px; }
.sites h2, .family h2, .about h2 { font-size: clamp(28px, 3.4vw, 42px); font-weight: 800; }
.sub { color: var(--ink2); font-size: 17px; margin: 14px 0 44px; max-width: 640px; }
.cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
.card {
  position: relative; display: block; text-decoration: none; border-radius: 22px; overflow: hidden;
  background: var(--bg2); border: 1px solid var(--line); transition: transform .35s cubic-bezier(.2,.8,.2,1), border-color .3s;
}
.card:hover { transform: translateY(-4px); border-color: rgba(95,211,232,.45); }
.card .thumb { aspect-ratio: 16 / 9; background: #0a1220 center / cover no-repeat; position: relative; }
.card .thumb::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, var(--bg2) 0%, rgba(11,20,34,0) 45%); }
.card .thumb .soon {
  position: absolute; inset: 0; display: grid; place-items: center; z-index: 1;
  font: 600 12px var(--mono); color: var(--ink3); letter-spacing: .12em;
}
.card .body { padding: 4px 24px 24px; position: relative; margin-top: -40px; z-index: 2; }
.card .scale { font: 600 11px var(--mono); color: var(--warm); letter-spacing: .12em; }
.card h3 { font-size: 26px; margin: 6px 0 8px; }
.card p { color: var(--ink2); margin: 0 0 14px; font-size: 15px; }
.card .tags { display: flex; gap: 6px; flex-wrap: wrap; }
.card .tags span { font-size: 12px; color: var(--ink2); border: 1px solid var(--line); border-radius: 99px; padding: 2px 10px; }
.card .go { position: absolute; right: 22px; top: 12px; font-size: 20px; color: var(--accent); transition: transform .3s; }
.card:hover .go { transform: translateX(4px); }

.family { padding: 60px 0; }
.links { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-top: 28px; }
.links a { text-decoration: none; border: 1px solid var(--line); border-radius: 16px; padding: 18px 20px; background: rgba(255,255,255,.02); }
.links a:hover { border-color: rgba(95,211,232,.45); }
.links b { display: block; font-size: 17px; }
.links span { color: var(--ink2); font-size: 14px; }

.about { padding: 60px 0 90px; border-top: 1px solid var(--line); margin-top: 40px; }
.two { display: grid; grid-template-columns: 1.2fr 1fr; gap: 60px; }
.about p { color: var(--ink2); }
.src { color: var(--ink2); padding-left: 18px; font-size: 14px; }
.credit { font-size: 13px; color: var(--ink3) !important; margin-top: 24px; }

/* ── mobile ─────────────────────────────── */
@media (min-width: 821px) { .hero.focus .hero-copy, .hero.focus .ticker { opacity: 1; pointer-events: auto; } }
@media (max-width: 820px) {
  .top { padding: 0 16px; }
  .top nav a:not(:first-child) { display: none; }
  .hero { min-height: 700px; }
  .hero::after { background: linear-gradient(180deg, rgba(6,11,20,.92) 0%, rgba(6,11,20,.4) 42%, rgba(6,11,20,0) 60%),
                               linear-gradient(0deg, var(--bg) 0%, rgba(6,11,20,0) 30%); }
  .hero-copy { left: 16px; right: 16px; top: 76px; transform: none; max-width: none; }
  .hero-copy h1 { font-size: 34px; }
  .lede { font-size: 15px; margin: 10px 0 16px; }
  .legend { width: 100%; }
  .ticker { left: 16px; right: 16px; bottom: 20px; gap: 8px; display: grid; grid-template-columns: 1fr 1fr; }
  .tick { min-width: 0; padding: 8px 12px; }
  .tick .v { font-size: 18px; }
  .scroll-cue { display: none; }
  .panel { left: 12px; right: 12px; width: auto; top: auto; bottom: 12px; max-height: 60%; }
  .cards, .links, .two { grid-template-columns: 1fr; gap: 18px; }
  .sites { padding-top: 70px; }
  .wrap { padding: 0 16px; }
}
/* 카드가 홀수 개면 마지막 카드는 가로로 편다 */
@media (min-width: 821px) {
  .card:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .card:last-child:nth-child(odd) .thumb { aspect-ratio: 21 / 7; }
}
.hero-copy h1 { font-size: clamp(34px, 3.8vw, 50px); }
@media (max-width: 820px) { .hero-copy h1 { font-size: 30px; } }
.card.wait { opacity: .6; }
.card.wait:hover { transform: none; border-color: var(--line); }
/* 한글 라벨은 고정폭·넓은 자간이 어색하다 */
.card .scale, .eyebrow { font-family: "Pretendard Variable", Pretendard, sans-serif; letter-spacing: .04em; font-weight: 700; }
