/* Scroll Without Doom: black, white, one grey, one solemn book face (EB Garamond).
   One line per screen, alone in the dark. No examples: the reader brings their own. */

@font-face {
  font-family: 'EB Garamond';
  src: url(/assets/fonts/eb-garamond.woff2) format('woff2-variations');
  font-weight: 400 800;
  font-display: swap;
}

:root {
  --black: #000;
  --white: #fff;
  --grey: #8c8c8c;      /* 6.6:1 on black: handles, citations */
  --rule: #262626;      /* hairlines only */
  --font: 'EB Garamond', Garamond, 'Times New Roman', serif;
  --gutter: clamp(20px, 5vw, 80px);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { background: var(--black); scroll-behavior: smooth; }
body {
  margin: 0; background: var(--black); color: var(--white);
  font-family: var(--font); font-size: 20px; line-height: 1.5;
  font-kerning: normal; font-variant-ligatures: common-ligatures;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
main, footer { padding-inline: var(--gutter); max-width: 1440px; margin-inline: auto; }
a { color: inherit; }
::selection { background: var(--white); color: var(--black); }
:focus-visible { outline: 2px solid var(--white); outline-offset: 4px; }
button { font: inherit; color: inherit; cursor: pointer; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.corner {
  position: fixed; top: 0; right: 0; z-index: 5;
  padding: 14px var(--gutter) 14px 18px;
  font-size: 1rem; color: var(--grey); text-decoration: none;
}
.corner:hover { color: var(--white); }

/* ---- Beats: one per screen, vertically centred ---- */
.beat { margin: 0; min-height: 100svh; display: flex; flex-direction: column; justify-content: center; padding-block: 8vh; }
.say {
  max-width: 15ch;
  font-size: clamp(3rem, 8.4vw, 8.8rem); font-weight: 500;
  line-height: 1.04; letter-spacing: -.018em; text-wrap: balance;
}
.say.loud { max-width: 11ch; font-size: clamp(3.6rem, 11.5vw, 12rem); line-height: .98; letter-spacing: -.025em; }
#elapsed-line { display: block; padding-top: 30svh; }
.after-line { display: block; margin-top: .6em; }

/* Only the line in front of you exists. JS only; everything is visible without it. */
.js .beat { opacity: .06; transition: opacity .9s ease; }
.js .beat.on { opacity: 1; }

/* ---- The ask ---- */
.ask { min-height: 100svh; display: flex; flex-direction: column; justify-content: center; padding-block: 14vh; }
.sub { margin: 0; max-width: 24ch; font-size: clamp(2.2rem, 4.8vw, 4.8rem); font-weight: 500; line-height: 1.1; letter-spacing: -.015em; text-wrap: pretty; }
.sub-small { margin: 2rem 0 0; max-width: 40ch; font-size: clamp(1.25rem, 2vw, 1.6rem); line-height: 1.35; }
.join { display: flex; flex-wrap: wrap; margin-top: 2.8rem; max-width: 48rem; }
.join input[type=email] {
  flex: 1 1 18rem; min-width: 0; padding: 1.15rem 1.2rem; border: 2px solid var(--white); border-right: 0; border-radius: 0;
  background: var(--black); color: var(--white); font: inherit; font-size: 1.3rem;
}
.join input[type=email]::placeholder { color: var(--grey); }
.join input[type=email]:focus { outline: none; box-shadow: inset 0 0 0 2px var(--white); }
.btn { flex: 0 0 auto; padding: 1.15rem 1.6rem; border: 2px solid var(--white); border-radius: 0; background: var(--white); color: var(--black); font-weight: 600; font-size: 1.3rem; }
.btn:hover { background: var(--black); color: var(--white); }
.btn:disabled { opacity: .5; cursor: wait; }
.msg { flex-basis: 100%; min-height: 1.5em; margin: .9rem 0 0; color: var(--grey); font-size: 1rem; }
.ghost { margin-top: 1.2rem; padding: .9rem 1.3rem; border: 2px solid var(--white); background: transparent; color: var(--white); font-weight: 600; font-size: 1.15rem; }
.ghost:hover { background: var(--white); color: var(--black); }

.survey { margin-top: 3rem; max-width: 48rem; }
.survey-head { margin: 0 0 1rem; font-size: 1.2rem; }
fieldset { margin: 0; padding: 1.4rem 0; border: 0; border-top: 1px solid var(--rule); }
legend { float: left; width: 100%; padding: 0 0 .9rem; font-size: 1.25rem; font-weight: 600; }
.chips { clear: both; display: flex; flex-wrap: wrap; gap: .5rem; }
.chips button { padding: .55rem .95rem; border: 1px solid var(--rule); background: var(--black); font-size: 1.1rem; color: var(--white); }
.chips button:hover { border-color: var(--grey); }
.chips button[aria-pressed=true] { background: var(--white); color: var(--black); border-color: var(--white); }
.survey > .btn { margin-top: 1.6rem; }
.after { margin-top: 2.4rem; }
.after p { margin: 0; font-size: 1.2rem; }

footer { padding-block: 6vh 8vh; border-top: 1px solid var(--rule); color: var(--grey); font-size: .95rem; }
footer p { margin: 0; max-width: 52ch; }

@media (max-width: 640px) {
  body { font-size: 19px; }
  .say { font-size: 12.4vw; line-height: 1.06; max-width: none; }
  .say.loud { font-size: 15.5vw; line-height: 1; }
  .sub { font-size: 9vw; }
  .join input[type=email] { border-right: 2px solid var(--white); flex-basis: 100%; }
  .btn { flex-basis: 100%; margin-top: .6rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .beat { opacity: 1; transition: none; }
}
