/* ================= Design tokens ================= */

:root {
  /* Background gradient stops */
  --bg-top: #23253a;
  --bg-mid: #1b1d2e;
  --bg-bottom: #121320;

  /* Brand */
  --accent: #f2825f;
  --accent-bright: #f49172;
  --accent-glow: rgba(242, 130, 95, 0.2);
  --accent-ring: rgba(242, 130, 95, 0.22);
  --blue-glow: rgba(77, 157, 224, 0.12);

  /* Text */
  --text: #f4f1de;
  --text-muted: #9a9cb0;
  --text-faint: #7e8098;
  --text-on-accent: #23253a;

  /* Feedback */
  --danger: #e06c7c;
  --danger-border: #d1495b;
  --success: #0ccf6e;
  --success-border: rgba(12, 207, 110, 0.45);
  --success-bg: rgba(12, 207, 110, 0.08);

  /* Fields */
  --field-bg: rgba(244, 241, 222, 0.06);
  --field-border: rgba(244, 241, 222, 0.18);
  --hover-bg: rgba(244, 241, 222, 0.07);

  /* Shape and spacing */
  --radius-pill: 999px;
  --control-height: 52px;
  --page-pad: clamp(20px, 4vw, 44px);
  --stack-gap: clamp(16px, 2.6vh, 26px);

  --font-stack: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* ================= Base ================= */

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

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background-color: var(--bg-bottom);
  background-image: linear-gradient(180deg, var(--bg-top) 0%, var(--bg-mid) 55%, var(--bg-bottom) 100%);
  color: var(--text);
  font-family: var(--font-stack);
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--accent);
  color: var(--text-on-accent);
}

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

/* ================= Backdrop: glows and floating dots ================= */

.backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.glow {
  position: absolute;
  border-radius: 50%;
}

.glow-warm {
  top: -22%;
  left: -14%;
  width: 58vw;
  height: 58vw;
  background: radial-gradient(circle, var(--accent-glow), transparent 68%);
  animation: glow-pulse 7s ease-in-out infinite alternate;
}

.glow-cool {
  bottom: -28%;
  right: -16%;
  width: 62vw;
  height: 62vw;
  background: radial-gradient(circle, var(--blue-glow), transparent 68%);
  animation: glow-pulse 9s ease-in-out 1.5s infinite alternate;
}

.dot {
  position: absolute;
  border-radius: 50%;
  animation: dot-float ease-in-out infinite alternate;
}

.dot:nth-of-type(1) { left: 16%; top: 24%; width: 6px; height: 6px; background: rgba(242, 130, 95, 0.55); animation-duration: 8s; }
.dot:nth-of-type(2) { left: 78%; top: 30%; width: 4px; height: 4px; background: rgba(244, 241, 222, 0.35); animation-duration: 10s; animation-delay: 1s; }
.dot:nth-of-type(3) { left: 68%; top: 70%; width: 7px; height: 7px; background: rgba(242, 130, 95, 0.4);  animation-duration: 9s;  animation-delay: 2s; }
.dot:nth-of-type(4) { left: 26%; top: 74%; width: 5px; height: 5px; background: rgba(77, 157, 224, 0.35); animation-duration: 11s; animation-delay: 0.5s; }
.dot:nth-of-type(5) { left: 8%;  top: 55%; width: 4px; height: 4px; background: rgba(244, 241, 222, 0.25); animation-duration: 12s; animation-delay: 3s; }
.dot:nth-of-type(6) { left: 88%; top: 52%; width: 5px; height: 5px; background: rgba(242, 130, 95, 0.45); animation-duration: 10s; animation-delay: 2.4s; }

@keyframes dot-float {
  from { transform: translateY(0); }
  to   { transform: translateY(-28px); }
}

@keyframes glow-pulse {
  from { opacity: 0.55; }
  to   { opacity: 1; }
}

/* ================= Layout ================= */

.page {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 100vh;
  min-height: 100dvh;
  padding: var(--page-pad);
}

/* ================= Header ================= */

.site-header {
  display: flex;
  justify-content: center;
}

.logo {
  height: clamp(56px, 9vh, 84px);
  width: auto;
  filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.35));
}

/* ================= Hero ================= */

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--stack-gap);
  padding: 0 8px;
  text-align: center;
}

.headline {
  margin: 0;
  font-size: clamp(46px, 9vw, 96px);
  font-weight: 900;
  line-height: 1.04;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.headline-dot {
  color: var(--accent);
}

.tagline {
  margin: 0;
  max-width: 46ch;
  font-size: clamp(15px, 2vw, 18px);
  line-height: 1.5;
  letter-spacing: 0.01em;
  color: var(--text-muted);
}

/* ================= Signup form ================= */

.signup {
  display: grid;
  justify-items: center;
  width: min(460px, 100%);
  margin-top: 6px;
}

.notify-form {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  width: 100%;
}

.email-input {
  flex: 1 1 240px;
  min-height: var(--control-height);
  padding: 0 22px;
  border: 1.5px solid var(--field-border);
  border-radius: var(--radius-pill);
  background: var(--field-bg);
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  caret-color: var(--accent);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.email-input::placeholder {
  color: var(--text-muted);
}

.email-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.email-input[aria-invalid="true"] {
  border-color: var(--danger-border);
}

.email-input:disabled {
  opacity: 0.6;
}

.notify-button {
  min-height: var(--control-height);
  padding: 0 30px;
  border: none;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: var(--text-on-accent);
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}

.notify-button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(242, 130, 95, 0.35);
  background: var(--accent-bright);
}

.notify-button:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 3px;
}

.notify-button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.form-error {
  width: 100%;
  margin: 0;
  font-size: 14px;
  color: var(--danger);
}

/* Empty until JS injects the confirmation, so the aria-live region
   exists at page load and the announcement is reliable. */
.form-success {
  margin: 0;
  font-size: 15px;
}

.form-success.is-visible {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: var(--control-height);
  padding: 0 26px;
  border: 1.5px solid var(--success-border);
  border-radius: var(--radius-pill);
  background: var(--success-bg);
}

.form-success .check {
  color: var(--success);
  font-weight: 700;
}

/* ================= Footer ================= */

.site-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.social-links {
  display: flex;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.social-link {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: var(--text-muted);
  transition: color 0.2s, background 0.2s;
}

.social-link:hover {
  color: var(--text);
  background: var(--hover-bg);
}

.social-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.copyright {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.05em;
  color: var(--text-faint);
}

/* ================= Small screens ================= */

@media (max-width: 480px) {
  .notify-form {
    flex-direction: column;
  }

  .email-input,
  .notify-button {
    width: 100%;
    flex: none;
  }

  /* 16px prevents iOS Safari from zooming the page on focus */
  .email-input {
    font-size: 16px;
  }
}

/* ================= Reduced motion ================= */

@media (prefers-reduced-motion: reduce) {
  .glow,
  .dot {
    animation: none;
  }

  .glow {
    opacity: 0.75;
  }

  .notify-button:hover:not(:disabled) {
    transform: none;
  }
}
