/* ============================================
   THE WICKED PROCESS
   Aesthetic: Drafting paper + blueprint grid
   The third document. A meta-guide: how the
   source material becomes the show and film.
   Distinct from Wicked (emerald) and the
   Oz source guide (sepia).
   ============================================ */

:root {
  --paper: #f5f1e8;
  --paper-warm: #efe8d4;
  --paper-dark: #d9cfb6;
  --ink: #1a2238;
  --ink-soft: #344057;
  --ink-faint: #6b7390;
  --rule: #98a4be;
  --blueprint: #1c3d5a;       /* blueprint blue */
  --blueprint-soft: #4d6c8a;  /* blueprint mid */
  --accent: #b94a48;          /* editorial red */
  --accent-soft: #c97975;
  --gold: #b4843c;            /* draft-paper accent */
}

body.night {
  --paper: #0e1726;
  --paper-warm: #142033;
  --paper-dark: #1f2d44;
  --ink: #e4e9f3;
  --ink-soft: #b5bdd1;
  --ink-faint: #7a83a0;
  --rule: #4d5a72;
  --blueprint: #5d8eb8;
  --blueprint-soft: #7da7c6;
  --accent: #e88a87;
  --accent-soft: #c97975;
  --gold: #d4a85c;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Georgia, 'Times New Roman', serif;
  background:
    /* blueprint grid lines */
    linear-gradient(to right, rgba(156,164,190,0.10) 1px, transparent 1px) 0 0 / 40px 40px,
    linear-gradient(to bottom, rgba(156,164,190,0.10) 1px, transparent 1px) 0 0 / 40px 40px,
    var(--paper);
  color: var(--ink);
  line-height: 1.65;
}

/* --- header / nav --- */
.site-header {
  padding: 2.2rem 1.5rem 1.4rem;
  border-bottom: 2px solid var(--ink);
  background: var(--paper-warm);
  position: relative;
}
.site-header::before {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -8px; height: 6px;
  background:
    repeating-linear-gradient(90deg, var(--ink) 0 20px, transparent 20px 30px);
}
.site-title {
  font-family: Georgia, serif;
  font-weight: 700;
  font-size: 2.2rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin: 0;
  text-align: center;
}
.site-tagline {
  font-style: italic;
  font-size: 1rem;
  color: var(--ink-soft);
  text-align: center;
  margin: 0.4rem 0 0;
}
.site-nav {
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}
.site-nav ul {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 0;
}
.site-nav a {
  display: inline-block;
  padding: 0.85rem 1.4rem;
  text-decoration: none;
  color: var(--ink-soft);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-right: 1px solid var(--rule);
  font-family: 'Helvetica Neue', Arial, sans-serif;
}
.site-nav li:first-child a { border-left: 1px solid var(--rule); }
.site-nav a:hover { background: var(--paper-warm); color: var(--accent); }

/* --- main --- */
main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}
h1 {
  font-family: Georgia, serif;
  font-size: 2rem;
  border-bottom: 3px double var(--ink);
  padding-bottom: 0.4rem;
  margin-top: 0;
}
h2 {
  font-family: Georgia, serif;
  font-size: 1.5rem;
  color: var(--blueprint);
  border-left: 4px solid var(--blueprint);
  padding-left: 0.7rem;
  margin-top: 2.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
body.night h2 { color: var(--blueprint); }
h3 { font-size: 1.15rem; color: var(--ink); margin-top: 1.5rem; }
.lede {
  font-size: 1.1rem;
  font-style: italic;
  color: var(--ink-soft);
  border-left: 3px solid var(--accent);
  padding-left: 1rem;
  margin: 1.5rem 0;
}
p { margin: 0 0 1rem; }

/* --- hero --- */
.hero {
  background: var(--paper-warm);
  border: 2px solid var(--ink);
  padding: 0;
  margin-bottom: 2rem;
  position: relative;
  overflow: hidden;
}
.hero-banner {
  position: relative;
  width: 100%;
  overflow: hidden;
}
.hero-banner img {
  width: 100%;
  height: 320px;
  object-fit: cover;
  object-position: center 30%;
  display: block;
  filter: grayscale(0.3) contrast(1.1) brightness(0.7);
  border-bottom: 2px solid var(--ink);
}
.hero-banner-text {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1.5rem;
  background: linear-gradient(180deg, rgba(30, 35, 50, 0.4) 0%, rgba(30, 35, 50, 0.65) 100%);
}
.hero-banner-text h2 {
  border: none; padding: 0;
  font-size: 1.7rem;
  color: #f0ead6;
  text-transform: none;
  letter-spacing: 0;
  margin: 0;
  text-shadow: 0 2px 8px rgba(0,0,0,0.8);
  font-family: 'Courier New', monospace;
}
.hero-banner-text .hero-sub {
  color: #c4b878;
  font-family: 'Courier New', monospace;
  font-size: 0.95rem;
  margin-top: 0.5rem;
  text-shadow: 0 1px 4px rgba(0,0,0,0.8);
}
.hero-body {
  padding: 2rem;
}
.hero::before {
  content: 'DRAFT · v1.0';
  position: absolute;
  top: 0.6rem; right: 1rem;
  z-index: 10;
  font-family: 'Courier New', monospace;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  color: var(--accent);
  border: 1px solid var(--accent);
  background: rgba(244, 235, 210, 0.85);
  padding: 0.15rem 0.5rem;
  transform: rotate(2deg);
}
.hero h2 {
  border: none; padding: 0;
  font-size: 1.7rem;
  color: var(--ink);
  text-transform: none;
  letter-spacing: 0;
  margin-top: 0;
}

/* --- cards --- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.2rem;
  margin: 1.5rem 0;
}
.card {
  background: var(--paper-warm);
  border: 1px solid var(--paper-dark);
  border-left: 4px solid var(--blueprint);
  padding: 1.2rem;
}
.card h3 { margin-top: 0; color: var(--blueprint); }
.card .meta { font-size: 0.85rem; color: var(--ink-faint); font-style: italic; margin-bottom: 0.5rem; }

/* --- funnel diagram --- */
.funnel {
  background: var(--paper-warm);
  border: 2px dashed var(--rule);
  padding: 1.5rem;
  margin: 1.5rem 0;
  font-family: 'Courier New', monospace;
  font-size: 0.95rem;
  line-height: 1.8;
  white-space: pre;
  overflow-x: auto;
  color: var(--ink-soft);
}

/* --- timeline --- */
.timeline { list-style: none; padding: 0; margin: 1.5rem 0; }
.timeline li {
  position: relative;
  padding: 0.7rem 0 0.7rem 7rem;
  border-left: 2px solid var(--blueprint);
  margin-left: 1rem;
}
.timeline li::before {
  content: attr(data-year);
  position: absolute;
  left: -2.2rem; top: 0.7rem;
  background: var(--paper);
  padding: 0.15rem 0.5rem;
  border: 1px solid var(--blueprint);
  font-family: 'Courier New', monospace;
  font-size: 0.85rem;
  color: var(--blueprint);
  font-weight: bold;
}
.timeline li .what { display: block; font-weight: bold; }
.timeline li .who { color: var(--ink-faint); font-style: italic; font-size: 0.9rem; }

/* --- table --- */
table.book-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.95rem;
  background: var(--paper-warm);
}
table.book-table th,
table.book-table td {
  text-align: left;
  padding: 0.6rem 0.7rem;
  border-bottom: 1px solid var(--paper-dark);
  vertical-align: top;
}
table.book-table th {
  background: var(--paper-dark);
  color: var(--ink);
  font-family: 'Helvetica Neue', Arial, sans-serif;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
table.book-table tbody tr:hover { background: var(--paper); }

/* --- callout --- */
.callout {
  background: var(--paper-warm);
  border-left: 5px solid var(--accent);
  padding: 1rem 1.2rem;
  margin: 1.5rem 0;
}
.callout .label {
  display: inline-block;
  font-family: 'Courier New', monospace;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 0.3rem;
}

/* --- cross-link banner --- */
.crosslink {
  background: var(--blueprint);
  color: var(--paper);
  padding: 1.5rem;
  margin: 2rem 0;
  text-align: center;
}
.crosslink p { margin: 0.3rem 0; }
.crosslink a {
  color: var(--gold);
  font-weight: bold;
  text-decoration: none;
  border-bottom: 1px dashed var(--gold);
}

/* --- footer --- */
.site-footer {
  background: var(--ink);
  color: var(--paper-warm);
  padding: 1.5rem;
  text-align: center;
  font-size: 0.85rem;
  font-style: italic;
  margin-top: 3rem;
  border-top: 4px solid var(--blueprint);
}
.site-footer a { color: var(--gold); }

/* --- theme toggle --- */
.theme-toggle {
  position: fixed;
  top: 1rem; right: 1rem;
  background: var(--paper-warm);
  border: 2px solid var(--ink);
  font-family: 'Courier New', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  padding: 0.3rem 0.7rem;
  cursor: pointer;
  z-index: 100;
  text-transform: uppercase;
  color: var(--ink);
}
.theme-toggle:hover { background: var(--paper-dark); }

/* --- comparison columns --- */
.compare {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}
.compare > div {
  background: var(--paper-warm);
  border: 1px solid var(--paper-dark);
  padding: 1rem;
}
.compare h4 {
  margin: 0 0 0.6rem;
  font-family: 'Courier New', monospace;
  font-size: 0.9rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* --- ornament --- */
.ornament {
  text-align: center;
  font-family: Georgia, serif;
  color: var(--blueprint);
  font-size: 1.2rem;
  letter-spacing: 1rem;
  margin: 1.5rem 0;
}

/* --- figure images --- */
.figure {
  margin: 2rem 0;
  text-align: center;
}
.figure img {
  max-width: 100%;
  height: auto;
  border: 1px solid var(--rule);
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}
.figure .caption {
  font-family: 'Courier New', monospace;
  font-size: 0.8rem;
  color: var(--ink-faint);
  margin-top: 0.5rem;
  line-height: 1.4;
  text-align: center;
  max-width: 90%;
  margin-left: auto;
  margin-right: auto;
}

/* --- figure row (side-by-side images) --- */
.figure-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin: 2rem 0;
  align-items: stretch;
}
.figure-row .figure {
  margin: 0;
  display: flex;
  flex-direction: column;
}
.figure-row .figure > a,
.figure-row .figure > span {
  flex: 1;
}
.figure-row img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border: 1px solid var(--rule);
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

/* --- inline figure (float right) --- */
.figure-inline {
  float: right;
  width: 280px;
  margin: 0 0 1rem 1.5rem;
}
.figure-inline img { max-width: 100%; height: auto; border: 1px solid var(--rule); }
.figure-inline .caption {
  font-family: 'Courier New', monospace;
  font-size: 0.75rem;
  color: var(--ink-faint);
  margin-top: 0.4rem;
}

/* --- stage banner image --- */
.stage-banner {
  width: 100%;
  max-height: 320px;
  object-fit: cover;
  border: 2px solid var(--ink);
  margin: 1.5rem 0;
}

/* Clear floats */
main::after { content: ''; display: table; clear: both; }

/* --- responsive --- */
@media (max-width: 700px) {
  .site-title { font-size: 1.6rem; }
  .site-nav a { padding: 0.7rem 0.8rem; font-size: 0.75rem; }
  main { padding: 1.5rem 1rem 3rem; }
  .hero { padding: 1.2rem; }
  .timeline li { padding-left: 5rem; }
  .figure-inline { float: none; width: 100%; margin: 1.5rem 0; }
}