:root {
  --bg: #fafafa;
  --bg-alt: #f1f1ef;
  --surface: #ffffff;
  --fg: #1a1a1a;
  --muted: #5c5c5c;
  --line: #e2e2df;
  --accent: #0b7a3b;
  --held: #8a5a00;
  --open: #1f4fbf;
  --code-bg: #1a1a1a;
  --code-fg: #f2f2f2;
  --band-bg: #1a1a1a;
  --band-fg: #f2f2f2;
  --sans: ui-sans-serif, -apple-system, "Segoe UI", Inter, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111111;
    --bg-alt: #181818;
    --surface: #1c1c1c;
    --fg: #f2f2f2;
    --muted: #a8a8a8;
    --line: #2c2c2c;
    --accent: #45cf7e;
    --held: #e0b04a;
    --open: #7fa6ff;
    --code-bg: #f2f2f2;
    --code-fg: #111111;
    --band-bg: #1f1f1f;
    --band-fg: #f2f2f2;
  }
}

:root[data-theme="dark"] {
  --bg: #111111;
  --bg-alt: #181818;
  --surface: #1c1c1c;
  --fg: #f2f2f2;
  --muted: #a8a8a8;
  --line: #2c2c2c;
  --accent: #45cf7e;
  --held: #e0b04a;
  --open: #7fa6ff;
  --code-bg: #f2f2f2;
  --code-fg: #111111;
  --band-bg: #1f1f1f;
  --band-fg: #f2f2f2;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 400 17px/1.6 var(--sans);
  overflow-x: hidden;
}

a { color: inherit; text-underline-offset: 3px; }
a:focus-visible, button:focus-visible { outline: 3px solid var(--open); outline-offset: 3px; border-radius: 4px; }

code { font-family: var(--mono); font-size: 0.92em; }

h1, h2, h3 { line-height: 1.15; letter-spacing: -0.02em; margin: 0; }
h2 { font-size: clamp(1.6rem, 3.2vw, 2.25rem); }
h3 { font-size: 1.1rem; letter-spacing: -0.01em; }
p { margin: 0; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 760px; }
.center { text-align: center; }
.muted { color: var(--muted); }

.skip { position: absolute; left: -9999px; top: 8px; background: var(--fg); color: var(--bg); padding: 8px 12px; border-radius: 6px; z-index: 10; }
.skip:focus { left: 8px; }

/* Header */
.top { border-bottom: 1px solid var(--line); background: var(--bg); position: sticky; top: 0; z-index: 5; }
.top-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; text-decoration: none; letter-spacing: -0.01em; }
.mark { width: 26px; height: 26px; flex: none; }
.mark rect { fill: none; stroke: currentColor; stroke-width: 6; }
.mark path { fill: none; stroke: currentColor; stroke-width: 7; stroke-linecap: round; stroke-linejoin: round; }
nav { display: flex; gap: 20px; font-size: 0.95rem; }
nav a { text-decoration: none; color: var(--muted); }
nav a:hover { color: var(--fg); }

/* Hero */
.hero { padding: 72px 0 80px; }
.hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 56px; align-items: center; }
.eyebrow { font-family: var(--mono); font-size: 0.85rem; color: var(--muted); margin-bottom: 14px; }
h1 { font-size: clamp(2.6rem, 6vw, 4.4rem); letter-spacing: -0.035em; }
.lead { font-size: clamp(1.1rem, 1.6vw, 1.3rem); color: var(--muted); margin: 20px 0 28px; max-width: 34em; }
.fine { font-size: 0.9rem; color: var(--muted); margin-top: 14px; }

.install {
  display: flex; align-items: stretch; max-width: 100%;
  background: var(--code-bg); color: var(--code-fg);
  border-radius: 10px; overflow: hidden;
}
.install code { flex: 1; min-width: 0; padding: 14px 16px; font-size: 0.95rem; }
.install code::before { content: "$ "; opacity: 0.55; }
.install .nb { white-space: nowrap; }
.copy {
  flex: none; border: 0; border-left: 1px solid rgba(127, 127, 127, 0.35);
  background: transparent; color: inherit; font: 600 0.85rem var(--sans);
  padding: 0 18px; cursor: pointer;
}
.copy:hover { background: rgba(127, 127, 127, 0.18); }

/* Receipt */
.receipt {
  margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  padding: 22px 22px 18px; font-size: 0.92rem;
  box-shadow: 0 1px 0 var(--line), 0 18px 40px -24px rgba(0, 0, 0, 0.25);
}
.receipt-head {
  display: flex; justify-content: space-between; font-family: var(--mono); text-transform: uppercase;
  letter-spacing: 0.08em; font-size: 0.78rem; padding-bottom: 12px; border-bottom: 1px dashed var(--line);
}
.receipt-task { font-weight: 600; margin: 14px 0 6px; }
.lines { list-style: none; margin: 0; padding: 0; }
.lines li {
  display: grid; grid-template-columns: 4.6rem 1fr auto; column-gap: 12px; row-gap: 2px;
  padding: 12px 0; border-bottom: 1px dashed var(--line);
}
.lines .id { font-family: var(--mono); font-size: 0.8rem; color: var(--muted); padding-top: 2px; }
.lines .what { min-width: 0; }
.lines .proof { grid-column: 2 / 4; font-size: 0.82rem; color: var(--muted); }
.tag {
  font: 700 0.7rem var(--mono); text-transform: uppercase; letter-spacing: 0.06em;
  padding: 3px 8px; border-radius: 999px; border: 1px solid currentColor; align-self: start;
}
.tag.pass { color: var(--accent); }
.tag.held { color: var(--held); }
.tag.open { color: var(--open); }
.receipt-next { margin-top: 14px; font-size: 0.88rem; }
.receipt-next .muted { font-family: var(--mono); text-transform: uppercase; font-size: 0.75rem; letter-spacing: 0.08em; margin-right: 8px; }

/* Sections */
.band { background: var(--band-bg); color: var(--band-fg); padding: 72px 0; border-block: 1px solid var(--line); }
.band h2 { margin-bottom: 18px; }
.band p { font-size: 1.12rem; opacity: 0.85; margin-top: 12px; }

.section { padding: 88px 0; }
.section.alt { background: var(--bg-alt); }
.section h2 { margin-bottom: 12px; }
.section-lead { color: var(--muted); max-width: 40em; margin-bottom: 40px; }

.steps { list-style: none; counter-reset: step; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0; border-top: 1px solid var(--line); }
.steps li { counter-increment: step; padding: 22px 22px 24px 0; border-bottom: 1px solid var(--line); }
.steps li::before { content: counter(step, decimal-leading-zero); display: block; font: 600 0.8rem var(--mono); color: var(--accent); margin-bottom: 8px; }
.steps p { color: var(--muted); margin-top: 6px; font-size: 0.97rem; }

.rules { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 28px; }
.rules article { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 24px; }
.rules p { color: var(--muted); margin-top: 10px; font-size: 0.97rem; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.stat {
  display: flex; flex-direction: column; gap: 10px; text-decoration: none;
  border: 1px solid var(--line); border-radius: 12px; padding: 24px; background: var(--surface);
  transition: border-color 0.15s ease;
}
.stat:hover { border-color: var(--fg); }
.num { font: 700 clamp(1.8rem, 3.4vw, 2.4rem)/1.1 var(--sans); letter-spacing: -0.03em; }
.label { font-size: 0.97rem; }
.src { font: 0.78rem/1.4 var(--mono); color: var(--muted); margin-top: auto; }
.caveat { margin-top: 24px; color: var(--muted); font-size: 0.95rem; }

.fits { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; }
.fits h2 { font-size: clamp(1.4rem, 2.4vw, 1.75rem); margin-bottom: 18px; }
.fits p { margin-bottom: 14px; }
.checks { list-style: none; margin: 0; padding: 0; }
.checks li { position: relative; padding-left: 30px; margin-bottom: 14px; }
.checks li::before {
  content: ""; position: absolute; left: 0; top: 0.3em; width: 16px; height: 16px;
  border: 2px solid var(--accent); border-radius: 4px;
}
.checks li::after {
  content: ""; position: absolute; left: 5px; top: calc(0.3em + 3px); width: 5px; height: 8px;
  border: solid var(--accent); border-width: 0 2px 2px 0; transform: rotate(45deg);
}

.cta { padding: 96px 0; }
.cta h2 { margin-bottom: 24px; }
.cta .install { max-width: 520px; margin: 0 auto; text-align: left; }
.links { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px 24px; margin-top: 22px; }

.foot { border-top: 1px solid var(--line); padding: 28px 0 40px; font-size: 0.88rem; }
.foot-row { display: flex; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; }

/* Narrow screens */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .rules, .stats { grid-template-columns: 1fr; }
  .fits { grid-template-columns: 1fr; gap: 40px; }
}

@media (max-width: 560px) {
  .wrap { padding: 0 16px; }
  body { font-size: 16px; }
  nav { gap: 14px; font-size: 0.88rem; }
  nav a[href="#how"] { display: none; }
  .hero { padding: 44px 0 56px; }
  .section { padding: 64px 0; }
  .band { padding: 56px 0; }
  .receipt { padding: 18px 16px 14px; }
  .lines li { grid-template-columns: 1fr auto; }
  .lines .id { grid-column: 1 / 3; }
  .lines .proof { grid-column: 1 / 3; }
  .install code { font-size: 0.8rem; padding: 12px 10px; }
  .install code::before { content: none; }
  .copy { padding: 0 12px; }
}

/* Korean */
:lang(ko) { word-break: keep-all; overflow-wrap: break-word; }
:lang(ko) h1 { letter-spacing: -0.03em; }
/* Korean set in a monospace face spreads out; keep mono for code and IDs only. */
:lang(ko) .eyebrow, :lang(ko) .receipt-head, :lang(ko) .tag, :lang(ko) .receipt-next .muted, :lang(ko) .src { font-family: var(--sans); letter-spacing: 0; }
:lang(ko) h2, :lang(ko) h3 { letter-spacing: -0.015em; }
:lang(ko) .lead, :lang(ko) .section-lead, :lang(ko) .band p { line-height: 1.7; }

@media (max-width: 400px) {
  nav a[href="#measured"] { display: none; }
}
