/* ─── 1. CSS VARIABLES ─── */
:root {
  --font-geist: 'Geist', sans-serif;
  --font-mono: 'Geist Mono', monospace;
  --font-serif: 'Lora', serif;

  --bg-dark: #0F1C24;
  --bg-light: #ffffff;
  --text-light: #F4F8FB;
  --text-dark: #353535;
  --text-muted-dark: #AACFD1;
  --text-muted-light: #7A7A7A;
  --accent: #3C6E71;
  --accent-light: #559DA1;
  --accent-hover: #2F5759;
  --secondary: #284B63;
  --border-dark: #315B78;
  --border-light: #D9D9D9;
  --card-dark: #1E3748;
  --card-light: #F7FAFB;
}

/* ─── 2. THEME ─── */
.dark {
  --bg: var(--bg-dark);
  --text: var(--text-light);
  --text-muted: var(--text-muted-dark);
  --border: var(--border-dark);
  --card: var(--card-dark);
}
.light {
  --bg: var(--bg-light);
  --text: var(--text-dark);
  --text-muted: var(--text-muted-light);
  --border: var(--border-light);
  --card: var(--card-light);
}

/* ─── 3. RESET ─── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
[id] { scroll-margin-top: 80px; }

body {
  font-family: var(--font-geist);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}

a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid var(--accent);
  transition: color 0.2s ease, border-bottom-color 0.2s ease, border-bottom-width 0.6s ease;
}
a:hover {
  color: var(--accent-hover);
  border-bottom-color: var(--accent-hover);
  border-bottom-width: 3px;
}

em { font-family: var(--font-serif); font-style: italic; }
strong { font-weight: 700; }

h1, h2, h3 {
  font-family: var(--font-mono);
  margin-bottom: 1rem;
  line-height: 1.1;
}

p { margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }
ul { list-style: none; padding: 0; }

/* ─── 4. LAYOUT ─── */
.section {
  max-width: 900px;
  margin: 0 auto;
  padding: clamp(4rem, 8vw, 7rem) 2rem;
  border-bottom: 1px solid var(--border);
}
.section:last-of-type { border-bottom: none; }

/* ─── 5. PROGRESS BAR ─── */
#progress-bar {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0%;
  background: var(--accent);
  z-index: 1001;
  transition: width 0.1s linear;
}

/* ─── 6. THEME TOGGLE ─── */
.theme-toggle-wrap {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 999;
  transition: opacity 0.4s ease;
}

.theme-toggle {
  position: relative;
  width: 40px; height: 20px;
  border-radius: 9999px;
  background: var(--border);
  cursor: pointer;
  transition: background 0.3s ease;
}
.theme-toggle-thumb {
  position: absolute;
  top: 2px; left: 2px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: var(--text);
  transition: transform 0.3s ease;
}
.dark .theme-toggle-thumb { transform: translateX(20px); }

/* ─── 7. NAV ─── */
.page-nav {
  max-width: 900px;
  margin: 0 auto;
  padding: 1.5rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-back, .nav-x {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: none;
  letter-spacing: 0.02em;
  transition: color 0.2s ease;
}
.nav-back:hover, .nav-x:hover { color: var(--text); border-bottom: none; }

/* ─── 8. HERO ─── */
.hero {
  max-width: 900px;
  margin: 0 auto;
  padding: clamp(2rem, 6vw, 5rem) 2rem clamp(4rem, 8vw, 7rem);
  border-bottom: 1px solid var(--border);
}

.hero-inner {
  max-width: 640px;
}

.hero-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(60, 110, 113, 0.12);
  border: 1px solid rgba(60, 110, 113, 0.3);
  border-radius: 4px;
  padding: 0.3rem 0.75rem;
  margin-bottom: 1.75rem;
}

.hero-headline {
  font-family: var(--font-mono);
  font-size: clamp(2.2rem, 6vw, 3.8rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  line-height: 0.95;
  margin-bottom: 1.5rem;
  color: var(--text);
}
.hero-headline em {
  font-family: var(--font-serif);
  font-style: italic;
  text-transform: none;
  font-weight: 400;
  font-size: 0.85em;
  color: var(--text-muted);
  display: block;
  margin-top: 0.25rem;
}

.hero-sub {
  font-size: clamp(1rem, 1.8vw, 1.1rem);
  color: var(--text-muted);
  line-height: 1.65;
  margin-bottom: 2.5rem;
  max-width: 520px;
}

/* ─── 9. OPT-IN FORM ─── */
.optin-wrap { margin-bottom: 0.5rem; }

.optin-form {
  display: flex;
  gap: 0;
  max-width: 520px;
  margin-bottom: 0.75rem;
}
.optin-form--centered {
  max-width: 540px;
  margin-left: auto;
  margin-right: auto;
}

.optin-input {
  flex: 1;
  padding: 1rem 1.25rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-right: none;
  border-radius: 8px 0 0 8px;
  color: var(--text);
  font-family: var(--font-geist);
  font-size: 1rem;
  outline: none;
  transition: border-color 0.3s ease;
}
.optin-input:focus { border-color: var(--accent); }
.optin-input::placeholder { color: var(--text-muted); opacity: 0.5; }

.optin-btn {
  padding: 1rem 1.5rem;
  background: var(--accent);
  color: #fff;
  border: 1px solid var(--accent);
  border-radius: 0 8px 8px 0;
  font-family: var(--font-geist);
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.3s ease, border-color 0.3s ease;
}
.optin-btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.optin-btn:disabled { opacity: 0.7; cursor: not-allowed; }

.optin-privacy {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  opacity: 0.55;
  line-height: 1.5;
  max-width: 520px;
  margin-bottom: 0;
}
.optin-privacy--center { text-align: center; max-width: 100%; }

/* ─── GUMROAD BUTTON ─── */
.fip-gumroad-btn {
  display: inline-block;
  padding: 1rem 2rem;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-decoration: none;
  border-radius: 6px;
  border: 2px solid var(--accent);
  cursor: pointer;
  transition: background 0.25s ease, border-color 0.25s ease, transform 0.15s ease;
  margin-bottom: 0.75rem;
}
.fip-gumroad-btn:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  transform: translateY(-1px);
}
.fip-gumroad-btn--centered {
  display: block;
  max-width: 360px;
  text-align: center;
  margin-left: auto;
  margin-right: auto;
}

/* ─── 10. SECTION HEADERS ─── */
.section-head {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 3rem;
}

.section-slug {
  font-family: var(--font-mono);
  font-size: clamp(1.6rem, 4vw, 2.8rem);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  color: var(--accent);
}

.section-sub {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  opacity: 0.7;
}

/* ─── 11. BULLETS GRID ─── */
.bullets-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.bullet-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.5rem 1.5rem 1.5rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: border-color 0.3s ease, transform 0.3s ease;
}
.bullet-card:hover { border-color: var(--accent); transform: translateY(-3px); }

.bullet-num {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  color: var(--accent);
  opacity: 0.8;
}

.bullet-text {
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--text);
  margin-bottom: 0;
}

/* ─── 12. STACK SECTION ─── */
.stack-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 1.5rem;
  align-items: stretch;
  margin-bottom: 2.5rem;
}

.stack-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem;
  transition: border-color 0.3s ease;
  display: flex;
  flex-direction: column;
}
.stack-card:hover { border-color: var(--accent); }

.stack-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  display: block;
  margin-bottom: 0.5rem;
  opacity: 0.8;
}

.stack-name-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.75rem;
}
.stack-logo {
  height: 1.6rem;
  width: auto;
  flex-shrink: 0;
  display: block;
}
.stack-logo--router {
  height: 1.2rem;
}

.stack-name {
  font-family: var(--font-mono);
  font-size: 1.6rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 0;
  line-height: 1;
  text-transform: uppercase;
}

.stack-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 0;
}

.stack-connector {
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 900;
  color: var(--accent);
  text-align: center;
  opacity: 0.6;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stack-result {
  font-size: 1.05rem;
  color: var(--text-muted);
  line-height: 1.65;
  max-width: 640px;
  border-left: 3px solid var(--accent);
  padding-left: 1.25rem;
  margin-bottom: 0;
}
.stack-result strong { color: var(--text); }

/* ─── 13. WHY SECTION ─── */
.why-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.why-col { padding: 1.75rem; border-radius: 10px; }
.why-col--before {
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  opacity: 0.7;
}
.why-col--after {
  background: rgba(60, 110, 113, 0.07);
  border: 1px solid rgba(60, 110, 113, 0.3);
}

.why-col-title {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 1.25rem;
  color: var(--text-muted);
}
.why-col--after .why-col-title { color: var(--accent); }

.why-list li {
  font-size: 0.9rem;
  color: var(--text-muted);
  padding-left: 1.1rem;
  position: relative;
  margin-bottom: 0.6rem;
  line-height: 1.5;
}
.why-list li::before {
  content: "";
  position: absolute;
  left: 0; top: 0.6em;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--border);
}
.why-col--after .why-list li { color: var(--text); }
.why-col--after .why-list li::before { background: var(--accent); }

/* ─── 14. ABOUT SECTION ─── */
.about-inner {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 3rem;
  align-items: start;
}

.about-img {
  width: 200px;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid var(--border);
  display: block;
}

.about-handle {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.75rem;
  opacity: 0.6;
  margin-bottom: 0;
}

.about-text p {
  font-size: 0.97rem;
  color: var(--text-muted);
  line-height: 1.7;
}

.about-links {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}
.about-links a {
  font-size: 0.85rem;
  font-weight: 600;
}

/* ─── 15. FINAL CTA ─── */
.final-cta {
  border-bottom: none;
}

.final-cta-inner {
  text-align: center;
  max-width: 640px;
  margin: 0 auto;
}

.final-cta-headline {
  font-family: var(--font-mono);
  font-size: clamp(1.8rem, 4.5vw, 3rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  color: var(--text);
  margin-bottom: 0.75rem;
}

.final-cta-sub {
  font-size: 1.05rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
  line-height: 1.6;
}

.final-cta-next {
  margin-top: 1.5rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0;
}

/* ─── 16. FOOTER ─── */
.footer {
  border-top: 1px solid var(--border);
  padding: 3rem 2rem 2.5rem;
}

.footer-inner {
  max-width: 900px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: start;
}

.footer-brand {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text);
  margin-bottom: 0.35rem;
}
.footer-tagline {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-style: italic;
  font-family: var(--font-serif);
  margin-bottom: 0;
  opacity: 0.7;
}

.footer-right { text-align: right; }

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  justify-content: flex-end;
  margin-bottom: 0.75rem;
}
.footer-links li { margin: 0; }
.footer-links a {
  font-size: 0.85rem;
  color: var(--text-muted);
  border-bottom: none;
  transition: color 0.2s ease;
}
.footer-links a:hover { color: var(--accent); border-bottom: none; }

.footer-copy {
  font-size: 0.75rem;
  color: var(--text-muted);
  opacity: 0.5;
  margin-bottom: 0;
  font-family: var(--font-mono);
}

/* ─── 16b. LEAD SECTION ─── */
.lead-inner {
  max-width: 660px;
}

.lead-hook {
  font-size: 1.05rem;
  color: var(--text);
  line-height: 1.65;
  margin-bottom: 0.6rem;
}

.lead-bullets {
  margin: 1.75rem 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.lead-bullets li {
  font-size: 0.97rem;
  color: var(--text-muted);
  padding: 0.85rem 0 0.85rem 1.5rem;
  border-bottom: 1px solid var(--border);
  position: relative;
  line-height: 1.55;
  margin-bottom: 0;
}
.lead-bullets li:first-child { border-top: 1px solid var(--border); }
.lead-bullets li::before {
  content: "→";
  position: absolute;
  left: 0;
  top: 0.85rem;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
}

.lead-close {
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.65;
  margin-bottom: 0;
  margin-top: 0.5rem;
}
.lead-close strong { color: var(--text); }

/* ─── 17. ANIMATIONS ─── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

.hero-animate {
  opacity: 0;
  animation: fadeInUp 0.75s cubic-bezier(0.25, 0.1, 0.25, 1) forwards;
}
.hero-animate:nth-child(1) { animation-delay: 0.05s; }
.hero-animate:nth-child(2) { animation-delay: 0.2s; }
.hero-animate:nth-child(3) { animation-delay: 0.35s; }
.hero-animate:nth-child(4) { animation-delay: 0.5s; }

.animate-on-scroll {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.65s cubic-bezier(0.25, 0.1, 0.25, 1),
              transform 0.65s cubic-bezier(0.25, 0.1, 0.25, 1);
}
.animate-on-scroll.visible { opacity: 1; transform: translateY(0); }

/* ─── 18. RESPONSIVE ─── */
@media (max-width: 700px) {
  .section { padding: 3rem 1.25rem; }
  .hero { padding: 1.5rem 1.25rem 3.5rem; }
  .page-nav { padding: 1.25rem; }

  .bullets-grid { grid-template-columns: 1fr; gap: 1rem; }
  .stack-row { grid-template-columns: 1fr; gap: 1rem; }
  .stack-connector { font-size: 1.5rem; text-align: left; }
  .why-grid { grid-template-columns: 1fr; gap: 1rem; }
  .about-inner { grid-template-columns: 1fr; gap: 1.5rem; }
  .about-img { width: 160px; }

  .optin-form {
    flex-direction: column;
    gap: 0.5rem;
  }
  .optin-input {
    border-right: 1px solid var(--border);
    border-radius: 8px;
  }
  .optin-btn {
    border-radius: 8px;
    padding: 1rem;
  }

  .footer-inner { grid-template-columns: 1fr; }
  .footer-right { text-align: left; }
  .footer-links { justify-content: flex-start; }

  .hero-headline { font-size: clamp(2rem, 8vw, 2.8rem); }
  .section-slug { font-size: clamp(1.4rem, 5vw, 2rem); }
  .final-cta-headline { font-size: clamp(1.6rem, 6vw, 2.2rem); }
}
