/* ============================================================
   StudyTheGame — waitlist landing
   Theme: near-black #0E0E12, white text, accent yellow #FAFF00,
   success green #00E676. Mobile-first. Fonts: Inter (body/UI),
   Rubik Mono One (wordmark/display), Archivo Black (numbers).
   ============================================================ */

:root {
  --bg: #0E0E12;
  --text: #FFFFFF;
  --muted: rgba(255, 255, 255, 0.48);
  --border: rgba(255, 255, 255, 0.14);
  --border-focus: rgba(255, 255, 255, 0.32);
  --field: rgba(255, 255, 255, 0.04);
  --accent: #FAFF00;
  --success: #00E676;

  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Rubik Mono One', 'Inter', sans-serif;
  --font-num: 'Archivo Black', 'Inter', sans-serif;
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  position: relative;
  overflow-x: hidden;
}

/* ---------- Atmosphere ----------
   Monochrome only — for moody depth, not decoration. */

/* Faint overhead light so the dark reads as lit, not empty. */
.ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(120% 70% at 50% -8%, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0) 60%),
    radial-gradient(90% 60% at 50% 42%, rgba(250, 255, 0, 0.035), rgba(250, 255, 0, 0) 55%);
}

/* Subtle film grain — the premium-dark texture cue. */
.grain {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.5;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

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

/* ---------- Layout ---------- */
.wrap {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  max-width: 480px;
  margin: 0 auto;
  padding: 24px 24px 22px;
}

.site-header {
  padding: 6px 0 20px;
  border-bottom: 1px solid var(--border);
}

.wordmark {
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 5vw, 1.35rem);
  letter-spacing: 0.02em;
  color: var(--text);
}

.hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 44px 0 40px;
}

/* Small display eyebrow — carries the one permitted extra yellow accent. */
.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  color: var(--muted);
  margin: 0 0 22px;
}

.eyebrow-mark {
  width: 9px;
  height: 9px;
  border-radius: 2px;
  background: var(--accent);
  box-shadow: 0 0 12px rgba(250, 255, 0, 0.55);
}

.headline {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: clamp(2rem, 8.5vw, 2.75rem);
  line-height: 1.06;
  letter-spacing: -0.025em;
  margin: 0;
}

.subline {
  color: var(--muted);
  font-size: clamp(1rem, 4.5vw, 1.15rem);
  line-height: 1.45;
  margin: 18px 0 0;
  max-width: 34ch;
}

/* ---------- Signup ---------- */
.signup {
  margin-top: 36px;
}

/* Framed panel gives the controls depth instead of floating on the bg. */
.signup-panel {
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.012));
  box-shadow: 0 24px 60px -30px rgba(0, 0, 0, 0.9);
}

.build-line {
  color: var(--muted);
  font-size: 0.8125rem;
  margin: 14px 2px 0;
}

.day-number {
  font-family: var(--font-num);
  font-size: 0.8125rem;
  color: var(--text);
}

/* Fallback form + MailerLite (.ml-form*) shared field/button styling.
   The .ml-form* selectors below let MailerLite's injected markup
   inherit this theme without touching its snippet. */
.fallback-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.fallback-form input[type="email"],
.signup .ml-form-embedContainer input[type="email"],
.signup .ml-form-embedContainer input[type="text"] {
  width: 100%;
  height: 54px;
  padding: 0 16px;
  background: var(--field);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  -webkit-appearance: none;
  appearance: none;
}

.fallback-form input[type="email"]::placeholder,
.signup .ml-form-embedContainer input::placeholder {
  color: var(--muted);
}

.fallback-form input[type="email"]:focus,
.signup .ml-form-embedContainer input:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 0 0 3px rgba(255, 255, 255, 0.05);
}

/* Primary CTA — the only "naked" yellow: yellow bg, black text. */
.cta,
.fallback-form button[type="submit"],
.signup .ml-form-embedSubmit button,
.signup button.primary {
  width: 100%;
  height: 54px;
  padding: 0 20px;
  background: var(--accent);
  color: #000000;
  border: none;
  border-radius: 12px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 10px 34px -12px rgba(250, 255, 0, 0.55);
  transition: opacity 0.15s ease, transform 0.05s ease, box-shadow 0.15s ease;
}

.cta:hover,
.fallback-form button[type="submit"]:hover,
.signup .ml-form-embedSubmit button:hover,
.signup button.primary:hover {
  opacity: 0.9;
}

.cta:active,
.signup .ml-form-embedSubmit button:active {
  transform: translateY(1px);
}

.cta:focus-visible,
.fallback-form input:focus-visible,
.success-link:focus-visible,
.handle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ---------- MailerLite theme overrides ----------
   Strip MailerLite's own chrome so nothing bleeds through. */
.signup .ml-form-embedContainer,
.signup .ml-form-embedWrapper,
.signup .ml-form-embedBody,
.signup .ml-form-embedSubmit {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;
  max-width: none !important;
  font-family: var(--font-body) !important;
  color: var(--text) !important;
}

.signup .ml-form-embedContainer * {
  font-family: var(--font-body) !important;
}

/* Layout the ML fields to match the fallback form (stacked, 12px gap) */
.signup .ml-form-embedBody .ml-form-fieldRow {
  margin-bottom: 12px !important;
}

.signup .ml-form-embedContainer label,
.signup .ml-form-embedContainer .ml-form-embedContent,
.signup .ml-form-embedContainer p {
  color: var(--text) !important;
}

/* Hide MailerLite branding + its default success body (we use our own) */
.signup .ml-form-embedPermissions,
.signup .ml-form-embedContainer .ml-form-successBody,
.signup a[href*="mailerlite"],
.signup .ml-form-embedContainer [class*="branding"] {
  display: none !important;
}

/* Red validation state on an invalid field */
.signup .ml-form-embedContainer .ml-error input {
  border-color: #ff5a5a !important;
}

/* Submit loading spinner — theme-matched (dark on the yellow button),
   since MailerLite's own spinner styles were stripped out. */
.signup .ml-form-embedSubmitLoad {
  display: inline-block;
  width: 20px;
  height: 20px;
}

.signup .ml-form-embedSubmitLoad:after {
  content: " ";
  display: block;
  width: 11px;
  height: 11px;
  margin: 1px;
  border-radius: 50%;
  border: 3px solid #000;
  border-color: #000 #000 #000 transparent;
  animation: ml-spin 1.1s linear infinite;
}

@keyframes ml-spin {
  to { transform: rotate(360deg); }
}

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

/* ---------- Success state ---------- */
.success {
  margin-top: 40px;
  padding: 22px;
  border: 1px solid rgba(0, 230, 118, 0.35);
  border-radius: 14px;
  background: rgba(0, 230, 118, 0.06);
}

.success-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  background: rgba(0, 230, 118, 0.12);
}

.success-title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--success);
  margin: 16px 0 8px;
}

.success-link {
  color: var(--text);
  font-size: 1rem;
  text-decoration: none;
  border-bottom: 1px solid var(--muted);
  padding-bottom: 2px;
}

.success-link:hover {
  border-bottom-color: var(--text);
}

/* Toggle: body.is-success hides the form, shows the success card. */
body.is-success #signup {
  display: none;
}

body.is-success #success {
  display: block;
}

/* ---------- Footer ---------- */
.site-footer {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.handle {
  color: var(--muted);
  font-size: 0.875rem;
  text-decoration: none;
}

.handle:hover {
  color: var(--text);
}

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
