/* ============================================================
   Criterium tease — quiet poster, forest palette
   Deep green field, bone type, single amber accent.
   Shape rule: CTA is pill, input is underline. One theme, dark.
   ============================================================ */

@font-face {
  font-family: "Satoshi";
  src: url("fonts/satoshi-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Satoshi";
  src: url("fonts/satoshi-500.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "Satoshi";
  src: url("fonts/satoshi-700.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "Plex Mono";
  src: url("fonts/plexmono-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Plex Mono";
  src: url("fonts/plexmono-500.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}

:root {
  --field: #0e1613;
  --field-deep: #0a100e;
  --bone: #e7e3d6;
  --bone-60: rgba(231, 227, 214, 0.62);
  --bone-35: rgba(231, 227, 214, 0.38);
  --line: rgba(231, 227, 214, 0.14);
  --amber: #dfa53c;
  --amber-deep: #c88f2b;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html, body { height: 100%; }

body {
  background: var(--field-deep);
  color: var(--bone);
  font-family: "Satoshi", -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.mono {
  font-family: "Plex Mono", ui-monospace, SFMono-Regular, monospace;
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

::selection { background: var(--amber); color: var(--field-deep); }

/* ---------- stage & atmosphere ---------- */

.stage {
  min-height: 100dvh;
  position: relative;
  background: var(--field);
  display: flex;
}

.ambient {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.ambient::before,
.ambient::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
}

/* slow warm light, upper right, like late-afternoon office light */
.ambient::before {
  width: 55vmax;
  height: 55vmax;
  top: -22vmax;
  right: -16vmax;
  background: radial-gradient(circle, rgba(223, 165, 60, 0.14), transparent 62%);
  animation: drift-a 46s ease-in-out infinite alternate;
}

/* cooler green depth, lower left */
.ambient::after {
  width: 60vmax;
  height: 60vmax;
  bottom: -28vmax;
  left: -18vmax;
  background: radial-gradient(circle, rgba(52, 94, 74, 0.32), transparent 64%);
  animation: drift-b 58s ease-in-out infinite alternate;
}

@keyframes drift-a {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(-6vmax, 4vmax, 0) scale(1.12); }
}

@keyframes drift-b {
  from { transform: translate3d(0, 0, 0) scale(1.08); }
  to { transform: translate3d(5vmax, -4vmax, 0) scale(1); }
}

.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 5;
  opacity: 0.5;
  mix-blend-mode: overlay;
  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='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.32'/%3E%3C/svg%3E");
}

/* ---------- frame ---------- */

.frame {
  position: relative;
  z-index: 10;
  flex: 1;
  margin: clamp(14px, 2.2vw, 30px);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: clamp(20px, 3vw, 44px);
}

.tick {
  position: absolute;
  width: 9px;
  height: 9px;
  pointer-events: none;
}

.tick::before, .tick::after {
  content: "";
  position: absolute;
  background: var(--bone-35);
}
.tick::before { width: 9px; height: 1px; top: 4px; }
.tick::after { width: 1px; height: 9px; left: 4px; }

.tick-tl { top: -5px; left: -5px; }
.tick-tr { top: -5px; right: -5px; }
.tick-bl { bottom: -5px; left: -5px; }
.tick-br { bottom: -5px; right: -5px; }

/* ---------- top & bottom rows ---------- */

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-weight: 700;
  font-size: 1.06rem;
  letter-spacing: 0.02em;
}

.glyph { width: 21px; height: 21px; color: var(--amber); }

.status { color: var(--bone-60); display: inline-flex; align-items: center; gap: 9px; }

.pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--amber);
  animation: pulse 2.6s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(223, 165, 60, 0.4); }
  50% { box-shadow: 0 0 0 6px rgba(223, 165, 60, 0); }
}

.row-bottom { color: var(--bone-35); }

/* ---------- poster ---------- */

.poster {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: clamp(40px, 6vh, 80px) 0 clamp(30px, 5vh, 64px);
  max-width: 1500px;
}

.display {
  font-size: clamp(2.9rem, 7.4vw, 6.8rem);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -0.035em;
  max-width: 15ch;
  margin-bottom: clamp(22px, 3.4vh, 40px);
}

.display em {
  font-style: normal;
  color: var(--amber);
}

.sub {
  color: var(--bone-60);
  font-size: clamp(1rem, 1.4vw, 1.22rem);
  font-weight: 500;
  line-height: 1.6;
  max-width: 44ch;
  margin-bottom: clamp(34px, 5vh, 56px);
}

/* ---------- signup ---------- */

.signup { max-width: 560px; }

.signup-field label {
  display: block;
  color: var(--bone-35);
  margin-bottom: 10px;
}

.signup-line {
  display: flex;
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
  transition: border-color 0.4s var(--ease);
}

.signup-line:focus-within { border-color: var(--bone-60); }

.signup-line input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  color: var(--bone);
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 500;
  padding: 6px 0;
}

.signup-line input::placeholder { color: var(--bone-35); }

.cta {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--field-deep);
  background: var(--amber);
  border: none;
  border-radius: 999px;
  padding: 12px 22px;
  cursor: pointer;
  transition: background-color 0.3s var(--ease), transform 0.3s var(--ease);
}

.cta:hover { background: var(--amber-deep); transform: translateY(-1px); }
.cta:active { transform: scale(0.97); }

.cta:focus-visible {
  outline: 2px solid var(--bone);
  outline-offset: 3px;
}
.cta:disabled { opacity: 0.6; cursor: default; }

.cta-arrow {
  width: 14px;
  height: 14px;
  opacity: 0;
  transform: translateX(-5px);
  margin-right: -18px;
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease), margin 0.3s var(--ease);
}

.cta:hover .cta-arrow { opacity: 1; transform: translateX(0); margin-right: 0; }

.form-status {
  min-height: 18px;
  margin-top: 14px;
  color: var(--amber);
  text-transform: none;
  letter-spacing: 0.04em;
}

.form-status.error { color: #d97b6c; }

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

/* ---------- tally (signature) ----------
   Seven boxes, checked one by one on a slow loop.
   22s cycle: each check draws in sequence, holds, then all reset. */

.tally {
  position: absolute;
  right: clamp(20px, 3vw, 44px);
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 18px;
  pointer-events: none;
}

.tally-box {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: var(--bone-35);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tally-check {
  stroke: var(--amber);
  stroke-dasharray: 22;
  stroke-dashoffset: 22;
  animation: tally-draw 22s var(--ease) infinite;
}

.tally-box:nth-child(1) .tally-check { animation-delay: 0s; }
.tally-box:nth-child(2) .tally-check { animation-delay: 1.8s; }
.tally-box:nth-child(3) .tally-check { animation-delay: 3.6s; }
.tally-box:nth-child(4) .tally-check { animation-delay: 5.4s; }
.tally-box:nth-child(5) .tally-check { animation-delay: 7.2s; }
.tally-box:nth-child(6) .tally-check { animation-delay: 9s; }
.tally-box:nth-child(7) .tally-check { animation-delay: 10.8s; }

@keyframes tally-draw {
  0% { stroke-dashoffset: 22; }
  4%, 82% { stroke-dashoffset: 0; }
  90%, 100% { stroke-dashoffset: 22; }
}

/* ---------- motion ---------- */

html.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 1s var(--ease), transform 1s var(--ease);
}

html.js .reveal[data-delay="3"] { transition-delay: 0.5s; }
html.js .reveal[data-delay="4"] { transition-delay: 0.72s; }

html.js .reveal.is-visible { opacity: 1; transform: translateY(0); }

html.js [data-word-reveal]:not(.is-ready) { opacity: 0; }

.word-reveal__word {
  display: inline-block;
  opacity: 0;
  transform: translate3d(0, 26px, 0);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
  transition-delay: calc(var(--word-index) * 0.07s);
  will-change: opacity, transform;
}

.is-visible .word-reveal__word { opacity: 1; transform: translate3d(0, 0, 0); }

@media (prefers-reduced-motion: reduce) {
  html.js .reveal,
  html.js [data-word-reveal]:not(.is-ready),
  .word-reveal__word {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  .pulse-dot, .ambient::before, .ambient::after { animation: none; }
  .tally-check { animation: none; stroke-dashoffset: 0; }
  .tally-box:nth-child(n+4) .tally-check { stroke-dashoffset: 22; }
}

/* ---------- responsive ---------- */

@media (max-width: 980px) {
  .tally { display: none; }
}

@media (max-width: 640px) {
  .frame { padding: 18px; }
  .poster { justify-content: center; }
  .display { max-width: none; }
  .signup-line { flex-direction: column; align-items: stretch; gap: 14px; border-bottom: none; padding-bottom: 0; }
  .signup-line input { border-bottom: 1px solid var(--line); padding-bottom: 12px; }
  .cta { justify-content: center; padding: 15px 22px; }
  .row-bottom { font-size: 0.62rem; }
}
