@font-face { font-family: "Saira Extra Condensed"; src: url(fonts/saira-extra-condensed-latin-800-normal.woff2) format("woff2"); font-weight: 800; font-display: swap; }
@font-face { font-family: Geist; src: url(fonts/geist-latin-400-normal.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url(fonts/geist-mono-latin-400-normal.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: Spectral; src: url(fonts/spectral-latin-300-normal.woff2) format("woff2"); font-weight: 300; font-display: swap; }
/* holds the name's width while the real face loads, so nothing jumps */
@font-face { font-family: "Name Fallback"; src: local("Arial Narrow"), local("Arial"); size-adjust: 72%; }

:root {
  --void: #05030a;
  --ink: #efeaf8;
  --violet: #7b3ff2;
  --magenta: #ff2d87;
  --green: #3dff9a;
  --rule: 1px solid rgb(123 63 242 / .7);
  --edge: clamp(1.25rem, 3.5vw, 4rem);
  --pad: clamp(1.25rem, 2.6vw, 2.25rem);
  --side: clamp(14rem, 24vw, 26rem);
  --body: clamp(1.2rem, 1.1rem + .4vw, 1.5rem);
  --label: clamp(1.1rem, 1.05rem + .2vw, 1.3rem);
  --serif: Spectral, Georgia, serif;
  --sans: Geist, system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, monospace;
  --display: "Saira Extra Condensed", "Name Fallback", sans-serif;
}

* { box-sizing: border-box; margin: 0; }
html { background: var(--void); color: var(--ink); -webkit-text-size-adjust: 100%; }
body { font: 400 var(--body)/1.35 var(--sans); overflow-x: clip; }
::selection { background: var(--magenta); color: #000; }
a { color: var(--green); text-underline-offset: .15em; }

/* one sheet: every block starts on a full-width rule and on the same left edge */
main > * { padding: var(--pad) var(--edge); }
main > * + * { border-top: var(--rule); }

/* the hero stops short of the fold, so the statement is always on the first screen */
.hero { display: grid; grid-template-columns: auto 1fr; gap: clamp(1.5rem, 4vw, 4rem); align-items: end; padding-top: clamp(.75rem, 2vh, 1.5rem); }
h1 { font: 800 min(31vw, 44svh)/.78 var(--display); letter-spacing: -.012em; color: var(--green); margin-left: -.035em; padding-top: .06em; }
.hook { display: grid; gap: .8rem; padding-bottom: .4rem; }
.lead { font-size: clamp(1.8rem, 1.2rem + 1.9vw, 3.4rem); line-height: 1.08; letter-spacing: -.03em; text-wrap: balance; }

.first { font: 800 min(16.4vw, 27svh)/.9 var(--display); color: var(--magenta); letter-spacing: -.01em; }
/* a longer headline runs at half size so it still sits on one line on wide screens */
.first.long { font-size: min(8.2vw, 14svh); text-wrap: balance; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 0 clamp(1.5rem, 4vw, 4rem); margin-top: 1rem; }
.pair p { max-width: 34em; text-wrap: pretty; }

.row { display: grid; grid-template-columns: var(--side) 1fr; gap: 1rem clamp(1.5rem, 3vw, 3rem); }
.row header span { display: block; font: 400 var(--label)/1.3 var(--mono); color: var(--green); }
h2 { font: 800 clamp(2.4rem, 1.7rem + 2.2vw, 4rem)/1 var(--display); text-wrap: balance; }

dl { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem clamp(1.5rem, 3vw, 3rem); }
dl > div { border-top: var(--rule); padding-top: .7rem; }
dt { font: 400 var(--label)/1.3 var(--mono); color: var(--green); margin-bottom: .25rem; }
dd { margin: 0; text-wrap: pretty; }

.prose p { max-width: 40em; text-wrap: pretty; }
.prose p + p { margin-top: .8em; }

/* her own writing: the one place the serif appears, so a reader can tell when she is speaking */
.voice p, .her { font: 300 clamp(1.45rem, 1.2rem + 1.1vw, 2.2rem)/1.26 var(--serif); max-width: 30em; text-wrap: pretty; }
.voice p + p { margin-top: .55em; }
.prose .her { margin-top: .7em; }

/* the one solid block of her color on the page, and it belongs to her own words */
.words { background: var(--violet); color: #fff; }
.words header span { color: #fff; }

/* Carrie: the only red on the page and the only thing that moves. Finished is the default state, so
   with no script or with reduced motion she is simply there; carrie.js holds her back until she is seen. */
.carrie { --blood: #9c0a16; --red: #ff2230; --top: clamp(9rem, 17vw, 16rem); position: relative; display: grid; grid-template-columns: auto 1fr; gap: clamp(1.5rem, 4vw, 4rem); align-items: end; padding-top: var(--top); border-top-color: var(--blood); }
.carrie > :not(.blood) { position: relative; }
.carrie h2 { font-size: min(24vw, 34svh); line-height: .8; color: var(--red); margin-left: -.03em; }
.carrie .lead { max-width: 20em; padding-bottom: .4rem; }
.tale { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem clamp(1.5rem, 4vw, 4rem); margin-top: clamp(1rem, 2vw, 2rem); }
.tale p { max-width: 34em; text-wrap: pretty; }
.tale p + p { margin-top: .8em; }
.carrie .last { grid-column: 1 / -1; color: var(--red); }

.blood { position: absolute; inset: 0; pointer-events: none; }
.blood::before { content: ""; position: absolute; inset: 0 0 auto; height: .3rem; background: var(--blood); }
.blood i { --r: calc(var(--w) * .9); position: absolute; top: .3rem; left: var(--x); width: var(--w); height: var(--h); background: var(--blood); border-radius: 0 0 var(--w) var(--w); }
/* where a drip leaves the line it flares, so it reads as liquid and not a bar */
.blood i::before { content: ""; position: absolute; top: 0; left: calc(var(--r) * -1); right: calc(var(--r) * -1); height: var(--r); background:
  radial-gradient(circle at 0 100%, transparent calc(var(--r) - .5px), var(--blood) var(--r)) left / var(--r) 100% no-repeat,
  radial-gradient(circle at 100% 100%, transparent calc(var(--r) - .5px), var(--blood) var(--r)) right / var(--r) 100% no-repeat; }
/* the weight that gathers at the tip */
.blood i::after { content: ""; position: absolute; left: 50%; bottom: 0; width: calc(var(--w) * 1.7); height: calc(var(--w) * 2.6); translate: -50% 0; background: var(--blood); border-radius: 50% 50% 50% 50% / 62% 62% 38% 38%; }
.blood i:nth-child(1) { --x: 5%;  --w: .5rem;  --h: calc(var(--top) * 0.42); --t: 3.6s; --d: .5s; }
.blood i:nth-child(2) { --x: 13%; --w: .28rem; --h: calc(var(--top) * 0.66); --t: 5s;   --d: 1.3s; }
.blood i:nth-child(3) { --x: 26%; --w: .7rem;  --h: calc(var(--top) * 0.5); --t: 4.2s; --d: .2s; }
.blood i:nth-child(4) { --x: 37%; --w: .32rem; --h: calc(var(--top) * 0.72); --t: 5.4s; --d: .9s; }
.blood i:nth-child(5) { --x: 54%; --w: .8rem;  --h: calc(var(--top) * 1.2); --t: 6s;   --d: .1s; }
.blood i:nth-child(6) { --x: 64%; --w: .36rem; --h: calc(var(--top) * 0.85); --t: 4.6s; --d: 1.6s; }
.blood i:nth-child(7) { --x: 79%; --w: .6rem;  --h: calc(var(--top) * 1.07); --t: 5.6s; --d: .6s; }
.blood i:nth-child(8) { --x: 93%; --w: .3rem;  --h: calc(var(--top) * 0.6); --t: 4s;   --d: 1.1s; }

.carrie.armed:not(.run) { border-top-color: var(--violet); }
.carrie.armed:not(.run) h2 { color: var(--green); }
.carrie.armed:not(.run) .blood { visibility: hidden; }
.carrie.run { animation: bleed .6s ease-in backwards; }
.carrie.run h2 { animation: turn 1.6s ease-in .5s backwards; }
.carrie.run .blood::before { animation: spread .9s ease-out backwards; }
.carrie.run .blood i { animation: run var(--t) cubic-bezier(.3, .2, .15, 1) var(--d) backwards; }
.carrie.run .blood i::before { animation: seep .8s ease-out var(--d) backwards; }
.carrie.run .blood i::after { animation: gather 1s ease-out var(--d) backwards; }
@keyframes bleed { from { border-top-color: var(--violet); } }
@keyframes turn { from { color: var(--green); } }
@keyframes spread { from { scale: 1 0; transform-origin: top; } }
@keyframes run { from { height: 0; } }
@keyframes seep { from { opacity: 0; } }
@keyframes gather { from { scale: 0; } }

/* the page ends as loud as it opens */
.close > p { min-width: 0; }
.mail { display: block; margin-top: .15em; font: 800 min(13.4vw, 27svh)/.95 var(--display); white-space: nowrap; }
.mail a { text-decoration-thickness: .03em; }

/* narrower windows: one column for the sheet, the spec cells stay paired while they fit */
@media (max-width: 62rem) {
  .row { grid-template-columns: 1fr; }
  .row header { display: flex; gap: .75rem; align-items: baseline; }
  .mail { font-size: min(20vw, 27svh); }
  .blood i:nth-child(5) { --h: calc(var(--top) * .9); }
  .blood i:nth-child(7) { --h: calc(var(--top) * .8); }
}
@media (max-width: 44rem) {
  .hero { grid-template-columns: 1fr; gap: 1rem; }
  h1 { font-size: min(49vw, 44svh); }
  .first { font-size: min(19vw, 24svh); }
  .first.long { font-size: min(13vw, 18svh); }
  .pair { grid-template-columns: 1fr; gap: .8rem; }
  dl { grid-template-columns: 1fr; gap: 1rem; }
  .carrie { --top: 8rem; grid-template-columns: 1fr; gap: .9rem; }
  .tale { grid-template-columns: 1fr; }
  .carrie h2 { font-size: min(44vw, 34svh); }
  /* the name fills the width here, so every drip stops above it */
  .blood i:nth-child(n) { --h: calc(var(--top) * .62); }
  .blood i:nth-child(2), .blood i:nth-child(6) { --h: calc(var(--top) * .42); }
  .blood i:nth-child(5), .blood i:nth-child(7) { --h: calc(var(--top) * .76); }
}
@media (max-width: 30rem) {
  .first { font-size: min(23vw, 24svh); }
}
/* short windows: give height back so the next section still shows on the first screen */
@media (min-width: 44.01rem) and (max-height: 50rem) {
  h1 { font-size: min(31vw, 36svh); }
  .first { font-size: min(16.4vw, 20svh); }
  .first.long { font-size: min(8.2vw, 11svh); }
}
