:root {
  --paper: #f2ecdf;
  --paper-deep: #e9e0cf;
  --ink: #263229;
  --muted: #5c665b;
  --sage: #d5d8ca;
  --sage-line: #98a28f;
  --rust: #d4a72c;
  --cursor-accent: #d4a72c;
  --rule: rgba(38, 50, 41, .2);
  --mouse-x: 72%;
  --mouse-y: 45%;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Newsreader", Georgia, serif;
  text-rendering: optimizeLegibility;
}
a { color: inherit; }

.skip-link {
  position: fixed;
  z-index: 100;
  top: 1rem;
  left: 1rem;
  padding: .75rem 1rem;
  background: var(--ink);
  color: var(--paper);
  opacity: 0;
  pointer-events: none;
  transform: translateY(calc(-100% - 2rem));
}
.skip-link:focus {
  opacity: 1;
  pointer-events: auto;
  transform: none;
}

.grain {
  position: fixed;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  opacity: .17;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.22'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}

.site-header {
  position: absolute;
  z-index: 10;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 clamp(1.25rem, 4vw, 4.5rem);
  padding: 1.45rem 0;
  border-bottom: 1px solid var(--rule);
}
.wordmark {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  font-size: clamp(1.25rem, 2vw, 1.8rem);
  text-decoration: none;
  letter-spacing: -.02em;
}
.theme-picker {
  position: absolute;
  left: 50%;
  display: flex;
  gap: .2rem;
  padding: .25rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  transform: translateX(-50%);
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: blur(12px);
}
.theme-button {
  min-height: 2.75rem;
  border: 0;
  border-radius: 999px;
  padding: .48rem .72rem;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: 400 .57rem/1 "DM Mono", monospace;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.theme-button.active { background: var(--ink); color: var(--paper); }
.theme-button:focus-visible { outline: 2px solid var(--rust); outline-offset: 2px; }
.site-header nav { display: flex; gap: clamp(1rem, 3vw, 2.75rem); }
.site-header nav a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  font: 400 .7rem/1 "DM Mono", monospace;
  letter-spacing: .12em;
  text-transform: uppercase;
  text-underline-offset: .35rem;
  text-decoration-thickness: 1px;
}

.hero {
  position: relative;
  min-height: 100svh;
  overflow: hidden;
  display: grid;
  align-content: center;
  padding: 9rem clamp(1.25rem, 8vw, 9rem) 5rem;
  isolation: isolate;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(rgba(38, 50, 41, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(38, 50, 41, .035) 1px, transparent 1px);
  background-size: 5.5vw 5.5vw;
  mask-image: linear-gradient(to bottom, black, transparent 90%);
}
.cursor-light {
  position: absolute;
  z-index: -1;
  top: 0;
  left: 0;
  width: 26rem;
  height: 26rem;
  border-radius: 50%;
  background: radial-gradient(circle 13rem at center, color-mix(in srgb, var(--cursor-accent) 36%, transparent), transparent 72%);
  pointer-events: none;
  transform: translate3d(var(--mouse-x), var(--mouse-y), 0) translate(-50%, -50%);
  transition: opacity .3s ease;
  will-change: transform;
  contain: paint;
}
body:not([data-theme="dark"]) .cursor-light {
  background: radial-gradient(circle 13rem at center, color-mix(in srgb, var(--cursor-accent) 18%, transparent), transparent 72%);
}
.hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background:
    linear-gradient(color-mix(in srgb, var(--cursor-accent) 30%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--cursor-accent) 30%, transparent) 1px, transparent 1px);
  background-size: 5.5vw 5.5vw;
  mask-image: radial-gradient(circle 10rem at var(--mouse-x) var(--mouse-y), black, transparent 76%);
  pointer-events: none;
}
.cursor-lens {
  position: absolute;
  z-index: -1;
  left: var(--mouse-x);
  top: var(--mouse-y);
  width: .95rem;
  height: .95rem;
  border: 1px solid color-mix(in srgb, var(--cursor-accent) 94%, transparent);
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
  opacity: .92;
}
.cursor-lens::after {
  content: "";
  position: absolute;
  width: .42rem;
  height: 1px;
  right: -.32rem;
  bottom: -.16rem;
  background: color-mix(in srgb, var(--cursor-accent) 94%, transparent);
  transform: rotate(45deg);
  transform-origin: left center;
}
.cursor-ripple {
  position: absolute;
  z-index: 2;
  width: .8rem;
  height: .8rem;
  border: 1px solid color-mix(in srgb, var(--cursor-accent) 82%, transparent);
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(.35);
  animation: cursor-ripple 3s cubic-bezier(.12, .62, .16, 1) forwards;
}
@keyframes cursor-ripple {
  0% { opacity: .9; transform: translate(-50%, -50%) scale(.35); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(15); }
}
.kicker, .chapter-number, .progress, .atlas-caption, .placeholder-note, .detail {
  font-family: "DM Mono", monospace;
  text-transform: uppercase;
  letter-spacing: .13em;
}
.kicker {
  margin: 0 0 2rem;
  color: var(--muted);
  font-size: .72rem;
}
.hero h1 {
  max-width: 14ch;
  margin: 0;
  font-size: clamp(4.6rem, 12vw, 11rem);
  font-weight: 300;
  line-height: .82;
  letter-spacing: -.055em;
}
.intro {
  max-width: 30rem;
  margin: 2.6rem 0 0;
  color: var(--muted);
  font-size: clamp(1.2rem, 2vw, 1.65rem);
  line-height: 1.45;
}
.hero-links {
  display: flex;
  align-items: flex-start;
  gap: 2rem;
  margin-top: 2.75rem;
}
.begin {
  display: inline-flex;
  gap: 1rem;
  align-items: center;
  width: fit-content;
  min-height: 2.75rem;
  margin: 0;
  color: var(--ink);
  font: 400 .72rem/1 "DM Mono", monospace;
  letter-spacing: .12em;
  text-transform: uppercase;
  text-decoration: none;
  border-bottom: 1px solid var(--ink);
  padding-bottom: .5rem;
}
.begin span { color: var(--rust); }
.begin-secondary {
  color: var(--muted);
  border-bottom-color: transparent;
  opacity: .62;
}
.begin-secondary span { color: currentColor; }
.placeholder-note {
  position: absolute;
  right: clamp(1.25rem, 4vw, 4.5rem);
  bottom: 2rem;
  margin: 0;
  color: var(--muted);
  font-size: .58rem;
}

.journey {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 51%) minmax(28rem, 49%);
  background: var(--paper-deep);
  border-top: 1px solid var(--rule);
}
.atlas-stage {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100svh;
  overflow: hidden;
  padding: clamp(1.25rem, 4vw, 4rem);
  border-right: 1px solid var(--rule);
}
.atlas-heading {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 1rem;
}
.atlas-heading .kicker { margin: 0; }
.progress { margin: 0; font-size: .67rem; }
.map-wrap {
  position: absolute;
  inset: 10% 2% 8%;
  display: grid;
  place-items: center;
}
.map { width: 100%; height: 100%; overflow: hidden; }
.regional-context {
  opacity: .2;
  filter: saturate(.6);
  pointer-events: none;
}
.land-mask {
  fill: var(--paper-deep);
  stroke: var(--paper-deep);
  stroke-width: 7;
  stroke-linejoin: round;
}
.land {
  fill: var(--sage);
  stroke: var(--sage-line);
  stroke-width: 2.2;
  filter: url(#paper-shadow);
}
.route {
  fill: none;
  stroke: var(--rust);
  stroke-width: 3;
  stroke-dasharray: .008 .018;
  stroke-linecap: round;
  opacity: .28;
}
.route-progress {
  fill: none;
  stroke: var(--rust);
  stroke-width: 4;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  stroke-linecap: round;
}
.route-traveler {
  pointer-events: none;
}
.route-traveler.jumping {
  transition: transform .8s cubic-bezier(.22, .8, .24, 1);
}
.traveler-halo {
  fill: var(--rust);
  opacity: .18;
}
.traveler-dot {
  fill: var(--rust);
  stroke: var(--paper);
  stroke-width: 4;
}
.place {
  cursor: pointer;
  outline: none;
  pointer-events: bounding-box;
}
.place-hit {
  fill: transparent;
  stroke: none;
}
.place text {
  fill: var(--ink);
  paint-order: stroke;
  stroke: var(--paper);
  stroke-width: 3px;
  stroke-linejoin: round;
  font: 500 17px "DM Mono", monospace;
  letter-spacing: .035em;
  opacity: 1;
  transition: opacity .5s ease;
}
.place text.label-end { text-anchor: end; }
.place .dot { fill: var(--paper); stroke: var(--rust); stroke-width: 3; }
.place .pulse { fill: none; stroke: var(--rust); stroke-width: 3; opacity: 0; transform: scale(.4); transition: .5s ease; }
.place.active text { fill: var(--rust); opacity: 1; }
body:not([data-theme="dark"]) .place.active text { fill: var(--ink); }
.place.visited text { opacity: 1; }
.place.active .dot { fill: var(--rust); stroke: var(--paper); stroke-width: 4; }
.place.active .pulse,
.place:focus-visible .pulse { opacity: .8; transform: scale(1); }
.place:focus-visible .dot { stroke-width: 6; }
.place.visited .dot { fill: var(--rust); }
.atlas-caption {
  position: absolute;
  left: clamp(1.25rem, 4vw, 4rem);
  right: clamp(1.25rem, 4vw, 4rem);
  bottom: clamp(1.25rem, 4vw, 3rem);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: var(--muted);
  font-size: .62rem;
}
.route-status { color: var(--ink); }

.chapters {
  padding: 0 clamp(1.5rem, 3.6vw, 4rem) 75svh;
}
.chapter {
  min-height: auto;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: clamp(2.5rem, 4vw, 4rem) .15rem;
}
.chapter.active { opacity: 1; transform: none; }
.chapter-head { max-width: 42rem; }
.chapter-number {
  color: var(--muted);
  font-size: .65rem;
}
.chapter-years {
  margin-left: .45rem;
  color: var(--rust);
  white-space: nowrap;
}
.chapter-years::before {
  content: "·";
  margin-right: .45rem;
  color: var(--muted);
}
.chapter h2 {
  margin: .8rem 0 0;
  font-size: clamp(2.8rem, 5.4vw, 5.6rem);
  font-weight: 300;
  line-height: .92;
  letter-spacing: -.055em;
}
.chapter .summary {
  max-width: 40rem;
  margin: 0;
  font-size: clamp(1.2rem, 2vw, 1.55rem);
  line-height: 1.5;
}

/* Icon constellation */
.constellation-block {
  margin-top: clamp(1.8rem, 3vw, 2.8rem);
  padding-top: clamp(1.8rem, 3vw, 2.8rem);
  border-top: 1px solid var(--rule);
}
.constellation {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-auto-rows: auto;
  grid-auto-flow: dense;
  gap: clamp(.6rem, 1vw, 1rem);
}
.star {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: .65rem;
  margin: 0;
  padding: clamp(1rem, 1.35vw, 1.25rem);
  border: 1px solid var(--rule);
  border-radius: 14px;
  background: color-mix(in srgb, var(--paper) 52%, transparent);
  color: var(--ink);
  font-family: inherit;
  text-align: left;
  text-decoration: none;
  overflow: hidden;
  transition: border-color .3s ease, background .3s ease, box-shadow .3s ease;
  container-type: inline-size;
}
.chapter.active .star { opacity: 1; transform: none; }
/* Editorial mosaics. The first card carries the chapter's main idea, while
   secondary cards close each six-column row without leaving holes. */
.star--sm, .star--wide, .star--tall, .star--lg, .star--row {
  grid-row: span 1;
}
.chapter .star {
  grid-column: span 6;
  grid-row: span 1;
}
/* Full-width feature cards use the same icon-led hierarchy as paired cards. */
.star--row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .65rem;
  padding-inline: clamp(1.1rem, 2vw, 1.6rem);
}
.star--row .star-label { font-size: clamp(1.05rem, 1.35vw, 1.2rem); }

.star::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 78% 18%, color-mix(in srgb, var(--rust) 14%, transparent), transparent 62%);
  opacity: 0;
  transition: opacity .3s ease;
  pointer-events: none;
}
.star:hover {
  border-color: color-mix(in srgb, var(--rust) 55%, var(--rule));
  box-shadow: 0 10px 26px rgba(38,50,41,.1);
}
.star:hover::after { opacity: 1; }
.star[href]::before {
  content: "↗";
  position: absolute;
  z-index: 3;
  top: .9rem;
  right: 1rem;
  color: var(--rust);
  font-size: 1rem;
  line-height: 1;
  opacity: .72;
  transform: none;
  transition: opacity .2s ease, transform .2s ease;
}
.star[href]:hover::before,
.star[href]:focus-visible::before {
  opacity: 1;
  transform: translate(.12rem, -.12rem);
}
.star[href]:focus-visible {
  outline: 2px solid var(--rust);
  outline-offset: 3px;
}
.star-label {
  position: relative;
  z-index: 1;
  font-size: clamp(1.05rem, 1.3vw, 1.22rem);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -.01em;
}
.star--lg .star-label, .star--tall .star-label {
  font-size: clamp(1.12rem, 1.45vw, 1.3rem);
}

.star-takeaway {
  position: relative;
  z-index: 1;
  margin: 0;
  color: color-mix(in srgb, var(--ink) 76%, var(--muted));
  font-size: clamp(.88rem, .98vw, .98rem);
  line-height: 1.42;
}
.math-highlights {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  width: 100%;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.math-highlight {
  min-width: 0;
  min-height: 4.2rem;
  display: grid;
  grid-template-columns: 2.25rem minmax(0, 1fr);
  align-items: center;
  gap: .65rem;
  padding: .75rem .65rem;
  overflow: hidden;
  background: transparent;
  transition: background .22s ease;
}
.math-highlight:hover {
  background: color-mix(in srgb, var(--rust) 5%, transparent);
}
.math-highlight--competitions { border-right: 1px solid var(--rule); }
.math-highlight--coursework {
  grid-column: 1 / -1;
  min-height: 6.3rem;
  grid-template-columns: 2.25rem minmax(0, 1fr);
  border-top: 1px solid var(--rule);
}
.math-highlight-icon {
  width: 2.25rem;
  height: 2.25rem;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--rust) 35%, var(--rule));
  border-radius: 50%;
  background: color-mix(in srgb, var(--paper) 72%, transparent);
}
.math-highlight-icon svg {
  width: 1.25rem;
  height: 1.25rem;
  fill: none;
  stroke: var(--rust);
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.math-highlight-copy,
.math-highlight-label,
.math-highlight-fact,
.math-feature { display: block; }
.math-highlight-copy { min-width: 0; }
.math-highlight-label {
  font: 400 clamp(.76rem, .86vw, .86rem)/1.3 "DM Mono", monospace;
}
.math-highlight-fact {
  margin-top: .2rem;
  color: color-mix(in srgb, var(--ink) 70%, var(--muted));
  font: 400 clamp(.7rem, .78vw, .78rem)/1.35 "DM Mono", monospace;
}
.math-subjects {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  margin-top: .48rem;
}
.math-subjects span {
  padding: .25rem .45rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  color: color-mix(in srgb, var(--ink) 78%, var(--muted));
  background: color-mix(in srgb, var(--paper) 68%, transparent);
  font: 400 clamp(.66rem, .72vw, .72rem)/1.1 "DM Mono", monospace;
}
.math-feature {
  margin-top: .55rem;
  color: var(--ink);
  font-size: clamp(.94rem, 1.08vw, 1.08rem);
  font-weight: 500;
  line-height: 1.35;
}
.math-feature span {
  margin-right: .35rem;
  color: color-mix(in srgb, var(--rust) 70%, var(--muted));
  font: 400 .66rem/1 "DM Mono", monospace;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.flat-highlights {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: 100%;
  border-top: 1px solid var(--rule);
}
.flat-highlight {
  min-width: 0;
  min-height: 4.5rem;
  display: grid;
  grid-template-columns: 2.25rem minmax(0, 1fr);
  align-items: center;
  gap: .65rem;
  padding: .75rem .65rem;
  border-bottom: 1px solid var(--rule);
  background: transparent;
  transition: background .22s ease;
}
.flat-highlight:nth-child(odd) { border-right: 1px solid var(--rule); }
.flat-highlight:last-child:nth-child(odd) {
  grid-column: 1 / -1;
  border-right: 0;
}
.flat-highlight:hover { background: color-mix(in srgb, var(--rust) 5%, transparent); }
.flat-highlight[href] {
  position: relative;
  color: inherit;
  text-decoration: none;
}
.flat-highlight[href]::after {
  content: "↗";
  position: absolute;
  top: .55rem;
  right: .65rem;
  color: var(--rust);
  font-size: .8rem;
  line-height: 1;
  opacity: .72;
  transform: none;
  transition: opacity .2s ease, transform .2s ease;
}
.flat-highlight[href]:hover::after,
.flat-highlight[href]:focus-visible::after {
  opacity: 1;
  transform: translate(.1rem, -.1rem);
}
.flat-highlight[href]:focus-visible {
  z-index: 3;
  outline: 2px solid var(--rust);
  outline-offset: -2px;
}
@container (max-width: 40rem) {
  .flat-highlights--adaptive { grid-template-columns: 1fr; }
  .flat-highlights--adaptive .flat-highlight { border-right: 0; }
  .flat-highlights--adaptive .flat-highlight:last-child:nth-child(odd) {
    grid-column: auto;
  }
}
.flat-highlight-icon {
  width: 2.25rem;
  height: 2.25rem;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--rust) 35%, var(--rule));
  border-radius: 50%;
  background: color-mix(in srgb, var(--paper) 72%, transparent);
}
.flat-highlight-icon svg {
  width: 1.25rem;
  height: 1.25rem;
  fill: none;
  stroke: var(--rust);
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.flat-highlight-copy,
.flat-highlight-label,
.flat-highlight-fact { display: block; }
.flat-highlight-copy { min-width: 0; }
.flat-highlight-label {
  font: 400 clamp(.76rem, .86vw, .86rem)/1.3 "DM Mono", monospace;
}
.flat-highlight-fact {
  margin-top: .25rem;
  color: color-mix(in srgb, var(--ink) 72%, var(--muted));
  font-size: clamp(.82rem, .92vw, .92rem);
  line-height: 1.4;
}
.flat-chips {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
}
.flat-chips { margin-top: .45rem; }
.flat-chips span {
  padding: .28rem .48rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  color: color-mix(in srgb, var(--ink) 78%, var(--muted));
  background: color-mix(in srgb, var(--paper) 68%, transparent);
  font: 400 clamp(.66rem, .72vw, .72rem)/1.25 "DM Mono", monospace;
}
.epilogue {
  position: relative;
  min-height: 100svh;
  display: grid;
  align-content: center;
  padding: clamp(5rem, 10vh, 8rem) clamp(1.25rem, 7vw, 8rem) clamp(4rem, 8vh, 6rem);
  overflow: hidden;
  border-top: 1px solid var(--rule);
  background: linear-gradient(to bottom, var(--paper-deep), var(--paper));
}
.epilogue::before {
  content: "";
  position: absolute;
  width: min(58vw, 52rem);
  aspect-ratio: 1;
  left: min(-21vw, -12rem);
  top: 50%;
  border: 1px solid color-mix(in srgb, var(--rust) 25%, transparent);
  border-radius: 50%;
  transform: translateY(-50%);
}
.epilogue-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr;
  align-items: start;
  gap: clamp(3.5rem, 7vw, 6rem);
  width: 100%;
  max-width: 78rem;
  margin: 0 auto;
}
.closing-card {
  max-width: 55rem;
}
.epilogue .kicker { margin: 0 0 2rem; }
.closing-marker {
  position: relative;
  width: clamp(2.8rem, 4vw, 3.6rem);
  height: clamp(2.8rem, 4vw, 3.6rem);
  margin-bottom: clamp(1.8rem, 4vh, 3rem);
  border: 1px solid var(--rust);
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
}
.closing-marker span {
  position: absolute;
  inset: 31%;
  border-radius: 50%;
  background: var(--rust);
}
.epilogue h2 {
  margin: 0;
  font-size: clamp(3.5rem, 7.4vw, 7rem);
  font-weight: 300;
  line-height: .86;
  letter-spacing: -.055em;
}
.synthesis {
  margin: clamp(2rem, 4vw, 3.2rem) 0 0;
  max-width: 43rem;
  color: var(--muted);
  font-size: clamp(1.2rem, 1.75vw, 1.5rem);
  line-height: 1.55;
}
.resource-directory {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border-block: 1px solid var(--rule);
}
.resource-group {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: .85rem;
  padding: 1.15rem 1rem 1.25rem;
  border-right: 1px solid var(--rule);
}
.resource-group:last-child { border-right: 0; }
.resource-group-head {
  min-height: 2.6rem;
  display: flex;
  align-items: center;
  gap: .6rem;
}
.resource-glyph {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 1.65rem;
  height: 1.65rem;
}
.resource-glyph svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: var(--rust);
  stroke-width: 1.45;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.resource-title {
  font: 400 .65rem/1.35 "DM Mono", monospace;
  letter-spacing: .085em;
  text-transform: uppercase;
}
.resource-destinations {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem .8rem;
}
.resource-destinations a {
  display: inline-flex;
  align-items: center;
  gap: .28rem;
  padding-block: .15rem;
  color: var(--muted);
  font: 400 .56rem/1.35 "DM Mono", monospace;
  letter-spacing: .04em;
  text-decoration-color: transparent;
  text-underline-offset: .22rem;
  text-transform: uppercase;
  transition: color .2s ease, text-decoration-color .2s ease;
}
.resource-destinations a span:last-child {
  color: var(--muted);
  font-size: .68rem;
  transition: color .2s ease, transform .2s ease;
}
.resource-destinations a:hover, .resource-destinations a:focus-visible {
  color: var(--rust);
  text-decoration-color: var(--rust);
}
.resource-destinations a:hover span:last-child,
.resource-destinations a:focus-visible span:last-child {
  color: var(--rust);
  transform: translate(.12rem, -.12rem);
}
.resource-destinations a:focus-visible { outline: 2px solid var(--rust); outline-offset: 3px; }
footer {
  display: flex;
  justify-content: space-between;
  margin: 0 clamp(1.25rem, 4vw, 4.5rem);
  padding: 1.5rem 0 2.5rem;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font: 300 .62rem/1 "DM Mono", monospace;
  letter-spacing: .1em;
  text-transform: uppercase;
}

/* The Atlas direction in dark mode. */
body[data-theme="dark"] {
  --paper: #0d1117;
  --paper-deep: #121923;
  --ink: #f3eee3;
  --muted: #99a7b7;
  --sage: #172a38;
  --sage-line: #355469;
  --rust: #f29a6f;
  --cursor-accent: #f29a6f;
  --rule: rgba(214, 229, 242, .18);
}
body[data-theme="dark"] .grain { opacity: .1; mix-blend-mode: screen; }
body[data-theme="dark"] .regional-context {
  opacity: .12;
  filter: saturate(.6) brightness(1.4);
}
body[data-theme="dark"] .land {
  fill: #234157;
  stroke: #5f8298;
  filter: drop-shadow(0 0 22px rgba(67, 143, 174, .18));
}
body[data-theme="dark"] .route,
body[data-theme="dark"] .route-progress,
body[data-theme="dark"] .route-traveler { filter: drop-shadow(0 0 5px rgba(255, 159, 110, .4)); }
body[data-theme="dark"] .place text { stroke: var(--paper-deep); }
body[data-theme="dark"] .star { background: color-mix(in srgb, var(--paper-deep) 70%, transparent); }
body[data-theme="dark"] .star-icon, body[data-theme="dark"] .resource-glyph { background: color-mix(in srgb, var(--paper) 60%, transparent); }
body[data-theme="dark"] .epilogue { background: linear-gradient(to bottom, #0a0f15, var(--paper)); }

@media (min-width: 1024px) {
  .place-5 text { transform: translate(12px, 8px); }
}

@media (max-width: 1023px) {
  .site-header {
    display: grid;
    grid-template-columns: auto 1fr;
    row-gap: 1rem;
  }
  .theme-picker {
    position: static;
    justify-self: end;
    transform: none;
  }
  .site-header nav {
    grid-column: 1 / -1;
    justify-content: space-between;
    width: 100%;
    padding-top: 1rem;
    border-top: 1px solid var(--rule);
  }
  .hero { padding-top: 9.5rem; }
  .hero h1 {
    max-width: 100%;
    font-size: clamp(3.2rem, 16.5vw, 4.75rem);
    line-height: .9;
  }
  .intro, .begin { margin-left: 0; }
  .hero-links { gap: 1rem; }
  .hero-links .begin {
    gap: .5rem;
    font-size: .62rem;
    letter-spacing: .08em;
    white-space: nowrap;
  }
  .placeholder-note { left: 1.25rem; right: auto; }
  .journey { display: block; }
  .atlas-stage {
    z-index: 20;
    height: 36svh;
    padding: 1.25rem;
    border-right: 0;
    border-bottom: 1px solid var(--rule);
    background: var(--paper-deep);
  }
  .map-wrap { inset: 15% 1.25rem 12%; }
  .chapters {
    position: relative;
    z-index: 1;
  }
  .place text, .place.visited text { font-size: 20px; opacity: 0; transition: none; }
  .place.active text { opacity: 1; }
  .place-5 text { transform: translate(-70px, 26px); }
  .atlas-caption { left: 1.25rem; right: 1.25rem; bottom: 1rem; }
  .chapters { padding: 0 1.5rem 18svh; }
  .chapter {
    min-height: auto;
    padding: 1rem 0 3rem;
    justify-content: flex-start;
  }
  .chapter + .chapter { padding-top: 1.5rem; }
  .chapter h2 { font-size: clamp(2.6rem, 12vw, 4rem); }
  .constellation-block {
    margin-top: 2rem;
    padding-top: 2rem;
  }
  /* Full-width cards keep the compact subtext readable on mobile. */
  .constellation {
    grid-template-columns: 1fr;
    grid-auto-rows: minmax(6.2rem, auto);
    gap: .7rem;
  }
  .star--sm, .star--wide, .star--tall, .star--lg, .star--row {
    grid-column: span 1 !important;
    grid-row: span 1 !important;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: .55rem;
  }
  .star--row .star-label { font-size: 1.12rem; }
  .star-label { font-size: 1.05rem; }
  .star--lg .star-label, .star--tall .star-label { font-size: 1.12rem; }
  .math-highlights { grid-template-columns: 1fr; }
  .math-highlight--coursework { grid-column: auto; }
  .math-highlight {
    min-height: 3.85rem;
    align-items: start;
  }
  .math-highlight + .math-highlight { border-top: 1px solid var(--rule); }
  .math-highlight--competitions { border-right: 0; }
  .math-highlight-icon { margin-top: .05rem; }
  .math-highlight--coursework { min-height: 6.25rem; }
  .math-highlight-label { font-size: .8rem; }
  .math-highlight-fact { font-size: .74rem; }
  .math-subjects span { font-size: .68rem; }
  .flat-highlights { grid-template-columns: 1fr; }
  .flat-highlight {
    min-height: 4rem;
    align-items: start;
    border-right: 0 !important;
  }
  .flat-highlight-icon { margin-top: .05rem; }
  .flat-highlight-label { font-size: .8rem; }
  .flat-highlight-fact { font-size: .84rem; }
  .flat-chips span { font-size: .68rem; }
  .epilogue {
    min-height: auto;
    padding: 5rem 1.5rem 4rem;
  }
  .epilogue::before {
    width: 34rem;
    left: -25rem;
    top: 18rem;
  }
  .epilogue-inner {
    grid-template-columns: 1fr;
    gap: 4.5rem;
  }
  .epilogue h2 { font-size: clamp(3.5rem, 16vw, 5.2rem); }
  .synthesis { font-size: 1.18rem; }
  .resource-directory {
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .resource-group-head { min-height: auto; }
  .resource-group {
    border-right: 1px solid var(--rule);
    border-bottom: 1px solid var(--rule);
  }
  .resource-group:nth-child(even) { border-right: 0; }
  .resource-group:nth-last-child(-n + 2) { border-bottom: 0; }
  .resource-group:last-child {
    grid-column: 1 / -1;
    border-right: 0;
  }
  footer { gap: 1rem; }
}

@media (max-width: 700px) {
  .resource-directory { grid-template-columns: 1fr; }
  .resource-group,
  .resource-group:nth-child(even),
  .resource-group:last-child {
    grid-column: auto;
    border-right: 0;
    border-bottom: 1px solid var(--rule);
  }
  .resource-group:last-child { border-bottom: 0; }
  .resource-destinations a {
    font-size: .62rem;
    letter-spacing: .08em;
  }
}

@media (max-width: 460px) {
  .resource-title { font-size: .72rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .cursor-light, .cursor-lens { display: none; }
  .route-progress { stroke-dashoffset: 0; }
  .traveler-halo { display: none; }
  .chapter { opacity: 1; transform: none; }
  .moment, .star { opacity: 1; transform: none; transition: none; }
}
