:root {
  --bg: #0b1020;
  --bg-2: #0f1530;
  --surface: #141b3a;
  --surface-2: #1a224a;
  --line: rgba(255, 255, 255, 0.08);
  --text: #e6e9f5;
  --muted: #9aa3c7;
  --primary: #7c5cff;
  --primary-2: #5b8cff;
  --accent: #00d4b5;
  --warn: #ffb547;
  --danger: #ff5d6c;
  --good: #2ecc71;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
  --r: 14px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--text);
  background: radial-gradient(1200px 800px at 80% -10%, rgba(124, 92, 255, 0.18), transparent 60%),
              radial-gradient(900px 600px at -10% 30%, rgba(0, 212, 181, 0.1), transparent 60%),
              var(--bg);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

.container { max-width: 1180px; margin: 0 auto; padding: 0 20px; }

/* TOPBAR */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(11, 16, 32, 0.85);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar__inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-weight: 700; }
.brand__logo {
  display: inline-grid; place-items: center;
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  font-weight: 800; font-size: 13px; letter-spacing: 0.5px;
}
.brand__text { font-size: 16px; }

.nav { display: flex; align-items: center; gap: 6px; }
.nav__link {
  color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 500;
  padding: 8px 12px; border-radius: 8px; transition: all .2s;
}
.nav__link:hover { color: var(--text); background: var(--surface); }
.nav__link.active { color: var(--text); background: var(--surface); }
.nav__link--cta {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff !important;
}
.nav__link--cta:hover { filter: brightness(1.1); }

.menu-btn {
  display: none; background: none; border: 1px solid var(--line);
  color: var(--text); font-size: 20px; padding: 6px 12px; border-radius: 8px; cursor: pointer;
}

/* HERO */
.hero { padding: 70px 0 60px; }
.hero__grid {
  display: grid; grid-template-columns: 1.2fr 0.9fr; gap: 50px; align-items: center;
}
.badge {
  display: inline-block; padding: 6px 12px; border-radius: 999px;
  background: rgba(124, 92, 255, 0.15); border: 1px solid rgba(124, 92, 255, 0.3);
  font-size: 12px; color: #c9bcff; font-weight: 600; letter-spacing: 0.3px;
  margin-bottom: 18px;
}
.hero h1 {
  font-size: 52px; line-height: 1.1; margin: 0 0 18px;
  font-weight: 800; letter-spacing: -0.02em;
}
.grad {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lead { font-size: 18px; color: var(--muted); margin: 0 0 28px; max-width: 540px; }
.hero__cta { display: flex; gap: 12px; margin-bottom: 36px; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: 10px; font-weight: 600; font-size: 15px;
  text-decoration: none; cursor: pointer; border: none; transition: all .2s;
  font-family: inherit;
}
.btn--primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff; box-shadow: 0 8px 24px rgba(124, 92, 255, 0.4);
}
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(124, 92, 255, 0.5); }
.btn--ghost {
  background: var(--surface); color: var(--text); border: 1px solid var(--line);
}
.btn--ghost:hover { background: var(--surface-2); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.hero__stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; max-width: 540px;
}
.hero__stats > div {
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 12px; text-align: center;
}
.hero__stats b { display: block; font-size: 22px; color: var(--accent); }
.hero__stats span { font-size: 12px; color: var(--muted); }

.hero__card { display: flex; justify-content: center; }
.card-pillars {
  width: 100%; max-width: 380px;
  background: linear-gradient(180deg, var(--surface) 0%, var(--bg-2) 100%);
  border: 1px solid var(--line); border-radius: 20px; padding: 26px;
  box-shadow: var(--shadow);
}
.card-pillars h3 { margin: 0 0 16px; font-size: 17px; }
.card-pillars h4 { margin: 0 0 12px; font-size: 14px; color: var(--muted); font-weight: 600; }
.card-pillars hr { border: none; border-top: 1px solid var(--line); margin: 18px 0; }
.pillar { display: flex; gap: 14px; align-items: center; margin-bottom: 12px; }
.pillar span {
  display: grid; place-items: center; width: 32px; height: 32px;
  border-radius: 50%; background: rgba(124, 92, 255, 0.2);
  color: var(--primary); font-weight: 700;
}
.pillar b { display: block; font-size: 14px; }
.pillar p { margin: 0; font-size: 12px; color: var(--muted); }
.values { display: flex; flex-wrap: wrap; gap: 6px; }
.values span {
  font-size: 12px; padding: 5px 10px; border-radius: 999px;
  background: rgba(0, 212, 181, 0.12); color: var(--accent);
  border: 1px solid rgba(0, 212, 181, 0.25);
}

/* SECTIONS */
.section { padding: 70px 0; }
.section--alt { background: linear-gradient(180deg, transparent 0%, rgba(124, 92, 255, 0.04) 100%); }
.section__title {
  font-size: 34px; font-weight: 800; letter-spacing: -0.02em;
  margin: 0 0 8px;
}
.section__sub { color: var(--muted); margin: 0 0 36px; font-size: 16px; max-width: 760px; }
.h3-mt { margin-top: 40px; margin-bottom: 16px; font-size: 22px; }

/* CARDS */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.grid-5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: 22px; transition: all .25s;
}
.card:hover { transform: translateY(-3px); border-color: rgba(124, 92, 255, 0.4); }
.card h3 { margin: 0 0 8px; font-size: 18px; }
.card h3 small { display: block; font-weight: 500; color: var(--muted); font-size: 12px; margin-top: 2px; }
.card p { margin: 0; color: var(--muted); font-size: 14.5px; }

.value-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; padding: 16px; text-align: center;
}
.value-card b { display: block; font-size: 15px; color: var(--accent); }
.value-card span { color: var(--muted); font-size: 12px; }

.callout {
  margin-top: 28px; padding: 16px 20px;
  background: linear-gradient(90deg, rgba(124, 92, 255, 0.12), rgba(0, 212, 181, 0.08));
  border-left: 3px solid var(--primary); border-radius: 10px;
  font-size: 15px;
}

/* ROLE CARDS */
.role-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: 24px; transition: all .25s;
}
.role-card:hover { transform: translateY(-3px); }
.role-card__head { font-size: 20px; margin-bottom: 12px; }
.role-card__purpose { color: var(--muted); font-size: 14px; margin: 0 0 16px; }
.role-card ul { margin: 0; padding-left: 18px; font-size: 14.5px; color: var(--text); }
.role-card ul li { margin-bottom: 8px; }
.role-card__note { font-size: 13px; color: var(--muted); margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.role-card--po { border-top: 3px solid #ffb547; }
.role-card--sm { border-top: 3px solid #5b8cff; }
.role-card--dev { border-top: 3px solid #2ecc71; }

/* TIMELINE EVENTS */
.timeline { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; }
.event-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: 22px; position: relative; transition: all .25s;
}
.event-card:hover { transform: translateY(-3px); border-color: rgba(124, 92, 255, 0.4); }
.event-card__time {
  display: inline-block; padding: 4px 10px; border-radius: 999px;
  background: rgba(0, 212, 181, 0.15); color: var(--accent);
  font-size: 12px; font-weight: 600; margin-bottom: 12px;
  font-family: 'JetBrains Mono', monospace;
}
.event-card h3 { margin: 0 0 10px; font-size: 18px; }
.event-card p { margin: 0 0 8px; color: var(--muted); font-size: 14px; }
.event-card ul { margin: 8px 0 0; padding-left: 18px; font-size: 14px; color: var(--muted); }
.event-card__who { font-size: 13px; padding-top: 10px; border-top: 1px solid var(--line); }

/* ARTIFACT CARDS */
.art-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: 22px; transition: all .25s;
}
.art-card:hover { transform: translateY(-3px); }
.art-card__head { font-size: 19px; font-weight: 700; margin-bottom: 12px; }
.art-card p { margin: 0 0 12px; color: var(--muted); font-size: 14px; }
.commit {
  background: rgba(124, 92, 255, 0.08); border: 1px solid rgba(124, 92, 255, 0.2);
  padding: 12px 14px; border-radius: 10px; font-size: 13.5px;
}

/* PRODUCT OWNER GRID */
.po-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; }
.po-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: 22px; transition: all .25s;
}
.po-card:hover { transform: translateY(-3px); border-color: rgba(0, 212, 181, 0.3); }
.po-card h3 { margin: 0 0 10px; font-size: 17px; }
.po-card p { margin: 0 0 10px; color: var(--muted); font-size: 14px; }
.po-card ul { margin: 8px 0; padding-left: 18px; font-size: 14px; color: var(--muted); }
.po-card ul li { margin-bottom: 6px; }

/* GLOSSARY */
.search {
  width: 100%; padding: 14px 18px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--line); color: var(--text);
  font-size: 15px; font-family: inherit; margin-bottom: 24px;
}
.search:focus { outline: none; border-color: var(--primary); }
.glossary { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.gloss-item {
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 16px 18px; transition: all .2s;
}
.gloss-item:hover { border-color: rgba(124, 92, 255, 0.3); transform: translateY(-2px); }
.gloss-item b { display: block; color: var(--accent); margin-bottom: 6px; font-size: 15px; }
.gloss-item p { margin: 0; color: var(--muted); font-size: 14px; }

/* FLASHCARDS */
.flash-wrap { max-width: 640px; margin: 0 auto; }
.flashcard {
  perspective: 1200px; width: 100%; height: 320px; margin-bottom: 24px;
  cursor: pointer;
}
.flashcard__inner {
  position: relative; width: 100%; height: 100%; transition: transform 0.6s;
  transform-style: preserve-3d;
}
.flashcard.flipped .flashcard__inner { transform: rotateY(180deg); }
.flashcard__face {
  position: absolute; inset: 0; border-radius: 18px;
  display: grid; place-items: center; padding: 30px;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  text-align: center; box-shadow: var(--shadow);
}
.flashcard__front {
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface-2) 100%);
  border: 1px solid var(--line);
}
.flashcard__back {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-2) 100%);
  color: #fff;
  transform: rotateY(180deg);
}
.flash-q { font-size: 22px; font-weight: 700; line-height: 1.4; }
.flash-a { font-size: 17px; line-height: 1.6; }
.flash-hint { position: absolute; bottom: 16px; right: 20px; font-size: 12px; color: var(--muted); }
.flash-controls {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.flash-counter { color: var(--muted); font-family: 'JetBrains Mono', monospace; font-size: 14px; }

/* QUIZ */
.quiz-start {
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  padding: 32px; max-width: 720px; margin: 0 auto;
}
.quiz-start h3 { margin: 0 0 20px; font-size: 20px; }
.quiz-modes {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px; margin-bottom: 24px;
}
.quiz-modes label {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; border-radius: 10px;
  background: var(--bg-2); border: 1px solid var(--line); cursor: pointer;
  transition: all .2s;
}
.quiz-modes label:hover { border-color: var(--primary); }
.quiz-modes input[type="radio"]:checked + span { color: var(--accent); font-weight: 600; }
.quiz-modes input[type="radio"] { accent-color: var(--primary); }
.quiz-options {
  display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 24px;
  padding: 14px; background: var(--bg-2); border-radius: 10px;
  font-size: 14px;
}
.quiz-options label { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.quiz-options input { accent-color: var(--primary); }

.quiz-play { max-width: 800px; margin: 0 auto; }
.quiz-bar { margin-bottom: 24px; }
.quiz-bar__progress {
  height: 8px; background: var(--surface); border-radius: 999px; overflow: hidden;
}
.quiz-bar__fill {
  height: 100%; background: linear-gradient(90deg, var(--primary), var(--accent));
  width: 0%; transition: width .3s;
}
.quiz-bar__meta {
  display: flex; justify-content: space-between; margin-top: 10px;
  font-size: 13px; color: var(--muted); font-family: 'JetBrains Mono', monospace;
}
.quiz-q {
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  padding: 22px 24px; font-size: 17px; line-height: 1.55; margin-bottom: 16px;
  font-weight: 500;
}
.quiz-q .qnum { color: var(--accent); font-family: 'JetBrains Mono', monospace; font-size: 13px; display: block; margin-bottom: 6px; }
.quiz-opts { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.quiz-opt {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 18px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; cursor: pointer; transition: all .2s;
  font-size: 15px;
}
.quiz-opt:hover { border-color: var(--primary); background: var(--surface-2); }
.quiz-opt__letter {
  display: grid; place-items: center; width: 28px; height: 28px;
  border-radius: 50%; background: var(--bg-2); border: 1px solid var(--line);
  font-weight: 700; font-size: 13px; flex-shrink: 0; color: var(--muted);
}
.quiz-opt.selected { border-color: var(--primary); background: rgba(124, 92, 255, 0.1); }
.quiz-opt.selected .quiz-opt__letter { background: var(--primary); color: #fff; border-color: var(--primary); }
.quiz-opt.correct { border-color: var(--good); background: rgba(46, 204, 113, 0.1); }
.quiz-opt.correct .quiz-opt__letter { background: var(--good); color: #fff; border-color: var(--good); }
.quiz-opt.wrong { border-color: var(--danger); background: rgba(255, 93, 108, 0.1); }
.quiz-opt.wrong .quiz-opt__letter { background: var(--danger); color: #fff; border-color: var(--danger); }
.quiz-opt.disabled { pointer-events: none; }

.quiz-explain {
  background: rgba(0, 212, 181, 0.08); border: 1px solid rgba(0, 212, 181, 0.25);
  border-left: 3px solid var(--accent); border-radius: 10px;
  padding: 14px 18px; margin-bottom: 16px; font-size: 14.5px; line-height: 1.6;
}
.quiz-explain b { color: var(--accent); }
.quiz-actions {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}

.quiz-result { max-width: 720px; margin: 0 auto; text-align: center; }
.quiz-result__score {
  display: flex; gap: 24px; align-items: center; justify-content: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  padding: 32px; margin-bottom: 24px;
}
.quiz-result__score > div:last-child { text-align: left; }
.quiz-result__score h3 { margin: 0 0 6px; font-size: 24px; }
.quiz-result__score p { margin: 0; color: var(--muted); }
.ring {
  width: 120px; height: 120px; border-radius: 50%;
  background: conic-gradient(var(--accent) var(--p, 0%), var(--surface-2) 0);
  display: grid; place-items: center; position: relative; flex-shrink: 0;
}
.ring::before {
  content: ''; position: absolute; inset: 8px; border-radius: 50%; background: var(--surface);
}
.ring span { position: relative; font-size: 22px; font-weight: 800; }

.quiz-result__actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-bottom: 24px; }
.quiz-review { text-align: left; display: flex; flex-direction: column; gap: 14px; margin-top: 20px; }
.quiz-review-item {
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 18px 20px;
}
.quiz-review-item h4 { margin: 0 0 10px; font-size: 15px; }
.quiz-review-item .qreview-correct { color: var(--good); font-size: 13.5px; margin: 4px 0; }
.quiz-review-item .qreview-your { color: var(--danger); font-size: 13.5px; margin: 4px 0; }
.quiz-review-item .qreview-explain { color: var(--muted); font-size: 13.5px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }

.hidden { display: none !important; }

/* FOOTER */
.footer {
  margin-top: 60px; padding: 30px 0;
  border-top: 1px solid var(--line);
  background: var(--bg-2);
}
.footer__inner { text-align: center; color: var(--muted); font-size: 14px; }
.footer__inner a { color: var(--accent); text-decoration: none; }
.footer__small { font-size: 12px; margin-top: 8px; }
.footer code { background: var(--surface); padding: 2px 8px; border-radius: 4px; font-size: 12px; }

/* RESPONSIVE */
@media (max-width: 960px) {
  .hero h1 { font-size: 38px; }
  .hero__grid { grid-template-columns: 1fr; gap: 30px; }
  .grid-3, .grid-5 { grid-template-columns: 1fr 1fr; }
  .grid-5 { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 720px) {
  .nav { display: none; position: absolute; top: 64px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; padding: 12px;
    background: var(--bg-2); border-bottom: 1px solid var(--line); }
  .nav.open { display: flex; }
  .nav__link { padding: 12px; }
  .menu-btn { display: block; }
  .hero h1 { font-size: 32px; }
  .section__title { font-size: 26px; }
  .section { padding: 50px 0; }
  .grid-3, .grid-5 { grid-template-columns: 1fr; }
  .hero__stats { grid-template-columns: 1fr 1fr; }
  .quiz-result__score { flex-direction: column; text-align: center; }
  .quiz-result__score > div:last-child { text-align: center; }
}
