/* Stellers Academy — brand: black #0e0e10, white, gold #BA9C5D · Playfair Display + Inter */
:root {
  --bg: #0e0e10;
  --bg-2: #141417;
  --panel: rgba(255, 255, 255, 0.035);
  --panel-2: rgba(255, 255, 255, 0.06);
  --line: rgba(255, 255, 255, 0.09);
  --line-2: rgba(255, 255, 255, 0.16);
  --text: #f4f2ee;
  --muted: #a3a09a;
  --faint: #6f6c67;
  --gold: #ba9c5d;
  --gold-2: #d4ba82;
  --gold-soft: rgba(186, 156, 93, 0.14);
  --ok: #5fb98a;
  --ok-soft: rgba(95, 185, 138, 0.14);
  --bad: #e06c5f;
  --bad-soft: rgba(224, 108, 95, 0.14);
  --warn: #e3b55b;
  --radius: 14px;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  --serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color-scheme: dark;
}
[data-theme='light'] {
  --bg: #f7f5f0;
  --bg-2: #ffffff;
  --panel: rgba(14, 14, 16, 0.03);
  --panel-2: rgba(14, 14, 16, 0.06);
  --line: rgba(14, 14, 16, 0.1);
  --line-2: rgba(14, 14, 16, 0.18);
  --text: #16161a;
  --muted: #5c5a55;
  --faint: #8d8a84;
  --gold: #9a7d40;
  --gold-2: #7d6330;
  --gold-soft: rgba(154, 125, 64, 0.12);
  --shadow: 0 16px 40px rgba(0, 0, 0, 0.08);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--gold-2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; line-height: 1.2; margin: 0 0 0.5em; letter-spacing: 0.005em; }
h1 { font-size: clamp(1.9rem, 3.4vw, 2.7rem); }
h2 { font-size: clamp(1.4rem, 2.4vw, 1.85rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
small, .small { font-size: 0.85rem; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.gold { color: var(--gold); }
.hidden { display: none !important; }
.wrap { width: min(1120px, 100% - 40px); margin: 0 auto; }
.narrow { width: min(760px, 100% - 40px); margin: 0 auto; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 6px; }

/* ---------- header ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar .wrap { display: flex; align-items: center; gap: 18px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-family: var(--serif); font-size: 1.12rem; letter-spacing: 0.06em; }
.brand:hover { text-decoration: none; }
.brand img { width: 30px; height: 30px; }
.brand b { font-weight: 600; }
.brand span { color: var(--gold); font-weight: 500; }
.nav { display: flex; gap: 4px; margin-left: 14px; }
.nav a { color: var(--muted); padding: 7px 12px; border-radius: 9px; font-size: 0.93rem; }
.nav a:hover, .nav a.active { color: var(--text); background: var(--panel-2); text-decoration: none; }
.topbar .right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.icon-btn { background: none; border: 1px solid var(--line); color: var(--muted); width: 36px; height: 36px; border-radius: 10px; cursor: pointer; display: grid; place-items: center; }
.icon-btn:hover { color: var(--text); border-color: var(--line-2); }
.menu-btn { display: none; }
@media (max-width: 820px) {
  .nav { display: none; position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; background: var(--bg-2); border-bottom: 1px solid var(--line); padding: 10px 20px 16px; margin: 0; }
  .nav.open { display: flex; }
  .menu-btn { display: grid; }
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: 10px; border: 1px solid var(--line-2);
  background: var(--panel-2); color: var(--text); font: 500 0.94rem var(--sans);
  cursor: pointer; transition: 0.15s ease; white-space: nowrap;
}
.btn:hover { border-color: var(--gold); text-decoration: none; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.primary { background: var(--gold); border-color: var(--gold); color: #141210; font-weight: 600; }
.btn.primary:hover { background: var(--gold-2); border-color: var(--gold-2); }
.btn.ghost { background: transparent; }
.btn.small { padding: 6px 12px; font-size: 0.85rem; border-radius: 8px; }
.btn.block { width: 100%; }
.btn.danger { border-color: var(--bad); color: var(--bad); background: transparent; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.spacer { flex: 1; }

/* ---------- cards & layout ---------- */
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; backdrop-filter: blur(8px);
}
.card.pad-lg { padding: 30px; }
.card h3 { margin-bottom: 0.35em; }
.grid { display: grid; gap: 18px; }
.grid.c2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid.c3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid.c4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.page { padding: 34px 0 80px; }
.page-head { margin-bottom: 26px; }
.page-head p { color: var(--muted); max-width: 720px; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.16em; font-size: 0.74rem; color: var(--gold); font-weight: 600; margin-bottom: 10px; }
.crumbs { font-size: 0.86rem; color: var(--faint); margin-bottom: 14px; }
.crumbs a { color: var(--muted); }
.tag { display: inline-block; font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--muted); }
.tag.gold { border-color: rgba(186, 156, 93, 0.45); color: var(--gold-2); background: var(--gold-soft); }
.tag.ok { border-color: rgba(95, 185, 138, 0.45); color: var(--ok); background: var(--ok-soft); }
.tag.bad { border-color: rgba(224, 108, 95, 0.45); color: var(--bad); background: var(--bad-soft); }
.divider { height: 1px; background: var(--line); margin: 22px 0; }
.notice { border: 1px solid rgba(186, 156, 93, 0.35); background: var(--gold-soft); border-radius: 12px; padding: 14px 16px; }
.notice.bad { border-color: rgba(224, 108, 95, 0.4); background: var(--bad-soft); }
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }

/* ---------- progress ---------- */
.bar { height: 8px; border-radius: 99px; background: var(--panel-2); overflow: hidden; position: relative; }
.bar > i { display: block; height: 100%; background: var(--gold); border-radius: 99px; transition: width 0.4s ease; }
.bar.ok > i { background: var(--ok); }
.bar.bad > i { background: var(--bad); }
.bar .mark { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--text); opacity: 0.55; }
.stat { font-family: var(--serif); font-size: 2.1rem; line-height: 1; }
.stat-label { color: var(--muted); font-size: 0.84rem; margin-top: 6px; }
.subj-row { display: grid; grid-template-columns: minmax(140px, 1.2fr) 2fr 70px; gap: 14px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); }
.subj-row:last-child { border-bottom: 0; }
.subj-row .num { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); font-size: 0.9rem; }

/* ---------- course & lesson lists ---------- */
.course-card { display: flex; flex-direction: column; gap: 8px; color: var(--text); background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; transition: 0.18s ease; }
.course-card:hover { border-color: rgba(186, 156, 93, 0.55); transform: translateY(-2px); text-decoration: none; }
.course-card h3 { margin: 6px 0 2px; }
.course-card p { color: var(--muted); margin: 0; font-size: 0.93rem; }
.course-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: auto; padding-top: 12px; font-size: 0.8rem; color: var(--faint); }
.course-meta .code { color: var(--gold); }
.module { border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 14px; overflow: hidden; background: var(--panel); }
.module-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.module-head h3 { margin: 0; font-size: 1.08rem; }
.lesson-row { display: flex; align-items: center; gap: 14px; padding: 13px 20px; border-bottom: 1px solid var(--line); color: var(--text); }
.lesson-row:last-child { border-bottom: 0; }
a.lesson-row:hover { background: var(--panel-2); text-decoration: none; }
.lesson-row .dot { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--line-2); display: grid; place-items: center; flex: none; font-size: 0.7rem; color: transparent; }
.lesson-row .dot.done { background: var(--gold); border-color: var(--gold); color: #141210; }
.lesson-row .title { flex: 1; }
.lesson-row.soon { color: var(--faint); }
.lesson-row .mins { color: var(--faint); font-size: 0.82rem; }

/* ---------- lesson reader ---------- */
.reader { font-size: 1.04rem; line-height: 1.75; }
.reader h1 { margin-bottom: 0.2em; }
.reader h2 { margin-top: 1.8em; font-size: 1.45rem; }
.reader h3 { margin-top: 1.5em; font-size: 1.15rem; font-family: var(--sans); font-weight: 650; }
.reader ul, .reader ol { padding-left: 1.3em; margin: 0 0 1.1em; }
.reader li { margin: 0.3em 0; }
.reader strong { color: var(--text); }
.reader table { width: 100%; border-collapse: collapse; margin: 1.2em 0; font-size: 0.93rem; display: block; overflow-x: auto; }
.reader th, .reader td { border: 1px solid var(--line-2); padding: 8px 12px; text-align: left; vertical-align: top; }
.reader th { background: var(--panel-2); font-weight: 600; }
.reader code { background: var(--panel-2); padding: 1px 6px; border-radius: 5px; font-size: 0.9em; }
.reader pre { background: var(--panel-2); padding: 14px 16px; border-radius: 10px; overflow-x: auto; border: 1px solid var(--line); }
.reader pre code { background: none; padding: 0; }
.reader blockquote { margin: 1.2em 0; padding: 4px 18px; border-left: 3px solid var(--gold); color: var(--muted); }
.reader .admonition { border: 1px solid var(--line-2); border-left: 4px solid var(--gold); background: var(--gold-soft); padding: 12px 18px; border-radius: 10px; margin: 1.3em 0; }
.reader .admonition p:last-child { margin-bottom: 0; }
.reader .admonition-title { font-weight: 700; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--gold-2); margin-bottom: 4px; }
.reader .admonition.warning { border-left-color: var(--bad); background: var(--bad-soft); }
.reader .admonition.warning .admonition-title { color: var(--bad); }
.reader .admonition.note { border-left-color: var(--ok); background: var(--ok-soft); }
.reader .admonition.note .admonition-title { color: var(--ok); }
.lesson-foot { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 40px; padding-top: 22px; border-top: 1px solid var(--line); }

/* ---------- exam runner ---------- */
.runner { display: grid; grid-template-columns: 1fr 260px; gap: 22px; align-items: start; }
@media (max-width: 900px) { .runner { grid-template-columns: 1fr; } }
.runner-bar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.timer { font-variant-numeric: tabular-nums; font-weight: 600; padding: 6px 12px; border-radius: 9px; border: 1px solid var(--line-2); }
.timer.low { color: var(--bad); border-color: var(--bad); }
.q-stem { font-size: 1.12rem; line-height: 1.6; margin: 10px 0 20px; white-space: pre-line; }
.q-img { max-width: 100%; border-radius: 10px; border: 1px solid var(--line); margin-bottom: 16px; }
.opts { display: grid; gap: 10px; }
.opt { display: flex; gap: 14px; align-items: flex-start; text-align: left; width: 100%; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--panel); color: var(--text); font: inherit; cursor: pointer; transition: 0.12s ease; }
.opt:hover:not(:disabled) { border-color: var(--gold); }
.opt .k { flex: none; width: 26px; height: 26px; border-radius: 7px; border: 1px solid var(--line-2); display: grid; place-items: center; font-size: 0.8rem; font-weight: 600; color: var(--muted); }
.opt.sel { border-color: var(--gold); background: var(--gold-soft); }
.opt.sel .k { background: var(--gold); border-color: var(--gold); color: #141210; }
.opt.right { border-color: var(--ok); background: var(--ok-soft); }
.opt.right .k { background: var(--ok); border-color: var(--ok); color: #0d1a12; }
.opt.wrong { border-color: var(--bad); background: var(--bad-soft); }
.opt.wrong .k { background: var(--bad); border-color: var(--bad); color: #1d0d0b; }
.opt:disabled { cursor: default; }
.explain { margin-top: 18px; padding: 16px 18px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--panel-2); }
.explain .verdict { font-weight: 700; margin-bottom: 6px; }
.explain .verdict.ok { color: var(--ok); }
.explain .verdict.bad { color: var(--bad); }
.explain .ref { color: var(--gold-2); font-size: 0.86rem; margin-top: 8px; }
.qnav { display: grid; grid-template-columns: repeat(auto-fill, minmax(36px, 1fr)); gap: 6px; }
.qnav button { height: 36px; border-radius: 8px; border: 1px solid var(--line-2); background: transparent; color: var(--muted); font: 500 0.8rem var(--sans); cursor: pointer; position: relative; }
.qnav button.ans { background: var(--panel-2); color: var(--text); }
.qnav button.cur { border-color: var(--gold); color: var(--gold-2); }
.qnav button.flag::after { content: ''; position: absolute; top: 3px; right: 3px; width: 6px; height: 6px; border-radius: 50%; background: var(--warn); }
.qnav button.right { border-color: var(--ok); color: var(--ok); }
.qnav button.wrong { border-color: var(--bad); color: var(--bad); }
.legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 0.78rem; color: var(--faint); margin-top: 10px; }
.flag-btn.on { border-color: var(--warn); color: var(--warn); }
.big-score { font-family: var(--serif); font-size: 4rem; line-height: 1; }
.review-item { padding: 18px 0; border-bottom: 1px solid var(--line); }
.review-item:last-child { border-bottom: 0; }
.review-item .opt { padding: 10px 14px; }

/* ---------- forms ---------- */
.form { display: grid; gap: 14px; }
label.field { display: grid; gap: 6px; font-size: 0.88rem; color: var(--muted); }
input[type='text'], input[type='email'], input[type='password'], input[type='number'], select {
  width: 100%; padding: 11px 13px; border-radius: 10px; border: 1px solid var(--line-2);
  background: var(--bg-2); color: var(--text); font: inherit;
}
input:focus, select:focus { outline: none; border-color: var(--gold); }
.check { display: flex; gap: 9px; align-items: center; font-size: 0.92rem; cursor: pointer; }
.check input { accent-color: var(--gold); width: 16px; height: 16px; }
.form-error { color: var(--bad); font-size: 0.9rem; min-height: 1.2em; }
.auth-box { max-width: 420px; margin: 40px auto; }

/* ---------- modal & toast ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.6); display: grid; place-items: center; z-index: 50; padding: 20px; }
.modal { background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 16px; padding: 26px; max-width: 440px; width: 100%; box-shadow: var(--shadow); }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--bg-2); border: 1px solid var(--line-2); padding: 11px 18px; border-radius: 10px; z-index: 60; box-shadow: var(--shadow); font-size: 0.92rem; }

/* ---------- trainer ---------- */
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 22px; flex-wrap: wrap; }
.tabs button { background: none; border: 0; border-bottom: 2px solid transparent; color: var(--muted); padding: 10px 14px; font: 500 0.95rem var(--sans); cursor: pointer; }
.tabs button.on { color: var(--text); border-bottom-color: var(--gold); }
.prompt-big { font-family: var(--serif); font-size: clamp(1.8rem, 5vw, 2.8rem); letter-spacing: 0.08em; margin: 8px 0 18px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 9px 13px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--panel); color: var(--text); font: inherit; font-size: 0.9rem; cursor: pointer; text-align: left; }
.chip:hover { border-color: var(--gold); }
.chip.used { opacity: 0.35; pointer-events: none; }
.built { min-height: 60px; border: 1px dashed var(--line-2); border-radius: 12px; padding: 12px; display: grid; gap: 6px; margin-bottom: 14px; }
.built .chip { pointer-events: auto; }
.phon-table { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 6px; font-size: 0.86rem; }
.phon-table div { padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; }
.phon-table b { color: var(--gold-2); margin-right: 6px; }

/* ---------- landing ---------- */
.hero { padding: 90px 0 60px; position: relative; overflow: hidden; }
.hero::before { content: ''; position: absolute; inset: -40% -10% auto auto; width: 720px; height: 720px; background: radial-gradient(closest-side, rgba(186, 156, 93, 0.16), transparent 70%); pointer-events: none; }
.hero h1 { font-size: clamp(2.3rem, 5.2vw, 3.9rem); max-width: 860px; }
.hero p.lead { font-size: 1.15rem; color: var(--muted); max-width: 640px; margin-bottom: 28px; }
.facts { display: flex; flex-wrap: wrap; gap: 28px 46px; margin-top: 46px; padding-top: 26px; border-top: 1px solid var(--line); }
.section { padding: 60px 0; }
.section-head { margin-bottom: 28px; max-width: 720px; }
.section-head p { color: var(--muted); }
.feature h3 { font-family: var(--sans); font-weight: 650; font-size: 1.02rem; }
.feature p { color: var(--muted); margin: 0; font-size: 0.94rem; }
.feature .ico { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--gold-soft); color: var(--gold-2); margin-bottom: 14px; }
.faq details { border-bottom: 1px solid var(--line); padding: 16px 0; }
.faq summary { cursor: pointer; font-weight: 600; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq details p { color: var(--muted); margin: 10px 0 0; }
footer.site { border-top: 1px solid var(--line); padding: 34px 0 50px; color: var(--faint); font-size: 0.85rem; }
footer.site .row { justify-content: space-between; }

/* ---------- print (ground school record) ---------- */
@media print {
  :root { --bg: #fff; --bg-2: #fff; --text: #111; --muted: #444; --faint: #666; --line: #ccc; --line-2: #bbb; --panel: #fff; --panel-2: #f3f3f3; --gold: #7d6330; --gold-2: #7d6330; }
  body { background: #fff; color: #111; font-size: 11pt; }
  .topbar, .no-print, footer.site { display: none !important; }
  .card { border: 1px solid #ccc; backdrop-filter: none; break-inside: avoid; }
  .page { padding: 0; }
}

/* ---------- fixes: tags in cards, small screens ---------- */
.course-card .tag, .card > .tag { align-self: flex-start; }
@media (max-width: 560px) {
  .topbar .wrap { gap: 10px; }
  .brand span, #theme-btn { display: none; }
  .topbar .right { gap: 6px; }
  #auth-slot .btn { padding: 6px 10px; max-width: 140px; overflow: hidden; text-overflow: ellipsis; }
  .subj-row { grid-template-columns: 1fr 70px; }
  .subj-row .bar { grid-column: 1 / -1; grid-row: 2; }
  .card.pad-lg { padding: 22px; }
  .big-score { font-size: 3rem; }
}
