/* getprolific.bio: one screen of living water around the flower.
   Deck palette: warm ink and bone, the flower's blues and gold, and its
   teal/rose fringe as the only glitch colours. Nothing flashes; things fade.
   Fonts are subset to what the page uses (tools/fonts.py); a changed font
   gets a new file name, since fonts are cached for a year. */

@font-face { font-family: "Newsreader"; src: url(../fonts/Newsreader.v2.woff2) format("woff2"); font-weight: 300 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Geist"; src: url(../fonts/Geist.v2.woff2) format("woff2"); font-weight: 400 500; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url(../fonts/GeistMono-aa.v2.woff2) format("woff2"); font-weight: 400; font-display: block; }

:root {
  color-scheme: dark;
  --ink: #17130e;
  --bone: #efe7d8;
  --bone-2: #d8cebd;
  --muted: #a89c88;
  --blue: #8bb0e7;
  --gold: #f1c76e;
  --teal: #5fc4b0;
  --rose: #d9707f;
  --ochre: #cf9d4c;
  --bar: #5b5249;
  --rule: rgba(168, 156, 136, .16);
  --serif: "Newsreader", "Iowan Old Style", Georgia, serif;
  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --pad: clamp(20px, 4.5vw, 64px);
  --ease: cubic-bezier(.2, .7, .1, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--ink); }
body { margin: 0; background: var(--ink); color: var(--bone); font: 400 16px/1.5 var(--sans); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
::selection { background: var(--blue); color: var(--ink); }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }

.stage {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
  isolation: isolate;
}
.pond { position: absolute; inset: 0; z-index: -1; overflow: hidden; }
.pond canvas { position: absolute; left: 0; top: 0; display: block; }
/* pinch zoom always stays the browser's; when the page fits and there is
   nothing to scroll, one finger on the water plays with it */
.pond { touch-action: pan-x pan-y pinch-zoom; }
.fits .pond { touch-action: pinch-zoom; }

/* no WebGL: the letters drawn once, and a brighter copy of them under slow
   bands of light the compositor moves */
.no-gl #pond { display: none; }
.fb-lit {
  -webkit-mask-image: repeating-linear-gradient(118deg, transparent 0 9%, #000 15%, transparent 21% 34%, rgba(0, 0, 0, .55) 39%, transparent 44% 50%);
  mask-image: repeating-linear-gradient(118deg, transparent 0 9%, #000 15%, transparent 21% 34%, rgba(0, 0, 0, .55) 39%, transparent 44% 50%);
  -webkit-mask-size: 220% 220%; mask-size: 220% 220%;
  animation: fb-light 60s linear infinite;
}
@keyframes fb-light { from { -webkit-mask-position: 0 0; mask-position: 0 0; } to { -webkit-mask-position: 100% 60%; mask-position: 100% 60%; } }
.pond-flower { position: absolute; left: 0; top: 0; image-rendering: pixelated; }
/* without JavaScript: the flower alone, where it usually sits */
.pond-flower.still { width: min(380px, 26vw, 46vh); height: auto; transform: none; left: auto; right: 13vw; top: 18vh; }
@media (max-width: 700px) { .pond-flower.still { width: min(240px, 56vw); right: 10vw; top: 8vh; } }

/* the readout: what the pointer rests on */
.probe {
  position: fixed; left: 0; top: 0; z-index: 20;
  pointer-events: none;
  width: max-content; max-width: min(320px, calc(100vw - 24px));
  font: 400 13px/1.4 var(--sans); color: var(--muted);
  background: rgba(23, 19, 14, .9);
  padding: 7px 10px 8px; border-radius: 2px;
  opacity: 0; transition: opacity .3s;
}
.probe.on { opacity: 1; }
.probe b { display: block; font-weight: 500; color: var(--bone); }
.probe span { display: block; }

/* reading with the keyboard: one button, shown when it has focus */
.explore {
  position: absolute; left: var(--pad); top: max(16px, env(safe-area-inset-top));
  font: 400 13px/1 var(--sans); color: var(--bone);
  background: rgba(23, 19, 14, .9); border: 1px solid rgba(168, 156, 136, .4); border-radius: 2px;
  padding: 9px 12px; cursor: pointer;
  opacity: 0; pointer-events: none;
}
.explore:focus-visible, .explore[aria-pressed="true"] { opacity: 1; pointer-events: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* an empty inline-block: its bottom is the baseline of its line */
.bl { display: inline-block; width: 0; height: 0; }

/* ---- the words ---- */
/* only the words take the pointer; the space around them is water */
.copy {
  padding: 0 max(var(--pad), env(safe-area-inset-right)) calc(clamp(76px, 11vh, 120px) + env(safe-area-inset-bottom)) max(var(--pad), env(safe-area-inset-left));
  max-width: 1100px;
  pointer-events: none;
}
.copy > * { pointer-events: auto; width: fit-content; }
.word {
  margin: 0 0 0 -0.04em;
  /* one continuous scale: about 80px on a small phone, 120 at 640px, 252 at most */
  font: 400 clamp(76px, calc(12.8vw + 39px), 252px)/.84 var(--serif);
  font-variation-settings: "opsz" 72;
  /* no letter-spacing here: Chrome drops the fi ligature when it is set */
  color: var(--bone);
  animation: settle 1.2s var(--ease) .1s both;
}
/* the wordmark comes into focus: a colour fringe closes in and is gone; at
   rest it is clean */
@keyframes settle {
  0% { opacity: 0; text-shadow: -8px 0 rgba(95, 196, 176, 0), 8px 0 rgba(217, 112, 127, 0); }
  35% { opacity: 1; text-shadow: -4px 0 rgba(95, 196, 176, .35), 4px 0 rgba(217, 112, 127, .35); }
  100% { opacity: 1; text-shadow: 0 0 rgba(95, 196, 176, 0), 0 0 rgba(217, 112, 127, 0); }
}
@keyframes appear { from { opacity: 0; } to { opacity: 1; } }

.line {
  margin: clamp(18px, 2.6vh, 30px) 0 0;
  font: 300 clamp(20px, calc(1.2vw + 16px), 34px)/1.2 var(--serif);
  font-variation-settings: "opsz" 36;
  color: var(--bone-2);
  max-width: 22em;
  text-wrap: balance;
  animation: appear .7s ease-out .3s both;
}
.reach { margin: clamp(20px, 3vh, 34px) 0 0; font: 400 15px/1.4 var(--sans); animation: appear .7s ease-out .45s both; }
.reach a { position: relative; color: var(--muted); text-decoration: none; border-bottom: 1px solid rgba(168, 156, 136, .35); padding-bottom: 2px; transition: color .2s, border-color .2s; }
.reach a::after { content: ""; position: absolute; inset: -10px -6px; } /* a generous target, drawn nowhere */
.reach a:hover { color: var(--bone); border-bottom-color: var(--bone); }

.foot {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px 24px; flex-wrap: wrap;
  padding: 0 max(var(--pad), env(safe-area-inset-right)) calc(clamp(18px, 3vh, 28px) + env(safe-area-inset-bottom)) max(var(--pad), env(safe-area-inset-left));
  font: 400 13px/1 var(--sans); color: var(--muted);
  font-variant-numeric: tabular-nums;
  animation: appear .7s ease-out .55s both;
}
.foot p { margin: 0; display: flex; align-items: baseline; gap: 12px; }
.foot .meta { gap: 20px; }
.foot a { text-decoration: underline; text-decoration-color: rgba(168, 156, 136, .35); text-underline-offset: 3px; transition: color .2s, text-decoration-color .2s; }
.foot a:hover { color: var(--bone); text-decoration-color: var(--bone); }
.backers img { height: 20px; width: auto; opacity: .9; align-self: center; }
.foot::before { content: ""; position: absolute; inset: auto 0 0 0; height: 96px; z-index: -1; pointer-events: none; background: linear-gradient(to top, rgba(23, 19, 14, .92), rgba(23, 19, 14, 0)); }

@media (max-width: 640px) {
  .copy { padding-bottom: calc(104px + env(safe-area-inset-bottom)); }
  .foot { justify-content: flex-start; }
  .backers img { height: 17px; }
}
/* reduced motion: the page opens composed and the light moves slower (the
   script follows the setting); the words simply appear */
@media (prefers-reduced-motion: reduce) {
  .word, .line, .reach, .foot { animation: none; }
  .fb-lit { animation-duration: 120s; }
}
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

/* ---- below the water: the one-pager ---- */
/* the deck's dark slides as a page: gold labels hang in a margin that starts
   on the wordmark's column (the script puts it there), the serif reads in the
   middle column, and the compute chart from the deck is the only figure. Each
   row is a subgrid, so a label and the first line beside it share a baseline;
   vertical space comes in half lines. */
.about {
  --lh: 32px;
  display: grid;
  grid-template-columns: minmax(9rem, 1fr) minmax(0, 37rem) minmax(0, 1fr);
  column-gap: 32px;
  row-gap: calc(var(--lh) * 2.5);
  padding-block: calc(var(--lh) * 4) calc(var(--lh) * 4 + env(safe-area-inset-bottom));
  padding-left: max(var(--pad), env(safe-area-inset-left));
  padding-right: max(var(--pad), env(safe-area-inset-right));
  font: 400 21px/var(--lh) var(--serif);
  font-variation-settings: "opsz" 36;
  color: var(--bone-2);
}
.about .row { grid-column: 1 / -1; display: grid; grid-template-columns: subgrid; row-gap: calc(var(--lh) / 2); align-items: baseline; }
.about .row > * { grid-column: 2; margin: 0; }
.about .row > :first-child { grid-column: 1; grid-row: 1; }
.about p { text-wrap: pretty; }

.about h2, .about .label { font: 500 15px/var(--lh) var(--sans); color: var(--ochre); }
.about .label { color: var(--muted); }
.about .lede { font: 300 clamp(26px, calc(1vw + 17px), 32px)/1.25 var(--serif); color: var(--bone); }

.about a { color: var(--bone); text-decoration: underline; text-decoration-color: rgba(168, 156, 136, .45); text-decoration-thickness: 1px; text-underline-offset: 4px; transition: text-decoration-color .2s; }
.about a:hover { text-decoration-color: currentColor; }
.about sup { position: relative; top: -.6em; vertical-align: baseline; font: 500 12px/0 var(--sans); }
.about sup a { color: var(--ochre); text-decoration: none; padding: 0 1px 0 2px; }
.about sub { position: relative; top: .25em; vertical-align: baseline; font-size: .7em; line-height: 0; }

/* the compute chart from the deck, kept inside the reading column: one row
   per model, each bar is training compute to scale and ends in its multiple
   (Proust's 1/340 of the longest is a tick) */
.about figure { margin: calc(var(--lh) / 2) 0; overflow-x: auto; }
.about table { width: 100%; border-collapse: collapse; font: 400 15px/20px var(--sans); font-variant-numeric: tabular-nums; color: var(--bone-2); }
.about caption { caption-side: top; text-align: left; padding-bottom: 4px; font: 500 15px/var(--lh) var(--sans); color: var(--ochre); }
.about th, .about td { padding: 7px 0; text-align: left; font-weight: 400; white-space: nowrap; vertical-align: middle; }
.about thead th { padding: 0 0 10px; font-size: 13px; color: var(--muted); border-bottom: 1px solid var(--rule); }
.about tbody tr:first-child > * { padding-top: 16px; }
.about tbody tr:last-child > * { padding-bottom: 16px; border-bottom: 1px solid var(--rule); }
.about tbody th { padding-right: 20px; color: var(--bone); }
.about tbody th span { margin-left: 6px; font-size: 13px; color: var(--muted); }
.about .n { padding-right: 28px; text-align: right; }
.about .bar { width: 100%; }
.about .b { display: inline-block; height: 10px; background: var(--bar); }
/* the longest bar leaves room for its label */
.about .x1 { width: 2px; }
.about .x41 { width: calc((100% - 56px) * .1206); }
.about .x62 { width: calc((100% - 56px) * .1824); }
.about .x213 { width: calc((100% - 56px) * .6265); }
.about .x229 { width: calc((100% - 56px) * .6735); }
.about .x340 { width: calc(100% - 56px); }
.about .v { margin-left: 8px; font-size: 13px; color: var(--muted); }
.about .ours th, .about .ours td, .about .ours .v { color: var(--blue); }
.about .ours .b { background: var(--blue); }
.about figcaption { padding-top: 10px; font: 400 13px/1.5 var(--sans); color: var(--muted); }

.about .refs ol { display: grid; gap: 8px; margin: 0; padding-left: 1.4em; font: 400 14px/24px var(--sans); color: var(--muted); }
.about .refs li::marker { color: var(--ochre); }
.about .refs a { color: var(--bone-2); text-decoration-color: rgba(168, 156, 136, .25); }

/* narrow: one column, each label sits over its text */
@media (max-width: 820px) {
  .about { --lh: 28px; grid-template-columns: minmax(0, 1fr); row-gap: calc(var(--lh) * 2); padding-block: calc(var(--lh) * 3) calc(var(--lh) * 3 + env(safe-area-inset-bottom)); font-size: 18px; }
  .about .row { row-gap: calc(var(--lh) / 2); }
  .about .row > *, .about .row > :first-child { grid-column: 1; grid-row: auto; }
  .about h2, .about .label { line-height: 20px; }
  .about table { font-size: 14px; }
  .about tbody th { padding-right: 12px; }
  .about tbody th span { display: block; margin: 1px 0 0; }
  .about .n { padding-right: 16px; }
}

/* ---- 404 ---- */
.lost { min-height: 100svh; display: grid; place-items: center; text-align: center; padding: 40px var(--pad); }
.lost img { width: 120px; height: auto; margin: 0 auto 28px; }
.lost h1 { font: 400 clamp(44px, 8vw, 88px)/1 var(--serif); margin: 0 0 14px; }
.lost p { color: var(--muted); margin: 0; }
.lost a { color: var(--bone); }
