:root {
  --navy: #1b3a5c;
  --teal: #2a7a7a;
  --teal-light: #e6f4f4;
  --teal-mid: #b8d9d9;
  --gold: #9a6f00;
  --gold-light: #fdf6e3;
  --slate: #4a5568;
  --mist: #f7f9fb;
  --rule: #dde4ec;
  --white: #ffffff;
  --text: #2d3748;
  --text-light: #5a6a7e;
  --code-bg: #f0f4f8;
  --shadow-sm: 0 1px 4px rgba(27,58,92,0.07);
  --shadow-md: 0 4px 16px rgba(27,58,92,0.10);
  --radius: 6px;
  --font-body: 'DM Sans', sans-serif;
  --font-serif: 'Lora', Georgia, serif;
  --font-mono: 'Source Code Pro', monospace;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--mist);
  line-height: 1.75;
}

/* ── SIDEBAR NAV ─────────────────────────────── */

#sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 240px;
  height: 100vh;
  background: var(--navy);
  overflow-y: auto;
  padding: 28px 0 40px;
  z-index: 100;
  transition: transform 0.3s ease;
}

#sidebar .brand {
  padding: 0 20px 24px;
  border-bottom: 1px solid rgba(255,255,255,0.12);
  margin-bottom: 16px;
}

#sidebar .brand .course-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--teal-mid);
  text-transform: uppercase;
  margin-bottom: 6px;
}

#sidebar .brand h2 {
  font-family: var(--font-serif);
  font-size: 14px;
  color: var(--white);
  font-weight: 600;
  line-height: 1.4;
}

#sidebar nav a {
  display: block;
  padding: 7px 20px;
  font-size: 13px;
  color: rgba(255,255,255,0.65);
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: all 0.15s;
  line-height: 1.4;
}

#sidebar nav a:hover,
#sidebar nav a.active {
  color: var(--white);
  background: rgba(255,255,255,0.06);
  border-left-color: var(--teal-mid);
}

#sidebar nav .nav-section {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.3);
  padding: 16px 20px 4px;
}

#sidebar nav a.unit-link {
  font-weight: 500;
  color: rgba(255,255,255,0.8);
}

#sidebar nav a.sub-link {
  padding-left: 32px;
  font-size: 12px;
}

/* ── MAIN CONTENT ────────────────────────────── */

#main {
  margin-left: 240px;
  min-height: 100vh;
}

/* ── HERO ────────────────────────────────────── */

#hero {
  background: linear-gradient(135deg, var(--navy) 0%, #2a4a6e 55%, var(--teal) 100%);
  padding: 80px 64px 72px;
  position: relative;
  overflow: hidden;
}

#hero::before {
  content: '';
  position: absolute;
  top: -40px;
  right: -40px;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: rgba(42,122,122,0.18);
  pointer-events: none;
}

#hero::after {
  content: '';
  position: absolute;
  bottom: -60px;
  left: 200px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: rgba(255,255,255,0.04);
  pointer-events: none;
}

#hero .eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--teal-mid);
  margin-bottom: 16px;
}

#hero h1 {
  font-family: var(--font-serif);
  font-size: clamp(28px, 4vw, 44px);
  color: var(--white);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 12px;
}

#hero .subtitle {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 18px;
  color: rgba(255,255,255,0.72);
  margin-bottom: 40px;
}

#hero .meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  max-width: 720px;
}

#hero .meta-card {
  background: rgba(255,255,255,0.09);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: var(--radius);
  padding: 14px 18px;
}

#hero .meta-card .label {
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--teal-mid);
  margin-bottom: 4px;
  font-family: var(--font-mono);
}

#hero .meta-card .value {
  font-size: 14px;
  color: var(--white);
  font-weight: 500;
}

/* ── CONTENT SECTIONS ────────────────────────── */

.content-wrap {
  max-width: 860px;
  padding: 56px 64px;
}

section {
  margin-bottom: 72px;
}

h2.section-title {
  font-family: var(--font-serif);
  font-size: 26px;
  color: var(--navy);
  font-weight: 700;
  margin-bottom: 8px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--teal);
  display: flex;
  align-items: center;
  gap: 12px;
}

h2.section-title .section-icon {
  width: 32px;
  height: 32px;
  background: var(--teal);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: white;
  flex-shrink: 0;
}

h3.subsection {
  font-family: var(--font-serif);
  font-size: 19px;
  color: var(--teal);
  font-weight: 600;
  margin: 36px 0 12px;
}

h4.session-title {
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  color: var(--gold);
  margin: 28px 0 8px;
  letter-spacing: 0.01em;
}

p {
  margin-bottom: 16px;
  font-size: 15.5px;
  color: var(--text);
}

p:last-child {
  margin-bottom: 0;
}

em.note {
  display: block;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 14.5px;
  color: var(--text-light);
  border-left: 3px solid var(--teal-mid);
  padding: 10px 16px;
  margin: 16px 0;
  background: var(--teal-light);
  border-radius: 0 var(--radius) var(--radius) 0;
}

ul, ol {
  margin: 8px 0 16px 0;
  padding-left: 22px;
}

li {
  font-size: 15.5px;
  margin-bottom: 7px;
  color: var(--text);
}

li::marker {
  color: var(--teal);
}

ol li::marker {
  color: var(--navy);
  font-weight: 600;
}

ul.sub {
  margin-top: 6px;
}

ul.sub li {
  font-size: 14.5px;
  color: var(--text-light);
}

/* ── BOXES ───────────────────────────────────── */

.box {
  border-radius: var(--radius);
  padding: 20px 24px;
  margin: 20px 0;
}

.box-teal {
  background: var(--teal-light);
  border: 1px solid var(--teal-mid);
}

.box-gold {
  background: var(--gold-light);
  border: 1px solid #e6cc8a;
}

.box-mist {
  background: var(--mist);
  border: 1px solid var(--rule);
}

.box-navy {
  background: #eef2f7;
  border: 1px solid #c8d4e4;
}

.box .box-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 10px;
}

.box-teal .box-label { color: var(--teal); }
.box-gold .box-label { color: var(--gold); }
.box-mist .box-label { color: var(--slate); }
.box-navy .box-label { color: var(--navy); }

/* ── CO CARDS ────────────────────────────────── */

.co-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 20px 0;
}

.co-card {
  border-radius: var(--radius);
  padding: 18px 20px;
  border: 1px solid transparent;
}

.co-card:nth-child(odd) {
  background: var(--teal-light);
  border-color: var(--teal-mid);
}

.co-card:nth-child(even) {
  background: var(--gold-light);
  border-color: #e6cc8a;
}

.co-card .co-id {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  margin-bottom: 6px;
  letter-spacing: 0.06em;
}

.co-card:nth-child(odd) .co-id  { color: var(--teal); }
.co-card:nth-child(even) .co-id { color: var(--gold); }

.co-card p {
  font-size: 14px;
  margin: 0;
}

/* ── UNIT HEADER BANNER ──────────────────────── */

.unit-banner {
  background: linear-gradient(120deg, var(--navy) 0%, #2d5080 100%);
  border-radius: var(--radius);
  padding: 28px 32px;
  margin-bottom: 28px;
  position: relative;
  overflow: hidden;
}

.unit-banner::after {
  content: '';
  position: absolute;
  right: -20px;
  top: -20px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: rgba(42,122,122,0.2);
}

.unit-banner .unit-number {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--teal-mid);
  margin-bottom: 6px;
}

.unit-banner h2 {
  font-family: var(--font-serif);
  font-size: 22px;
  color: var(--white);
  font-weight: 700;
  margin-bottom: 8px;
  border: none;
  padding: 0;
}

.unit-banner .unit-question {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 14.5px;
  color: rgba(255,255,255,0.68);
  margin-bottom: 14px;
}

.unit-banner .unit-meta {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.unit-banner .unit-meta span {
  font-size: 12px;
  color: rgba(255,255,255,0.75);
  background: rgba(255,255,255,0.1);
  padding: 4px 12px;
  border-radius: 20px;
  font-weight: 500;
}

/* ── SESSION CARDS ───────────────────────────── */

.session-card {
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  margin-bottom: 20px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.session-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  background: var(--white);
  cursor: pointer;
  border-bottom: 1px solid var(--rule);
  user-select: none;
}

.session-header:hover {
  background: #f9fbfd;
}

.session-num {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--white);
  background: var(--teal);
  padding: 3px 9px;
  border-radius: 4px;
  flex-shrink: 0;
  letter-spacing: 0.05em;
}

.session-header h4 {
  font-size: 15px;
  font-weight: 600;
  color: var(--navy);
  flex: 1;
}

.session-toggle {
  font-size: 18px;
  color: var(--teal);
  transition: transform 0.2s;
  flex-shrink: 0;
}

.session-card.open .session-toggle {
  transform: rotate(180deg);
}

.session-body {
  display: none;
  padding: 20px 24px;
  background: var(--white);
}

.session-card.open .session-body {
  display: block;
}

/* ── OVERVIEW TABLE ──────────────────────────── */

.overview-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  margin: 20px 0;
  box-shadow: var(--shadow-sm);
  border-radius: var(--radius);
  overflow: hidden;
}

.overview-table th {
  background: var(--navy);
  color: var(--white);
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.04em;
}

.overview-table td {
  padding: 11px 16px;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
  line-height: 1.5;
}

.overview-table tr:nth-child(even) td {
  background: var(--teal-light);
}

.overview-table tr:last-child td {
  border-bottom: none;
}

.overview-table td:first-child {
  font-weight: 600;
  color: var(--teal);
  white-space: nowrap;
}

/* ── SESSION SUMMARY TABLE ───────────────────── */

.session-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  margin: 16px 0;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.session-table th {
  background: var(--teal);
  color: var(--white);
  padding: 10px 14px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
}

.session-table td {
  padding: 9px 14px;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}

.session-table tr:nth-child(even) td {
  background: #f5f8fb;
}

.session-table tr:last-child td {
  border-bottom: none;
}

.session-table td:first-child {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--teal);
}

/* ── ASSESSMENT TABLE ────────────────────────── */

.assess-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  margin: 20px 0;
  box-shadow: var(--shadow-sm);
  border-radius: var(--radius);
  overflow: hidden;
}

.assess-table th {
  background: var(--navy);
  color: white;
  padding: 11px 16px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
}

.assess-table td {
  padding: 11px 16px;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}

.assess-table tr:nth-child(even) td {
  background: #f5f8fb;
}

.assess-table tr:last-child td {
  border-bottom: none;
}

.assess-table .weight {
  font-weight: 700;
  color: var(--navy);
}

.assess-table .co-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 10px;
  background: var(--teal-light);
  color: var(--teal);
  border: 1px solid var(--teal-mid);
  border-radius: 4px;
  padding: 1px 6px;
  margin-right: 4px;
}

/* ── FOOTER ──────────────────────────────────── */

footer {
  background: var(--navy);
  color: rgba(255,255,255,0.5);
  text-align: center;
  padding: 28px;
  font-size: 13px;
  margin-left: 0;
}

footer strong {
  color: rgba(255,255,255,0.8);
}

/* ── PRINT ───────────────────────────────────── */

@media print {
  #sidebar { display: none; }
  #main { margin-left: 0; }
  .session-body { display: block !important; }
  .unit-banner { background: var(--navy) !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ── RESPONSIVE ──────────────────────────────── */

@media (max-width: 900px) {
  #sidebar { transform: translateX(-240px); }
  #sidebar.open { transform: translateX(0); }
  #main { margin-left: 0; }
  .content-wrap { padding: 32px 24px; }
  #hero { padding: 48px 24px; }
  .co-grid { grid-template-columns: 1fr; }
  #hamburger { display: flex; }
}

/* ── HAMBURGER ───────────────────────────────── */

#hamburger {
  display: none;
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 200;
  background: var(--navy);
  border: none;
  border-radius: 6px;
  padding: 8px 10px;
  cursor: pointer;
  flex-direction: column;
  gap: 4px;
}

#hamburger span {
  display: block;
  width: 20px;
  height: 2px;
  background: white;
  border-radius: 2px;
}
