/* ============================================================
   Nudgi Focus — waitlist landing page
   Ion design system.

   Token values below are copied verbatim from
   `design system/tokens/{colors,typography,spacing}.css` so this
   page tracks the source of truth rather than forking it. If a
   token changes there, change it here too.
   ============================================================ */

/* ===== Custom Properties ===== */
:root {
  /* ---- Space canvas / surfaces (cold, near-monochrome) ---- */
  --space-950: #080b12;
  --space-900: #0c0f18;
  --space-850: #161b29;
  --space-800: #141828;
  --space-750: #1b2132;
  --space-700: #242c40;
  --space-border: #1d2233;
  --space-border-soft: rgba(214, 221, 238, 0.08);

  /* ---- Text (cool grayscale) ---- */
  --fg-1: #eef0f6;
  --fg-2: #b6bccb;
  --fg-3: #7b8194;
  --fg-4: #3c4255;
  --fg-on-accent: #04141a;

  /* ---- Ion teal — THE one accent ---- */
  --ion-300: #6fe0ea;
  --ion-350: #45cad6;
  --ion-400: #2fb8c4;
  --ion-500: #1e97a2;
  --ion-fill-soft: rgba(47, 184, 196, 0.12);
  --ion-border: rgba(47, 184, 196, 0.42);

  /* ---- Decorative neutrals (stars) ---- */
  --star: #6b7490;
  --star-bright: #aab2c6;

  /* ---- Danger — the one destructive signal ---- */
  --danger-400: #e34450;

  /* ---- Semantic aliases — use THESE below ---- */
  --bg-base: var(--space-950);
  --bg-screen: var(--space-900);
  --surface-card: var(--space-800);
  --surface-raised: var(--space-850);
  --surface-input: var(--space-950);
  --surface-hover: var(--space-750);
  --border-hairline: var(--space-border);
  --border-soft: var(--space-border-soft);

  --text-strong: var(--fg-1);
  --text-body: var(--fg-2);
  --text-muted: var(--fg-3);
  --text-dim: var(--fg-4);

  --accent: var(--ion-400);
  --accent-hover: var(--ion-350);
  --accent-text: var(--fg-on-accent);
  --accent-fill-soft: var(--ion-fill-soft);

  /* ---- Type ---- */
  --font-display: 'Sora', 'Hanken Grotesk', system-ui, sans-serif;
  --font-sans: 'Hanken Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;

  --tracking-display: -0.02em;
  --tracking-eyebrow: 0.16em;

  --leading-tight: 1.05;
  --leading-snug: 1.25;
  --leading-normal: 1.55;

  /* ---- Radii ---- */
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 24px;
  --radius-pill: 100px;

  /* ---- Shadows — one flat ambient scale, never colored ---- */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.40);
  --shadow-md: 0 6px 20px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.55);
  --focus-ring: 0 0 0 3px rgba(47, 184, 196, 0.45);

  /* ---- Motion ---- */
  --ease-standard: cubic-bezier(0.4, 0, 0.2, 1);
  --dur-fast: 120ms;
  --dur-base: 200ms;
  --dur-slow: 360ms;
  --dur-orbit: 60s;
  --press-scale: 0.97;
}

/* ===== Reset ===== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* script.js toggles the `hidden` property on elements this sheet
   gives a `display` value. This must outrank every one of them. */
[hidden] {
  display: none !important;
}

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

body {
  font-family: var(--font-sans);
  background: var(--bg-screen);
  color: var(--text-body);
  font-size: 1rem;
  line-height: var(--leading-normal);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: relative;
  overflow-x: hidden;
}

/* Ambient starfield — a dim, sparse night sky behind everything.
   Pure CSS, fixed, never interactive. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.5;
  background-image:
    radial-gradient(1.4px 1.4px at 12% 18%, var(--star-bright), transparent),
    radial-gradient(1px 1px at 27% 62%, var(--star), transparent),
    radial-gradient(1.6px 1.6px at 44% 12%, var(--star-bright), transparent),
    radial-gradient(1px 1px at 58% 78%, var(--star), transparent),
    radial-gradient(1.2px 1.2px at 71% 33%, var(--star-bright), transparent),
    radial-gradient(1px 1px at 83% 68%, var(--star), transparent),
    radial-gradient(1.5px 1.5px at 91% 22%, var(--star-bright), transparent),
    radial-gradient(1px 1px at 8% 84%, var(--star), transparent),
    radial-gradient(1.1px 1.1px at 36% 91%, var(--star), transparent),
    radial-gradient(1.3px 1.3px at 65% 5%, var(--star-bright), transparent);
}

.topbar,
main,
.footer {
  position: relative;
  z-index: 1;
}

img, svg {
  display: block;
  max-width: 100%;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

a {
  color: var(--ion-300);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Keyboard focus is always the ion ring — never a border swap. */
:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: var(--radius-sm);
}

/* ===== Layout ===== */
.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ===== Eyebrow =====
   The Ion spec paints eyebrows in `--star` (#6b7490). At 11px on this
   canvas that measures 4.13:1 — below WCAG AA for text this size. On a
   public marketing page we step to `--text-muted` (#7b8194, 4.93:1),
   which is still an in-system token. */
.eyebrow {
  font-family: var(--font-sans);
  font-size: 0.6875rem;
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 14px;
}

/* ===== Top Bar ===== */
.topbar {
  padding: 20px 0;
  border-bottom: 1px solid var(--border-hairline);
}

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

.topbar__logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-display);
  color: var(--text-strong);
  text-decoration: none;
}

.topbar__logo:hover {
  text-decoration: none;
}

.topbar__mark {
  flex: none;
  border-radius: var(--radius-sm);
}

/* ===== Hero ===== */
.hero {
  padding: 72px 0 96px;
}

.hero__inner {
  display: flex;
  flex-direction: column;
  gap: 60px;
}

.hero__left {
  flex: 1;
  max-width: 540px;
}

.hero__headline {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-display);
  color: var(--text-strong);
  text-wrap: balance;
  margin-bottom: 18px;
}

.hero__subheadline {
  font-size: 1.125rem;
  color: var(--text-body);
  line-height: var(--leading-normal);
  margin-bottom: 24px;
}

.hero__play-badge {
  display: block;
  width: 160px;
  max-width: 100%;
  margin-left: -11px;
}

.hero__play-badge img {
  width: 100%;
  height: auto;
}

.hero__play-badge:hover {
  text-decoration: none;
}

/* Form */
.hero__form {
  position: relative;
  margin-top: 24px;
}

.hero__form-question {
  font-size: 1.125rem;
  font-weight: var(--weight-semibold);
  color: var(--text-strong);
  margin-bottom: 14px;
}

.hero__form-row {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hero__input {
  font-family: var(--font-sans);
  font-size: 1rem;
  padding: 15px 18px;
  background: var(--surface-input);
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-strong);
  outline: none;
  width: 100%;
  transition: box-shadow var(--dur-base) var(--ease-standard);
}

.hero__input:focus {
  box-shadow: var(--focus-ring);
}

.hero__input::placeholder {
  color: var(--text-dim);
}

.hero__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: var(--weight-bold);
  line-height: 1;
  min-height: 52px;
  padding: 15px 30px;
  background: var(--accent);
  color: var(--accent-text);
  border-radius: var(--radius-pill);
  border: none;
  cursor: pointer;
  transition: background var(--dur-base) var(--ease-standard), transform var(--dur-fast);
  white-space: nowrap;
}

.hero__cta:hover:not(:disabled) {
  background: var(--accent-hover);
}

.hero__cta:active:not(:disabled) {
  transform: scale(var(--press-scale));
}

.hero__cta:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.spinner {
  animation: spin 0.8s linear infinite;
}

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

.hero__error {
  color: var(--danger-400);
  font-size: 0.875rem;
  margin-top: 8px;
}

.hero__microcopy {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 14px;
}

/* Success State */
.hero__success-state {
  animation: fadeIn var(--dur-slow) var(--ease-standard) forwards;
}

.hero__success-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.hero__success-title {
  font-family: var(--font-display);
  font-size: 1.625rem;
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-display);
  line-height: var(--leading-snug);
  color: var(--text-strong);
}

.hero__success-subtitle {
  color: var(--text-body);
  margin-bottom: 28px;
}

/* Questions */
.questions {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-bottom: 24px;
}

.question__label {
  font-size: 0.9375rem;
  font-weight: var(--weight-semibold);
  color: var(--text-strong);
  margin-bottom: 10px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  font-weight: var(--weight-medium);
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  border: none;
  background: var(--surface-raised);
  color: var(--text-body);
  transition: background var(--dur-base) var(--ease-standard), color var(--dur-base) var(--ease-standard);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.chip:hover {
  background: var(--surface-hover);
  color: var(--text-strong);
}

.chip.selected {
  background: var(--accent-fill-soft);
  color: var(--ion-300);
}

.chip.selected:hover {
  background: rgba(47, 184, 196, 0.20);
}

.questions__actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.btn-secondary {
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  font-weight: var(--weight-bold);
  line-height: 1;
  min-height: 52px;
  padding: 14px 28px;
  background: var(--surface-raised);
  border: none;
  border-radius: var(--radius-pill);
  color: var(--text-strong);
  transition: background var(--dur-base) var(--ease-standard), transform var(--dur-fast);
}

.btn-secondary:hover {
  background: var(--surface-hover);
}

.btn-secondary:active {
  transform: scale(var(--press-scale));
}

.btn-link {
  font-family: var(--font-sans);
  font-size: 0.875rem;
  color: var(--text-dim);
  background: none;
  border: none;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color var(--dur-base) var(--ease-standard);
}

.btn-link:hover {
  color: var(--text-muted);
}

.hero__final-thanks {
  padding: 16px 0;
  color: var(--text-body);
  animation: fadeIn var(--dur-slow) var(--ease-standard) forwards;
}

/* Phone Frame + orbit rings.
   Your attention is the gravity everything orbits — the rings are
   structure, not scenery. */
.hero__right {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero__right::before,
.hero__right::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 46%;
  border: 1px solid var(--border-soft);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  animation: orbit var(--dur-orbit) linear infinite;
}

.hero__right::before {
  width: 400px;
  height: 400px;
}

.hero__right::after {
  width: 560px;
  height: 560px;
  animation-duration: 90s;
  animation-direction: reverse;
}

@keyframes orbit {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

.phone-frame {
  position: relative;
  z-index: 1;
  width: 260px;
  filter: drop-shadow(0 20px 50px rgba(0, 0, 0, 0.55));
}

.phone-frame__img {
  width: 100%;
  height: auto;
}

.hero__caption {
  position: relative;
  z-index: 1;
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 16px;
  text-align: center;
}

/* ===== Benefits ===== */
.benefits {
  padding: 80px 0;
  border-top: 1px solid var(--border-hairline);
}

.benefits__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

.benefit-card {
  background: var(--surface-card);
  border: none;
  border-radius: var(--radius-md);
  padding: 32px 28px;
  box-shadow: var(--shadow-sm);
  transition: background var(--dur-slow) var(--ease-standard), box-shadow var(--dur-slow);
}

.benefit-card:hover {
  background: var(--surface-hover);
  box-shadow: var(--shadow-md);
}

.benefit-card__icon {
  color: var(--accent);
  margin-bottom: 18px;
}

.benefit-card__title {
  font-size: 1.125rem;
  font-weight: var(--weight-semibold);
  color: var(--text-strong);
  margin-bottom: 9px;
}

.benefit-card__text {
  font-size: 0.9375rem;
  color: var(--text-body);
  line-height: 1.5;
}

/* ===== Steps ===== */
.steps {
  padding: 80px 0;
  border-top: 1px solid var(--border-hairline);
}

.steps__title {
  font-family: var(--font-display);
  font-size: 1.625rem;
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-display);
  line-height: var(--leading-snug);
  color: var(--text-strong);
  margin-bottom: 44px;
}

.steps__grid {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.step {
  text-align: center;
  max-width: 260px;
}

.step__number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  font-size: 0.875rem;
  font-weight: var(--weight-bold);
  border-radius: 50%;
  background: var(--accent-fill-soft);
  color: var(--ion-300);
  border: none;
  margin-bottom: 14px;
}

.step__label {
  font-size: 1.0625rem;
  font-weight: var(--weight-semibold);
  color: var(--text-strong);
  margin-bottom: 7px;
}

.step__text {
  font-size: 0.875rem;
  color: var(--text-body);
  line-height: 1.5;
}

.step__arrow {
  color: var(--text-dim);
  transform: rotate(90deg);
}

/* ===== FAQ ===== */
.faq {
  padding: 80px 0;
  border-top: 1px solid var(--border-hairline);
}

.faq__title {
  font-family: var(--font-display);
  font-size: 1.625rem;
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-display);
  line-height: var(--leading-snug);
  color: var(--text-strong);
  margin-bottom: 36px;
}

/* The list is measure-limited, but its left edge stays on the same
   grid line as every other section's — the container is not narrowed. */
.faq__item {
  max-width: 720px;
  border-bottom: 1px solid var(--border-hairline);
}

.faq__question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  padding: 20px 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: var(--weight-semibold);
  text-align: left;
  color: var(--text-strong);
  background: none;
  border: none;
  cursor: pointer;
  transition: color var(--dur-base) var(--ease-standard);
}

.faq__question:hover {
  color: var(--ion-300);
}

.faq__chevron {
  flex-shrink: 0;
  color: var(--text-muted);
  transition: transform var(--dur-base) var(--ease-standard);
}

.faq__question[aria-expanded="true"] .faq__chevron {
  transform: rotate(180deg);
  color: var(--accent);
}

.faq__answer {
  padding: 0 0 20px;
}

.faq__answer p {
  font-size: 0.9375rem;
  color: var(--text-body);
  line-height: var(--leading-normal);
}

/* ===== Legal Pages ===== */
.legal-page {
  padding: 64px 0 88px;
}

.legal-page__inner {
  max-width: 800px;
}

.legal-page h1 {
  font-family: var(--font-display);
  font-size: 2.25rem;
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-display);
  line-height: var(--leading-tight);
  color: var(--text-strong);
  text-wrap: balance;
  margin-bottom: 16px;
}

.legal-page__lead {
  color: var(--text-body);
  font-size: 1.0625rem;
  margin-bottom: 40px;
}

.legal-section {
  padding: 28px 0;
  border-top: 1px solid var(--border-hairline);
}

.legal-section h2 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-display);
  line-height: var(--leading-snug);
  color: var(--text-strong);
  margin-bottom: 12px;
}

.legal-section h3 {
  font-size: 1.0625rem;
  font-weight: var(--weight-semibold);
  color: var(--text-strong);
  margin-bottom: 8px;
}

.legal-section p,
.legal-section li {
  color: var(--text-body);
}

.legal-section ol,
.legal-section ul {
  padding-left: 22px;
}

.legal-section li + li {
  margin-top: 10px;
}

/* ===== Footer ===== */
.footer {
  padding: 40px 0;
  border-top: 1px solid var(--border-hairline);
}

.footer__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.footer__links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 24px;
}

.footer__links a {
  color: var(--text-muted);
  transition: color var(--dur-base) var(--ease-standard);
}

.footer__links a:hover {
  color: var(--text-strong);
  text-decoration: none;
}

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

/* ===== Animations ===== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}

@media (max-width: 767px) {
  .hero {
    padding-top: 48px;
  }

  .hero__inner {
    gap: 0;
  }

  .hero__left {
    display: contents;
  }

  .hero__headline { order: 1; }
  .hero__subheadline { order: 2; }
  .hero__play-badge { order: 3; }
  .hero__right { order: 4; }
  .hero__form-state { order: 5; }
  .hero__success-state { order: 6; }

  .hero__play-badge {
    margin-bottom: 12px;
  }

  .phone-frame {
    width: 230px;
  }

  .hero__form-state,
  .hero__success-state {
    width: 100%;
    margin-top: 32px;
  }

  .hero__form {
    margin-top: 0;
  }
}

/* ===== Desktop (768px+) ===== */
@media (min-width: 768px) {
  .hero__inner {
    flex-direction: row;
    align-items: center;
    gap: 80px;
  }

  .hero__headline {
    font-size: 3.5rem;
  }

  .hero__form-row {
    flex-direction: row;
  }

  .hero__input {
    flex: 1;
  }

  .benefits__grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .steps__grid {
    flex-direction: row;
    justify-content: flex-start;
    align-items: flex-start;
    gap: 16px;
  }

  /* Left-packed row under a left-aligned title — the whole page sits
     on one grid line. */
  .step {
    text-align: left;
  }

  .step__arrow {
    transform: none;
    padding-top: 8px;
  }

  .footer__inner {
    flex-direction: row;
    justify-content: space-between;
  }
}

/* ===== Large Desktop (1024px+) ===== */
@media (min-width: 1024px) {
  .hero {
    padding: 112px 0 132px;
  }

  .hero__headline {
    font-size: 4.25rem;
  }

  .steps__title,
  .faq__title {
    font-size: 2rem;
  }

  .phone-frame {
    width: 300px;
  }
}
