:root {
  --ink: #040407;
  --text: #ece8e1;
  --dim: rgba(236, 232, 225, .56);
  --faint: rgba(236, 232, 225, .2);
  --gold: #e2d2ad;
  --err: #d98b76;
  --display: 'Italiana', 'Didot', 'Bodoni 72', serif;
  --sans: 'Tenor Sans', 'Gill Sans', 'Optima', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

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

html, body { margin: 0; background: var(--ink); }

body {
  color: var(--text);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Film grain over everything, very faint */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

::selection { background: rgba(226, 210, 173, .28); color: #fff; }

.sky {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.page {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}

/* ---------- Corner ---------- */
.top {
  position: relative;
  padding: clamp(22px, 4vw, 44px) clamp(22px, 4.5vw, 56px);
  font-family: var(--mono);
  text-transform: uppercase;
}

.mark {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .46em;
  color: var(--dim);
}

/* ---------- Hero ---------- */
.hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: clamp(44px, 9vh, 96px);
  padding: clamp(24px, 8vh, 110px) clamp(22px, 5vw, 64px) clamp(40px, 8vh, 96px);
}

.lede {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(22px, 3.8vh, 40px);
}

h1 {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  /* Sized so the longest line ("never knew existed", ~8.2em) always fits the column
     inside the hero's side padding, and capped by height so short windows don't crowd */
  font-size: clamp(28px, min((100vw - 2 * clamp(22px, 5vw, 64px)) / 8.6, 15vh), 114px);
  line-height: 1.02;
  letter-spacing: 0;
  text-wrap: balance;
  color: var(--text);
}

h1 .accent { color: var(--gold); }

.sub {
  margin: 0;
  max-width: 34em;
  font-size: clamp(15px, 1.35vw + 7px, 19px);
  line-height: 1.6;
  letter-spacing: .02em;
  text-wrap: balance;
  color: rgba(236, 232, 225, .7);
}

.sub strong {
  font-weight: inherit;
  color: var(--text);
}

/* ---------- Email field ---------- */
.join { width: min(480px, 100%); }

.field {
  position: relative;
  display: flex;
  align-items: center;
  border-bottom: 1px solid rgba(236, 232, 225, .3);
  transition: border-color .4s;
}

.field::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold) 30%, var(--gold) 70%, transparent);
  transform: scaleX(0);
  transition: transform .9s var(--ease);
}

.field:focus-within::after { transform: scaleX(1); }
.field.error { border-color: var(--err); }
.field.error::after { background: var(--err); }

.field input[type=email] {
  flex: 1;
  min-width: 0;
  /* A soft, frosted surface so typing never competes with the stars */
  background: rgba(236, 232, 225, .055);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 0;
  border-radius: 3px 3px 0 0;
  outline: 0;
  padding: 15px 18px 14px;
  font: 400 19px/1.3 var(--sans);
  letter-spacing: .02em;
  color: #f6f3ee;
  caret-color: var(--gold);
  transition: background-color .4s;
}

.field input[type=email]:focus { background: rgba(236, 232, 225, .075); }

.field input[type=email]::placeholder {
  color: rgba(236, 232, 225, .66);
}

.field input[type=email]:-webkit-autofill {
  -webkit-text-fill-color: var(--text);
  transition: background-color 9999s;
}

.field button {
  flex: none;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 2px 14px 20px;
  background: none;
  border: 0;
  font: 500 11px/1 var(--mono);
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--gold);
  cursor: pointer;
  transition: color .3s;
}

.field button:hover { color: #fff; }
.field button:disabled { opacity: .45; cursor: progress; }

.arrow {
  width: 24px;
  height: 10px;
  margin-top: -1px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1;
  overflow: visible;
  transition: transform .45s var(--ease);
}

.field button:hover .arrow { transform: translateX(5px); }

button:focus-visible, .side:focus-visible {
  outline: 1px solid var(--gold);
  outline-offset: 6px;
}


.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.note {
  min-height: 1em;
  margin: 16px 0 0;
  font: 400 10.5px/1.4 var(--mono);
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--err);
}

/* ---------- After joining ---------- */
.after { width: min(560px, 100%); }

.step { animation: rise 1.1s var(--ease) both; }

.title {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(30px, 3.4vw, 40px);
  line-height: 1.15;
  outline: none;
}

.sides {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 26px;
}

.side {
  padding: 16px 24px;
  background: rgba(236, 232, 225, .015);
  border: 1px solid var(--faint);
  border-radius: 1px;
  font: 500 11px/1 var(--mono);
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--text);
  cursor: pointer;
  transition: border-color .35s, color .35s, background-color .35s;
}

.side:hover {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(226, 210, 173, .04);
}

.done {
  margin: 16px auto 0;
  max-width: 30em;
  font-size: 17px;
  line-height: 1.6;
  letter-spacing: .02em;
  color: rgba(236, 232, 225, .7);
}

/* ---------- Intro status line ---------- */
.scan {
  position: fixed;
  left: 0;
  right: 0;
  bottom: clamp(56px, 10vh, 96px);
  margin: 0;
  text-align: center;
  font: 400 10px/1 var(--mono);
  letter-spacing: .32em;
  text-transform: uppercase;
  color: rgba(226, 210, 173, .62);
  font-variant-numeric: tabular-nums;
  pointer-events: none;
  opacity: 0;
  transition: opacity .6s;
}

.scan.on { opacity: 1; }

/* ---------- Reveal choreography (only when JS runs the intro) ---------- */
.js .hero h1,
.js .sub,
.js .join,
.js .top {
  opacity: 0;
  transform: translateY(10px);
  filter: blur(8px);
  transition: opacity 1.2s var(--ease), transform 1.2s var(--ease), filter 1.2s var(--ease);
}

.js.revealed .hero h1,
.js.revealed .sub,
.js.revealed .join,
.js.revealed .top {
  opacity: 1;
  transform: none;
  filter: none;
}

.js.revealed .sub { transition-delay: .3s; }
.js.revealed .join { transition-delay: .55s; }
.js.revealed .top { transition-delay: .9s; }

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

@media (max-width: 480px) {
  .field {
    flex-wrap: wrap;
    border-bottom: 0;
  }
  .field::after { display: none; }
  .field input[type=email] {
    flex-basis: 100%;
    border-bottom: 1px solid var(--faint);
    text-align: center;
    transition: border-color .4s;
  }
  .field input[type=email]:focus { border-bottom-color: var(--gold); }
  .field.error input[type=email] { border-bottom-color: var(--err); }
  .field button {
    flex: 1;
    justify-content: center;
    padding: 22px 0 6px;
  }
}

@media (max-height: 520px) {
  .top { padding-top: 18px; padding-bottom: 0; }
  .hero { gap: 30px; padding-top: 16px; padding-bottom: 24px; }
  .lede { gap: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .js .hero h1, .js .sub, .js .join, .js .top, .step {
    transition: none;
    animation: none;
    filter: none;
    transform: none;
  }
}

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