:root {
  --paper: #f3eee3;
  --paper-bright: #fcfaf5;
  --paper-deep: #e7decd;
  --ink: #17233d;
  --ink-soft: #5b6678;
  --coral: #e0523e;
  --coral-dark: #ae3529;
  --green: #1d7155;
  --green-soft: #dcebe1;
  --gold: #bd8b2d;
  --rule: #d5cbb9;
  --rule-dark: #a99c87;
  --white: #fffefb;
  --shadow: 0 22px 56px rgba(30, 37, 52, 0.11);
  --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --serif: Iowan Old Style, Baskerville, "Times New Roman", serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 84% 7%, rgba(224, 82, 62, 0.08), transparent 25rem),
    var(--paper);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
}

button,
input {
  color: inherit;
  font: inherit;
}

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

button,
label {
  cursor: pointer;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 12px;
  left: 16px;
  padding: 10px 14px;
  transform: translateY(-160%);
  color: var(--white);
  background: var(--ink);
  text-decoration: none;
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: sticky;
  z-index: 30;
  top: 0;
  display: flex;
  min-height: 74px;
  align-items: center;
  justify-content: space-between;
  padding: 10px max(24px, calc((100vw - 1240px) / 2));
  background: rgba(243, 238, 227, 0.94);
  border-bottom: 1px solid rgba(169, 156, 135, 0.65);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  color: var(--paper-bright);
  background: var(--ink);
  border: 1px solid var(--ink);
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.brand > span:last-child {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand strong {
  font-family: var(--serif);
  font-size: 19px;
}

.brand small {
  margin-top: 4px;
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.header-actions,
.hero-actions,
.data-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.storage-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 11px;
  color: var(--ink-soft);
  border: 1px solid var(--rule);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 750;
}

.storage-dot {
  width: 7px;
  height: 7px;
  background: var(--green);
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(29, 113, 85, 0.12);
}

.button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--rule-dark);
  border-radius: 3px;
  font-size: 13px;
  font-weight: 750;
  line-height: 1;
  text-decoration: none;
  transition: transform 160ms ease, background-color 160ms ease, color 160ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button-primary {
  color: var(--white);
  background: var(--coral);
  border-color: var(--coral);
  box-shadow: 4px 4px 0 var(--ink);
}

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

.button-quiet {
  background: var(--paper-bright);
}

.button-quiet:hover,
.button-paper:hover {
  background: var(--paper-deep);
}

.button-ink {
  color: var(--white);
  background: var(--ink);
  border-color: var(--ink);
}

.button-paper {
  background: var(--paper-bright);
}

.text-button {
  padding: 7px;
  color: var(--ink-soft);
  background: transparent;
  border: 0;
  font-size: 12px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.danger-button:hover {
  color: var(--coral-dark);
}

.hero,
.metrics,
.principle-banner,
.curriculum-section,
.evidence-section,
.data-section,
footer {
  width: min(1240px, calc(100% - 48px));
  margin-right: auto;
  margin-left: auto;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(360px, 0.88fr);
  gap: clamp(44px, 8vw, 110px);
  align-items: center;
  min-height: 610px;
  padding: 82px 0 72px;
  border-bottom: 1px solid var(--rule-dark);
}

.eyebrow {
  margin: 0 0 16px;
  color: var(--coral-dark);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

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

h1,
h2,
h3,
h4 {
  text-wrap: balance;
}

h1 {
  max-width: 720px;
  margin-bottom: 24px;
  font-family: var(--serif);
  font-size: clamp(52px, 7vw, 88px);
  font-weight: 650;
  letter-spacing: -0.055em;
  line-height: 0.94;
}

h1 em {
  color: var(--coral);
  font-weight: 500;
}

.hero-intro {
  max-width: 650px;
  margin-bottom: 30px;
  color: var(--ink-soft);
  font-size: clamp(16px, 2vw, 19px);
}

.progress-card {
  position: relative;
  padding: 30px;
  background: var(--paper-bright);
  border: 1px solid var(--rule-dark);
  box-shadow: 12px 12px 0 var(--paper-deep), var(--shadow);
}

.progress-card::before {
  position: absolute;
  top: -1px;
  left: -1px;
  width: 84px;
  height: 5px;
  background: var(--coral);
  content: "";
}

.progress-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.progress-fraction {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0;
}

.progress-fraction strong {
  font-family: var(--serif);
  font-size: 58px;
  font-weight: 650;
  letter-spacing: -0.05em;
  line-height: 1;
}

.progress-fraction span {
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
}

.progress-ring {
  --progress: 0deg;
  position: relative;
  display: grid;
  width: 92px;
  height: 92px;
  flex: 0 0 auto;
  place-items: center;
  background: conic-gradient(var(--green) var(--progress), var(--paper-deep) 0);
  border-radius: 50%;
}

.progress-ring::after {
  position: absolute;
  width: 70px;
  height: 70px;
  background: var(--paper-bright);
  border-radius: 50%;
  content: "";
}

.progress-ring span {
  z-index: 1;
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 800;
}

.progress-track {
  display: block;
  width: 100%;
  height: 8px;
  margin-top: 28px;
  overflow: hidden;
  appearance: none;
  background: var(--paper-deep);
  border: 0;
  border-radius: 99px;
}

.progress-track::-webkit-progress-bar {
  background: var(--paper-deep);
  border-radius: 99px;
}

.progress-track::-webkit-progress-value {
  background: var(--green);
  border-radius: 99px;
}

.progress-track::-moz-progress-bar {
  background: var(--green);
  border-radius: 99px;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin: 10px 0 26px;
  color: var(--ink-soft);
  font-size: 11px;
}

.continue-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 20px;
  color: var(--white);
  background: var(--ink);
  text-decoration: none;
  transition: transform 160ms ease;
}

.continue-card:hover {
  transform: translateX(3px);
}

.continue-card small,
.continue-card strong {
  display: block;
}

.continue-card small {
  margin-bottom: 5px;
  color: #cbd2df;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.continue-card strong {
  font-size: 13px;
  line-height: 1.35;
}

.continue-card.all-complete {
  background: var(--green);
}

.continue-arrow {
  color: var(--coral);
  font-size: 24px;
}

.all-complete .continue-arrow {
  color: var(--white);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-bottom: 1px solid var(--rule-dark);
}

.metrics article {
  display: flex;
  min-height: 142px;
  flex-direction: column;
  justify-content: center;
  padding: 28px;
  border-right: 1px solid var(--rule);
}

.metrics article:last-child {
  border-right: 0;
}

.metric-number {
  font-family: var(--serif);
  font-size: 38px;
  font-weight: 650;
  line-height: 1;
}

.metric-label {
  margin-top: 9px;
  color: var(--ink-soft);
  font-size: 12px;
}

.principle-banner {
  display: flex;
  align-items: center;
  gap: clamp(25px, 5vw, 70px);
  padding: 32px 0;
  border-bottom: 1px solid var(--rule);
}

.principle-banner .eyebrow {
  flex: 0 0 auto;
  margin: 0;
}

.principle-banner > p:last-child {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  margin: 0;
  font-family: var(--serif);
  font-size: 16px;
}

.principle-banner b {
  color: var(--coral);
  font-family: var(--sans);
  font-weight: 500;
}

.curriculum-section {
  padding: 92px 0 80px;
}

.section-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 40px;
  align-items: end;
  margin-bottom: 56px;
}

.section-heading h2,
.evidence-section h2,
.data-section h2 {
  max-width: 760px;
  margin-bottom: 14px;
  font-family: var(--serif);
  font-size: clamp(35px, 5vw, 56px);
  font-weight: 650;
  letter-spacing: -0.045em;
  line-height: 1;
}

.section-heading > div:first-child > p:last-child,
.evidence-section > div > p,
.data-section > div > p {
  max-width: 680px;
  margin-bottom: 0;
  color: var(--ink-soft);
}

.toolbar {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}

.search-field {
  display: flex;
  min-width: 320px;
  height: 43px;
  align-items: center;
  gap: 10px;
  padding: 0 13px;
  background: var(--paper-bright);
  border: 1px solid var(--rule-dark);
}

.search-field:focus-within {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

.search-field svg {
  width: 17px;
  fill: none;
  stroke: var(--ink-soft);
  stroke-linecap: round;
  stroke-width: 1.8;
}

.search-field input {
  width: 100%;
  background: transparent;
  border: 0;
  outline: 0;
}

.filter-group {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

.filter-button {
  padding: 8px 12px;
  color: var(--ink-soft);
  background: transparent;
  border: 1px solid var(--rule);
  border-right: 0;
  font-size: 11px;
  font-weight: 750;
}

.filter-button:last-child {
  border-right: 1px solid var(--rule);
}

.filter-button.active {
  color: var(--white);
  background: var(--ink);
  border-color: var(--ink);
}

.phase-section + .phase-section {
  margin-top: 62px;
}

.phase-header {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  gap: 22px;
  align-items: center;
  margin-bottom: 18px;
}

.phase-index {
  padding: 7px 9px;
  color: var(--coral-dark);
  border: 1px solid var(--coral);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 800;
  text-align: center;
  text-transform: uppercase;
}

.phase-header h3 {
  margin-bottom: 2px;
  font-family: var(--serif);
  font-size: 27px;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.phase-header p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 12px;
}

.phase-count {
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 12px;
}

.phase-topics {
  border-top: 1px solid var(--rule-dark);
}

.topic-card {
  position: relative;
  display: grid;
  grid-template-columns: 52px 72px 1fr;
  gap: 20px;
  padding: 28px 18px;
  background: rgba(252, 250, 245, 0.35);
  border-bottom: 1px solid var(--rule);
  transition: background-color 160ms ease, transform 160ms ease;
}

.topic-card:hover {
  z-index: 1;
  background: var(--paper-bright);
  transform: translateX(3px);
}

.topic-card.completed {
  background: rgba(220, 235, 225, 0.55);
}

.topic-check {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  align-self: start;
}

.topic-check input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.topic-check span {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  background: var(--paper-bright);
  border: 1px solid var(--rule-dark);
  border-radius: 50%;
  transition: background-color 150ms ease, border-color 150ms ease, transform 150ms ease;
}

.topic-check:hover span {
  transform: scale(1.08);
}

.topic-check svg {
  width: 17px;
  fill: none;
  stroke: transparent;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.4;
}

.topic-check input:focus-visible + span {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

.topic-check input:checked + span {
  background: var(--green);
  border-color: var(--green);
}

.topic-check input:checked + span svg {
  stroke: var(--white);
}

.topic-number {
  color: var(--rule-dark);
  font-family: var(--serif);
  font-size: 38px;
  line-height: 1;
}

.completed .topic-number {
  color: var(--green);
}

.topic-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 9px;
}

.topic-meta span {
  padding: 3px 7px;
  color: var(--ink-soft);
  background: var(--paper-deep);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.completed .topic-meta span {
  background: rgba(29, 113, 85, 0.1);
}

.topic-content h4 {
  margin-bottom: 7px;
  font-family: var(--serif);
  font-size: clamp(21px, 2.4vw, 29px);
  font-weight: 650;
  letter-spacing: -0.025em;
  line-height: 1.1;
}

.completed .topic-content h4 {
  text-decoration: line-through;
  text-decoration-color: rgba(29, 113, 85, 0.45);
  text-decoration-thickness: 1px;
}

.topic-content > p {
  max-width: 760px;
  margin-bottom: 15px;
  color: var(--ink-soft);
}

.topic-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.topic-status {
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
}

.completed .topic-status {
  color: var(--green);
  font-weight: 800;
}

.topic-footer a,
.text-link {
  color: var(--coral-dark);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
  text-underline-offset: 4px;
}

.topic-footer a:hover,
.text-link:hover {
  text-decoration: underline;
}

.empty-state {
  padding: 70px 20px;
  color: var(--ink-soft);
  background: var(--paper-bright);
  border: 1px solid var(--rule);
  text-align: center;
}

.evidence-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.7fr);
  gap: clamp(40px, 8vw, 100px);
  align-items: center;
  padding: 90px clamp(24px, 5vw, 72px);
  color: var(--white);
  background: var(--ink);
}

.evidence-section .eyebrow {
  color: #f28a79;
}

.evidence-section > div > p {
  margin-bottom: 22px;
  color: #cad1dc;
}

.evidence-section .text-link {
  color: #f28a79;
}

.evidence-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid rgba(255, 255, 255, 0.24);
}

.evidence-list li {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 18px;
  align-items: center;
  padding: 17px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
}

.evidence-list strong {
  color: #f28a79;
  font-family: var(--serif);
  font-size: 30px;
}

.evidence-list span {
  color: #d9dee7;
  font-size: 13px;
}

.data-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 50px;
  align-items: center;
  padding: 76px 0;
  border-bottom: 1px solid var(--rule-dark);
}

.data-section h2 {
  max-width: 700px;
  font-size: clamp(32px, 4vw, 48px);
}

.data-section code {
  padding: 2px 5px;
  background: var(--paper-deep);
  font-family: var(--mono);
  font-size: 12px;
}

.data-actions {
  max-width: 400px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

footer {
  display: flex;
  min-height: 210px;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  padding: 45px 0;
}

footer > div {
  display: flex;
  max-width: 580px;
  align-items: center;
  gap: 18px;
}

.footer-mark {
  flex: 0 0 auto;
}

footer p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 12px;
}

footer nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 18px;
}

footer nav a {
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

footer nav a:hover {
  color: var(--coral-dark);
}

.toast {
  position: fixed;
  z-index: 50;
  right: 22px;
  bottom: 22px;
  max-width: min(360px, calc(100% - 44px));
  padding: 13px 16px;
  color: var(--white);
  background: var(--ink);
  border-left: 4px solid var(--coral);
  box-shadow: var(--shadow);
  font-size: 12px;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transform: translateY(16px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 900px) {
  .hero,
  .section-heading,
  .evidence-section,
  .data-section {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
    padding-top: 64px;
  }

  .progress-card {
    max-width: 560px;
  }

  .metrics {
    grid-template-columns: repeat(2, 1fr);
  }

  .metrics article:nth-child(2) {
    border-right: 0;
  }

  .metrics article:nth-child(-n + 2) {
    border-bottom: 1px solid var(--rule);
  }

  .toolbar {
    align-items: start;
  }

  .data-actions {
    max-width: none;
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  .site-header {
    min-height: 66px;
    padding-right: 16px;
    padding-left: 16px;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
    font-size: 12px;
  }

  .brand strong {
    font-size: 16px;
  }

  .brand small,
  .storage-pill,
  .header-github {
    display: none;
  }

  .hero,
  .metrics,
  .principle-banner,
  .curriculum-section,
  .evidence-section,
  .data-section,
  footer {
    width: min(100% - 28px, 1240px);
  }

  .hero {
    gap: 38px;
    padding: 48px 0 54px;
  }

  h1 {
    font-size: clamp(46px, 15vw, 66px);
  }

  .hero-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .progress-card {
    padding: 24px;
    box-shadow: 7px 7px 0 var(--paper-deep);
  }

  .progress-ring {
    width: 78px;
    height: 78px;
  }

  .progress-ring::after {
    width: 59px;
    height: 59px;
  }

  .progress-fraction strong {
    font-size: 48px;
  }

  .progress-meta {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }

  .metrics article {
    min-height: 112px;
    padding: 20px;
  }

  .principle-banner {
    align-items: flex-start;
    flex-direction: column;
    gap: 15px;
  }

  .curriculum-section {
    padding: 68px 0;
  }

  .section-heading {
    gap: 30px;
    margin-bottom: 42px;
  }

  .search-field {
    width: 100%;
    min-width: 0;
  }

  .toolbar,
  .filter-group {
    width: 100%;
  }

  .phase-header {
    grid-template-columns: 70px 1fr;
    gap: 15px;
  }

  .phase-count {
    display: none;
  }

  .topic-card {
    grid-template-columns: 40px 1fr;
    gap: 12px;
    padding: 24px 8px;
  }

  .topic-number {
    display: none;
  }

  .topic-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .evidence-section {
    width: 100%;
    padding: 68px 24px;
  }

  .data-section {
    padding: 64px 0;
  }

  .data-actions {
    align-items: stretch;
    flex-direction: column;
  }

  footer,
  footer > div {
    align-items: flex-start;
    flex-direction: column;
  }

  footer nav {
    justify-content: flex-start;
  }
}

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