/* SpreadAtlas — radar navy, one signature element (the Spread Line). */
@font-face { font-family: "Archivo"; src: url("/assets/fonts/archivo.woff2") format("woff2-variations"), url("/assets/fonts/archivo.woff2") format("woff2"); font-weight: 100 900; font-stretch: 62% 125%; font-display: swap; }
:root {
  --bg: #0e1729; --surface: #142038; --surface-2: #192842; --line: #2b3b5e; --grid: #22324f;
  --text: #e8eef8; --text-2: #b4c0d6; --muted: #8d9ab4;
  --blue: #3b97ff; --yellow: #ffd21e; --red: #ff3b4a;
  --up: #34c77b; --down: #ff6470; --focus: #ffd21e;
  --font: "Archivo", "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", system-ui, sans-serif;
  --font-ko: "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", "Archivo", system-ui, sans-serif;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root { --bg: #f3f5f9; --surface: #ffffff; --surface-2: #eef2f8; --line: #d3dae6; --grid: #e2e7f0;
    --text: #101b31; --text-2: #34425e; --muted: #56647f; --blue: #0a66d1; --yellow: #a87e00; --red: #d11f2f;
    --up: #13824b; --down: #c8283a; --focus: #0a66d1; color-scheme: light; }
}
html[lang="ko"] { --up: #ff6470; --down: #4aa3ff; }
@media (prefers-color-scheme: light) { html[lang="ko"] { --up: #c8283a; --down: #0a66d1; } }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 17px/1.6 var(--font); font-variant-numeric: tabular-nums; }
html[lang="ko"] body { font-family: var(--font-ko); word-break: keep-all; line-height: 1.75; }
a { color: var(--blue); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 3px; }
img, svg { max-width: 100%; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.measure { max-width: 70ch; }
.skip { position: absolute; left: -9999px; } .skip:focus { left: 16px; top: 12px; background: var(--surface); padding: 8px 12px; z-index: 9; }

/* header */
.top { border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; gap: 24px; min-height: 64px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 700; font-stretch: 115%; font-size: 20px; letter-spacing: -0.01em; }
.brand svg { width: 30px; height: 30px; flex: none; }
.brand b { color: var(--red); font-weight: 700; }
.nav { display: flex; gap: 20px; flex-wrap: wrap; margin-left: auto; align-items: center; }
.nav a { color: var(--text-2); text-decoration: none; font-weight: 500; padding: 6px 0; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); text-decoration: underline; text-underline-offset: 6px; }
.nav .lang { border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; font-size: 15px; }
@media (max-width: 640px) { .top .wrap { gap: 8px 16px; padding-top: 10px; padding-bottom: 10px; } .nav { margin-left: 0; gap: 14px; font-size: 15px; } }

/* type */
h1, h2, h3 { line-height: 1.15; letter-spacing: -0.015em; margin: 0 0 0.5em; }
h1 { font-size: clamp(34px, 6vw, 60px); font-weight: 700; font-stretch: 118%; }
h2 { font-size: clamp(24px, 3.4vw, 32px); font-weight: 650; font-stretch: 112%; margin-top: 1.8em; }
h3 { font-size: 20px; font-weight: 650; margin-top: 1.5em; }
html[lang="ko"] h1, html[lang="ko"] h2 { letter-spacing: -0.03em; }
p { margin: 0 0 1em; }
.lede { font-size: clamp(18px, 2.2vw, 21px); color: var(--text-2); max-width: 62ch; }
.small { font-size: 14px; color: var(--muted); }
main { padding: 36px 0 72px; }
article h2 { margin-top: 1.6em; }
article ul, article ol { padding-left: 1.2em; } article li { margin: 0.3em 0; }
.crumbs { font-size: 14px; color: var(--muted); margin-bottom: 18px; } .crumbs a { color: var(--muted); }
.meta { font-size: 14px; color: var(--muted); margin: -4px 0 28px; }

/* hero with the spread line */
.hero { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 40px; align-items: end; padding: 28px 0 8px; }
@media (max-width: 900px) { .hero { grid-template-columns: 1fr; gap: 20px; } }
.hero h1 { margin-bottom: 14px; }

/* Spread Line: the signature element */
.spread { position: relative; padding: 18px 0 0; }
.coins { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 3px; gap: 2px; margin-bottom: 8px; flex-wrap: wrap; }
.coins button { font: inherit; font-size: 14px; font-weight: 600; background: none; color: var(--text-2); border: 0; border-radius: 999px; padding: 6px 14px; cursor: pointer; min-height: 34px; }
.coins button[aria-pressed="true"] { background: var(--surface-2); color: var(--text); }
.sl { width: 100%; height: auto; display: block; overflow: visible; }
[data-spread] { width: 100%; }
.sl .axis { stroke: var(--line); stroke-width: 1; }
.sl .tick { stroke: var(--grid); stroke-width: 1; }
.sl .ticklabel { fill: var(--muted); font-size: 12px; }
.sl .med { stroke: var(--yellow); stroke-width: 2; }
.sl .medlabel { fill: var(--yellow); font-size: 13px; font-weight: 600; }
.sl .dot { fill: var(--blue); stroke: var(--bg); stroke-width: 2; transition: transform 0.9s cubic-bezier(.2, .8, .2, 1); }
.sl .dot.krw { fill: var(--red); }
.sl .vlabel { fill: var(--text-2); font-size: 13px; }
.sl .vlabel.krw { fill: var(--text); font-weight: 650; font-size: 14px; }
.sl .stem { stroke: var(--line); stroke-width: 1; }
@media (prefers-reduced-motion: reduce) { .sl .dot { transition: none; } }
.status { font-size: 13px; color: var(--muted); margin-top: 6px; min-height: 1.4em; }
.status .stale { color: var(--down); }

/* number rows */
.kp { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 28px 0; }
.kp > div { padding: 16px 18px 16px 0; }
.kp > div + div { border-left: 1px solid var(--line); padding-left: 18px; }
@media (max-width: 560px) { .kp > div + div { border-left: 0; border-top: 1px solid var(--line); padding-left: 0; } }
.kp .v { font-size: 34px; font-weight: 700; font-stretch: 110%; line-height: 1.1; }
.kp .l { font-size: 14px; color: var(--text-2); }
.up { color: var(--up); } .down { color: var(--down); }

/* sections */
.sec { margin-top: 56px; }
.findings { list-style: none; padding: 0; margin: 0; display: grid; gap: 0; }
.findings li { display: grid; grid-template-columns: 9.5em minmax(0, 1fr); gap: 18px; padding: 18px 0; border-top: 1px solid var(--line); }
.findings li:last-child { border-bottom: 1px solid var(--line); }
.findings .n { font-size: 28px; font-weight: 700; font-stretch: 112%; line-height: 1.1; color: var(--text); }
.findings p { margin: 0; color: var(--text-2); }
.findings a { font-weight: 600; }
@media (max-width: 560px) { .findings li { grid-template-columns: 1fr; gap: 4px; } }
.list { list-style: none; padding: 0; margin: 0; }
.list li { padding: 14px 0; border-top: 1px solid var(--line); }
.list li:last-child { border-bottom: 1px solid var(--line); }
.list a { font-weight: 600; font-size: 18px; }
.list p { margin: 2px 0 0; color: var(--text-2); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; } @media (max-width: 820px) { .two { grid-template-columns: 1fr; gap: 0; } }

/* tables */
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 16px 0 8px; border-top: 1px solid var(--line); }
table { border-collapse: collapse; width: 100%; font-size: 15px; }
th, td { text-align: left; padding: 10px 12px 10px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 600; color: var(--text-2); font-size: 13px; white-space: nowrap; }
td.num, th.num { text-align: right; white-space: nowrap; }
tr.krw td:first-child { font-weight: 650; }
caption { caption-side: bottom; text-align: left; font-size: 13px; color: var(--muted); padding-top: 8px; }

/* figures (server-rendered SVG) */
figure { margin: 24px 0; overflow-x: auto; } figure > svg { min-width: 560px; } figcaption { font-size: 13px; color: var(--muted); margin-top: 6px; max-width: 70ch; }
.fig .gridl { stroke: var(--grid); } .fig .axisl { stroke: var(--line); } .fig .lbl { fill: var(--muted); font-size: 11px; }
.fig .s1 { stroke: var(--blue); fill: none; stroke-width: 2; } .fig .s2 { stroke: var(--yellow); fill: none; stroke-width: 2; } .fig .s3 { stroke: var(--muted); fill: none; stroke-width: 1.5; stroke-dasharray: 4 3; }
.fig .b1 { fill: var(--blue); } .fig .b2 { fill: var(--muted); } .fig .val { fill: var(--text); font-size: 12px; font-weight: 600; }
.fig .zero { stroke: var(--text-2); stroke-width: 1; }

/* forms / calculators */
.calc { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; margin: 24px 0; }
@media (max-width: 760px) { .calc { grid-template-columns: 1fr; } }
.field { display: grid; gap: 4px; margin-bottom: 14px; }
.field label { font-size: 14px; font-weight: 600; color: var(--text-2); }
.field input, .field select { font: inherit; font-size: 17px; background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; min-height: 44px; width: 100%; }
.field .hint { font-size: 13px; color: var(--muted); }
.out { border-left: 3px solid var(--blue); padding: 4px 0 4px 18px; }
.out dl { display: grid; grid-template-columns: auto auto; gap: 8px 20px; margin: 0; }
.out dt { color: var(--text-2); } .out dd { margin: 0; text-align: right; font-weight: 650; }
.out .big { font-size: 30px; font-weight: 700; font-stretch: 110%; margin: 0 0 12px; }
.rows { width: 100%; } .rows input { font: inherit; width: 100%; background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: 8px; min-height: 40px; }
.btn { font: inherit; font-weight: 600; background: var(--surface-2); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 8px 14px; cursor: pointer; min-height: 40px; }
.btn:hover { border-color: var(--text-2); }

/* filter chips for graveyard */
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.chips button { font: inherit; font-size: 14px; background: none; color: var(--text-2); border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; cursor: pointer; min-height: 34px; }
.chips button[aria-pressed="true"] { color: var(--text); border-color: var(--text-2); background: var(--surface-2); }
.verdict { font-weight: 650; white-space: nowrap; }
.verdict.fail { color: var(--down); } .verdict.mixed { color: var(--yellow); } .verdict.paused { color: var(--text-2); }
html[lang="ko"] .verdict.fail { color: var(--text); }

/* notes, code */
.note { border-left: 3px solid var(--yellow); padding: 6px 0 6px 16px; color: var(--text-2); margin: 20px 0; }
code, pre { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: 14px; }
pre { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 14px; overflow-x: auto; white-space: pre-wrap; word-break: break-all; }

/* footer */
.foot { border-top: 1px solid var(--line); padding: 28px 0 40px; font-size: 14px; color: var(--muted); }
.foot .wrap { display: grid; gap: 12px; }
.foot nav { display: flex; gap: 18px; flex-wrap: wrap; }
.foot a { color: var(--text-2); }

/* widget page */
body.widget { background: var(--surface); }
body.widget main { padding: 12px; }
