:root {
  --bg: #05080d;
  --bg2: #0a111c;
  --panel: rgba(10, 16, 26, 0.78);
  --panel-b: rgba(160, 190, 230, 0.14);
  --ink: #e9eef5;
  --ink2: #a9b8ca;
  --muted: #6d7f95;
  --line: rgba(255, 255, 255, 0.08);
  --hot: #ff6a4d;
  --warm: #ffa15c;
  --cool: #6cc0ff;
  --ice: #dff3ff;
  --gl: #9aa6b6;
  --steps-w: min(420px, 36vw);
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 17px; line-height: 1.72;
  letter-spacing: -0.01em; word-break: keep-all; overflow-x: hidden; -webkit-font-smoothing: antialiased; }
b { font-weight: 700; color: #fff; }
.hot { color: var(--hot) !important; }
.cool { color: var(--cool) !important; }
.mono, .num { font-family: var(--mono); font-feature-settings: "tnum"; letter-spacing: -0.02em; }
a { color: var(--cool); }

#err { position: fixed; z-index: 99; left: 8px; right: 8px; bottom: 8px; background: #5a0d12; color: #fff; padding: 8px 12px;
  border-radius: 8px; font: 12px var(--mono); white-space: pre-wrap; }
.progress { position: fixed; z-index: 50; top: 0; left: 0; right: 0; height: 2px; background: transparent; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, #2171b5, #fc9272, #cb181d); transform-origin: 0 0; transform: scaleX(0); }

/* ---------- TOC ---------- */
.toc { position: fixed; z-index: 40; right: 14px; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; gap: 4px;
  opacity: 0; pointer-events: none; transition: opacity .4s; }
.toc.on { opacity: 1; pointer-events: auto; }
.toc a { display: flex; align-items: center; justify-content: flex-end; gap: 8px; color: var(--muted); text-decoration: none; font-size: 12px; padding: 2px 0; }
.toc a::after { content: attr(data-n); font: 10px var(--mono); width: 26px; height: 20px; display: grid; place-items: center; border-radius: 10px;
  border: 1px solid var(--panel-b); background: rgba(8, 12, 20, .7); }
.toc a span { opacity: 0; transition: opacity .2s; }
.toc a:hover, .toc a.cur { color: var(--ink); }
.toc a.cur::after { background: #fff; color: #000; border-color: #fff; }
.toc a { font-size: 0; }
.toc a:hover { font-size: 12px; }

/* ---------- HERO ---------- */
.hero { position: relative; min-height: 100svh; display: flex; align-items: flex-end; overflow: hidden; }
.hero-stripes { position: absolute; inset: 0; }
.stripes-bg { width: 100%; height: 100%; display: block; }
.hero-shade { position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(5, 8, 13, .15) 0%, rgba(5, 8, 13, .05) 35%, rgba(5, 8, 13, .72) 70%, var(--bg) 100%); }
.hero-inner { position: relative; z-index: 2; width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 28px 13svh; pointer-events: none; }
.hero-inner > * { pointer-events: auto; }
.kicker { font: 600 13px var(--sans); letter-spacing: .14em; color: #fff; opacity: .9; margin: 0 0 6px; text-shadow: 0 1px 12px rgba(0, 0, 0, .6); }
.hero h1 { font-size: clamp(56px, 11vw, 148px); line-height: .95; margin: 0 0 18px; font-weight: 850; letter-spacing: -0.045em;
  text-shadow: 0 4px 40px rgba(0, 0, 0, .55); }
.dek { font-size: clamp(16px, 2vw, 20px); color: #dfe7f1; max-width: 640px; margin: 0 0 28px; text-shadow: 0 1px 14px rgba(0, 0, 0, .7); }
.hero-num { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; padding: 16px 22px; border-radius: 16px; width: fit-content; max-width: 100%;
  background: rgba(5, 8, 13, .62); border: 1px solid var(--panel-b); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.hero-num .big { font: 700 clamp(48px, 7vw, 76px)/1 var(--mono); color: #ff7d5e; letter-spacing: -0.05em; }
.hero-num .big small { font-size: .45em; margin-left: 4px; color: #ffb7a4; }
.hero-num-txt { font-size: 15px; color: var(--ink2); line-height: 1.6; }
.hero-legend { margin: 16px 0 0; font-size: 12.5px; color: var(--ink2); display: flex; align-items: center; gap: 4px 14px; flex-wrap: wrap; text-shadow: 0 1px 8px #000; max-width: 720px; }
.hero-legend .lg-item { display: inline-flex; align-items: center; gap: 6px; color: var(--ink); }
.hero-legend i { display: inline-block; width: 22px; height: 10px; border-radius: 2px; }
.sw-cold { background: linear-gradient(90deg, #08306b, #6baed6); }
.sw-warm { background: linear-gradient(90deg, #fc9272, #67000d); }
.scroll-cue { position: absolute; z-index: 3; bottom: 18px; left: 50%; transform: translateX(-50%); color: var(--ink2); text-decoration: none; font-size: 12px;
  display: flex; flex-direction: column; align-items: center; gap: 2px; }
.scroll-cue span { animation: bob 1.8s ease-in-out infinite; font-size: 16px; }
@keyframes bob { 50% { transform: translateY(5px); } }

/* ---------- chapters ---------- */
.chapter { position: relative; }
.ch-head { max-width: 1180px; margin: 0 auto; padding: 18vh 28px 6vh; }
.ch-no { font: 700 13px var(--mono); color: var(--hot); letter-spacing: .1em; display: inline-block; padding: 2px 10px; border: 1px solid rgba(255, 106, 77, .45); border-radius: 20px; }
.ch-head h2 { font-size: clamp(34px, 5.4vw, 64px); line-height: 1.08; margin: 16px 0 8px; font-weight: 800; letter-spacing: -0.035em; }
.ch-dek { color: var(--ink2); margin: 0; font-size: clamp(16px, 1.8vw, 20px); }

.scrolly { position: relative; display: grid; grid-template-columns: var(--steps-w) 1fr; max-width: 1480px; margin: 0 auto; }
.graphic { grid-column: 2; grid-row: 1; position: sticky; top: 0; height: 100vh; height: 100svh; margin: 0; padding: 56px 36px 40px 12px; display: flex; flex-direction: column; }
.graphic > .fig, .graphic > .panel { flex: 1; min-height: 0; position: relative; }
.graphic figcaption { font-size: 12px; color: var(--muted); padding-top: 10px; margin-top: auto; position: relative; z-index: 2; }
.panel { position: absolute !important; inset: 56px 36px 64px 12px; opacity: 0; visibility: hidden; transition: opacity .6s, visibility .6s; display: flex; flex-direction: column; }
.panel.on { opacity: 1; visibility: visible; }
.panel > .fig { flex: 1; min-height: 0; position: relative; }
.steps { grid-column: 1; grid-row: 1; position: relative; z-index: 3; padding: 0 0 30vh 28px; }
.step { min-height: 92vh; display: flex; align-items: center; padding: 10vh 0; }
.step:first-child { margin-top: 10vh; }
.card { background: var(--panel); border: 1px solid var(--panel-b); border-radius: 16px; padding: 22px 24px; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 10px 40px rgba(0, 0, 0, .35); opacity: .35; transition: opacity .45s, transform .45s; transform: translateY(8px); }
.step.is-active .card { opacity: 1; transform: none; }
.card p { margin: 0 0 12px; }
.card p:last-child { margin-bottom: 0; }
.card .note { font-size: 14px; color: var(--ink2); }
.mini { height: 120px; margin: 6px 0 10px; position: relative; }

/* ---------- maps ---------- */
.mapbox { position: absolute; inset: 0; }
.map-canvas, .map-svg { position: absolute; inset: 0; }
.map-svg { pointer-events: none; overflow: visible; }
.map-canvas { touch-action: pan-y; cursor: crosshair; }
.tip { position: absolute; left: 0; top: 0; z-index: 10; pointer-events: none; background: rgba(6, 10, 17, .94); border: 1px solid var(--panel-b);
  border-radius: 10px; padding: 8px 11px; font-size: 13px; line-height: 1.5; color: var(--ink); white-space: nowrap; box-shadow: 0 6px 20px rgba(0, 0, 0, .4); }
.tip small { color: var(--ink2); }
.tip b.hot { color: var(--hot); }
.legend { position: absolute; right: 8px; top: 4px; z-index: 5; background: rgba(6, 10, 17, .82); border: 1px solid var(--panel-b); border-radius: 10px;
  padding: 8px 12px 6px; font-size: 11.5px; color: var(--ink2); min-width: 210px; pointer-events: none; }
.legend .t { color: var(--ink); font-size: 12px; margin-bottom: 5px; }
.legend .bar { height: 10px; border-radius: 3px; }
.legend .ticks { display: flex; justify-content: space-between; font: 10.5px var(--mono); margin-top: 3px; }
.region-lbl { font: 700 12px var(--sans); fill: #fff; paint-order: stroke; stroke: rgba(0, 0, 0, .8); stroke-width: 3px; }
.region-val { font: 700 13px var(--mono); fill: #ffd1a8; paint-order: stroke; stroke: rgba(0, 0, 0, .85); stroke-width: 3px; }
.region-line { fill: none; stroke: rgba(255, 255, 255, .55); stroke-width: 1; stroke-dasharray: 3 3; }
.hotspot { fill: none; stroke: #fff; stroke-width: 1.5; }
.hotspot-lbl { font: 600 12px var(--sans); fill: #fff; paint-order: stroke; stroke: rgba(0, 0, 0, .85); stroke-width: 3px; }
.sea-lbl { font: 500 12px var(--sans); fill: rgba(220, 232, 245, .75); letter-spacing: .12em; paint-order: stroke; stroke: rgba(0, 0, 0, .55); stroke-width: 2px; }
.player[hidden] { display: none; }
.player { position: absolute; left: 50%; transform: translateX(-50%); top: 8px; z-index: 6; display: flex; align-items: center; gap: 10px;
  background: rgba(6, 10, 17, .85); border: 1px solid var(--panel-b); border-radius: 30px; padding: 6px 14px 6px 6px; width: min(460px, 92%); }
.player .play { width: 34px; height: 34px; border-radius: 50%; border: 0; background: #fff; color: #000; font-size: 13px; cursor: pointer; flex: none; }
.player input { flex: 1; accent-color: var(--hot); min-width: 0; }
.player .yr { font-size: 15px; width: 44px; text-align: right; }
.ice-year { position: absolute; left: 6px; top: 0; z-index: 5; pointer-events: none; }
.ice-year span { font-size: clamp(44px, 6vw, 72px); font-weight: 700; line-height: 1; color: #fff; display: block; letter-spacing: -0.05em; }
.ice-year small { color: var(--ice); font-size: 14px; }
.inset { position: absolute; left: 64px; bottom: 96px; width: min(280px, 38%); height: 190px; border: 1px solid var(--panel-b); border-radius: 10px; overflow: hidden;
  background: #0a111c; z-index: 4; transition: opacity .5s; }
.inset.off { opacity: 0; pointer-events: none; }
.sec-line { stroke: var(--hot); stroke-width: 3; stroke-linecap: round; }
.sec-arrow { fill: var(--hot); }
.sec-lbl { font: 600 11px var(--sans); fill: #fff; paint-order: stroke; stroke: #000; stroke-width: 3px; }
.route-suez { fill: none; stroke: #b9c4d2; stroke-width: 2; stroke-dasharray: 5 4; }
.route-nsr { fill: none; stroke: var(--cool); stroke-width: 3; }
.route-lbl { font: 700 13px var(--sans); paint-order: stroke; stroke: rgba(0, 0, 0, .85); stroke-width: 3.5px; }
.port { fill: #fff; stroke: #000; stroke-width: 1.5; }
.port-lbl { font: 600 12px var(--sans); fill: #fff; paint-order: stroke; stroke: #000; stroke-width: 3px; }
.nsr-path { fill: none; stroke: #ffd35a; stroke-width: 2; stroke-dasharray: 4 3; opacity: .9; }

/* chips */
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 10px; position: relative; z-index: 6; }
.chips button { font: 500 13px var(--sans); color: var(--ink2); background: rgba(255, 255, 255, .05); border: 1px solid var(--panel-b);
  border-radius: 20px; padding: 4px 12px; cursor: pointer; }
.chips button[aria-pressed="true"] { background: #fff; color: #000; border-color: #fff; }

/* ---------- charts ---------- */
svg.chart { display: block; overflow: visible; }
.axis text { fill: var(--ink2); font: 11px var(--mono); }
.axis line { stroke: #fff; }
.unit { fill: var(--ink2); font: 12px var(--sans); }
.line-glob { fill: none; stroke: var(--gl); stroke-width: 2.2; }
.lbl-glob { fill: var(--gl); font: 600 12px var(--sans); paint-order: stroke; stroke: var(--bg); stroke-width: 3px; }
.line-trend { stroke: #fff; stroke-width: 1.6; stroke-dasharray: 6 5; opacity: .85; }
.lbl-trend { fill: #fff; font: 600 12px var(--sans); }
.lbl-rec { fill: #fff; font: 700 12px var(--mono); paint-order: stroke; stroke: var(--bg); stroke-width: 3px; }
.mhw-area { fill: var(--hot); opacity: .75; }
.l-clim { fill: none; stroke: #7f8fa3; stroke-width: 1.6; }
.l-thr { fill: none; stroke: var(--warm); stroke-width: 1.6; stroke-dasharray: 5 4; }
.l-sst { fill: none; stroke: #fff; stroke-width: 2; }
.l-clim-t { fill: #9fb0c3; font: 12px var(--sans); }
.key text { fill: var(--ink2); font: 12px var(--sans); }
.l-thr-t { fill: var(--warm); font: 12px var(--sans); }
.strip-lbl { fill: var(--ink2); font: 11px var(--sans); }
.hdot { fill: #fff; stroke: #000; stroke-width: 1.5; }
.vline { stroke: rgba(255, 255, 255, .35); stroke-width: 1; }
.ref-line { stroke: #fff; stroke-dasharray: 4 4; stroke-width: 1.3; opacity: .8; }
.ref-lbl { fill: #fff; font: 600 12px var(--sans); paint-order: stroke; stroke: var(--bg); stroke-width: 3px; }
.kr-raw { fill: none; stroke: var(--cool); stroke-width: 1; opacity: .35; }
.kr-sm { fill: none; stroke: var(--cool); stroke-width: 2.6; }
.gl-raw { fill: none; stroke: var(--gl); stroke-width: 1; opacity: .3; }
.gl-sm { fill: none; stroke: var(--gl); stroke-width: 2.2; }
.lbl-kr { fill: var(--cool); font: 600 13px var(--sans); }
.lbl-gl { fill: var(--gl); font: 600 13px var(--sans); }
.seg { stroke-width: 2.2; stroke-dasharray: 6 4; }
.seg-kr { stroke: #cfeaff; } .seg-gl { stroke: #e3e7ec; }
.seg-lbl { font: 700 12px var(--mono); paint-order: stroke; stroke: var(--bg); stroke-width: 3px; }
.seg-lbl-kr { fill: #cfeaff; } .seg-lbl-gl { fill: #e3e7ec; }
.q-raw { fill: none; stroke: var(--cool); stroke-width: .6; opacity: .22; }
.q-sm { fill: none; stroke: var(--cool); stroke-width: 2.4; }
.sw { stroke: var(--warm); stroke-dasharray: 4 4; }
.sw-l { fill: var(--warm); font: 12px var(--sans); }
.yr { fill: none; stroke-width: 1.1; opacity: .75; }
.clim-band { fill: rgba(108, 192, 255, .14); }
.clim-line { fill: none; stroke: #fff; stroke-width: 2.6; }
.clim-lbl { fill: #fff; font: 700 12px var(--sans); paint-order: stroke; stroke: var(--bg); stroke-width: 3px; }
.yr-lbl { fill: var(--ink2); font: 11px var(--sans); }
.ice-area { fill: rgba(159, 210, 255, .12); }
.ice-line { fill: none; stroke: var(--ice); stroke-width: 2; }
.pt { fill: var(--ice); }
.pt.prelim { fill: var(--bg); stroke: var(--ice); stroke-width: 1.5; }
.ice-tr { stroke: var(--warm); }
.hl-dot { fill: none; stroke: var(--hot); stroke-width: 2; }
.cal-canvas { position: absolute; inset: 0; }
#lg-cal { top: auto; bottom: 0; }

/* ---------- end ---------- */
.end .ch-head { padding-bottom: 4vh; }
.tiles { max-width: 1180px; margin: 0 auto; padding: 0 28px; display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.tile { background: linear-gradient(180deg, rgba(20, 30, 46, .7), rgba(10, 16, 26, .7)); border: 1px solid var(--panel-b); border-radius: 16px; padding: 18px 20px; }
.tile .v { font: 700 38px/1.1 var(--mono); letter-spacing: -0.04em; }
.tile .v small { font-size: 16px; color: var(--ink2); margin-left: 3px; }
.tile .l { color: var(--ink2); font-size: 14.5px; margin-top: 6px; line-height: 1.55; }
.tile .s { font-size: 12px; color: var(--muted); margin-top: 8px; }
.about { max-width: 900px; margin: 9vh auto 0; padding: 0 28px; }
.about details { border-top: 1px solid var(--line); padding: 14px 0; }
.about summary { cursor: pointer; font-weight: 700; font-size: 18px; list-style: none; }
.about summary::-webkit-details-marker { display: none; }
.about summary::before { content: "+"; display: inline-block; width: 22px; color: var(--hot); font-family: var(--mono); }
.about details[open] summary::before { content: "−"; }
.about summary small { color: var(--muted); font-weight: 400; font-size: 13px; margin-left: 6px; }
.about ul { padding-left: 20px; color: var(--ink2); font-size: 15px; }
.about li { margin: 8px 0; }
footer { max-width: 900px; margin: 6vh auto 0; padding: 26px 28px 60px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
footer p { margin: 4px 0; }

/* ---------- mobile ---------- */
@media (max-width: 820px) {
  body { font-size: 16px; }
  .br-d { display: none; }
  .toc { display: none; }
  .hero-inner { padding: 0 18px 12svh; }
  .hero-num { padding: 12px 16px; gap: 12px; }
  .hero-num-txt { font-size: 13.5px; }
  .kicker { letter-spacing: .04em; font-size: 12px; }
  .hero-legend .lg-txt { flex-basis: 100%; }
  .ch-head { padding: 14vh 18px 4vh; }
  .scrolly { display: block; }
  .graphic { height: 100svh; padding: 50px 10px 0; }
  .graphic > .fig { flex: none; height: 60svh; }
  .graphic figcaption { font-size: 11px; padding: 6px 4px 0; }
  .panel { inset: 50px 10px auto 10px; height: 60svh; }
  .steps { margin-top: -100svh; padding: 0 12px 20svh; pointer-events: none; }
  .step { min-height: 100svh; align-items: flex-end; padding: 0 0 5svh; }
  .step:first-child { margin-top: 0; }
  .card { pointer-events: auto; padding: 16px 18px; font-size: 15.5px; background: rgba(8, 13, 21, .9); opacity: 1; transform: none; }
  .legend { min-width: 160px; right: 4px; padding: 6px 9px 5px; font-size: 10.5px; }
  #lg-ice { top: auto; bottom: 4px; }
  .ice-year small { font-size: 12px; }
  .player { bottom: auto; top: calc(60svh + 16px); }
  #p-ice-map .player { top: auto; bottom: -46px; }
  .inset { left: 44px; bottom: auto; top: calc(60svh - 128px); width: 42%; height: 112px; }
  .ice-year span { font-size: 40px; }
  .tiles { padding: 0 18px; }
  .tile .v { font-size: 32px; }
  .about { padding: 0 18px; }
}
