:root {
  --ink: #f7ead5;
  --muted: #cbbdad;
  --gold: #ffad4a;
  --blue: #ffbf74;
  --line: #3f3030;
  --surface: #211a20;
  --bg: #121016;
  --edge: clamp(20px, 4vw, 66px);
  --display: Georgia, 'Times New Roman', serif;
}

body { overflow-wrap: anywhere; }
header, footer { background: #151219; }
body:has(#academy:not([hidden])) header {
  position: absolute;
  inset: 0 0 auto;
  z-index: 1;
  background: #141017b3;
  border-color: #f7ead52b;
}
header .bar {
  width: min(1680px, calc(100% - 2 * var(--edge)));
  gap: 12px 24px;
  min-height: 75px;
}
.brand {
  font: 700 clamp(19px, 2.2vw, 31px)/1.08 var(--display);
  gap: 15px;
}
.brand .mark {
  width: 3px;
  height: 31px;
  clip-path: none;
  font-size: 0;
  flex: none;
}
.brand small { font: 700 0.65rem/1.1 'Segoe UI', sans-serif; letter-spacing: 0.12em; }
.top-nav {
  gap: 12px clamp(14px, 3vw, 45px);
  font: 400 clamp(14px, 1.6vw, 21px)/1.1 var(--display);
}
.top-nav .external { font: inherit; }
.top-nav a { position: relative; padding: 4px 0; }
.top-nav a[aria-current='page']::after {
  content: '';
  position: absolute;
  inset: auto 0 -8px;
  height: 2px;
  background: var(--gold);
}
h1, h2, h3 { font-family: var(--display); }
main:has(> #academy:not([hidden])) { width: 100%; }
main > #academy { padding-top: 0; }

.academy-hero {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: 1fr;
  align-items: end;
  min-height: clamp(570px, 47vw, 765px);
  padding: 125px var(--edge) clamp(37px, 5vw, 74px);
  border: 0;
  border-radius: 0;
  background: #1a1319;
}
.academy-visual {
  position: absolute;
  z-index: -1;
  inset: 0;
  background: url('/night-station.webp') right bottom / cover no-repeat;
}
.academy-hero::after {
  content: '';
  position: absolute;
  z-index: -1;
  inset: 0;
  background:
    linear-gradient(90deg, #140f15ef 0%, #140f15b8 29%, #140f1530 56%, transparent 75%),
    linear-gradient(0deg, #121016 0%, transparent 16%);
}
.academy-intro {
  width: min(51%, 755px);
  padding: 0;
}
.academy-intro h1 {
  margin: 0 0 12px;
  font-size: clamp(42px, 5.2vw, 86px);
  line-height: 1.01;
  letter-spacing: -0.045em;
  text-wrap: balance;
}
.academy-intro h1::after {
  content: '';
  display: block;
  width: 75px;
  height: 5px;
  margin-top: 18px;
  background: var(--gold);
}
.academy-intro > .kicker { color: #ffe0ad; }
.academy-intro > p:not(.kicker) { max-width: 48ch; color: var(--ink); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.academy-start {
  justify-content: center;
  min-height: 50px;
  padding: 9px clamp(15px, 2vw, 32px);
  border: 1px solid var(--gold);
  border-radius: 8px;
  background: var(--gold);
  color: #20110a;
  font: 700 clamp(16px, 1.55vw, 23px)/1.2 var(--display);
}
.academy-start:hover { background: #ffcb85; }
.academy-start.secondary { background: #19131ce3; color: var(--ink); }
.academy-start.secondary:hover { background: #483124; }
.course-heading { margin: clamp(22px, 4vw, 52px) 0 0; }
.course-heading h2 { font-size: clamp(22px, 2vw, 32px); letter-spacing: -0.02em; }
.course-heading .sub { max-width: 46ch; margin-bottom: 11px; }
.hero-topics { margin: 0; }
.hero-topics a, .course-tools a {
  border-color: #6d5547;
  background: #221923;
  color: var(--ink);
  font-size: 0.9rem;
}
.hero-topics a:hover, .course-tools a:hover { background: #483124; }

.course-content {
  width: min(1680px, calc(100% - clamp(32px, 4vw, 66px)));
  margin: 0 auto;
  padding-top: clamp(14px, 2vw, 30px);
}
.course-unit h3 { font-size: 1.25rem; }
.course-unit + .course-unit { margin-top: 28px; }
.course-unit.featured > h3 {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.course-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(12px, 1.45vw, 24px); }
.course-link {
  border-color: var(--line);
  background: var(--surface);
}
.course-link:hover { border-color: var(--gold); background: #301f25; }
.course-label span { color: var(--muted); }
.course-arrow { display: none; }
.featured .course-link {
  display: grid;
  position: relative;
  isolation: isolate;
  min-height: clamp(190px, 17vw, 310px);
  padding: clamp(17px, 2.1vw, 33px);
  align-items: end;
  grid-template-columns: minmax(0, 1fr);
  background: #1a1419;
  overflow: hidden;
}
.featured .course-thumb {
  position: absolute;
  z-index: -2;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 0;
  background-size: cover;
  background-position: center;
}
.featured .course-link::before {
  content: '';
  position: absolute;
  z-index: -1;
  inset: 0;
  background: linear-gradient(0deg, #1b101a 0%, #1b101ab0 26%, #1b101a10 68%);
}
.course-traffic { background-image: url('/lesson-traffic-cinematic.jpg'); }
.course-detention { background-image: url('/lesson-detention-cinematic.jpg'); }
.course-search { background-image: url('/lesson-search-gameplay.webp'); }
.featured .course-detention { background-size: 170%; background-position: 45% bottom; }
.featured .course-search { background-position: 64% center; }
.featured .course-label strong { font: 700 clamp(22px, 2.75vw, 40px)/1.13 var(--display); }
.featured .course-label strong::after {
  content: '';
  display: block;
  width: 50px;
  height: 4px;
  margin: 8px 0 5px;
  background: var(--gold);
}
.featured .course-label span { font-size: 0.88rem; color: #f4dec5; }

.lesson-banner, .step, .term-list .term, .quiz-question {
  border-color: var(--line);
}
.lesson-banner, .step, .term-list .term { background: var(--surface); }

body:has(#leadership:not([hidden])) { background: #0b121e; }
#leadership { color: #eaf0fa; }
#leadership :is(h2, h3) { font-family: 'Segoe UI', system-ui, sans-serif; }
#leadership > .sub, #leadership .back { color: #b9cbe1; }
.leader-info { padding: 16px 17px; border-top-width: 1px; }
.leader-info h3 { font-size: 1.125rem; line-height: 1.3; }
.leader-info p:last-child { font-size: 0.9rem; line-height: 1.55; }

@media (max-width: 980px) {
  .academy-intro { width: min(65%, 570px); }
  .featured .course-link { min-height: 190px; }
}
@media (max-width: 690px) {
  body:has(#academy:not([hidden])) header { position: static; }
  header .bar { padding: 14px 0 18px; }
  .top-nav { row-gap: 8px; }
  .top-nav a[aria-current='page']::after { bottom: -4px; }
  .academy-hero { min-height: 0; padding: 28px var(--edge) 15px; }
  .academy-intro { display: contents; }
  .academy-start { padding-inline: 11px; }
  .hero-actions { gap: 8px; }
  .course-heading { order: 2; margin-top: 14px; }
  .academy-visual {
    position: relative;
    z-index: auto;
    order: 1;
    min-height: 0;
    height: clamp(175px, 52vw, 300px);
    margin: 10px calc(-1 * var(--edge)) 0;
    background-image:
      linear-gradient(180deg, #1a1319 0%, #1a131900 25%, #1a131900 88%, #1a1319 100%),
      url('/night-station.webp');
  }
  .academy-hero::after { display: none; }
  .course-grid { grid-template-columns: 1fr; }
  .featured .course-link { min-height: clamp(180px, 48vw, 305px); }
}
