@font-face {
  font-family: "Newsreader";
  src: url("/fonts/newsreader-latin.woff2") format("woff2-variations");
  font-weight: 200 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #faf8f4;
  --ink: #1a1815;
  --muted: #968f83;
  --rule: rgba(26, 24, 21, 0.12);
  --gutter: clamp(1.75rem, 6vw, 6rem);
  --measure: 62rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14120f;
    --ink: #ece7de;
    --muted: #6f685c;
    --rule: rgba(236, 231, 222, 0.14);
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  height: 100%;
}

body {
  margin: 0;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font-family: "Newsreader", ui-serif, Georgia, "Times New Roman", serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--gutter);
}

.quote {
  margin: 0;
  max-width: var(--measure);
  opacity: 0;
  transform: translateY(0.5rem);
}

.quote.is-visible {
  opacity: 1;
  transform: none;
  transition: opacity 450ms ease, transform 500ms cubic-bezier(0.2, 0.7, 0.3, 1);
}

blockquote {
  margin: 0;
  max-width: 20em;
  font-weight: 350;
  letter-spacing: -0.014em;
  hyphens: none;
}

figcaption {
  margin-top: 1.9em;
  font-size: clamp(0.78rem, 1.4vw, 0.92rem);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Length buckets — set by build.js and by app.js from the quote's character count.
   Thresholds follow the actual corpus: median 65, p90 100, longest 163. */
.s1 blockquote {
  font-size: clamp(3rem, 8.5vw, 6rem);
  font-variation-settings: "opsz" 72;
  line-height: 1.04;
  text-wrap: balance;
}

.s2 blockquote {
  font-size: clamp(2.5rem, 6.6vw, 4.6rem);
  font-variation-settings: "opsz" 64;
  line-height: 1.08;
  text-wrap: balance;
}

.s3 blockquote {
  font-size: clamp(2.1rem, 5.2vw, 3.6rem);
  font-variation-settings: "opsz" 48;
  line-height: 1.14;
  text-wrap: balance;
}

.s4 blockquote {
  font-size: clamp(1.75rem, 4.2vw, 2.9rem);
  font-variation-settings: "opsz" 36;
  line-height: 1.22;
  text-wrap: pretty;
}

/* Footer — present on every page, aligned to the same centred column. */
.site-footer {
  padding: 0 var(--gutter) clamp(1.5rem, 4vw, 3rem);
  animation: fade-in 500ms ease 250ms both;
}

.site-footer nav {
  max-width: var(--measure);
  margin-inline: auto;
  display: flex;
  gap: 1.75rem;
}

.site-footer a {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--muted);
  transition: color 200ms ease;
}

.site-footer a:hover,
.site-footer a:focus-visible {
  color: var(--ink);
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Legal pages. */
.page {
  display: block;
  padding: clamp(2.5rem, 7vw, 5rem) var(--gutter) 0;
}

.prose {
  max-width: 34em;
  margin-inline: auto;
  font-size: clamp(1rem, 1.6vw, 1.125rem);
  font-variation-settings: "opsz" 16;
  line-height: 1.6;
}

.back-link {
  display: inline-block;
  margin-bottom: clamp(2rem, 5vw, 3.5rem);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--muted);
  transition: color 200ms ease;
}

.back-link:hover,
.back-link:focus-visible {
  color: var(--ink);
}

.prose h1 {
  margin: 0 0 1.5rem;
  font-size: clamp(2.1rem, 5vw, 3rem);
  font-weight: 350;
  font-variation-settings: "opsz" 48;
  letter-spacing: -0.014em;
  line-height: 1.1;
}

.prose h2 {
  margin: 2.75rem 0 0.6rem;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.prose p,
.prose address {
  margin: 0 0 1.1rem;
  font-style: normal;
}

.prose a {
  color: inherit;
  text-decoration-color: var(--rule);
  text-underline-offset: 0.2em;
}

.prose a:hover {
  text-decoration-color: currentColor;
}

.prose hr {
  margin: 3rem 0;
  border: 0;
  border-top: 1px solid var(--rule);
}

.prose .note {
  color: var(--muted);
  font-size: 0.92em;
}

@media (prefers-reduced-motion: reduce) {
  .quote {
    opacity: 1;
    transform: none;
  }

  .quote.is-visible {
    transition: none;
  }

  .site-footer {
    animation: none;
  }
}
