:root {
  --bg: #fbfaf7;          /* lighter off-white */
  --ink: #111111;         /* near-black text */
  --muted: #5f5a52;
  --accent: #6b4ea8;
  --accent-2: #2c7a9e;
  --card: rgba(0, 0, 0, 0.03);
  --border: rgba(0, 0, 0, 0.12);
  --radius: 18px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;            /* never allow a stray horizontal scroll */
}

/* Soft ambient color wash behind everything. */
.bg-glow {
  position: fixed;
  inset: -20vmax;
  z-index: 0;
  background:
    radial-gradient(40vmax 40vmax at 20% 18%, rgba(107, 78, 168, 0.10), transparent 60%),
    radial-gradient(38vmax 38vmax at 85% 75%, rgba(44, 122, 158, 0.08), transparent 60%);
  filter: blur(8px);
  pointer-events: none;
}

.wrap {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  /* Equal padding on both edges, plus the device safe-area insets so content
     clears the notch while the off-white background still fills the screen. */
  padding:
    calc(clamp(28px, 6vw, 72px) + env(safe-area-inset-top))
    calc(clamp(20px, 5vw, 40px) + env(safe-area-inset-right))
    calc(clamp(28px, 6vw, 72px) + env(safe-area-inset-bottom))
    calc(clamp(20px, 5vw, 40px) + env(safe-area-inset-left));
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}

/* ---------------------------------------------------------------- hero --- */
.hero {
  flex: 1;
  display: grid;
  /* minmax(0, …) so a wide child (e.g. .sub's 46ch max-width) can't force a
     track wider than its share — WebKit otherwise blows the column out and
     overflows the viewport. */
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  align-items: center;
  gap: clamp(32px, 6vw, 80px);
}

/* Grid items must be allowed to shrink below their content's min-content width,
   otherwise the column overflows the screen on narrow phones (iOS Safari). */
.copy,
.phone { min-width: 0; }

.badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  border: 1px solid var(--border);
  background: var(--card);
  padding: 6px 12px;
  border-radius: 999px;
  margin-bottom: 22px;
}

.wordmark {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 600;
  font-size: clamp(52px, 9vw, 96px);
  line-height: 0.95;
  margin: 0 0 14px;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.tagline {
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(20px, 3vw, 28px);
  font-weight: 500;
  margin: 0 0 14px;
  color: var(--ink);
}

.sub {
  font-size: clamp(15px, 1.6vw, 18px);
  line-height: 1.6;
  color: var(--muted);
  max-width: 46ch;
  margin: 0 0 30px;
}

/* ------------------------------------------------------------- signup --- */
.signup {
  display: flex;
  gap: 10px;
  max-width: 460px;
}

.email {
  flex: 1;
  min-width: 0;
  padding: 14px 16px;
  font-size: 16px;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.email::placeholder { color: #9a948b; }
.email:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(0, 0, 0, 0.04);
}

.submit {
  padding: 14px 20px;
  font-size: 15px;
  font-weight: 600;
  color: var(--bg);
  white-space: nowrap;
  background: var(--ink);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.12s ease, opacity 0.15s ease;
}
.submit:hover { transform: translateY(-1px); }
.submit:active { transform: translateY(0); }
.submit:disabled { opacity: 0.6; cursor: default; transform: none; }

.status {
  min-height: 20px;
  margin: 12px 0 0;
  font-size: 14px;
  color: var(--accent-2);
}
.status.error { color: #c0392b; }

/* -------------------------------------------------------- iphone frame --- */
.phone {
  display: flex;
  justify-content: center;
}

.phone-frame {
  position: relative;
  width: clamp(240px, 30vw, 300px);
  aspect-ratio: 9 / 19.5;
  background: #050507;
  border-radius: 44px;
  padding: 12px;
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, 0.06),
    0 30px 80px -20px rgba(0, 0, 0, 0.8),
    0 0 120px -30px rgba(200, 155, 255, 0.35);
}

.phone-notch {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 36%;
  height: 26px;
  background: #050507;
  border-radius: 0 0 16px 16px;
  z-index: 2;
}

.phone-screen {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 33px;
  display: block;
  background: var(--bg);
}

/* ------------------------------------------------------------ responsive */
@media (max-width: 820px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
    text-align: center;
  }
  .copy { order: 2; }
  .phone { order: 1; }
  /* Center the constrained blocks and let them fill the (symmetric) container
     so the email field and button sit equidistant from both screen edges. */
  .sub { margin-left: auto; margin-right: auto; }
  .signup {
    width: 100%;
    margin-left: auto;
    margin-right: auto;
  }

  /* Slimmer phone bezel so the black frame doesn't crowd the video. */
  .phone-frame {
    padding: 4px;
    border-radius: 36px;
  }
  .phone-screen { border-radius: 32px; }
  .phone-notch {
    top: 14px;
    height: 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .phone-screen { /* video still loops; browsers honor user setting at OS level */ }
}
