/* ============================================================
   THE CROSSROADS CARMEL SOCIAL ACADEMY
   Hearst · The Social Studio brand alignment.

   Aesthetic: Bold poster-style display + clean modern body.
   Cream paper / deep navy ink / apricot+copper accents.
   Tight letter-spacing on headlines, all-caps display
   moves on big-type sections.

   Type: Barlow Condensed (display, 700/800/900 — bold
   condensed sans, the Social Studio signature) + Inter
   (body, 400-700 — clean modern body) + JetBrains Mono
   (code).
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:ital,wght@0,500;0,600;0,700;0,800;0,900;1,700;1,800&family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;700&display=swap');

:root {
    /* ---- Coastal Editorial palette ---- */
    --cream:        #FAF6EC;   /* paper background */
    --cream-deep:   #F2EBD7;   /* card / panel slightly recessed */
    --cream-shadow: #E6DDC2;   /* warmer recess for depth */
    --ink:          #16263A;   /* deep navy body text — Hearst-deck navy, deeper */
    --ink-soft:     #3A4F66;   /* secondary text */
    --ink-muted:    #6A7989;   /* labels, captions */
    --apricot:      #E68B3A;   /* primary accent — Social Studio orange */
    --apricot-deep: #B85F1F;   /* hover, deeper accent */
    --apricot-glow: #F4B16A;   /* subtle highlight */
    --rust:         #8C3F1A;   /* deep accent for emphasis runs */
    --sage:         #5B7A6E;   /* tertiary accent — coastal sage */
    --gold:         #B89042;   /* warm gold for callout numerals */
    --line:         #C9BFA3;   /* warm hairline rule */
    --line-soft:    #DACE9F;
    --paper-tint:   rgba(232,139,58,0.045); /* whisper of orange paper */

    /* Legacy variable shims (so any existing references still work) */
    --bg-primary: var(--cream);
    --bg-secondary: var(--cream-deep);
    --bg-tertiary: var(--cream-shadow);
    --bg-hover: var(--cream-shadow);
    --text-primary: var(--ink);
    --text-secondary: var(--ink-soft);
    --text-muted: var(--ink-muted);
    --accent-orange: var(--apricot);
    --accent-orange-dim: var(--apricot-deep);
    --accent-orange-bright: var(--apricot-glow);
    --accent-gold: var(--gold);
    --accent-blue: var(--sage);
    --accent-teal: var(--sage);
    --border-color: var(--line);
    --code-bg: #2A1F0E;
    --table-row-alt: #F6EFD9;
    --link-color: var(--apricot-deep);
    --link-hover: var(--rust);
    --success: #5B7A6E;
    --warning: var(--apricot);
    --danger: var(--rust);
    --sidebar-width: 300px;

    /* Type stack — Social Studio brand */
    --font-display: 'Barlow Condensed', 'Arial Narrow', Impact, sans-serif;
    --font-body:    'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
    --font-mono:    'JetBrains Mono', ui-monospace, Menlo, Monaco, monospace;
}

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

body {
    font-family: var(--font-body);
    font-weight: 400;
    background-color: var(--cream);
    color: var(--ink);
    line-height: 1.6;
    font-size: 19px;
    /* Subtle paper noise — SVG inline so it travels with the file */
    background-image:
        radial-gradient(ellipse at top left, var(--paper-tint), transparent 60%),
        url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.35  0 0 0 0 0.27  0 0 0 0 0.15  0 0 0 0.08 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.45'/></svg>");
    background-attachment: fixed;
    background-size: auto, 180px 180px;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* Optical-size + axis tuning for Fraunces — slight WONK and SOFT for personality */
body, .container { font-feature-settings: "kern", "liga", "calt"; }

.container {
    max-width: 1080px;
    margin: 0 auto;
    padding: 56px 36px 80px;
}

/* ============================================================
   PODCAST / AUDIO COMPANION BLOCK
   Sits at the top of each module, below the nav bar.
   Dark ink panel with apricot accent, embedded HTML5 audio player.
   ============================================================ */
.podcast-block {
    background: var(--ink);
    color: var(--cream);
    padding: 28px 32px;
    margin: 32px 0 40px;
    box-shadow: 7px 7px 0 var(--apricot);
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 26px;
    align-items: center;
}
.podcast-block .pod-icon {
    width: 78px;
    height: 78px;
    border-radius: 50%;
    background: var(--apricot);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.podcast-block .pod-icon svg {
    width: 38px;
    height: 38px;
    fill: var(--ink);
}
.podcast-block .pod-meta { flex: 1; }
.podcast-block .pod-eyebrow {
    font-family: var(--font-display);
    font-style: italic;
    font-size: 0.78em;
    color: var(--apricot-glow);
    text-transform: uppercase;
    letter-spacing: 4px;
    font-weight: 600;
    margin-bottom: 6px;
    display: block;
}
.podcast-block .pod-title {
    font-family: var(--font-display);
    font-variation-settings: "opsz" 96, "SOFT" 30, "WONK" 1;
    font-size: 1.6em;
    color: var(--cream);
    font-weight: 600;
    font-style: italic;
    line-height: 1.05;
    letter-spacing: -0.01em;
    margin: 0 0 4px;
    display: block;
}
.podcast-block .pod-deck {
    font-family: var(--font-body);
    font-style: italic;
    font-size: 0.95em;
    color: var(--cream);
    opacity: 0.78;
    margin: 0 0 14px;
    display: block;
}
.podcast-block audio {
    width: 100%;
    max-width: 540px;
    height: 40px;
    margin-top: 4px;
    filter: invert(0.92) hue-rotate(180deg) saturate(0.4);
}
@media (max-width: 640px) {
    .podcast-block { grid-template-columns: 1fr; padding: 22px; }
    .podcast-block .pod-icon { display: none; }
}

/* ============================================================
   BRAND LOCKUP — Hearst × The Social Studio co-branding
   Sits at the very top of every page, above hero/course header.
   ============================================================ */
.brand-lockup {
    display: flex;
    align-items: center;
    gap: 22px;
    padding: 22px 0 18px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 12px;
}
.brand-lockup .mark {
    display: inline-flex;
    align-items: center;
    line-height: 1;
}
.brand-lockup .mark img,
.brand-lockup .mark svg {
    display: block;
    height: 28px;
    width: auto;
}
.brand-lockup .mark.social img { height: 32px; }
.brand-lockup .divider {
    width: 1px;
    height: 26px;
    background: var(--line);
    flex: 0 0 auto;
}
@media (max-width: 520px) {
    .brand-lockup { gap: 14px; padding: 16px 0 12px; }
    .brand-lockup .mark img,
    .brand-lockup .mark svg { height: 22px; }
    .brand-lockup .mark.social img { height: 26px; }
    .brand-lockup .divider { height: 20px; }
}

/* ============================================================
   HERO / COURSE HEADER — editorial cover-page treatment
   ============================================================ */
.course-header {
    background: var(--cream);
    border: none;
    padding: 36px 0 44px;
    margin-bottom: 56px;
    text-align: left;
    position: relative;
    border-bottom: 2px solid var(--ink);
}

.course-header::before {
    /* small decorative bracket mark above eyebrow */
    content: "";
    display: block;
    width: 56px;
    height: 8px;
    border-top: 2px solid var(--apricot);
    border-left: 2px solid var(--apricot);
    margin-bottom: 18px;
}

.course-header .brand {
    font-family: var(--font-display);
    font-weight: 500;
    font-style: italic;
    font-size: 13px;
    color: var(--apricot-deep);
    text-transform: uppercase;
    letter-spacing: 4px;
    margin-bottom: 22px;
    line-height: 1;
}

.course-header h1 {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(2.6rem, 6vw, 4.4rem);
    line-height: 0.95;
    letter-spacing: -0.005em;
    color: var(--ink);
    margin: 0 0 24px;
    border: none;
    padding: 0;
    max-width: 16ch;
}

.course-header h1 em {
    font-style: italic;
    color: var(--apricot-deep);
}

.course-header .subtitle {
    font-family: var(--font-body);
    font-weight: 400;
    font-style: italic;
    color: var(--ink-soft);
    font-size: 1.15em;
    line-height: 1.5;
    max-width: 56ch;
    margin: 0;
}

/* ============================================================
   NAV BAR — newspaper-style horizontal rule with crumb links
   ============================================================ */
.nav-bar {
    background: transparent;
    border: none;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    padding: 14px 0;
    margin-bottom: 48px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    font-family: var(--font-display);
    font-weight: 500;
    font-size: 0.95em;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.nav-bar a {
    color: var(--ink);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.18s;
    border: none;
}
.nav-bar a:hover { color: var(--apricot-deep); }
.nav-links { display: flex; gap: 26px; flex-wrap: wrap; }

/* ============================================================
   TABLE OF CONTENTS — magazine sidebar
   ============================================================ */
.toc {
    background: var(--cream-deep);
    border: none;
    border-left: 6px solid var(--apricot);
    border-radius: 0;
    padding: 28px 32px;
    margin-bottom: 56px;
    position: relative;
}

.toc::before {
    content: "Contents";
    display: none; /* h2 already handles label */
}

.toc h2 {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.78em;
    color: var(--apricot-deep);
    margin: 0 0 18px;
    border: none;
    padding: 0;
    text-transform: uppercase;
    letter-spacing: 3px;
}

.toc ul { list-style: none; padding-left: 0; counter-reset: tocnum; }
.toc li {
    margin-bottom: 9px;
    line-height: 1.45;
    position: relative;
    padding-left: 36px;
    counter-increment: tocnum;
}
.toc li::before {
    content: counter(tocnum, decimal-leading-zero);
    position: absolute;
    left: 0;
    top: 1px;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.85em;
    color: var(--apricot-deep);
    letter-spacing: 0.5px;
}
.toc li.toc-h2 { font-weight: 600; font-family: var(--font-body); font-size: 1.02em; }
.toc li.toc-h3 { margin-left: 18px; font-weight: 400; font-size: 0.92em; color: var(--ink-soft); }
.toc a { color: var(--ink); text-decoration: none; border: none; }
.toc a:hover { color: var(--apricot-deep); border-bottom: 1px solid var(--apricot); }

/* ============================================================
   TYPOGRAPHY — magazine body type
   ============================================================ */
h1, h2, h3, h4 {
    font-family: var(--font-display);
    color: var(--ink);
    line-height: 1.15;
    margin-top: 1.6em;
    margin-bottom: 0.5em;
    font-weight: 600;
    letter-spacing: -0.01em;
}

h1 { font-size: 2.4em; }

h2 {
    font-size: 2em;
    color: var(--ink);
    border: none;
    padding: 0;
    position: relative;
    padding-left: 0;
    margin-top: 2.4em;
}
h2::before {
    content: "";
    display: block;
    width: 64px;
    height: 3px;
    background: var(--apricot);
    margin-bottom: 18px;
}

h3 {
    font-size: 1.45em;
    color: var(--ink);
    font-weight: 600;
    font-style: italic;
}

h4 {
    font-size: 1.1em;
    text-transform: uppercase;
    letter-spacing: 2.5px;
    color: var(--apricot-deep);
    font-weight: 600;
    font-style: normal;
}

p {
    margin-bottom: 1.1em;
    color: var(--ink);
    font-size: 1.02em;
}
p.lead {
    font-family: var(--font-display);
    font-size: 1.4em;
    line-height: 1.4;
    color: var(--ink);
    font-style: italic;
    font-weight: 400;
    margin-bottom: 1.6em;
}

/* Drop cap removed — Social Studio brand uses bold display heads instead. */

a {
    color: var(--apricot-deep);
    text-decoration: none;
    border-bottom: 1px solid var(--line-soft);
    transition: all 0.18s;
}
a:hover { color: var(--rust); border-bottom-color: var(--apricot); }

ul, ol { margin: 0.8em 0 1.2em 1.6em; }
ul { list-style: none; padding-left: 0; }
ul li {
    position: relative;
    padding-left: 26px;
    margin-bottom: 0.55em;
}
ul li::before {
    content: "❍";
    position: absolute;
    left: 0;
    top: 0;
    color: var(--apricot);
    font-size: 0.7em;
    line-height: 1.8;
}
ol { padding-left: 1.6em; }
ol li { margin-bottom: 0.55em; }
ol li::marker {
    color: var(--apricot-deep);
    font-family: var(--font-display);
    font-weight: 600;
}

strong {
    color: var(--ink);
    font-weight: 700;
    background: linear-gradient(180deg, transparent 60%, rgba(230,139,58,0.22) 60%);
    padding: 0 2px;
}
em { color: var(--ink-soft); font-style: italic; }

/* ============================================================
   CODE
   ============================================================ */
code {
    background: var(--cream-deep);
    color: var(--rust);
    padding: 2px 7px;
    border-radius: 3px;
    font-family: var(--font-mono);
    font-size: 0.86em;
    border: 1px solid var(--line-soft);
}

pre {
    background: var(--ink);
    color: var(--cream);
    border: none;
    border-radius: 4px;
    padding: 22px 26px;
    overflow-x: auto;
    margin: 1.4em 0;
    font-family: var(--font-mono);
    font-size: 0.88em;
    line-height: 1.55;
    box-shadow: 6px 6px 0 var(--apricot);
}
pre code {
    background: transparent;
    color: var(--cream);
    padding: 0;
    border: none;
    font-size: 1em;
}

/* ============================================================
   TABLES — magazine data treatment
   ============================================================ */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.6em 0;
    background: transparent;
    border: none;
    border-radius: 0;
    overflow: visible;
    font-size: 0.95em;
}

th, td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}

th {
    background: transparent;
    color: var(--ink);
    font-family: var(--font-display);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-size: 0.78em;
    border-bottom: 2px solid var(--ink);
    padding-bottom: 10px;
}

tr:nth-child(even) td { background: var(--paper-tint); }
tr:hover td { background: var(--cream-deep); }

/* ============================================================
   CALLOUTS — bracketed pull-quote treatment
   ============================================================ */
.callout {
    background: var(--cream-deep);
    border-left: 4px solid var(--apricot);
    padding: 22px 28px 22px 32px;
    margin: 1.8em 0;
    border-radius: 0;
    position: relative;
}
.callout::before {
    content: "❝";
    position: absolute;
    top: -8px;
    left: 14px;
    font-family: var(--font-display);
    font-size: 2.2em;
    color: var(--apricot);
    line-height: 1;
    opacity: 0;
}

.callout.warning { border-left-color: var(--gold); background: #F8F0D5; }
.callout.danger  { border-left-color: var(--rust);  background: #F5DDCB; }
.callout.success { border-left-color: var(--sage);  background: #E5EDE7; }
.callout.info    { border-left-color: var(--ink);   background: #E4E8EC; }

.callout .label {
    font-family: var(--font-display);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.72em;
    letter-spacing: 3px;
    color: var(--apricot-deep);
    margin-bottom: 10px;
    display: block;
}
.callout.warning .label { color: var(--gold); }
.callout.danger .label  { color: var(--rust); }
.callout.success .label { color: var(--sage); }
.callout.info .label    { color: var(--ink); }

.callout p:last-child { margin-bottom: 0; }
.callout p { font-size: 1.02em; }

/* ============================================================
   DEFINITION LIST — glossary cards
   ============================================================ */
.definition-list {
    display: grid;
    gap: 14px;
    margin: 1.6em 0;
}

.def-card {
    background: var(--cream);
    border: 1px solid var(--line);
    border-radius: 0;
    padding: 18px 22px;
    position: relative;
    box-shadow: 4px 4px 0 var(--cream-deep);
    transition: transform 0.2s, box-shadow 0.2s;
}
.def-card:hover {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0 var(--apricot);
}

.def-card .term {
    font-family: var(--font-display);
    font-weight: 600;
    font-style: italic;
    color: var(--apricot-deep);
    display: block;
    margin-bottom: 6px;
    font-size: 1.18em;
    line-height: 1.2;
}
.def-card .def {
    color: var(--ink);
    font-size: 1em;
    line-height: 1.55;
}

/* ============================================================
   SECTION RHYTHM
   ============================================================ */
section { margin-bottom: 3em; }
section.major { padding-top: 1em; }

hr {
    border: none;
    height: 1px;
    background: linear-gradient(to right,
        transparent 0%,
        var(--line) 20%,
        var(--apricot) 50%,
        var(--line) 80%,
        transparent 100%);
    margin: 3.2em auto;
    max-width: 480px;
}

/* Editorial section divider — diagonal arrow homage to the deck */
.section-divider {
    margin: 4em 0;
    text-align: center;
    font-family: var(--font-display);
    font-weight: 400;
    font-size: 4em;
    color: var(--apricot);
    line-height: 1;
}
.section-divider::before { content: "↘"; }

/* ============================================================
   PILLAR / 4-UP CARDS
   ============================================================ */
.pillar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 22px;
    margin: 2em 0;
}

.pillar-card {
    background: var(--cream);
    border: 1px solid var(--line);
    border-top: 6px solid var(--apricot);
    border-radius: 0;
    padding: 26px 24px;
    box-shadow: 6px 6px 0 var(--cream-deep);
    transition: transform 0.25s, box-shadow 0.25s;
    position: relative;
}
.pillar-card:hover {
    transform: translate(-3px, -3px);
    box-shadow: 9px 9px 0 var(--apricot-glow);
}
.pillar-card h4 {
    margin-top: 0;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.6em;
    color: var(--apricot-deep);
    text-transform: none;
    letter-spacing: -0.01em;
    margin-bottom: 4px;
    font-style: normal;
}
.pillar-card .tag {
    display: inline-block;
    font-family: var(--font-body);
    font-size: 0.85em;
    color: var(--ink-muted);
    font-style: italic;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--line);
    padding-bottom: 8px;
}
.pillar-card.tell  { border-top-color: var(--gold); }
.pillar-card.tell h4 { color: var(--gold); }
.pillar-card.teach { border-top-color: var(--sage); }
.pillar-card.teach h4 { color: var(--sage); }
.pillar-card.invite { border-top-color: var(--ink); }
.pillar-card.invite h4 { color: var(--ink); }

/* ============================================================
   FOOTER + CTA
   ============================================================ */
.module-footer {
    margin-top: 80px;
    padding-top: 32px;
    border-top: 2px solid var(--ink);
    color: var(--ink-muted);
    font-family: var(--font-display);
    font-size: 0.78em;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 3px;
}

.next-module-cta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-top: 56px;
}
.next-module-cta a {
    display: block;
    background: var(--cream);
    border: 1px solid var(--line);
    padding: 22px 24px;
    border-radius: 0;
    color: var(--ink);
    border-bottom: 1px solid var(--line);
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    box-shadow: 4px 4px 0 var(--cream-deep);
}
.next-module-cta a:hover {
    transform: translate(-2px, -2px);
    border-color: var(--apricot);
    box-shadow: 7px 7px 0 var(--apricot);
}
.next-module-cta .label {
    display: block;
    font-family: var(--font-display);
    font-size: 0.72em;
    color: var(--apricot-deep);
    text-transform: uppercase;
    letter-spacing: 3px;
    margin-bottom: 6px;
    font-weight: 600;
}
.next-module-cta .title {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.15em;
    color: var(--ink);
}

/* ============================================================
   DASHBOARD-SPECIFIC
   ============================================================ */
.dashboard-grid {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    min-height: 100vh;
}

.sidebar {
    background: var(--cream-deep);
    border-right: 1px solid var(--line);
    padding: 36px 26px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.sidebar .brand-mark {
    font-family: var(--font-display);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 4px;
    color: var(--apricot-deep);
    text-align: center;
    margin-bottom: 12px;
    font-style: italic;
    font-weight: 500;
}
.sidebar .brand-mark--logos {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 18px;
}
.sidebar .brand-mark--logos img {
    display: block;
    width: auto;
}
.sidebar .brand-mark-hearst { height: 16px; }
.sidebar .brand-mark-social { height: 22px; }
.sidebar .brand-mark-divider {
    width: 1px;
    height: 18px;
    background: var(--line);
    flex: 0 0 auto;
}
.sidebar h1 {
    font-family: var(--font-display);
    font-size: 1.4em;
    text-align: center;
    color: var(--ink);
    margin: 0 0 28px;
    line-height: 1.05;
    border: none;
    padding: 0;
    font-weight: 600;
}

.module-nav { list-style: none; margin: 0; padding: 0; }
.module-nav li { margin-bottom: 2px; padding-left: 0; }
.module-nav li::before { content: none; }
.module-nav a {
    display: flex;
    align-items: baseline;
    gap: 12px;
    color: var(--ink-soft);
    padding: 10px 14px;
    border-radius: 0;
    border: none;
    border-left: 2px solid transparent;
    font-size: 0.96em;
    font-family: var(--font-body);
    transition: all 0.15s;
}
.module-nav a:hover {
    background: var(--cream);
    color: var(--apricot-deep);
    border-left-color: var(--apricot);
}
.module-nav .num {
    font-family: var(--font-display);
    color: var(--apricot-deep);
    font-size: 0.78em;
    font-weight: 600;
    letter-spacing: 1px;
    flex-shrink: 0;
    width: 24px;
    text-align: right;
}
.module-nav a.active {
    background: var(--cream);
    color: var(--apricot-deep);
    border-left-color: var(--apricot);
    font-weight: 600;
}

.main-content { padding: 64px 56px 80px; max-width: 1180px; }

/* ============================================================
   MODULE INDEX CARDS — magazine grid (asymmetric)
   ============================================================ */
.module-card-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 24px;
    margin-top: 28px;
}

.module-card {
    grid-column: span 6;
    background: var(--cream);
    border: 1px solid var(--line);
    border-radius: 0;
    padding: 32px 32px 28px;
    transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
    text-decoration: none;
    color: var(--ink);
    border-bottom: 1px solid var(--line);
    display: block;
    box-shadow: 6px 6px 0 var(--cream-deep);
    position: relative;
    min-height: 220px;
}

/* Asymmetric grid — featured module spans larger; alternating heights for editorial rhythm */
.module-card:nth-child(1) { grid-column: span 12; min-height: 260px; }
.module-card:nth-child(2) { grid-column: span 7; }
.module-card:nth-child(3) { grid-column: span 5; }
.module-card:nth-child(4) { grid-column: span 5; }
.module-card:nth-child(5) { grid-column: span 7; }
.module-card:nth-child(6) { grid-column: span 4; }
.module-card:nth-child(7) { grid-column: span 4; }
.module-card:nth-child(8) { grid-column: span 4; }
.module-card:nth-child(9) {
    grid-column: span 12;
    min-height: 240px;
    background: var(--ink);
    color: var(--cream);
    border-color: var(--ink);
}
.module-card:nth-child(9) .num,
.module-card:nth-child(9) h3,
.module-card:nth-child(9) p,
.module-card:nth-child(9) .links { color: var(--cream); }
.module-card:nth-child(9) .num-badge { background: var(--apricot); color: var(--ink); }

.module-card:hover {
    transform: translate(-3px, -3px);
    box-shadow: 9px 9px 0 var(--apricot);
    border-color: var(--apricot);
}

.module-card .num {
    font-family: var(--font-display);
    color: var(--apricot-deep);
    font-size: 0.78em;
    text-transform: uppercase;
    letter-spacing: 4px;
    font-weight: 600;
    display: block;
    margin-bottom: 10px;
}

.module-card .num-badge {
    display: inline-block;
    background: var(--ink);
    color: var(--cream);
    padding: 4px 12px;
    border-radius: 0;
    font-family: var(--font-display);
    font-size: 0.72em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 3px;
    margin-bottom: 14px;
}

.module-card h3 {
    margin: 0 0 14px;
    font-family: var(--font-display);
    font-size: 1.7em;
    line-height: 1.05;
    color: var(--ink);
    font-weight: 600;
    font-style: normal;
    letter-spacing: -0.015em;
}
.module-card:nth-child(1) h3,
.module-card:nth-child(9) h3 { font-size: 2.4em; max-width: 22ch; }

.module-card p {
    color: var(--ink-soft);
    font-size: 1.02em;
    margin-bottom: 16px;
    line-height: 1.55;
}

.module-card .links {
    display: flex;
    gap: 14px;
    align-items: baseline;
    font-family: var(--font-display);
    font-size: 0.85em;
    color: var(--apricot-deep);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 600;
    border-top: 1px solid var(--line);
    padding-top: 14px;
    margin-top: auto;
}
.module-card .links a {
    color: var(--apricot-deep);
    border: none;
    text-decoration: none;
}
.module-card .links a:hover { color: var(--rust); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 920px) {
    .module-card,
    .module-card:nth-child(n) { grid-column: span 12 !important; min-height: auto; }
    .container { padding: 36px 22px; }
    .course-header { padding: 24px 0 32px; margin-bottom: 36px; }
    .course-header h1 { font-size: clamp(2.2rem, 9vw, 3rem); }
    h2 { font-size: 1.7em; }
    .dashboard-grid { grid-template-columns: 1fr; }
    .sidebar { position: static; height: auto; border-right: none; border-bottom: 1px solid var(--line); }
    .main-content { padding: 36px 22px; }
}

@media print {
    body { background: white; color: black; }
    body, .container { background-image: none; }
    .nav-bar, .next-module-cta, .sidebar { display: none; }
    pre { box-shadow: none; }
}

/* ============================================================
   ORCHESTRATED PAGE LOAD — staggered editorial reveals
   ============================================================ */
@keyframes fadeRise {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes inkSweep {
    from { opacity: 0; transform: translateX(-12px); }
    to   { opacity: 1; transform: translateX(0); }
}

.course-header > * { animation: inkSweep 0.7s ease both; }
.course-header > *:nth-child(1) { animation-delay: 0.05s; }
.course-header > *:nth-child(2) { animation-delay: 0.18s; }
.course-header > *:nth-child(3) { animation-delay: 0.32s; }
.course-header > *:nth-child(4) { animation-delay: 0.46s; }

.nav-bar { animation: fadeRise 0.6s 0.55s ease both; }
.toc { animation: fadeRise 0.6s 0.7s ease both; }
section { animation: fadeRise 0.6s 0.85s ease both; }

.module-card { animation: fadeRise 0.7s ease both; opacity: 0; }
.module-card:nth-child(1) { animation-delay: 0.10s; }
.module-card:nth-child(2) { animation-delay: 0.18s; }
.module-card:nth-child(3) { animation-delay: 0.26s; }
.module-card:nth-child(4) { animation-delay: 0.34s; }
.module-card:nth-child(5) { animation-delay: 0.42s; }
.module-card:nth-child(6) { animation-delay: 0.50s; }
.module-card:nth-child(7) { animation-delay: 0.58s; }
.module-card:nth-child(8) { animation-delay: 0.66s; }
.module-card:nth-child(9) { animation-delay: 0.78s; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01s !important;
        animation-delay: 0s !important;
        transition-duration: 0.01s !important;
    }
}
