:root {
  color-scheme: dark;
  --bg: #0b111c;
  --surface: #101a29;
  --raised: #142033;
  --text: #edf3fb;
  --muted: #a9b8cb;
  --muted-strong: #c2d0de;
  --faint: #859bb3;
  --line: #26374b;
  --ice: #94e4fa;
  --blue: #6bd6f7;
  --gold: #faca8b;
  --mono: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  --sans: "Pretendard", "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 300px; font: 1rem/1.65 var(--sans); color: var(--text); background: var(--bg); }
button, input { font: inherit; }
button, a, label.file-button { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--ice); outline-offset: 4px; }
[hidden] { display: none !important; }
.shell { width: min(calc(100% - 9rem), 1200px); margin-inline: auto; }
.mono { font-family: var(--mono); }
.math, .formula-type { font-family: Georgia, serif; }
.skip { position: absolute; z-index: 3; transform: translateY(-180%); padding: .6rem 1rem; background: var(--ice); color: var(--bg); }
.skip:focus { transform: translateY(0); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.site-header { border-bottom: 1px solid #202d3d; background: #0c1320; }
.topbar { min-height: 4.7rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand { display: inline-flex; gap: .72rem; align-items: center; font: .8rem/1.2 var(--mono); letter-spacing: .07em; text-decoration: none; white-space: nowrap; }
.brand strong { font-weight: 500; color: var(--ice); }
.brand-mark { display: grid; place-items: center; width: 2.05rem; height: 2.05rem; border: 1px solid #3a6f85; border-radius: .4rem; color: var(--ice); font: 1.5rem/1 Georgia, serif; background: #152c3c; }
nav { display: flex; gap: clamp(1.1rem, 3vw, 2.8rem); }
nav a, .header-status { color: var(--muted-strong); font-size: .875rem; text-decoration: none; white-space: nowrap; }
nav a:hover, .header-status:hover { color: var(--ice); }
.header-status { display: inline-flex; align-items: center; gap: .52rem; }
i { font-style: normal; }
.header-status i, .figure-top i { width: .42rem; height: .42rem; border-radius: 50%; display: inline-block; background: #75dcbe; box-shadow: 0 0 10px #75dcbe66; }
.hero { display: grid; grid-template-columns: 1fr 1.06fr; gap: clamp(1.5rem, 6vw, 6rem); min-height: 34.5rem; align-items: center; padding-block: 4.6rem 4.8rem; }
.eyebrow { display: flex; align-items: center; gap: .6rem; margin: 0; color: var(--ice); font: 500 .78rem/1.35 var(--mono); letter-spacing: .12em; }
.eyebrow span { width: 1.32rem; height: 1px; background: #58a7bf; }
.eyebrow b { color: var(--faint); font-weight: 400; }
h1, h2, h3, p { overflow-wrap: anywhere; }
h1, h2, h3 { margin: 0; }
h1 { margin-block: 1.35rem 1.3rem; font-size: clamp(3.15rem, 5.25vw, 5.35rem); line-height: 1.11; letter-spacing: -.075em; font-weight: 750; white-space: nowrap; }
h1 em { font-style: normal; color: var(--ice); }
.hero-copy > p:not(.eyebrow) { font-size: 1.08rem; color: var(--muted-strong); max-width: 25rem; margin: 0; word-break: keep-all; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1.8rem; }
.button { display: inline-flex; align-items: center; justify-content: center; border-radius: .4rem; font-weight: 650; border: 1px solid transparent; min-height: 2.75rem; padding: .53rem 1rem; font-size: .9rem; text-decoration: none; transition: border-color .18s, background .18s, color .18s; }
.primary { color: #071320; background: var(--ice); border-color: var(--ice); }
.primary:hover { background: #c2f0fc; border-color: #c2f0fc; }
.ghost { color: var(--text); background: transparent; border-color: #3a4f66; }
.ghost:hover { color: var(--ice); border-color: #68aac0; background: #142538; }
.hero-figure { margin: 0; min-width: 0; border: 1px solid #2d4259; border-radius: .8rem; background: #101c2d; box-shadow: 0 18px 50px #03060d80; overflow: hidden; }
.figure-top, .figure-bottom { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .85rem 1.05rem; font-size: .85rem; color: var(--muted-strong); }
.figure-top { border-bottom: 1px solid #26384c; }
.figure-top i, .figure-bottom i { margin-right: .35rem; }
.figure-top .mono { color: var(--ice); white-space: nowrap; }
.plot-box { height: 16.25rem; background: radial-gradient(ellipse at 76% 31%, #142d43 0%, #111f33 62%); }
canvas { display: block; width: 100%; height: 100%; }
.figure-bottom { border-top: 1px solid #26384c; color: var(--muted); font-size: .8rem; }
.figure-bottom i { display: inline-block; width: .65rem; height: .5rem; border: 1px solid #70cde5; background: #66d1e54a; vertical-align: middle; }
.figure-bottom b { color: #7ea9be; font-weight: normal; }
.status-strip { background: #0e1827; border-block: 1px solid #233449; }
.strip-inner { display: grid; grid-template-columns: .9fr 1.1fr 1fr; }
.strip-inner a { display: flex; flex-direction: column; padding: 1.28rem 1.7rem; gap: .15rem; text-decoration: none; }
.strip-inner a:first-child { padding-left: 0; }
.strip-inner a + a { border-left: 1px solid #26384e; }
.strip-inner b { font-size: clamp(1.05rem, 2.2vw, 1.48rem); font-weight: 500; color: var(--text); }
.strip-inner a:hover b { color: var(--ice); }
.strip-inner span { font-size: .875rem; color: var(--muted); }
.section { padding-block: 4.5rem; scroll-margin-top: 1.1rem; }
.section-heading { margin: 0 0 1.7rem; }
.section-heading h2 { margin-block: .5rem .45rem; font-size: clamp(1.65rem, 4.3vw, 2.9rem); letter-spacing: -.06em; line-height: 1.2; word-break: keep-all; }
.section-heading > p:not(.eyebrow) { margin: 0; color: var(--muted); word-break: keep-all; }
.workbench, .source-grid { display: grid; grid-template-columns: minmax(17rem, .76fr) minmax(0, 1.24fr); border: 1px solid var(--line); border-radius: .8rem; overflow: hidden; background: var(--surface); }
.controls, .results { padding: clamp(1rem, 3vw, 2rem); min-width: 0; }
.controls { border-right: 1px solid var(--line); }
.results { background: #111c2a; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: .65rem; margin-bottom: 1rem; }
.panel-head h3 { font-size: 1.13rem; }
.panel-head > .mono { font-size: .88rem; color: var(--muted); }
.presets { display: flex; flex-wrap: wrap; gap: .45rem; margin-bottom: 1.05rem; }
.presets button { border: 1px solid #344a62; background: #142236; color: var(--muted-strong); border-radius: .3rem; padding: .25rem .56rem; min-height: 2.05rem; font-size: .82rem; }
.presets button:hover, .presets button[aria-pressed=true] { color: var(--ice); background: #1c3549; border-color: #5592a9; }
.controls label { display: block; color: var(--muted-strong); font-size: .9rem; margin-bottom: .26rem; }
.controls label span { color: var(--ice); }
.controls input[type=text] { width: 100%; min-height: 2.7rem; margin-bottom: .8rem; padding: .48rem .65rem; border: 1px solid #3b5068; border-radius: .35rem; color: var(--text); background: #0c1522; font: .96rem/1.3 var(--mono); }
input[type=range] { width: 100%; accent-color: var(--ice); }
.range-line { display: flex; justify-content: space-between; gap: .75rem; align-items: center; }
.range-line output { min-width: 4rem; text-align: right; color: var(--ice); font: .87rem var(--mono); }
.input-help, .form-error, .file-message { margin: .6rem 0; font-size: .83rem; color: var(--muted); }
.form-error, .file-message[data-error=true] { color: #ffb6aa; }
.run { margin-top: .3rem; width: 100%; }
.state { display: inline-block; border: 1px solid #396965; border-radius: .25rem; background: #152e35; color: #9de7d7; font-size: .79rem; padding: .18rem .49rem; white-space: nowrap; }
.state[data-tone=warn] { border-color: #765c40; color: #ffcf93; background: #342919; }
.range-result { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 1.4rem; }
.range-result > div { min-width: 0; }
.range-result span { display: block; color: var(--muted); font-size: .9rem; }
.range-result strong { display: block; color: var(--ice); font: 500 clamp(1.55rem, 4vw, 2.9rem)/1.18 var(--mono); letter-spacing: -.065em; margin-top: .2rem; overflow-wrap: anywhere; }
.range-result strong sup { font-size: .6em; line-height: 0; letter-spacing: 0; }
.result-note { color: var(--muted-strong); margin-block: 1.15rem 1rem; font-size: .94rem; }
.range-band { position: relative; height: .78rem; margin: 0 .1rem; border-block: 1px solid #365971; background: #1e3148; border-radius: .12rem; }
.bound-band { position: absolute; inset: -1px 0; border: 1px solid #78d8ee; background: linear-gradient(90deg,#427c94,#508da2,#427c94); border-radius: .12rem; }
.range-band > i { position: absolute; top: -.3rem; bottom: -.3rem; width: 2px; background: var(--gold); }
.band-labels { display: flex; justify-content: space-between; gap: .5rem; margin: .4rem 0 1rem; color: var(--muted); font: .77rem/1.4 var(--mono); }
.band-labels span { overflow-wrap: anywhere; }
.band-labels span:last-child { text-align: right; }
.result-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.3rem; }
.result-actions .button { font-size: .83rem; min-height: 2.2rem; padding: .35rem .6rem; }
.file-button { cursor: pointer; }
.file-button:has(+ input:focus-visible) { outline: 2px solid var(--ice); outline-offset: 4px; }
.text-button { color: var(--ice); padding: .16rem 0; font-size: .88rem; background: none; border: 0; text-decoration: underline; text-underline-offset: .22em; }
.text-button:hover { color: #d7f7ff; }
.text-button:disabled { color: var(--muted); cursor: wait; }
.exact-section { display: flex; gap: .8rem; flex-wrap: wrap; align-items: center; color: var(--gold); font-size: .89rem; }
.method { margin-top: .85rem; border: 1px solid var(--line); border-radius: .5rem; background: var(--surface); }
summary { cursor: pointer; color: var(--muted-strong); padding: .72rem 1rem; }
.method-body { padding: 0 1rem .8rem; max-width: 62rem; color: var(--muted-strong); }
.method-body p { margin: .35rem 0 .7rem; }
.method-body a { color: var(--ice); }
.proof-section { background: #0d1624; border-block: 1px solid #233449; }
.source-guide { padding: 1.15rem; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: .6rem; }
.source-choice { text-align: left; background: #131f30; color: var(--text); border: 1px solid #304257; border-radius: .4rem; padding: .72rem .85rem; }
.source-choice > * { display: block; }
.source-choice span { color: var(--ice); font-size: .8rem; }
.source-choice b { font-size: 1rem; margin-top: .14rem; }
.source-choice small { font-size: .84rem; margin-top: .06rem; color: var(--muted); }
.source-choice:hover, .source-choice[aria-pressed=true] { border-color: #5598b0; background: #1a3143; }
.source-explanation { margin: .4rem .13rem 0; font-size: .93rem; color: var(--muted-strong); }
.editor { background: #0b1421; min-width: 0; }
.editor-head { display: flex; gap: .85rem; align-items: center; justify-content: space-between; padding: .85rem 1.1rem; background: #132235; border-bottom: 1px solid var(--line); font-size: .88rem; }
.editor-head a { color: var(--ice); white-space: nowrap; }
.editor pre { margin: 0; padding: 1rem; min-height: 9rem; overflow: auto; color: #dde8f8; font: .86rem/1.8 var(--mono); tab-size: 2; }
.editor pre code { font: inherit; }
.code-line { display: block; }
.line-no { display: inline-block; margin-right: .8rem; color: #899eb5; user-select: none; }
.code-key { color: #e3aaff; }
.code-symbol { color: #93e7ef; }
.integrity { padding: .85rem 1.1rem 1rem; border-top: 1px solid var(--line); }
.hash-header { display: flex; gap: .5rem; align-items: center; justify-content: space-between; font-size: .89rem; color: var(--muted-strong); }
#hash-output { display: block; word-break: break-all; color: var(--ice); margin: .45rem 0 .25rem; font: .82rem/1.55 var(--mono); }
.hash-actions { display: flex; flex-wrap: wrap; gap: 1rem; }
.integrity-note { margin: .5rem 0 0; color: var(--muted); font-size: .82rem; }
.verification { display: grid; grid-template-columns: minmax(14rem,.76fr) minmax(0,1.24fr); align-items: start; gap: 1.35rem; margin-top: 2.1rem; scroll-margin-top: 1.7rem; }
.verification h3 { font-size: 1.45rem; margin-top: .27rem; }
.verification-list { display: grid; }
.verification-list a { display: grid; padding: .52rem .1rem; border-top: 1px solid var(--line); text-decoration: none; color: var(--muted); font-size: .86rem; gap: .12rem; }
.verification-list a:hover strong { color: var(--ice); text-decoration: underline; }
.verification-list strong { color: var(--text); font-size: .95rem; }
.footer-inner { display: flex; justify-content: space-between; align-items: flex-end; gap: 1.6rem; padding-block: 2rem; }
.footer-inner p { color: var(--muted); margin: .5rem 0 0; font-size: .87rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: 1rem; font-size: .87rem; color: var(--muted-strong); }
.footer-links a:hover { color: var(--ice); }
@media (max-width: 1050px) { .shell { width: calc(100% - 4.2rem); } .hero { gap: 2rem; min-height: 30rem; } }
@media (max-width: 760px) {
  .shell { width: calc(100% - 2rem); }
  .topbar { min-height: 3.8rem; }
  .header-status { display: none; }
  .hero { display: block; min-height: auto; padding-block: 2.7rem 2.1rem; }
  .hero-copy { margin-bottom: 1.7rem; }
  h1 { font-size: clamp(2.7rem, 10vw, 4.5rem); }
  .plot-box { height: 13rem; }
  .strip-inner a { padding: .8rem .45rem; }
  .strip-inner b { font-size: .87rem; }
  .strip-inner span { font-size: .75rem; line-height: 1.35; }
  .section { padding-block: 2.8rem; }
  .workbench, .source-grid, .verification { grid-template-columns: 1fr; }
  .controls, .source-guide { border-right: 0; border-bottom: 1px solid var(--line); }
  .footer-inner { display: block; }
  .footer-links { margin-top: 1rem; }
}
@media (max-width: 390px) {
  .brand { gap: .35rem; font-size: .7rem; }
  nav { gap: .6rem; }
  nav a { font-size: .8rem; }
  h1 { font-size: 2.64rem; }
  .figure-top, .figure-bottom { padding-inline: .65rem; gap: .45rem; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; } }
