/* ─────────────────────────────────────────────────────────────
   "The Printed Word": an editorial deck about Gutenberg.
   Palette: rag paper, lampblack ink, rubricator's vermilion.
   ───────────────────────────────────────────────────────────── */

@font-face { font-family: 'Cormorant Garamond'; font-style: normal; font-weight: 300 700; font-display: block; src: url(assets/CormorantGaramond-normal-300_700.woff2) format('woff2'); }
@font-face { font-family: 'Cormorant Garamond'; font-style: italic; font-weight: 300 700; font-display: block; src: url(assets/CormorantGaramond-italic-300_700.woff2) format('woff2'); }
@font-face { font-family: 'EB Garamond'; font-style: normal; font-weight: 400 800; font-display: block; src: url(assets/EBGaramond-normal-400_800.woff2) format('woff2'); }
@font-face { font-family: 'EB Garamond'; font-style: italic; font-weight: 400 800; font-display: block; src: url(assets/EBGaramond-italic-400_800.woff2) format('woff2'); }
@font-face { font-family: 'UnifrakturMaguntia'; font-style: normal; font-weight: 400; font-display: block; src: url(assets/UnifrakturMaguntia-normal-400.woff2) format('woff2'); }

:root {
  --paper: #efe5cf;
  --paper-2: #e4d7bb;
  --ink: #1d1813;
  --ink-soft: #4a4036;
  --red: #b3261e;
  --display: 'Cormorant Garamond', 'Garamond', serif;
  --text: 'EB Garamond', 'Garamond', serif;
  --black: 'UnifrakturMaguntia', serif;
  --m: 120px;                        /* outer margin */
  --leaf: cubic-bezier(.66, 0, .22, 1);
}

html { background: #15110d; }
body { margin: 0; color: var(--ink); font-family: var(--text); }
h1, h2, p, figure, ol, blockquote { margin: 0; padding: 0; }
em { font-style: italic; }

/* ── the page ────────────────────────────────────────────────── */
.slide {
  width: 1920px; height: 1080px; overflow: hidden;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  column-gap: 40px;
  padding: 170px var(--m) 140px;
  box-sizing: border-box;
  background:
    radial-gradient(ellipse at 50% 45%, transparent 55%, rgba(120, 84, 40, .16) 100%),
    repeating-linear-gradient(90deg, transparent 0 158px, rgba(110, 80, 40, .07) 158px 160px),  /* chain lines */
    repeating-linear-gradient(0deg, rgba(110, 80, 40, .035) 0 1px, transparent 1px 6px),       /* laid lines */
    var(--paper);
}

.runhead {
  position: absolute; left: var(--m); right: var(--m); top: 52px;
  display: flex; justify-content: space-between; align-items: baseline;
  padding-bottom: 14px;
  border-bottom: 7px double var(--ink);
  font: 500 28px/1 var(--text); letter-spacing: .14em; text-transform: uppercase;
}
.runhead .mast { font: 400 40px/1 var(--black); letter-spacing: 0; text-transform: none; color: var(--red); }
.folio {
  position: absolute; left: var(--m); right: var(--m); bottom: 48px;
  border-top: 2px solid var(--ink); padding-top: 12px;
  font: italic 500 30px/1 var(--text); text-align: right;
}

.kicker {
  font: 600 28px/1.1 var(--text); letter-spacing: .2em; text-transform: uppercase; color: var(--red);
}
h2 {
  font: 600 112px/.92 var(--display); letter-spacing: -.015em;
}
h2 em { font-weight: 500; color: var(--red); }
.body { font: 400 38px/1.42 var(--text); hyphens: manual; }

/* ── transition: a leaf being turned ─────────────────────────────
   Forward: the new page slides over from the right, the old one sinks left.
   Back:    the current page lifts off to the right, revealing the one beneath.
   html[data-presi-direction] decides which page sits on top. */
.deck { perspective: 3200px; }
.slide {
  opacity: 1;
  transform-origin: 0 50%;
  transition: transform 1s var(--leaf), filter 1s var(--leaf), visibility 0s linear 1s;
  box-shadow: -30px 0 60px rgba(30, 18, 6, .35);
}
.slide.is-active  { visibility: visible; transform: none; z-index: 2; transition: transform 1s var(--leaf), filter 1s var(--leaf), visibility 0s; }
.slide.is-future  { transform: translateX(104%) rotateY(-14deg); z-index: 3; }
.slide.is-past    { transform: translateX(-22%); filter: brightness(.55) sepia(.4); z-index: 1; }
html[data-presi-direction="forward"] .slide.is-future { z-index: 1; }   /* going forward, the incoming page (active) is on top */
html[data-presi-direction="back"]    .slide.is-active { z-index: 2; }   /* going back, the leaving page (future, z 3) covers it while it turns away */

/* ── 1. cover ───────────────────────────────────────────────── */
.cover-text { grid-column: 1 / 8; align-self: center; display: flex; flex-direction: column; gap: 34px; }
.cover h1 { font: 700 268px/.8 var(--display); letter-spacing: -.035em; margin-left: -12px; }
.cover h1 em { font-weight: 500; color: var(--red); display: inline-block; padding-left: 190px; }
.cover .dek { margin-top: 70px; }
.cover .dek { font: italic 400 42px/1.3 var(--text); max-width: 820px; border-left: 6px solid var(--red); padding-left: 28px; }
.stick { grid-column: 8 / 13; align-self: center; display: flex; flex-direction: column; gap: 40px; margin-right: -20px; }
.stick svg { transform: rotate(-5deg); filter: drop-shadow(10px 12px 0 rgba(60, 40, 20, .18)); }
.stick svg { width: 100%; display: block; }
.stick figcaption { font: italic 400 32px/1.3 var(--text); color: var(--ink-soft); }

/* ── 2. system / drop cap / wipe steps ──────────────────────── */
.system .col-main { grid-column: 1 / 7; display: flex; flex-direction: column; gap: 40px; align-self: center; }
.dropcap::first-letter {
  initial-letter: 3;
  font-family: var(--black); color: var(--red);
  margin-right: 22px;
}
.parts { grid-column: 8 / 13; list-style: none; align-self: center; border-bottom: 2px solid var(--ink); }
.parts li {
  display: grid; grid-template-columns: 90px 1fr; column-gap: 12px; row-gap: 4px;
  padding: 24px 0 26px; border-top: 2px solid var(--ink);
}
.parts .num { grid-row: span 2; font: italic 600 64px/.9 var(--display); color: var(--red); }
.parts b { font: 600 42px/1.05 var(--text); }
.parts li > span:last-child { font: italic 400 32px/1.25 var(--text); color: var(--ink-soft); }

/* wipe: a line of type being set, left to right */
.wipe { opacity: 1; clip-path: inset(0 100% 0 0); transition: clip-path .9s var(--leaf), border-color .4s; }
.wipe.is-shown { opacity: 1; clip-path: inset(0 -20px 0 0); }
.parts li.is-current { border-top-color: var(--red); border-top-width: 6px; padding-top: 20px; }

/* ── 3. the 42-line Bible / stamp steps ─────────────────────── */
.leaf { grid-column: 1 / 6; align-self: center; justify-self: start; height: 780px; }
.leaf svg { height: 100%; display: block; outline: 2px solid var(--ink); box-shadow: 16px 16px 0 -2px var(--paper-2), 16px 16px 0 0 var(--ink); }
.figures { grid-column: 6 / 13; align-self: center; padding-left: 40px; }
.figures h2 { font-size: 96px; margin-bottom: 30px; }
.fig { display: grid; grid-template-columns: 330px 1fr; align-items: center; column-gap: 34px; padding: 10px 0; border-top: 2px solid var(--ink); }
.fig .big { font: 600 156px/1 var(--display); font-variant-numeric: lining-nums; text-align: right; letter-spacing: -.02em; }
.fig .big.red { color: var(--red); }
.fig .cap { font: italic 400 34px/1.25 var(--text); }

/* stamp: the platen comes down and bites the paper */
.stamp { opacity: 0; transform: scale(1.22); filter: blur(10px); transform-origin: 20% 50%;
  transition: opacity .2s, transform .5s cubic-bezier(.55, 0, .25, 1.35), filter .4s; }
.stamp.is-shown { opacity: 1; transform: none; filter: none; }

/* draw: the 42-line bracket is ruled in, like a rubricator's pen */
.count { opacity: 1; }
.count path { stroke-dasharray: 680; stroke-dashoffset: 680; transition: stroke-dashoffset 1.1s var(--leaf); }
.count text { opacity: 0; transition: opacity .4s .6s; }
.count.is-shown path { stroke-dashoffset: 0; }
.count.is-shown text { opacity: 1; }

/* ── 4. spread / rise steps ─────────────────────────────────── */
.spread h2 { grid-column: 1 / 11; align-self: start; }
.timeline { position: absolute; left: var(--m); top: 340px; width: 1680px; height: 560px; overflow: visible; }
.timeline .axis line { stroke: var(--ink); stroke-width: 4; }
.timeline .ticks line { stroke: var(--ink); stroke-width: 3; }
.timeline .ticks text { font: italic 500 30px var(--text); fill: var(--ink); }
.ev line { stroke: var(--ink); stroke-width: 3; }
.ev:first-of-type line { stroke: var(--red); stroke-width: 6; }
.ev .city { font: 600 40px var(--text); font-variant: small-caps; letter-spacing: .04em; fill: var(--ink); }
.ev .yr { font: italic 400 30px var(--text); fill: var(--red); }

/* rise: ink climbs up from the axis */
.rise { opacity: 1; clip-path: inset(100% -40px 0 -40px); transition: clip-path 1s var(--leaf); }
.rise.is-shown { opacity: 1; clip-path: inset(-40px -40px -40px -40px); }
.rise[data-step="2"] + .rise[data-step="2"], .rise[data-step="3"] + .rise[data-step="3"] { transition-delay: .18s; }

.tally { position: absolute; right: var(--m); top: 590px; text-align: right; display: flex; flex-direction: column; gap: 6px; }
.tally .big { font: 700 124px/1 var(--display); color: var(--red); letter-spacing: -.02em; font-variant-numeric: lining-nums; }
.tally .big sup { font-size: .45em; vertical-align: .9em; }
.tally .cap { font: italic 400 36px/1.2 var(--text); }

/* ── 5. pull quote / rubric underline ───────────────────────── */
.pull { grid-column: 1 / 9; align-self: center; position: relative; padding-left: 150px; }
.pull .mark { position: absolute; left: -10px; top: -110px; font: 700 420px/1 var(--display); color: var(--red); }
.pull p { font: italic 500 92px/1.04 var(--display); letter-spacing: -.01em; }
.pull cite { display: block; margin-top: 44px; font: 500 32px/1 var(--text); font-style: normal; letter-spacing: .12em; text-transform: uppercase; }
.pull cite i { text-transform: none; letter-spacing: 0; font-size: 36px; }

/* the rubricator's red underline, drawn across each line in turn */
.rubric {
  opacity: 1;
  background: linear-gradient(var(--red), var(--red)) 0 92% / 0% 7px no-repeat;
  transition: background-size 1.4s var(--leaf), color .6s;
}
.rubric.is-shown { opacity: 1; background-size: 100% 7px; color: var(--red); }

.sidebar { grid-column: 10 / 13; align-self: center; border-top: 14px solid var(--red); border-bottom: 2px solid var(--ink); padding: 26px 0 34px; display: flex; flex-direction: column; gap: 10px; }
.sidebar .big { font: 700 170px/1 var(--display); font-variant-numeric: lining-nums; }
.sidebar p:last-child { font: 400 36px/1.3 var(--text); }
.wipe-down { opacity: 1; clip-path: inset(0 0 100% 0); transition: clip-path 1s var(--leaf); }
.wipe-down.is-shown { opacity: 1; clip-path: inset(0); }

/* ── 6. colophon / tapered text with shape-outside ──────────── */
.explicit { grid-column: 1 / 7; align-self: center; }
.explicit .blk { display: block; font: 400 250px/1 var(--black); color: var(--red); margin-left: -8px; }
.explicit .kicker { color: var(--ink); margin-top: 14px; font-style: italic; text-transform: none; letter-spacing: .02em; font-size: 36px; font-weight: 400; max-width: 640px; line-height: 1.3; }
.taper { grid-column: 7 / 13; align-self: center; height: 500px; }
.taper::before, .taper p::before { content: ''; height: 500px; width: 50%; }
.taper::before { float: right; shape-outside: polygon(100% 0, 100% 100%, 0 100%); }
.taper p::before { float: left; shape-outside: polygon(0 0, 100% 100%, 0 100%); }
.taper p { font: 400 58px/1.2 var(--text); text-align: center; hyphens: auto; height: 100%; }
.taper p em { color: var(--red); }
.taper .pil { color: var(--red); font-weight: 600; }
