/* =========================================================================
   The Slap-Proof Curriculum — styles
   ========================================================================= */
:root {
  --bg: #0a0e1a;
  --bg-2: #0e1424;
  --panel: #111a2e;
  --panel-2: #15203a;
  --card: #121a2e;
  --line: #233048;
  --line-soft: #1a2438;
  --text: #e6ecf8;
  --text-dim: #9aa6c4;
  --text-mute: #6b7796;
  --accent: #7cf5c8;
  --accent-2: #8bb4ff;
  --gold: #ffd166;
  --pink: #ff8fa3;
  --radius: 16px;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --disp: "Space Grotesk", system-ui, sans-serif;
  --body: "Inter", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--body);
  color: var(--text);
  background:
    radial-gradient(1100px 600px at 85% -10%, rgba(124, 245, 200, 0.07), transparent 60%),
    radial-gradient(900px 500px at -5% 10%, rgba(139, 180, 255, 0.07), transparent 55%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
}

/* layout */
.layout { display: grid; grid-template-columns: 290px 1fr; min-height: 100vh; }

/* sidebar */
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: linear-gradient(180deg, var(--bg-2), var(--bg));
  border-right: 1px solid var(--line-soft);
  padding: 22px 16px; display: flex; flex-direction: column; gap: 14px;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 4px 6px 12px; border-bottom: 1px solid var(--line-soft); }
.brand-mark { font-size: 22px; filter: saturate(1.2); }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-family: var(--disp); font-size: 17px; letter-spacing: -0.02em; }
.brand-text span { font-size: 10.5px; color: var(--text-mute); text-transform: lowercase; }

.nav { display: flex; flex-direction: column; gap: 3px; flex: 1; }
.nav-item {
  --gc: var(--accent);
  display: flex; align-items: center; gap: 10px; width: 100%;
  background: transparent; border: 1px solid transparent; border-radius: 11px;
  padding: 8px 10px; cursor: pointer; color: var(--text-dim);
  font-family: var(--body); font-size: 12.5px; text-align: left; transition: 0.15s;
}
.nav-item:hover { background: var(--panel); color: var(--text); }
.nav-item.active { background: var(--panel-2); border-color: var(--line); color: var(--text); box-shadow: inset 3px 0 0 var(--gc); }
.nav-emoji { font-size: 14px; width: 18px; text-align: center; flex-shrink: 0; }
.nav-label { flex: 1; line-height: 1.25; }
.nav-count {
  font-family: var(--mono); font-size: 10px; color: var(--text-mute);
  background: var(--bg); border: 1px solid var(--line-soft); border-radius: 20px; padding: 1px 7px; flex-shrink: 0;
}
.nav-count.done { color: #0a0e1a; background: var(--accent); border-color: var(--accent); font-weight: 600; }

.sidebar-foot { border-top: 1px solid var(--line-soft); padding-top: 12px; }
.ghost-btn {
  width: 100%; background: transparent; border: 1px solid var(--line); color: var(--text-dim);
  border-radius: 10px; padding: 7px; font-family: var(--body); font-size: 12px; cursor: pointer; transition: 0.15s;
}
.ghost-btn:hover { border-color: var(--pink); color: var(--pink); }
.credit { font-size: 10.5px; color: var(--text-mute); line-height: 1.5; margin: 12px 4px 2px; }
.credit code { font-family: var(--mono); color: var(--accent-2); font-size: 10px; }

/* main */
.main { min-width: 0; }
.hero { padding: 46px clamp(20px, 5vw, 64px) 26px; border-bottom: 1px solid var(--line-soft); }
.hero-inner { max-width: 920px; }
.eyebrow { font-family: var(--mono); font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--accent); margin: 0 0 10px; }
h1 { font-family: var(--disp); font-size: clamp(30px, 5vw, 50px); line-height: 1.02; letter-spacing: -0.03em; margin: 0 0 14px;
  background: linear-gradient(120deg, #fff 20%, var(--accent) 60%, var(--accent-2)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.lede { font-size: 15.5px; line-height: 1.6; color: var(--text-dim); max-width: 760px; margin: 0 0 22px; }
.lede strong { color: var(--text); font-weight: 600; }
.lede em { color: var(--gold); font-style: italic; }

.progress-wrap { margin: 0 0 20px; max-width: 760px; }
.progress-track { height: 9px; background: var(--bg-2); border: 1px solid var(--line-soft); border-radius: 20px; overflow: hidden; }
.progress-bar { height: 100%; width: 0%; border-radius: 20px; background: linear-gradient(90deg, var(--accent-2), var(--accent)); transition: width 0.45s cubic-bezier(.2,.8,.2,1); box-shadow: 0 0 14px rgba(124,245,200,.5); }
.progress-meta { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; gap: 12px; }
#proglabel { font-size: 12.5px; color: var(--text-dim); font-family: var(--mono); }
.slaptest { font-family: var(--mono); font-size: 10px; letter-spacing: 0.05em; padding: 3px 9px; border-radius: 20px; border: 1px solid var(--line); color: var(--text-mute); white-space: nowrap; }
.slaptest.passed { color: #0a0e1a; background: var(--accent); border-color: var(--accent); font-weight: 600; }

.controls { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.search-box { position: relative; flex: 1; min-width: 240px; }
.search-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-mute); font-size: 16px; }
#search { width: 100%; background: var(--panel); border: 1px solid var(--line); color: var(--text); border-radius: 12px; padding: 12px 14px 12px 38px; font-family: var(--body); font-size: 14px; transition: 0.15s; }
#search:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(124,245,200,.12); }
.primary-btn { background: linear-gradient(120deg, var(--accent), var(--accent-2)); color: #07121f; border: none; border-radius: 12px; padding: 12px 18px; font-family: var(--disp); font-weight: 600; font-size: 14px; cursor: pointer; transition: 0.15s; }
.primary-btn:hover { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(124,245,200,.25); }
.primary-btn.alt { background: linear-gradient(120deg, var(--gold), #f6a560); color: #2a1c05; }
.primary-btn.active { background: linear-gradient(120deg, var(--pink), #f778ba); color: #2a0512; }
.howto { font-size: 11.5px; color: var(--text-mute); margin: 14px 0 0; }

.quizstat { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 16px 0 0; padding: 10px 14px; background: rgba(255,209,102,.07); border: 1px solid rgba(255,209,102,.25); border-radius: 12px; font-size: 12.5px; color: var(--text-dim); }
.quizstat-label { font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.12em; color: var(--gold); font-weight: 600; }
.quizstat-score { font-family: var(--mono); margin-left: auto; color: var(--text); }
.quizstat-score b { color: var(--accent); }
.ghost-btn.inline { width: auto; padding: 5px 12px; font-size: 11.5px; }

/* content */
.content { padding: 30px clamp(20px, 5vw, 64px) 40px; max-width: 1300px; }
.group { margin-bottom: 40px; scroll-margin-top: 20px; }
.group-head { --gc: var(--accent); display: flex; align-items: center; gap: 12px; margin: 0 0 18px; padding-bottom: 10px; border-bottom: 1px solid var(--line-soft); }
.group-n { font-size: 22px; }
.group-head h2 { font-family: var(--disp); font-size: 19px; letter-spacing: -0.02em; margin: 0; flex: 1; color: var(--text); }
.group-head h2::before { content: ""; }
.group-prog { font-family: var(--mono); font-size: 11px; color: var(--gc); border: 1px solid var(--line); border-radius: 20px; padding: 2px 10px; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 16px; }

.card {
  background: linear-gradient(180deg, var(--card), #0e1626);
  border: 1px solid var(--line-soft); border-radius: var(--radius);
  padding: 16px 17px 15px; position: relative; transition: 0.18s; scroll-margin-top: 24px;
}
.card:hover { border-color: var(--line); transform: translateY(-2px); box-shadow: 0 14px 30px rgba(0,0,0,.35); }
.card.flash { animation: flash 1.2s ease; }
@keyframes flash { 0%,100% { box-shadow: 0 0 0 0 rgba(124,245,200,0); } 25% { box-shadow: 0 0 0 3px rgba(124,245,200,.6); border-color: var(--accent); } }

.card-top { display: flex; align-items: flex-start; gap: 11px; margin-bottom: 10px; }
.known-toggle {
  flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%; margin-top: 2px;
  border: 2px solid var(--line); background: var(--bg-2); color: #07121f; cursor: pointer;
  font-size: 13px; font-weight: 700; display: flex; align-items: center; justify-content: center; transition: 0.18s;
}
.known-toggle:hover { border-color: var(--accent); }
.known-toggle.on { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 12px rgba(124,245,200,.5); }
.known-toggle.pop { animation: pop 0.35s ease; }
@keyframes pop { 50% { transform: scale(1.35); } }
.card-head { flex: 1; min-width: 0; }
.card-group { --gc: var(--accent); font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.04em; color: var(--gc); text-transform: uppercase; }
.card-head h3 { font-family: var(--disp); font-size: 17px; letter-spacing: -0.02em; margin: 3px 0 0; line-height: 1.15; }

.card-tldr { font-size: 13.5px; line-height: 1.5; color: var(--text); margin: 0 0 12px; }
.tldr-badge { font-family: var(--mono); font-size: 9px; font-weight: 600; letter-spacing: 0.05em; color: #07121f; background: var(--gold); border-radius: 5px; padding: 1.5px 6px; margin-right: 5px; vertical-align: middle; }

.card-visual { background: var(--bg-2); border: 1px solid var(--line-soft); border-radius: 11px; padding: 8px; margin: 0 0 12px; }
.viz { width: 100%; height: auto; display: block; }

.card-core { font-size: 12.8px; line-height: 1.62; color: var(--text-dim); margin: 0 0 12px; }
.card-core b { color: var(--text); font-weight: 600; }
.card-core i { color: var(--accent); font-style: italic; }

.card-yours { background: rgba(124,245,200,.05); border: 1px solid rgba(124,245,200,.18); border-radius: 11px; padding: 9px 11px; margin: 0 0 11px; }
.yours-tag { font-family: var(--mono); font-size: 8.5px; letter-spacing: 0.1em; font-weight: 600; color: var(--accent); }
.card-yours p { font-size: 12.3px; line-height: 1.55; color: var(--text-dim); margin: 4px 0 0; }
.card-yours b { color: var(--accent); font-weight: 600; }
.card-yours i { color: var(--text); font-style: italic; }
.card-yours code, .card-core code, .card-tldr code { font-family: var(--mono); font-size: 11px; background: var(--bg); border: 1px solid var(--line-soft); border-radius: 4px; padding: 0 4px; color: var(--accent-2); }

.card-slap { font-size: 11.8px; color: var(--text-mute); margin: 0 0 11px; line-height: 1.4; }
.card-slap em { color: var(--gold); font-style: italic; font-weight: 500; }

.card-see { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding-top: 10px; border-top: 1px solid var(--line-soft); }
.card-see > span { font-size: 10px; color: var(--text-mute); text-transform: uppercase; letter-spacing: 0.06em; margin-right: 2px; }
.xref { font-size: 11.5px; color: var(--accent-2); text-decoration: none; background: rgba(139,180,255,.08); border: 1px solid rgba(139,180,255,.2); border-radius: 7px; padding: 2px 8px; transition: 0.15s; }
.xref:hover { background: rgba(139,180,255,.2); color: #fff; }

/* quiz mode */
.quiz-cover, .quiz-grade { display: none; }
.quiz-on .known-toggle { visibility: hidden; }
.quiz-on .card-body { display: none; }
.quiz-on .card .quiz-cover { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; padding: 6px 2px 4px; }
.quiz-on .card.revealed .card-body { display: block; animation: reveal 0.3s ease; }
.quiz-on .card.revealed .quiz-cover { display: none; }
.quiz-on .card.revealed .quiz-grade { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 12px; padding-top: 11px; border-top: 1px dashed var(--line); }
@keyframes reveal { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.quiz-q { font-size: 14px; color: var(--text-dim); margin: 4px 0 0; line-height: 1.4; }
.quiz-q b { color: var(--text); font-weight: 600; }
.reveal-btn { background: var(--panel-2); border: 1px solid var(--line); color: var(--gold); border-radius: 10px; padding: 9px 16px; font-family: var(--disp); font-weight: 600; font-size: 13px; cursor: pointer; transition: 0.15s; }
.reveal-btn:hover { border-color: var(--gold); background: rgba(255,209,102,.1); }
.quiz-grade-q { font-size: 11.5px; color: var(--text-mute); margin-right: 2px; }
.grade-btn { border-radius: 9px; padding: 6px 13px; font-family: var(--body); font-size: 12.5px; font-weight: 600; cursor: pointer; border: 1px solid var(--line); background: var(--bg-2); transition: 0.15s; }
.grade-btn.got { color: var(--accent); }
.grade-btn.got:hover, .grade-btn.got.chosen { background: var(--accent); color: #07121f; border-color: var(--accent); }
.grade-btn.miss { color: var(--pink); }
.grade-btn.miss:hover, .grade-btn.miss.chosen { background: var(--pink); color: #2a0512; border-color: var(--pink); }

.empty { text-align: center; padding: 60px 20px; color: var(--text-mute); font-size: 15px; }

.foot { padding: 26px clamp(20px,5vw,64px) 50px; border-top: 1px solid var(--line-soft); color: var(--text-dim); font-size: 12.5px; }
.foot-dim { color: var(--text-mute); margin-top: 4px; }

/* responsive */
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: column; border-right: none; border-bottom: 1px solid var(--line-soft); }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .nav-item { width: auto; flex: none; }
  .nav-label { display: none; }
  .nav-item.active .nav-label, .nav-item[data-group=""] .nav-label { display: inline; }
  .sidebar-foot { display: none; }
  .cards { grid-template-columns: 1fr; }
}
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 10px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #2f3e5c; }
