/* ────────────────────────────────────────────────────────────────
   Smart Classroom Story — Bauhaus B&W
   Geometric sans throughout. No serifs. Weight does the work.
──────────────────────────────────────────────────────────────── */

:root {
  --font-display: "Archivo Black", "Archivo", Helvetica, Arial, sans-serif;
  --font-sans:    "Archivo", Helvetica, Arial, sans-serif;
  --font-mono:    "JetBrains Mono", "SF Mono", monospace;

  --ink:        #000000;
  --ink-soft:   #1a1a1a;
  --ink-muted:  #666666;
  --ink-faint:  #b0b0b0;
  --paper:      #ffffff;
  --paper-deep: #ededed;
  --rule:       #000000;
}

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

html { scroll-behavior: smooth; }

/* Anchor targets: extra space above so the section title isn't crammed against the top */
:target {
  scroll-margin-top: 32px;
}
:target::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 14px;
  background: var(--ink);
  vertical-align: middle;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--ink);
  transition: opacity 0.15s;
}
a:hover { opacity: 0.55; }

/* ─── Container ─────────────────────────────────────────────── */

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 32px;
}

/* ─── Masthead ──────────────────────────────────────────────── */

.masthead {
  border-bottom: 6px solid var(--rule);
  padding: 96px 0 64px;
  background: var(--paper);
}

.masthead-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 32px;
}

.meta {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 40px;
}
.meta-sep { margin: 0 8px; color: var(--ink-faint); }

.masthead-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(64px, 14vw, 168px);
  line-height: 0.88;
  letter-spacing: -0.04em;
  text-transform: uppercase;
  color: var(--ink);
  margin-bottom: 32px;
}

.masthead-sub {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: clamp(18px, 2.5vw, 24px);
  letter-spacing: -0.01em;
  color: var(--ink-soft);
  max-width: 640px;
}

/* ─── Phase Cards ───────────────────────────────────────────── */

.phase-card {
  background: var(--ink);
  color: var(--paper);
  padding: 96px 0;
  margin-top: 0;
  border-top: 6px solid var(--rule);
  border-bottom: 6px solid var(--rule);
}
.phase-card .container {
  max-width: 1200px;
}

.phase-card-light {
  background: var(--paper);
  color: var(--ink);
}
.phase-card-light .phase-meta { color: var(--ink-muted); border-color: var(--ink); opacity: 1; }
.phase-card-light .phase-time { color: var(--ink); }
.phase-card-light .phase-num { color: var(--ink-muted); }
.phase-card-light .phase-sub { color: var(--ink-soft); }

.phase-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--paper);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 32px;
  padding-bottom: 24px;
  position: relative;
  opacity: 0.95;
}
/* Partial-width left-anchored bar — Swiss/Bauhaus rule.
   Doesn't reach the right edge; that's the point. */
.phase-meta::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 220px;
  height: 5px;
  background: currentColor;
}

.phase-time {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.18em;
}

.phase-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(56px, 11vw, 144px);
  line-height: 0.9;
  letter-spacing: -0.04em;
  text-transform: uppercase;
  margin-bottom: 24px;
}

.phase-sub {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: clamp(16px, 2vw, 22px);
  letter-spacing: -0.005em;
  color: var(--paper-deep);
  max-width: 600px;
}

/* ─── Chapters ──────────────────────────────────────────────── */

.chapter {
  padding: 88px 0;
}

.chapter-hero {
  padding: 96px 0 80px;
  border-bottom: 2px solid var(--ink);
}

.lede {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: clamp(22px, 2.8vw, 30px);
  line-height: 1.3;
  letter-spacing: -0.015em;
  margin-bottom: 32px;
  color: var(--ink);
}

.lede-runner {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink-soft);
  max-width: 600px;
}

.chapter p {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 17px;
  line-height: 1.65;
  margin-bottom: 1.4em;
  color: var(--ink);
}

.chapter p strong {
  font-family: var(--font-sans);
  font-weight: 800;
  letter-spacing: -0.01em;
}

.chapter p em {
  font-style: italic;
}

.aside {
  font-family: var(--font-mono) !important;
  font-size: 12px !important;
  font-weight: 400 !important;
  line-height: 1.6 !important;
  color: var(--ink-soft) !important;
  border-left: 4px solid var(--ink);
  padding: 4px 0 4px 20px;
  margin: 2.5em 0;
  max-width: 600px;
  text-transform: none;
  letter-spacing: 0;
}

/* ─── Blockquotes ───────────────────────────────────────────── */

blockquote {
  margin: 3em 0;
  padding: 32px 0;
  border-top: 4px solid var(--ink);
  border-bottom: 4px solid var(--ink);
}

blockquote p {
  font-family: var(--font-sans) !important;
  font-weight: 700 !important;
  font-style: normal !important;
  font-size: clamp(22px, 2.8vw, 28px) !important;
  line-height: 1.3 !important;
  letter-spacing: -0.02em !important;
  margin-bottom: 20px !important;
  color: var(--ink);
}

blockquote cite {
  font-family: var(--font-mono);
  font-style: normal;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-muted);
  display: block;
}

/* ─── Figures ───────────────────────────────────────────────── */

.figure {
  margin: 3em 0;
}

.figure img,
.figure video {
  display: block;
  width: 100%;
  height: auto;
  border: 2px solid var(--ink);
  background: var(--ink);
}

.figure video {
  outline: none;
}

.figure-wide {
  max-width: 1200px;
  margin-left: 50%;
  transform: translateX(-50%);
  width: min(calc(100vw - 64px), 1200px);
}

.figure figcaption {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--ink);
  margin-top: 12px;
  padding-top: 10px;
  border-top: 2px solid var(--ink);
  line-height: 1.5;
  text-transform: uppercase;
}

/* ─── Links list ────────────────────────────────────────────── */

.links {
  list-style: none;
  margin-top: 2em;
  border-top: 2px solid var(--ink);
}
.links li {
  border-bottom: 2px solid var(--ink);
}
.links a {
  display: block;
  padding: 22px 0;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-bottom: none;
  color: var(--ink);
  transition: padding 0.15s, background 0.15s;
}
.links a:hover {
  background: var(--ink);
  color: var(--paper);
  opacity: 1;
  padding-left: 16px;
  padding-right: 16px;
}

/* ─── Credits ───────────────────────────────────────────────── */

.chapter-credits {
  background: var(--paper-deep);
  padding: 96px 0 64px;
  border-top: 6px solid var(--rule);
}

.credits-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(48px, 7vw, 88px);
  line-height: 0.9;
  letter-spacing: -0.04em;
  text-transform: uppercase;
  margin-bottom: 56px;
}

.credits-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 48px;
  margin-bottom: 48px;
}

.credits-block h3 {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink);
  margin-bottom: 16px;
  padding-bottom: 12px;
  position: relative;
}
.credits-block h3::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 80px;
  height: 4px;
  background: var(--ink);
}

.credits-block ul {
  list-style: none;
}

.credits-block li {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 15px;
  line-height: 1.7;
  color: var(--ink-soft);
}

.credits-block li a {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  border-bottom: 1px solid var(--ink-faint);
}

.project-jump {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px 24px;
}
.project-jump li {
  font-size: 13px;
}
.project-jump a {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--ink-faint);
}

.colophon {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 14px;
  line-height: 1.65;
  color: var(--ink-muted);
  max-width: 640px;
  margin-top: 48px;
  padding-top: 24px;
  border-top: 2px solid var(--ink);
}
.colophon em { font-style: normal; font-weight: 700; }

/* ─── Footer ────────────────────────────────────────────────── */

.colophon-footer {
  background: var(--ink);
  color: var(--paper);
  padding: 32px 0;
}
.colophon-footer .container {
  max-width: 1200px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.colophon-footer a {
  color: var(--paper);
  border-bottom-color: var(--paper);
}

/* ─── Mobile ────────────────────────────────────────────────── */

@media (max-width: 640px) {
  .container { padding: 0 20px; }
  .masthead { padding: 56px 0 40px; }
  .phase-card { padding: 56px 0; }
  .chapter { padding: 56px 0; }
  .figure-wide { width: calc(100vw - 40px); }

  /* Display titles: pure-vw scaling so long single words ("Classroom",
     "Contributors") don't overshoot the viewport at narrow widths. */
  .masthead-title {
    font-size: 11vw;
    letter-spacing: -0.05em;
    line-height: 0.92;
  }
  .phase-title {
    font-size: 12vw;
    letter-spacing: -0.03em;
    line-height: 0.92;
  }
  .credits-title {
    font-size: 8.5vw;
    letter-spacing: -0.05em;
    line-height: 0.92;
  }

  /* Safety net: hyphenate long words rather than overflow. */
  .masthead-title,
  .phase-title,
  .credits-title {
    overflow-wrap: break-word;
    hyphens: auto;
    -webkit-hyphens: auto;
  }
}

/* ─── Print ─────────────────────────────────────────────────── */

@media print {
  body { background: white; color: black; font-size: 11pt; }
  .phase-card { background: white; color: black; border-top: 2pt solid black; border-bottom: 2pt solid black; padding: 32pt 0; page-break-before: always; }
  .phase-title, .phase-sub, .phase-meta, .phase-time { color: black !important; }
  .colophon-footer { background: white; color: black; border-top: 1pt solid black; }
  .figure { page-break-inside: avoid; }
  .links { display: none; }
}
