:root {
  --paper: #f7f2e8;
  --paper-2: #efe7d6;
  --paper-3: #e6dcc7;
  --ink: #1c1915;
  --ink-2: #4b443a;
  --ink-3: #7c7366;
  --rule: #dcd1bd;
  --seal: #b3402b;
  --seal-soft: rgba(179, 64, 43, .10);
  --seal-ink: #ffffff;
  --band: #1c1915;
  --band-ink: #f2ebdd;
  --band-dim: #a79e8e;
  --code-bg: #1c1915;
  --code-ink: #efe8da;
  --code-dim: #968d7d;
  --code-key: #e9a57c;
  --code-str: #b8d3a0;
  --shadow: 0 1px 0 rgba(28, 25, 21, .04), 0 18px 40px -24px rgba(28, 25, 21, .35);
  --serif: "Noto Serif KR", "Noto Serif CJK KR", "AppleMyungjo", "Batang", serif;
  --sans: "Pretendard Variable", "Pretendard", -apple-system, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", system-ui, sans-serif;
  --mono: "JetBrains Mono", "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #13110e; --paper-2: #1b1814; --paper-3: #24201a; --ink: #eee7d9; --ink-2: #c4bba9; --ink-3: #8e8575;
    --rule: #332d25; --seal: #d9624a; --seal-soft: rgba(217, 98, 74, .14); --band: #0b0a08; --band-ink: #eee7d9;
    --band-dim: #8e8575; --code-bg: #0b0a08; --shadow: 0 18px 40px -24px rgba(0, 0, 0, .8);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #13110e; --paper-2: #1b1814; --paper-3: #24201a; --ink: #eee7d9; --ink-2: #c4bba9; --ink-3: #8e8575;
  --rule: #332d25; --seal: #d9624a; --seal-soft: rgba(217, 98, 74, .14); --band: #0b0a08; --band-ink: #eee7d9;
  --band-dim: #8e8575; --code-bg: #0b0a08; --shadow: 0 18px 40px -24px rgba(0, 0, 0, .8);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--sans); font-size: 17px; line-height: 1.72;
  word-break: keep-all; overflow-wrap: anywhere;
  -webkit-font-smoothing: antialiased;
}
:lang(en) body, body:lang(en) { line-height: 1.65; }
a { color: inherit; text-decoration-color: var(--seal); text-underline-offset: 3px; }
a:hover { color: var(--seal); }
code { font-family: var(--mono); font-size: .86em; background: var(--paper-2); padding: .12em .38em; border-radius: 5px; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 32px; } }
.serif { font-family: var(--serif); }

/* ---------- header ---------- */
header.top { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--paper) 86%, transparent); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--rule); }
header.top .wrap { display: flex; align-items: center; justify-content: space-between; height: 62px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; text-decoration: none; letter-spacing: -.01em; white-space: nowrap; }
.brand .seal { width: 30px; height: 30px; border-radius: 6px; background: var(--seal); color: var(--seal-ink); display: grid; place-items: center; font-family: var(--serif); font-size: 18px; line-height: 1; box-shadow: inset 0 0 0 2px rgba(255,255,255,.18); }
nav.links { display: flex; align-items: center; gap: 22px; font-size: 15px; color: var(--ink-2); }
nav.links a { text-decoration: none; white-space: nowrap; }
.lang { display: inline-flex; white-space: nowrap; flex: none; border: 1px solid var(--rule); border-radius: 999px; padding: 2px; font-size: 13px; }
.lang a, .lang span { padding: 3px 10px; border-radius: 999px; text-decoration: none; line-height: 1.4; }
.lang span[aria-current] { background: var(--ink); color: var(--paper); font-weight: 600; }
@media (max-width: 760px) { nav.links .hide-sm { display: none; } nav.links { gap: 14px; } }
@media (max-width: 400px) { nav.links .hide-xs { display: none; } }

/* ---------- hero ---------- */
.hero { position: relative; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: -20% -10% auto auto; width: 720px; height: 720px; border-radius: 50%;
  background: radial-gradient(closest-side, var(--seal-soft), transparent 70%); pointer-events: none;
}
.hero .wrap { position: relative; display: grid; gap: 44px; align-items: center; padding-top: 64px; padding-bottom: 72px; }
@media (min-width: 960px) { .hero .wrap { grid-template-columns: 1.2fr 1fr; gap: 56px; padding-top: 96px; padding-bottom: 104px; } }
.hero .wrap > * { min-width: 0; }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; font-size: 13.5px; letter-spacing: .06em; color: var(--seal); font-weight: 600; margin: 0 0 20px; }
.eyebrow::before { content: ""; width: 22px; height: 1px; background: currentColor; }
h1 { font-family: var(--serif); font-weight: 700; font-size: clamp(34px, 4.6vw, 54px); line-height: 1.18; letter-spacing: -.025em; margin: 0 0 22px; }
h1 em { font-style: normal; color: var(--seal); }
:lang(ko) h1 { font-size: clamp(32px, 4.1vw, 46px); line-height: 1.26; }
:lang(en) h1 { letter-spacing: -.02em; font-size: clamp(32px, 4.1vw, 46px); line-height: 1.18; }
.lede { font-size: clamp(17px, 1.6vw, 19px); color: var(--ink-2); margin: 0 0 34px; max-width: 33em; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 13px 22px; border-radius: 10px; font-weight: 600; font-size: 16px; text-decoration: none; border: 1px solid var(--ink); transition: background .2s, color .2s, border-color .2s, transform .2s; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--ink); color: var(--paper); }
.btn.primary:hover { background: var(--seal); border-color: var(--seal); color: var(--seal-ink); }
.btn.ghost:hover { border-color: var(--seal); color: var(--seal); }
.btn .arr { transition: transform .2s; }
.btn:hover .arr { transform: translateX(3px); }

/* ---------- chart card ---------- */
.chart { margin: 0; background: var(--paper); border: 1px solid var(--rule); border-radius: 18px; box-shadow: var(--shadow); overflow: hidden; }
.tabs { display: flex; gap: 4px; padding: 10px; background: var(--paper-2); border-bottom: 1px solid var(--rule); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: 1 0 auto; border: 0; background: transparent; color: var(--ink-3); font: inherit; font-size: 13.5px; font-weight: 600; padding: 7px 12px; border-radius: 8px; cursor: pointer; white-space: nowrap; transition: background .2s, color .2s; }
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { background: var(--paper); color: var(--ink); box-shadow: 0 1px 0 var(--rule), 0 0 0 1px var(--rule); }
.chart-body { padding: 22px 22px 20px; }
.chart .input { font-family: var(--mono); font-size: 13px; color: var(--ink-2); margin-bottom: 18px; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.chart .input .cal { font-family: var(--sans); font-size: 12px; font-weight: 700; color: var(--seal); border: 1px solid currentColor; border-radius: 5px; padding: 0 6px; }
.pillars { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.pillar { text-align: center; }
.pillar .label { font-size: 12.5px; color: var(--ink-3); margin-bottom: 8px; white-space: nowrap; }
.pillar .label b { font-family: var(--serif); font-weight: 600; color: var(--ink-2); margin-right: 3px; }
.pillar .glyphs { position: relative; border: 1px solid var(--rule); background: linear-gradient(var(--paper), var(--paper-2)); border-radius: 12px; padding: 12px 0; font-family: var(--serif); font-size: clamp(30px, 7.4vw, 46px); line-height: 1.24; font-weight: 600; }
.pillar .glyphs span { display: block; }
.pillar.day .glyphs { border-color: var(--seal); box-shadow: inset 0 0 0 1px var(--seal); }
.pillar .hangul { font-size: 13.5px; color: var(--ink-2); margin-top: 8px; }
.pillar.changed .glyphs { background: var(--seal-soft); }
.chart .note { margin: 18px 0 0; font-size: 15px; color: var(--ink); line-height: 1.6; padding-left: 12px; border-left: 2px solid var(--seal); }
.chart .foot { margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--rule); font-size: 12.5px; color: var(--ink-3); font-family: var(--mono); display: grid; gap: 3px; }
.chart .foot b { color: var(--ink-2); font-weight: 500; }
.status { display: inline-block; font-weight: 600; padding: 0 6px; border-radius: 4px; }
.status.stable { color: #2f7a4f; background: rgba(47,122,79,.1); }
.status.sensitive { color: var(--seal); background: var(--seal-soft); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .status.stable { color: #7fc79c; } }
.cands { display: grid; gap: 6px; margin-top: 14px; }
.cand { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; font-size: 13px; padding: 7px 10px; border: 1px solid var(--rule); border-radius: 9px; background: var(--paper-2); }
.cand .g { font-family: var(--serif); font-size: 17px; letter-spacing: .06em; }
.cand .g i { font-style: normal; color: var(--seal); }
.cand .r { font-family: var(--mono); font-size: 11.5px; color: var(--ink-3); text-align: right; }
.swap { transition: opacity .35s ease, transform .35s ease; }
.swap.out { opacity: 0; transform: translateY(6px); }

/* ---------- sections ---------- */
section { padding: 88px 0; border-top: 1px solid var(--rule); }
.kicker { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--seal); font-weight: 700; margin: 0 0 12px; }
.sec-head { max-width: 44em; margin-bottom: 44px; }
h2 { font-family: var(--serif); font-size: clamp(27px, 3.8vw, 38px); line-height: 1.28; letter-spacing: -.02em; margin: 0 0 14px; }
.sec-head p { color: var(--ink-2); margin: 0; }
h3 { font-size: 18px; margin: 0 0 8px; letter-spacing: -.01em; }

/* solar-term wheel */
.wheel-grid { display: grid; gap: 40px; align-items: center; }
@media (min-width: 960px) { .wheel-grid { grid-template-columns: 1fr 1.05fr; gap: 64px; } }
.wheel-grid > * { min-width: 0; }
@media (min-width: 960px) { .wheel-grid { align-items: start; } .wheel-grid > figure { position: sticky; top: 110px; } }
.wheel { width: 100%; max-width: 480px; margin: 0 auto; display: block; }
.wheel text { font-family: var(--sans); }
.wheel .br { font-family: var(--serif); font-size: 19px; font-weight: 600; fill: var(--ink); }
.wheel .term { font-size: 10.5px; fill: var(--ink-3); }
.wheel .term.jie { fill: var(--ink-2); font-weight: 600; }
.wheel .term.lichun { fill: var(--seal); font-weight: 700; }
.wheel .ring { fill: none; stroke: var(--rule); }
.wheel .sector { fill: var(--paper-2); stroke: var(--paper); stroke-width: 2; transition: fill .25s; }
.wheel .sector.hl { fill: var(--seal-soft); }
.wheel .tick { stroke: var(--ink-3); stroke-width: 1; }
.wheel .tick.jie { stroke: var(--ink); stroke-width: 1.6; }
.wheel .tick.lichun { stroke: var(--seal); stroke-width: 2.6; }
.wheel .center { font-family: var(--serif); fill: var(--ink); }
.wheel .center-sub { font-size: 11px; fill: var(--ink-3); }
.traps { display: grid; gap: 0; border-top: 1px solid var(--rule); }
.trap { display: grid; grid-template-columns: 40px 1fr; gap: 2px 14px; padding: 18px 0; border-bottom: 1px solid var(--rule); }
.trap .n { grid-row: span 2; font-family: var(--serif); font-size: 22px; color: var(--seal); line-height: 1.3; }
.trap strong { font-size: 17px; }
.trap span { color: var(--ink-2); font-size: 15.5px; }

/* response cards */
.grid { display: grid; gap: 16px; }
.grid > * { min-width: 0; }
@media (min-width: 720px) { .grid.two { grid-template-columns: 1fr 1fr; } .grid.three { grid-template-columns: repeat(3, 1fr); } }
.card { position: relative; border: 1px solid var(--rule); border-radius: 14px; padding: 22px 22px 20px; background: var(--paper); transition: border-color .25s, transform .25s, box-shadow .25s; }
.card:hover { border-color: var(--ink-3); transform: translateY(-2px); box-shadow: var(--shadow); }
.card p { margin: 0; color: var(--ink-2); font-size: 15.5px; }
.card .field { font-family: var(--mono); color: var(--seal); font-size: 13px; font-weight: 500; margin-bottom: 10px; display: inline-block; }

/* stats band */
.band { background: var(--band); color: var(--band-ink); border-top: 0; }
.band .kicker { color: #e58a70; }
.band .sec-head p { color: var(--band-dim); }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 36px 24px; }
@media (min-width: 960px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat { min-width: 0; border-top: 1px solid rgba(255,255,255,.14); padding-top: 18px; }
.stat .v { font-family: var(--serif); font-size: clamp(30px, 4.4vw, 48px); font-weight: 700; line-height: 1.1; letter-spacing: -.03em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.stat .v small { font-size: .5em; font-weight: 600; margin-left: 2px; letter-spacing: 0; }
.stat .k { font-size: 14.5px; color: var(--band-dim); margin-top: 10px; line-height: 1.55; }
.band .note { color: var(--band-dim); }
.band code { background: rgba(255,255,255,.08); color: var(--band-ink); }
.note { font-size: 14px; color: var(--ink-3); margin-top: 28px; }

/* code */
.code { background: var(--code-bg); color: var(--code-ink); border-radius: 14px; overflow: hidden; border: 1px solid rgba(255,255,255,.04); }
.code .bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 16px; font-size: 12.5px; color: var(--code-dim); border-bottom: 1px solid rgba(255,255,255,.07); font-family: var(--mono); }
.code .dots { display: inline-flex; gap: 6px; margin-right: 10px; vertical-align: middle; }
.code .dots i { width: 9px; height: 9px; border-radius: 50%; background: rgba(255,255,255,.14); }
.code pre { margin: 0; padding: 18px 16px 20px; overflow-x: auto; font-family: var(--mono); font-size: 13px; line-height: 1.7; }
.code .k { color: var(--code-key); }
.code .s { color: var(--code-str); }
.code .c { color: var(--code-dim); }
.copy { background: transparent; border: 1px solid rgba(255,255,255,.16); color: var(--code-dim); font: inherit; font-size: 12px; padding: 3px 10px; border-radius: 6px; cursor: pointer; }
.copy:hover { color: var(--code-ink); border-color: var(--code-ink); }
.ok { color: #8fd19e; }

table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; padding: 13px 16px; border-top: 1px solid var(--rule); vertical-align: top; }
th { font-size: 12.5px; color: var(--ink-3); font-weight: 600; border-top: 0; letter-spacing: .03em; }
td:first-child { white-space: nowrap; font-family: var(--mono); font-size: 13.5px; }
.method { display: inline-block; min-width: 46px; font-weight: 700; color: var(--seal); }
.table-wrap { border: 1px solid var(--rule); border-radius: 14px; overflow-x: auto; background: var(--paper); margin-top: 28px; }

/* access */
.access { display: grid; gap: 18px; }
@media (min-width: 820px) { .access { grid-template-columns: 1fr 1fr; } }
.access > * { min-width: 0; }
.plan { border: 1px solid var(--rule); border-radius: 16px; padding: 28px 26px; background: var(--paper); display: flex; flex-direction: column; gap: 14px; }
.plan.featured { border-color: var(--ink); box-shadow: var(--shadow); }
.plan .tag { font-size: 12px; font-weight: 700; letter-spacing: .07em; color: var(--seal); }
.plan .price { font-family: var(--serif); font-size: 30px; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; }
.plan .price small { font-family: var(--sans); font-size: 15px; font-weight: 500; color: var(--ink-3); }
.plan ul { margin: 0; padding: 0; list-style: none; color: var(--ink-2); font-size: 15.5px; display: grid; gap: 8px; }
.plan li { padding-left: 22px; position: relative; }
.plan li::before { content: ""; position: absolute; left: 2px; top: .62em; width: 9px; height: 9px; border-radius: 2px; background: var(--seal); transform: rotate(45deg) scale(.7); }
.plan .btn { align-self: flex-start; margin-top: 6px; }

footer { border-top: 1px solid var(--rule); padding: 36px 0 52px; color: var(--ink-3); font-size: 14px; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 12px 28px; justify-content: space-between; align-items: center; }
footer nav { display: flex; gap: 18px; flex-wrap: wrap; }

/* reveal */
.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity .7s ease, transform .7s ease; }
.js .reveal.in { opacity: 1; transform: none; }
.js .pillar.enter .glyphs { animation: rise .6s cubic-bezier(.2,.7,.2,1) both; }
.js .pillar.enter:nth-child(2) .glyphs { animation-delay: .07s; }
.js .pillar.enter:nth-child(3) .glyphs { animation-delay: .14s; }
.js .pillar.enter:nth-child(4) .glyphs { animation-delay: .21s; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal, .swap, .card, .btn { transition: none; opacity: 1; transform: none; }
  .js .pillar.enter .glyphs { animation: none; }
}
