/* =========================================================================
   PMP 2026 Study Hub — styles
   ========================================================================= */
:root {
  --people: #0d9488;
  --people-soft: #ccfbf1;
  --process: #2563eb;
  --process-soft: #dbeafe;
  --business: #c2410c;
  --business-soft: #ffedd5;
  --accent: #4f46e5;
  --accent-soft: #e0e7ff;
  --green: #15803d;
  --green-soft: #dcfce7;
  --red: #b91c1c;
  --red-soft: #fee2e2;
  --amber: #b45309;
  --amber-soft: #fef3c7;
  --ink: #0f172a;
  --slate: #475569;
  --muted: #64748b;
  --line: #e2e8f0;
  --bg: #f6f7fb;
  --card: #ffffff;
  --code: #f1f5f9;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.07), 0 8px 24px rgba(15, 23, 42, 0.05);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --people: #2dd4bf;
    --people-soft: #134e4a;
    --process: #60a5fa;
    --process-soft: #1e3a5f;
    --business: #fb923c;
    --business-soft: #4a2511;
    --accent: #818cf8;
    --accent-soft: #312e81;
    --green: #4ade80;
    --green-soft: #14391f;
    --red: #f87171;
    --red-soft: #4c1717;
    --amber: #fbbf24;
    --amber-soft: #422c06;
    --ink: #e5e7eb;
    --slate: #cbd5e1;
    --muted: #94a3b8;
    --line: #2b3444;
    --bg: #0e131b;
    --card: #161d29;
    --code: #1f2937;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  }
}
:root[data-theme="dark"] {
  --people: #2dd4bf; --people-soft: #134e4a; --process: #60a5fa; --process-soft: #1e3a5f;
  --business: #fb923c; --business-soft: #4a2511; --accent: #818cf8; --accent-soft: #312e81;
  --green: #4ade80; --green-soft: #14391f; --red: #f87171; --red-soft: #4c1717;
  --amber: #fbbf24; --amber-soft: #422c06; --ink: #e5e7eb; --slate: #cbd5e1; --muted: #94a3b8;
  --line: #2b3444; --bg: #0e131b; --card: #161d29; --code: #1f2937; --shadow: 0 1px 3px rgba(0,0,0,.4);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
}
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 0.5em; }
h1 { font-size: 1.9rem; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.1rem; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
p { margin: 0 0 0.8em; }

/* ----------------------------- header / nav ----------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px;
  padding: 10px 20px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; color: var(--ink); font-size: 1.1rem; }
.brand:hover { text-decoration: none; }
.brand-icon { font-size: 1.4rem; }
.site-nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav-link { padding: 6px 12px; border-radius: 999px; color: var(--slate); font-weight: 500; font-size: 0.95rem; }
.nav-link:hover { background: var(--code); text-decoration: none; }
.nav-link.active { background: var(--accent-soft); color: var(--accent); }

.container { max-width: 1040px; margin: 0 auto; padding: 28px 16px 60px; }
.site-footer { text-align: center; color: var(--muted); font-size: 0.85rem; padding: 24px 16px 40px; border-top: 1px solid var(--line); }
.site-footer .fine { font-size: 0.78rem; max-width: 720px; margin: 0 auto; }

/* ----------------------------- generic ----------------------------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.muted { color: var(--muted); }
.small { font-size: 0.88rem; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.spacer { flex: 1; }
.stack > * + * { margin-top: 16px; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.grid-3 { display: grid; gap: 16px; grid-template-columns: repeat(3, 1fr); }
@media (max-width: 760px) { .grid-3 { grid-template-columns: 1fr; } }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 18px; border-radius: 10px; border: 1px solid transparent;
  background: var(--accent); color: #fff; font: inherit; font-weight: 600; cursor: pointer;
}
.btn:hover { filter: brightness(1.08); text-decoration: none; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; filter: none; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { background: var(--code); }
.btn.small { padding: 6px 12px; font-size: 0.88rem; }
.btn.danger { background: var(--red); }

.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 0.75rem; font-weight: 600; background: var(--code); color: var(--slate); }
.pill.people { background: var(--people-soft); color: var(--people); }
.pill.process { background: var(--process-soft); color: var(--process); }
.pill.business { background: var(--business-soft); color: var(--business); }
.pill.core { background: var(--accent-soft); color: var(--accent); }
.pill.new { background: var(--amber-soft); color: var(--amber); }

.callout { border-left: 4px solid var(--accent); background: var(--accent-soft); padding: 12px 16px; border-radius: 8px; margin: 14px 0; }
.callout.tip { border-color: var(--green); background: var(--green-soft); }
.callout.warn { border-color: var(--amber); background: var(--amber-soft); }

/* ----------------------------- home ----------------------------- */
.hero { padding: 36px 28px; border-radius: 20px; background: linear-gradient(135deg, var(--accent-soft), var(--process-soft)); margin-bottom: 24px; }
.hero h1 { font-size: 2.1rem; }
.hero p { max-width: 640px; font-size: 1.05rem; color: var(--slate); }
.domain-card { border-top: 5px solid var(--process); }
.domain-card.people { border-top-color: var(--people); }
.domain-card.business { border-top-color: var(--business); }
.big-num { font-size: 2.2rem; font-weight: 700; line-height: 1; }
.stat { text-align: center; }
.stat .label { color: var(--muted); font-size: 0.85rem; }

.bar { height: 10px; border-radius: 999px; background: var(--code); overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.bar.people > span { background: var(--people); }
.bar.process > span { background: var(--process); }
.bar.business > span { background: var(--business); }

/* ----------------------------- learn ----------------------------- */
.task-list { list-style: none; margin: 0; padding: 0; }
.task-link {
  display: flex; gap: 12px; align-items: center; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--card); color: var(--ink); margin-bottom: 8px;
}
.task-link:hover { border-color: var(--accent); text-decoration: none; }
.task-num { width: 34px; height: 34px; flex: none; border-radius: 10px; display: grid; place-items: center; font-weight: 700; font-size: 0.85rem; background: var(--code); }
.people .task-num { background: var(--people-soft); color: var(--people); }
.process .task-num { background: var(--process-soft); color: var(--process); }
.business .task-num { background: var(--business-soft); color: var(--business); }
.core .task-num { background: var(--accent-soft); color: var(--accent); }
.mastery { font-size: 0.78rem; color: var(--muted); white-space: nowrap; }

.lesson { max-width: 820px; }
.lesson h2 { margin-top: 1.4em; }
.lesson ul, .lesson ol { padding-left: 1.3em; }
.lesson li { margin-bottom: 0.3em; }
.lesson table, .result-table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 0.93rem; }
.lesson th, .lesson td, .result-table th, .result-table td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
.lesson th, .result-table th { background: var(--code); }
.enablers { background: var(--code); border-radius: 12px; padding: 14px 18px; }
.enablers ul { margin: 6px 0 0; }
.visual { margin: 18px 0; padding: 14px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow-x: auto; }
.visual svg { width: 100%; height: auto; display: block; max-width: 760px; margin: 0 auto; }
svg text { fill: var(--ink); font-family: inherit; }
svg .cap { font-size: 12px; fill: var(--muted); }
svg .lbl { font-size: 14px; font-weight: 600; }
.lesson-nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 30px; flex-wrap: wrap; }

.flow { display: flex; flex-wrap: wrap; gap: 8px; align-items: stretch; }
.flow > div { flex: 1 1 120px; background: var(--code); border-radius: 10px; padding: 10px; text-align: center; font-size: 0.9rem; }
.flow > div b { display: block; }

/* ----------------------------- exam ----------------------------- */
.option-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.choice {
  display: block; padding: 14px; border: 2px solid var(--line); border-radius: 12px; cursor: pointer; background: var(--card);
}
.choice:hover { border-color: var(--accent); }
.choice input { display: none; }
.choice.selected { border-color: var(--accent); background: var(--accent-soft); }
.choice b { display: block; }

.exam-top { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.timer { font-variant-numeric: tabular-nums; font-weight: 700; padding: 6px 12px; border-radius: 10px; background: var(--code); }
.timer.low { background: var(--red-soft); color: var(--red); }
.q-meta { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.q-text { font-size: 1.08rem; font-weight: 500; margin-bottom: 14px; }
.scenario { background: var(--code); border-radius: 12px; padding: 14px 16px; margin-bottom: 16px; font-size: 0.95rem; max-height: 340px; overflow: auto; }
.scenario h4 { margin-bottom: 6px; }
.answers { list-style: none; padding: 0; margin: 0; }
.answer {
  display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; margin-bottom: 8px;
  border: 2px solid var(--line); border-radius: 12px; cursor: pointer; background: var(--card);
}
.answer:hover { border-color: var(--accent); }
.answer.selected { border-color: var(--accent); background: var(--accent-soft); }
.answer.correct { border-color: var(--green); background: var(--green-soft); }
.answer.wrong { border-color: var(--red); background: var(--red-soft); }
.answer .key { flex: none; width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; font-size: 0.8rem; font-weight: 700; }
.answer.multi .key { border-radius: 6px; }
.answer.selected .key { background: var(--accent); border-color: var(--accent); color: #fff; }
.feedback { margin-top: 12px; padding: 12px 16px; border-radius: 10px; background: var(--code); }
.feedback.ok { background: var(--green-soft); }
.feedback.bad { background: var(--red-soft); }

.navigator { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 18px; }
.navigator button {
  width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer; font-size: 0.78rem;
}
.navigator button.answered { background: var(--accent-soft); border-color: var(--accent); }
.navigator button.flagged { box-shadow: inset 0 -3px 0 var(--amber); }
.navigator button.current { outline: 2px solid var(--accent); outline-offset: 1px; }
.navigator button.locked { opacity: 0.35; cursor: not-allowed; }

.break-screen { text-align: center; padding: 50px 20px; }

/* ----------------------------- results ----------------------------- */
.score-ring { width: 150px; height: 150px; }
.verdict { font-size: 1.3rem; font-weight: 700; }
.verdict.great, .verdict.good { color: var(--green); }
.verdict.ok { color: var(--amber); }
.verdict.low { color: var(--red); }
.restudy { border-left: 4px solid var(--red); }
.review-item { border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-bottom: 10px; background: var(--card); }
.review-item.ok { border-left: 4px solid var(--green); }
.review-item.bad { border-left: 4px solid var(--red); }
details summary { cursor: pointer; font-weight: 600; }

/* ----------------------------- flashcards ----------------------------- */
.flashcard {
  perspective: 1200px; height: 260px; cursor: pointer; max-width: 620px; margin: 0 auto;
}
.flashcard-inner { position: relative; width: 100%; height: 100%; transition: transform 0.45s; transform-style: preserve-3d; }
.flashcard.flipped .flashcard-inner { transform: rotateY(180deg); }
.flashcard .face {
  position: absolute; inset: 0; backface-visibility: hidden; border-radius: 18px; padding: 26px;
  display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center;
  background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow);
}
.flashcard .front h2 { font-size: 1.6rem; margin: 10px 0; }
.flashcard .back { transform: rotateY(180deg); font-size: 1.02rem; overflow: auto; }

@media (max-width: 600px) {
  .hero { padding: 24px 18px; }
  .hero h1 { font-size: 1.6rem; }
  .site-header { padding: 10px 12px; }
  .nav-link { padding: 5px 9px; font-size: 0.88rem; }
  .card { padding: 16px; }
}
