/* Epilogue: the poster.
   Photocopy paper, black toner, one red. Shared by the coming-soon page and the full site.
   Fonts are loaded in each page's <head> from Google Fonts. */

:root {
  --paper: #e8e5da;
  --paper-deep: #d8d4c6;
  --toner: #0f0f0e;
  --toner-soft: #1c1c1a;
  --red: #e3261b;
  --grey: #6d6b63;
  --grey-light: #a9a69b;

  --display: "Archivo", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --gutter: clamp(1rem, 3.2vw, 2.75rem);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);

  color-scheme: light;
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--toner);
  font-family: var(--display);
  font-size: 1.0625rem;
  font-variation-settings: "wdth" 100;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

img,
svg,
canvas,
video {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

h1,
h2,
h3,
p,
ol,
ul,
dl,
dd,
figure {
  margin: 0;
}

ol,
ul {
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.22em;
}

::selection {
  background: var(--red);
  color: var(--paper);
}

:focus-visible {
  outline: 3px solid var(--red);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Smooth scrolling (Lenis) */
html.lenis,
html.lenis body {
  height: auto;
}

.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}

.lenis.lenis-stopped {
  overflow: hidden;
}

/* ---------- The photocopy: grain over everything ---------- */

.grain {
  position: fixed;
  inset: -50%;
  z-index: 90;
  pointer-events: none;
  opacity: 0.16;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1.4 -0.35'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 0.8s steps(5) infinite;
}

@keyframes grain {
  0% { transform: translate(0, 0); }
  20% { transform: translate(-4%, 3%); }
  40% { transform: translate(3%, -5%); }
  60% { transform: translate(-2%, 6%); }
  80% { transform: translate(5%, 1%); }
  100% { transform: translate(-3%, -3%); }
}

/* ---------- Photos printed as halftone (halftone.js) ---------- */

.ht {
  position: relative;
  overflow: hidden;
  background: var(--paper);
}

.ht img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* Without WebGL: a plain, hard photocopy */
  filter: grayscale(1) contrast(1.7) brightness(1.05);
  mix-blend-mode: multiply;
}

.ht-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.ht.ht-live img {
  opacity: 0;
}

/* ---------- Small print ---------- */

.mono {
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.4;
}

/* ---------- Buttons and fields ---------- */

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.7em;
  min-height: 3.25rem;
  padding: 0 1.4rem;
  background: var(--toner);
  border: 0;
  color: var(--paper);
  font-family: var(--mono);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  isolation: isolate;
  overflow: hidden;
  transition: color 0.3s var(--ease-out), transform 0.14s var(--ease-out);
}

.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--red);
  transform: translateY(101%);
  transition: transform 0.45s var(--ease-out);
}

.btn svg {
  width: 1.1em;
  height: 1.1em;
  flex: none;
  transition: transform 0.35s var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .btn:hover::before {
    transform: none;
  }

  .btn:hover svg {
    transform: translateX(3px);
  }
}

.btn:active {
  transform: scale(0.97);
}

.btn[disabled],
.btn[aria-busy="true"] {
  cursor: progress;
  opacity: 0.7;
}

.btn-red {
  background: var(--red);
}

.btn-red::before {
  background: var(--toner);
}

.btn-paper {
  background: var(--paper);
  color: var(--toner);
}

.btn-paper::before {
  background: var(--red);
}

@media (hover: hover) and (pointer: fine) {
  .btn-paper:hover {
    color: var(--paper);
  }
}

.field-label {
  display: block;
  margin-bottom: 0.6rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.field-row {
  display: flex;
  align-items: stretch;
  border: 2px solid currentColor;
}

.field-row input {
  flex: 1 1 0;
  width: 100%;
  min-width: 0;
  min-height: 3.25rem;
  padding: 0.5rem 1rem;
  background: transparent;
  border: 0;
  border-radius: 0;
  color: inherit;
  font: inherit;
  font-size: 1.125rem;
  font-variation-settings: "wdth" 100, "wght" 500;
  caret-color: var(--red);
}

.field-row input::placeholder {
  color: inherit;
  opacity: 0.5;
}

.field-row input:focus {
  outline: none;
}

.field-row:focus-within {
  outline: 3px solid var(--red);
  outline-offset: 2px;
}

.field-row .btn {
  min-height: auto;
}

.form-status {
  min-height: 1.5em;
  margin-top: 0.6rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.02em;
}

.form-status[data-tone="error"] {
  color: var(--red);
  font-weight: 500;
}

/* Honeypot: off-screen for people, still there for bots */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
  .grain {
    animation: none;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* ---------- Cookie choice (consent.js) ---------- */

.consent {
  position: fixed;
  z-index: 95;
  left: var(--gutter);
  bottom: calc(var(--gutter) + env(safe-area-inset-bottom, 0px));
  width: min(27rem, calc(100vw - 2 * var(--gutter)));
  padding: 1.1rem 1.2rem 1rem;
  background: var(--toner);
  color: var(--paper);
  box-shadow: 8px 8px 0 var(--red);
  animation: consent-in 0.6s var(--ease-out) 0.8s both;
}

.consent-title {
  margin-bottom: 0.5rem;
  color: var(--red);
  font-family: var(--display);
  font-variation-settings: "wdth" 62, "wght" 900;
  font-size: 2rem;
  line-height: 0.9;
  text-transform: uppercase;
}

.consent-text {
  font-size: 0.95rem;
  line-height: 1.45;
}

/* Accept and Reject: same size, same look, same effort */
.consent-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-top: 1rem;
}

.consent-actions .btn {
  min-height: 2.9rem;
}

.consent-more {
  display: inline-block;
  margin-top: 0.75rem;
  color: var(--grey-light);
}

.consent-open {
  padding: 0;
  background: none;
  border: 0;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
  cursor: pointer;
}

@keyframes consent-in {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
}

/* ---------- Copyright and site credit ---------- */

.credit {
  flex-basis: 100%;
  margin-top: 0.75rem;
  font-family: var(--mono);
  font-size: 0.6875rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  line-height: 1.5;
  text-transform: none;
  opacity: 0.75;
}

.credit a {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

/* ---------- Countdowns (countdown.js) ---------- */

.countdown {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem clamp(0.75rem, 2.5vw, 2rem);
}

.cd-unit {
  display: grid;
  justify-items: start;
}

.cd-num {
  display: block;
  font-family: var(--display);
  font-variation-settings: "wdth" 62, "wght" 900;
  line-height: 0.82;
  font-variant-numeric: tabular-nums;
}

.cd-label {
  margin-top: 0.35rem;
  font-size: 0.6875rem;
}

.cd-num.is-tick {
  animation: cd-tick 0.45s var(--ease-out);
}

.countdown.is-done .cd-num {
  color: var(--red);
}

@keyframes cd-tick {
  from {
    opacity: 0.2;
    transform: translateY(-0.18em);
  }
}

@media (prefers-reduced-motion: reduce) {
  .cd-num.is-tick {
    animation: none;
  }
}
