:root {
  color-scheme: light;
  --paper: #f3ede2;
  --ink: #1c1712;
  --quiet: rgba(28, 23, 18, 0.7);
  --hair: rgba(28, 23, 18, 0.16);
  --green: #16633f;
  --acid: #c4dc50;
  --red: #cd251a;
  --serif: "Fraunces", "Iowan Old Style", Georgia, serif;
  --mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
  --gutter: 20px;
}

/* Type rule: nothing on the page is set smaller than 14px. Text that is not
   worth reading at that size is removed rather than shrunk. */

* { box-sizing: border-box; }
html { background: var(--paper); }
body {
  margin: 0;
  min-width: 320px;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }
.on-photo :focus-visible { outline-color: #fff; }

.skip {
  position: fixed;
  z-index: 30;
  top: 8px;
  left: 8px;
  padding: 10px 14px;
  background: var(--ink);
  color: var(--paper);
  transform: translateY(-160%);
}
.skip:focus { transform: none; }

/* Masthead and chapter rail */
.masthead {
  position: fixed;
  z-index: 20;
  inset: 0 0 auto 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  padding: 0 var(--gutter);
  background: var(--paper);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  pointer-events: none;
  transition: color 300ms ease;
}
.motion .masthead { background: none; }
.masthead a { pointer-events: auto; text-decoration: none; }
.brand span { opacity: 0.7; }
.masthead__cta {
  padding: 7px 14px;
  border: 1px solid currentColor;
  border-radius: 999px;
}
.masthead__cta:hover { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.on-photo .masthead,
.on-photo .rail { color: #fff; }
.on-photo .masthead__cta:hover { background: #fff; border-color: #fff; color: var(--ink); }

.rail {
  position: fixed;
  z-index: 20;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: color 300ms ease;
}
.rail ol { display: flex; margin: 0; padding: 0; list-style: none; }
.rail a { display: flex; align-items: center; text-decoration: none; }
.rail i { display: block; background: currentColor; opacity: 0.3; transition: opacity 200ms ease, transform 200ms ease; }
.rail a[aria-current="true"] i { opacity: 1; }

/* Static document: no JavaScript, or reduced motion */
.scroller { padding-top: 56px; }
.stage__canvas { display: none; }
.cap {
  max-width: 680px;
  margin: 0 auto;
  padding: 56px var(--gutter);
  border-top: 1px solid var(--hair);
  scroll-margin-top: 56px;
}
.cap--hero { border-top: 0; padding-top: 24px; }
.still { margin: 0 0 32px; }
.still--photo img { width: 100%; border-radius: 10px; }
.still--ink img { mix-blend-mode: multiply; margin: 0 auto; }
.still--small img { max-height: 340px; width: auto; }
.pager { display: none; }

h1, h2, .lead {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -0.015em;
  text-wrap: balance;
}
h1 { font-size: clamp(36px, 5.4vw, 80px); line-height: 1.02; }
h2 { font-size: clamp(25px, 2.5vw, 40px); line-height: 1.14; }
.draft-label {
  width: fit-content;
  max-width: 100%;
  margin: 0 0 12px;
  padding: 7px 11px;
  border: 1px solid var(--green);
  border-radius: 3px;
  background: rgba(243, 237, 226, 0.94);
  color: var(--green);
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}
.lead { margin-bottom: 8px; color: var(--red); font-size: clamp(22px, 1.9vw, 28px); font-style: italic; }
.note { margin: 20px 0 0; max-width: 46ch; color: var(--quiet); }
.actions { margin: 24px 0 0; }
.button {
  display: inline-block;
  padding: 13px 22px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-decoration: none;
  text-transform: uppercase;
}
.button:hover { background: var(--ink); }
.contact { margin: 16px 0 0; overflow-wrap: anywhere; }

@media (max-width: 899px) {
  .rail { top: 14px; right: 124px; }
  .rail ol { gap: 2px; }
  .rail a { width: 12px; height: 28px; }
  .rail i { width: 100%; height: 3px; }
  .rail span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .brand span { display: none; }
  .contact a { display: block; }
}
@media (max-width: 360px) {
  .masthead { letter-spacing: 0.03em; }
  .rail { right: 116px; }
  .rail a { width: 9px; }
}
@media (min-width: 900px) {
  :root { --gutter: 40px; }
  .rail { top: 50%; right: 28px; transform: translateY(-50%); }
  .rail ol { flex-direction: column; align-items: flex-end; }
  .rail a { flex-direction: row-reverse; gap: 10px; height: 30px; }
  .rail i { width: 18px; height: 2px; transform-origin: right; }
  .rail span { opacity: 0; transition: opacity 200ms ease; }
  .rail a[aria-current="true"] i { transform: scaleX(1.7); }
  .rail a:hover span,
  .rail a:focus-visible span { opacity: 1; }
}

/* Chaptered stage: nothing scrolls; input selects a chapter and time plays it */
.motion,
.motion body { height: 100%; overflow: hidden; overscroll-behavior: none; }
.motion .scroller { padding-top: 0; }
.motion .stage {
  position: relative;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  touch-action: pan-x pinch-zoom;
}
.motion .stage__canvas { display: block; position: absolute; inset: 0; width: 100%; height: 100%; }
.motion .still { display: none; }
.motion .cap {
  --shift: 36px;
  position: absolute;
  inset: 57% var(--gutter) 76px var(--gutter);
  max-width: none;
  margin: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  transform: translate3d(0, calc(var(--shift) * -1), 0);
  pointer-events: none;
  transition: opacity 350ms ease, transform 350ms ease;
}
/* Captions before the current chapter rest above it, later ones below, so a
   forward step lifts the old caption away and raises the new one into place. */
.motion .cap.is-current ~ .cap { transform: translate3d(0, var(--shift), 0); }
/* The arriving caption waits for the leaving one, then stays until the reader moves on. */
.motion .cap.is-current {
  opacity: 1;
  transform: none;
  pointer-events: auto;
  transition: opacity 700ms ease var(--cap-delay, 450ms), transform 700ms cubic-bezier(.2, .7, .2, 1) var(--cap-delay, 450ms);
}
.motion .cap--reserve { top: 50%; }
.motion .cap--hero {
  inset: auto var(--gutter) 96px var(--gutter);
  color: #fff;
}
.motion .cap--hero .draft-label {
  border-color: rgba(255, 255, 255, 0.72);
  background: rgba(28, 23, 18, 0.78);
  color: #fff;
}

.motion .pager {
  position: fixed;
  z-index: 20;
  inset: auto var(--gutter) max(14px, env(safe-area-inset-bottom)) var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transition: color 300ms ease;
}
.on-photo .pager { color: #fff; }
.pager button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid currentColor;
  border-radius: 999px;
  background: none;
  color: inherit;
  font: 500 14px/1 var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
  transition: opacity 300ms ease 150ms;
}
.pager button:hover { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.on-photo .pager button:hover { background: #fff; border-color: #fff; color: var(--ink); }
.pager button:disabled { display: none; }
/* While a transformation plays the cue steps back; it returns once the chapter has settled. */
.is-moving .pager button { opacity: 0; pointer-events: none; transition: opacity 200ms ease; }
.pager__next { margin-left: auto; }
.pager__next span { display: inline-block; animation: nudge 1.8s ease-in-out infinite; }
@keyframes nudge { 50% { transform: translateY(4px); } }
.pager__status { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); margin: 0; }

@media (max-width: 899px) {
  .motion h2 { font-size: clamp(22px, 6.4vw, 28px); }
  .motion .note { margin-top: 12px; line-height: 1.45; }
  .motion .actions { margin-top: 14px; }
  .motion .contact { margin-top: 10px; }
}
@media (max-width: 899px) and (max-height: 720px) {
  .motion .cap { top: 58%; }
  .motion .cap--reserve { top: 47%; }
  .motion h2 { font-size: 22px; }
  .motion .note,
  .motion .contact { font-size: 15px; }
  .motion .button { padding: 11px 18px; }
  .motion .cap--hero { top: auto; bottom: 84px; }
}
@media (min-width: 900px) {
  .motion .cap {
    inset: 0 12% 0 60%;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
  .motion .cap--hero { inset: auto 30% 120px var(--gutter); display: block; }
  .motion .pager { inset: auto 12% 44px 60%; justify-content: flex-start; }
  .pager__next { margin-left: 0; }
}
