/* ============================================================
   Email opt-in landing page
   Judgment calls:
   - Accent: lime green (#B7F543). Reads energetic/honest against
     near-black, and it's nowhere near the banned navy/blue.
   - Font: system UI stack. Zero requests, loads instantly on
     Instagram's in-app browser, and looks native on every phone.
   - Mobile-first: base styles are the phone layout; one
     breakpoint at 640px widens type and the form.
   ============================================================ */

:root {
  --bg: #101210;
  --bg-raised: #191c19;
  --text: #f2f4f0;
  --text-dim: #a9b0a6;
  --accent: #b7f543;
  --accent-dark: #90cc26;
  --error: #ff7a6b;
  --radius: 10px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  font-size: 1.0625rem; /* 17px, big enough to read one-handed on a phone */
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 40rem;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ---------- Type ---------- */

h1 {
  font-size: clamp(1.9rem, 7.5vw, 3rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}

h2 {
  font-size: clamp(1.4rem, 5.5vw, 2rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin-bottom: 1.5rem;
}

h3 {
  font-size: 1.15rem;
  color: var(--accent);
  margin-bottom: 0.35rem;
}

.eyebrow {
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.9rem;
}

.sub {
  color: var(--text-dim);
  margin-bottom: 1.75rem;
}

.small {
  font-size: 0.9rem;
}

/* ---------- Sections ---------- */

.hero {
  padding: 4.5rem 0 3.5rem;
}

.fails {
  padding: 3rem 0;
}

.fail-block {
  background: var(--bg-raised);
  border-radius: var(--radius);
  padding: 1.25rem 1.25rem 1.35rem;
  margin-bottom: 1rem;
}

.fail-block p {
  color: var(--text-dim);
}

.tease {
  padding: 3rem 0;
}

.tease p {
  color: var(--text-dim);
}

.final-cta {
  padding: 3.5rem 0 4rem;
  text-align: center;
}

.final-cta .sub {
  margin-bottom: 1.25rem;
}

.reassure {
  color: var(--text-dim);
  font-size: 0.9rem;
  margin-top: 1rem;
}

.footer {
  border-top: 1px solid #23271f;
  padding: 1.5rem 0 2.5rem;
  text-align: center;
}

.footer p {
  color: var(--text-dim);
  font-size: 0.85rem;
}

/* ---------- Form ---------- */

.optin-form {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.final-cta .optin-form {
  max-width: 26rem;
  margin: 0 auto;
}

.optin-form input[type="email"],
.optin-form input[type="text"] {
  width: 100%;
  padding: 0.95rem 1rem;
  font-size: 1rem;
  font-family: inherit;
  color: var(--text);
  background: var(--bg-raised);
  border: 1px solid #2e332b;
  border-radius: var(--radius);
  outline: none;
}

.optin-form input[type="email"]:focus,
.optin-form input[type="text"]:focus {
  border-color: var(--accent);
}

.optin-form input.invalid {
  border-color: var(--error);
}

.cta-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  width: 100%;
  padding: 0.95rem 1.5rem;
  font-size: 1.05rem;
  font-weight: 700;
  font-family: inherit;
  color: #101210;
  background: var(--accent);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.15s ease;
}

.cta-button:hover,
.cta-button:focus-visible {
  background: var(--accent-dark);
}

.icon-plane {
  flex: 0 0 auto;
}

.form-error {
  color: var(--error);
  font-size: 0.9rem;
  text-align: left;
}

/* ---------- Modal ---------- */

.optin-modal {
  width: calc(100% - 2.5rem);
  max-width: 24rem;
  margin: auto;
  padding: 2rem 1.5rem 1.75rem;
  background: var(--bg-raised);
  color: var(--text);
  border: 1px solid #2e332b;
  border-radius: var(--radius);
}

.optin-modal::backdrop {
  background: rgba(0, 0, 0, 0.65);
}

.optin-modal h2 {
  font-size: 1.4rem;
  margin-bottom: 1.1rem;
  padding-right: 2rem;
}

.optin-modal .reassure {
  color: var(--text-dim);
  font-size: 0.85rem;
  margin-top: 0.9rem;
  margin-bottom: 0;
}

.modal-close {
  position: absolute;
  top: 0.6rem;
  right: 0.75rem;
  padding: 0.25rem 0.5rem;
  font-size: 1.6rem;
  line-height: 1;
  font-family: inherit;
  color: var(--text-dim);
  background: none;
  border: none;
  cursor: pointer;
}

.modal-close:hover,
.modal-close:focus-visible {
  color: var(--text);
}

/* ---------- Thanks page ---------- */

.thanks {
  min-height: 100svh;
  display: flex;
  align-items: center;
  text-align: center;
  padding: 3rem 0;
}

.thanks .container {
  width: 100%;
}

/* ---------- Utility ---------- */

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

/* ---------- Wider screens ---------- */

@media (min-width: 640px) {
  .hero {
    padding: 6.5rem 0 4.5rem;
  }

  .hero-cta {
    width: auto;
  }

  /* Bottom CTA on desktop: name + email share a row, button spans below.
     The modal form stays stacked at every width; it is only 24rem wide. */
  .final-cta .optin-form {
    flex-direction: row;
    flex-wrap: wrap;
    max-width: 30rem;
  }

  .final-cta .optin-form input[type="text"] {
    flex: 1 1 9rem;
    width: auto;
  }

  .final-cta .optin-form input[type="email"] {
    flex: 1 1 13rem;
    width: auto;
  }

  .final-cta .optin-form .cta-button {
    flex-basis: 100%;
  }

  .form-error {
    flex-basis: 100%;
  }
}
