:root {
  --navy: #17243f;
  --navy-2: #213257;
  --ink: #20293a;
  --muted: #657087;
  --yellow: #f5c84c;
  --yellow-deep: #e9ae19;
  --cream: #fbf8ef;
  --white: #ffffff;
  --line: #e5e7eb;
  --green: #24745f;
  --green-soft: #e7f4ef;
  --red: #a74242;
  --red-soft: #faecec;
  --shadow: 0 18px 45px rgba(24, 36, 63, 0.09);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--cream);
  font-family: "DM Sans", system-ui, sans-serif;
  line-height: 1.55;
}
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, summary:focus-visible {
  outline: 3px solid rgba(245, 200, 76, 0.7);
  outline-offset: 3px;
}
.skip-link { position: fixed; left: 12px; top: -60px; background: var(--white); color: var(--navy); padding: 10px 14px; z-index: 99; }
.skip-link:focus { top: 12px; }
.topbar {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px clamp(20px, 5vw, 74px);
  background: var(--navy);
  color: var(--white);
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.brand { display: inline-flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.brand-mark {
  width: 43px; height: 43px; display: grid; place-items: center;
  border-radius: 12px; color: var(--navy); background: var(--yellow);
  font-family: "Manrope", sans-serif; font-weight: 800;
}
.brand strong, .brand small { display: block; }
.brand strong { font-family: "Manrope", sans-serif; letter-spacing: -.01em; }
.brand small { color: #c6cddd; font-size: .73rem; }
.top-actions { display: flex; gap: 18px; align-items: center; }
.private-pill { font-size: .8rem; color: #d5daE4; }
.private-pill span { color: #7bd7b7; margin-right: 6px; }
.quiet-button { border: 0; background: transparent; color: #d5dae4; cursor: pointer; padding: 8px 0; font-size: .84rem; }
.quiet-button:hover { color: var(--white); }

.hero {
  min-height: 520px;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, .75fr);
  gap: clamp(36px, 7vw, 100px);
  align-items: center;
  padding: clamp(62px, 9vw, 116px) clamp(20px, 7vw, 104px);
  color: var(--white);
  background:
    radial-gradient(circle at 85% 10%, rgba(245,200,76,.14), transparent 28%),
    linear-gradient(135deg, var(--navy) 0%, #111b31 100%);
}
.eyebrow, .card-kicker, .domain-nav > p {
  margin: 0 0 14px; color: var(--yellow); font-weight: 800; letter-spacing: .14em; font-size: .73rem;
}
.hero h1, .section-intro h2, .domain-header h2 { font-family: "Manrope", sans-serif; }
.hero h1 { max-width: 780px; margin: 0; font-size: clamp(2.45rem, 5vw, 4.75rem); line-height: 1.03; letter-spacing: -.045em; }
.hero h1 span { color: var(--yellow); }
.hero-intro { max-width: 650px; margin: 26px 0 0; color: #dce1eb; font-size: clamp(1rem, 1.5vw, 1.18rem); }
.hero-actions { display: flex; align-items: center; gap: 24px; margin-top: 34px; }
.primary-button {
  border: 0; border-radius: 10px; padding: 15px 19px; background: var(--yellow); color: var(--navy);
  font-weight: 800; cursor: pointer; box-shadow: 0 8px 18px rgba(245,200,76,.18);
}
.primary-button:hover { background: #ffd86a; transform: translateY(-1px); }
.text-link { color: var(--white); text-underline-offset: 4px; font-weight: 700; }
.progress-card { padding: 28px; border-radius: 22px; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.14); backdrop-filter: blur(8px); }
.progress-card-head { display: flex; justify-content: space-between; gap: 20px; align-items: center; }
.progress-card h2 { margin: 2px 0 0; font: 700 1.45rem "Manrope", sans-serif; }
.progress-ring {
  --p: 0;
  width: 74px; height: 74px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--yellow) calc(var(--p) * 1%), rgba(255,255,255,.13) 0);
  position: relative; flex: 0 0 auto;
}
.progress-ring::before { content: ""; position: absolute; inset: 7px; border-radius: inherit; background: #1c2946; }
.progress-ring span { position: relative; z-index: 1; font-size: .85rem; font-weight: 800; }
.progress-track { height: 7px; overflow: hidden; margin: 25px 0 24px; border-radius: 99px; background: rgba(255,255,255,.12); }
.progress-track span { display: block; height: 100%; width: 0%; background: var(--yellow); border-radius: inherit; transition: width .35s ease; }
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.stats-grid div { min-width: 0; }
.stats-grid strong, .stats-grid span { display: block; }
.stats-grid strong { font: 700 1rem "Manrope", sans-serif; }
.stats-grid span { color: #bfc7d7; font-size: .68rem; line-height: 1.25; }
.save-note { color: #bfc7d7; font-size: .76rem; margin: 23px 0 0; }
.save-note span { color: #7bd7b7; margin-right: 4px; }

.study-shell { padding: clamp(58px, 8vw, 100px) clamp(20px, 6vw, 90px) 96px; max-width: 1550px; margin: 0 auto; }
.section-intro { display: grid; grid-template-columns: 1fr minmax(320px, .65fr); gap: 60px; align-items: end; margin-bottom: 42px; }
.section-intro .eyebrow { color: #a16e00; }
.section-intro h2 { margin: 0; color: var(--navy); font-size: clamp(2rem, 3.2vw, 3.1rem); letter-spacing: -.04em; line-height: 1.07; }
.section-intro > p { margin: 0; color: var(--muted); }
.study-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 36px; align-items: start; }
.domain-nav { position: sticky; top: 20px; padding: 23px 20px; border-radius: 17px; background: var(--white); border: 1px solid var(--line); box-shadow: 0 8px 30px rgba(24,36,63,.05); }
.domain-nav > p { color: #8e6500; padding: 0 8px; }
.nav-item {
  width: 100%; display: grid; grid-template-columns: 30px 1fr auto; gap: 10px; align-items: center;
  padding: 11px 9px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); cursor: pointer; text-align: left;
}
.nav-item:hover { background: #f8f7f2; color: var(--navy); }
.nav-item.active { background: var(--navy); color: var(--white); }
.nav-number { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 8px; background: #f0eee6; color: var(--navy); font-size: .72rem; font-weight: 800; }
.nav-item.active .nav-number { background: var(--yellow); }
.nav-label { font-size: .87rem; font-weight: 700; line-height: 1.2; }
.nav-progress { font-size: .7rem; }
.exam-note { display: flex; gap: 10px; margin: 22px 3px 0; padding-top: 18px; border-top: 1px solid var(--line); color: var(--muted); }
.exam-note > span { width: 23px; height: 23px; flex: 0 0 auto; border-radius: 50%; display: grid; place-items: center; background: #fff4cb; color: #795800; font-weight: 800; font-size: .75rem; }
.exam-note p { margin: 0; font-size: .73rem; line-height: 1.35; }
.exam-note strong { display: block; color: var(--ink); margin-bottom: 3px; }

.domain-content { min-width: 0; }
.domain-panel { animation: enter .25s ease; }
@keyframes enter { from { opacity: .35; transform: translateY(5px); } }
.domain-header { padding: clamp(25px, 4vw, 40px); border-radius: 20px; background: var(--white); border: 1px solid var(--line); box-shadow: var(--shadow); }
.domain-meta { display: flex; align-items: center; gap: 10px; color: #8b6710; font-size: .77rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.domain-meta span { width: 5px; height: 5px; border-radius: 50%; background: var(--yellow-deep); }
.domain-header h2 { margin: 12px 0 8px; color: var(--navy); font-size: clamp(1.8rem, 3.5vw, 3rem); line-height: 1.06; letter-spacing: -.04em; }
.domain-header > p { max-width: 780px; color: var(--muted); margin: 0; }
.domain-status { display: flex; align-items: center; gap: 13px; margin-top: 24px; }
.mini-track { height: 6px; width: min(320px, 70%); border-radius: 99px; background: #eeeef0; overflow: hidden; }
.mini-track span { display: block; height: 100%; border-radius: inherit; background: var(--yellow-deep); }
.domain-status strong { font-size: .77rem; color: var(--navy); }
.content-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 20px; }
.study-card { border-radius: 17px; background: var(--white); border: 1px solid var(--line); overflow: hidden; }
.study-card.full { grid-column: 1 / -1; }
.card-head { display: flex; justify-content: space-between; align-items: start; gap: 18px; padding: 24px 24px 18px; }
.card-head h3 { margin: 0; font: 800 1.08rem "Manrope", sans-serif; color: var(--navy); }
.card-head p { margin: 5px 0 0; color: var(--muted); font-size: .84rem; }
.card-count { flex: 0 0 auto; border-radius: 999px; padding: 5px 9px; background: #f4f2ec; color: #755600; font-size: .72rem; font-weight: 800; }
.topic-list { list-style: none; margin: 0; padding: 0 24px 24px; }
.topic-list li { border-top: 1px solid #eff0f2; }
.topic-label { display: flex; align-items: center; gap: 11px; padding: 12px 1px; cursor: pointer; font-size: .88rem; }
.topic-label input { position: absolute; opacity: 0; pointer-events: none; }
.checkmark { width: 21px; height: 21px; border: 1.5px solid #c4c8d0; border-radius: 6px; display: grid; place-items: center; flex: 0 0 auto; color: transparent; transition: .18s ease; }
.topic-label input:checked + .checkmark { background: var(--green); border-color: var(--green); color: var(--white); }
.topic-label input:checked ~ .topic-text { color: #737a86; text-decoration: line-through; }
.notes-list { padding: 0 24px 24px; }
.note { border-top: 1px solid #eff0f2; }
.note summary { list-style: none; cursor: pointer; padding: 14px 30px 14px 1px; position: relative; font-weight: 700; font-size: .9rem; color: var(--navy); }
.note summary::-webkit-details-marker { display: none; }
.note summary::after { content: "+"; position: absolute; right: 3px; top: 12px; font-size: 1.25rem; font-weight: 400; }
.note[open] summary::after { content: "−"; }
.note p { color: var(--muted); font-size: .86rem; margin: -3px 22px 16px 1px; }
.note .thinking-tip { background: #fff9e9; color: #6d5316; border-left: 3px solid var(--yellow); padding: 10px 12px; border-radius: 0 8px 8px 0; }
.practice-wrap { padding: 0 24px 24px; }
.question { padding: 20px 0; border-top: 1px solid #eff0f2; }
.question:first-child { padding-top: 16px; }
.question-number { color: #8b6710; font-weight: 800; font-size: .73rem; letter-spacing: .09em; }
.question-text { margin: 7px 0 14px; font-weight: 700; color: var(--navy); }
.answer-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.answer-button { padding: 11px 13px; border: 1px solid #dadde3; border-radius: 9px; background: var(--white); color: var(--ink); text-align: left; cursor: pointer; font-size: .84rem; }
.answer-button:hover:not(:disabled) { border-color: #9da5b4; background: #fbfbfc; }
.answer-button.correct { border-color: var(--green); background: var(--green-soft); color: #155646; }
.answer-button.incorrect { border-color: var(--red); background: var(--red-soft); color: #8d3030; }
.answer-button:disabled { cursor: default; }
.explanation { display: none; margin: 13px 0 0; padding: 12px 14px; border-radius: 9px; font-size: .83rem; }
.explanation.show { display: block; }
.explanation.correct { color: #155646; background: var(--green-soft); }
.explanation.incorrect { color: #7b3434; background: var(--red-soft); }
.explanation strong { display: block; margin-bottom: 3px; }
.domain-footer { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-top: 24px; }
.domain-footer button { border: 1px solid #d4d7dd; border-radius: 9px; padding: 11px 14px; background: var(--white); color: var(--navy); font-weight: 800; cursor: pointer; }
.domain-footer button:hover { border-color: var(--navy); }
.domain-footer .next-button { background: var(--navy); color: var(--white); border-color: var(--navy); margin-left: auto; }
.domain-footer .next-button:hover { background: var(--navy-2); }
.toast { position: fixed; left: 50%; bottom: 22px; transform: translate(-50%, 30px); opacity: 0; background: var(--navy); color: var(--white); padding: 11px 16px; border-radius: 10px; font-size: .83rem; pointer-events: none; transition: .25s ease; box-shadow: var(--shadow); z-index: 20; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
footer { display: flex; justify-content: space-between; gap: 30px; padding: 26px clamp(20px, 6vw, 90px); background: var(--navy); color: #bdc5d4; font-size: .75rem; }
footer p { margin: 0; }
footer strong { color: var(--white); }
footer a { color: var(--yellow); text-underline-offset: 3px; }

@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; }
  .progress-card { max-width: 620px; }
  .study-layout { grid-template-columns: 1fr; }
  .domain-nav { position: static; overflow: hidden; }
  .domain-nav > p, .exam-note { display: none; }
  #domainNav { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 3px; }
  .nav-item { min-width: 190px; }
}
@media (max-width: 700px) {
  .topbar { padding: 12px 16px; }
  .private-pill { display: none; }
  .hero { min-height: auto; padding-top: 60px; padding-bottom: 70px; }
  .hero-actions { align-items: flex-start; flex-direction: column; gap: 15px; }
  .section-intro { grid-template-columns: 1fr; gap: 20px; }
  .content-grid { grid-template-columns: 1fr; }
  .study-card.full { grid-column: auto; }
  .answer-options { grid-template-columns: 1fr; }
  .domain-footer { flex-wrap: wrap; }
  footer { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}
