:root {
  color-scheme: dark;
  --bg: #0b100f;
  --surface: rgba(21, 28, 26, 0.86);
  --surface-2: #18201e;
  --line: rgba(222, 235, 229, 0.12);
  --text: #f2f5f1;
  --muted: #9ca9a4;
  --accent: #ffb454;
  --accent-strong: #ff8d3b;
  --mint: #7de2b8;
  --danger: #ff8c7c;
  --radius: 22px;
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.42);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100dvh;
  color: var(--text);
  background:
    linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px),
    var(--bg);
  background-size: 36px 36px;
  overflow-x: hidden;
}
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }
button:focus-visible, a:focus-visible { outline: 3px solid rgba(255, 180, 84, .55); outline-offset: 3px; }

.ambient { position: fixed; border-radius: 50%; filter: blur(100px); pointer-events: none; z-index: -1; }
.ambient-one { width: 420px; height: 420px; top: -220px; right: -130px; background: rgba(255, 141, 59, .16); }
.ambient-two { width: 340px; height: 340px; top: 42%; left: -240px; background: rgba(71, 175, 142, .11); }

.site-header, main, footer { width: min(1120px, calc(100% - 40px)); margin-inline: auto; }
.site-header { height: 88px; display: flex; align-items: center; justify-content: space-between; }
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none; }
.brand-mark { width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid rgba(255, 180, 84, .42); border-radius: 12px; color: var(--accent); background: rgba(255, 180, 84, .08); font-weight: 850; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 15px; letter-spacing: .01em; }
.brand small { color: var(--muted); font-size: 11px; margin-top: 2px; }
.icon-button, .close-button { border: 1px solid var(--line); color: var(--muted); background: rgba(255,255,255,.04); cursor: pointer; }
.icon-button { width: 44px; height: 44px; border-radius: 50%; font-weight: 750; }

.hero { padding: 76px 0 58px; }
.eyebrow, .kicker { color: var(--accent); text-transform: uppercase; letter-spacing: .16em; font-size: 11px; font-weight: 780; }
.eyebrow { display: flex; align-items: center; gap: 9px; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 5px rgba(125, 226, 184, .08); }
h1 { margin: 20px 0 18px; max-width: 780px; font-size: clamp(42px, 6.4vw, 72px); line-height: 1; letter-spacing: -.05em; text-wrap: balance; }
h1 span { color: #aeb8b4; }
.hero-copy { max-width: 610px; margin: 0; color: var(--muted); font-size: clamp(17px, 2.2vw, 21px); line-height: 1.58; }
.hero-actions { margin-top: 32px; display: flex; flex-wrap: wrap; gap: 12px; }
.primary-button, .secondary-button, .audio-button, .text-button, .exam-action { min-height: 52px; border-radius: 14px; border: 0; cursor: pointer; font-weight: 760; }
.primary-button { padding: 0 20px; display: inline-flex; align-items: center; justify-content: space-between; gap: 42px; color: #17130d; background: linear-gradient(135deg, var(--accent), #ffd085); box-shadow: 0 14px 32px rgba(255, 141, 59, .14); }
.secondary-button { padding: 0 20px; color: var(--text); background: rgba(255,255,255,.055); border: 1px solid var(--line); }
.primary-button:hover, .secondary-button:hover, .audio-button:hover { transform: translateY(-1px); }

.progress-card { width: min(610px, 100%); margin-top: 30px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 16px; background: rgba(15, 21, 19, .72); backdrop-filter: blur(16px); }
.progress-copy { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 11px; font-size: 12px; color: var(--muted); }
.progress-copy strong { color: var(--text); }
.progress-track, .exam-progress { height: 6px; overflow: hidden; border-radius: 10px; background: rgba(255,255,255,.07); }
.progress-track span, .exam-progress span { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--accent-strong), var(--accent)); transition: width .35s ease; }
.offline-row { min-height: 24px; margin-top: 11px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.offline-status { color: var(--muted); font-size: 11px; }
.offline-status::before { content: ""; width: 7px; height: 7px; margin-right: 7px; display: inline-block; border-radius: 50%; background: var(--accent); }
.offline-status.is-ready::before { background: var(--mint); }
.offline-status.is-error::before { background: var(--danger); }
.text-button { min-height: 44px; padding: 0; color: var(--accent); background: transparent; }

.section-shell { padding: 56px 0 40px; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
h2 { margin: 8px 0 0; font-size: clamp(28px, 4vw, 42px); line-height: 1.08; letter-spacing: -.035em; }
.count-pill, .verified-pill { display: inline-flex; align-items: center; min-height: 28px; padding: 0 10px; border-radius: 999px; font-size: 11px; font-weight: 740; }
.count-pill { flex-shrink: 0; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.verified-pill { color: var(--mint); background: rgba(125, 226, 184, .09); }
.module-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.module-card { position: relative; min-height: 280px; padding: 22px; display: flex; flex-direction: column; text-align: left; color: var(--text); background: linear-gradient(145deg, rgba(28, 37, 34, .95), rgba(15, 21, 19, .95)); border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; overflow: hidden; transition: transform .2s ease, border-color .2s ease; }
.module-card::after { content: ""; position: absolute; width: 150px; height: 150px; top: -70px; right: -70px; border: 1px solid rgba(255,180,84,.16); border-radius: 50%; box-shadow: 0 0 0 30px rgba(255,180,84,.025), 0 0 0 60px rgba(255,180,84,.015); }
.module-card:hover { transform: translateY(-4px); border-color: rgba(255, 180, 84, .32); }
.module-card.is-complete { border-color: rgba(125, 226, 184, .26); }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-index { color: var(--accent); font-size: 13px; font-weight: 820; }
.card-duration { color: var(--muted); font-size: 11px; }
.module-card h3 { margin: auto 0 10px; max-width: 250px; font-size: 26px; line-height: 1.05; letter-spacing: -.03em; }
.module-card p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.card-footer { margin-top: 20px; padding-top: 16px; display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); color: #cbd3cf; font-size: 12px; }
.complete-check { color: var(--mint); }

.method-strip { margin: 48px 0 94px; display: grid; grid-template-columns: repeat(2, 1fr); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: rgba(17, 23, 21, .72); }
.method-strip article { padding: 24px; min-height: 140px; border-right: 1px solid var(--line); }
.method-strip article:last-child { border-right: 0; }
.method-strip span { display: block; color: var(--accent); font-size: 11px; font-weight: 800; margin-bottom: 30px; }
.method-strip strong, .method-strip small { display: block; }
.method-strip strong { font-size: 16px; margin-bottom: 7px; }
.method-strip small { color: var(--muted); line-height: 1.4; }

.sheet { width: min(740px, calc(100% - 24px)); max-height: calc(100dvh - 24px); margin: auto; padding: 0; overflow: auto; overscroll-behavior: contain; border: 1px solid var(--line); border-radius: 28px; color: var(--text); background: #111816; box-shadow: var(--shadow); }
.sheet::backdrop, .about-dialog::backdrop { background: rgba(1, 5, 4, .78); backdrop-filter: blur(8px); }
.sheet-inner { position: relative; padding: 34px; }
.sheet-inner > h2 { padding-right: 56px; }
.close-button { position: absolute; top: 18px; right: 18px; width: 44px; height: 44px; border-radius: 50%; font-size: 24px; line-height: 1; }
.sheet-topline { display: flex; align-items: center; gap: 10px; padding-right: 50px; }
.module-number { color: var(--accent); font-size: 12px; font-weight: 850; letter-spacing: .13em; }
.module-lead { max-width: 590px; color: var(--muted); line-height: 1.6; }
.mode-switch { margin: 26px 0 24px; padding: 5px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; background: rgba(255,255,255,.045); border-radius: 14px; }
.mode-button { min-height: 44px; border: 0; border-radius: 10px; color: var(--muted); background: transparent; cursor: pointer; font-weight: 720; }
.mode-button.is-active { color: var(--text); background: var(--surface-2); box-shadow: 0 5px 18px rgba(0,0,0,.22); }

.audio-card { padding: 18px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 15px; border: 1px solid rgba(255,180,84,.22); border-radius: 18px; background: rgba(255,180,84,.06); }
.audio-button { width: 52px; min-width: 52px; padding: 0; display: grid; place-items: center; color: #17130d; background: var(--accent); font-size: 19px; }
.audio-copy { min-width: 0; flex: 1; }
.audio-copy strong, .audio-copy small { display: block; }
.audio-copy small { margin-top: 5px; color: var(--muted); }
.audio-side { display: grid; justify-items: end; gap: 7px; }
.audio-time { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.audio-rate { min-height: 44px; padding: 0 8px; border: 1px solid var(--line); border-radius: 9px; color: var(--text); background: #19211f; font: inherit; font-size: 12px; font-weight: 760; }
.memory-hook { margin: 18px 0; padding: 18px; border-left: 3px solid var(--mint); border-radius: 0 14px 14px 0; background: rgba(125,226,184,.06); }
.memory-hook span { display: block; color: var(--mint); font-size: 10px; font-weight: 820; letter-spacing: .15em; text-transform: uppercase; }
.memory-hook strong { display: block; margin-top: 7px; font-size: 18px; line-height: 1.4; }
.lesson-block { padding: 17px 0; border-top: 1px solid var(--line); }
.lesson-block h3 { margin: 0 0 8px; font-size: 16px; }
.lesson-block p { margin: 0; color: #c4ceca; line-height: 1.65; }
.mark-done { width: 100%; margin-top: 18px; color: #0c1813; background: var(--mint); }

.question-list { display: grid; gap: 10px; }
.question-item { border: 1px solid var(--line); border-radius: 15px; overflow: hidden; }
.question-toggle { width: 100%; padding: 16px; display: flex; justify-content: space-between; gap: 18px; text-align: left; color: var(--text); background: rgba(255,255,255,.025); border: 0; cursor: pointer; }
.question-toggle span:last-child { color: var(--accent); }
.question-answer { padding: 0 16px 16px; color: #c5cfcb; line-height: 1.62; }
.question-answer[hidden] { display: none; }

.source-list { display: grid; gap: 10px; }
.source-link { padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--text); text-decoration: none; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.025); }
.source-link small { color: var(--muted); }
.source-link span:last-child { color: var(--accent); }
.source-note, .notice { padding: 14px 16px; color: var(--muted); background: rgba(255,255,255,.035); border-radius: 14px; line-height: 1.55; }

.exam-header { padding-right: 46px; }
.exam-meta { margin-top: 18px; display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; }
.exam-progress { margin: 12px 0 28px; }
.exam-question { margin: 0; font-size: clamp(25px, 5vw, 38px); line-height: 1.15; letter-spacing: -.035em; }
.exam-source { display: inline-block; margin-top: 13px; color: var(--accent); font-size: 11px; text-transform: uppercase; letter-spacing: .12em; }
.countdown-box { margin: 26px 0 18px; min-height: 110px; display: grid; place-items: center; border: 1px dashed rgba(255,180,84,.28); border-radius: 18px; background: rgba(255,180,84,.04); }
.countdown-box strong { font-size: 42px; font-variant-numeric: tabular-nums; }
.countdown-box span { display: block; color: var(--muted); text-align: center; font-size: 12px; }
.exam-answer { margin: 22px 0; padding: 18px; border-radius: 16px; background: rgba(125,226,184,.065); color: #d7e5df; line-height: 1.65; }
.exam-actions { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.exam-action { padding: 0 14px; color: var(--text); background: rgba(255,255,255,.06); border: 1px solid var(--line); }
.exam-action.primary { color: #132019; background: var(--mint); border-color: transparent; }
.exam-result { text-align: center; padding: 30px 0 12px; }
.result-ring { width: 128px; height: 128px; margin: 0 auto 22px; display: grid; place-items: center; border-radius: 50%; border: 8px solid rgba(125,226,184,.16); box-shadow: inset 0 0 0 2px var(--mint); }
.result-ring strong { font-size: 36px; }
.exam-result p { color: var(--muted); line-height: 1.6; }

.about-dialog { width: min(540px, calc(100% - 24px)); max-height: calc(100dvh - 24px); padding: 30px; overflow: auto; overscroll-behavior: contain; border: 1px solid var(--line); border-radius: 24px; color: var(--text); background: #111816; box-shadow: var(--shadow); }
.about-dialog .close-button { position: absolute; }
.about-dialog p { color: #c4ceca; line-height: 1.65; }
.about-dialog .notice { color: var(--muted); }
.about-dialog h3 { margin: 24px 0 10px; font-size: 16px; }
.install-steps { margin: 0; padding-left: 22px; color: #c4ceca; line-height: 1.55; }
.install-steps li + li { margin-top: 7px; }

footer { padding: 24px 0 calc(40px + env(safe-area-inset-bottom)); display: flex; justify-content: space-between; color: #87928e; border-top: 1px solid var(--line); font-size: 11px; }
.toast { position: fixed; left: 50%; bottom: calc(22px + env(safe-area-inset-bottom)); z-index: 10; width: min(420px, calc(100% - 28px)); padding: 13px 16px; transform: translateX(-50%); border: 1px solid var(--line); border-radius: 13px; color: var(--text); background: #1b2421; box-shadow: var(--shadow); text-align: center; font-size: 13px; }
.toast[hidden] { display: none; }

@media (max-width: 760px) {
  .site-header, main, footer { width: min(100% - 28px, 1120px); }
  .site-header { height: 72px; }
  .hero { padding: 54px 0 42px; }
  h1 { font-size: clamp(40px, 11.5vw, 52px); }
  .hero-actions { display: grid; }
  .primary-button, .secondary-button { width: 100%; max-width: 100%; }
  .primary-button { gap: 16px; }
  h1 { max-width: 100%; overflow-wrap: normal; }
  .module-grid { grid-template-columns: 1fr; }
  .module-card { min-height: 230px; }
  .method-strip { grid-template-columns: 1fr; }
  .method-strip article { min-height: 118px; border-right: 0; border-bottom: 1px solid var(--line); }
  .method-strip article:last-child { border-bottom: 0; }
  .method-strip span { margin-bottom: 18px; }
  .sheet { width: 100vw; max-width: none; max-inline-size: none; max-height: 94dvh; margin: auto 0 0; border-radius: 26px 26px 0 0; }
  .sheet-inner { padding: 28px 18px calc(30px + env(safe-area-inset-bottom)); }
  .section-heading { align-items: flex-start; }
  .audio-card { align-items: center; }
}

@media (max-width: 380px) {
  .audio-card { grid-template-columns: auto minmax(0, 1fr); }
  .audio-side { grid-column: 2; grid-row: 2; justify-items: start; grid-template-columns: auto auto; align-items: center; gap: 10px; }
  .exam-actions { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
