@font-face { font-family: "Cathdra"; src: url("fonts/cathdra.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "IM Fell English"; src: url("fonts/IMFellEnglish-Regular.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "IM Fell English"; font-style: italic; src: url("fonts/IMFellEnglish-Italic.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "IM Fell Double Pica"; font-style: italic; src: url("fonts/IMFellDoublePica-Italic.woff2") format("woff2"); font-display: swap; }

:root {
  --ink: #111;
  --red: #D81220;
  --paper: #FFFFFF;
  --hero: "Cathdra", "IM Fell English", Georgia, serif;
  --body: "IM Fell English", Georgia, serif;
  --voice: "IM Fell Double Pica", "IM Fell English", Georgia, serif;

  /* scroll lengths: change these to make the page longer or shorter */
  --gap: 408vh;         /* "Step into my world." down to Second Opinion; the handstand woman sits halfway */
  --gap-mid: 286vh;     /* Second Opinion to First Rodeo, First Rodeo to The Rest of Me */
  --gap-pre: 270vh;     /* the last section down to where the woman starts to fall */
  --gap-short: 60vh;    /* from the seal down to "Step into my world." */
  --drift: 652vh;       /* her pinned stretch: 340vh of fall, 212vh hanging, then 100vh with the quote showing (keep in step with FALL/HANG/HOLD in site.js) */
  --gap-last: 298vh;    /* from the Milton quote down to the footer */
}

* { box-sizing: border-box; }
html {
  background: var(--paper);
  color: var(--ink);
  color-scheme: light;
  cursor: url("img/cursor.png") 13 11, auto;
  cursor: -webkit-image-set(url("img/cursor.png") 1x, url("img/cursor@2x.png") 2x) 13 11, auto;
  cursor: image-set(url("img/cursor.png") 1x, url("img/cursor@2x.png") 2x) 13 11, auto;
}
/* the hand is the only pointer on the page, links included */
a, a *, button { cursor: inherit; }
body {
  margin: 0;
  font-family: var(--body);
  font-size: 18px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
a { color: var(--red); text-decoration: none; }
::selection { background: var(--red); color: var(--paper); }

/* ---------- hero ---------- */
.hero {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6vh 6vw 8vh;
}
.seal {
  position: relative;
  width: min(440px, 74vw, 52vh);
  aspect-ratio: 880 / 754;
}
.seal img { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; }
.seal img.on { opacity: 1; }
.name {
  margin: 3vh 0 0;
  font-family: var(--hero);
  font-weight: normal;
  font-size: clamp(44px, 7.4vw, 92px);
  line-height: 1;
  letter-spacing: .01em;
  text-align: center;
}
.name a { color: var(--ink); }

/* ---------- the long white stretches ---------- */
.gap { height: var(--gap); display: flex; align-items: center; justify-content: center; }
.gap-mid { height: var(--gap-mid); }
.gap-pre { height: var(--gap-pre); }
.gap-short { height: var(--gap-short); }
.gap-last { height: var(--gap-last); }

/* ---------- quotes (opening and closing share one style) ---------- */
.quote { margin: 0 auto; padding: 0 6vw; max-width: 880px; text-align: center; }
.quote p { margin: 0; font-size: clamp(24px, 3vw, 40px); line-height: 1.25; text-wrap: balance; }
.quote footer { margin-top: .7em; font-family: var(--voice); font-style: italic; font-size: clamp(18px, 1.6vw, 23px); }
.quote cite { font-style: italic; }

/* ---------- sections ---------- */
.sec {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 6vw;
  font-size: clamp(17px, 1.25vw, 19px);
  line-height: 1.5;
}
.sec::after { content: ""; display: block; clear: both; }
.sec h2 {
  margin: 0 0 .3em;
  font-family: var(--hero);
  font-weight: normal;
  font-size: clamp(34px, 3.4vw, 50px);
  line-height: 1.05;
  color: var(--red);
}
.sec p { margin: 0 0 .7em; }
.sec .go { margin-top: 1em; font-family: var(--voice); font-style: italic; font-size: 1.12em; }
.sec .go a { display: inline-flex; align-items: center; gap: .45em; }
.sec .go .lbl { border-bottom: 1px solid var(--red); padding-bottom: 1px; }
/* the archer's arrow sits after each link, aimed back at it: every few seconds it draws back and shoots toward the words */
.tw { display: inline-flex; transform: scaleX(-1); }
.arw { width: 1em; height: .5em; overflow: visible; flex: none; position: relative; top: .06em; animation: loose 3.2s cubic-bezier(.2,.7,.2,1) infinite; }
.arw * { fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.arw .solid { fill: currentColor; stroke: none; }
.go a:hover .arw { animation: loose-hover .5s cubic-bezier(.2,.7,.2,1) forwards; }
@keyframes loose { 0%, 62% { transform: translateX(0); } 68% { transform: translateX(-2px); } 74% { transform: translateX(5px); } 100% { transform: translateX(0); } }
@keyframes loose-hover { 0% { transform: translateX(-2px); } 100% { transform: translateX(4px); } }
.sec p:not(.go) a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.sec p:last-child { margin-bottom: 0; }

/* the copy follows the edge of each stamp; the script centres it on the stamp's middle */
.stamp {
  shape-image-threshold: .35;
  shape-margin: 34px;
}
.sec-so .stamp { float: right; width: 50%; margin-left: 4%; shape-outside: url("img/stamp-wolf.webp"); }
.sec-fr .stamp { float: left;  width: 27%; margin-right: 4%; shape-outside: url("img/stamp-studying.webp"); }
.sec-me .stamp { float: left;  width: 40%; margin-right: 4%; shape-outside: url("img/stamp-fox.webp"); }

/* fade-ins on their own clock (the script adds .on once a piece is in view; it stays) */
.js .w { opacity: 0; transition: opacity 1.4s ease; }
.js .copy h2 { opacity: 0; transition: opacity 1.8s ease; }
.js .on .w, .js .copy.on h2 { opacity: 1; }
.js .stamp, .js .critter img { opacity: 0; filter: blur(6px); transition: opacity 2.8s ease, filter 2.8s ease; }
.js .stamp.on, .js .critter img.on { opacity: 1; filter: none; }
.js .go .lbl { border-bottom-color: transparent; transition: border-color 1.4s ease var(--d, 0s); }
.js .go .tw { opacity: 0; transition: opacity 1.4s ease var(--d, 0s); }
.js .on .go .lbl { border-bottom-color: var(--red); }
.js .on .go .tw { opacity: 1; }

/* ---------- creatures, halfway down each white stretch ---------- */
.critter { margin: 0; }
.critter img { height: clamp(120px, 13vw, 180px); width: auto; }
.critter.flip img { transform: scaleX(-1); }

/* ---------- finale ---------- */
.finale { position: relative; }
.stage {
  position: sticky; top: 0; z-index: 1;
  height: 100vh; height: 100svh;
  overflow: hidden;
  pointer-events: none;
}
.faller {
  position: absolute; left: 50%; top: 4vh;
  width: min(560px, 80vw, 50vh);
  transform: translate(-50%, -58vh);
  will-change: transform;
}
.drift { height: var(--drift); }
.quote-end { position: absolute; left: 0; right: 0; top: calc(4vh + min(560px, 80vw, 50vh) * 1008 / 1024 + 4vh); }

/* ---------- footer ---------- */
.foot {
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: .3em .9em;
  padding: 0 6vw 10vh;
  font-family: var(--voice); font-style: italic;
  font-size: clamp(19px, 1.7vw, 24px);
}
.foot .star { width: .7em; height: .7em; color: var(--ink); }

/* ---------- phones: picture above the words, no wrapping ---------- */
@media (max-width: 720px) {
  .sec { font-size: 18px; }
  .sec h2 { font-size: 36px; }
  .sec .stamp { float: none; shape-outside: none; margin: 0 auto 2.2em; }
  .sec-so .stamp { width: 72%; }
  .sec-fr .stamp { width: 40%; }
  .sec-me .stamp { width: 56%; }
  .sec .copy { padding-top: 0 !important; }
  .sec .stamp { margin-top: 0 !important; }
  .foot { font-size: 16px; gap: .3em .55em; flex-wrap: nowrap; white-space: nowrap; }
}

@media (prefers-reduced-motion: reduce) {
  .arw { animation: none !important; }
  .faller { transform: translate(-50%, 0) rotate(12deg) !important; }
}
