:root {
  --bg: #f3f1eb;
  --surface: #fcfbf8;
  --surface-2: #eeebe3;
  --border: #d8d3c7;
  --text: #1e1d1a;
  --muted: #6b665c;
  --accent: #26395a;
  --accent-soft: #e8e8e6;
  --accent-text: #fcfbf8;
  --good: #2c6a3f;
  --good-soft: #e5eee3;
  --warn: #9a6512;
  --warn-soft: #f4ecda;
  --bad: #b02a20;
  --bad-soft: #f6e4e0;
  --ink: #1e1d1a;
  --ink-text: #fcfbf8;
  --shadow: none;
  --radius: 6px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141412;
    --surface: #1c1b19;
    --surface-2: #262521;
    --border: #3a3832;
    --text: #ebe7de;
    --muted: #a39d91;
    --accent: #a9bbd8;
    --accent-soft: #252830;
    --accent-text: #141412;
    --good: #7fbf8c;
    --good-soft: #1d2a20;
    --warn: #d9ab5c;
    --warn-soft: #2d2618;
    --bad: #ec8a7f;
    --bad-soft: #33201d;
    --ink: #ebe7de;
    --ink-text: #141412;
    --shadow: none;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #141412;
  --surface: #1c1b19;
  --surface-2: #262521;
  --border: #3a3832;
  --text: #ebe7de;
  --muted: #a39d91;
  --accent: #a9bbd8;
  --accent-soft: #252830;
  --accent-text: #141412;
  --good: #7fbf8c;
  --good-soft: #1d2a20;
  --warn: #d9ab5c;
  --warn-soft: #2d2618;
  --bad: #ec8a7f;
  --bad-soft: #33201d;
  --ink: #ebe7de;
  --ink-text: #141412;
  --shadow: none;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
button, a, .opt, .flash, summary { touch-action: manipulation; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;
  font-size: 16px;
  line-height: 1.65;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code { background: var(--surface-2); padding: .1em .35em; border-radius: 2px; font-size: .9em; }
.container { max-width: 960px; margin: 0 auto; padding: 0 16px; }
main.container { padding-top: 20px; padding-bottom: 40px; min-height: 70vh; outline: none; }
.footer { color: var(--muted); font-size: 13px; padding-bottom: 32px; }

/* ── 상단 바 ── */
.topbar { padding-top: env(safe-area-inset-top); position: sticky; top: 0; z-index: 10; background: var(--bg); border-bottom: 1px solid var(--text); }
.topbar-inner { max-width: 960px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 12px; }
.brand { font-weight: 800; letter-spacing: -0.02em; color: var(--text); white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.brand:hover { text-decoration: none; }
.brand-mark { display: none; }
.crumbs { flex: 1; min-width: 0; font-size: 14px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumbs a { color: var(--muted); }
.crumbs .sep { margin: 0 6px; opacity: .6; }
.icon-btn[hidden] { display: none !important; }
.icon-btn { flex: none; color: var(--text); text-decoration: none !important; border: 1px solid var(--border); background: var(--surface); color: var(--text); width: 34px; height: 34px; border-radius: 4px; cursor: pointer; display: grid; place-items: center; padding: 0; }

/* ── 공통 ── */
h1 { font-size: 26px; line-height: 1.3; margin: 4px 0 6px; font-weight: 800; letter-spacing: -0.02em; }
h2 { font-size: 19px; margin: 28px 0 10px; letter-spacing: -0.01em; }
.lead { color: var(--muted); margin: 0 0 20px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--border); background: var(--surface); color: var(--text); padding: 9px 16px; border-radius: 4px; font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn:hover { text-decoration: none; border-color: var(--text); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--ink); border-color: var(--ink); color: var(--ink-text); }
.btn.primary:hover { background: color-mix(in srgb, var(--ink) 85%, var(--bg)); }
.btn.small { padding: 5px 11px; font-size: 13px; }
.btn.ghost { background: transparent; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.spacer { flex: 1; }
.muted { color: var(--muted); }
.tag { display: inline-block; font-size: 12px; font-weight: 600; padding: 0 6px; border-radius: 2px; border: 1px solid var(--border); background: transparent; color: var(--muted); white-space: nowrap; }
.tag.good { border-color: currentColor; color: var(--good); }
.tag.warn { border-color: currentColor; color: var(--warn); }
.tag.bad { border-color: currentColor; color: var(--bad); }
.tag.accent { border-color: currentColor; color: var(--accent); }
.empty { padding: 40px 16px; text-align: center; color: var(--muted); }

/* ── 홈 ── */
.exam-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.exam-card { padding: 20px; display: flex; flex-direction: column; gap: 10px; color: var(--text); }
.exam-card:hover { text-decoration: none; border-color: var(--text); }
.exam-card h3 { margin: 0; font-size: 18px; line-height: 1.4; letter-spacing: -0.02em; }
.exam-card .meta { font-size: 14px; color: var(--muted); }
.exam-card.add { border-style: dashed; box-shadow: none; background: transparent; color: var(--muted); justify-content: center; }

/* ── 탭 ── */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin: 16px 0 18px; overflow-x: auto; }
.tabs a { padding: 10px 14px; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { text-decoration: none; color: var(--text); }
.tabs a.on { color: var(--text); border-color: var(--text); }
.subtabs { display: inline-flex; border: 1px solid var(--border); border-radius: 4px; padding: 0; gap: 0; margin-bottom: 18px; background: var(--surface); }
.subtabs a { padding: 6px 14px; border-radius: 0; border-right: 1px solid var(--border); color: var(--muted); font-weight: 600; font-size: 14px; }
.subtabs a:hover { text-decoration: none; color: var(--text); }
.subtabs a:last-child { border-right: 0; }
.subtabs a.on { background: var(--ink); color: var(--ink-text); }

/* ── 통계 ── */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 16px; }
.stat { padding: 14px 16px; }
.stat .k { font-size: 13px; color: var(--muted); }
.stat .v { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.bar { height: 4px; background: var(--surface-2); border-radius: 0; overflow: hidden; margin-top: 6px; }
.bar > i { display: block; height: 100%; background: var(--ink); border-radius: 0; }
.quick { padding: 14px 16px; margin-bottom: 8px; }

/* ── 세트 목록 ── */
.group-h { display: flex; align-items: baseline; gap: 10px; margin: 26px 0 10px; }
.group-h h2 { margin: 0; font-size: 17px; }
.set-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.set-card { padding: 12px 14px; color: var(--text); display: flex; flex-direction: column; gap: 4px; min-height: 84px; }
.set-card:hover { text-decoration: none; border-color: var(--text); }
.set-card .t { font-weight: 600; line-height: 1.4; }
.set-card .s { font-size: 13px; color: var(--muted); }
.set-card .foot { margin-top: auto; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.set-card.done { border-left: 3px solid var(--good); }
.set-card.partial { border-left: 3px solid var(--warn); }

/* ── 퀴즈 ── */
.quiz-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.quiz-head h1 { font-size: 20px; margin: 0; }
.dots { display: flex; gap: 6px; }
.dot { width: 30px; height: 30px; border-radius: 3px; display: grid; place-items: center; font-size: 13px; font-weight: 700; background: transparent; color: var(--muted); border: 1px solid var(--border); cursor: pointer; padding: 0; font-family: inherit; }
.dot.cur { border-color: var(--text); color: var(--text); box-shadow: inset 0 0 0 1px var(--text); }
.dot.ok { border-color: var(--good); color: var(--good); }
.dot.ng { border-color: var(--bad); color: var(--bad); }
.dot.mid { border-color: var(--warn); color: var(--warn); }
.qcard { padding: 22px; }
.qmeta { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.qmeta .tag { white-space: normal; max-width: 100%; }
.qtext { font-size: 18px; font-weight: 600; line-height: 1.6; margin-bottom: 16px; }
.qtext p { margin: 0 0 .5em; }
.opts { display: flex; flex-direction: column; gap: 8px; }
.opt { display: flex; gap: 10px; align-items: flex-start; text-align: left; padding: 12px 14px; border: 1px solid var(--border); border-radius: 4px; background: var(--surface); color: var(--text); font: inherit; cursor: pointer; }
.opt:hover:not(:disabled) { border-color: var(--text); background: var(--surface); }
.opt:disabled { cursor: default; }
.opt .num { flex: none; width: 24px; height: 24px; margin-top: 1px; border-radius: 50%; display: grid; place-items: center; border: 1px solid currentColor; background: transparent; font-weight: 600; font-size: 13px; }
.opt.correct { border-color: var(--good); background: var(--good-soft); box-shadow: inset 3px 0 0 var(--good); }
.opt.correct .num { background: var(--good); border-color: var(--good); color: var(--surface); }
.opt.wrong { border-color: var(--bad); background: var(--bad-soft); box-shadow: inset 3px 0 0 var(--bad); }
.opt.wrong .num { background: var(--bad); border-color: var(--bad); color: var(--surface); }
.opt.dim { opacity: .55; }
.feedback { margin-top: 16px; padding: 14px 16px; border-radius: 0; background: transparent; border-top: 1px solid var(--text); }
.feedback .verdict { font-weight: 700; margin-bottom: 4px; }
.feedback.ok .verdict { color: var(--good); }
.feedback.ng .verdict { color: var(--bad); }
.nav-row { display: flex; gap: 8px; margin-top: 16px; align-items: center; flex-wrap: wrap; }
.kbd-hint { font-size: 12px; color: var(--muted); }

/* 실기 */
textarea.answer { width: 100%; min-height: 140px; resize: vertical; padding: 12px; border-radius: 4px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; line-height: 1.6; }
textarea.answer:focus { outline: none; border-color: var(--text); }
.reveal { margin-top: 16px; display: flex; flex-direction: column; gap: 12px; }
.box { border-radius: 4px; padding: 14px 16px; border: 1px solid var(--border); }
.box h4 { margin: 0 0 8px; font-size: 14px; color: var(--muted); }
.box.model { background: var(--surface-2); }
.box.trap { background: var(--warn-soft); border-color: transparent; box-shadow: inset 3px 0 0 var(--warn); }
.box.trap h4 { color: var(--warn); }
.kw { display: flex; flex-wrap: wrap; gap: 6px; }
.kw span { font-size: 14px; padding: 2px 8px; border-radius: 2px; border: 1px solid var(--border); background: var(--surface); }
.kw span.hit { border-color: var(--good); background: var(--good-soft); color: var(--good); }
.grade { display: flex; gap: 8px; flex-wrap: wrap; }
.grade .btn { flex: 1; min-width: 90px; }
.grade .btn.on-o { background: var(--good); border-color: var(--good); color: #fff; }
.grade .btn.on-t { background: var(--warn); border-color: var(--warn); color: #fff; }
.grade .btn.on-x { background: var(--bad); border-color: var(--bad); color: #fff; }

/* 결과 */
.result { padding: 24px; text-align: center; }
.result .big { font-size: 44px; font-weight: 800; font-variant-numeric: tabular-nums; }
.review { margin-top: 16px; display: flex; flex-direction: column; gap: 8px; }
.review-item { padding: 12px 14px; display: flex; gap: 10px; align-items: flex-start; }
.review-item .mark { flex: none; width: 24px; text-align: center; font-weight: 800; }
.review-item .mark.ok { color: var(--good); }
.review-item .mark.ng { color: var(--bad); }
.review-item .mark.mid { color: var(--warn); }
.review-item .body { flex: 1; min-width: 0; font-size: 15px; }
.review-item .body .sub { color: var(--muted); font-size: 14px; margin-top: 2px; }

/* ── 개념 ── */
.concept-layout { display: grid; grid-template-columns: 240px 1fr; gap: 24px; align-items: start; }
.toc { position: sticky; top: 70px; max-height: calc(100vh - 90px); overflow: auto; padding: 10px; font-size: 14px; }
.toc .g { font-size: 12px; font-weight: 700; color: var(--muted); margin: 12px 8px 4px; }
.toc .g:first-child { margin-top: 2px; }
.toc a { display: block; padding: 5px 8px; border-radius: 0; border-left: 2px solid transparent; color: var(--text); line-height: 1.4; }
.toc a:hover { background: var(--surface-2); text-decoration: none; }
.toc a.on { background: transparent; color: var(--text); border-left-color: var(--text); font-weight: 700; }
.toc-select { display: none; width: 100%; padding: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; margin-bottom: 14px; border-radius: 4px; }
.doc { padding: 24px 28px; min-width: 0; }
.doc h1 { font-size: 24px; }
.doc h3 { font-size: 18px; margin: 28px 0 10px; padding-top: 12px; border-top: 1px solid var(--border); letter-spacing: -0.01em; }
.doc h4 { font-size: 16px; margin: 20px 0 8px; }
.doc table { border-collapse: collapse; width: 100%; margin: 12px 0; font-size: 15px; display: block; overflow-x: auto; }
.doc th, .doc td { border: 1px solid var(--border); padding: 7px 10px; text-align: left; vertical-align: top; }
.doc th { background: var(--surface-2); white-space: nowrap; }
.doc blockquote { margin: 12px 0; padding: 4px 14px; border-left: 2px solid var(--text); background: transparent; color: var(--muted); border-radius: 0; }
.doc blockquote p { margin: 4px 0; }
.doc pre { background: var(--surface-2); padding: 12px 14px; border-radius: 3px; overflow-x: auto; font-size: 14px; line-height: 1.5; }
.doc pre code { background: none; padding: 0; }
.doc ul, .doc ol { padding-left: 1.4em; }
.doc li { margin: 2px 0; }
.doc hr { border: 0; border-top: 1px solid var(--border); margin: 20px 0; }
.rich p { margin: 0 0 .5em; }
.rich p:last-child { margin-bottom: 0; }
.rich table { border-collapse: collapse; margin: 8px 0; font-size: 14px; display: block; overflow-x: auto; }
.rich th, .rich td { border: 1px solid var(--border); padding: 5px 9px; text-align: left; }
.rich th { background: var(--surface); }
.rich ul, .rich ol { padding-left: 1.3em; margin: 4px 0; }
.rich pre { overflow-x: auto; background: var(--surface-2); padding: 10px 12px; border-radius: 3px; font-size: 13px; line-height: 1.5; margin: 8px 0; }
.rich pre code { background: none; padding: 0; font-size: inherit; border-radius: 0; }
.qtext pre { font-weight: 400; }
@media (max-width: 560px) { .rich pre:has(> code.language-c, > code.language-java, > code.language-python, > code.language-sql) { white-space: pre-wrap; overflow-wrap: anywhere; } } /* 휴대폰: 프로그램 코드만 줄바꿈 (래더도·출력 결과는 그대로) */
.doc-foot { margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 12px; }
.pager { display: flex; gap: 8px; justify-content: space-between; flex-wrap: wrap; }

@media (max-width: 760px) {
  h1 { font-size: 22px; }
  .concept-layout { grid-template-columns: 1fr; }
  .toc { display: none; }
  .toc-select { display: block; }
  .doc { padding: 18px 16px; }
  .qcard { padding: 16px; }
  .qtext { font-size: 17px; }
  .crumbs { display: none; }
  .topbar-inner { justify-content: space-between; }
}

/* ── 북마크 ── */
.star { border: 0; background: none; padding: 0 2px; font-size: 20px; line-height: 1; cursor: pointer; color: var(--muted); font-family: inherit; }
.star.on { color: var(--text); }

/* ── 모의고사 ── */
.mock-hero { padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.mock-hero h2 { margin: 0 0 4px; }
.mock-hero p { margin: 0; }
.table-wrap { overflow-x: auto; }
table.hist { width: 100%; border-collapse: collapse; font-size: 15px; }
table.hist th, table.hist td { padding: 9px 14px; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; }
table.hist tr:last-child td { border-bottom: 0; }
table.hist th { color: var(--muted); font-weight: 600; font-size: 13px; }
table.hist .num { font-variant-numeric: tabular-nums; }
.cbt-bar { position: sticky; top: 55px; z-index: 5; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 10px 14px; margin-bottom: 14px; }
.clock { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 17px; }
.clock.urgent { color: var(--bad); }
.cbt-layout { display: grid; grid-template-columns: 1fr 260px; gap: 16px; align-items: start; }
.opt.sel, .opt.sel:hover:not(:disabled) { border-color: var(--text); background: var(--surface-2); }
.opt.sel .num { background: var(--ink); border-color: var(--ink); color: var(--ink-text); }
div.opt { cursor: default; }
.sheet { padding: 12px; position: sticky; top: 120px; }
.sheet-h { font-weight: 700; font-size: 14px; margin-bottom: 8px; cursor: pointer; list-style: none; }
.sheet-h::-webkit-details-marker { display: none; }
.sheet-h::after { content: " ▾"; color: var(--muted); }
details.sheet:not([open]) .sheet-h { margin-bottom: 0; }
details.sheet:not([open]) .sheet-h::after { content: " ▸"; }
.sheet-h .muted { font-weight: 400; font-size: 12px; }
.sheet-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.cell { border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 2px; padding: 3px 0; cursor: pointer; font-family: inherit; display: flex; flex-direction: column; align-items: center; line-height: 1.2; }
.cell .i { font-size: 11px; color: var(--muted); }
.cell .a { font-size: 14px; font-weight: 700; min-height: 17px; color: var(--text); }
.cell.filled { background: var(--surface-2); }
.cell.cur { border-color: var(--text); box-shadow: inset 0 0 0 1px var(--text); }
details.rv { padding: 0; }
details.rv summary { padding: 12px 14px; cursor: pointer; list-style: none; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
details.rv summary::-webkit-details-marker { display: none; }
details.rv summary .mark { font-weight: 800; color: var(--bad); }
details.rv summary .sub { width: 100%; color: var(--muted); font-size: 14px; padding-left: 20px; }
.rv-body { padding: 0 16px 16px; }
.pm-list { display: flex; flex-direction: column; gap: 12px; }
.cat-h { margin: 18px 0 2px; font-size: 16px; color: var(--muted); }
.score-pill { font-weight: 800; font-size: 16px; padding: 1px 10px; border-radius: 2px; border: 1px solid var(--border); font-variant-numeric: tabular-nums; }
.score-pill.good { border-color: currentColor; color: var(--good); }
.score-pill.bad { border-color: currentColor; color: var(--bad); }
.mock-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }

@media (max-width: 760px) {
  .cbt-layout { grid-template-columns: 1fr; }
  .sheet { position: static; }
  .sheet-grid { grid-template-columns: repeat(6, 1fr); }
  .cbt-bar { top: 55px; gap: 10px; }
}

/* ── 암기카드 ── */
.flash { min-height: 260px; padding: 28px 24px; border-radius: 6px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); cursor: pointer; display: flex; flex-direction: column; gap: 14px; text-align: center; justify-content: center; outline: none; }
.flash:focus-visible { border-color: var(--text); }
.flash-deck { font-size: 13px; }
.flash-front { font-size: 22px; font-weight: 700; line-height: 1.5; }
.flash-hint { font-size: 14px; margin-top: 8px; }
.flash-back { border-top: 1px solid var(--border); padding-top: 16px; font-size: 18px; color: var(--text); font-weight: 700; }
.flash-extra { margin-top: 10px; font-size: 14px; color: var(--muted); font-weight: 400; text-align: left; }
.flash.flipped { cursor: default; }
.kbd { font-size: 11px; opacity: .7; border: 1px solid currentColor; border-radius: 4px; padding: 0 4px; margin-left: 4px; font-weight: 600; }

/* ── 학습 현황 ── */
.tabs .tab-stats { margin-left: auto; }
.mini { font-size: 13px; color: var(--muted); font-weight: 600; }
.todo { padding: 14px 18px; margin-bottom: 14px; }
.todo ul { margin: 6px 0 0; padding-left: 1.2em; }
.todo li { margin: 3px 0; }
.chart-card { padding: 16px 18px; }
.chart-h { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; margin-bottom: 10px; }
.chart-h .muted { font-size: 13px; }
.chart { display: flex; gap: 8px; height: 170px; }
.chart .y { display: flex; flex-direction: column; justify-content: space-between; font-size: 11px; color: var(--muted); text-align: right; padding-bottom: 20px; min-width: 22px; font-variant-numeric: tabular-nums; }
.chart .cols { flex: 1; display: flex; gap: 2px; position: relative; border-bottom: 1px solid var(--border); padding-bottom: 0; }
.chart .col { flex: 1; display: flex; flex-direction: column; align-items: center; outline: none; cursor: default; }
.chart .plot { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; background: linear-gradient(var(--border), var(--border)) 0 50% / 100% 1px no-repeat; }
.chart .plot i { display: block; width: 70%; max-width: 26px; background: var(--ink); border-radius: 0; min-height: 0; opacity: .75; }
.chart .plot i.today { opacity: 1; }
.chart .col:hover .plot i, .chart .col:focus .plot i { opacity: 1; box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--text); }
.chart .x { height: 20px; font-size: 11px; color: var(--muted); padding-top: 3px; white-space: nowrap; }
.chart .tip { position: absolute; top: -6px; transform: translate(-50%, -100%); background: var(--text); color: var(--bg); font-size: 12px; padding: 5px 9px; border-radius: 2px; white-space: nowrap; pointer-events: none; z-index: 2; }
@media (max-width: 760px) {
  .flash-front { font-size: 19px; }
  .chart .x { font-size: 10px; }
}

/* ── 검색 ── */
.search-box { margin-bottom: 14px; }
.search-box input { width: 100%; font: inherit; font-size: 17px; padding: 12px 16px; border-radius: 4px; border: 1px solid var(--border); background: var(--surface); color: var(--text); -webkit-appearance: none; appearance: none; }
.search-box input:focus { outline: none; border-color: var(--text); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips.filters { margin-bottom: 10px; }
.chip { border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 3px; padding: 5px 12px; font: inherit; font-size: 14px; cursor: pointer; }
.chip.on { background: var(--ink); border-color: var(--ink); color: var(--ink-text); font-weight: 600; }
.hits { display: flex; flex-direction: column; gap: 8px; }
.hit { display: block; padding: 12px 14px; color: var(--text); }
.hit:hover { text-decoration: none; border-color: var(--text); }
.hit .meta { display: flex; gap: 8px; align-items: center; font-size: 13px; margin-bottom: 4px; flex-wrap: wrap; }
.hit .hd { font-weight: 600; line-height: 1.5; }
.hit .sn { color: var(--muted); font-size: 14px; margin-top: 2px; }
.hit .card-qa div { color: var(--muted); font-size: 15px; margin-top: 2px; }
mark { background: color-mix(in srgb, #e8c547 40%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }

/* ── 반응형 공통 ── */
.name-short { display: none; }
.back-btn { display: none; }
.tabs .tab-right { margin-left: auto; }
.subtabs { max-width: 100%; overflow-x: auto; }
.subtabs a { white-space: nowrap; }
.swipe-hint { display: none; }
.flash { transition: transform .12s ease-out, border-color .12s; }
.flash.swipe-ok { border-color: var(--good); }
.flash.swipe-ng { border-color: var(--bad); }

@media (hover: none) {
  .kbd, .kbd-hint { display: none; }
  .swipe-hint { display: block; text-align: center; font-size: 13px; margin-top: 10px; }
  .opt:hover:not(:disabled) { border-color: var(--border); background: var(--surface); }
  .opt.sel:hover:not(:disabled) { border-color: var(--text); background: var(--surface-2); }
  .btn:hover, .set-card:hover, .exam-card:hover, .hit:hover { border-color: var(--border); }
  .btn.primary:hover { border-color: var(--ink); }
}

@media (max-width: 760px) {
  body { font-size: 16px; }
  main.container { padding-top: 14px; padding-bottom: calc(40px + env(safe-area-inset-bottom)); }
  .topbar-inner { gap: 8px; padding: 8px 12px; }
  .back-btn { display: grid; }
  .brand { flex: 1; min-width: 0; }
  h1 { font-size: 21px; }
  .name-full { display: none; }
  .name-short { display: inline; }
  .tabs { margin: 10px 0 14px; }
  .tabs a { padding: 10px 12px; }
  .tabs .lbl { display: none; }
  .subtabs { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; width: 100%; margin-bottom: 14px; }
  .subtabs a { text-align: center; padding: 8px 2px; font-size: 14px; }
  .stats { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat { padding: 12px 14px; }
  .stat .v { font-size: 19px; }
  .quick .btn { flex: 1 1 calc(50% - 8px); padding: 10px 8px; font-size: 14px; }
  .quick .btn.primary { flex-basis: 100%; }
  .quick .spacer { display: none; }
  .quick .btn.ghost { flex-basis: 100%; }
  .set-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .mock-grid { grid-template-columns: 1fr; }
  .set-card { min-height: 0; padding: 11px 12px; }
  .group-h { margin: 20px 0 8px; flex-wrap: wrap; }
  .quiz-head h1 { font-size: 17px; }
  .dot { width: 30px; height: 30px; }
  .qcard .nav-row { position: sticky; bottom: 0; z-index: 3; background: var(--surface); margin: 16px -16px -16px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid var(--border); border-radius: 0 0 var(--radius) var(--radius); }
  .qcard .nav-row .btn { padding: 11px 18px; }
  .qcard .nav-row.reveal-row { position: static; margin: 12px 0 0; padding: 0; border-top: 0; background: none; }
  .qcard .nav-row.reveal-row .btn { flex: 1; }
  .qcard .nav-row .btn.primary { flex: 1; }
  .grade .btn { min-width: 0; padding: 11px 6px; }
  .opt { padding: 13px 12px; }
  .cbt-bar { padding: 8px 12px; gap: 8px 12px; }
  .cbt-bar { flex-wrap: nowrap; }
  .cbt-bar > b { display: none; }
  .cbt-bar .muted { white-space: nowrap; font-size: 14px; }
  #pmBar { flex-wrap: wrap; }
  #pmBar > b { display: block; width: 100%; font-size: 15px; }
  .clock { font-size: 16px; }
  .result { padding: 20px 14px; }
  .result .big { font-size: 38px; }
  .flash { min-height: 300px; padding: 24px 18px; }
  .doc h3 { font-size: 17px; }
  .doc table { font-size: 14px; }
  table.hist th, table.hist td { padding: 8px 10px; }
  .chart { height: 150px; }
  .footer { font-size: 12px; }
}

/* ── 문제 화면 개념 패널 ── */
.concept-btn { order: 99; margin-left: auto; border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 3px; padding: 1px 10px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.concept-btn:hover { border-color: var(--text); }
.linkish { border: 0; background: none; padding: 0; font: inherit; color: var(--accent); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.linkish:hover { text-decoration: underline; }
.drawer-backdrop { position: fixed; inset: 0; background: rgba(10, 12, 16, .45); z-index: 40; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(520px, 94vw); z-index: 41; background: var(--surface); border-left: 1px solid var(--border); display: flex; flex-direction: column; box-shadow: none; animation: drawer-in .18s ease-out; }
@keyframes drawer-in { from { transform: translateX(24px); opacity: .6; } to { transform: none; opacity: 1; } }
.drawer-head { display: flex; gap: 10px; align-items: flex-start; padding: 14px 16px 8px; padding-top: calc(14px + env(safe-area-inset-top)); }
.drawer-title { flex: 1; min-width: 0; }
.drawer-title .muted { font-size: 12px; }
.drawer-title b { display: block; font-size: 17px; line-height: 1.4; }
.drawer-tools { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 16px 10px; border-bottom: 1px solid var(--border); }
.drawer .drawer-body { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding: 12px 18px calc(24px + env(safe-area-inset-bottom)); }
.drawer .drawer-body.doc h3:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
body.drawer-lock { overflow: hidden; }
@media (max-width: 760px) {
  .drawer { top: auto; left: 0; width: auto; height: 84vh; border-left: 0; border-top: 1px solid var(--border); border-radius: 8px 8px 0 0; box-shadow: none; animation-name: sheet-in; }
  @keyframes sheet-in { from { transform: translateY(40px); opacity: .6; } to { transform: none; opacity: 1; } }
  .drawer-head { padding-top: 14px; }
  .drawer-head::before { content: ""; position: absolute; left: 50%; top: 6px; width: 40px; height: 4px; margin-left: -20px; border-radius: 4px; background: var(--border); }
}
.drawer[hidden], .drawer-backdrop[hidden] { display: none; }
.drawer-head { position: relative; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 4px; padding: 0; gap: 0; }
.seg button { border: 0; background: none; color: var(--muted); font: inherit; font-size: 13px; font-weight: 600; padding: 5px 10px; border-radius: 0; cursor: pointer; white-space: nowrap; }
.seg button.on { background: var(--ink); color: var(--ink-text); }
.concept-note { font-size: 16px; line-height: 1.75; }
.concept-note ul { padding-left: 1.2em; margin: 0 0 12px; }
.concept-note li { margin: 4px 0; }
.concept-note p:last-child { margin-top: 12px; color: var(--muted); font-size: 14px; }

/* ── 풀면서 배우기 ── */
.cf-toggle { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 4px; padding: 6px 12px 6px 6px; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.cf-toggle .sw { width: 34px; height: 20px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--border); position: relative; transition: background .15s; }
.cf-toggle .sw::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--muted); transition: transform .15s, background .15s; }
.cf-toggle.on { border-color: var(--text); color: var(--text); }
.cf-toggle.on .sw { background: var(--ink); border-color: var(--ink); }
.cf-toggle.on .sw::after { transform: translateX(14px); background: var(--ink-text); }
.cf-row { margin: -4px 0 12px; }
.box.concept { background: var(--surface); border-color: var(--border); box-shadow: inset 3px 0 0 var(--accent); }
.box.concept h4 { color: var(--accent); }
.box.concept.first { margin-bottom: 14px; }
.box.concept .concept-note { font-size: 15px; line-height: 1.7; }
.box.nudge { border: 1px solid var(--warn); background: var(--surface); }
.box.nudge h4 { color: var(--warn); }
.path-card { padding: 16px 18px; margin-bottom: 14px; border-top: 2px solid var(--text); }
.path-top { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 10px; }
.path-top > div:first-child { flex: 1; min-width: 0; }
.path-kicker { font-size: 13px; font-weight: 700; color: var(--muted); margin-bottom: 2px; }
.path-num { font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.path-num span { font-size: 15px; color: var(--muted); font-weight: 600; }
.path-tip { font-size: 13px; margin-top: 10px; }
.path-intro { padding: 16px 18px; margin-bottom: 8px; }
.path-intro ol { margin: 8px 0 12px; padding-left: 1.3em; }
.path-intro li { margin: 3px 0; }
.path-step { margin-top: 22px; }
.step-h { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 10px; }
.step-h h2 { margin: 0; font-size: 17px; }
.step-no { flex: none; width: 28px; height: 28px; border-radius: 2px; display: grid; place-items: center; border: 1px solid var(--border); color: var(--muted); font-weight: 800; }
.path-step.cur .step-no { background: var(--ink); border-color: var(--ink); color: var(--ink-text); }
.path-step.complete .step-no { border-color: var(--good); color: var(--good); }
@media (max-width: 760px) {
  .path-card .btn.primary { flex-basis: 100%; }
  .path-card .cf-toggle { margin-top: 2px; }
}

/* ══ 그림 개념 (viz.js) ══ */
:root {
  --vz-ink: #1e1d1a; --vz-muted: #6b665c; --vz-line: #cdc7ba; --vz-soft: #f1eee7; --vz-bg: #fcfbf8;
  --vz-sun: #f2a516; --vz-dc: #e0761f; --vz-ac: #1f8a4c; --vz-e: #2f6fde; --vz-h: #d0453a;
  --vz-panel: #2b4a7a; --vz-panel2: #4d75b3; --vz-n: #dce8fb; --vz-p: #fbe1de; --vz-warn: #c9372c; --vz-ok: #1f8a4c;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --vz-ink: #ebe7de; --vz-muted: #a39d91; --vz-line: #47443d; --vz-soft: #262521; --vz-bg: #1c1b19;
    --vz-sun: #f5b942; --vz-dc: #f08d3c; --vz-ac: #4cc27e; --vz-e: #6d9cf0; --vz-h: #f07167;
    --vz-panel: #3a5f99; --vz-panel2: #6f93cf; --vz-n: #1d2a41; --vz-p: #3a2220; --vz-warn: #f07167; --vz-ok: #4cc27e;
  }
}
:root[data-theme="dark"] {
  --vz-ink: #ebe7de; --vz-muted: #a39d91; --vz-line: #47443d; --vz-soft: #262521; --vz-bg: #1c1b19;
  --vz-sun: #f5b942; --vz-dc: #f08d3c; --vz-ac: #4cc27e; --vz-e: #6d9cf0; --vz-h: #f07167;
  --vz-panel: #3a5f99; --vz-panel2: #6f93cf; --vz-n: #1d2a41; --vz-p: #3a2220; --vz-warn: #f07167; --vz-ok: #4cc27e;
}
.viz { margin: 16px 0; }
.vz { margin: 0; border: 1px solid var(--border); border-radius: 4px; background: var(--surface); overflow: hidden; }
.vz-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--surface); }
.vz-kind { font-size: 12px; font-weight: 600; color: var(--muted); border: 1px solid var(--border); border-radius: 2px; padding: 0 6px; white-space: nowrap; }
.vz-title { font-size: 15px; font-weight: 700; flex: 1; min-width: 0; }
.vz-play { border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 3px; padding: 3px 10px; font: inherit; font-size: 13px; cursor: pointer; }
.vz-stage { padding: 10px; }
.vz-svg { display: block; width: 100%; height: auto; margin: 0 auto; font-family: inherit; overflow: visible; }
.vz-svg text { fill: var(--vz-ink); }
.vz-ctrl { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: flex-end; padding: 4px 14px 12px; }
.vz-slider { display: flex; flex-direction: column; gap: 4px; flex: 1 1 200px; font-size: 14px; }
.vz-sl-top { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); }
.vz-sl-top b { color: var(--text); font-variant-numeric: tabular-nums; }
.vz-slider input[type=range] { width: 100%; accent-color: var(--ink); }
.vz-seg { display: inline-flex; border: 1px solid var(--border); border-radius: 4px; padding: 0; gap: 0; flex-wrap: wrap; overflow: hidden; }
.vz-seg button { border: 0; background: none; color: var(--muted); font: inherit; font-size: 14px; font-weight: 600; padding: 6px 12px; border-radius: 0; cursor: pointer; }
.vz-seg button.on { background: var(--ink); color: var(--ink-text); }
.vz-readout { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 14px; width: 100%; }
.vz-readout span { white-space: nowrap; }
.vz-readout b { font-variant-numeric: tabular-nums; }
.vz-cap { padding: 0 14px 14px; font-size: 14px; color: var(--muted); line-height: 1.6; }
.vz-cap b { color: var(--text); }
/* 만화 */
div.vz-comic { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.vz-panel { position: relative; border: 1.5px solid var(--vz-ink); border-radius: 3px; background: var(--vz-bg); padding: 8px 8px 10px; display: flex; flex-direction: column; gap: 6px; }
.vz-panel.tone-warn { border-color: var(--vz-warn); }
.vz-panel.tone-ok { border-color: var(--vz-ok); }
.vz-pno { position: absolute; top: -10px; left: -8px; width: 22px; height: 22px; border-radius: 2px; background: var(--vz-ink); color: var(--vz-bg); font-weight: 800; font-size: 13px; display: grid; place-items: center; }
.vz-panel .vz-svg { max-height: 150px; }
.vz-bubble { position: relative; background: var(--surface-2); border-radius: 4px; padding: 7px 10px; font-size: 14px; line-height: 1.5; font-weight: 600; }
.vz-bubble::before { content: ""; position: absolute; top: -7px; right: 26px; border: 7px solid transparent; border-top: 0; border-bottom-color: var(--surface-2); }
.vz-pcap { font-size: 13px; color: var(--muted); }
.vz-pcap b { color: var(--text); }
@media (max-width: 760px) {
  .vz-stage { padding: 6px; }
  div.vz-comic { grid-template-columns: 1fr 1fr; gap: 8px; }
  .vz-bubble { font-size: 13px; }
}
@media (max-width: 420px) { div.vz-comic { grid-template-columns: 1fr; } }
/* 휴대폰: 그림은 화면 끝까지 넓히고, 그림 속 글자는 키운다 */
@media (max-width: 560px) {
  .viz .vz { width: 100vw; margin-left: calc(50% - 50vw); border-radius: 0; border-left: 0; border-right: 0; }
  .vz-stage { padding: 6px 2px; }
  .vz-stage .vz-svg { --vz-fs: 1.25; }
  .vz-panel .vz-svg { --vz-fs: 1; }
}
@media (prefers-reduced-motion: reduce) { .vz * { transition: none !important; } }
.vz-first { margin: 4px 0 20px; }
.vz-first > summary { cursor: pointer; font-weight: 700; padding: 8px 0; }
.vz-first > summary .muted { font-weight: 400; font-size: 13px; }
.vz-btn { margin-top: 10px; }
.drawer .drawer-body .viz:first-child { margin-top: 0; }
/* 개념서 본문 카드화 */
.doc .callout { border-radius: 4px; padding: 12px 16px; margin: 14px 0; border: 1px solid var(--border); }
.doc .callout .c-head { font-size: 13px; font-weight: 800; margin-bottom: 6px; }
.doc .callout > p:last-child, .doc .callout > ul:last-child, .doc .callout > ol:last-child { margin-bottom: 0; }
.doc .callout ul, .doc .callout ol { margin: 4px 0; }
.doc .c-point { background: var(--surface); border-color: var(--border); border-top: 2px solid var(--text); }
.doc .c-point .c-head { color: var(--text); }
.doc .c-memo { background: var(--warn-soft); border-color: transparent; }
.doc .c-memo .c-head { color: var(--warn); }
.doc .c-example { background: var(--surface-2); border-left: 3px solid var(--vz-dc); }
.doc .c-example .c-head { color: var(--vz-dc); }
.doc .c-q { background: var(--surface-2); border-left: 3px solid var(--accent); }
.doc .c-q .c-head { color: var(--accent); }
.doc .c-a { background: var(--good-soft); border-color: transparent; }
.doc .c-a .c-head { color: var(--good); }
.flip-tip { font-size: 13px; margin: 0 0 8px; }
.flipgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; margin: 0 0 16px; }
.flip { position: relative; text-align: left; border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 4px; padding: 12px 12px 12px 40px; font: inherit; font-size: 14px; line-height: 1.5; cursor: pointer; min-height: 64px; }
.flip .fn { position: absolute; left: 10px; top: 11px; width: 22px; height: 22px; border-radius: 2px; border: 1px solid var(--border); color: var(--muted); font-size: 12px; font-weight: 800; display: grid; place-items: center; }
.flip .fb { display: none; color: var(--text); font-weight: 700; margin-top: 6px; }
.flip.on { border-color: var(--text); background: var(--surface); }
.flip.on .fb { display: block; }
@media (hover: hover) { .flip:hover { border-color: var(--text); } }
.tabs .ic { vertical-align: -3px; }
/* 서비스명 두배로 · do better */
.brand { align-items: baseline; }
.brand-tag { font-size: 12px; font-weight: 600; letter-spacing: .02em; color: var(--muted); margin-left: 6px; }
.home-h1 { font-size: 34px; letter-spacing: -0.03em; }
.h1-tag { font-size: 17px; font-weight: 600; letter-spacing: .02em; color: var(--muted); margin-left: 4px; }
@media (max-width: 760px) { .home-h1 { font-size: 28px; } .h1-tag { font-size: 15px; } }
@media (max-width: 360px) { .brand-tag { display: none; } }
.lead.slogan { color: var(--text); font-size: 19px; font-weight: 700; letter-spacing: -0.01em; margin: 2px 0 4px; }
.lead.sub { font-size: 15px; }
@media (max-width: 760px) { .lead.slogan { font-size: 17px; } }
.qtext table { font-weight: 400; font-size: 15px; } .qtext th { font-weight: 700; }

/* ════════════ 홈 히어로(루프 모션) — assets/hero.js ════════════ */
.hero { position: relative; margin: 0 0 28px; border-radius: 10px; overflow: hidden; background: #0b1324; color: #fff; isolation: isolate; }
.hero-visual { position: relative; width: 100%; aspect-ratio: 16 / 9; max-height: 560px; overflow: hidden; opacity: 0; transition: opacity .9s ease; }
.hero.is-ready .hero-visual { opacity: 1; }
.hero-kb, .hero-cam, .hero-jolt, .hero-img, .hero-fx, .hero-leak, .hero-scrim { position: absolute; inset: 0; }
/* 레일 이음매 덜컹–덜컹: 두 번 튀고 잦아드는 리듬을 1.8초마다 */
.hero-jolt { animation: hero-jolt 1.8s linear infinite; will-change: transform; }
.hero-kb { transform-origin: 62% 55%; animation: hero-kb 30s ease-in-out infinite alternate; will-change: transform; }
.hero-cam { animation: hero-sway 6.5s ease-in-out infinite; will-change: transform; }
.hero-img, .hero-fx { width: 100%; height: 100%; display: block; object-fit: cover; }
.hero-clouds ellipse { animation: hero-cloud linear infinite; }
.hero-train { transform: translate(1580px, 440px); animation: hero-train 14s linear infinite 1s; }
.hero-spark { opacity: 0; transform-box: fill-box; transform-origin: center; animation: hero-twinkle ease-in-out infinite; }
.hero-pole { transform: translateX(560px); animation: hero-pole 9s linear infinite; }
.hero-post { transform-box: view-box; transform-origin: 269px 468px; transform: scale(.45); animation: hero-rail 3.2s linear infinite; }
.hero-sign circle { fill: none; stroke: #8f84ff; stroke-width: 2; vector-effect: non-scaling-stroke; opacity: 0; transform-box: fill-box; transform-origin: center; animation: hero-ring 2.4s ease-out infinite; }
.hero-sign circle:nth-child(2) { animation-delay: .8s; }
.hero-sign circle:nth-child(3) { animation-delay: 1.6s; }
.hero-formula { fill: rgba(47,107,255,.12); stroke: #2f6bff; stroke-width: 2.5; stroke-linejoin: round; opacity: .2; animation: hero-pulse 3.2s ease-in-out infinite; }
.hero-current circle { fill: #2f6bff; transform: translate(620px, 682.5px); animation: hero-current 4s linear infinite; }
.hero-leak { background: radial-gradient(circle at 96% 4%, rgba(255,243,214,.55), rgba(255,213,154,.18) 22%, rgba(255,159,107,0) 45%); mix-blend-mode: screen; animation: hero-leak 9s ease-in-out infinite; pointer-events: none; }
.hero-sweep { position: absolute; top: 0; bottom: 0; left: 0; width: 50%; background: linear-gradient(100deg, transparent 20%, rgba(20,30,60,.75) 50%, transparent 80%); mix-blend-mode: multiply; opacity: 0; transform: translateX(-100%); animation: hero-sweep 9s linear infinite; pointer-events: none; }
.hero-scrim { background: linear-gradient(90deg, rgba(8,14,30,.9) 0%, rgba(8,14,30,.66) 30%, rgba(8,14,30,0) 58%), linear-gradient(0deg, rgba(8,14,30,.55) 0%, rgba(8,14,30,0) 35%); pointer-events: none; }
.hero-copy { position: absolute; left: 44px; bottom: 40px; max-width: 470px; z-index: 2; }
.hero-copy > * { animation: hero-up .9s cubic-bezier(.2,.8,.2,1) both; }
.hero-copy > :nth-child(2) { animation-delay: .1s; }
.hero-copy > :nth-child(3) { animation-delay: .2s; }
.hero-copy > :nth-child(4) { animation-delay: .3s; }
.hero-eyebrow { margin: 0 0 10px; font-size: 13px; font-weight: 700; letter-spacing: .14em; color: #9fb4dc; }
.hero-title { margin: 0 0 12px; font-size: 44px; line-height: 1.16; font-weight: 800; letter-spacing: -.035em; color: #fff; }
.hero-title em { font-style: normal; background: linear-gradient(100deg, #fff 10%, #9fc0ff 55%, #fff 95%); background-size: 220% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: hero-shine 6s ease-in-out infinite; }
.hero-lead { margin: 0 0 20px; font-size: 16px; line-height: 1.6; color: #cfd8ea; }
.hero-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.hero-btn { display: inline-flex; align-items: center; gap: 8px; border: 0; border-radius: 999px; padding: 12px 20px; background: #fff; color: #0b1324; font: inherit; font-size: 15px; font-weight: 700; cursor: pointer; }
.hero-btn:hover { background: #e6edfb; }
.hero-btn:focus-visible { outline: 3px solid #9fc0ff; outline-offset: 3px; }
.hero-stats { font-size: 14px; color: #b8c4dc; }
.hero.is-paused *, .hero.is-paused *::before { animation-play-state: paused !important; }
.home-h2 { font-size: 20px; letter-spacing: -.02em; margin: 0 0 12px; scroll-margin-top: 72px; }

@media (max-width: 760px) {
  .hero { margin: -14px -16px 24px; border-radius: 0; }
  .hero-visual { aspect-ratio: 1 / 1; max-height: 68svh; }
  .hero-scrim { background: linear-gradient(180deg, rgba(8,14,30,.3) 0%, rgba(8,14,30,0) 20%, rgba(8,14,30,0) 50%, rgba(11,19,36,.85) 82%, #0b1324 100%); }
  .hero-copy { position: relative; left: auto; bottom: auto; max-width: none; margin-top: -48px; padding: 0 20px 26px; }
  .hero-title { font-size: 30px; }
  .hero-lead { font-size: 15px; }
  .hero-sweep { width: 70%; }
}
@media (max-width: 360px) { .hero-title { font-size: 26px; } .hero-lead br { display: none; } }

@keyframes hero-kb { from { transform: scale(1.05) translate(0, 0); } to { transform: scale(1.11) translate(-1.2%, -.6%); } }
@keyframes hero-sway {
  0%, 100% { transform: translate(0, 0) rotate(0); }
  22% { transform: translate(-.25%, .3%) rotate(-.18deg); }
  48% { transform: translate(.15%, -.2%) rotate(.12deg); }
  71% { transform: translate(-.1%, .25%) rotate(-.08deg); }
}
@keyframes hero-jolt {
  0%, 30%, 100% { transform: translate(0, 0) rotate(0); }
  2.5% { transform: translate(-.6px, 3px) rotate(.07deg); }
  5% { transform: translate(.3px, -1.2px) rotate(-.03deg); }
  7.5% { transform: translate(0, .6px) rotate(0); }
  10% { transform: translate(0, 0); }
  15.5% { transform: translate(.6px, 2.6px) rotate(-.06deg); }
  18% { transform: translate(-.3px, -1px) rotate(.03deg); }
  20.5% { transform: translate(0, .5px); }
  23% { transform: translate(0, -.2px); }
}
@keyframes hero-cloud { to { transform: translateX(1100px); } }
@keyframes hero-train { 0% { transform: translate(1580px, 440px); } 72%, 100% { transform: translate(740px, 440px); } }
@keyframes hero-twinkle { 0% { opacity: 0; transform: translateX(-6px) scale(.4); } 50% { opacity: 1; transform: translateX(2px) scale(1.1); } 100% { opacity: 0; transform: translateX(10px) scale(.4); } }
@keyframes hero-pole { 0%, 84% { transform: translateX(560px); animation-timing-function: cubic-bezier(.55, 0, .9, .45); } 89%, 100% { transform: translateX(1700px); } }
@keyframes hero-sweep { 0%, 85.5% { opacity: 0; transform: translateX(-100%); } 86.5% { opacity: .55; } 90.5% { opacity: .55; } 91.5%, 100% { opacity: 0; transform: translateX(200%); } }
@keyframes hero-ring { 0% { opacity: .9; transform: scale(1); } 100% { opacity: 0; transform: scale(5); } }
@keyframes hero-pulse { 0%, 100% { opacity: .15; } 50% { opacity: .85; } }
@keyframes hero-current {
  0% { transform: translate(620px, 682.5px); } 30.2% { transform: translate(735px, 695px); }
  50.4% { transform: translate(721.5px, 771.5px); } 80% { transform: translate(609px, 757.5px); }
  100% { transform: translate(620px, 682.5px); }
}
@keyframes hero-leak { 0%, 100% { opacity: .55; transform: translate(0, 0); } 50% { opacity: 1; transform: translate(-1.5%, 1%); } }
@keyframes hero-up { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes hero-shine { 0%, 100% { background-position: 100% 0; } 50% { background-position: 0 0; } }
@media (prefers-reduced-motion: reduce) {
  .hero *, .hero *::before { animation: none !important; }
  .hero-visual { transition: none; }
  .hero-current, .hero-sign, .hero-pole, .hero-sweep, .hero-rail { display: none; }
  .hero-kb { transform: scale(1.05); }
}
