/* DSC Competency Quiz — stylesheet
 * Dark-mode first. Navy + ink + terracotta (Sam) + OKLCH module accents.
 * Ported from the Claude Design canvas (screens-a..d.jsx, tokens.css).
 */

:root {
  /* Brand palette */
  --dsc-navy: #0A1628;
  --dsc-navy-2: #0F1E34;
  --dsc-navy-3: #152944;
  --dsc-surface: #0D1A30;

  --dsc-line: rgba(245, 243, 238, 0.08);
  --dsc-line-strong: rgba(245, 243, 238, 0.14);
  --dsc-line-bright: rgba(245, 243, 238, 0.22);

  --dsc-ink: #F5F3EE;
  --dsc-ink-2: rgba(245, 243, 238, 0.72);
  --dsc-ink-3: rgba(245, 243, 238, 0.52);
  --dsc-ink-4: rgba(245, 243, 238, 0.36);
  --dsc-ink-5: rgba(245, 243, 238, 0.18);

  --dsc-blue: #3B82F6;
  --dsc-blue-soft: rgba(59, 130, 246, 0.16);
  --dsc-blue-glow: rgba(59, 130, 246, 0.35);

  /* Sam — warm terracotta */
  --dsc-sam: #E8A87C;
  --dsc-sam-soft: rgba(232, 168, 124, 0.18);

  /* Module accents — OKLCH for consistent chroma across hues */
  --mod-ps:  oklch(0.78 0.13 215);
  --mod-sd:  oklch(0.74 0.13 295);
  --mod-ai:  oklch(0.76 0.14 340);
  --mod-sup: oklch(0.78 0.13 150);

  /* Tier */
  --tier-bronze: #CD7F32;
  --tier-silver: #C0C0C0;
  --tier-gold:   #FFD700;

  /* Feedback */
  --ok:   oklch(0.78 0.14 150);
  --no:   oklch(0.70 0.18 25);
  --warn: oklch(0.80 0.14 75);

  /* Type */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  /* Radii */
  --r-xs: 6px;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;

  /* Shadows */
  --shadow-1: 0 1px 2px rgba(0,0,0,0.25), 0 4px 14px rgba(0,0,0,0.18);
  --shadow-2: 0 10px 40px rgba(0,0,0,0.45), 0 2px 4px rgba(0,0,0,0.30);
  --glow-blue: 0 0 0 1px var(--dsc-blue-glow), 0 0 24px rgba(59,130,246,0.25);
}

/* Light theme (optional) */
[data-theme="light"] {
  --dsc-navy: #F5F3EE;
  --dsc-navy-2: #EDE8DC;
  --dsc-navy-3: #E0DACA;
  --dsc-surface: #F0EEE9;
  --dsc-line: rgba(10, 22, 40, 0.10);
  --dsc-line-strong: rgba(10, 22, 40, 0.16);
  --dsc-line-bright: rgba(10, 22, 40, 0.28);
  --dsc-ink: #0A1628;
  --dsc-ink-2: rgba(10, 22, 40, 0.72);
  --dsc-ink-3: rgba(10, 22, 40, 0.52);
  --dsc-ink-4: rgba(10, 22, 40, 0.36);
  --dsc-ink-5: rgba(10, 22, 40, 0.18);
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: var(--dsc-navy);
  color: var(--dsc-ink);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  letter-spacing: -0.005em;
  min-height: 100vh;
  overflow-x: hidden;
}
body { font-feature-settings: 'ss01', 'cv11'; }

#app {
  min-height: 100vh;
  position: relative;
}

/* Ambient dot grid on the whole page */
.grid-bg::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(var(--dsc-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--dsc-line) 1px, transparent 1px);
  background-size: 32px 32px;
  background-position: -1px -1px;
  opacity: .5;
  pointer-events: none;
  mask-image: radial-gradient(ellipse at 50% 40%, #000 30%, transparent 85%);
  z-index: 0;
}

.mono { font-family: var(--font-mono); letter-spacing: 0; }
.uc   { text-transform: uppercase; letter-spacing: 0.08em; }
.nowrap { white-space: nowrap; }

/* Brand lockup — monogram + wordmark */
.brand-lockup {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--dsc-ink);
  line-height: 1;
}
.brand-mark { flex: 0 0 auto; }
.brand-wordmark {
  font-family: var(--font-sans);
  font-weight: 650;
  letter-spacing: -0.015em;
  line-height: 1;
  white-space: nowrap;
  color: var(--dsc-ink);
}
/* On very narrow screens hide the wordmark — just show the monogram */
@media (max-width: 480px) {
  .landing-nav-tagline { display: none; }
  .brand-wordmark { display: none; }
  .brand-lockup { gap: 0; }
}

/* Screen container */
.screen {
  position: relative;
  min-height: 100vh;
  z-index: 1;
}
.screen-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 40px;
}

/* Blinking terminal cursor */
@keyframes dsc-blink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }
.cursor {
  display: inline-block;
  width: 0.55em; height: 1em;
  vertical-align: -0.12em;
  background: currentColor;
  margin-left: 0.25em;
  animation: dsc-blink 1.05s steps(1) infinite;
}
.cursor-thin { width: 2px; background: currentColor; }

/* Sheen sweep */
@keyframes dsc-sheen {
  0%   { transform: translateX(-120%) skewX(-20deg); }
  100% { transform: translateX(220%)  skewX(-20deg); }
}

/* Fade / slide utilities */
@keyframes fade-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
@keyframes count-up { from { opacity: 0; } to { opacity: 1; } }
.fade-in { animation: fade-in 350ms ease-out both; }

/* Focus */
button, [role="button"], input, textarea, select, a {
  outline: none;
}
:focus-visible {
  outline: 2px solid var(--dsc-blue);
  outline-offset: 2px;
  border-radius: 6px;
}

/* Scrollbar hiding in artboard-like panels */
.hide-scroll ::-webkit-scrollbar { width: 0; height: 0; }
.hide-scroll { scrollbar-width: none; }

/* ─── BUTTON ──────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  height: 48px; padding: 0 22px;
  border-radius: 12px;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 15px;
  background: var(--dsc-ink);
  color: var(--dsc-navy);
  border: none;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s, opacity .15s;
  text-decoration: none;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 10px 30px rgba(245,243,238,0.12); }
.btn:active { transform: translateY(0); }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-primary { background: var(--dsc-blue); color: white; }
.btn-primary:hover { box-shadow: 0 0 0 1px var(--dsc-blue), 0 10px 30px var(--dsc-blue-glow); }

.btn-ghost { background: transparent; color: var(--dsc-ink); border: 1px solid var(--dsc-line-bright); }
.btn-ghost:hover { background: rgba(255,255,255,0.04); }

.btn-sm { height: 36px; padding: 0 14px; font-size: 13px; border-radius: 9px; }
.btn-icon { gap: 0; padding: 0 10px; justify-content: center; }

/* ─── CHIP / PILL ─────────────────────────────────────────────── */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 24px; padding: 0 10px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 11px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--dsc-line-strong);
  color: var(--dsc-ink-2);
  white-space: nowrap;
}
[data-theme="light"] .chip { background: rgba(10,22,40,0.04); }

.chip-solid { background: var(--dsc-blue); color: white; border-color: transparent; }

/* ─── OPTION CARD (MCQ) ───────────────────────────────────────── */
.opt {
  position: relative;
  display: flex; align-items: flex-start; gap: 12px;
  border: 1px solid var(--dsc-line-strong);
  background: linear-gradient(180deg, rgba(255,255,255,0.025), rgba(255,255,255,0));
  border-radius: var(--r-md);
  padding: 14px 16px;
  cursor: pointer;
  transition: border-color .15s, background .15s, transform .12s, opacity .15s;
  width: 100%;
  text-align: left;
  font: inherit;
  color: inherit;
}
[data-theme="light"] .opt { background: linear-gradient(180deg, rgba(10,22,40,0.02), transparent); }
.opt:hover { border-color: var(--dsc-line-bright); background: linear-gradient(180deg, rgba(255,255,255,0.045), rgba(255,255,255,0.01)); }
.opt[data-state="selected"] {
  border-color: var(--dsc-blue);
  background: var(--dsc-blue-soft);
  box-shadow: inset 0 0 0 1px var(--dsc-blue-glow);
}
.opt[data-state="correct"] {
  border-color: var(--ok);
  background: color-mix(in oklch, var(--ok) 14%, transparent);
}
.opt[data-state="wrong"] {
  border-color: var(--no);
  background: color-mix(in oklch, var(--no) 14%, transparent);
}
.opt[data-state="dimmed"] { opacity: .35; filter: grayscale(0.5); pointer-events: none; }

.opt-letter {
  width: 26px; height: 26px; border-radius: 7px;
  background: rgba(255,255,255,0.06);
  color: var(--dsc-ink-2);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 11px; font-weight: 600;
  flex: 0 0 26px; margin-top: 1px;
}
[data-theme="light"] .opt-letter { background: rgba(10,22,40,0.06); }
.opt[data-state="selected"] .opt-letter { background: var(--dsc-blue); color: white; }
.opt[data-state="correct"] .opt-letter { background: var(--ok); color: white; }
.opt[data-state="wrong"] .opt-letter { background: var(--no); color: white; }

.opt-body { flex: 1; font-size: 14.5px; line-height: 1.45; }
.opt-tick { width: 16px; height: 16px; flex: 0 0 16px; margin-top: 5px; color: var(--dsc-blue); }
.opt[data-state="selected"] .opt-tick { display: block; }
.opt-tick { display: none; }

/* ─── TOP BAR / PROGRESS PILL / MODULE CHIP ───────────────────── */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  padding: 18px 28px 14px;
  border-bottom: 1px solid var(--dsc-line);
  position: sticky; top: 0;
  background: color-mix(in oklch, var(--dsc-navy) 92%, transparent);
  backdrop-filter: blur(8px);
  z-index: 20;
}
.topbar-left { display: flex; align-items: center; gap: 14px; min-width: 0; flex: 1; min-height: 0; }
.topbar-right { display: inline-flex; align-items: center; gap: 10px; }
.timer-chip { gap: 6px; color: var(--dsc-ink-3); }
.timer-chip .timer-value { color: var(--dsc-ink-2); }
@media (max-width: 760px) {
  .topbar-right { width: auto; }
}

.progress-pill {
  display: inline-flex; flex-direction: column; gap: 4px; min-width: 90px;
}
.progress-pill-num { height: 22px; font-size: 10.5px; }
.progress-bar {
  height: 2px; background: var(--dsc-ink-5); border-radius: 2px; overflow: hidden;
}
.progress-fill { height: 100%; background: var(--dsc-blue); border-radius: 2px; transition: width .25s ease; }

.module-chip { display: inline-flex; align-items: center; gap: 6px; }
.module-chip-dot {
  width: 8px; height: 8px; border-radius: 50%;
  box-shadow: 0 0 10px currentColor;
}

/* ─── LIFELINE TRAY ───────────────────────────────────────────── */
.lifelines { display: inline-flex; gap: 6px; }
.lifeline {
  display: flex; align-items: center; gap: 8px;
  height: 32px; padding: 0 10px;
  border-radius: 8px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--dsc-line-strong);
  color: var(--dsc-ink);
  font: 500 12.5px/1 var(--font-sans);
  cursor: pointer;
  transition: all .15s;
}
[data-theme="light"] .lifeline { background: rgba(10,22,40,0.04); }
.lifeline:hover:not([disabled]) {
  border-color: var(--dsc-line-bright);
  background: rgba(255,255,255,0.07);
  transform: translateY(-1px);
}
.lifeline[disabled] {
  background: rgba(255,255,255,0.015);
  color: var(--dsc-ink-4);
  cursor: not-allowed;
  opacity: 0.6;
}
.lifeline-count {
  font-family: var(--font-mono); font-size: 10px;
  padding: 2px 6px; background: rgba(0,0,0,0.25); border-radius: 6px;
  min-width: 18px; text-align: center;
}
[data-theme="light"] .lifeline-count { background: rgba(10,22,40,0.08); }
.lifeline[data-low="1"] .lifeline-count { color: var(--warn); }
.lifeline[disabled] .lifeline-count { color: var(--dsc-ink-4); }

/* Floating (mobile) variant */
.lifelines-floating {
  position: fixed; right: 14px; bottom: calc(80px + env(safe-area-inset-bottom, 0px));
  display: none;
  flex-direction: column; gap: 8px;
  z-index: 16;
}
.lifelines-floating .lifeline {
  height: 44px; padding: 0 14px; border-radius: 22px;
  background: color-mix(in oklch, var(--dsc-navy) 85%, transparent);
  backdrop-filter: blur(10px);
}
.lifelines-floating .lifeline-label { display: none; }

@media (max-width: 760px) {
  .lifelines-bar { display: none; }
  .lifelines-floating { display: flex; }
}

/* ─── NEXT BAR ────────────────────────────────────────────────── */
.nextbar {
  position: sticky; bottom: 0; left: 0; right: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 24px calc(16px + env(safe-area-inset-bottom, 0px));
  gap: 12px;
  border-top: 1px solid var(--dsc-line);
  background: color-mix(in oklch, var(--dsc-navy) 92%, transparent);
  backdrop-filter: blur(10px);
  z-index: 15;
}
@media (min-width: 760px) {
  .nextbar { padding: 20px 28px; }
}
.nextbar-hint {
  font-family: var(--font-mono); font-size: 11px; color: var(--dsc-ink-3);
  flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
@media (max-width: 760px) {
  .topbar { padding: 12px 16px 10px; gap: 8px; flex-wrap: wrap; }
  .screen-inner { padding: 0 20px; }
}

/* ─── CODE BLOCK ──────────────────────────────────────────────── */
.codeblock {
  background: #06101F;
  border: 1px solid var(--dsc-line-strong);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 22px;
}
[data-theme="light"] .codeblock { background: #1b1f2b; }
.codeblock-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 14px;
  border-bottom: 1px solid var(--dsc-line);
  background: var(--dsc-navy);
}
[data-theme="light"] .codeblock-header { background: #11151e; }
.codeblock-meta { font-family: var(--font-mono); font-size: 10.5px; color: rgba(245,243,238,0.52); }
.codeblock-body {
  padding: 12px 0;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.65;
  color: rgba(245,243,238,0.95);
  overflow-x: auto;
}
.codeblock-line { display: flex; white-space: pre; }
.codeblock-ln { width: 42px; text-align: right; padding-right: 14px;
  color: rgba(245,243,238,0.18); user-select: none; flex: 0 0 42px; }
.tok-kw { color: #C38BF5; }
.tok-str { color: #8EE5A2; }
.tok-com { color: var(--dsc-ink-4); font-style: italic; }
.tok-id { color: #8FC8F7; }
.tok-punct { color: var(--dsc-ink-3); }
.tok-num { color: #FFB078; }

/* ─── TERMINAL ────────────────────────────────────────────────── */
.terminal {
  background: #06101F;
  border-radius: 14px;
  border: 1px solid var(--dsc-line-strong);
  box-shadow: var(--glow-blue);
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.55;
}
.terminal-titlebar {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  background: var(--dsc-navy);
  border-bottom: 1px solid var(--dsc-line);
}
.terminal-dot { width: 10px; height: 10px; border-radius: 50%; }
.terminal-title {
  flex: 1; text-align: center; font-size: 10.5px; color: var(--dsc-ink-4);
}
.terminal-body {
  padding: 14px 16px;
  color: var(--dsc-ink-2);
  min-height: 260px;
  max-height: 340px;
  overflow-y: auto;
  background: linear-gradient(180deg, #06101F, #050C18);
}
.terminal-line { white-space: pre-wrap; word-break: break-all; }
.terminal-line-prompt { color: var(--dsc-ink-3); }
.terminal-line-cmd { color: var(--dsc-ink); }
.terminal-line-out { color: var(--dsc-ink-2); }
.terminal-line-err { color: #FF8B7B; }
.terminal-line-ok { color: #8EE5A2; }
.terminal-prompt-char { color: var(--dsc-blue); }
.terminal-input-line { display: flex; align-items: center; gap: 6px; }
.terminal-input {
  flex: 1;
  background: transparent; border: none; outline: none;
  color: var(--dsc-ink);
  font-family: inherit; font-size: inherit;
  caret-color: var(--dsc-blue);
}

/* ─── PHISHING / SCALES GRIDS ─────────────────────────────────── */
.phish-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  align-items: start;
}
.scales-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  align-items: start;
}
@media (min-width: 900px) {
  .phish-grid  { grid-template-columns: 280px 1fr; gap: 28px; }
  .scales-grid { grid-template-columns: 320px 1fr; gap: 24px; }
}

/* ─── PHISHING EMAIL ──────────────────────────────────────────── */
.phish {
  background: #F5F3EE; color: #1a1a1a;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
  overflow: hidden;
  border: 1px solid var(--dsc-line-strong);
}
.phish-header {
  padding: 14px 18px; background: #EEEAE0;
  display: flex; justify-content: space-between; align-items: center;
}
.phish-subject { font-size: 13px; font-weight: 600; }
.phish-time { font-size: 11px; color: #7a7a7a; }
.phish-body { padding: 18px 24px; font-size: 13.5px; line-height: 1.6; }
.phish-meta { margin-bottom: 14px; font-size: 12.5px; color: #555; }
.phish-attach {
  margin-top: 18px; padding: 8px 12px;
  background: #F7F3E8; border: 1px solid #E6DCC2; border-radius: 6px;
  display: flex; align-items: center; gap: 8px;
  cursor: pointer;
}
.phish-hot {
  cursor: pointer; padding: 0 2px; border-radius: 3px;
  transition: background .12s;
}
.phish-hot:hover {
  background: rgba(196, 60, 42, 0.08);
  outline: 1.5px dashed rgba(196, 60, 42, 0.5);
  outline-offset: 2px;
}
.phish-hot[data-marked="1"] {
  background: rgba(196, 60, 42, 0.18);
  outline: 1.5px solid var(--no);
  outline-offset: 2px;
  position: relative;
}
.phish-hot[data-marked="1"]::before {
  content: attr(data-label);
  position: absolute; top: -18px; left: 0;
  font-family: var(--font-mono); font-size: 9px;
  color: white; background: var(--no);
  padding: 2px 6px; border-radius: 3px;
  white-space: nowrap; letter-spacing: 0.1em; text-transform: uppercase;
}

.phish-progress {
  background: rgba(255,255,255,0.025);
  border: 1px solid var(--dsc-line-strong);
  border-radius: 12px;
  padding: 14px 16px; margin-bottom: 14px;
}
.phish-progress-bar {
  height: 4px; background: var(--dsc-ink-5); border-radius: 2px; margin-top: 6px;
}
.phish-progress-fill {
  height: 100%; background: var(--no); border-radius: 2px;
  transition: width .25s ease;
}

/* ─── BALANCE SCALES ──────────────────────────────────────────── */
.scales-weight {
  width: 56px; height: 56px; border-radius: 10px;
  display: grid; place-items: center;
  font-family: var(--font-mono); font-weight: 600; font-size: 14px;
  cursor: grab; user-select: none;
  transition: transform .15s, box-shadow .15s;
  touch-action: none;
}
.scales-weight[data-kind="sq"] {
  background: color-mix(in oklch, var(--mod-ps) 25%, transparent);
  border: 1px solid var(--mod-ps);
  color: var(--mod-ps);
}
.scales-weight[data-kind="ci"] {
  background: color-mix(in oklch, var(--mod-ai) 25%, transparent);
  border: 1px solid var(--mod-ai);
  color: var(--mod-ai);
  border-radius: 50%;
}
.scales-weight:active { cursor: grabbing; transform: scale(1.05); box-shadow: 0 4px 20px rgba(0,0,0,0.3); }
.scales-weight[data-placed="1"] { opacity: 0.35; cursor: default; pointer-events: none; }

.scales-pan {
  min-height: 64px;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  flex-wrap: wrap;
  padding: 6px;
}

/* ─── RANK / DRAG LIST ────────────────────────────────────────── */
.rank-list { display: flex; flex-direction: column; gap: 8px; }
.rank-item {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px;
  background: rgba(255,255,255,0.025);
  border: 1px solid var(--dsc-line-strong);
  border-radius: 12px;
  transition: transform .2s, box-shadow .2s, background .2s, border-color .2s;
  user-select: none;
  touch-action: none;
}
[data-theme="light"] .rank-item { background: rgba(10,22,40,0.02); }
.rank-item[data-dragging="1"] {
  background: rgba(59,130,246,0.08);
  border-color: var(--dsc-blue);
  transform: translateY(-2px) scale(1.01);
  box-shadow: 0 14px 34px rgba(0,0,0,0.4);
  z-index: 5;
}
.rank-handle {
  display: flex; flex-direction: column; gap: 2px;
  color: var(--dsc-ink-4); cursor: grab;
  font-family: var(--font-mono); font-size: 10px;
  line-height: 0.8;
}
.rank-handle:active { cursor: grabbing; }
.rank-num {
  width: 26px; height: 26px; border-radius: 6px;
  background: rgba(0,0,0,0.3); color: var(--dsc-ink-2);
  display: grid; place-items: center;
  font-family: var(--font-mono); font-size: 11px; font-weight: 600;
}
[data-theme="light"] .rank-num { background: rgba(10,22,40,0.08); }
.rank-body { flex: 1; font-size: 14.5px; }

/* ─── SAM AVATAR + BUBBLE ─────────────────────────────────────── */
.sam-overlay {
  position: fixed; inset: 0; z-index: 50;
  background: color-mix(in oklch, var(--dsc-navy) 70%, transparent);
  backdrop-filter: blur(6px);
  display: flex; align-items: flex-end; justify-content: flex-end;
  padding: 20px;
  animation: fade-in 200ms ease-out;
}
.sam-cluster {
  display: flex; align-items: flex-end; gap: 10px;
  max-width: 380px;
}
.sam-bubble {
  background: linear-gradient(180deg, #F5F3EE, #EDE8DC);
  color: var(--dsc-navy);
  border-radius: 16px 16px 4px 16px;
  padding: 14px 16px;
  box-shadow: var(--shadow-2);
  position: relative;
  animation: sam-in 360ms cubic-bezier(0.18, 0.89, 0.32, 1.28) both;
}
@keyframes sam-in {
  from { opacity: 0; transform: translateY(10px) scale(0.92); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.sam-title {
  font-family: var(--font-mono);
  font-size: 9.5px; color: var(--dsc-sam);
  margin-bottom: 6px; letter-spacing: 0.14em; font-weight: 700;
  text-transform: uppercase;
}
.sam-text { font-size: 13.5px; line-height: 1.5; }
.sam-dismiss {
  margin-top: 10px; font-size: 11.5px;
  background: transparent; border: none;
  color: var(--dsc-sam); font-weight: 600;
  padding: 0; cursor: pointer;
}
.sam-counter {
  position: absolute; top: -10px; right: 10px;
  background: var(--dsc-navy); color: var(--dsc-sam);
  font-family: var(--font-mono);
  font-size: 9.5px; padding: 3px 7px; border-radius: 10px;
  border: 1px solid var(--dsc-sam);
}

/* ─── TIER BADGE ──────────────────────────────────────────────── */
.tier-badge { position: relative; display: inline-block; }
.tier-badge-sheen {
  position: absolute; inset: 0; overflow: hidden;
  border-radius: 50%; pointer-events: none;
}
.tier-badge-sheen > div {
  position: absolute; top: 0; bottom: 0; width: 40%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
  animation: dsc-sheen 2.5s ease-in-out infinite;
}
.tier-badge-label {
  position: absolute; bottom: -18px; left: 0; right: 0;
  text-align: center; font-size: 10px;
  letter-spacing: 0.2em; font-weight: 600;
  font-family: var(--font-mono);
}

/* ─── LANDING ─────────────────────────────────────────────────── */
.landing {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center;
  min-height: 100vh;
  padding: 100px 24px 80px;
  position: relative;
  box-sizing: border-box;
}
@media (min-width: 760px) {
  .landing { padding: 120px 40px 80px; }
}
.landing-nav {
  position: absolute; top: 0; left: 0; right: 0;
  display: flex; justify-content: space-between; align-items: center;
  padding: 20px 24px;
  gap: 12px;
  flex-wrap: wrap;
}
@media (min-width: 760px) {
  .landing-nav { padding: 22px 40px; }
}
.landing-boot {
  font-family: var(--font-mono);
  font-size: clamp(10px, 1.4vw, 11px);
  color: var(--dsc-ink-3);
  line-height: 1.55;
  text-align: left;
  background: rgba(255,255,255,0.025);
  border: 1px solid var(--dsc-line-strong);
  border-radius: 10px;
  padding: 10px 16px;
  box-shadow: 0 4px 30px rgba(0,0,0,0.25);
  white-space: pre;
  overflow-x: auto;
  /* hide scrollbar cross-browser — content still scrolls via touch/wheel */
  scrollbar-width: none;
  -ms-overflow-style: none;
  min-height: 90px;
  margin-bottom: 30px;
  max-width: min(560px, 100%);
  width: 100%;
  box-sizing: border-box;
}
.landing-boot::-webkit-scrollbar { display: none; height: 0; width: 0; }
[data-theme="light"] .landing-boot { background: rgba(10,22,40,0.03); }
.landing-h1 {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: clamp(44px, 7vw, 80px);
  line-height: 0.95;
  letter-spacing: -0.03em;
  margin: 0;
  max-width: 920px;
  text-wrap: balance;
}
.landing-h1 .muted { color: var(--dsc-ink-3); }
.landing-sub {
  font-size: clamp(15px, 1.7vw, 19px);
  line-height: 1.45;
  color: var(--dsc-ink-2);
  max-width: 620px;
  margin: 24px 0 40px;
  text-wrap: pretty;
}
.landing-trust {
  display: flex; gap: 0; margin-top: 48px;
  padding: 10px 18px;
  border: 1px solid var(--dsc-line);
  border-radius: 999px;
  background: rgba(255,255,255,0.02);
  flex-wrap: wrap;
  justify-content: center;
}
.landing-trust-sep { color: var(--dsc-ink-5); margin: 0 14px; }
.landing-trust-item { font-family: var(--font-mono); font-size: 11px; color: var(--dsc-ink-3); }

.last-result {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  justify-content: center;
  padding: 10px 16px;
  background: rgba(255,255,255,0.025);
  border: 1px solid var(--dsc-line-strong);
  border-radius: 999px;
  margin-bottom: 20px;
  max-width: 480px;
}
.landing-corner-tl {
  position: absolute; top: 14px; left: 18px;
  font-family: var(--font-mono);
  font-size: 9.5px; color: var(--dsc-ink-4);
  line-height: 1.2; margin: 0; white-space: pre;
  letter-spacing: 0.05em;
  pointer-events: none;
}
.landing-corner-br {
  position: absolute; bottom: 14px; right: 18px;
  font-family: var(--font-mono);
  font-size: 9.5px; color: var(--dsc-ink-4);
  margin: 0; white-space: pre; line-height: 1.2;
  pointer-events: none;
}
@media (max-width: 600px) {
  .landing-corner-tl, .landing-corner-br { display: none; }
}

/* Generic page sub-header (below top nav) — responsive padding */
.page-subheader {
  padding: 20px 24px;
  display: flex; align-items: center; gap: 10px;
  flex-wrap: wrap;
}
@media (min-width: 760px) {
  .page-subheader { padding: 22px 40px; }
}
.page-body {
  padding: 32px 24px 140px;
}
@media (min-width: 760px) {
  .page-body { padding: 40px 40px 140px; }
}

/* ─── SELF-IDENTIFY / RULES ───────────────────────────────────── */
.pill-group { display: flex; gap: 6px; flex-wrap: wrap; }
.pill {
  padding: 10px 14px; border-radius: 10px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--dsc-line-strong);
  color: var(--dsc-ink-2);
  font-size: 13px; font-weight: 500; font-family: inherit;
  cursor: pointer;
  transition: all .15s;
}
[data-theme="light"] .pill { background: rgba(10,22,40,0.03); }
.pill:hover { border-color: var(--dsc-line-bright); }
.pill[data-active="1"] {
  background: var(--dsc-blue-soft);
  border-color: var(--dsc-blue);
  color: var(--dsc-ink);
  font-weight: 600;
}

.rules-body {
  padding: 36px 24px 0;
  max-width: 1100px;
  margin: 0 auto;
}
@media (min-width: 760px) {
  .rules-body { padding: 56px 40px 0; }
}
.about-body {
  padding: 40px 24px 120px;
  max-width: 880px;
}
@media (min-width: 760px) {
  .about-body { padding: 56px 40px 80px; }
}
.modules-body {
  padding: 28px 24px 100px;
  max-width: 1100px;
  margin: 0 auto;
}
@media (min-width: 760px) {
  .modules-body { padding: 36px 40px; }
}

.rules-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px; margin-top: 32px;
}
@media (min-width: 760px) {
  .rules-grid { gap: 18px; margin-top: 44px; }
}
.rule-card {
  background: rgba(255,255,255,0.025);
  border: 1px solid var(--dsc-line-strong);
  border-radius: 16px;
  padding: 26px 24px;
  position: relative;
}
[data-theme="light"] .rule-card { background: rgba(10,22,40,0.02); }
.rule-glyph {
  width: 44px; height: 44px; border-radius: 11px;
  display: grid; place-items: center;
  margin-bottom: 16px;
}
.rule-title { font-size: 17px; font-weight: 650; margin-bottom: 8px; letter-spacing: -0.01em; }
.rule-body { font-size: 13.5px; color: var(--dsc-ink-2); line-height: 1.55; }

/* ─── QUESTION LAYOUT ─────────────────────────────────────────── */
.question-page {
  display: flex; flex-direction: column;
  min-height: 100vh;
}
.question-content {
  flex: 1;
  padding: 48px 120px;
  max-width: 1040px;
  width: 100%;
  margin: 0 auto;
}
@media (max-width: 1024px) {
  .question-content { padding: 36px 40px; }
}
@media (max-width: 760px) {
  .question-content { padding: 22px 20px 140px; }
}
.question-module-tag {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 14px;
}
.question-prompt {
  font-size: clamp(19px, 2.5vw, 28px);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.015em;
  margin: 0 0 8px;
  max-width: 820px;
  text-wrap: pretty;
}
.question-meta {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--dsc-ink-4);
  margin-bottom: 32px;
}
.options-stack { display: flex; flex-direction: column; gap: 10px; }

/* ─── MODULE TRANSITION ──────────────────────────────────────── */
.module-transition {
  min-height: 100vh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 12px;
  padding: 0 24px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
@media (min-width: 760px) {
  .module-transition { padding: 0 80px; }
}
.module-transition::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 50%, color-mix(in oklch, var(--mod-ai) 22%, transparent), transparent 60%);
  animation: fade-in 500ms ease-out both;
}
.module-transition > * { position: relative; z-index: 1; }
.mt-up-next {
  display: flex; align-items: center; gap: 12px;
  padding: 6px 14px; border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 10.5px; letter-spacing: 0.2em; font-weight: 700;
  text-transform: uppercase;
}
.mt-title {
  font-size: clamp(56px, 10vw, 96px);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 0.95;
  margin: 10px 0;
  text-wrap: balance;
}
.mt-sub {
  font-size: clamp(16px, 2vw, 19px);
  color: var(--dsc-ink-2);
  max-width: 580px;
  margin: 0 0 18px;
}
.mt-stats { display: flex; gap: 34px; margin-top: 22px; flex-wrap: wrap; justify-content: center; }

/* ─── FEEDBACK CARD (learn mode) ─────────────────────────────── */
.feedback-card {
  padding: 0 20px;
  min-height: 220px;
  display: flex; flex-direction: column; justify-content: center;
  text-align: center;
  animation: fade-in 350ms ease-out both;
}
.feedback-icon {
  width: 56px; height: 56px; border-radius: 50%;
  display: grid; place-items: center;
  margin: 0 auto 16px;
  border: 1.5px solid currentColor;
}
.feedback-ok { color: var(--ok); background: color-mix(in oklch, var(--ok) 30%, transparent); }
.feedback-no { color: var(--no); background: color-mix(in oklch, var(--no) 30%, transparent); }

/* ─── STAT ────────────────────────────────────────────────────── */
.stat { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.stat-num {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 600;
  text-transform: uppercase;
}
.stat-label {
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--dsc-ink-4);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

/* ─── RESULTS ─────────────────────────────────────────────────── */
.results-header {
  padding: 16px 24px;
  border-bottom: 1px solid var(--dsc-line);
  display: flex; justify-content: space-between; align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
@media (min-width: 760px) {
  .results-header { padding: 20px 40px; }
}
.results-grid {
  padding: 34px 56px 0;
  display: grid; grid-template-columns: 1.1fr 1fr; gap: 48px;
}
@media (max-width: 900px) {
  .results-grid { grid-template-columns: 1fr; gap: 32px; padding: 24px 20px 0; }
}
.score-hero {
  display: flex; align-items: flex-end; gap: 16px; margin-bottom: 6px;
}
.score-big {
  font-family: var(--font-sans);
  font-size: clamp(92px, 14vw, 148px);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 0.9;
  background: linear-gradient(180deg, var(--dsc-ink), var(--tier-gold));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.score-suffix { padding-bottom: 18px; font-family: var(--font-mono); font-size: 18px; color: var(--dsc-ink-3); }
.rank-title {
  font-size: clamp(32px, 5vw, 44px);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 18px 0 8px;
}
.rank-blurb {
  font-size: 15px;
  color: var(--dsc-ink-2);
  margin: 0 0 22px;
  max-width: 440px;
}
.results-stats { display: flex; gap: 26px; margin-bottom: 32px; flex-wrap: wrap; }
.results-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.module-cards-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 18px;
}
.module-card {
  background: rgba(255,255,255,0.025);
  border: 1px solid var(--dsc-line-strong);
  border-radius: 16px;
  padding: 22px 24px;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: transform .15s, border-color .15s;
}
[data-theme="light"] .module-card { background: rgba(10,22,40,0.025); }
.module-card:hover { border-color: var(--dsc-line-bright); transform: translateY(-2px); }
.module-card-glow {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(circle at 100% 0%, var(--accent-glow), transparent 60%);
}
.module-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; position: relative; z-index: 1; }
.module-card-tier {
  font-family: var(--font-mono);
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.module-card-score {
  display: flex; align-items: flex-end; gap: 8px;
  margin-bottom: 16px; position: relative; z-index: 1;
}
.module-card-score-num {
  font-family: var(--font-mono);
  font-size: 42px; font-weight: 700;
  line-height: 1; letter-spacing: -0.02em;
}
.module-card-bar { height: 3px; background: var(--dsc-ink-5); border-radius: 2px; margin-bottom: 14px; position: relative; z-index: 1; }
.module-card-fill { height: 100%; border-radius: 2px; }
.module-card-stats {
  display: flex; justify-content: space-between;
  font-family: var(--font-mono); font-size: 11px;
  color: var(--dsc-ink-3);
  position: relative; z-index: 1;
}

/* ─── ANSWER REVIEW ──────────────────────────────────────────── */
.review-head {
  display: grid;
  grid-template-columns: 28px 1fr 1fr 1fr 80px;
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--dsc-ink-4);
  text-transform: uppercase;
  padding: 0 14px 10px;
  border-bottom: 1px solid var(--dsc-line);
  gap: 12px;
}
.review-row {
  display: grid;
  grid-template-columns: 28px 1fr 1fr 1fr 80px;
  align-items: center;
  padding: 14px; border-bottom: 1px solid var(--dsc-line);
  gap: 12px;
}
.review-row:nth-child(even) { background: rgba(255,255,255,0.012); }
[data-theme="light"] .review-row:nth-child(even) { background: rgba(10,22,40,0.025); }
.review-row-ellipsis {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
@media (max-width: 900px) {
  .review-head { display: none; }
  .review-row {
    grid-template-columns: 1fr;
    gap: 4px;
    padding: 12px 14px;
  }
  .review-row > span:nth-child(1) { font-size: 10px; color: var(--dsc-ink-4); }
}

/* ─── SHARE ──────────────────────────────────────────────────── */
.share-grid {
  padding: 48px 80px;
  display: grid; grid-template-columns: 1.2fr 1fr; gap: 52px;
  align-items: center;
}
@media (max-width: 900px) { .share-grid { grid-template-columns: 1fr; padding: 24px 20px; gap: 32px; } }
.share-note {
  background: rgba(255,255,255,0.025);
  border: 1px solid var(--dsc-line-strong);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 20px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--dsc-ink-2);
  width: 100%;
  font-family: inherit;
  resize: vertical;
  min-height: 60px;
}
[data-theme="light"] .share-note { background: rgba(10,22,40,0.02); color: var(--dsc-ink); }
.share-preview-wrap {
  background: rgba(255,255,255,0.025);
  border: 1px solid var(--dsc-line-strong);
  border-radius: 14px;
  padding: 14px;
}
[data-theme="light"] .share-preview-wrap { background: rgba(10,22,40,0.02); }
.og-card {
  aspect-ratio: 1200 / 630;
  width: 100%;
  background: linear-gradient(135deg, #0A1628 0%, #152944 100%);
  border-radius: 8px; overflow: hidden; position: relative;
  display: flex; padding: 5%; align-items: center; justify-content: space-between;
  color: var(--dsc-ink);
}
.og-card::before {
  content: '';
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(245,243,238,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(245,243,238,0.04) 1px, transparent 1px);
  background-size: 24px 24px;
  mask-image: radial-gradient(ellipse at 50% 50%, #000 30%, transparent 80%);
}

/* ─── SETTINGS DRAWER ────────────────────────────────────────── */
.settings-overlay {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(0,0,0,0.4);
  display: flex; justify-content: flex-end;
  animation: fade-in 200ms ease-out;
}
.settings-panel {
  width: 420px; max-width: 100%;
  height: 100%;
  background: var(--dsc-navy-2);
  border-left: 1px solid var(--dsc-line-strong);
  padding: 22px 22px 24px;
  overflow-y: auto;
  animation: slide-in 300ms cubic-bezier(0.18, 0.89, 0.32, 1.28) both;
}
@keyframes slide-in { from { transform: translateX(100%); } to { transform: translateX(0); } }
.settings-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--dsc-line);
  gap: 20px;
}
.settings-label { font-size: 14px; font-weight: 500; }
.settings-desc { font-size: 12px; color: var(--dsc-ink-3); margin-top: 3px; }
.settings-section-title {
  font-family: var(--font-mono); font-size: 10px;
  color: var(--dsc-ink-4); letter-spacing: 0.16em;
  margin: 22px 0 4px; text-transform: uppercase;
}
.seg {
  display: inline-flex; padding: 3px;
  background: rgba(0,0,0,0.25);
  border-radius: 8px;
  border: 1px solid var(--dsc-line);
}
.seg-item {
  padding: 5px 11px; border-radius: 6px;
  background: transparent; color: var(--dsc-ink-3);
  font-size: 12px; font-family: var(--font-mono);
  letter-spacing: 0.02em; text-transform: lowercase;
  cursor: pointer; border: none;
}
.seg-item[data-active="1"] {
  background: var(--dsc-ink-5); color: var(--dsc-ink);
}
.toggle {
  width: 34px; height: 20px; border-radius: 10px; padding: 2px;
  background: rgba(255,255,255,0.1);
  display: flex; align-items: center;
  justify-content: flex-start;
  cursor: pointer; border: none;
  transition: background .15s, justify-content .15s;
}
.toggle[data-on="1"] {
  background: var(--dsc-blue);
  justify-content: flex-end;
}
.toggle-knob { width: 16px; height: 16px; border-radius: 50%; background: white; }

/* ─── MODAL ──────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 45;
  background: color-mix(in oklch, var(--dsc-navy) 60%, transparent);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  animation: fade-in 180ms ease-out;
}
.modal {
  max-width: 440px; width: 100%;
  background: var(--dsc-navy-2);
  border: 1px solid var(--dsc-line-strong);
  border-radius: 16px;
  padding: 24px 24px 22px;
  box-shadow: var(--shadow-2);
}

/* ─── TOAST ──────────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%);
  background: var(--dsc-ink); color: var(--dsc-navy);
  padding: 10px 18px; border-radius: 10px;
  font-size: 13.5px; font-weight: 500;
  box-shadow: var(--shadow-2);
  z-index: 60;
  animation: fade-in 200ms ease-out;
}

/* ─── REDUCED MOTION ─────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .cursor { animation: none; opacity: 1; }
  .tier-badge-sheen { display: none; }
}

/* reduced-motion setting (manual) */
[data-motion="reduce"] *, [data-motion="reduce"] *::before, [data-motion="reduce"] *::after {
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important;
}

/* ─── HIGH CONTRAST ──────────────────────────────────────────── */
[data-contrast="high"] {
  --dsc-ink-2: rgba(245, 243, 238, 0.92);
  --dsc-ink-3: rgba(245, 243, 238, 0.72);
  --dsc-line: rgba(245, 243, 238, 0.20);
  --dsc-line-strong: rgba(245, 243, 238, 0.32);
}

/* ─── TEXT SIZE ──────────────────────────────────────────────── */
[data-textsize="S"] { font-size: 14px; }
[data-textsize="M"] { font-size: 16px; }
[data-textsize="L"] { font-size: 18px; }

/* ─── MISC ───────────────────────────────────────────────────── */
.text-muted { color: var(--dsc-ink-3); }
.v-stack { display: flex; flex-direction: column; }
.h-stack { display: flex; align-items: center; }
.gap-10 { gap: 10px; }
.gap-14 { gap: 14px; }
.gap-18 { gap: 18px; }
.gap-26 { gap: 26px; }
.mono-small { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--dsc-ink-3); }
