:root {
  --kagan-blue: #0a84ff;
  --kagan-blue-deep: #005baa;
  --kagan-blue-light: #91eef3;
  --kagan-yellow: #ffd400;
  --kagan-magenta: #ec008c;
  --kagan-cyan: #00aeef;
  --ink: #02061d;
  --ink-2: #050b25;
  --text: #f5f8ff;
  --text-muted: rgba(245, 248, 255, 0.88);
  --text-subtle: rgba(245, 248, 255, 0.7);
  --radius: 14px;
  --radius-lg: 18px;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-rise: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--ink);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

.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;
}

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

.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 1.5rem 2rem;
  background-color: var(--ink);
  background-image:
    radial-gradient(120% 80% at 50% 110%, #001a4d 0%, transparent 60%),
    linear-gradient(180deg, var(--ink) 0%, #040a22 50%, #02061d 100%);
  isolation: isolate;
}

/* ----------------------------------------------------------------
   Aurora — animated blurred color orbs drifting behind the content.
   Uses the brand palette (blue, magenta, cyan, yellow).
   ---------------------------------------------------------------- */

.hero__aurora {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.hero__orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  pointer-events: none;
  will-change: transform, opacity;
  mix-blend-mode: screen;
}

.hero__orb--1 {
  width: 60vmax;
  height: 60vmax;
  top: -18vmax;
  left: -16vmax;
  background: radial-gradient(closest-side, #0a84ff 0%, rgba(10, 132, 255, 0) 72%);
  opacity: 0.62;
  animation: driftA 24s ease-in-out infinite alternate;
}

.hero__orb--2 {
  width: 52vmax;
  height: 52vmax;
  top: -12vmax;
  right: -16vmax;
  background: radial-gradient(closest-side, #ec008c 0%, rgba(236, 0, 140, 0) 70%);
  opacity: 0.48;
  animation: driftB 28s ease-in-out -4s infinite alternate;
}

.hero__orb--3 {
  width: 65vmax;
  height: 65vmax;
  bottom: -22vmax;
  left: -14vmax;
  background: radial-gradient(closest-side, #00aeef 0%, rgba(0, 174, 239, 0) 75%);
  opacity: 0.42;
  animation: driftC 32s ease-in-out -10s infinite alternate;
}

.hero__orb--4 {
  width: 44vmax;
  height: 44vmax;
  bottom: -14vmax;
  right: -10vmax;
  background: radial-gradient(closest-side, #ffd400 0%, rgba(255, 212, 0, 0) 70%);
  opacity: 0.3;
  animation: driftA 26s ease-in-out -7s infinite alternate;
}

.hero__orb--5 {
  width: 38vmax;
  height: 38vmax;
  top: 8%;
  left: 32%;
  background: radial-gradient(closest-side, #1a4cff 0%, rgba(26, 76, 255, 0) 65%);
  opacity: 0.55;
  animation: driftB 30s ease-in-out -16s infinite alternate;
}

.hero__orb--6 {
  width: 30vmax;
  height: 30vmax;
  top: 38%;
  right: 22%;
  background: radial-gradient(closest-side, #ec008c 0%, rgba(236, 0, 140, 0) 60%);
  opacity: 0.32;
  animation: driftC 34s ease-in-out -22s infinite alternate;
}

/* Fine film-grain noise overlay for a richer, more cinematic feel. */
.hero__grain {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.07;
  mix-blend-mode: overlay;
}

.hero__content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 760px;
  width: 100%;
}

.hero__eyebrow {
  font-family: 'Fredoka', system-ui, sans-serif;
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--text-subtle);
  margin: 0 0 1.25rem;
  opacity: 0;
  animation: rise 800ms var(--ease-rise) 200ms forwards;
}

.hero__subtitle {
  font-family: 'Fredoka', system-ui, sans-serif;
  font-weight: 500;
  font-size: clamp(0.9375rem, 1.3vw, 1.0625rem);
  line-height: 1.4;
  color: var(--text-muted);
  margin: 0 0 2.25rem;
  max-width: 540px;
  opacity: 0;
  animation: rise 800ms var(--ease-rise) 350ms forwards;
}

.hero__wordmark {
  display: block;
  margin: 0 0 1.75rem;
  color: var(--kagan-yellow);
  opacity: 0;
  filter: drop-shadow(0 10px 28px rgba(255, 212, 0, 0.32))
          drop-shadow(0 0 60px rgba(255, 212, 0, 0.18));
  animation: wordmarkRise 1100ms var(--ease-rise) 550ms forwards;
}

.hero__wordmark svg {
  display: block;
  width: clamp(280px, 64vw, 680px);
  height: auto;
}

.hero__headline {
  font-family: 'Fredoka', system-ui, sans-serif;
  font-weight: 600;
  font-size: clamp(1.375rem, 2.4vw, 2rem);
  line-height: 1.22;
  letter-spacing: -0.005em;
  color: var(--text);
  max-width: 620px;
  margin: 0 0 1.75rem;
  opacity: 0;
  animation: rise 900ms var(--ease-rise) 900ms forwards;
}

.hero__pillars {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.6rem 0;
  padding: 0;
  margin: 0 0 2.5rem;
  max-width: 760px;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-subtle);
  opacity: 0;
  animation: rise 900ms var(--ease-rise) 1100ms forwards;
}

.hero__pillars li {
  padding: 0 0.875rem;
  border-right: 1px solid rgba(245, 248, 255, 0.22);
  line-height: 1;
}

.hero__pillars li:last-child {
  border-right: 0;
}

.hero__cta {
  position: relative;
  appearance: none;
  border: 0;
  cursor: pointer;
  background: var(--kagan-yellow);
  color: #0b0f1a;
  font-family: 'Fredoka', system-ui, sans-serif;
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: -0.005em;
  padding: 0.9375rem 1.5rem 0.9375rem 1.875rem;
  min-height: 52px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  overflow: hidden;
  isolation: isolate;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.35) inset,
    0 0 0 1px rgba(0, 0, 0, 0.05),
    0 8px 22px -6px rgba(255, 212, 0, 0.45),
    0 4px 10px -2px rgba(0, 0, 0, 0.22);
  transition:
    transform 250ms var(--ease),
    box-shadow 250ms var(--ease),
    background 200ms var(--ease);
  opacity: 0;
  animation: rise 900ms var(--ease-rise) 1300ms forwards;
}

/* Periodic shimmer sweep — runs at rest, fades out on hover so the
   cursor-following highlight takes over. */
.hero__cta::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, 0.55) 50%, transparent 65%);
  transform: translateX(-110%);
  pointer-events: none;
  z-index: 0;
  opacity: 1;
  animation: shine 4.5s ease-in-out 2.2s infinite;
  transition: opacity 220ms var(--ease);
}

/* Cursor-following highlight — radial spotlight centered on --mx/--my
   set by JS. Hidden by default; fades in on hover. */
.hero__cta::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(
    140px circle at var(--mx, 50%) var(--my, 50%),
    rgba(255, 255, 255, 0.55) 0%,
    rgba(255, 255, 255, 0.1) 40%,
    transparent 70%
  );
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  transition: opacity 220ms var(--ease);
}

.hero__cta__label,
.hero__cta__arrow {
  position: relative;
  z-index: 1;
}

.hero__cta__arrow {
  flex-shrink: 0;
  transition: transform 280ms var(--ease);
}

.hero__cta:hover {
  transform: translateY(-1px);
  background: #ffde33;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.5) inset,
    0 0 0 1px rgba(0, 0, 0, 0.05),
    0 18px 40px -8px rgba(255, 212, 0, 0.4),
    0 14px 28px -10px rgba(236, 0, 140, 0.3),
    0 4px 12px -2px rgba(0, 0, 0, 0.3);
}

.hero__cta:hover .hero__cta__arrow {
  transform: translateX(4px);
}

.hero__cta:hover::after {
  opacity: 0;
}

.hero__cta:hover::before {
  opacity: 1;
}

.hero__cta:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 4px;
}

.hero__cta:active {
  transform: translateY(0);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.25) inset,
    0 0 0 1px rgba(0, 0, 0, 0.08),
    0 6px 16px -6px rgba(255, 212, 0, 0.4),
    0 2px 6px -1px rgba(0, 0, 0, 0.2);
}

.hero__footer {
  position: relative;
  z-index: 1;
  margin-top: auto;
  padding-top: 4rem;
  color: var(--text-subtle);
  font-size: 0.8125rem;
  letter-spacing: 0.02em;
}

.hero__footer p { margin: 0; }

/* ============================================================
   Modal
   ============================================================ */

.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 250ms var(--ease);
}

.modal[aria-hidden="false"] {
  opacity: 1;
  pointer-events: auto;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 28, 0.72);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.modal__panel {
  position: relative;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03)),
    rgba(10, 18, 45, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  padding: 2.75rem 2rem 2rem;
  max-width: 440px;
  width: 100%;
  color: var(--text);
  box-shadow:
    0 40px 80px -20px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(255, 255, 255, 0.04);
  transform: translateY(12px) scale(0.97);
  transition: transform 300ms var(--ease-rise);
}

.modal[aria-hidden="false"] .modal__panel {
  transform: translateY(0) scale(1);
}

.modal__close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 40px;
  height: 40px;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 150ms var(--ease), color 150ms var(--ease);
}

.modal__close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.modal__close:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.modal__title {
  font-family: 'Fredoka', system-ui, sans-serif;
  font-weight: 600;
  font-size: 1.875rem;
  line-height: 1.15;
  letter-spacing: -0.005em;
  margin: 0 0 0.5rem;
  color: var(--kagan-yellow);
}

.modal__title:focus-visible {
  outline: none;
}

.modal__subtitle {
  color: var(--text-muted);
  font-size: 0.9375rem;
  line-height: 1.5;
  margin: 0 0 1.5rem;
}

/* Signup form */

.signup-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.signup-form input[type="email"] {
  appearance: none;
  width: 100%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
  padding: 0.875rem 1rem;
  min-height: 48px;
  border-radius: var(--radius);
  transition: border-color 150ms var(--ease), background 150ms var(--ease);
}

.signup-form input[type="email"]::placeholder {
  color: rgba(245, 248, 255, 0.35);
}

.signup-form input[type="email"]:focus {
  outline: none;
  border-color: var(--kagan-yellow);
  background: rgba(255, 255, 255, 0.1);
}

.signup-form__submit {
  appearance: none;
  border: 0;
  cursor: pointer;
  background: var(--kagan-yellow);
  color: #0b0f1a;
  font-family: inherit;
  font-weight: 600;
  font-size: 1rem;
  padding: 0.875rem 1rem;
  min-height: 48px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: background 150ms var(--ease), transform 150ms var(--ease);
}

.signup-form__submit:hover { background: #ffde33; }

.signup-form__submit:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.signup-form__submit:active { transform: scale(0.99); }

.signup-form__submit:disabled {
  cursor: not-allowed;
  opacity: 0.75;
}

.signup-form__error {
  font-size: 0.875rem;
  color: #ffb4b4;
  margin: 0.25rem 0 0;
  min-height: 1.25rem;
  line-height: 1.25rem;
}

.submit-spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(11, 15, 26, 0.25);
  border-top-color: #0b0f1a;
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

.signup-form__submit.is-loading .submit-label { opacity: 0.7; }
.signup-form__submit.is-loading .submit-spinner { display: inline-block; }

/* Success view */

.modal__success {
  text-align: center;
  padding: 0.5rem 0 0.25rem;
}

.modal__success-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(255, 212, 0, 0.15);
  color: var(--kagan-yellow);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem;
  animation: pop 500ms var(--ease-rise);
}

/* ============================================================
   Animations
   ============================================================ */

@keyframes rise {
  0%   { opacity: 0; transform: translateY(14px); }
  100% { opacity: 1; transform: translateY(0); }
}

@keyframes wordmarkRise {
  0%   { opacity: 0; transform: translateY(22px) scale(0.96); }
  60%  { opacity: 1; }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes driftA {
  0%   { transform: translate(0, 0) scale(1); }
  100% { transform: translate(14vmax, 10vmax) scale(1.18); }
}

@keyframes driftB {
  0%   { transform: translate(0, 0) scale(1); }
  100% { transform: translate(-12vmax, 14vmax) scale(1.22); }
}

@keyframes driftC {
  0%   { transform: translate(0, 0) scale(1); }
  100% { transform: translate(16vmax, -8vmax) scale(1.15); }
}

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

@keyframes pop {
  0%   { transform: scale(0.6); opacity: 0; }
  60%  { transform: scale(1.08); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes shine {
  0%   { transform: translateX(-110%); }
  35%  { transform: translateX(210%); }
  100% { transform: translateX(210%); }
}

@media (prefers-reduced-motion: reduce) {
  .hero__eyebrow,
  .hero__subtitle,
  .hero__wordmark,
  .hero__headline,
  .hero__pillars,
  .hero__cta,
  .hero__orb,
  .modal__panel,
  .modal__success-icon {
    animation: none !important;
    opacity: var(--reduced-opacity, 1) !important;
    transform: none !important;
  }
  .hero__orb { opacity: 0.35 !important; }
}

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 480px) {
  .hero { padding: 3rem 1.25rem 1.5rem; }
  .hero__eyebrow { margin-bottom: 1rem; }
  .hero__subtitle { margin-bottom: 1.75rem; }
  .hero__wordmark { margin-bottom: 1.5rem; }
  .hero__headline { margin-bottom: 1.5rem; }
  .hero__pillars {
    margin-bottom: 2.25rem;
    font-size: 0.6875rem;
    letter-spacing: 0.18em;
  }
  .hero__pillars li { padding: 0 0.625rem; }
  .hero__footer { padding-top: 3rem; font-size: 0.75rem; }
  .modal__panel { padding: 2.25rem 1.5rem 1.5rem; }
  .modal__title { font-size: 1.625rem; }
}
