/* 족장국어 구매자 자료실 · 공통 스타일 v2
 * 브랜드: 먹색 + 문법 오렌지 / 독서 파랑, Noto Sans KR
 * 현대적인 둥근 면·부드러운 그림자·움직임. prefers-reduced-motion 이면 움직임 끔.
 */
:root {
  --ink: #16161A;
  --ink-2: #2B2B31;
  --bg: #FAF9F6;
  --surface: #FFFFFF;
  --sub: #5A5A63;
  --line: #E9E5DF;
  --line-2: #F1EEE9;
  --soft: #FFF4EC;
  --ok: #15803D;
  --ok-soft: #ECFDF3;
  --danger: #B91C1C;
  --g: #C2410C;          /* 문법 */
  --r-: #1D4ED8;         /* 독서 */
  --acc: var(--g);
  --acc-2: #F97316;
  --acc-soft: #FFF1E7;
  --panel: #F4F2EE;
  --kakao: #FEE500;
  --kakao-ink: rgba(0, 0, 0, .85);
  --max: 1120px;
  --r: 18px;
  --r-sm: 12px;
  --r-pill: 999px;
  --sh-1: 0 1px 2px rgba(22, 22, 26, .04), 0 2px 8px rgba(22, 22, 26, .04);
  --sh-2: 0 2px 4px rgba(22, 22, 26, .04), 0 12px 32px -8px rgba(22, 22, 26, .12);
  --sh-3: 0 4px 8px rgba(22, 22, 26, .05), 0 28px 60px -16px rgba(22, 22, 26, .22);
  --ease: cubic-bezier(.22, 1, .36, 1);
  --grad: linear-gradient(100deg, #C2410C 0%, #F97316 40%, #6366F1 70%, #1D4ED8 100%);
  --grad-loop: linear-gradient(100deg, #C2410C 0%, #F97316 25%, #6366F1 50%, #F97316 75%, #C2410C 100%);
}
body[data-book="reading"] { --acc: var(--r-); --acc-2: #6366F1; --acc-soft: #EEF2FF; }

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #F3F1EC;
    --ink-2: #D9D6CF;
    --bg: #0E0E11;
    --surface: #17171B;
    --sub: #A6A3AC;
    --line: #2A2A31;
    --line-2: #202026;
    --soft: #1D1611;
    --ok: #4ADE80;
    --ok-soft: #0F2418;
    --danger: #F87171;
    --g: #FB8C4C;
    --r-: #7AA7FF;
    --acc-2: #FDBA74;
    --acc-soft: #2A1A10;
    --panel: #141418;
    --sh-1: 0 1px 2px rgba(0,0,0,.4);
    --sh-2: 0 12px 32px -8px rgba(0,0,0,.6);
    --sh-3: 0 28px 60px -16px rgba(0,0,0,.7);
    --grad: linear-gradient(100deg, #FB8C4C 0%, #FDBA74 35%, #A5B4FC 70%, #7AA7FF 100%);
    --grad-loop: linear-gradient(100deg, #FB8C4C 0%, #FDBA74 25%, #A5B4FC 50%, #FDBA74 75%, #FB8C4C 100%);
  }
  body[data-book="reading"] { --acc-2: #A5B4FC; --acc-soft: #141C33; }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: 'Noto Sans KR', system-ui, -apple-system, 'Apple SD Gothic Neo', sans-serif;
  font-size: 16px; line-height: 1.65; word-break: keep-all; overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
::selection { background: var(--acc); color: #fff; }
a { color: inherit; }
img, svg { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
input, select, textarea { font-size: 16px; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; font-weight: 900; letter-spacing: -.035em; }
p { margin: 0 0 1em; }
u { text-decoration-thickness: 2px; text-underline-offset: 3px; text-decoration-color: var(--acc); }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 660px; margin: 0 auto; padding: 0 20px; }
@media (max-width: 420px) { .wrap, .narrow { padding: 0 16px; } }
.muted { color: var(--sub); }
.small { font-size: 14px; }
.tiny { font-size: 13px; }
.acc { color: var(--acc); }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.grad-text { background: var(--grad-loop); background-size: 200% auto; -webkit-background-clip: text; background-clip: text; color: transparent; animation: gradShift 8s linear infinite; }
@keyframes gradShift { to { background-position: 200% center; } }

/* ---------- 머리·바닥 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(14px); backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent; transition: border-color .3s, box-shadow .3s;
}
.topbar.scrolled, body:not(.landing) .topbar { border-bottom-color: var(--line); }
.topbar.scrolled { box-shadow: var(--sh-1); }
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 900; text-decoration: none; letter-spacing: -.03em; font-size: 17px; }
.brand::before {
  content: ''; width: 26px; height: 26px; border-radius: 8px; flex: none;
  background: radial-gradient(circle at 50% 50%, var(--bg) 0 4px, transparent 4.5px), var(--grad-loop); background-size: 100% 100%, 200% auto;
  animation: gradShift 8s linear infinite; transform: rotate(-8deg);
}
.brand b { color: var(--acc); }
.topbar .who { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--sub); }
.topbar .who > span { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 480px) { .topbar .who > span { display: none; } }
.footer { border-top: 1px solid var(--line); margin-top: 80px; padding: 36px 0 48px; font-size: 14px; color: var(--sub); }
.footer nav { display: flex; flex-wrap: wrap; gap: 4px 20px; margin-top: 8px; }
.footer a { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; transition: color .2s; }
.footer a:hover { color: var(--ink); }
.landing .footer { margin-top: 24px; }

/* ---------- 버튼 ---------- */
.btn {
  position: relative; overflow: hidden; isolation: isolate;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 50px; padding: 0 22px; border: 1px solid var(--line); border-radius: var(--r-pill);
  background: var(--surface); color: var(--ink); font-weight: 700; font-size: 16px; text-decoration: none; cursor: pointer;
  box-shadow: var(--sh-1);
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), background .2s, border-color .2s, color .2s;
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--sh-2); border-color: color-mix(in srgb, var(--ink) 20%, var(--line)); }
.btn:active { transform: translateY(0) scale(.98); }
.btn::after { /* 빛 지나가기 */
  content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.45) 50%, transparent 70%);
  transform: translateX(-120%); transition: transform .7s var(--ease);
}
.btn:hover::after { transform: translateX(120%); }
.btn:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible, button:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--acc) 55%, transparent); outline-offset: 2px;
}
.btn-acc { background: var(--acc); border-color: transparent; color: #fff; box-shadow: 0 8px 24px -8px color-mix(in srgb, var(--acc) 70%, transparent); }
.btn-acc:hover { background: var(--acc); border-color: transparent; box-shadow: 0 14px 32px -10px color-mix(in srgb, var(--acc) 80%, transparent); }
@media (prefers-color-scheme: dark) { .btn-acc { color: #111; } }
.btn-ink { background: var(--ink); color: var(--bg); border-color: transparent; }
.btn-ink:hover { background: var(--ink); }
.btn-ghost { background: transparent; box-shadow: none; }
.btn-sm { min-height: 44px; padding: 0 16px; font-size: 14px; }
.btn-lg { min-height: 58px; padding: 0 28px; font-size: 17px; }
.btn-block { width: 100%; }
.btn-danger { border-color: color-mix(in srgb, var(--danger) 40%, transparent); color: var(--danger); }
.btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-kakao { background: var(--kakao); border-color: transparent; color: var(--kakao-ink); box-shadow: 0 8px 24px -10px rgba(180, 160, 0, .6); }
.btn-kakao:hover { background: var(--kakao); border-color: transparent; }
.btn-kakao svg { width: 20px; height: 20px; flex: none; }
.btn .arr { transition: transform .25s var(--ease); }
.btn:hover .arr, a:hover > .card-go .arr { transform: translateX(4px); }
.linkbtn { background: none; border: 0; padding: 0 4px; min-height: 44px; text-decoration: underline; cursor: pointer; color: var(--sub); font-size: 14px; }

/* ---------- 배지·라벨 ---------- */
.label {
  display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; letter-spacing: .02em;
  color: var(--acc); background: var(--acc-soft); padding: 6px 12px; border-radius: var(--r-pill); margin-bottom: 18px;
}
.label::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 0 currentColor; animation: pulse 2.4s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 50%, transparent); } 70%, 100% { box-shadow: 0 0 0 8px transparent; } }
.badges { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0 0 20px; list-style: none; }
.badges li { border: 1px solid var(--line); padding: 5px 12px; font-size: 13px; font-weight: 700; background: var(--surface); border-radius: var(--r-pill); }
.badges.acc li { border-color: color-mix(in srgb, var(--acc) 30%, transparent); color: var(--acc); background: var(--acc-soft); }
.tag { display: inline-flex; align-items: center; font-size: 12.5px; font-weight: 700; padding: 2px 10px; border-radius: var(--r-pill); background: color-mix(in srgb, currentColor 10%, transparent); }
.tag-ok { color: var(--ok); }
.tag-acc { color: var(--acc); }
.tag-mute { color: var(--sub); }

/* ---------- 섹션·카드 ---------- */
.section { padding: 72px 0; }
@media (max-width: 720px) { .section { padding: 56px 0; } }
.section h2 { font-size: clamp(26px, 5.2vw, 40px); }
.sec-head { max-width: 640px; margin-bottom: 32px; }
.sec-head p { color: var(--sub); font-size: 17px; }
.hero { padding: 48px 0 40px; }
.hero h1 { font-size: clamp(30px, 7vw, 46px); }
.hero .lead { font-size: 17px; color: var(--sub); max-width: 560px; }
.grid { display: grid; gap: 18px; }
@media (min-width: 720px) {
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
}
.card { position: relative; border: 1px solid var(--line); border-radius: var(--r); padding: 24px; background: var(--surface); box-shadow: var(--sh-1); }
.card h3 { font-size: 20px; }
.card.soft { background: var(--panel); box-shadow: none; }
.card-num { font-weight: 900; font-size: 14px; letter-spacing: .08em; color: var(--acc); margin-bottom: 6px; }
.icon { width: 30px; height: 30px; color: var(--acc); }
.icon-wrap {
  display: grid; place-items: center; width: 56px; height: 56px; border-radius: 16px; margin-bottom: 20px;
  background: var(--acc-soft); color: var(--acc); transition: transform .5s var(--ease);
}
a.card-link { display: flex; flex-direction: column; text-decoration: none; color: inherit; cursor: pointer; overflow: hidden;
  transition: transform .45s var(--ease), box-shadow .45s var(--ease), border-color .3s; }
a.card-link::before { /* 커서 따라오는 빛 */
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .3s;
  background: radial-gradient(360px circle at var(--mx, 50%) var(--my, 50%), color-mix(in srgb, var(--acc) 12%, transparent), transparent 60%);
}
a.card-link:hover { transform: translateY(-6px); box-shadow: var(--sh-3); border-color: color-mix(in srgb, var(--acc) 35%, var(--line)); }
a.card-link:hover::before { opacity: 1; }
a.card-link:hover .icon-wrap { transform: rotate(-8deg) scale(1.08); }
a.card-link .muted { flex: 1; }
.card-go { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--acc); font-size: 15px; margin-top: 4px; }
.card-go .arr { display: inline-block; transition: transform .25s var(--ease); }
.book-pick { justify-content: space-between; min-height: 60px; border-radius: var(--r-sm); }

/* 옛 단계 블록(다른 화면 호환) */
.steps { display: grid; gap: 0; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--surface); }
@media (min-width: 720px) { .steps { grid-template-columns: repeat(3, 1fr); } }
.step { padding: 22px; border-bottom: 1px solid var(--line); }
.step:last-child { border: 0; }
@media (min-width: 720px) { .step { border-bottom: 0; border-right: 1px solid var(--line); } }
.step .k { font-weight: 900; letter-spacing: .08em; color: var(--acc); font-size: 14px; }

.book-card { display: flex; flex-direction: column; overflow: hidden; }
.book-card[data-b="grammar"] { --acc: var(--g); --acc-soft: #FFF1E7; }
.book-card[data-b="reading"] { --acc: var(--r-); --acc-soft: #EEF2FF; }
@media (prefers-color-scheme: dark) {
  .book-card[data-b="grammar"] { --acc-soft: #2A1A10; }
  .book-card[data-b="reading"] { --acc-soft: #141C33; }
}
.book-card .grow { flex: 1; }
.book-card h3 { color: var(--acc); font-size: 24px; }
.band { background: var(--ink); color: var(--bg); padding: 28px 0; }
.band .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.notice { border: 1px solid color-mix(in srgb, var(--acc) 22%, transparent); background: var(--acc-soft); padding: 14px 18px; margin: 16px 0; border-radius: var(--r-sm); }
.notice.warn { border-color: color-mix(in srgb, var(--danger) 30%, transparent); background: color-mix(in srgb, var(--danger) 7%, var(--surface)); }
.config-warn { background: #7c2d12; color: #fff; padding: 10px 16px; font-size: 14px; text-align: center; }

/* ---------- 폼 ---------- */
.field { margin-bottom: 18px; }
.field > label, .field > .flabel { display: block; font-weight: 700; margin-bottom: 8px; }
.input, select.input, textarea.input {
  width: 100%; min-height: 50px; padding: 11px 14px; border: 1px solid var(--line); background: var(--surface);
  border-radius: var(--r-sm); transition: border-color .2s, box-shadow .2s;
}
textarea.input { min-height: 100px; resize: vertical; }
.input:focus { border-color: var(--acc); outline: none; box-shadow: 0 0 0 4px color-mix(in srgb, var(--acc) 15%, transparent); }
.check { display: flex; align-items: flex-start; gap: 10px; min-height: 44px; padding: 10px 0; cursor: pointer; }
.check input { width: 22px; height: 22px; margin: 2px 0 0; flex: none; accent-color: var(--acc); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 16px; border: 1px solid var(--line); border-radius: var(--r-pill); cursor: pointer; background: var(--surface); transition: all .2s; }
.chip:has(input:checked) { border-color: var(--acc); color: var(--acc); font-weight: 700; background: var(--acc-soft); }
.chip input { accent-color: var(--acc); width: 18px; height: 18px; margin: 0; }
.consent-box { border: 1px solid var(--line); background: var(--surface); padding: 4px 18px; margin-bottom: 16px; border-radius: var(--r); box-shadow: var(--sh-1); }
.consent-box.opt { box-shadow: none; background: var(--panel); }
.consent-box .row { border-bottom: 1px solid var(--line); }
.consent-box .row:last-child { border: 0; }
.req { color: var(--acc); font-weight: 700; font-size: 13px; }
.opt-t { color: var(--sub); font-weight: 700; font-size: 13px; }

/* ---------- 표 ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
.t th, .t td { border-bottom: 1px solid var(--line-2); padding: 12px 12px; text-align: left; vertical-align: top; }
.t tr:last-child td { border-bottom: 0; }
.t th { font-weight: 700; background: var(--panel); white-space: nowrap; color: var(--sub); font-size: 13px; }
.t tbody tr { transition: background .15s; }
.t tbody tr:hover { background: color-mix(in srgb, var(--acc) 4%, transparent); }
.t td.nowrap { white-space: nowrap; }

/* ---------- 자료실 ---------- */
.booktabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 6px; margin: 16px auto 0; max-width: calc(var(--max) - 40px); background: var(--panel); border-radius: var(--r); width: calc(100% - 32px); }
.booktab {
  min-height: 58px; border: 0; background: transparent; cursor: pointer; font-weight: 700; padding: 8px 10px; border-radius: 13px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; color: var(--sub); transition: all .3s var(--ease);
}
.booktab small { font-size: 12.5px; font-weight: 400; }
.booktab:hover { color: var(--ink); }
.booktab[data-b="grammar"] { --tc: var(--g); }
.booktab[data-b="reading"] { --tc: var(--r-); }
.booktab[aria-selected="true"] { background: var(--tc); color: #fff; box-shadow: 0 10px 24px -10px var(--tc); }
@media (prefers-color-scheme: dark) { .booktab[aria-selected="true"] { color: #111; } }
.subtabs { display: flex; overflow-x: auto; gap: 4px; padding-top: 12px; padding-bottom: 0; border-bottom: 1px solid var(--line); scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.subtabs::-webkit-scrollbar { display: none; }
.subtabs a { position: relative; flex: none; display: flex; align-items: center; min-height: 48px; padding: 0 14px; text-decoration: none; color: var(--sub); font-weight: 700; white-space: nowrap; transition: color .2s; }
.subtabs a::after { content: ''; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 3px; border-radius: 3px 3px 0 0; background: var(--acc); transform: scaleX(0); transition: transform .35s var(--ease); }
.subtabs a:hover { color: var(--ink); }
.subtabs a[aria-current="page"] { color: var(--acc); }
.subtabs a[aria-current="page"]::after { transform: scaleX(1); }
.pane { padding-top: 28px; padding-bottom: 28px; animation: fadeUp .45s var(--ease) both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.seg { display: inline-flex; padding: 4px; gap: 4px; background: var(--panel); border-radius: var(--r-pill); margin-bottom: 16px; }
.seg button { min-height: 42px; padding: 0 18px; border: 0; background: transparent; cursor: pointer; font-weight: 700; border-radius: var(--r-pill); color: var(--sub); transition: all .25s var(--ease); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--sh-1); }

/* 진단 */
.progress-bar { position: sticky; top: 64px; z-index: 10; background: color-mix(in srgb, var(--bg) 85%, transparent); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); padding: 10px 0; display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 14px; }
.progress-bar .track, .big-progress .track { flex: 1; height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; }
.progress-bar .fill, .big-progress .fill { height: 100%; width: 0; border-radius: 99px; background: linear-gradient(90deg, var(--acc), var(--acc-2)); transition: width .5s var(--ease); }
.q { border: 1px solid var(--line); background: var(--surface); padding: 20px; margin: 16px 0; border-radius: var(--r); box-shadow: var(--sh-1); }
.q-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; font-size: 13px; color: var(--sub); font-weight: 700; }
.q-no { display: grid; place-items: center; min-width: 30px; height: 30px; padding: 0 6px; border-radius: 10px; background: var(--acc-soft); color: var(--acc); font-weight: 900; font-size: 15px; }
.q-prompt { font-weight: 700; margin-bottom: 14px; white-space: pre-line; }
.opts { display: grid; gap: 8px; }
.opt { display: flex; align-items: flex-start; gap: 10px; min-height: 48px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-sm); cursor: pointer; transition: border-color .2s, background .2s, transform .15s; }
.opt:hover { border-color: color-mix(in srgb, var(--acc) 40%, var(--line)); }
.opt:active { transform: scale(.995); }
.opt input { width: 20px; height: 20px; margin: 2px 0 0; flex: none; accent-color: var(--acc); }
.opt:has(input:checked) { border-color: var(--acc); background: var(--acc-soft); }
.opt.is-correct { border-color: var(--ok); background: var(--ok-soft); }
.opt.is-wrong { border-color: var(--acc); }
.opt.is-wrong .otext { text-decoration: line-through; text-decoration-color: var(--acc); text-decoration-thickness: 2px; color: var(--acc); }
.ok-mark { color: var(--ok); font-weight: 900; font-size: 13px; margin-left: auto; flex: none; }
.expl { margin-top: 12px; padding: 14px; background: var(--panel); font-size: 15px; border-radius: var(--r-sm); animation: fadeUp .4s var(--ease) both; }
.expl .res-ok { color: var(--ok); font-weight: 700; }
.expl .res-no { color: var(--acc); font-weight: 700; }
.passage { border: 1px solid var(--line); background: var(--surface); margin: 28px 0 8px; border-radius: var(--r); box-shadow: var(--sh-1); overflow: hidden; }
.passage summary { cursor: pointer; padding: 14px 18px; font-weight: 900; min-height: 52px; display: flex; align-items: center; gap: 8px; list-style: none; }
.passage summary::-webkit-details-marker { display: none; }
.passage summary::after { content: '펼치기'; margin-left: auto; font-size: 13px; color: var(--sub); font-weight: 700; }
.passage[open] summary::after { content: '접기'; }
.passage-body { padding: 0 18px 18px; font-size: 15px; line-height: 1.85; }
.passage-body p { margin: 0 0 .8em; text-indent: .6em; }
.passage-body .pn { font-weight: 700; color: var(--acc); margin-right: 4px; }
dialog.sheet { border: 1px solid var(--line); padding: 0; max-width: 560px; width: calc(100% - 24px); max-height: 85vh; background: var(--surface); color: var(--ink); border-radius: 22px; box-shadow: var(--sh-3); }
dialog.sheet[open] { animation: pop .35s var(--ease) both; }
@keyframes pop { from { opacity: 0; transform: translateY(16px) scale(.97); } to { opacity: 1; transform: none; } }
dialog.sheet::backdrop { background: rgba(10, 10, 14, .45); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
dialog.sheet header { position: sticky; top: 0; background: var(--surface); display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 10px 10px 20px; border-bottom: 1px solid var(--line); font-weight: 900; }
dialog.sheet .passage-body { padding-top: 16px; }
#passageSheet { max-width: 760px; }
.score-big { font-size: clamp(48px, 11vw, 68px); font-weight: 900; line-height: 1; letter-spacing: -.04em; background: linear-gradient(90deg, var(--acc), var(--acc-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.score-big small { font-size: 18px; color: var(--sub); -webkit-text-fill-color: var(--sub); font-weight: 700; letter-spacing: 0; }
.bars { display: grid; gap: 12px; margin: 16px 0 24px; }
.bar-row { display: grid; grid-template-columns: 96px 1fr 64px; align-items: center; gap: 10px; font-size: 14px; }
.bar-row .name { font-weight: 700; }
.bar { position: relative; height: 14px; background: var(--line-2); border-radius: 99px; }
.bar .fill { position: absolute; inset: 0 auto 0 0; border-radius: 99px; background: linear-gradient(90deg, var(--acc), var(--acc-2)); transform-origin: left; animation: growX .9s var(--ease) both; }
@keyframes growX { from { transform: scaleX(0); } }
.bar .pre { position: absolute; top: -5px; bottom: -5px; width: 3px; border-radius: 2px; background: var(--ink); }
.bar-row .val { text-align: right; font-weight: 700; white-space: nowrap; }
.diff-up { color: var(--ok); }
.diff-down { color: var(--danger); }
.rx { list-style: none; padding: 0; margin: 0; }
.rx li { border-left: 3px solid var(--acc); background: var(--acc-soft); padding: 12px 16px; margin-bottom: 8px; border-radius: 0 var(--r-sm) var(--r-sm) 0; }
.rx li.top { border-color: var(--ink); font-weight: 700; }
.results { position: relative; border: 1px solid var(--line); background: var(--surface); padding: 24px; margin: 28px 0; border-radius: 22px; box-shadow: var(--sh-2); animation: fadeUp .5s var(--ease) both; }
.results::before { content: ''; position: absolute; inset: -1px; border-radius: 22px; padding: 1px; background: linear-gradient(135deg, var(--acc), transparent 40%, transparent 60%, var(--acc-2)); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none; }

/* 플래너 */
.plan-week { margin-bottom: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 6px 18px 8px; box-shadow: var(--sh-1); }
.plan-week h3 { font-size: 16px; padding: 12px 0 10px; margin-bottom: 0; display: flex; justify-content: space-between; border-bottom: 1px solid var(--line); }
.plan-row { display: grid; grid-template-columns: 40px 44px 1fr auto; align-items: center; gap: 8px; border-bottom: 1px solid var(--line-2); min-height: 54px; cursor: pointer; padding: 6px 0; }
.plan-row:last-child { border-bottom: 0; }
.plan-row input { width: 22px; height: 22px; margin: 0 auto; accent-color: var(--acc); }
.plan-row .d { font-weight: 700; color: var(--sub); font-size: 14px; }
.plan-row .pg { font-size: 13px; color: var(--sub); white-space: nowrap; }
.plan-row .task { transition: color .2s; }
.plan-row:has(input:checked) .task { color: var(--sub); text-decoration: line-through; }
.big-progress { font-weight: 900; font-size: 20px; }
.big-progress .track { margin-top: 8px; height: 10px; }

/* 오답 카드 */
.note { border: 1px solid var(--line); background: var(--surface); padding: 16px 18px; margin-bottom: 12px; border-radius: var(--r); box-shadow: var(--sh-1); animation: fadeUp .4s var(--ease) both; }
.note h4 { margin: 0 0 8px; font-size: 16px; }
.note dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 15px; }
.note dt { font-weight: 700; color: var(--sub); }
.note dd { margin: 0; white-space: pre-wrap; }
.note .foot { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; font-size: 13px; color: var(--sub); }

/* 공통 상태 */
.center-card { max-width: 480px; margin: 48px auto; padding: 0 16px; }
.center-card .card { padding: 32px 28px; border-radius: 24px; box-shadow: var(--sh-2); animation: fadeUp .5s var(--ease) both; }
.loading { padding: 64px 0; text-align: center; color: var(--sub); }
.loading::before { content: ''; display: block; width: 28px; height: 28px; margin: 0 auto 12px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--acc); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty { padding: 32px; text-align: center; color: var(--sub); border: 1px dashed var(--line); border-radius: var(--r); background: var(--surface); }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.cross { margin-top: 40px; padding: 20px 22px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; }
.banner { background: var(--ink); color: var(--bg); padding: 12px 0; font-size: 14px; }
.banner .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; justify-content: space-between; }
.banner .btn { border-color: transparent; color: var(--ink); background: var(--bg); }
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 720px) { .stat-grid { grid-template-columns: repeat(4, 1fr); } }
.stat { border: 1px solid var(--line); background: var(--surface); padding: 16px; border-radius: var(--r); box-shadow: var(--sh-1); }
.stat .n { font-size: 30px; font-weight: 900; line-height: 1.1; letter-spacing: -.03em; }
.stat .k { font-size: 13px; color: var(--sub); font-weight: 700; }
.draft { background: #7c2d12; color: #fff; padding: 10px 16px; font-weight: 700; text-align: center; }
.doc h2 { font-size: 20px; margin-top: 2em; }
.doc h3 { font-size: 17px; margin-top: 1.4em; }
.doc li { margin-bottom: .3em; }

/* 토스트 */
#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 100; display: grid; gap: 8px; width: min(92vw, 440px); pointer-events: none; }
.toast { background: var(--ink); color: var(--bg); padding: 13px 18px; font-size: 15px; font-weight: 700; border-radius: 14px; box-shadow: var(--sh-3); animation: pop .35s var(--ease) both; }
.toast.err { background: var(--danger); color: #fff; }

/* =====================================================
 * 랜딩 (index.html)
 * ===================================================== */
.lp-hero { position: relative; overflow: hidden; padding: 56px 0 72px; isolation: isolate; }
@media (min-width: 900px) { .lp-hero { padding: 88px 0 104px; } }
.lp-hero .wrap { display: grid; gap: 48px; align-items: center; }
@media (min-width: 900px) { .lp-hero .wrap { grid-template-columns: 1.1fr .9fr; } }
.lp-hero h1 { font-size: clamp(38px, 9vw, 72px); line-height: 1.08; letter-spacing: -.05em; margin-bottom: 22px; }
.lp-hero h1 .line { display: block; }
.lp-hero .lead { font-size: clamp(16px, 2.2vw, 19px); color: var(--sub); max-width: 520px; margin-bottom: 28px; }
.lp-cta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.lp-trust { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 26px; font-size: 14px; color: var(--sub); font-weight: 700; }
.lp-trust span { display: inline-flex; align-items: center; gap: 6px; }
.lp-trust svg { width: 16px; height: 16px; color: var(--ok); }

/* 배경 오로라 */
.aurora { position: absolute; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.aurora i { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .55; will-change: transform; }
.aurora i:nth-child(1) { width: 460px; height: 460px; background: #FDBA74; top: -140px; left: -120px; animation: drift1 18s var(--ease) infinite alternate; }
.aurora i:nth-child(2) { width: 420px; height: 420px; background: #A5B4FC; top: 10%; right: -140px; animation: drift2 22s var(--ease) infinite alternate; }
.aurora i:nth-child(3) { width: 320px; height: 320px; background: #FCA5A5; bottom: -160px; left: 35%; opacity: .35; animation: drift3 20s var(--ease) infinite alternate; }
@media (prefers-color-scheme: dark) { .aurora i { opacity: .22; } }
@keyframes drift1 { to { transform: translate(120px, 80px) scale(1.15); } }
@keyframes drift2 { to { transform: translate(-100px, 60px) scale(.9); } }
@keyframes drift3 { to { transform: translate(-80px, -60px) scale(1.2); } }
.grid-bg { position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 44px 44px; opacity: .45;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, #000 30%, transparent 75%); mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, #000 30%, transparent 75%); }

/* 히어로 점수 카드 */
.score-card {
  position: relative; background: color-mix(in srgb, var(--surface) 85%, transparent);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  border: 1px solid color-mix(in srgb, var(--line) 70%, transparent); border-radius: 26px; padding: 24px; box-shadow: var(--sh-3);
  animation: floatY 7s ease-in-out infinite;
}
@keyframes floatY { 50% { transform: translateY(-10px); } }
.score-card .sc-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 18px; }
.score-card .sc-title { font-weight: 900; font-size: 15px; }
.score-card .sc-sub { font-size: 12.5px; color: var(--sub); }
.sc-score { text-align: right; }
.sc-score b { display: block; font-size: 38px; line-height: 1; letter-spacing: -.04em; background: var(--grad-loop); background-size: 200% auto; -webkit-background-clip: text; background-clip: text; color: transparent; animation: gradShift 8s linear infinite; }
.sc-score b small { font-size: 16px; -webkit-text-fill-color: var(--sub); color: var(--sub); letter-spacing: 0; }
.sc-score em { display: inline-block; margin-top: 6px; font-style: normal; font-size: 12px; font-weight: 700; color: var(--ok); background: var(--ok-soft); padding: 2px 8px; border-radius: 99px; }
.sc-bars { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; align-items: end; height: 150px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.sc-bar { position: relative; height: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 3px; }
.sc-bar i { display: block; width: 42%; border-radius: 6px 6px 3px 3px; transform-origin: bottom; }
.sc-bar .b { height: var(--b); background: var(--line); animation: barIn 1.2s var(--ease) both; animation-delay: var(--dl, 0s); }
.sc-bar .a { height: var(--a); background: linear-gradient(180deg, var(--acc-2), var(--acc)); animation: barIn 1.2s var(--ease) both, barPulse 4s ease-in-out infinite; animation-delay: calc(var(--dl, 0s) + .5s), calc(var(--dl, 0s) + 1.7s); }
@keyframes barIn { from { transform: scaleY(0); } }
@keyframes barPulse { 50% { filter: brightness(1.15); } }
.sc-labels { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; margin-top: 8px; font-size: 11.5px; color: var(--sub); text-align: center; font-weight: 700; }
.sc-legend { display: flex; gap: 16px; margin-top: 16px; font-size: 12.5px; color: var(--sub); font-weight: 700; }
.sc-legend span { display: inline-flex; align-items: center; gap: 6px; }
.sc-legend i { width: 10px; height: 10px; border-radius: 3px; background: var(--line); }
.sc-legend .al i { background: var(--acc); }
.float-chip {
  position: absolute; display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--sh-2); font-size: 13px; font-weight: 700; white-space: nowrap;
}
.float-chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 4px var(--ok-soft); }
.float-chip.c1 { top: -18px; left: -14px; animation: floatY 6s ease-in-out infinite reverse; }
.float-chip.c2 { bottom: -20px; right: -10px; animation: floatY 8s ease-in-out infinite; }
@media (max-width: 520px) { .float-chip.c1 { left: 8px; } .float-chip.c2 { right: 8px; } }

/* 키워드 흐름 띠 */
.marquee { position: relative; overflow: hidden; border-block: 1px solid var(--line); background: var(--surface); padding: 16px 0;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.marquee .track { display: flex; gap: 40px; width: max-content; animation: marq 32s linear infinite; }
.marquee:hover .track { animation-play-state: paused; }
.marquee span { display: inline-flex; align-items: center; gap: 40px; font-weight: 900; font-size: clamp(17px, 2.4vw, 22px); letter-spacing: -.03em; white-space: nowrap; color: var(--ink-2); }
.marquee span::after { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--grad); }
@keyframes marq { to { transform: translateX(-50%); } }

/* 혜택 카드 */
.benefit .card-num { margin-top: 2px; }
.benefit h3 { font-size: 21px; margin-bottom: 8px; }

/* 흐름 타임라인 */
.flow { position: relative; display: grid; gap: 18px; }
@media (min-width: 820px) { .flow { grid-template-columns: repeat(3, 1fr); gap: 24px; } }
.flow-line { display: none; }
@media (min-width: 820px) {
  .flow-line { display: block; position: absolute; top: 36px; left: 16%; right: 16%; height: 2px; background: var(--line); border-radius: 2px; overflow: hidden; }
  .flow-line::after { content: ''; position: absolute; inset: 0; background: var(--grad); transform: scaleX(0); transform-origin: left; transition: transform 1.6s var(--ease) .2s; }
  .flow.in .flow-line::after { transform: scaleX(1); }
}
.flow-step { position: relative; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 24px; box-shadow: var(--sh-1); }
.flow-step .bubble { position: relative; z-index: 1; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; margin-bottom: 16px; font-weight: 900; font-size: 12px; letter-spacing: .06em; color: #fff; background: var(--ink); box-shadow: 0 0 0 6px var(--surface); }
.flow-step:nth-child(4) .bubble { background: var(--grad-loop); background-size: 200% auto; animation: gradShift 6s linear infinite; }
.flow-step .k { font-size: 12px; font-weight: 900; letter-spacing: .14em; color: var(--acc); }
.flow-step h3 { font-size: 19px; margin: 4px 0 8px; }

/* 책 카드 (랜딩) */
.lp-books .book-card { padding: 28px; border-radius: 24px; transition: transform .5s var(--ease), box-shadow .5s var(--ease); transform-style: preserve-3d; }
.lp-books .book-card:hover { box-shadow: var(--sh-3); }
.lp-books .book-card::before { content: ''; position: absolute; width: 280px; height: 280px; right: -90px; top: -110px; border-radius: 50%; background: var(--acc); opacity: .1; filter: blur(10px); transition: transform .8s var(--ease), opacity .4s; }
.lp-books .book-card:hover::before { transform: scale(1.3); opacity: .16; }
.book-cover { position: relative; width: 64px; height: 84px; border-radius: 6px 10px 10px 6px; margin-bottom: 20px; background: linear-gradient(135deg, var(--acc), var(--acc-2)); box-shadow: inset 6px 0 0 rgba(0,0,0,.15), var(--sh-2); display: grid; place-items: center; color: #fff; font-weight: 900; font-size: 22px; transition: transform .6s var(--ease); }
.book-card:hover .book-cover { transform: rotate(-6deg) translateY(-4px); }
.book-card[data-b="reading"] { --acc-2: #6366F1; }
.book-card[data-b="grammar"] { --acc-2: #F97316; }
.together { margin-top: 28px; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; text-align: center; font-weight: 700; font-size: 17px; }
.together .plus { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--grad); color: #fff; font-weight: 900; }

/* 선생님 띠 */
.lp-teacher { position: relative; overflow: hidden; margin: 0 auto; border-radius: 28px; padding: 40px 32px; background: var(--ink); color: var(--bg); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; isolation: isolate; }
.lp-teacher::before { content: ''; position: absolute; inset: -40%; z-index: -1; background: conic-gradient(from 0deg, transparent 0 60%, color-mix(in srgb, #F97316 55%, transparent), transparent 80%, color-mix(in srgb, #6366F1 55%, transparent), transparent); animation: spin 14s linear infinite; opacity: .35; }
.lp-teacher::after { content: ''; position: absolute; inset: 1px; z-index: -1; border-radius: 27px; background: var(--ink); opacity: .9; }
.lp-teacher h2 { font-size: clamp(24px, 4.5vw, 34px); margin: 0 0 6px; color: var(--bg); }
.lp-teacher p { margin: 0; opacity: .75; }
.lp-teacher .btn { background: var(--bg); color: var(--ink); border-color: transparent; }

/* 스크롤 등장 */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .9s var(--ease), transform .9s var(--ease); transition-delay: var(--d, 0s); }
.reveal.in { opacity: 1; transform: none; }
.hero-in > * { animation: fadeUp .9s var(--ease) both; }
.hero-in > *:nth-child(2) { animation-delay: .08s; }
.hero-in > *:nth-child(3) { animation-delay: .16s; }
.hero-in > *:nth-child(4) { animation-delay: .24s; }
.hero-in > *:nth-child(5) { animation-delay: .32s; }
.lp-hero h1 .line { animation: lineUp 1s var(--ease) both; }
.lp-hero h1 .line:nth-child(2) { animation-delay: .12s; }
@keyframes lineUp { from { opacity: 0; transform: translateY(40%); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }

/* 움직임 줄이기 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
  .marquee .track { animation: none; }
}
