/* Foundational: any element with the `hidden` attribute is hidden,
   regardless of which class it carries. The user-agent default
   `[hidden]{display:none}` loses to class selectors that set
   `display: inline-flex` etc., so JS toggling `hidden` would fail.
   This makes `hidden` reliable across the entire app. */
[hidden] { display: none !important; }

/* Balance status pill (signed-in, home page). Sits just under the primary
   action so the user sees their wallet without leaving the action's
   visual neighborhood. Stays out of the way pre-load via [hidden]. */
.balance-status {
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  gap: 6px;
  margin: 14px auto 0;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.55);
  font-family: var(--font-body);
  font-size: 0.78rem;
  letter-spacing: 0.01em;
  font-feature-settings: "tnum" 1;
  opacity: 0;
  animation: balanceStatusIn 480ms 1.35s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.balance-status[hidden] {
  display: none;
}

/* The home `Download` button uses `.primary-btn` which set display:
   inline-flex; that wins over the user-agent stylesheet's
   `[hidden]{display:none}`. Re-assert via attribute specificity so JS
   toggling `hidden` actually hides the element. Same pattern used in
   admin.css and auth.css for class-styled elements. */

.balance-status__num {
  color: #ffffff;
  font-weight: 500;
}

.balance-status[data-tone="low"] {
  border-color: rgba(248, 113, 113, 0.32);
}

.balance-status[data-tone="low"] .balance-status__num {
  color: #fca5a5;
}

.balance-status[data-tone="lifetime"] {
  border-color: rgba(215, 188, 124, 0.42);
  background: rgba(215, 188, 124, 0.06);
}

.balance-status[data-tone="lifetime"] .balance-status__num {
  color: var(--accent-gold, #d7bc7c);
}

.balance-status__unit {
  color: rgba(255, 255, 255, 0.45);
}

.balance-status__dot {
  color: rgba(255, 255, 255, 0.28);
  margin: 0 2px;
}

@keyframes balanceStatusIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .balance-status { animation: none; }
}

/* Out-of-credits panel — replaces the Download CTA on a 402. Calm,
   not alarming. White CTA stays primary; the panel echoes the
   capture-stage frame's hairline + faint white tint. */
.out-of-credits {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: min(100%, 22rem);
  margin: 4px auto 0;
  padding: 22px 24px 24px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    radial-gradient(120% 60% at 50% -20%, rgba(215, 188, 124, 0.08), transparent 55%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.02) 0%, rgba(255, 255, 255, 0) 100%),
    rgba(12, 12, 16, 0.7);
  -webkit-backdrop-filter: blur(10px);
          backdrop-filter: blur(10px);
  text-align: center;
  animation: outOfCreditsIn 360ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.out-of-credits[hidden] {
  display: none;
}

/* When the inline pricing table is mounted (signed-in user hit 402 on
   /), the OOC panel mirrors the /account `Add credits` modal panel
   exactly: same width cap, same padding, same border radius, same
   gradient. The panel sits inside `<section class="hero">` which is
   itself capped at 768px, so we break out via 50vw negative margins
   that anchor to the viewport regardless of how narrow the parent is.
   The `:has()` selector triggers only when the pricing-table block is
   visible — bare 402 with no provider falls back to the legacy
   `width: min(100%, 22rem)` styling above. */
.out-of-credits:has(.out-of-credits__pricing:not([hidden])) {
  display: flex;
  align-items: stretch;
  /* Viewport-anchored break-out: width grows with the viewport up to
     64rem, ignoring the `.hero` column's narrower max-width. Position
     stays in normal flow (no relative+left:50% trick) so the OOC card
     pushes the page below it down naturally without overlapping. */
  width: min(100vw - 48px, 62rem);
  max-width: none;
  margin-left: calc(50% - min(50vw - 24px, 31rem));
  margin-right: calc(50% - min(50vw - 24px, 31rem));
  padding: clamp(26px, 4vw, 38px);
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.115);
  background:
    radial-gradient(90% 55% at 18% -12%, rgba(215, 188, 124, 0.13), transparent 62%),
    radial-gradient(78% 70% at 100% 0%, rgba(255, 255, 255, 0.045), transparent 56%),
    linear-gradient(180deg, rgba(16, 15, 13, 0.98) 0%, rgba(7, 7, 8, 0.99) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.10),
    0 34px 90px rgba(0, 0, 0, 0.58),
    0 0 0 1px rgba(5, 5, 5, 0.6);
  text-align: left;
  overflow: visible;
}
.out-of-credits:has(.out-of-credits__pricing:not([hidden])) .out-of-credits__title {
  text-align: center;
  font-size: clamp(1.9rem, 4vw, 2.65rem);
  line-height: 0.98;
}
.out-of-credits:has(.out-of-credits__pricing:not([hidden])) .out-of-credits__copy {
  max-width: 40rem;
  margin-inline: auto;
  text-align: center;
  color: rgba(255, 255, 255, 0.58);
  font-size: 0.94rem;
  line-height: 1.65;
}
@media (max-width: 640px) {
  .out-of-credits:has(.out-of-credits__pricing:not([hidden])) {
    width: min(100vw - 20px, 100%);
    margin-left: calc(50% - 50vw + 10px);
    margin-right: calc(50% - 50vw + 10px);
    padding: 26px 18px 22px;
    border-radius: 24px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .out-of-credits:has(.out-of-credits__pricing:not([hidden])) {
    transition: none;
  }
}

.out-of-credits__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.5rem;
  letter-spacing: -0.018em;
  line-height: 1.1;
  color: #ffffff;
}

.out-of-credits__copy {
  margin: 0;
  color: rgba(255, 255, 255, 0.6);
  font-family: var(--font-body);
  font-size: 0.86rem;
  line-height: 1.55;
  letter-spacing: 0.005em;
}

.out-of-credits__num {
  color: #ffffff;
  font-feature-settings: "tnum" 1;
}

.out-of-credits__cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  padding: 12px 22px;
  border-radius: 11px;
  background: linear-gradient(180deg, #ffffff 0%, #ededf0 100%);
  color: #111111;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    0 8px 20px rgba(0, 0, 0, 0.28);
  transition: transform 140ms ease;
}

.out-of-credits__cta:hover {
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 1),
    0 12px 28px rgba(0, 0, 0, 0.38);
}

.out-of-credits__cta svg {
  flex: 0 0 auto;
  opacity: 0.75;
}

@keyframes outOfCreditsIn {
  from { opacity: 0; transform: translateY(8px) scale(0.99); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .out-of-credits { animation: none; }
}


@font-face {
  font-family: 'Marion Local';
  src: local('Marion'), local('Marion Regular'), local('Marion-Regular');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #050505;
  --surface: rgba(17, 17, 17, 0.72);
  --surface-strong: #0a0a0a;
  --surface-soft: #121212;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.18);
  --text: #ffffff;
  --text-dim: #888888;
  --text-muted: #a1a1aa;
  --text-faint: #52525b;
  --danger: #f87171;
  --success: #4ade80;
  --shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
  --accent-gold: #d7bc7c;
  --accent-gold-soft: rgba(215, 188, 124, 0.78);
  --accent-gold-faint: rgba(215, 188, 124, 0.16);
  --font-display: 'Marion Local', 'Marion', 'Iowan Old Style', 'Baskerville', 'Palatino Linotype', Georgia, serif;
  --font-body: 'Inter', ui-sans-serif, system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

html {
  /* iOS: kill the grey flash on taps; we drive feedback via :active states. */
  -webkit-tap-highlight-color: transparent;
  /* Tint native UI (form controls, scrollbars on iOS, focus rings) with the
     brand gold so any system-rendered chrome reads on-brand. */
  accent-color: #c9a55c;
  /* iOS Safari: block "Smart App Banner"-style auto-zoom on form focus by
     ensuring base font-size is >= 16px on inputs (handled per-input in the
     hero), and prevent the address bar from over-tinting our dark canvas. */
  background: var(--bg);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  /* Stop iOS rubber-band scroll bleeding through the dark canvas as white. */
  overscroll-behavior-y: none;
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
  /* Prevent iOS Safari's default rounded grey button styling. */
  -webkit-appearance: none;
  appearance: none;
}

.app-shell {
  position: relative;
  width: 100%;
  max-width: 100vw;
  min-height: 100vh;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  isolation: isolate;
}

.app-shell:has(.out-of-credits__pricing:not([hidden])) {
  align-items: flex-start;
  overflow-x: hidden;
  overflow-y: auto;
}

.app-shell::before,
.app-shell::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.app-shell::before {
  z-index: 0;
  opacity: 0.05;
  mix-blend-mode: screen;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220' viewBox='0 0 220 220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
}

.app-shell::after {
  z-index: 0;
  background:
    radial-gradient(circle at 50% 12%, rgba(255, 255, 255, 0.045), transparent 28%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 18%, transparent 82%, rgba(255, 255, 255, 0.03));
  opacity: 0.7;
}

.starfield,
.ambient-lights,
.planet-horizon {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.starfield {
  z-index: 0;
}

.star {
  position: absolute;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.98);
  animation: twinkle ease-in-out infinite;
  will-change: opacity, transform;
}

.star--bright {
  background: #ffffff;
  box-shadow:
    0 0 4px rgba(255, 255, 255, 0.75),
    0 0 10px rgba(255, 236, 204, 0.32);
  animation-name: twinkleBright;
}

.star--hero {
  background: #ffffff;
  box-shadow:
    0 0 6px rgba(255, 255, 255, 0.85),
    0 0 16px rgba(255, 236, 204, 0.42),
    0 0 32px rgba(215, 188, 124, 0.22);
  animation-name: twinkleHero;
}

/* Shooting star: a short, sharp head with a soft trailing tail. The element
   itself is a tiny bright pill; the ::before pseudo paints the tail.
   We translate along a shallow diagonal while fading the tail — slow start,
   quick streak, gentle decay. JS injects these on a short random cadence
   and removes them after the animation ends, so they layer organically
   over the static twinkle field. */
.shooting-star {
  position: absolute;
  top: var(--ss-top, 0%);
  left: var(--ss-left, 0%);
  width: 2px;
  height: 2px;
  border-radius: 999px;
  background: #ffffff;
  opacity: 0;
  transform: rotate(var(--ss-angle, 18deg));
  transform-origin: left center;
  box-shadow:
    0 0 6px rgba(255, 255, 255, 0.95),
    0 0 14px rgba(255, 232, 186, 0.75),
    0 0 28px rgba(215, 188, 124, 0.35);
  animation: shootingStar var(--ss-duration, 1400ms) cubic-bezier(0.12, 0.7, 0.2, 1) forwards;
  pointer-events: none;
  will-change: transform, opacity;
}

.shooting-star::before {
  content: "";
  position: absolute;
  top: 50%;
  right: 100%;
  width: var(--ss-tail, 140px);
  height: 1px;
  transform: translateY(-50%);
  background: linear-gradient(
    to left,
    rgba(255, 255, 255, 0.95) 0%,
    rgba(255, 236, 204, 0.55) 30%,
    rgba(215, 188, 124, 0.18) 70%,
    transparent 100%
  );
  filter: blur(0.4px);
  border-radius: 999px;
}

.ambient-lights {
  z-index: 0;
  overflow: hidden;
}

.ambient-lights__glow {
  position: absolute;
  bottom: -10%;
  width: 60vw;
  height: 50vh;
  border-radius: 999px;
  filter: blur(130px);
  opacity: 0.14;
  mix-blend-mode: screen;
}

/* Single warm amber wash on the left — drops the cool-green glow that
   read as "AI dark-mode-with-glow." Keeps just enough atmosphere to
   anchor the hero without competing with the planet horizon. */
.ambient-lights__glow--left {
  left: 10%;
  background: #3b1e54;
}

.ambient-lights__glow--right {
  display: none;
}

.planet-horizon {
  top: auto;
  height: 25vh;
  z-index: 0;
  overflow: hidden;
}

.planet-horizon__rays,
.planet-horizon__flare {
  position: absolute;
  pointer-events: none;
}

.planet-horizon__rays {
  inset: auto 0 0;
  height: 48vh;
  opacity: 0.72;
  background:
    radial-gradient(ellipse at 50% 100%, rgba(236, 208, 141, 0.24), transparent 24%),
    radial-gradient(ellipse at 50% 100%, rgba(255, 232, 186, 0.16), transparent 32%),
    radial-gradient(ellipse at 50% 100%, rgba(255, 242, 210, 0.08), transparent 44%),
    linear-gradient(180deg, transparent 0%, rgba(230, 196, 119, 0.04) 48%, transparent 100%);
  filter: blur(18px) saturate(125%);
  transform-origin: center bottom;
  animation: sunRays 12s ease-in-out infinite alternate;
}

.planet-horizon__flare {
  bottom: -6%;
  width: 42vw;
  height: 20vh;
  border-radius: 999px;
  filter: blur(36px);
  mix-blend-mode: screen;
  opacity: 0.38;
  animation: sunFlare 10s ease-in-out infinite alternate;
}

.planet-horizon__flare--left {
  left: 18%;
  background: radial-gradient(circle, rgba(255, 220, 159, 0.38), rgba(255, 193, 87, 0.16) 44%, transparent 72%);
}

.planet-horizon__flare--right {
  right: 16%;
  width: 36vw;
  background: radial-gradient(circle, rgba(255, 236, 197, 0.32), rgba(255, 190, 78, 0.12) 42%, transparent 72%);
  animation-delay: -3s;
}

.planet-horizon__disc {
  position: absolute;
  top: 30%;
  left: 50%;
  width: 200vw;
  height: 150vw;
  transform: translate(-50%, 60%);
  border-radius: 50%;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255, 255, 255, 0.025), transparent 24%),
    radial-gradient(ellipse at 50% 72%, rgba(12, 24, 39, 0.9), rgba(2, 3, 6, 0.98) 58%, #010101 82%);
  border-top: 1.5px solid rgba(224, 196, 132, 0.42);
  box-shadow:
    inset 0 2px 20px rgba(255, 255, 255, 0.05),
    0 -5px 30px rgba(241, 220, 168, 0.12),
    0 -18px 72px rgba(203, 162, 78, 0.11),
    0 -26px 96px rgba(180, 200, 255, 0.05);
  animation: planetRise 2.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.planet-horizon__disc::before,
.planet-horizon__disc::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.planet-horizon__disc::before {
  background:
    radial-gradient(ellipse at 18% 26%, rgba(255, 255, 255, 0.018), transparent 16%),
    radial-gradient(ellipse at 72% 22%, rgba(114, 142, 190, 0.05), transparent 18%),
    radial-gradient(ellipse at 52% 34%, rgba(255, 255, 255, 0.014), transparent 18%),
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.02) 0%,
      transparent 10%,
      transparent 21%,
      rgba(24, 39, 62, 0.14) 37%,
      rgba(6, 10, 17, 0.22) 54%,
      rgba(14, 24, 38, 0.12) 68%,
      transparent 82%
    );
  opacity: 0.95;
}

.planet-horizon__disc::after {
  background:
    radial-gradient(ellipse at 50% -12%, rgba(244, 223, 170, 0.14), transparent 34%),
    radial-gradient(ellipse at 50% 0%, rgba(182, 137, 54, 0.12), transparent 26%),
    radial-gradient(ellipse at 50% 22%, rgba(255, 255, 255, 0.016), transparent 21%),
    radial-gradient(ellipse at 50% 30%, transparent 46%, rgba(0, 0, 0, 0.18) 74%, rgba(0, 0, 0, 0.46) 100%);
  opacity: 0.72;
}

.hero {
  position: relative;
  z-index: 1;
  width: min(100%, 48rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-bottom: 96px;
}

.hero__badge,
.hero__title,
.hero__subtitle,
.hero__form,
.hero__actions {
  opacity: 0;
  animation: blurFadeIn 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.hero__badge {
  animation-delay: 0.2s;
  margin-bottom: 36px;
}

.hero__title {
  --hero-title-letter-spacing: -0.03em;
  animation-delay: 0.35s;
  margin: 0 0 22px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(3.5rem, 13vw, 8.4rem);
  line-height: 0.86;
  letter-spacing: var(--hero-title-letter-spacing);
  text-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
}

.hero__brand-lockup {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: clamp(1rem, 2.15vw, 1.55rem);
  max-width: 100%;
  text-align: left;
  white-space: nowrap;
}

.hero__brand-symbol {
  position: relative;
  flex: 0 0 auto;
  width: clamp(5rem, 13vw, 9.5rem);
  aspect-ratio: 500 / 428;
  margin-block-start: 0.01em;
  transform: translateY(-0.035em);
  filter:
    drop-shadow(0 20px 42px rgba(0, 0, 0, 0.54))
    drop-shadow(0 0 18px rgba(215, 188, 124, 0.18));
}

.hero__brand-symbol img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.hero__wordmark {
  display: inline-block;
  min-width: 0;
  line-height: 0.86;
}

.hero__subtitle {
  animation-delay: 0.75s;
  margin: 0 0 32px;
  max-width: 32rem;
  color: rgba(193, 178, 145, 0.86);
  font-size: clamp(0.95rem, 2vw, 1rem);
  line-height: 1.7;
}

.hero__form {
  animation-delay: 0.95s;
  width: min(100%, 40rem);
  margin-bottom: 28px;
}

.hero__actions {
  animation-delay: 1.15s;
  margin-top: 2px;
  width: 100%;
  display: flex;
  justify-content: center;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(16px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  color: rgba(255, 255, 255, 0.72);
}

.badge .icon {
  width: 1.1em;
  height: 1.1em;
  color: var(--accent-gold-soft);
  filter: drop-shadow(0 0 8px rgba(183, 140, 58, 0.18));
}

.icon {
  width: 1em;
  height: 1em;
  flex: none;
}

.icon path,
.icon circle {
  stroke: currentColor;
}

.hero__input {
  width: 100%;
  padding: 20px 26px;
  border-radius: 22px;
  border: 1px solid rgba(230, 185, 92, 0.28);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.008) 38%, rgba(255, 255, 255, 0.013) 100%),
    radial-gradient(circle at 16% 8%, rgba(255, 236, 204, 0.15), transparent 30%),
    radial-gradient(circle at 88% 120%, rgba(255, 255, 255, 0.09), transparent 28%),
    rgba(8, 13, 22, 0.2);
  color: var(--text);
  outline: none;
  transition:
    border-color 180ms ease,
    background 180ms ease,
    transform 180ms ease;
  backdrop-filter: blur(30px) saturate(150%);
  -webkit-backdrop-filter: blur(30px) saturate(150%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.32),
    inset 0 -1px 0 rgba(255, 255, 255, 0.03),
    0 0 0 1px rgba(255, 236, 204, 0.08),
    0 0 0 1px rgba(215, 188, 124, 0.06),
    0 0 18px rgba(215, 188, 124, 0.1),
    0 24px 58px rgba(0, 0, 0, 0.38),
    0 10px 28px rgba(165, 130, 57, 0.06);
}

.hero__input::placeholder {
  color: rgba(192, 205, 224, 0.46);
}

.hero__input:focus {
  border-color: rgba(230, 185, 92, 0.58);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.065), rgba(255, 255, 255, 0.016) 34%, rgba(255, 255, 255, 0.02) 100%),
    radial-gradient(circle at 18% 8%, rgba(255, 236, 204, 0.18), transparent 34%),
    radial-gradient(circle at 88% 120%, rgba(255, 255, 255, 0.11), transparent 32%),
    rgba(8, 14, 24, 0.24);
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.4),
    inset 0 -1px 0 rgba(255, 255, 255, 0.04),
    0 0 0 1px rgba(255, 236, 204, 0.12),
    0 0 22px rgba(215, 188, 124, 0.12),
    0 0 8px rgba(255, 255, 255, 0.08),
    0 28px 64px rgba(0, 0, 0, 0.42),
    0 12px 32px rgba(165, 130, 57, 0.08);
}

.primary-btn[hidden] {
  display: none;
}

.primary-btn {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
  padding: 13px 22px 12px;
  width: min(100%, 14.25rem);
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #d7dde8;
  background: #ffffff;
  color: #111111;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0;
  text-decoration: none;
  line-height: 1.1;
  transition:
    transform 180ms ease,
    background 180ms ease,
    border-color 180ms ease,
    opacity 180ms ease,
    color 180ms ease;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.85),
    inset 0 -1px 0 rgba(0, 0, 0, 0.05),
    0 16px 34px rgba(0, 0, 0, 0.24),
    0 6px 18px rgba(0, 0, 0, 0.08);
}

.primary-btn::before,
.primary-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  display: none;
}

.primary-btn::before {
  background: none;
  opacity: 1;
}

.primary-btn::after {
  inset: 1px;
  border-radius: 9px;
  background: none;
  opacity: 1;
}

.primary-btn:hover:not(:disabled) {
  border-color: #b6bfce;
  background: #fafafa;
  transform: translateY(-2px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    inset 0 -1px 0 rgba(0, 0, 0, 0.08),
    0 22px 42px rgba(0, 0, 0, 0.4),
    0 8px 22px rgba(0, 0, 0, 0.15);
}

.primary-btn:disabled {
  border-color: #d8dee8;
  color: #111111;
  background: #ffffff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    inset 0 -1px 0 rgba(0, 0, 0, 0.04),
    0 14px 28px rgba(0, 0, 0, 0.2),
    0 6px 14px rgba(0, 0, 0, 0.08);
  cursor: not-allowed;
  opacity: 1;
}

.primary-btn__icon {
  width: 1rem;
  height: 1rem;
  flex: none;
  opacity: 1;
  transition: transform 180ms ease;
}

.primary-btn:hover:not(:disabled) .primary-btn__icon {
  transform: translateY(-2px);
}

.status-line {
  min-height: 24px;
  margin: 18px 0 0;
  color: var(--text-dim);
  font-size: 0.875rem;
}

.status-line[data-state='error'] {
  color: var(--danger);
}

.status-line[data-state='success'] {
  color: var(--success);
}

.modal[hidden] {
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
}

.modal__panel {
  position: relative;
  width: min(100%, 28rem);
  border: 1px solid #27272a;
  border-radius: 24px;
  background: var(--surface-strong);
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.55);
  overflow: hidden;
  animation: modalIn 220ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.modal__close {
  position: absolute;
  top: 16px;
  right: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: transparent;
  color: rgba(255, 255, 255, 0.45);
  transition: color 160ms ease, background 160ms ease;
}

.modal__close:hover:not(:disabled) {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.05);
}

.modal__body {
  padding: 32px;
}

.modal__title {
  margin: 0 0 8px;
  font-size: 1.25rem;
  font-weight: 500;
}

.modal__copy {
  margin: 0 0 24px;
  color: var(--text-muted);
  font-size: 0.925rem;
  line-height: 1.6;
}

.modal__success {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 16px;
  padding: 28px 0 18px;
}

.modal__success[hidden],
.modal__form[hidden] {
  display: none;
}

.modal__success-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 500;
}

.modal__success-copy {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.925rem;
  line-height: 1.6;
}

.modal__input {
  width: 100%;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid #27272a;
  background: var(--surface-soft);
  color: var(--text);
  outline: none;
  transition: border-color 160ms ease;
}

.modal__input::placeholder {
  color: var(--text-faint);
}

.modal__input:focus {
  border-color: rgba(255, 255, 255, 0.3);
}

.modal__input[aria-invalid='true'] {
  border-color: rgba(239, 68, 68, 0.6);
}

.modal__error {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 20px;
  margin: 10px 0 0;
  color: var(--danger);
  font-size: 0.75rem;
}

.modal__error[hidden] {
  display: none;
}

.modal__submit {
  width: 100%;
  margin-top: 16px;
  min-width: 0;
  padding: 14px 20px;
  font-family: var(--font-body);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  line-height: 1.1;
  text-shadow: none;
  color: #111111;
  border-color: rgba(255, 255, 255, 0.5);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(227, 227, 227, 0.94)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.18));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.88),
    inset 0 -1px 0 rgba(0, 0, 0, 0.06),
    0 16px 34px rgba(0, 0, 0, 0.24);
}

.modal__submit::before,
.modal__submit::after {
  display: none;
}

.modal__fineprint {
  margin: 24px 0 0;
  text-align: center;
  color: var(--text-faint);
  font-size: 0.75rem;
}

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

@keyframes blurFadeIn {
  0% {
    opacity: 0;
    filter: blur(16px);
    transform: translateY(20px) scale(0.95);
  }
  100% {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0) scale(1);
  }
}

@keyframes planetRise {
  0% {
    transform: translate(-50%, 60%);
    opacity: 0;
  }
  100% {
    transform: translate(-50%, 0);
    opacity: 1;
  }
}

@keyframes twinkle {
  0%,
  100% {
    opacity: 0.12;
    transform: scale(0.72);
  }
  42% {
    opacity: 0.65;
    transform: scale(1.05);
  }
  50% {
    opacity: 1;
    transform: scale(1.35);
  }
  58% {
    opacity: 0.55;
    transform: scale(1.05);
  }
}

@keyframes twinkleBright {
  0%,
  100% {
    opacity: 0.25;
    transform: scale(0.8);
    filter: brightness(0.9);
  }
  48% {
    opacity: 0.95;
    transform: scale(1.25);
    filter: brightness(1.15);
  }
  52% {
    opacity: 1;
    transform: scale(1.4);
    filter: brightness(1.3);
  }
}

@keyframes twinkleHero {
  0%,
  100% {
    opacity: 0.38;
    transform: scale(0.85);
    filter: brightness(0.95);
  }
  46% {
    opacity: 0.95;
    transform: scale(1.3);
    filter: brightness(1.25);
  }
  50% {
    opacity: 1;
    transform: scale(1.55);
    filter: brightness(1.45);
  }
  54% {
    opacity: 0.9;
    transform: scale(1.3);
    filter: brightness(1.2);
  }
}

/* Travels along a rotated transform-origin so the pill + tail move together.
   translateX goes from 0 to a computed distance (--ss-distance). Fade-in
   is fast (0→10%), streak holds bright through most of the travel, then
   the tail fades out at the end — matching how a real meteor dims as
   debris cools. */
@keyframes shootingStar {
  0% {
    opacity: 0;
    transform: rotate(var(--ss-angle, 18deg)) translateX(0);
  }
  6% {
    opacity: 1;
  }
  78% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: rotate(var(--ss-angle, 18deg)) translateX(var(--ss-distance, 520px));
  }
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes sunRays {
  0% {
    opacity: 0.42;
    transform: scale(0.98) translateY(3%);
  }
  100% {
    opacity: 0.78;
    transform: scale(1.02) translateY(0);
  }
}

@keyframes sunFlare {
  0% {
    opacity: 0.22;
    transform: translateY(2%) scale(0.96);
  }
  100% {
    opacity: 0.46;
    transform: translateY(-1%) scale(1.04);
  }
}

@media (max-width: 768px) {
  .app-shell {
    padding: 16px;
  }

  .planet-horizon__disc {
    width: 240vw;
  }

  .hero {
    padding-bottom: 72px;
  }

  .hero__badge {
    margin-bottom: 24px;
  }

  .hero__subtitle {
    margin-bottom: 24px;
  }

  .hero__form {
    margin-bottom: 22px;
  }

  .hero__input {
    padding: 14px 18px;
    border-radius: 16px;
  }

  .primary-btn {
    width: min(100%, 13.5rem);
    padding: 13px 18px 12px;
    min-width: 0;
    font-size: 1.1rem;
    gap: 8px;
  }

  .badge {
    padding: 8px 12px;
    gap: 6px;
    font-size: 0.68rem;
  }

  .modal__body {
    padding: 24px 18px;
  }
}

@media (max-width: 390px) {
  .hero__title {
    font-size: clamp(3.1rem, 16vw, 4.6rem);
    margin-bottom: 16px;
  }

  .hero__input {
    padding: 13px 14px;
  }

  .primary-btn {
    width: min(100%, 12.75rem);
    padding: 12px 16px 11px;
    font-size: 1.1rem;
    gap: 8px;
  }

  .badge {
    font-size: 0.64rem;
  }

  .modal__body {
    padding: 20px 14px;
  }
}

/* Keyboard focus rings live at the end of site.css so they win source-order
   against later-declared `:focus { outline: none }` rules in either sheet
   (specifically `.lead-modal__input:focus { outline: none }` in site.css
   would otherwise override an app.css-declared `:focus-visible` of equal
   specificity). See the focus-visible block at the bottom of site.css. */

/* ==========================================================================
   Reduced motion: kill the heavy decorative loops + entrance animations.
   UI transitions (hover, focus) stay since they're already <=180ms.
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  .star,
  .star--bright,
  .star--hero,
  .shooting-star,
  .planet-horizon__rays,
  .planet-horizon__flare,
  .planet-horizon__disc,
  .hero__badge,
  .hero__title,
  .hero__subtitle,
  .hero__form,
  .hero__actions {
    animation: none !important;
  }
  .hero__badge,
  .hero__title,
  .hero__subtitle,
  .hero__form,
  .hero__actions {
    opacity: 1 !important;
    filter: none !important;
    transform: none !important;
  }
}
