/* Quadrillions / Bureau of Possibility: shared foundation for every concept.
   Worldbook v13. White paper, black ink, one pale accent.
   General Sans is loaded per page from Fontshare (its licence forbids self-hosting):
   <link rel="stylesheet" href="https://api.fontshare.com/v2/css?f[]=general-sans@400,500,600&display=swap"> */

@font-face {
  font-family: "EB Garamond";
  src: url("../fonts/EBGaramond-ExtraBold.woff2") format("woff2");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #ffffff;
  --canton: #f3ff97;
  --ink: #10110f;
  --anthracite: #202124;
  --gray-text: #666a60;
  --gray-line: #d4d7cc;

  --serif: "EB Garamond", "Iowan Old Style", Georgia, serif;
  --sans: "General Sans", "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  --display: clamp(3.25rem, 8.4vw, 8.5rem);
  --h1: clamp(2.5rem, 5.6vw, 5.25rem);
  --h2: clamp(1.9rem, 3.4vw, 3.25rem);
  --h3: clamp(1.35rem, 2vw, 1.85rem);
  --body: clamp(1rem, 1.05vw + 0.55rem, 1.2rem);
  --small: 0.875rem;
  --label: 0.75rem;

  --gutter: clamp(1.25rem, 4.5vw, 4.5rem);
  --measure: 34rem;
  --settle: cubic-bezier(0.2, 0.8, 0.2, 1);
  --press: cubic-bezier(0.3, 0, 0.2, 1);
}

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

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 var(--body) / 1.38 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, p, figure, blockquote, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg, canvas, video { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-underline-offset: 0.18em; text-decoration-thickness: 0.06em; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
::selection { background: var(--canton); color: var(--ink); }

/* ---------------------------------------------------------------- type */
.q-display, .q-h1, .q-h2, .q-h3, .q-serif {
  font-family: var(--serif);
  font-weight: 800;
  letter-spacing: -0.008em;
  line-height: 1;
  text-wrap: balance;
}
.q-display { font-size: var(--display); line-height: 0.96; }
.q-h1 { font-size: var(--h1); }
.q-h2 { font-size: var(--h2); line-height: 1.02; }
.q-h3 { font-size: var(--h3); line-height: 1.08; }
.q-body { max-width: var(--measure); text-wrap: pretty; }
.q-body + .q-body { margin-top: 0.9em; }
.q-lede { font-family: var(--serif); font-weight: 800; font-size: var(--h3); line-height: 1.14; letter-spacing: -0.006em; max-width: 30rem; text-wrap: balance; }
.q-small { font-size: var(--small); color: var(--gray-text); }
.q-num { font-family: var(--serif); font-weight: 800; font-variant-numeric: lining-nums tabular-nums; letter-spacing: 0; }

/* Pretitle: one simple uppercase label, a pale marker the height of a capital. */
.q-pretitle {
  display: inline-flex;
  align-items: center;
  gap: 0.7em;
  font: 600 var(--label) / 1 var(--sans);
  letter-spacing: 0.055em;
  text-transform: uppercase;
}
.q-pretitle::before { content: ""; width: 1.15em; height: 0.72em; background: var(--canton); flex: none; }
.q-pretitle--plain::before { display: none; }
.q-pretitle--ink::before { background: var(--ink); }

/* ---------------------------------------------------------------- wordmark */
.q-wordmark { display: block; width: var(--wordmark-width, 11rem); color: var(--ink); }
.q-wordmark svg { display: block; width: 100%; height: auto; }

/* ---------------------------------------------------------------- controls */
.q-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  padding: 0.95em 1.35em 0.9em;
  background: var(--ink);
  color: var(--paper);
  font: 600 0.95rem / 1 var(--sans);
  text-decoration: none;
  transition: transform 0.18s var(--settle), background 0.18s, color 0.18s;
}
.q-btn:hover { transform: translateY(-2px); }
.q-btn:active { transform: translateY(1px); transition-duration: 0.06s; }
.q-btn--canton { background: var(--canton); color: var(--ink); }
.q-btn--line { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 2px var(--ink); }

.q-link { font-weight: 600; text-decoration: underline; }

/* Stamp: serif, boxed, optically centred. ONE MORE stays black on white. */
.q-stamp {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.42em 0.62em 0.34em;
  border: 0.12em solid currentColor;
  font: 800 1.25rem / 1 var(--serif);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
}
.q-stamp--tilt { transform: rotate(-4deg); }

/* A press: the stamp comes down, holds, leaves ink. Add .is-pressed from JS. */
@keyframes q-press {
  0% { transform: translateY(-0.6em) scale(1.12) rotate(var(--tilt, -4deg)); opacity: 0; }
  55% { transform: translateY(0) scale(0.97) rotate(var(--tilt, -4deg)); opacity: 1; }
  100% { transform: translateY(0) scale(1) rotate(var(--tilt, -4deg)); opacity: 1; }
}
.q-stamp.is-pressed { animation: q-press 0.22s var(--press) both; }

/* ---------------------------------------------------------------- artwork */
/* Opaque scenes sit on the paper as ink. Cut-outs (scenes-cut, cutouts) need nothing. */
.q-art { mix-blend-mode: multiply; }
.q-boil { filter: url(#q-boil); }

/* ---------------------------------------------------------------- reveal */
[data-reveal] { opacity: 0; transform: translateY(14px); transition: opacity 0.5s var(--settle), transform 0.5s var(--settle); transition-delay: var(--delay, 0s); }
[data-reveal].is-in { opacity: 1; transform: none; }

/* ---------------------------------------------------------------- footer (facts) */
.q-footer { padding: clamp(3rem, 7vw, 6rem) var(--gutter) 2rem; border-top: 1px solid var(--gray-line); }
.q-footer__grid { display: grid; gap: 2.5rem; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }
.q-footer h3 { font: 600 var(--label) / 1 var(--sans); letter-spacing: 0.055em; text-transform: uppercase; margin-bottom: 1rem; }
.q-footer p, .q-footer li { font-size: var(--small); line-height: 1.5; max-width: 26rem; }
.q-footer li + li { margin-top: 0.35rem; }
.q-footer__legal { margin-top: 3rem; display: flex; flex-wrap: wrap; gap: 0.75rem 2rem; justify-content: space-between; align-items: baseline; color: var(--gray-text); font-size: 0.8125rem; line-height: 1.5; }
.q-footer__legal p { max-width: 46rem; }
.q-footer__sign { font-family: var(--serif); font-weight: 800; color: var(--ink); font-size: 1rem; }
.q-footer__paperwork { display: flex; gap: 1.2rem; font: 600 var(--label) / 1 var(--sans); letter-spacing: 0.055em; text-transform: uppercase; }
.q-footer__paperwork a { color: var(--ink); text-decoration: none; border-bottom: 2px solid var(--gray-line); padding-bottom: 0.15rem; }
.q-footer__paperwork a:hover { border-bottom-color: var(--ink); }

/* ---------------------------------------------------------------- helpers */
.q-vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.q-canton { background: var(--canton); }
.q-dark { background: var(--anthracite); color: var(--paper); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
  [data-reveal] { opacity: 1; transform: none; }
  .q-boil { filter: none; }
}
