:root {
  --page-bg: #f4f7f8;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --text: #182230;
  --muted: #667085;
  --border: #e4e7ec;
  --navy: #0b1b31;
  --navy-dark: #07111f;
  --accent: #35d8ff;
  --accent-bright: #b8f34a;
  --accent-soft: #e9faff;
  --accent-border: #bfe3eb;
  --shadow-sm: 0 1px 3px rgba(16, 24, 40, 0.08);
  --shadow-md: 0 14px 36px rgba(16, 24, 40, 0.11);
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 26px;
  --content-width: 1120px;
}

body.course-ap {
  --accent: #b8f34a;
  --accent-bright: #35d8ff;
  --accent-soft: #f3f9df;
  --accent-border: #d4e5a8;
}

body.course-pdd {
  --accent: #80aee3;
  --accent-bright: #35d8ff;
  --accent-soft: #edf3fb;
  --accent-border: #c9d7ea;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
  background:
    radial-gradient(circle at 8% 15%, color-mix(in srgb, var(--accent) 15%, transparent), transparent 28rem),
    linear-gradient(rgba(11, 27, 49, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(11, 27, 49, 0.025) 1px, transparent 1px),
    var(--page-bg);
  background-size: auto, 32px 32px, 32px 32px, auto;
}

a { color: inherit; }

.skip-link {
  position: absolute;
  top: -60px;
  left: 16px;
  z-index: 999;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--text);
  color: #fff;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid rgba(228, 231, 236, 0.9);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(14px);
}

.header-inner {
  width: min(calc(100% - 32px), var(--content-width));
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 0 auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  text-decoration: none;
}

.brand-mark {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: grid;
  place-items: center;
  border: 2px solid var(--navy-dark);
  border-radius: 13px;
  background: var(--accent);
  box-shadow: 4px 4px 0 var(--navy-dark);
  color: var(--navy-dark);
  font-weight: 900;
  transform: rotate(-2deg);
}

.brand strong, .brand span { display: block; }
.brand strong { font-size: .96rem; }
.brand span { color: var(--muted); font-size: .77rem; }

.header-nav { display: flex; gap: 6px; }
.header-nav a {
  padding: 9px 11px;
  border-radius: 10px;
  color: #344054;
  font-size: .88rem;
  font-weight: 700;
  text-decoration: none;
}
.header-nav a:hover { background: var(--accent-soft); }

.page-shell {
  width: min(calc(100% - 32px), var(--content-width));
  margin: 0 auto;
  padding: 34px 0 64px;
}

.course-hero {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(255px, .65fr);
  gap: 34px;
  align-items: center;
  padding: clamp(30px, 5vw, 54px);
  border-radius: var(--radius-lg);
  color: #fff;
  background:
    linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px),
    linear-gradient(135deg, var(--navy-dark), #123b67);
  background-size: 34px 34px, 34px 34px, auto;
  box-shadow: var(--shadow-md);
}

.course-hero::after {
  content: "";
  position: absolute;
  width: 290px;
  height: 290px;
  right: -105px;
  top: -115px;
  border: 46px solid color-mix(in srgb, var(--accent) 22%, transparent);
  border-radius: 999px;
}

.hero-copy, .schedule-card { position: relative; z-index: 1; }
.eyebrow, .section-kicker {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(2.2rem, 5vw, 4.2rem);
  line-height: 1;
  letter-spacing: -.05em;
}

.hero-description {
  max-width: 690px;
  margin: 19px 0 0;
  color: #c8d4e2;
  font-size: 1.02rem;
}

.schedule-card {
  padding: 22px;
  border: 1px solid color-mix(in srgb, var(--accent) 42%, transparent);
  border-radius: var(--radius-md);
  background: rgba(5, 16, 30, .8);
}
.schedule-card span { color: var(--accent); font-size: .75rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.schedule-card strong { display: block; margin-top: 8px; font-size: 1.15rem; }
.schedule-card p { margin: 7px 0 0; color: #bfcbd8; font-size: .87rem; }

.section { margin-top: 44px; scroll-margin-top: 90px; }
.section-heading { margin-bottom: 17px; }
.section-heading h2 { margin: 0; font-size: clamp(1.55rem, 4vw, 2.15rem); letter-spacing: -.035em; }
.section-heading p:last-child { max-width: 680px; margin: 6px 0 0; color: var(--muted); }

.latest-card {
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(200px, .55fr) minmax(0, 1.45fr);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

.latest-visual {
  min-height: 270px;
  display: grid;
  place-items: center;
  padding: 28px;
  color: #fff;
  background:
    linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px),
    linear-gradient(135deg, #123b67, var(--navy));
  background-size: 26px 26px, 26px 26px, auto;
}

.play-mark {
  width: 82px;
  height: 82px;
  display: grid;
  place-items: center;
  border: 3px solid var(--navy-dark);
  border-radius: 24px;
  background: var(--accent);
  box-shadow: 7px 7px 0 var(--navy-dark);
  color: var(--navy-dark);
  font-size: 2rem;
  font-weight: 900;
}

.latest-copy { padding: clamp(25px, 4vw, 40px); }
.status-badge, .topic-tag {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: #176378;
  font-size: .73rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}
body.course-ap .status-badge, body.course-ap .topic-tag { color: #536a16; }
body.course-pdd .status-badge, body.course-pdd .topic-tag { color: #355f8f; }
.latest-copy h2 { margin: 14px 0 7px; font-size: clamp(1.45rem, 3vw, 2rem); line-height: 1.15; }
.recording-meta { color: var(--muted); font-size: .86rem; font-weight: 700; }
.latest-copy > p { margin: 14px 0 0; color: #475467; }

.button-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 23px; }
.button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 11px;
  font-weight: 760;
  text-decoration: none;
}
.button-primary { background: var(--navy); color: #fff; box-shadow: 3px 3px 0 var(--accent); }
.button-secondary { border-color: var(--border); background: #fff; color: #344054; }
.button:hover { transform: translateY(-1px); }

.recording-list { display: grid; gap: 13px; }
.recording-card {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 18px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.recording-number {
  min-height: 62px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--accent-soft);
  color: var(--navy);
  font-size: 1.05rem;
  font-weight: 900;
}
.recording-copy h3 { margin: 0 0 4px; font-size: 1rem; }
.recording-copy p { margin: 6px 0 0; color: var(--muted); font-size: .87rem; }
.recording-actions { display: flex; gap: 8px; }
.text-link { padding: 9px 11px; border-radius: 10px; color: #087e99; font-size: .84rem; font-weight: 800; text-decoration: none; white-space: nowrap; }
.text-link:hover { background: var(--accent-soft); }

.help-note {
  display: flex;
  gap: 13px;
  align-items: flex-start;
  padding: 18px 20px;
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-md);
  background: var(--accent-soft);
}
.help-note strong { display: block; margin-bottom: 3px; }
.help-note p { margin: 0; color: #475467; font-size: .9rem; }

/* Course information pages */
.info-hero {
  grid-template-columns: minmax(0, 1.45fr) minmax(240px, .55fr);
}

.info-hero .schedule-card strong {
  font-size: 1.05rem;
}

.info-grid {
  display: grid;
  gap: 16px;
}

.info-panel {
  overflow: hidden;
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.info-panel summary {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 72px;
  padding: 18px 54px 18px 20px;
  cursor: pointer;
  list-style: none;
  font-size: 1.08rem;
  font-weight: 800;
}

.info-panel summary::-webkit-details-marker { display: none; }

.info-panel summary::after {
  content: "+";
  position: absolute;
  right: 20px;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--accent-soft);
  color: var(--navy);
  font-size: 1.2rem;
  line-height: 1;
}

.info-panel[open] summary {
  border-bottom: 1px solid var(--accent-border);
  background: var(--accent-soft);
}

.info-panel[open] summary::after { content: "−"; }

.info-icon {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  display: grid;
  place-items: center;
  border: 2px solid var(--navy-dark);
  border-radius: 11px;
  background: var(--accent);
  color: var(--navy-dark);
  font-size: .78rem;
  font-weight: 900;
}

.info-content {
  padding: 22px;
  color: #475467;
}

.info-content > :first-child { margin-top: 0; }
.info-content > :last-child { margin-bottom: 0; }
.info-content h3 { margin: 24px 0 8px; color: var(--text); font-size: 1rem; }
.info-content ul { margin: 10px 0; padding-left: 22px; }
.info-content li + li { margin-top: 7px; }

.policy-placeholder {
  padding: 15px 17px;
  border-left: 4px solid var(--accent);
  border-radius: 0 10px 10px 0;
  background: var(--surface-soft);
}

.table-wrap {
  overflow-x: auto;
  margin-top: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.gradebook-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 620px;
  color: #344054;
  font-size: .9rem;
}

.gradebook-table th,
.gradebook-table td {
  padding: 13px 15px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.gradebook-table th {
  background: var(--accent-soft);
  color: var(--text);
  font-size: .78rem;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.gradebook-table tr:last-child td { border-bottom: 0; }

.back-row {
  display: flex;
  justify-content: flex-start;
  margin-top: 26px;
}

.footer { margin-top: 54px; padding-top: 25px; border-top: 1px solid var(--border); color: var(--muted); font-size: .84rem; }
.footer-inner { display: flex; justify-content: space-between; gap: 20px; }

@media (max-width: 800px) {
  .course-hero, .latest-card, .info-hero { grid-template-columns: 1fr; }
  .latest-visual { min-height: 190px; }
  .recording-card { grid-template-columns: 68px minmax(0, 1fr); }
  .recording-actions { grid-column: 2; }
}

@media (max-width: 600px) {
  .header-inner, .page-shell { width: min(calc(100% - 22px), var(--content-width)); }
  .header-nav a:not(:first-child), .brand span { display: none; }
  .page-shell { padding-top: 18px; }
  .course-hero { padding: 27px 22px; border-radius: 20px; }
  .recording-card { grid-template-columns: 1fr; }
  .recording-number { min-height: 48px; place-items: center start; padding: 0 14px; }
  .recording-actions { grid-column: 1; flex-wrap: wrap; }
  .button-row { flex-direction: column; }
  .footer-inner { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
