/* Dropout Academy — brand tokens in one place so a rebrand is a small change. */
:root {
  --bg: #141312;
  --panel: #1c1a18;
  --card: #211f1c;
  --card-hi: #2a2723;
  --line: #34302b;
  --text: #f3ead8;
  --muted: #a8a196;
  --gold: #d8a33f;
  --gold-hi: #e8b85a;
  --gold-ink: #1e1c1a;
  --ok: #3fae7a;
  --warn: #d8a33f;
  --bad: #d0574c;
  --info: #6b8fe0;
  --radius: 14px;
  --serif: 'Fraunces', Georgia, serif;
  --sans: 'Inter', system-ui, -apple-system, Segoe UI, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.55 var(--sans); }
a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-hi); }
h1, h2, h3 { margin: 0; line-height: 1.15; }
h1 { font-family: var(--serif); font-size: clamp(26px, 4vw, 36px); font-weight: 700; }
h2 { font-size: 18px; font-weight: 700; }
h3 { font-size: 16px; font-weight: 700; }
p { margin: 0 0 10px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
[hidden] { display: none !important; }

/* ---------- brand ---------- */
.brand { display: inline-flex; flex-direction: column; line-height: 1; color: var(--text); }
.brand-name { font-weight: 800; font-size: 22px; letter-spacing: .01em; }
.brand-sub { font-weight: 700; font-size: 9px; letter-spacing: .55em; color: var(--gold); margin-top: 5px; }
.brand-lg .brand-name { font-size: 40px; }
.brand-lg .brand-sub { font-size: 12px; margin-top: 8px; }
.brand-sm .brand-name { font-size: 18px; }

/* ---------- layout ---------- */
.layout { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.layout > * { min-width: 0; }
.side {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 28px;
  padding: 26px 18px; background: var(--panel); border-right: 1px solid var(--line);
}
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--muted); font-weight: 500; }
.nav a:hover { background: var(--card); color: var(--text); }
.nav a.active { background: var(--card-hi); color: var(--text); box-shadow: inset 2px 0 0 var(--gold); }
.nav .ico { width: 18px; text-align: center; color: var(--gold); font-size: 13px; }
.nav-admin { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 14px !important; border-radius: 0 !important; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.who { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--gold); color: var(--gold-ink); display: grid; place-items: center; font-weight: 800; }
.link-btn { background: none; border: 0; color: var(--muted); padding: 0; font: inherit; font-size: 13px; cursor: pointer; }
.link-btn:hover { color: var(--text); }
.topbar { display: none; }
.main { padding: 36px clamp(16px, 4vw, 48px) 64px; max-width: 1180px; width: 100%; outline: none; }

@media (max-width: 860px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .topbar { display: flex; align-items: center; gap: 14px; position: sticky; top: 0; z-index: 20; padding: 12px 16px; background: var(--panel); border-bottom: 1px solid var(--line); }
  .menu-btn { background: none; border: 1px solid var(--line); color: var(--text); border-radius: 8px; width: 38px; height: 38px; font-size: 18px; cursor: pointer; }
  .side { position: fixed; z-index: 30; inset: 0 auto 0 0; width: 270px; transform: translateX(-100%); transition: transform .2s ease; }
  .side.open { transform: none; box-shadow: 0 0 0 100vmax rgba(0,0,0,.55); }
  .main { padding: 22px 16px 56px; }
}

/* ---------- building blocks ---------- */
.kicker { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: var(--gold); margin-bottom: 8px; }
.page-head { margin-bottom: 26px; }
.page-head h1 { margin-bottom: 6px; }
.back { display: inline-block; margin-bottom: 18px; color: var(--muted); font-size: 14px; }
.back:hover { color: var(--text); }
.loading { color: var(--muted); padding: 40px 0; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid transparent; border-radius: 999px; padding: 10px 20px; font: 600 14px var(--sans); cursor: pointer; white-space: nowrap; }
.btn-gold { background: var(--gold); color: var(--gold-ink); }
.btn-gold:hover { background: var(--gold-hi); color: var(--gold-ink); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--muted); color: var(--text); }
.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn:disabled { opacity: .6; cursor: default; }

.bar { height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; flex: 1; min-width: 80px; }
.bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--gold-hi)); border-radius: 99px; }

.tag { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: rgba(216,163,63,.14); color: var(--gold); margin-right: 6px; vertical-align: middle; }
.tag-draft { background: rgba(168,161,150,.14); color: var(--muted); }

.grid { display: grid; gap: 16px; }
.cards { grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr)); }
.card { display: flex; flex-direction: column; gap: 8px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; color: var(--text); }
a.card:hover { border-color: #4a443c; background: var(--card-hi); color: var(--text); }

.block { margin-top: 34px; }
.block > h2 { margin-bottom: 14px; }
.block-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 14px; }
.more { font-size: 14px; }
.two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 28px; }
@media (max-width: 900px) { .two { grid-template-columns: minmax(0, 1fr); } }

.list { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.row-link { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 16px; background: var(--card); color: var(--text); border-top: 1px solid var(--line); }
.row-link:first-child { border-top: 0; }
a.row-link:hover { background: var(--card-hi); color: var(--text); }
.row-link > span:first-child { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.price { font-weight: 700; color: var(--gold); white-space: nowrap; }

.empty { text-align: center; padding: 38px 18px; border: 1px dashed var(--line); border-radius: var(--radius); }
.empty-ico { font-size: 26px; color: var(--gold); margin-bottom: 6px; }
.empty h3 { margin-bottom: 4px; }
.empty p { margin: 0; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 99px; border: 1px solid var(--line); background: transparent; color: var(--muted); font: 500 13px var(--sans); cursor: pointer; }
.chip span { color: var(--muted); font-size: 12px; }
.chip:hover { color: var(--text); }
.chip.active { background: var(--gold); border-color: var(--gold); color: var(--gold-ink); }
.chip.active span { color: var(--gold-ink); opacity: .7; }

/* ---------- home ---------- */
.hero { display: grid; grid-template-columns: 1.3fr 1fr; gap: 24px; align-items: stretch; padding: 30px; border-radius: 20px; border: 1px solid var(--line);
  background: radial-gradient(circle at 92% 0%, rgba(216,163,63,.22), transparent 45%), var(--panel); }
.hero h1 { margin-bottom: 8px; }
.hero .bar { margin-top: 14px; max-width: 360px; }
.continue { display: flex; flex-direction: column; gap: 6px; justify-content: center; padding: 22px; border-radius: var(--radius); background: rgba(0,0,0,.25); border: 1px solid var(--line); color: var(--text); }
.continue strong { font-size: 18px; }
.continue .btn { align-self: flex-start; margin-top: 10px; }
.continue:hover { border-color: var(--gold); color: var(--text); }
@media (max-width: 760px) { .hero { grid-template-columns: minmax(0, 1fr); padding: 22px; } }

.track h3 { font-family: var(--serif); font-size: 22px; }
.track-top { display: flex; justify-content: space-between; align-items: center; }
.track-foot { display: flex; align-items: center; gap: 10px; margin-top: auto; padding-top: 10px; }

.cta { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 36px; padding: 26px 30px; border-radius: 20px; border: 1px solid rgba(216,163,63,.4);
  background: linear-gradient(120deg, rgba(216,163,63,.16), rgba(216,163,63,.03)); }
.cta h2 { font-family: var(--serif); font-size: 24px; margin-bottom: 6px; }
@media (max-width: 760px) { .cta { flex-direction: column; align-items: flex-start; } }

/* ---------- course ---------- */
.course-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; }
.course-progress { display: flex; align-items: center; gap: 10px; margin-top: 14px; max-width: 360px; }
.phase { margin-top: 30px; }
.phase-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.phase-num { font-family: var(--serif); font-size: 30px; color: var(--gold); line-height: 1; }
.modules { grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); }
.module h3 { font-size: 17px; }
.lessons { list-style: none; margin: 4px 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.lessons a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--text); font-size: 14px; }
.lessons a:hover { background: var(--card-hi); }
.lessons a > span:nth-child(2) { flex: 1; }
.lessons a.current { background: var(--card-hi); box-shadow: inset 2px 0 0 var(--gold); }
.tick { width: 18px; height: 18px; flex: 0 0 18px; border-radius: 50%; border: 1.5px solid var(--line); display: grid; place-items: center; font-size: 11px; color: var(--gold-ink); }
.lessons a.done .tick { background: var(--gold); border-color: var(--gold); }

/* ---------- lesson ---------- */
.lesson { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; align-items: start; }
@media (max-width: 1000px) { .lesson { grid-template-columns: minmax(0, 1fr); } }
.player { aspect-ratio: 16 / 9; background: #000; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.player iframe, .player video { width: 100%; height: 100%; border: 0; display: block; }
.no-video { height: 100%; display: grid; place-content: center; text-align: center; color: var(--muted); background: radial-gradient(circle at 50% 40%, rgba(216,163,63,.12), transparent 55%), #0d0c0b; }
.no-video span { font-size: 40px; color: var(--gold); }
.lesson-bar { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; margin: 20px 0 14px; flex-wrap: wrap; }
.lesson-bar h1 { font-size: clamp(22px, 3vw, 28px); }
.lesson-side { position: sticky; top: 20px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.lesson-side h2 { font-size: 15px; margin-bottom: 10px; }
.resources { margin-top: 24px; }
.resources h2 { margin-bottom: 10px; }
.resources .row-link { border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; }
.pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 28px; flex-wrap: wrap; }
.pager .btn { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }

.prose { color: #ded6c6; max-width: 72ch; }
.prose h2 { font-family: var(--serif); font-size: 22px; margin: 26px 0 10px; }
.prose h3 { margin: 20px 0 8px; }
.prose ul { padding-left: 20px; margin: 0 0 12px; }
.prose li { margin-bottom: 4px; }

/* ---------- plugs ---------- */
.plugs { grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); }
.plug h3 { font-size: 17px; }
.plug details summary { cursor: pointer; color: var(--muted); font-size: 13px; }
.plug-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); }
.dialog { background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 18px; padding: 26px; width: min(480px, calc(100vw - 32px)); }
.dialog::backdrop { background: rgba(0,0,0,.6); }
.dialog h2 { font-family: var(--serif); font-size: 22px; margin-bottom: 4px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }

/* ---------- blog ---------- */
.posts { grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); }
.post h3 { font-family: var(--serif); font-size: 20px; }
.post .tag { align-self: flex-start; }
.article { max-width: 72ch; }
.article h1 { margin-bottom: 8px; }
.lead { font-size: 18px; color: var(--text); margin: 18px 0; }

/* ---------- account ---------- */
.status { font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 99px; background: var(--card-hi); }
.s-new { color: var(--info); }
.s-in_progress { color: var(--warn); }
.s-done { color: var(--ok); }
.s-cancelled { color: var(--muted); }

/* ---------- forms ---------- */
label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
input, textarea, select { font: 15px var(--sans); color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; width: 100%; }
textarea { resize: vertical; line-height: 1.5; }
input:focus, textarea:focus, select:focus { border-color: var(--gold); outline: none; }
label.check { flex-direction: row; align-items: center; gap: 8px; color: var(--text); font-weight: 500; }
label.check input { width: auto; accent-color: var(--gold); }
.hint { font-weight: 400; font-size: 12px; color: var(--muted); }
.stack { display: flex; flex-direction: column; gap: 14px; }
.form-grid { max-width: 680px; }
.form-actions { display: flex; align-items: center; gap: 12px; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; align-items: end; }
.input-btn { display: flex; gap: 6px; }
.error { color: #f0a199; background: rgba(208,87,76,.12); border: 1px solid rgba(208,87,76,.35); padding: 10px 12px; border-radius: 10px; }

/* ---------- login ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px;
  background: radial-gradient(circle at 85% 5%, rgba(216,163,63,.25), transparent 40%), var(--bg); }
.login-card { width: min(420px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 34px 30px; }
.login-card .brand { margin-bottom: 28px; }
.login-card h1 { font-size: 28px; margin-bottom: 4px; }
.login-card form { display: flex; flex-direction: column; gap: 14px; margin-top: 20px; }
.login-card .btn { margin-top: 6px; padding: 12px; }

/* ---------- admin ---------- */
.admin-tabs { margin-bottom: 24px; }
.tree { display: flex; flex-direction: column; gap: 10px; }
.node { background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.node .node { background: var(--panel); }
.node > summary, .add > summary, .edit > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 12px 14px; flex-wrap: wrap; }
.node > summary::-webkit-details-marker, .add > summary::-webkit-details-marker, .edit > summary::-webkit-details-marker { display: none; }
.node > summary::before { content: '▸'; color: var(--gold); transition: transform .15s; }
.node[open] > summary::before { transform: rotate(90deg); }
.node.leaf > summary::before { content: '•'; transform: none; }
.node-title { font-weight: 600; }
.node-body { padding: 4px 14px 16px 32px; display: flex; flex-direction: column; gap: 10px; }
.add > summary, .edit > summary { color: var(--gold); font-weight: 600; font-size: 14px; border: 1px dashed var(--line); border-radius: 10px; }
.edit > summary { border-style: solid; color: var(--muted); }
.add[open] > summary, .edit[open] > summary { margin-bottom: 12px; }
.tools { margin-left: auto; display: inline-flex; gap: 4px; }
.icon-btn { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line); background: transparent; color: var(--muted); cursor: pointer; font-size: 13px; }
.icon-btn:hover { color: var(--text); border-color: var(--muted); }
.icon-btn.danger:hover { color: var(--bad); border-color: var(--bad); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; padding: 12px 14px; background: var(--panel); }
.table td { padding: 12px 14px; border-top: 1px solid var(--line); vertical-align: top; background: var(--card); }
.table tr.off td { opacity: .55; }
.table .msg { max-width: 340px; white-space: pre-wrap; }
.status-select { width: auto; padding: 6px 10px; font-size: 13px; font-weight: 600; }
.access { margin-top: 16px; padding: 16px; border-radius: 12px; border: 1px solid var(--gold); background: rgba(216,163,63,.08); }
.access pre { white-space: pre-wrap; font: 14px/1.6 ui-monospace, Menlo, monospace; margin: 10px 0; color: var(--text); }

/* ---------- toast ---------- */
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 50; background: var(--text); color: var(--gold-ink); padding: 12px 18px; border-radius: 12px; font-weight: 600; font-size: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.4); max-width: calc(100vw - 32px); }
.toast.bad { background: var(--bad); color: #fff; }
