:root {
  color-scheme: light;
  --bg: #f3f6fb;
  --paper: #ffffff;
  --ink: #172033;
  --muted: #5f6b7a;
  --line: #dce3ed;
  --brand: #284dc1;
  --brand-soft: #eaf0ff;
  --good: #087443;
  --good-soft: #ecfdf3;
  --warn: #8a3b12;
  --warn-soft: #fff4e5;
  --risk: #a61b1b;
  --risk-soft: #fff0f0;
  font-family: Inter, Pretendard, "Noto Sans KR", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--bg); line-height: 1.65; }
a { color: var(--brand); }
code { padding: .12rem .35rem; border-radius: .35rem; background: #eef1f5; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 1rem; top: 1rem; z-index: 10; padding: .7rem 1rem; background: #fff; }
.shell { display: grid; grid-template-columns: 270px minmax(0, 1fr); max-width: 1500px; margin: 0 auto; }
.side { position: sticky; top: 0; align-self: start; height: 100vh; overflow: auto; padding: 1.5rem; border-right: 1px solid var(--line); background: var(--paper); }
.side strong { display: block; margin-bottom: .25rem; font-size: 1.05rem; }
.side small { color: var(--muted); }
.side ol { padding-left: 1.3rem; }
.side li { margin: .35rem 0; }
.side a { color: #344054; text-decoration: none; }
.side a:hover, .side a:focus { color: var(--brand); text-decoration: underline; }
.side-reference { margin-top: .75rem; padding-top: .75rem; border-top: 1px solid var(--line); }
.side-reference summary { cursor: pointer; color: #344054; font-weight: 750; }
.primary-link { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; padding: .7rem 1rem; border-radius: .65rem; background: var(--brand); color: #fff; font-weight: 800; text-decoration: none; }
.primary-link:hover, .primary-link:focus { color: #fff; text-decoration: underline; }
.side .primary-link, .side .primary-link:hover, .side .primary-link:focus { color: #fff; }
main { min-width: 0; padding: 2rem clamp(1rem, 4vw, 4rem) 5rem; }
.hero, .chapter, .boundary, .quick-tour, .reference-intro { margin-bottom: 1.4rem; padding: clamp(1.1rem, 3vw, 2rem); border: 1px solid var(--line); border-radius: 1rem; background: var(--paper); box-shadow: 0 10px 28px rgba(24, 34, 48, .05); }
.hero { background: linear-gradient(135deg, #fff, var(--brand-soft)); }
.hero h1 { margin: 0 0 .5rem; font-size: clamp(2rem, 5vw, 3.25rem); line-height: 1.12; letter-spacing: -.04em; }
.hero p { max-width: 800px; color: var(--muted); }
.eyebrow { margin: 0 0 .5rem; color: var(--brand); font-size: .82rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.warning, .note, .expected { margin: 1rem 0; padding: .9rem 1rem; border-radius: .75rem; }
.warning { color: var(--risk); background: var(--risk-soft); border-left: 4px solid var(--risk); }
.note { color: var(--warn); background: var(--warn-soft); border-left: 4px solid #ef8d32; }
.expected { color: var(--good); background: var(--good-soft); border-left: 4px solid var(--good); }
.chapter h2 { margin-top: 0; font-size: clamp(1.55rem, 3vw, 2.2rem); }
.chapter h3 { margin: 1.4rem 0 .35rem; font-size: 1rem; }
.eli5 { padding: 1rem; border: 1px solid #cbd7fa; border-radius: .8rem; background: var(--brand-soft); }
.eli5 strong { color: var(--brand); }
.steps { padding-left: 1.4rem; }
.steps li { margin: .35rem 0; }
.word-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; margin: 0; }
.word-grid div { padding: 1rem; border: 1px solid var(--line); border-radius: .8rem; background: #f8fafc; }
.word-grid dt { margin-bottom: .25rem; font-weight: 850; }
.word-grid dd { margin: 0; color: var(--muted); }
.spotlight-flow { display: grid; gap: 1rem; margin-top: 1.2rem; }
.spotlight-flow > article { display: grid; grid-template-columns: minmax(17rem, .8fr) minmax(0, 1.2fr); gap: 1rem; overflow: hidden; border: 1px solid var(--line); border-radius: .9rem; background: #f8fafc; }
.spotlight-copy { padding: 1.1rem; }
.spotlight-copy h3 { margin: .65rem 0 .2rem; }
.step-number { display: grid; width: 2rem; height: 2rem; place-items: center; border-radius: 999px; background: var(--brand); color: #fff; font-weight: 850; }
.step-target { margin: 0 0 .8rem; color: var(--brand); font-weight: 750; }
.spotlight-copy dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: .35rem .65rem; margin: 0; }
.spotlight-copy dt { font-weight: 800; }
.spotlight-copy dd { margin: 0; color: var(--muted); }
.spotlight-flow figure { align-self: stretch; border-width: 0 0 0 1px; border-radius: 0; }
.technical { margin-top: 1rem; padding: .9rem 1rem; border: 1px solid var(--line); border-radius: .75rem; background: #f8fafc; }
.technical summary { cursor: pointer; font-weight: 750; }
.technical p { margin-bottom: 0; color: var(--muted); }
.url-list { margin-bottom: 0; padding-left: 1.35rem; }
.url-list li { margin: .35rem 0; overflow-wrap: anywhere; }
.reference-intro { border-style: dashed; box-shadow: none; }
.reference-intro h2, .reference-intro p:last-child { margin-bottom: 0; }
.shots { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-top: 1.2rem; }
.shots.one { grid-template-columns: minmax(0, 1fr); }
figure { min-width: 0; margin: 0; overflow: hidden; border: 1px solid var(--line); border-radius: .85rem; background: #f8fafc; }
figure img { display: block; width: 100%; height: auto; background: #e9edf3; }
figcaption { padding: .8rem 1rem; color: var(--muted); font-size: .9rem; }
.table-wrap { max-width: 100%; overflow: auto; }
.table-wrap:focus { outline: 3px solid #9db5ff; outline-offset: 2px; }
.boundary table { width: 100%; border-collapse: collapse; }
.boundary caption { padding: 0 0 .6rem; color: var(--muted); text-align: left; }
.boundary th, .boundary td { padding: .75rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.boundary th { background: #f7f9fc; }
.persona-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; }
.persona-grid div { padding: .8rem; border: 1px solid var(--line); border-radius: .7rem; }
.meta { color: var(--muted); font-size: .88rem; }

@media (max-width: 900px) {
  .shell { display: block; }
  .side { position: static; width: auto; height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .side ol { columns: 2; }
  .shots, .persona-grid, .word-grid, .spotlight-flow > article { grid-template-columns: 1fr; }
  .spotlight-flow figure { border-width: 1px 0 0; }
}

@media (max-width: 560px) {
  .side ol { columns: 1; }
  main { padding: 1rem .75rem 3rem; }
  .hero, .chapter, .boundary, .quick-tour, .reference-intro { border-radius: .75rem; }
  .boundary table { min-width: 34rem; }
}

@media print {
  body { background: #fff; font-size: 10pt; }
  .shell { display: block; max-width: none; }
  .side, .skip { display: none; }
  main { padding: 0; }
  .hero, .chapter, .boundary, .quick-tour { box-shadow: none; break-inside: avoid; }
  a { color: inherit; text-decoration: none; }
  figure { break-inside: avoid; }
}
