/* FreedomFund landing page — mobile first.
   Same type as the app: New York serif headlines (ui-serif on Apple
   devices), SF Pro body (system-ui). Freedom Blue canvas, white type. */

:root {
  --blue: #0555F8;
  --blue-deep: #0447D1;
  --navy: #07132F;
  --white: #FFFFFF;
  --white-soft: rgba(255, 255, 255, 0.86);
  --white-faint: rgba(255, 255, 255, 0.64);

  --serif: ui-serif, "New York", "Iowan Old Style", Georgia, serif;
  --sans: system-ui, -apple-system, "SF Pro Text", "Segoe UI", Roboto, sans-serif;

  --gutter: 24px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  background: var(--blue);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--blue);
  color: var(--white);
  font-family: var(--sans);
  font-size: 18px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }

a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--white);
  outline-offset: 4px;
  border-radius: 6px;
}

/* ---------- 1. The question ---------- */

.hero {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: calc(env(safe-area-inset-top) + 48px) var(--gutter) 140px;
  position: relative;
}

.question {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  /* Scales with the screen so each phrase keeps to one line, down to 320px. */
  font-size: clamp(2rem, 11vw, 5.6rem);
  line-height: 1.06;
  letter-spacing: -0.01em;
}

.question .line {
  display: block;
  opacity: 0;
  transform: translateY(18px);
  animation: rise 0.9s var(--ease) forwards;
}
.question .line:nth-child(1) { animation-delay: 0.15s; }
.question .line:nth-child(2) { animation-delay: 0.45s; }
.question .line:nth-child(3) { animation-delay: 0.75s; }
.question .line:nth-child(4) { animation-delay: 1.05s; }

.question em {
  font-style: normal;
  font-weight: 800;
}

.scroll-cue {
  position: absolute;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom) + 36px);
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  text-decoration: none;
  color: var(--white-soft);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.02em;
  opacity: 0;
  animation: fade 0.8s var(--ease) 1.9s forwards;
}

.scroll-cue__arrow {
  width: 26px;
  height: 26px;
  animation: bob 1.8s ease-in-out 2.4s infinite;
}

/* ---------- 2. The app ---------- */

.app {
  padding: 96px var(--gutter) 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.icon-wrap {
  position: relative;
  width: min(46vw, 200px);
  margin-bottom: 40px;
}

.icon {
  width: 100%;
  border-radius: 22.5%;
  position: relative;
  z-index: 1;
  /* Lit from above: a soft lift plus a deeper contact shadow. */
  /* A faint white edge separates the icon's blue from the page's blue. */
  outline: 1.5px solid rgba(255, 255, 255, 0.28);
  outline-offset: -1.5px;
  box-shadow:
    0 18px 40px rgba(7, 19, 47, 0.35),
    0 40px 80px rgba(7, 19, 47, 0.25);
  animation: float 6s ease-in-out infinite;
}

/* Shadow on the "ground", breathing with the float. */
.icon-shadow {
  position: absolute;
  left: 12%;
  right: 12%;
  bottom: -34px;
  height: 22px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(7, 19, 47, 0.45), transparent);
  filter: blur(6px);
  animation: shadow 6s ease-in-out infinite;
}

.title {
  margin: 0 0 40px;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2.3rem, 10vw, 3.6rem);
  line-height: 1.05;
}

.subtitle {
  display: block;
  margin-top: 12px;
  font-family: var(--sans);
  font-size: clamp(1.05rem, 4.6vw, 1.3rem);
  font-weight: 500;
  line-height: 1.35;
  color: var(--white-soft);
}

.story {
  max-width: 34rem;
  text-align: left;
}

.story p {
  margin: 0 0 1.25em;
  color: var(--white-soft);
}

.story strong {
  color: var(--white);
  font-weight: 700;
}

.story .believe {
  font-family: var(--serif);
  font-size: 1.45rem;
  line-height: 1.3;
  color: var(--white);
  margin-top: 1.6em;
}

/* ---------- Waitlist ---------- */

.waitlist {
  width: 100%;
  max-width: 34rem;
  margin-top: 40px;
  padding: 28px 22px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.18);
  text-align: left;
  scroll-margin-bottom: 40px;
}

.waitlist__title {
  margin: 0 0 8px;
  font-family: var(--serif);
  font-size: 1.6rem;
  font-weight: 500;
  line-height: 1.2;
}

.waitlist__lead {
  margin: 0 0 20px;
  color: var(--white-soft);
  font-size: 16px;
  line-height: 1.5;
}

.waitlist__input {
  display: block;
  width: 100%;
  padding: 16px 18px;
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.12);
  color: var(--white);
  font: inherit;
  font-size: 17px; /* 16px+ stops iPhone zooming in on focus */
  outline: none;
  transition: border-color 0.2s, background 0.2s;
}
.waitlist__input::placeholder { color: rgba(255, 255, 255, 0.55); }
.waitlist__input:focus { border-color: var(--white); background: rgba(255, 255, 255, 0.18); }
.waitlist__input[aria-invalid="true"] { border-color: #FFD6D6; }

.waitlist__trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.waitlist__button {
  display: block;
  width: 100%;
  margin-top: 12px;
  padding: 17px 24px;
  border: 0;
  border-radius: 14px;
  background: var(--white);
  color: var(--blue);
  font-family: var(--sans);
  font-size: 17px;
  font-weight: 650;
  cursor: pointer;
  box-shadow: 0 10px 26px rgba(7, 19, 47, 0.25);
  transition: transform 0.15s var(--ease), opacity 0.2s;
}
.waitlist__button:active { transform: scale(0.98); }
.waitlist__button:disabled { opacity: 0.7; cursor: default; }

.waitlist__status {
  min-height: 1.4em;
  margin: 12px 0 0;
  font-size: 15px;
  font-weight: 500;
}
.waitlist__status.is-error { color: #FFE0E0; }

.waitlist__note {
  margin: 4px 0 0;
  color: var(--white-faint);
  font-size: 14px;
}

/* Joined: the form collapses to a thank-you. */
.waitlist.is-done .waitlist__input,
.waitlist.is-done .waitlist__button,
.waitlist.is-done .waitlist__note { display: none; }
.waitlist.is-done .waitlist__status { font-size: 17px; margin-top: 0; }

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

/* ---------- Waitlist button (fixed, appears after the question) ---------- */

.download {
  position: fixed;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom) + 20px);
  z-index: 10;
  width: min(calc(100% - 2 * var(--gutter)), 420px);
  padding: 18px 24px;
  border-radius: 16px;
  background: var(--white);
  color: var(--blue);
  font-family: var(--sans);
  font-size: 17px;
  font-weight: 650;
  letter-spacing: -0.005em;
  text-align: center;
  text-decoration: none;
  box-shadow: 0 14px 36px rgba(7, 19, 47, 0.32);
  transform: translate(-50%, calc(100% + 40px));
  opacity: 0;
  pointer-events: none;
  transition: transform 0.5s var(--ease), opacity 0.4s var(--ease);
}
.download.is-shown {
  transform: translate(-50%, 0);
  opacity: 1;
  pointer-events: auto;
}
.download:active { transform: translate(-50%, 0) scale(0.98); }

/* ---------- Footer ---------- */

.footer {
  /* Extra bottom room so the fixed Download button never covers the links. */
  padding: 32px var(--gutter) calc(env(safe-area-inset-bottom) + 112px);
  text-align: center;
  font-size: 14px;
  color: var(--white-faint);
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}
.footer nav { display: flex; justify-content: center; align-items: center; gap: 10px; }
.footer a { text-decoration: none; padding: 6px 2px; }
.footer a:hover { color: var(--white); }
.footer p { margin: 10px 0 0; }

/* ---------- Scroll reveal ---------- */

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}
/* Without JavaScript, show everything. */
.no-js .reveal { opacity: 1; transform: none; }

/* ---------- Motion ---------- */

@keyframes rise { to { opacity: 1; transform: none; } }
@keyframes fade { to { opacity: 1; } }
@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(7px); }
}
@keyframes float {
  0%, 100% { transform: translateY(0) rotate(-1.5deg); }
  50% { transform: translateY(-16px) rotate(1.5deg); }
}
@keyframes shadow {
  0%, 100% { transform: scaleX(1); opacity: 1; }
  50% { transform: scaleX(0.82); opacity: 0.6; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .question .line, .scroll-cue { animation: none; opacity: 1; transform: none; }
  .scroll-cue { transform: translateX(-50%); }
  .scroll-cue__arrow, .icon, .icon-shadow { animation: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .download { transition: opacity 0.2s linear; }
}

/* ---------- Larger screens ---------- */

@media (min-width: 768px) {
  :root { --gutter: 48px; }
  body { font-size: 19px; }
  .app { padding-top: 140px; }
  .icon-wrap { width: 220px; }
}
