/* Grindcore Never Sleeps / waitlist v1
   Locked palette: black #000000, cream #FDF9EF, blood red #E10202.
   Red only for: the hero rule, focus rings, error markers, button hover. */

@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/ibm-plex-mono-latin-400.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/ibm-plex-mono-latin-700.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --black: #000000;
  --cream: #FDF9EF;
  --red: #E10202;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --gutter: 20px;
  color-scheme: dark;
}

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

html {
  background: var(--black);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--black);
  color: var(--cream);
  font-family: var(--mono);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }

p { margin: 0; }

a { color: var(--cream); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }

[hidden] { display: none !important; }

:focus { outline: none; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }
[tabindex="-1"]:focus { outline: none; }

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

/* Small uppercase labels: wide tracking. */
.kicker,
.field label,
legend,
.tile-name,
.micro,
.foot,
.gate-age {
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

/* Layout */

main {
  width: 100%;
  max-width: 40rem;
  margin: 0 auto;
  padding: 0 var(--gutter);
  padding-left: max(var(--gutter), env(safe-area-inset-left));
  padding-right: max(var(--gutter), env(safe-area-inset-right));
}

/* Hero */

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-top: 56px;
}

.mark img {
  width: 60vw;
  max-width: 420px;
}

.mark-text {
  font-weight: 700;
  font-size: clamp(1.5rem, 8vw, 2.75rem);
  line-height: 1.15;
  letter-spacing: 0.08em;
}

.hero-text .mark-badge { display: none; }
.hero-text .mark-text { display: block !important; }

.kicker {
  margin-top: 40px;
}

h1 {
  margin: 16px 0 0;
  max-width: 30rem;
  font-size: clamp(1.25rem, 5.4vw, 1.75rem);
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.rule {
  display: block;
  width: 48px;
  height: 2px;
  margin-top: 28px;
  background: var(--red);
}

/* Waitlist */

.join {
  max-width: 24rem;
  margin: 72px auto 0;
}

.form { display: flex; flex-direction: column; gap: 20px; }

.field { display: flex; flex-direction: column; gap: 8px; }

input[type="email"],
input[type="text"] {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border: 1px solid var(--cream);
  border-radius: 0;
  background: var(--black);
  color: var(--cream);
  caret-color: var(--cream);
  font: inherit;
  font-size: 1rem; /* 16px stops iOS zoom on focus */
  -webkit-appearance: none;
  appearance: none;
}

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--cream);
  -webkit-box-shadow: 0 0 0 1000px var(--black) inset;
  box-shadow: 0 0 0 1000px var(--black) inset;
  transition: background-color 9999s 0s;
}

.hp { display: none !important; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 10px 22px;
  border: 1px solid var(--cream);
  border-radius: 0;
  font: inherit;
  font-weight: 700;
  font-size: 0.9375rem;
  letter-spacing: 0.06em;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.btn-solid { background: var(--cream); color: var(--black); }
.btn-ghost { background: var(--black); color: var(--cream); }

@media (hover: hover) {
  .btn:hover { background: var(--red); border-color: var(--red); color: var(--cream); }
}

.btn:active { background: var(--red); border-color: var(--red); color: var(--cream); }

.btn[disabled] { cursor: progress; }

.micro {
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  line-height: 1.8;
}

.error {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: 0.875rem;
  line-height: 1.5;
}

.error::before {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  background: var(--red);
  transform: translateY(-1px);
}

/* Admission state */

.admitted { display: flex; flex-direction: column; gap: 40px; text-align: center; }

.admitted legend { width: 100%; text-align: center; }
.admitted .tile { align-items: center; }
.admitted .error { justify-content: center; }

.admission,
.closing {
  font-weight: 700;
  font-size: 1.125rem;
  line-height: 1.5;
}

.demand { gap: 28px; }

fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }

legend { padding: 0; margin-bottom: 14px; }

.designs legend {
  font-size: 0.9375rem;
  letter-spacing: 0;
  text-transform: none;
  font-weight: 700;
  line-height: 1.5;
}

.pick {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
}

.design-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.design { position: relative; display: block; cursor: pointer; }

.tile {
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100%;
  padding: 6px;
  border: 2px solid var(--black);
}

.tile-name {
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.pick:checked + .tile { border-color: var(--cream); }
.pick:focus-visible + .tile { outline: 2px solid var(--red); outline-offset: 2px; }

.size-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.size { position: relative; display: block; flex: 0 0 calc((100% - 24px) / 4); cursor: pointer; }

@media (min-width: 30rem) {
  .size { flex-basis: calc((100% - 48px) / 7); }
}

.chip {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border: 1px solid var(--cream);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.pick:checked + .chip { background: var(--cream); color: var(--black); }
.pick:focus-visible + .chip { outline: 2px solid var(--red); outline-offset: 2px; }

.demand-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}

.quiet {
  min-height: 48px;
  min-width: 48px;
  padding: 0 4px;
  border: 0;
  background: none;
  color: var(--cream);
  font: inherit;
  font-size: 0.875rem;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

/* Lore */

.lore p,
.micro,
.gate-age,
.gate-q,
.admission,
.closing,
.designs legend,
.plain .lead { text-wrap: balance; }

.lore {
  max-width: 24rem;
  margin: 96px auto 0;
  text-align: center;
  font-size: 0.9375rem;
  line-height: 1.8;
}

/* Footer */

.foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  column-gap: 24px;
  max-width: 40rem;
  margin: 96px auto 0;
  padding: 24px var(--gutter) max(24px, env(safe-area-inset-bottom));
  font-size: 0.75rem;
  letter-spacing: 0.14em;
}

.foot > * { display: inline-flex; align-items: center; min-height: 44px; }

/* Plain pages: joined, privacy, 404 */

.plain {
  max-width: 34rem;
  padding-top: 72px;
}

.plain h1 { max-width: none; }

.plain .lead {
  font-weight: 700;
  font-size: 1.25rem;
  line-height: 1.45;
}

.plain .back { display: inline-flex; align-items: center; min-height: 44px; margin-top: 32px; }

.prose { margin-top: 32px; display: flex; flex-direction: column; gap: 28px; }
.prose h2 { margin: 0 0 8px; font-size: 0.75rem; letter-spacing: 0.18em; text-transform: uppercase; font-weight: 700; }
.prose p { line-height: 1.7; }
.prose a { padding: 12px 0; } /* 44px tap area without changing the line */
.prose a { overflow-wrap: anywhere; }

/* Gate. Built by main.js; without JS there is no gate. */

html.gate-pending body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--black);
}

.gate {
  position: fixed;
  inset: 0;
  z-index: 101;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--gutter);
  background: var(--black);
  text-align: center;
  opacity: 1;
  transition: opacity 400ms ease-out;
}

.gate.is-leaving { opacity: 0; }

html.gate-open,
html.gate-open body { overflow: hidden; }

.gate-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
  max-width: 22rem;
}

.gate-q {
  font-weight: 700;
  font-size: clamp(1.25rem, 6vw, 1.625rem);
  line-height: 1.3;
}

.gate-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.gate-wait {
  font-size: 1rem;
  line-height: 1.5;
}

.gate-age { font-size: 0.75rem; letter-spacing: 0.12em; line-height: 1.8; }

.gate-flash {
  position: fixed;
  inset: 0;
  background: var(--cream);
  opacity: 0;
  pointer-events: none;
}

/* One hit: instant on, gone in about 120ms. Runs once, never loops. */
.gate-flash.is-hit { animation: gns-hit 120ms ease-out 1 forwards; }

@keyframes gns-hit {
  0% { opacity: 1; }
  100% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .gate { transition-duration: 300ms; }
  .gate-flash { display: none; }
}

@media (min-width: 700px) {
  .hero { padding-top: 88px; }
}
