:root {
  color-scheme: light;
  --cream: #faf9f6;
  --midnight: #0b0f19;
  --midnight-soft: #111827;
  --ink: #1f2937;
  --muted: #6b7280;
  --dark-muted: #d1d5db;
  --soft: #a7adb8;
  --accent: #ff5e5e;
  --accent-dark: #e34a4f;
  --white: #ffffff;
  --line: rgba(31, 41, 55, 0.08);
  --dark-line: rgba(255, 255, 255, 0.12);
  --shadow: 0 26px 70px rgba(31, 41, 55, 0.14), 0 0 34px rgba(255, 94, 94, 0.11);
  --dark-shadow: 0 34px 100px rgba(0, 0, 0, 0.42), 0 0 50px rgba(255, 94, 94, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: Inter, "Plus Jakarta Sans", Geist, "Segoe UI", Arial, Helvetica, sans-serif;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

img,
svg {
  display: block;
}

img {
  max-width: 100%;
}

[hidden] {
  display: none !important;
}

.prelaunch-app {
  position: relative;
  min-height: 100svh;
  overflow-x: hidden;
  background: var(--cream);
}

.app-screen {
  transition:
    opacity 420ms ease,
    transform 420ms ease,
    visibility 420ms ease;
}

.splash-page {
  display: grid;
  height: 100svh;
  min-height: 620px;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  overflow: hidden;
  background: var(--cream);
}

.splash-copy {
  position: relative;
  display: flex;
  min-height: 100%;
  align-items: center;
  justify-content: center;
  padding: 110px clamp(34px, 6vw, 82px) 70px;
}

.brand {
  position: absolute;
  top: 32px;
  left: clamp(34px, 6vw, 82px);
  width: 62px;
  text-decoration: none;
  filter: drop-shadow(0 12px 28px rgba(255, 94, 94, 0.16));
}

.splash-inner {
  width: min(100%, 540px);
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  line-height: 1.2;
  text-transform: uppercase;
}

h1,
h2,
h3,
h4,
p {
  margin-top: 0;
}

h1 {
  max-width: 620px;
  margin-bottom: 18px;
  color: var(--ink);
  font-family: "Plus Jakarta Sans", Inter, "Segoe UI", Arial, Helvetica, sans-serif;
  font-size: clamp(3.4rem, 6.6vw, 5.8rem);
  font-weight: 900;
  letter-spacing: 0;
  line-height: 0.96;
  text-wrap: balance;
}

.subheadline {
  max-width: 500px;
  margin-bottom: 34px;
  color: var(--muted);
  font-size: clamp(1.05rem, 1.7vw, 1.2rem);
  line-height: 1.58;
}

.email-form {
  width: min(100%, 540px);
}

.email-row {
  display: flex;
  width: 100%;
  min-height: 66px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: 999px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.email-row input {
  min-width: 0;
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--ink);
  outline: 0;
  padding: 0 26px;
  font-size: 1rem;
}

.email-row input::placeholder {
  color: #9ca3af;
}

.button,
.copy-button,
.social-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  font-weight: 850;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
}

.button-primary {
  gap: 9px;
  min-width: 166px;
  padding: 0 28px;
  border-radius: 0 999px 999px 0;
  background: var(--accent);
  color: var(--white);
  transition:
    background-color 160ms ease,
    transform 160ms ease,
    box-shadow 160ms ease;
}

.button-primary:hover,
.button-primary:focus-visible {
  background: var(--accent-dark);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.button-primary[disabled] {
  cursor: progress;
  opacity: 0.72;
  transform: none;
}

.key-icon {
  display: inline-grid;
  width: 18px;
  height: 18px;
  place-items: center;
}

.key-icon svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.form-error,
.referral-note {
  margin: 12px 0 0;
  padding-left: 26px;
  color: #9ca3af;
  font-size: 0.9rem;
  font-weight: 760;
  text-align: left;
}

.form-error {
  color: #c73f3f;
}

.hidden-field,
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.splash-visual {
  position: relative;
  min-height: 100%;
  overflow: hidden;
  background: var(--midnight);
}

.splash-visual img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 53% 50%;
}

.splash-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 58% 80%, rgba(255, 94, 94, 0.18), transparent 30%),
    linear-gradient(90deg, rgba(11, 15, 25, 0.18), rgba(11, 15, 25, 0) 34%),
    linear-gradient(180deg, rgba(11, 15, 25, 0.08), rgba(11, 15, 25, 0.34));
  pointer-events: none;
}

.visual-lines {
  position: absolute;
  inset: 0;
  opacity: 0.07;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.7) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.7) 1px, transparent 1px);
  background-size: 56px 56px;
  mix-blend-mode: screen;
  pointer-events: none;
}

.referral-page {
  min-height: 100svh;
  padding: clamp(34px, 5vw, 62px) 22px clamp(42px, 6vw, 76px);
  background:
    radial-gradient(circle at 50% 4%, rgba(255, 94, 94, 0.16), transparent 31%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 28%),
    var(--midnight);
  color: var(--white);
}

.referral-shell {
  display: grid;
  width: min(100%, 1040px);
  min-height: calc(100svh - clamp(76px, 11vw, 138px));
  align-content: center;
  gap: clamp(28px, 4.6vw, 46px);
  margin: 0 auto;
}

.referral-header {
  display: grid;
  justify-items: center;
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
}

.referral-logo {
  width: 74px;
  margin-bottom: 22px;
  filter: drop-shadow(0 18px 36px rgba(255, 94, 94, 0.2));
}

.referral-header h2 {
  max-width: 780px;
  margin: 0 0 16px;
  color: var(--white);
  font-family: "Plus Jakarta Sans", Inter, "Segoe UI", Arial, Helvetica, sans-serif;
  font-size: clamp(2.3rem, 5.6vw, 4.7rem);
  font-weight: 900;
  letter-spacing: 0;
  line-height: 0.98;
  text-wrap: balance;
}

.referral-header p {
  max-width: 690px;
  margin: 0;
  color: var(--dark-muted);
  font-size: clamp(1rem, 1.6vw, 1.13rem);
  line-height: 1.7;
}

.console {
  display: grid;
  width: min(100%, 760px);
  gap: 24px;
  margin: 0 auto;
  border: 1px solid var(--dark-line);
  border-radius: 8px;
  padding: clamp(22px, 4vw, 36px);
  background: rgba(255, 255, 255, 0.055);
  box-shadow: var(--dark-shadow);
  backdrop-filter: blur(18px);
}

.console-progress {
  display: grid;
  gap: 12px;
}

.progress-top {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  color: var(--white);
  font-size: 0.9rem;
  font-weight: 850;
}

.progress-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
}

.progress-track span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #ff8a5e);
  transition: width 280ms ease;
}

#next-tier {
  margin: 0;
  color: var(--dark-muted);
  font-size: 0.9rem;
  font-weight: 720;
}

.link-box {
  display: grid;
  gap: 12px;
}

.link-box label {
  color: var(--dark-muted);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-align: center;
  text-transform: uppercase;
}

.copy-row {
  display: flex;
  min-height: 58px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.36);
}

.copy-row input {
  min-width: 0;
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--white);
  outline: 0;
  padding: 0 18px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: clamp(0.84rem, 2vw, 1.02rem);
  text-align: center;
}

.copy-button {
  min-height: 56px;
  min-width: 98px;
  border-left: 1px solid rgba(255, 255, 255, 0.12);
  background: var(--white);
  color: #05070d;
  padding: 0 22px;
  font-size: 0.8rem;
  text-transform: uppercase;
  transition:
    background-color 160ms ease,
    transform 160ms ease;
}

.copy-button:hover,
.copy-button:focus-visible {
  background: #f3f4f6;
}

.copy-status {
  min-height: 18px;
  margin: 0;
  color: var(--dark-muted);
  font-size: 0.82rem;
  font-weight: 760;
  text-align: center;
}

.share-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: -4px;
}

.social-button {
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--white);
  transition:
    border-color 160ms ease,
    background-color 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}

.social-button:hover,
.social-button:focus-visible {
  border-color: rgba(255, 94, 94, 0.85);
  background: rgba(255, 94, 94, 0.16);
  color: var(--accent);
  transform: translateY(-1px);
}

.social-icon {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.milestones {
  width: min(100%, 920px);
  margin: 0 auto;
}

.milestone-track {
  position: relative;
  display: flex;
  min-height: 132px;
  justify-content: space-between;
  gap: 16px;
  --track-progress: 0%;
}

.milestone-track::before,
.milestone-track::after {
  content: "";
  position: absolute;
  top: 30px;
  left: 34px;
  height: 2px;
  border-radius: 999px;
}

.milestone-track::before {
  right: 34px;
  background: rgba(255, 255, 255, 0.1);
}

.milestone-track::after {
  width: calc((100% - 68px) * var(--track-progress) / 100);
  max-width: calc(100% - 68px);
  background: var(--accent);
  box-shadow: 0 0 20px rgba(255, 94, 94, 0.38);
  transition: width 280ms ease;
}

.tier-card {
  position: relative;
  z-index: 1;
  display: grid;
  width: 25%;
  justify-items: center;
  text-align: center;
}

.reward-icon {
  display: inline-grid;
  width: 62px;
  height: 62px;
  place-items: center;
  margin-bottom: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: #151b27;
  color: #7c8798;
  font-size: 0.86rem;
  font-weight: 950;
  box-shadow: 0 0 0 8px var(--midnight);
}

.tier-card.is-unlocked .reward-icon {
  border-color: rgba(255, 94, 94, 0.74);
  background: var(--accent);
  color: var(--white);
  box-shadow: 0 0 0 8px var(--midnight), 0 0 28px rgba(255, 94, 94, 0.34);
}

.tier-card h4 {
  margin: 0 0 7px;
  color: var(--white);
  font-size: 0.94rem;
  font-weight: 900;
}

.tier-card p {
  max-width: 172px;
  margin: 0;
  color: var(--dark-muted);
  font-size: 0.82rem;
  line-height: 1.38;
}

.tier-card:not(.is-unlocked) {
  opacity: 0.62;
}

.button:focus-visible,
.copy-button:focus-visible,
.social-button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(255, 94, 94, 0.36);
  outline-offset: 3px;
}

body.has-results {
  background: var(--midnight);
}

body.has-results .splash-page,
body:not(.has-results) .referral-page {
  position: absolute;
  inset: 0;
  visibility: hidden;
  pointer-events: none;
}

body.has-results .splash-page {
  opacity: 0;
  transform: translateX(-18px);
}

body:not(.has-results) .referral-page {
  opacity: 0;
  transform: translateY(18px);
}

body.has-results .referral-page,
body:not(.has-results) .splash-page {
  visibility: visible;
  opacity: 1;
  transform: none;
}

@media (max-width: 960px) {
  .splash-page {
    min-height: 100svh;
    grid-template-columns: minmax(0, 1fr);
  }

  .splash-copy {
    z-index: 1;
    min-height: 100svh;
    padding: 104px 28px 52px;
    background:
      linear-gradient(90deg, rgba(250, 249, 246, 0.95), rgba(250, 249, 246, 0.88)),
      var(--cream);
  }

  .brand {
    left: 28px;
  }

  .splash-visual {
    position: absolute;
    inset: 0;
    opacity: 0.18;
  }

  .splash-visual img {
    object-position: 64% 50%;
  }
}

@media (max-width: 720px) {
  .splash-copy {
    padding-inline: 22px;
  }

  .brand {
    left: 22px;
    width: 56px;
  }

  h1 {
    font-size: clamp(3rem, 15vw, 4.45rem);
  }

  .subheadline {
    margin-bottom: 28px;
    font-size: 1rem;
  }

  .email-row {
    display: grid;
    border-radius: 24px;
    padding: 6px;
  }

  .email-row input {
    min-height: 54px;
    padding-inline: 18px;
  }

  .button-primary {
    min-height: 54px;
    width: 100%;
    border-radius: 18px;
  }

  .form-error,
  .referral-note {
    padding-left: 18px;
  }

  .referral-page {
    padding: 30px 16px 44px;
  }

  .referral-shell {
    min-height: calc(100svh - 74px);
    gap: 28px;
  }

  .referral-logo {
    width: 62px;
    margin-bottom: 18px;
  }

  .referral-header h2 {
    font-size: clamp(2.1rem, 10vw, 3.3rem);
  }

  .referral-header p {
    font-size: 0.95rem;
  }

  .console {
    gap: 20px;
    padding: 20px;
  }

  .progress-top {
    display: grid;
    gap: 5px;
    text-align: center;
  }

  #next-tier {
    text-align: center;
  }

  .copy-row {
    display: grid;
    border-radius: 8px;
  }

  .copy-row input {
    min-height: 54px;
    padding-inline: 12px;
    font-size: 0.78rem;
  }

  .copy-button {
    min-height: 48px;
    width: 100%;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    border-left: 0;
  }

  .milestone-track {
    display: grid;
    min-height: auto;
    gap: 18px;
  }

  .milestone-track::before,
  .milestone-track::after {
    top: 28px;
    bottom: 28px;
    left: 31px;
    width: 2px;
    height: auto;
    max-width: none;
  }

  .milestone-track::before {
    right: auto;
  }

  .milestone-track::after {
    height: var(--track-progress);
    max-height: calc(100% - 56px);
  }

  .tier-card {
    width: 100%;
    min-height: 72px;
    grid-template-columns: 62px minmax(0, 1fr);
    column-gap: 16px;
    align-items: center;
    justify-items: start;
    text-align: left;
  }

  .reward-icon {
    margin: 0;
  }

  .tier-card p {
    max-width: none;
  }
}

@media (max-height: 700px) and (min-width: 961px) {
  .splash-page {
    min-height: 560px;
  }

  .splash-copy {
    padding-top: 88px;
    padding-bottom: 46px;
  }

  .brand {
    top: 24px;
  }

  h1 {
    font-size: clamp(3rem, 6vw, 5.2rem);
  }

  .subheadline {
    margin-bottom: 26px;
  }

  .referral-page {
    padding-top: 26px;
    padding-bottom: 34px;
  }

  .referral-shell {
    gap: 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .app-screen,
  .button-primary,
  .copy-button,
  .social-button,
  .progress-track span,
  .milestone-track::after {
    transition: none;
  }
}
