:root {
  --ink: #432818;
  --ink-deep: #2A180D;
  --field: #4C301F;
  --bone: #EDEBE3;
  --camel: #BB9457;
  --gold: #99582A;
  --wine: #6F1D1B;
  --apricot: #FFE6A7;
  --error: #E0805F;
  --font: 'Space Grotesk', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { background: var(--ink-deep); }

body {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(120% 90% at 50% 42%, transparent 50%, rgba(24, 12, 6, 0.6)),
    radial-gradient(55% 38% at 50% 46%, rgba(153, 88, 42, 0.26), transparent 72%),
    var(--ink);
  color: var(--bone);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

/* fine film grain over everything */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' 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 .7 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.top { position: relative; z-index: 2; padding: 26px 22px; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.02em;
  color: var(--bone);
  text-decoration: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
.brand:focus-visible { outline: 2px solid var(--apricot); outline-offset: 4px; border-radius: 4px; }

.stage {
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 44px;
  padding: 0 24px 9vh;
}

/* ---------- timer ---------- */
.timer {
  font-family: var(--font);
  font-weight: 700;
  font-size: clamp(52px, 17vw, 120px);
  line-height: 1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  color: var(--bone);
}
.timer .c { color: var(--camel); opacity: 0.75; }
.timer--small { font-size: clamp(28px, 8vw, 40px); opacity: 0.9; }

/* ---------- reticle brackets (shared) ---------- */
.signup, .follow { --reticle: var(--camel); position: relative; }

.signup::before, .follow::before {
  content: "";
  position: absolute;
  inset: -11px;
  pointer-events: none;
  opacity: 0.75;
  transition: inset 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.3s ease;
  background:
    linear-gradient(var(--reticle), var(--reticle)) left top / 14px 1.5px no-repeat,
    linear-gradient(var(--reticle), var(--reticle)) left top / 1.5px 14px no-repeat,
    linear-gradient(var(--reticle), var(--reticle)) right top / 14px 1.5px no-repeat,
    linear-gradient(var(--reticle), var(--reticle)) right top / 1.5px 14px no-repeat,
    linear-gradient(var(--reticle), var(--reticle)) left bottom / 14px 1.5px no-repeat,
    linear-gradient(var(--reticle), var(--reticle)) left bottom / 1.5px 14px no-repeat,
    linear-gradient(var(--reticle), var(--reticle)) right bottom / 14px 1.5px no-repeat,
    linear-gradient(var(--reticle), var(--reticle)) right bottom / 1.5px 14px no-repeat;
}

/* ---------- signup form ---------- */
.signup { width: 100%; max-width: 400px; }
.signup:focus-within::before { inset: -6px; opacity: 1; }

.signup__input {
  width: 100%;
  height: 60px;
  padding: 0 76px 0 22px;
  background: var(--field);
  border: 1px solid rgba(237, 235, 227, 0.14);
  border-radius: 14px;
  color: var(--bone);
  font-family: var(--font-body);
  font-size: 16px;
  letter-spacing: 0.01em;
  outline: none;
  transition: border-color 0.2s ease;
}
.signup__input::placeholder { color: rgba(237, 235, 227, 0.42); }
.signup__input:focus { border-color: var(--camel); }

.signup__input:-webkit-autofill,
.signup__input:-webkit-autofill:hover,
.signup__input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--bone);
  caret-color: var(--bone);
  box-shadow: 0 0 0 1000px var(--field) inset;
  transition: background-color 9999s ease-in-out 0s;
}

.signup__btn {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 10px;
  background: var(--camel);
  color: var(--ink);
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}
.signup__btn:hover { background: var(--apricot); }
.signup__btn:active { transform: scale(0.95); }
.signup__btn:focus-visible { outline: 2px solid var(--apricot); outline-offset: 3px; }

.signup.is-busy .signup__btn { opacity: 0.6; pointer-events: none; }
.signup.is-error { --reticle: var(--error); animation: shake 0.35s ease; }
.signup.is-error .signup__input { border-color: var(--error); }

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

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

/* ---------- confirmation ---------- */
.fx {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

.mark { width: min(64vw, 260px); aspect-ratio: 1; }

.follow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  height: 56px;
  padding: 0 28px;
  background: var(--bone);
  color: var(--ink);
  border-radius: 12px;
  font-family: var(--font);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -0.005em;
  text-decoration: none;
  transition: background 0.2s ease, transform 0.15s ease;
}
.follow::before { inset: -9px; }
.follow:hover { background: var(--apricot); }
.follow:hover::before { inset: -5px; opacity: 1; }
.follow:active { transform: scale(0.98); }
.follow:focus-visible { outline: 2px solid var(--apricot); outline-offset: 10px; }
.follow svg { width: 18px; height: 18px; }

.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.9s ease, transform 0.9s cubic-bezier(0.2, 0.8, 0.2, 1);
}
body.is-ready .reveal { opacity: 1; transform: none; }
body.is-ready .reveal + .reveal { transition-delay: 0.25s; }

@media (min-width: 900px) {
  .top { padding: 36px 64px; }
  .stage { gap: 56px; }
  .timer { font-size: clamp(96px, 10vw, 160px); }
  .timer--small { font-size: 44px; }
  .mark { width: 300px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}
