@import url("https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Manrope:wght@400;500;600;700;800&display=swap");

:root {
  color-scheme: light;
  --paper: #f6f3ec;
  --surface: #fffdf8;
  --surface-strong: #ffffff;
  --ink: #172033;
  --muted: #667085;
  --line: #d8d3c8;
  --line-strong: #b8b1a4;
  --accent: #2856d8;
  --accent-dark: #183ca4;
  --accent-soft: #e9efff;
  --positive: #13715a;
  --positive-soft: #e5f5ef;
  --warning: #9a5d0a;
  --warning-soft: #fff1d7;
  --danger: #b4233e;
  --danger-soft: #ffebef;
  --shadow: 0 22px 60px rgba(31, 42, 68, 0.1);
  --header-height: 74px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background:
    linear-gradient(rgba(40, 86, 216, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(40, 86, 216, 0.025) 1px, transparent 1px),
    var(--paper);
  background-size: 32px 32px;
  color: var(--ink);
  font-family: "Manrope", system-ui, sans-serif;
  margin: 0;
  min-height: 100vh;
}

button,
input,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
}

.skip-link {
  background: var(--ink);
  color: white;
  left: 12px;
  padding: 10px 14px;
  position: fixed;
  top: -60px;
  z-index: 100;
}

.skip-link:focus {
  top: 12px;
}

.app-header {
  align-items: center;
  backdrop-filter: blur(18px);
  background: rgba(246, 243, 236, 0.9);
  border-bottom: 1px solid rgba(184, 177, 164, 0.75);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  height: var(--header-height);
  padding: 0 4vw;
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand {
  align-items: center;
  display: inline-flex;
  gap: 12px;
  justify-self: start;
  text-decoration: none;
}

.brand-mark {
  align-items: center;
  background: var(--ink);
  border-radius: 9px;
  color: white;
  display: flex;
  font-family: "DM Mono", monospace;
  font-size: 18px;
  font-weight: 500;
  height: 38px;
  justify-content: center;
  width: 38px;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 14px;
  letter-spacing: -0.02em;
}

.brand small {
  color: var(--muted);
  font-size: 11px;
  margin-top: 1px;
}

.primary-nav {
  align-items: center;
  display: flex;
  gap: 8px;
}

.primary-nav a {
  border-radius: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  padding: 9px 13px;
  text-decoration: none;
}

.primary-nav a:hover,
.primary-nav a.is-active {
  background: var(--surface);
  color: var(--ink);
}

.header-action {
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  justify-self: end;
  text-decoration: none;
}

main {
  margin: 0 auto;
  max-width: 1440px;
  padding: 64px 5vw 100px;
}

.view {
  animation: view-in 360ms ease both;
}

.view[hidden] {
  display: none;
}

@keyframes view-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.workspace-heading,
.tool-heading {
  align-items: end;
  display: flex;
  justify-content: space-between;
  margin-bottom: 46px;
}

.workspace-heading > div:first-child,
.tool-heading > div:first-child {
  max-width: 780px;
}

.eyebrow,
.section-number,
.card-label {
  color: var(--accent);
  font-family: "DM Mono", monospace;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.07em;
  margin: 0 0 13px;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  font-size: clamp(38px, 5vw, 68px);
  letter-spacing: -0.055em;
  line-height: 0.98;
  margin-bottom: 20px;
}

h2 {
  font-size: 22px;
  letter-spacing: -0.035em;
  line-height: 1.18;
}

.lede {
  color: var(--muted);
  font-size: 17px;
  line-height: 1.65;
  margin-bottom: 0;
  max-width: 700px;
}

.readiness-seal,
.tool-stat {
  align-items: center;
  background: var(--ink);
  border-radius: 50%;
  color: white;
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  height: 144px;
  justify-content: center;
  text-align: center;
  width: 144px;
}

.readiness-seal span,
.readiness-seal small,
.tool-stat span {
  color: #bdc7d9;
  font-family: "DM Mono", monospace;
  font-size: 10px;
  text-transform: uppercase;
}

.readiness-seal strong,
.tool-stat strong {
  font-size: 24px;
  letter-spacing: -0.04em;
  margin: 4px 0;
}

.readiness-seal.is-ready,
.readiness-score.is-ready {
  background: var(--positive);
}

.metric-strip {
  border-bottom: 1px solid var(--line-strong);
  border-top: 1px solid var(--line-strong);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-bottom: 56px;
}

.metric-strip > div {
  padding: 20px 24px;
}

.metric-strip > div + div {
  border-left: 1px solid var(--line);
}

.metric-strip span,
.metric-strip strong {
  display: block;
}

.metric-strip span {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 6px;
}

.metric-strip strong {
  font-size: 21px;
  letter-spacing: -0.035em;
}

.overview-grid,
.readiness-grid {
  display: grid;
  gap: 64px;
  grid-template-columns: minmax(0, 1fr) minmax(380px, 0.8fr);
  margin-bottom: 72px;
}

.next-action {
  border-left: 3px solid var(--accent);
  padding: 8px 0 8px 28px;
}

.next-action h2 {
  font-size: 34px;
  max-width: 580px;
}

.next-action > p:not(.section-number) {
  color: var(--muted);
  line-height: 1.65;
  max-width: 620px;
}

.primary-button,
.secondary-button,
.text-button {
  border: 0;
  cursor: pointer;
  font-weight: 800;
}

.primary-button,
.secondary-button {
  align-items: center;
  border-radius: 8px;
  display: inline-flex;
  gap: 24px;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  text-decoration: none;
}

.primary-button {
  background: var(--accent);
  color: white;
}

.primary-button:hover {
  background: var(--accent-dark);
}

.secondary-button {
  background: transparent;
  border: 1px solid var(--line-strong);
  color: var(--ink);
}

.secondary-button:hover {
  background: var(--surface);
}

.text-button {
  background: transparent;
  color: var(--accent);
  font-size: 12px;
}

.learning-loop {
  align-items: center;
  display: flex;
  margin-top: 44px;
  max-width: 580px;
}

.learning-loop span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.learning-loop span.is-current {
  color: var(--accent);
}

.learning-loop i {
  background: var(--line-strong);
  flex: 1;
  height: 1px;
  margin: 0 10px;
}

.section-heading {
  align-items: start;
  display: flex;
  justify-content: space-between;
  margin-bottom: 22px;
}

.section-heading h2 {
  margin-bottom: 8px;
}

.section-heading p:not(.section-number) {
  color: var(--muted);
  line-height: 1.5;
  max-width: 650px;
}

.section-heading > a,
.section-heading > span {
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.mock-history {
  border-top: 1px solid var(--line-strong);
}

.history-row {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr auto auto;
  min-height: 61px;
}

.history-row strong,
.history-row span,
.history-row small {
  display: block;
}

.history-row span {
  font-size: 13px;
  font-weight: 700;
}

.history-row small {
  color: var(--muted);
  font-size: 10px;
  margin-top: 2px;
}

.history-row .history-score {
  font-family: "DM Mono", monospace;
  font-size: 12px;
}

.status-mark {
  border-radius: 999px;
  font-family: "DM Mono", monospace;
  font-size: 10px;
  font-style: normal;
  padding: 5px 8px;
  text-transform: uppercase;
}

.status-mark.pass {
  background: var(--positive-soft);
  color: var(--positive);
}

.status-mark.fail {
  background: var(--danger-soft);
  color: var(--danger);
}

.empty-state {
  color: var(--muted);
  line-height: 1.6;
  padding: 24px 0;
}

.coverage-section,
.library-section,
.readiness-gates {
  border-top: 1px solid var(--line-strong);
  padding-top: 32px;
}

.coverage-section {
  margin-bottom: 72px;
}

.coverage-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.coverage-row {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 16px;
  grid-template-columns: auto 1fr auto;
  min-height: 76px;
  padding: 10px 18px 10px 0;
}

.coverage-row:nth-child(even) {
  padding-left: 28px;
}

.coverage-row input {
  accent-color: var(--accent);
  height: 18px;
  width: 18px;
}

.coverage-row label {
  cursor: pointer;
}

.coverage-row strong,
.coverage-row small {
  display: block;
}

.coverage-row strong {
  font-size: 13px;
}

.coverage-row small {
  color: var(--muted);
  font-size: 11px;
  margin-top: 4px;
}

.coverage-row a {
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  text-decoration: none;
}

.level-label {
  color: var(--muted);
  font-family: "DM Mono", monospace;
  font-size: 9px;
  text-transform: uppercase;
}

.resource-list {
  border-top: 1px solid var(--line);
}

.resource-list a {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 20px;
  grid-template-columns: 0.65fr 1fr auto;
  min-height: 76px;
  text-decoration: none;
  transition: padding 180ms ease;
}

.resource-list a:hover {
  padding-left: 12px;
}

.resource-list span,
.resource-list i {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.resource-list strong {
  font-size: 17px;
}

.tool-heading {
  border-bottom: 1px solid var(--line-strong);
  padding-bottom: 38px;
}

.flashcard-toolbar {
  align-items: end;
  display: flex;
  gap: 28px;
  margin-bottom: 34px;
}

.flashcard-toolbar label > span {
  color: var(--muted);
  display: block;
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 7px;
  text-transform: uppercase;
}

select {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  color: var(--ink);
  min-height: 43px;
  padding: 0 38px 0 12px;
}

.toggle-control {
  align-items: center;
  cursor: pointer;
  display: flex;
  gap: 9px;
  min-height: 43px;
}

.toggle-control input {
  accent-color: var(--accent);
}

.toggle-control > span {
  margin: 0 !important;
  text-transform: none !important;
}

.flashcard-toolbar .text-button {
  margin-left: auto;
  min-height: 43px;
}

.flashcard-layout {
  display: grid;
  gap: 54px;
  grid-template-columns: minmax(0, 1fr) 340px;
}

.flashcard {
  cursor: pointer;
  height: 470px;
  perspective: 1400px;
  position: relative;
}

.flashcard:focus-visible {
  outline: 3px solid rgba(40, 86, 216, 0.28);
  outline-offset: 5px;
}

.flashcard-face {
  backface-visibility: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  height: 100%;
  justify-content: space-between;
  left: 0;
  padding: 34px;
  position: absolute;
  top: 0;
  transform-style: preserve-3d;
  transition: transform 520ms cubic-bezier(0.2, 0.72, 0.2, 1);
  width: 100%;
}

.flashcard-front {
  background: var(--surface-strong);
}

.flashcard-back {
  background: var(--ink);
  color: white;
  transform: rotateY(180deg);
}

.flashcard.is-flipped .flashcard-front {
  transform: rotateY(-180deg);
}

.flashcard.is-flipped .flashcard-back {
  transform: rotateY(0);
}

.card-meta {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.card-meta span,
.card-meta a {
  font-family: "DM Mono", monospace;
  font-size: 11px;
  text-decoration: none;
  text-transform: uppercase;
}

.flashcard-front .card-meta {
  color: var(--accent);
}

.flashcard-back .card-meta {
  color: #b9c7e6;
}

.flashcard-front h2 {
  font-size: clamp(28px, 4vw, 48px);
  letter-spacing: -0.045em;
  line-height: 1.14;
  margin: auto 0;
  max-width: 850px;
}

.flashcard-back > p {
  font-size: clamp(22px, 3vw, 34px);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.38;
  margin: auto 0;
}

.flip-hint {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.flashcard-back .flip-hint {
  color: #aebbd5;
}

.rating-row {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(4, 1fr);
  margin-top: 14px;
}

.rating-row button {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  color: var(--ink);
  cursor: pointer;
  min-height: 58px;
}

.rating-row button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.rating-row kbd,
.rating-row small {
  display: block;
  font-family: "DM Mono", monospace;
  font-size: 9px;
}

.rating-row small {
  color: var(--muted);
  margin-top: 2px;
}

.deck-progress {
  border-left: 1px solid var(--line-strong);
  padding-left: 32px;
}

.topic-progress-row {
  margin-bottom: 20px;
}

.topic-progress-row div:first-child {
  display: flex;
  font-size: 12px;
  justify-content: space-between;
  margin-bottom: 7px;
}

.progress-track {
  background: #ded9cf;
  height: 5px;
  overflow: hidden;
}

.progress-track span {
  background: var(--accent);
  display: block;
  height: 100%;
  transition: width 420ms ease;
}

.progress-note {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
  margin-top: 34px;
}

.empty-deck {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  padding: 60px;
  text-align: center;
}

.empty-deck p:not(.eyebrow) {
  color: var(--muted);
}

.readiness-gates {
  margin-bottom: 58px;
}

#gate-list {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
}

.gate {
  border-right: 1px solid var(--line);
  min-height: 130px;
  padding: 16px 20px;
}

.gate:first-child {
  padding-left: 0;
}

.gate:last-child {
  border-right: 0;
}

.gate i {
  align-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--muted);
  display: flex;
  font-style: normal;
  height: 26px;
  justify-content: center;
  margin-bottom: 14px;
  width: 26px;
}

.gate.is-complete i {
  background: var(--positive);
  border-color: var(--positive);
  color: white;
}

.gate strong,
.gate small {
  display: block;
}

.gate strong {
  font-size: 13px;
}

.gate small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
  margin-top: 5px;
}

.self-evidence,
.knowledge-check {
  min-width: 0;
}

.task-row {
  align-items: start;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 14px;
  grid-template-columns: auto 1fr;
  padding: 17px 0;
}

.task-row input {
  accent-color: var(--accent);
  height: 19px;
  margin-top: 2px;
  width: 19px;
}

.task-row strong,
.task-row small {
  display: block;
}

.task-row strong {
  font-size: 13px;
}

.task-row small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
  margin-top: 4px;
}

.quiz-progress {
  background: #ded9cf;
  height: 4px;
  margin-bottom: 26px;
}

.quiz-progress span {
  background: var(--accent);
  display: block;
  height: 100%;
  transition: width 280ms ease;
}

.question-topic {
  color: var(--accent);
  font-family: "DM Mono", monospace;
  font-size: 10px;
  text-transform: uppercase;
}

#readiness-question .scenario {
  background: var(--warning-soft);
  border-left: 3px solid var(--warning);
  color: #593b16;
  font-size: 12px;
  line-height: 1.6;
  margin: 16px 0;
  padding: 12px 14px;
}

#readiness-question h3 {
  font-size: 20px;
  line-height: 1.4;
  margin: 12px 0 18px;
}

.quiz-option {
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 7px;
  cursor: pointer;
  display: grid;
  gap: 11px;
  grid-template-columns: auto 1fr;
  margin-bottom: 8px;
  padding: 12px;
}

.quiz-option:hover,
.quiz-option:has(input:checked) {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.quiz-option input {
  accent-color: var(--accent);
  margin-top: 3px;
}

.quiz-option span {
  font-size: 12px;
  line-height: 1.45;
}

.quiz-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 22px;
}

.quiz-result {
  border-top: 1px solid var(--line-strong);
  margin-top: 28px;
  padding-top: 24px;
}

.quiz-result strong {
  display: block;
  font-size: 28px;
  letter-spacing: -0.04em;
  margin-bottom: 8px;
}

.quiz-result p {
  color: var(--muted);
  line-height: 1.5;
}

.toast {
  background: var(--ink);
  border-radius: 8px;
  bottom: 24px;
  color: white;
  font-size: 12px;
  left: 50%;
  opacity: 0;
  padding: 12px 16px;
  pointer-events: none;
  position: fixed;
  transform: translate(-50%, 18px);
  transition: 220ms ease;
  z-index: 50;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 980px) {
  .app-header {
    grid-template-columns: 1fr auto;
  }

  .primary-nav {
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    bottom: auto;
    grid-column: 1 / -1;
    justify-content: center;
    left: 0;
    order: 3;
    position: fixed;
    right: 0;
    top: var(--header-height);
  }

  main {
    padding-top: 92px;
  }

  .header-action {
    grid-column: 2;
  }

  .overview-grid,
  .readiness-grid,
  .flashcard-layout {
    grid-template-columns: 1fr;
  }

  .deck-progress {
    border-left: 0;
    border-top: 1px solid var(--line-strong);
    padding-left: 0;
    padding-top: 28px;
  }

  #gate-list {
    grid-template-columns: repeat(2, 1fr);
  }

  .gate {
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 680px) {
  :root {
    --header-height: 66px;
  }

  .app-header {
    padding: 0 18px;
  }

  .brand small,
  .header-action {
    display: none;
  }

  .primary-nav a {
    flex: 1;
    text-align: center;
  }

  main {
    padding: 86px 20px 70px;
  }

  .workspace-heading,
  .tool-heading {
    align-items: start;
    flex-direction: column;
    gap: 28px;
  }

  .readiness-seal,
  .tool-stat {
    border-radius: 10px;
    height: auto;
    padding: 15px;
    width: 100%;
  }

  .metric-strip {
    grid-template-columns: 1fr 1fr;
  }

  .metric-strip > div {
    border-bottom: 1px solid var(--line);
    padding: 16px 12px;
  }

  .metric-strip > div:nth-child(3) {
    border-left: 0;
  }

  .coverage-list {
    grid-template-columns: 1fr;
  }

  .coverage-row:nth-child(even) {
    padding-left: 0;
  }

  .resource-list a {
    grid-template-columns: 1fr auto;
    padding: 14px 0;
  }

  .resource-list span {
    grid-column: 1 / -1;
  }

  .flashcard-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .flashcard-toolbar .text-button {
    margin-left: 0;
    text-align: left;
  }

  .flashcard {
    height: 430px;
  }

  .flashcard-face {
    padding: 24px;
  }

  .rating-row {
    grid-template-columns: 1fr 1fr;
  }

  #gate-list {
    grid-template-columns: 1fr;
  }

  .gate {
    border-right: 0;
    padding-left: 0;
  }

  .section-heading {
    gap: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

