/* Sleek theme layer — refines the base tokens and components in app.css. */
:root {
  --bg: #f7f7f8;
  --surface: #ffffff;
  --surface-2: #f1f2f4;
  --text: #0b0d12;
  --muted: #646b78;
  --border: #e6e7eb;
  --accent: #0d7c72;
  --accent-2: #e5f4f2;
  --accent-ink: #ffffff;
  --grad: linear-gradient(135deg, #0d7c72 0%, #0e7490 55%, #3b5bdb 130%);
  --glow: 0 10px 30px -12px rgba(13, 124, 114, .45);
  --radius: 14px;
  --shadow: 0 1px 0 rgba(16, 24, 40, .02), 0 1px 3px rgba(16, 24, 40, .04);
  --shadow-hover: 0 8px 24px -10px rgba(16, 24, 40, .18);
  --font: "Geist", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "Geist Mono", "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #09090c; --surface: #111216; --surface-2: #191b21; --text: #eceef3; --muted: #8d94a3;
    --border: #23252d; --accent: #34d3bf; --accent-2: rgba(52, 211, 191, .12); --accent-ink: #04201c;
    --grad: linear-gradient(135deg, #0f766e 0%, #0e7490 55%, #4338ca 130%);
    --glow: 0 10px 40px -12px rgba(52, 211, 191, .35);
    --shadow: none; --shadow-hover: 0 10px 30px -12px rgba(0, 0, 0, .7);
  }
}
:root[data-theme="dark"] {
  --bg: #09090c; --surface: #111216; --surface-2: #191b21; --text: #eceef3; --muted: #8d94a3;
  --border: #23252d; --accent: #34d3bf; --accent-2: rgba(52, 211, 191, .12); --accent-ink: #04201c;
  --grad: linear-gradient(135deg, #0f766e 0%, #0e7490 55%, #4338ca 130%);
  --glow: 0 10px 40px -12px rgba(52, 211, 191, .35);
  --shadow: none; --shadow-hover: 0 10px 30px -12px rgba(0, 0, 0, .7);
}

body { font-size: 15px; letter-spacing: -0.006em; font-feature-settings: "ss01", "cv11"; }
h1 { font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.15rem); font-weight: 680; letter-spacing: -0.035em; }
h2 { font-size: 1.12rem; font-weight: 620; letter-spacing: -0.02em; }
h3 { font-weight: 620; letter-spacing: -0.015em; }
.eyebrow { color: var(--accent); font-size: 11.5px; letter-spacing: .12em; font-weight: 650; }
.page-head { margin-bottom: 26px; }
.page-head p { font-size: 15.5px; max-width: 70ch; }
::selection { background: color-mix(in srgb, var(--accent) 25%, transparent); }

/* shell */
.topbar { background: color-mix(in srgb, var(--bg) 72%, transparent); backdrop-filter: saturate(180%) blur(14px); -webkit-backdrop-filter: saturate(180%) blur(14px); border-bottom-color: color-mix(in srgb, var(--border) 70%, transparent); }
.brand-mark { background: var(--grad); color: #fff; border-radius: 9px; box-shadow: var(--glow); font-size: 11px; }
.countdown-chip { background: var(--surface); border: 1px solid var(--border); color: var(--text); font-variant-numeric: tabular-nums; }
.bottomnav { background: color-mix(in srgb, var(--surface) 82%, transparent); backdrop-filter: saturate(180%) blur(14px); -webkit-backdrop-filter: saturate(180%) blur(14px); border-top-color: color-mix(in srgb, var(--border) 70%, transparent); }
.bottomnav a.active svg { filter: drop-shadow(0 0 8px color-mix(in srgb, var(--accent) 60%, transparent)); }
@media (min-width: 900px) {
  .sidebar { background: var(--bg); border-right-color: color-mix(in srgb, var(--border) 80%, transparent); }
  .sidebar a.nav { position: relative; font-size: 14.5px; padding: 8px 12px; }
  .sidebar a.nav.active { background: var(--surface); color: var(--text); box-shadow: 0 0 0 1px var(--border), var(--shadow); }
  .sidebar a.nav.active::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--grad); }
  .sidebar a.nav.active svg { color: var(--accent); }
  .sidebar svg { width: 19px; height: 19px; }
  .sidebar .nav-sep { font-size: 10.5px; letter-spacing: .14em; }
  main#view { padding: 36px 44px 72px; }
}

/* cards & surfaces */
.card { border-color: var(--border); box-shadow: var(--shadow); padding: 20px; transition: border-color .15s, box-shadow .2s, transform .15s; }
a.card:hover, a.dom-card:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); box-shadow: var(--shadow-hover); transform: translateY(-1px); text-decoration: none; }
.kpi { background: var(--surface-2); border: 1px solid transparent; border-radius: 12px; }
.kpi .v { font-size: 1.45rem; font-weight: 680; letter-spacing: -0.03em; }
.bar { height: 6px; }
.pill { font-weight: 600; letter-spacing: -0.005em; border: 1px solid transparent; }
.pill.accent { border-color: color-mix(in srgb, var(--accent) 25%, transparent); }

/* buttons */
.btn { border-radius: 10px; font-weight: 600; font-size: 14px; box-shadow: var(--shadow); }
.btn.primary { background: var(--grad); border-color: transparent; color: #fff; box-shadow: var(--glow); }
.btn.primary:hover { filter: brightness(1.08) saturate(1.05); background: var(--grad); }
.btn.ghost { box-shadow: none; }
.chip { background: var(--surface); transition: border-color .12s, background .12s; }
.chip:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }

/* hero (dashboard) */
.hero > .card:first-child {
  position: relative; overflow: hidden; color: #fff; border: 0;
  background: radial-gradient(120% 140% at 100% 0%, rgba(255,255,255,.14) 0%, transparent 45%), var(--grad);
  box-shadow: var(--glow);
}
.hero > .card:first-child::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px);
  background-size: 28px 28px; mask-image: linear-gradient(180deg, rgba(0,0,0,.6), transparent 70%);
}
.hero > .card:first-child > * { position: relative; z-index: 1; }
.hero > .card:first-child .muted { color: rgba(255,255,255,.78) !important; }
.hero > .card:first-child .kpi { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.14); backdrop-filter: blur(6px); }
.hero > .card:first-child .kpi .l, .hero > .card:first-child .kpi .muted { color: rgba(255,255,255,.75) !important; }
.hero .ring circle:first-child { stroke: rgba(255,255,255,.18); }
.hero .ring circle:nth-child(2) { stroke: #fff; }
.hero .ring text { fill: #fff !important; }
.next-list .ico { background: var(--surface-2); color: var(--accent); border: 1px solid var(--border); border-radius: 10px; }
.next-list li a strong { color: var(--text); font-weight: 600; }
.next-list li a:hover strong { color: var(--accent); }

/* domain cards */
.dom-card .name { font-weight: 620; letter-spacing: -0.015em; }
.dom-dot { border-radius: 50%; box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 0%, transparent); }

/* notes */
.prose { font-size: 16px; }
.prose h4 { font-size: 1.02rem; letter-spacing: -0.015em; }
.prose strong { font-weight: 640; }
.callout { background: var(--surface); border-radius: 12px; }
.callout.key { border-left: 0; box-shadow: inset 3px 0 0 var(--accent); }
.callout.trap { border-left: 0; box-shadow: inset 3px 0 0 var(--bad); }
.callout.formula { border-left: 0; box-shadow: inset 3px 0 0 var(--warn); }
.topic-list li a { border-radius: 10px; padding: 12px 10px; border-bottom-color: color-mix(in srgb, var(--border) 70%, transparent); }

/* questions */
.choice { border-width: 1px; border-radius: 12px; padding: 13px 15px; transition: border-color .12s, background .12s, transform .08s; }
.choice:hover:not(:disabled) { background: color-mix(in srgb, var(--accent) 4%, var(--surface)); }
.choice:active:not(:disabled) { transform: scale(.997); }
.choice .letter { border-radius: 8px; font-family: var(--mono); }
.choice.selected { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.explain { background: var(--surface); border: 1px solid var(--border); }
.q-progress { height: 3px; }
.q-progress span, .bar > span { background: var(--grad); }
.exam-bar { backdrop-filter: blur(12px); background: color-mix(in srgb, var(--surface) 85%, transparent); }

/* flashcards */
.flash-face { border-radius: 20px; font-size: 19px; letter-spacing: -0.015em; }
.flash-back { background: radial-gradient(120% 120% at 0% 0%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 60%), var(--surface); }

/* tables & inputs */
th { font-size: 11px; letter-spacing: .08em; }
input[type=text], input[type=number], input[type=date], input[type=password], input[type=search], select, textarea { border-radius: 10px; background: var(--surface); transition: border-color .12s, box-shadow .12s; }
input:focus, select:focus, textarea:focus { outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.tabs a.active { border-image: var(--grad) 1; }
.tool-out { background: var(--surface-2); border: 1px solid var(--border); }
.week.current { box-shadow: 0 0 0 1px var(--accent), var(--glow); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } .flash-inner { transition: none !important; } }
.explain { white-space: normal; }
.explain .exp-text { white-space: pre-line; }
@media (max-width: 520px) {
  .ring-wrap { align-items: flex-start; gap: 14px; }
  .ring { width: 78px; height: 78px; }
  .hero > .card:first-child h2 { font-size: 1.05rem; }
}
@media (max-width: 640px) {
  .stack-table thead { display: none; }
  .stack-table tr { display: block; padding: 10px 12px; border-bottom: 1px solid var(--border); }
  .stack-table td { display: block; padding: 3px 0; border: 0; width: auto !important; }
}
