/* ============================================================
   AnalystPrep AI — single-screen quiz
   Dark theme aligned with the hummOut design system.
   ============================================================ */

:root {
  --bg:        #0d1117;
  --bg-soft:   #131a24;
  --surface:   #161e2b;
  --surface-2: #1c2738;
  --border:        rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);

  --text:       #eef2f7;
  --text-muted: #9fb0c3;
  --text-dim:   #6b7c91;

  --brand:   #ff6b4a;
  --brand-2: #ffb347;
  --teal:    #4ad0c7;
  --danger:  #ff5d6c;

  --grad-warm: linear-gradient(120deg, #ff6b4a 0%, #ffb347 100%);

  --radius:    18px;
  --radius-sm: 12px;
  --radius-lg: 26px;
  --shadow: 0 18px 50px -20px rgba(0, 0, 0, 0.6);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font);
  background:
    radial-gradient(900px 480px at 80% -10%, rgba(255, 107, 74, 0.10), transparent 60%),
    radial-gradient(700px 420px at 5% 0%, rgba(74, 208, 199, 0.07), transparent 55%),
    var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

button, select { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
kbd {
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  padding: 1px 6px;
  font-family: inherit;
  font-size: 0.8em;
  font-weight: 700;
}
.sr-only {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

.shell {
  max-width: 1120px;
  margin: 0 auto;
  padding: 26px 20px 40px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: 100vh;
}

/* ============ Header ============ */
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.mark {
  width: 44px; height: 44px;
  border-radius: 13px;
  box-shadow: 0 12px 28px -12px rgba(255, 107, 74, 0.6);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text strong { font-size: 1.1rem; letter-spacing: -0.02em; }
.brand-text small { color: var(--text-dim); font-size: 0.8rem; font-weight: 600; }

.home-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 700;
  transition: background 0.2s, transform 0.25s var(--ease);
}
.home-link:hover { background: rgba(255, 255, 255, 0.08); transform: translateY(-1px); }
.home-link .humm { color: #4FC3F7; }
.home-link .out { color: #FFA726; }

/* ============ Category tabs ============ */
.tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.92rem;
  white-space: nowrap;
  transition: transform 0.25s var(--ease), background 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.25s;
}
.tab:hover { transform: translateY(-2px); border-color: var(--border-strong); color: var(--text); }
.tab.active {
  background: var(--grad-warm);
  border-color: transparent;
  color: #1a0f0a;
  box-shadow: 0 14px 30px -14px rgba(255, 107, 74, 0.65);
}
.tab-icon { font-size: 1rem; opacity: 0.85; }

/* ============ Quiz card ============ */
.quiz-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 30px 32px 32px;
  box-shadow: var(--shadow);
}

.meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.chips { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.chip {
  padding: 6px 13px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  border: 1px solid var(--border);
  color: var(--text-muted);
}
.chip.subject { background: rgba(255, 107, 74, 0.12); color: #ffab94; border-color: transparent; }
.chip.dim { background: var(--surface-2); }
.chip.level.beginner { background: rgba(74, 208, 199, 0.12); color: var(--teal); border-color: transparent; }
.chip.level.intermediate { background: rgba(255, 179, 71, 0.12); color: var(--brand-2); border-color: transparent; }
.chip.level.advanced { background: rgba(255, 93, 108, 0.12); color: var(--danger); border-color: transparent; }

.meta-right { display: flex; align-items: center; gap: 14px; }
select {
  background: var(--bg-soft);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 9px 12px;
  font-size: 0.9rem;
  font-weight: 600;
}
select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(255, 107, 74, 0.18); }
.score { text-align: right; line-height: 1.2; }
.score strong { display: block; font-size: 1.3rem; letter-spacing: -0.03em; }
.score span { color: var(--text-dim); font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; }

.qprogress { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.qbar {
  flex: 1;
  height: 7px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}
.qbar span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--grad-warm);
  transition: width 0.5s var(--ease);
}
.qcount { color: var(--text-dim); font-size: 0.82rem; font-weight: 700; white-space: nowrap; }

.quiz-body { display: grid; gap: 24px; }
.a-col { display: grid; }
.a-col .placeholder { display: none; }

@media (min-width: 980px) {
  .quiz-body { grid-template-columns: 1.05fr 0.95fr; gap: 30px; align-items: stretch; }
  .a-col .placeholder {
    display: grid;
    place-content: center;
    justify-items: center;
    gap: 12px;
    text-align: center;
    padding: 30px;
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius);
    color: var(--text-dim);
    height: 100%;
    min-height: 280px;
  }
  .placeholder .ph-icon { font-size: 1.8rem; opacity: 0.7; }
  .placeholder p { margin: 0; max-width: 30ch; font-size: 0.95rem; line-height: 1.6; }
}

.question {
  font-size: clamp(1.3rem, 3vw, 1.7rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.3;
  margin: 0 0 24px;
}

/* ---- Options ---- */
.options { display: grid; gap: 12px; }
.option {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  text-align: left;
  padding: 15px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text);
  font-size: 1rem;
  font-weight: 600;
  transition: transform 0.22s var(--ease), border-color 0.2s, background 0.2s, box-shadow 0.22s;
}
.option:not(:disabled):hover { transform: translateY(-2px); border-color: var(--border-strong); }
.option.selected {
  border-color: var(--brand);
  background: rgba(255, 107, 74, 0.08);
  box-shadow: 0 0 0 3px rgba(255, 107, 74, 0.16);
}
.option.correct {
  border-color: rgba(74, 208, 199, 0.6);
  background: rgba(74, 208, 199, 0.10);
}
.option.correct .letter { background: var(--teal); color: #06211f; }
.option.wrong {
  border-color: rgba(255, 93, 108, 0.55);
  background: rgba(255, 93, 108, 0.09);
}
.option.wrong .letter { background: var(--danger); color: #2b0509; }
.option.faded { opacity: 0.45; }
.option:disabled { cursor: default; }
.letter {
  flex: none;
  width: 32px; height: 32px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--surface-2);
  font-weight: 800;
  font-size: 0.88rem;
  transition: background 0.2s, color 0.2s;
}
.option.selected .letter { background: var(--brand); color: #1a0f0a; }
.opt-text { flex: 1; }
.tick { color: var(--teal); font-weight: 800; font-size: 1.1rem; }

/* ---- Submit / hint ---- */
.submit-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 24px;
}
.hint { color: var(--text-dim); font-size: 0.84rem; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 13px 26px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 800;
  font-size: 0.95rem;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), background 0.2s;
}
.btn:not(:disabled):hover { transform: translateY(-2px); }
.btn.primary {
  background: var(--grad-warm);
  color: #1a0f0a;
  box-shadow: 0 12px 30px -12px rgba(255, 107, 74, 0.7);
}
.btn.primary:not(:disabled):hover { box-shadow: 0 18px 40px -12px rgba(255, 107, 74, 0.85); }
.btn.primary:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; }
.btn.ghost {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border-strong);
  color: var(--text);
}
.btn.ghost:hover { background: rgba(255, 255, 255, 0.08); }

/* ---- Answer panel ---- */
.answer {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  border-left: 3px solid var(--teal);
  background: var(--bg-soft);
  padding: 22px 24px;
  animation: rise 0.45s var(--ease);
  height: fit-content;
}
.answer.bad { border-left-color: var(--danger); }
.verdict { font-weight: 800; font-size: 1.05rem; margin-bottom: 10px; color: var(--teal); }
.answer.bad .verdict { color: var(--danger); }
.answer p { margin: 8px 0; color: var(--text-muted); }
.answer .example {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.answer .example span {
  display: block;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--brand-2);
  margin-bottom: 5px;
}
.answer-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 20px; }

@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

/* ---- Loading skeleton ---- */
.skeleton { display: grid; gap: 13px; padding: 6px 0 12px; }
.sk-line, .sk-opt {
  border-radius: var(--radius-sm);
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface) 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.3s infinite linear;
}
.sk-line { height: 26px; }
.sk-line.w70 { width: 70%; }
.sk-line.w45 { width: 45%; margin-bottom: 10px; }
.sk-opt { height: 60px; border-radius: var(--radius); }
@keyframes shimmer { to { background-position: -200% 0; } }

.empty { text-align: center; padding: 48px 16px; color: var(--text-muted); }

/* ---- Round summary ---- */
.summary { text-align: center; padding: 26px 10px 14px; max-width: 560px; margin: 0 auto; }
.ring {
  width: 132px; height: 132px;
  margin: 0 auto 22px;
  border-radius: 50%;
  display: grid; place-items: center;
  background:
    radial-gradient(closest-side, var(--surface) 78%, transparent 79% 100%),
    conic-gradient(#ff6b4a calc(var(--pct) * 1%), var(--surface-2) 0);
}
.ring span { font-size: 1.7rem; font-weight: 800; letter-spacing: -0.03em; }
.summary h1 { margin: 0 0 8px; font-size: 1.7rem; letter-spacing: -0.02em; }
.summary-score { color: var(--text-muted); margin: 0; }
.summary-score strong { color: var(--text); }
.summary-verdict { color: var(--brand-2); font-weight: 700; margin: 8px 0 0; }
.summary .answer-actions { justify-content: center; margin-top: 26px; }

/* ============ Footer bar ============ */
.bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 12px 22px;
}
.daily { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 220px; }
.daily-label {
  color: var(--text-dim);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  white-space: nowrap;
}
.daily-bar {
  flex: 1;
  height: 7px;
  max-width: 220px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}
.daily-bar span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--teal), var(--brand-2));
  transition: width 0.5s var(--ease);
}
.daily strong { font-size: 0.92rem; }
.foot-actions { display: flex; align-items: center; gap: 10px; }
.link-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.9rem;
  padding: 4px 2px;
  transition: color 0.2s;
}
.link-btn:hover { color: var(--text); }
.sep { color: var(--text-dim); }
.share-msg { color: var(--teal); font-size: 0.85rem; font-weight: 700; }

.credit { text-align: center; color: var(--text-dim); font-size: 0.84rem; margin: 4px 0 0; }
.credit a { color: var(--text-muted); font-weight: 700; }
.credit a:hover { color: var(--text); }

/* ============ About section (static, SEO-visible content) ============ */
.about-wrap {
  max-width: 1120px;
  margin: 8px auto 40px;
  padding: 0 20px;
}
.about {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px 34px;
}
.about h2 {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 16px;
}
.about > p {
  color: var(--text-muted);
  line-height: 1.7;
  margin: 0 0 14px;
  max-width: 74ch;
}
.about-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin: 26px 0 22px;
}
.about-grid h3 {
  font-size: 1rem;
  font-weight: 800;
  margin: 0 0 6px;
  color: var(--brand-2);
}
.about-grid p {
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.6;
  margin: 0;
}
.about-guide-link { margin: 4px 0 0; }
.about-guide-link a { color: var(--brand-2); font-weight: 700; font-size: 0.95rem; }
.about-guide-link a:hover { color: var(--brand); }

.about-credit {
  color: var(--text-dim);
  font-size: 0.88rem;
  margin: 18px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}
.about-credit a { color: var(--text-muted); font-weight: 700; }
.about-credit a:hover { color: var(--text); }

@media (max-width: 900px) {
  .about-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .about { padding: 26px 22px; border-radius: 22px; }
  .about-grid { grid-template-columns: 1fr; gap: 20px; }
}

/* ============ Guide / landing page ============ */
.guide-shell { max-width: 900px; margin: 0 auto; padding: 26px 20px 60px; }
.guide-hero { text-align: center; padding: 20px 0 34px; }
.guide-hero .eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--brand-2);
  margin-bottom: 16px;
}
.guide-hero h1 {
  font-size: clamp(1.8rem, 4.4vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin: 0 0 18px;
}
.guide-hero p {
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1.7;
  max-width: 62ch;
  margin: 0 auto 28px;
}
.guide-cta { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }

.guide-section { margin-top: 40px; }
.guide-section h2 {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 0 0 6px;
}
.guide-section > p {
  color: var(--text-muted);
  font-size: 0.98rem;
  margin: 0 0 18px;
}
.qa-list { display: grid; gap: 14px; }
.qa-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
}
.qa-item .q { font-weight: 700; margin: 0 0 8px; }
.qa-item .q span { color: var(--brand-2); margin-right: 6px; }
.qa-item .a { color: var(--text-muted); margin: 0 0 6px; font-size: 0.96rem; }
.qa-item .a span { color: var(--teal); font-weight: 700; margin-right: 6px; }
.qa-item .expl { color: var(--text-dim); font-size: 0.9rem; margin: 0; }

.guide-cta-band {
  margin-top: 46px;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 38px 28px;
}
.guide-cta-band h2 { margin: 0 0 10px; }
.guide-cta-band p { color: var(--text-muted); margin: 0 0 22px; }

@media (max-width: 560px) {
  .guide-shell { padding: 18px 14px 44px; }
  .qa-item { padding: 16px 18px; }
}

/* ============ Focus & motion ============ */
button:focus-visible, a:focus-visible, select:focus-visible {
  outline: 3px solid rgba(255, 107, 74, 0.5);
  outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ============ Responsive ============ */
@media (max-width: 700px) {
  .shell { padding: 18px 14px 30px; gap: 14px; }
  .tabs { grid-template-columns: repeat(2, 1fr); }
  .quiz-card { padding: 22px 18px 24px; border-radius: 22px; }
  .brand-text small { display: none; }
  .hint { display: none; }
  .submit-row .btn { width: 100%; }
  .answer-actions .btn { flex: 1; }
  .bottom { border-radius: 20px; }
}
@media (max-width: 420px) {
  .tab { font-size: 0.84rem; padding: 12px 6px; }
  .tab-icon { display: none; }
  .meta-right { width: 100%; justify-content: space-between; }
}
