/* The Woozle Effect — one page, mobile first, light theme only. */

@font-face {
  font-family: "EB Garamond";
  src: url("fonts/EBGaramond-latin.woff2") format("woff2");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "EB Garamond";
  src: url("fonts/EBGaramond-Italic-latin.woff2") format("woff2");
  font-weight: 400 800;
  font-style: italic;
  font-display: swap;
}

:root {
  --paper: #F1E7D4;          /* the film's intertitle cream */
  --paper-deep: #E6D8BE;
  --ink: #2B231C;            /* warm near-black */
  --ink-soft: #5A4C3E;
  --accent: #7A1F2E;         /* the burgundy of the opening titles */
  --rule: #CDBB9C;
  --panel: rgba(241, 231, 212, 0.66);   /* the map shows faintly through the text */
  --measure: 34em;
  --fade: 800ms;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "EB Garamond", Garamond, "Iowan Old Style", Georgia, serif;
  font-size: 19px;
  line-height: 1.6;
  font-variant-ligatures: common-ligatures;
  font-kerning: normal;
}

/* ---------- the two worlds behind the page ---------- */

.world {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  height: 100vh;
  height: 100lvh;            /* no gap when the mobile URL bar collapses */
  z-index: -1;
  opacity: 0;
  transition: opacity var(--fade) ease;
  pointer-events: none;
}
.world img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}
.world-map { opacity: 1; }
body.after-film .world-map { opacity: 0; }
body.after-film .world-ai  { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  .world { transition: none; }
}

/* ---------- the page ---------- */

.panel {
  max-width: calc(var(--measure) + 3rem);
  margin: 0 auto;
  padding: 2.5rem 1.25rem 3rem;
  background: var(--panel);
}

@media (max-width: 47.99em) {
  /* phones: no margins, so the map shows through a little more */
  .panel { --panel: rgba(241, 231, 212, 0.60); }
}
@media (min-width: 48em) {
  body { font-size: 20px; }
  .panel {
    margin: 3rem auto;
    padding: 3.5rem 2.75rem 3.5rem;
    box-shadow: 0 0 0 1px rgba(122, 99, 66, 0.10), 0 1px 30px rgba(90, 70, 40, 0.10);
  }
}

p, ol, ul, figure, details { margin: 0 0 1.1em; }

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.16em;
}
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }

em { font-style: italic; }

.sr {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

/* ---------- masthead ---------- */

.masthead { margin-bottom: 2.4rem; text-align: center; }
.masthead h1 {
  font-weight: 500;
  font-size: 2.6rem;
  line-height: 1.1;
  letter-spacing: 0.01em;
  color: var(--accent);
  margin: 0 0 0.6rem;
}
@media (min-width: 48em) { .masthead h1 { font-size: 3.2rem; } }
.byline { font-size: 1.15rem; margin: 0 0 0.9rem; font-variant: small-caps; letter-spacing: 0.06em; }
.disclaimer-top {
  font-size: 0.86rem;
  line-height: 1.45;
  color: var(--ink-soft);
  margin: 0 auto 0.35rem;
  max-width: 30em;
}
.disclaimer-top { font-style: italic; }
.masthead::after {
  content: "";
  display: block;
  width: 5rem;
  margin: 1.6rem auto 0;
  border-top: 1px solid var(--rule);
}

/* ---------- essay ---------- */

.essay h2 {
  font-weight: 500;
  font-size: 1.45rem;
  line-height: 1.25;
  color: var(--accent);
  margin: 2.2em 0 0.7em;
}
.essay sup:not(.en-ref) { font-size: 0.7em; line-height: 0; }
.essay .opening { font-size: 1.12em; margin-bottom: 1.2em; }

/* footnotes: the jokes, revealed in place */
.fn-ref {
  font: inherit;
  font-size: 0.68em;
  line-height: 0;
  vertical-align: super;
  color: var(--accent);
  background: none;
  border: 0;
  cursor: pointer;
  /* a generous hit area without disturbing the line */
  padding: 1.1em 0.9em;
  margin: -1.1em -0.9em -1.1em -0.85em;   /* net zero width: the hit area overlaps, the line doesn't move */
  border-radius: 4px;
}
.fn-ref span[aria-hidden] {
  border-bottom: 1px dotted currentColor;
  padding: 0 0.08em;
}
.fn-ref[aria-expanded="true"] span[aria-hidden] { border-bottom-style: solid; }
.fn {
  font-size: 0.9em;
  line-height: 1.5;
  margin: -0.4em 0 1.1em;
  padding: 0.55em 0.9em;
  border-left: 2px solid var(--accent);
  background: rgba(230, 216, 190, 0.55);
}
.fn .fn-num { color: var(--accent); margin-right: 0.35em; }

/* endnotes: citations, numbered in Roman */
.en-ref {
  font-size: 0.66em;
  line-height: 0;
  vertical-align: super;
}
.en-ref a {
  text-decoration: none;
  padding: 1.1em 0.95em;
  margin: -1.1em -0.95em -1.1em -0.9em;
  border-radius: 4px;
}

/* ---------- film ---------- */

.film {
  margin: 2rem 0 1.6rem;
  text-align: center;
}
.film-title {
  font-size: 0.86rem;
  letter-spacing: 0.06em;
  line-height: 1.4;
  color: var(--ink-soft);
  margin: 0 0 0.8rem;
}
.film-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #111;
  box-shadow: 0 1px 2px rgba(0,0,0,0.12), 0 8px 30px rgba(60, 40, 20, 0.18);
}
.film video {
  display: block;
  width: 100%;
  height: 100%;
  background: #111;
}
.film-sentinel {           /* the line the background switch watches */
  position: absolute;
  left: 0; right: 0;
  top: 50%;
  height: 1px;
  pointer-events: none;
}
@media (min-width: 60em) {
  /* desktop: the film breaks slightly wider than the text */
  .film { margin-left: -3rem; margin-right: -3rem; }
}

.transcript {
  text-align: left;
  font-size: 0.92em;
  margin: 1rem 0 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.transcript summary {
  cursor: pointer;
  padding: 0.7em 0;
  color: var(--accent);
  list-style-position: inside;
}
.transcript ol { list-style: none; padding: 0; margin: 0 0 1em; }
.transcript li { margin: 0 0 0.45em; }
.transcript .who { font-variant: small-caps; letter-spacing: 0.05em; color: var(--ink-soft); }
.transcript .super { font-style: italic; }
.transcript .credits { margin-top: 1em; font-size: 0.92em; color: var(--ink-soft); }

/* ---------- notes ---------- */

.notes {
  margin-top: 3rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--rule);
  font-size: 0.86em;
  line-height: 1.5;
}
.notes h2 {
  font-weight: 500;
  font-size: 1.3rem;
  color: var(--accent);
  margin: 0 0 0.9em;
}
.notes ol { list-style: lower-roman; padding-left: 2.6em; }
.notes li { margin-bottom: 0.7em; padding-left: 0.2em; }
.notes li:target { background: rgba(122, 31, 46, 0.08); }
.notes li::marker { color: var(--accent); }
.notes a { overflow-wrap: anywhere; }
.notes .back {
  text-decoration: none;
  margin-left: 0.3em;
  padding: 0.3em 0.4em;
}

/* ---------- author ---------- */

.author {
  margin-top: 2.6rem;
  padding: 1.2rem 1.3rem;
  border: 1px solid var(--rule);
  font-size: 0.9em;
  line-height: 1.5;
}
.author p { margin: 0 0 0.7em; }
.author p:last-child { margin: 0; }
.author .disclaimer { font-style: italic; color: var(--ink-soft); }

