/* ---------- Fonts (self-hosted, OFL — see /fonts/OFL.txt) ---------- */
@font-face {
  font-family: "Cormorant Garamond";
  src: url("fonts/cormorant-garamond-300.woff2") format("woff2");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Cormorant Garamond";
  src: url("fonts/cormorant-garamond-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  --bg: #060608;
  --ink: #e9e4da;
  --ink-dim: rgba(233, 228, 218, 0.55);
  --ink-faint: rgba(233, 228, 218, 0.28);
  --line: rgba(233, 228, 218, 0.18);
  --ember: #ffb45c;
  --ember-deep: #ff7a1a;
  --error: #c8563f;
  --serif: "Cormorant Garamond", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --gutter: 1.5rem;
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

::selection { background: rgba(255, 180, 92, 0.25); color: var(--ink); }

/* ---------- Layout ---------- */
.stage {
  flex: 1;
  width: 100%;
  max-width: 34rem;
  margin: 0 auto;
  padding: max(18vh, 6rem) var(--gutter) 4rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

/* ---------- The light ---------- */
.light {
  position: relative;
  width: 2px;
  height: 2px;
  margin-bottom: clamp(4.5rem, 14vh, 8rem);
  opacity: 0;
  /* beacon dims via filter so it doesn't fight arrive, which owns opacity */
  animation:
    arrive 4s ease-out 0.4s forwards,
    beacon 14s ease-in-out 4.4s infinite;
}
.light__core,
.light__halo {
  position: absolute;
  left: 50%;
  top: 50%;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}
.light__core {
  width: 3px;
  height: 3px;
  background: #fff2dc;
  box-shadow:
    0 0 4px 1px var(--ember),
    0 0 14px 3px rgba(255, 122, 26, 0.55);
  animation: flicker 7.3s ease-in-out infinite;
}
.light__halo {
  width: 140px;
  height: 140px;
  background: radial-gradient(circle, rgba(255, 150, 60, 0.16) 0%, rgba(255, 122, 26, 0.05) 35%, transparent 70%);
  animation: breathe 6s ease-in-out infinite;
}

@keyframes arrive { to { opacity: 1; } }
/* ~7.7s lit, ~1.8s fade out, ~2.5s dark, ~2s fade back in */
@keyframes beacon {
  0%, 55%  { filter: opacity(1); }
  68%, 86% { filter: opacity(0); }
  100%     { filter: opacity(1); }
}
@keyframes breathe {
  0%, 100% { transform: translate(-50%, -50%) scale(0.85); opacity: 0.55; }
  50%      { transform: translate(-50%, -50%) scale(1.15); opacity: 1; }
}
@keyframes flicker {
  0%, 100% { opacity: 0.85; }
  18%      { opacity: 1; }
  24%      { opacity: 0.7; }
  52%      { opacity: 1; }
  61%      { opacity: 0.8; }
  78%      { opacity: 0.95; }
}

/* ---------- Type ---------- */
.headline {
  margin: 0;
  font-weight: 300;
  font-size: clamp(2.1rem, 8.5vw, 3.6rem);
  line-height: 1.1;
  letter-spacing: -0.005em;
  text-wrap: balance;
  opacity: 0;
  animation: rise 2.4s ease-out 1.2s forwards;
}
.subline {
  margin: 1.4rem 0 0;
  font-weight: 400;
  font-size: 0.95rem;
  font-variant: small-caps;
  text-transform: lowercase;
  letter-spacing: 0.28em;
  color: var(--ink-dim);
  opacity: 0;
  animation: rise 2.4s ease-out 2s forwards;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- Signup ---------- */
.signup {
  width: 100%;
  max-width: 21rem;
  margin-top: clamp(4rem, 12vh, 6.5rem);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  opacity: 0;
  animation: rise 2.4s ease-out 2.8s forwards;
}
.signup__input {
  width: 100%;
  padding: 0.7rem 0.2rem;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font: 400 1.2rem/1.3 var(--serif);
  text-align: center;
  letter-spacing: 0.02em;
  outline: none;
  transition: border-color 0.6s ease, box-shadow 0.6s ease;
  -webkit-appearance: none;
  appearance: none;
}
.signup__input::placeholder { color: var(--ink-faint); }
.signup__input:focus { border-bottom-color: rgba(255, 180, 92, 0.6); }
.signup__input.is-invalid {
  border-bottom-color: var(--error);
  box-shadow: 0 10px 18px -14px var(--error);
}

/* Honeypot: off-screen, not display:none, so simple bots still fill it in */
.signup__trap {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.signup__button {
  margin-top: 1.6rem;
  align-self: center;
  padding: 0.7rem 1rem;
  border: 0;
  background: none;
  color: var(--ink-dim);
  font: 400 0.95rem/1 var(--serif);
  font-variant: small-caps;
  text-transform: lowercase;
  letter-spacing: 0.26em;
  cursor: pointer;
  transition: color 0.5s ease, text-shadow 0.5s ease;
}
.signup__button:hover,
.signup__button:focus-visible {
  color: var(--ink);
  text-shadow: 0 0 14px rgba(255, 170, 80, 0.45);
  outline: none;
}
.signup__button:disabled { cursor: default; color: var(--ink-faint); text-shadow: none; }

.signup__status {
  min-height: 1.4em;
  margin: 1.2rem 0 0;
  font-size: 1.1rem;
  font-weight: 400;
  color: var(--ember);
  opacity: 0;
  transition: opacity 1.2s ease;
}
.signup__status.is-visible { opacity: 1; }

.signup__note {
  margin: 0.4rem 0 0;
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--ink-faint);
  letter-spacing: 0.02em;
}

/* ---------- Footer ---------- */
.footer {
  padding: 1.5rem var(--gutter) max(1.5rem, env(safe-area-inset-bottom));
  text-align: center;
}
.footer a,
.back {
  color: var(--ink-faint);
  font-size: 0.85rem;
  font-weight: 400;
  font-variant: small-caps;
  text-transform: lowercase;
  letter-spacing: 0.22em;
  text-decoration: none;
  transition: color 0.4s ease;
}
.footer a:hover, .footer a:focus-visible,
.back:hover, .back:focus-visible { color: var(--ink-dim); outline: none; }

/* ---------- Privacy page ---------- */
.prose {
  width: 100%;
  max-width: 36rem;
  margin: 0 auto;
  padding: 4rem var(--gutter) 3rem;
  font-size: 1.12rem;
  font-weight: 400;
  line-height: 1.6;
  color: var(--ink-dim);
}
.prose h1 {
  margin: 2.5rem 0 2rem;
  font-weight: 300;
  font-size: clamp(2rem, 7vw, 2.8rem);
  line-height: 1.1;
  color: var(--ink);
}
.prose h2 {
  margin: 2.4rem 0 0.6rem;
  font-weight: 400;
  font-size: 0.95rem;
  font-variant: small-caps;
  text-transform: lowercase;
  letter-spacing: 0.22em;
  color: var(--ink);
}
.prose p, .prose ul { margin: 0 0 1rem; }
.prose ul { padding-left: 1.1rem; }
.prose a { color: var(--ink); text-decoration-color: var(--line); text-underline-offset: 3px; }
.prose a:hover { text-decoration-color: var(--ember); }
.prose .meta { margin-top: 3rem; font-size: 0.9rem; color: var(--ink-faint); }

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

/* ---------- Larger screens ---------- */
@media (min-width: 48rem) {
  :root { --gutter: 2rem; }
  .stage { padding-top: max(20vh, 7rem); }
}

/* ---------- Reduced motion: the light stays, it just doesn't move ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
  .light, .headline, .subline, .signup { opacity: 1; }
}
