/*
  ============================================================================
  Practical Enlightenment - landing styles
  ============================================================================
  Aesthetic: playful + warm, taken straight from the onion mascot. Rounded
  display type (Baloo 2) paired with a clean body (Hanken Grotesk). The palette
  is the onion itself: violet body, pink cheeks, orange shells — purple for
  headings, pink for accents/labels, a single vivid orange pill for the CTA.
  White hero, lavender mid-section, concentric "onion layer" rings on the final
  call to action.
  ============================================================================
*/
:root {
  --bg: #ffffff;
  --lavender: #f3eefc;      /* mid-section wash */
  --ink: #2f2a36;           /* warm near-black, faint violet */
  --ink-soft: #565060;
  --muted: #8e8898;
  --line: #ece6f4;          /* hairline */
  --purple: #6a2c93;        /* headings */
  --purple-deep: #51206f;
  --pink: #ec4b93;          /* accents / eyebrows / labels */
  --cta: #ff6719;           /* the site's real Substack-orange accent */
  --cta-deep: #ff5600;
  --ring: rgba(255, 103, 25, 0.26);
  --green: #5fb84e;
  --maxw: 1160px;

  --display: "Baloo 2", system-ui, sans-serif;
  --body: "Hanken Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 18px;
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
a { color: var(--cta); }
img { display: block; max-width: 100%; }

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 28px;
}

.eyebrow {
  display: block;
  font-family: var(--body);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--pink);
}

/* ------------------------------ Hero ------------------------------- */
.hero { padding: 64px 0 76px; }
.hero .wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}
.hero-banner { margin: 0; }
.hero-banner img {
  width: 100%;
  border-radius: 18px;
  border: 1px solid var(--line);
  box-shadow: 0 26px 60px -34px rgba(70, 40, 100, 0.45);
}
.hero-banner figcaption {
  margin-top: 12px;
  text-align: center;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--muted);
}

/* One shared left edge + a steady vertical rhythm for the whole hero column. */
.hero-copy { --measure: 32rem; }
.hero-copy > * { margin-left: 0; margin-right: 0; }
.hero-copy .eyebrow { margin: 0 0 22px; }
.hero h1 {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(2.7rem, 5vw, 4rem);
  line-height: 1.04;
  letter-spacing: -0.01em;
  margin: 0 0 24px;
  color: var(--purple);
}
.hero h1 .pink { color: var(--pink); }
.hero .lead {
  font-size: 1.2rem;
  line-height: 1.5;
  color: var(--ink-soft);
  max-width: var(--measure);
  margin: 0 0 36px;
}

/* --------------------------- Pill subscribe ------------------------ */
/* The subscribe block is the focal point: a soft halo draws the eye, the field
   is roomy with a clear focus glow, and the button gently breathes. */
.subscribe { position: relative; max-width: var(--measure, 31rem); }
.closing .subscribe { margin: 0 auto; }

/* Warm glow behind the field that pulses softly to attract attention. */
.subscribe .pill-field::before {
  content: "";
  position: absolute;
  inset: -10px -6px;
  border-radius: 999px;
  background: radial-gradient(120% 160% at 80% 50%, rgba(255, 103, 25, 0.22), transparent 70%),
              radial-gradient(120% 160% at 0% 50%, rgba(236, 75, 147, 0.18), transparent 70%);
  filter: blur(14px);
  z-index: -1;
  opacity: 0.9;
  animation: halo 3.4s ease-in-out infinite;
}
@keyframes halo {
  0%, 100% { opacity: 0.55; transform: scale(0.98); }
  50% { opacity: 1; transform: scale(1.02); }
}

.pill-field {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  border: 2px solid var(--line);
  border-radius: 999px;
  padding: 7px 7px 7px 10px;
  box-shadow: 0 20px 44px -22px rgba(70, 40, 100, 0.45);
  transition: border-color 0.18s, box-shadow 0.18s, transform 0.18s;
}
.pill-field:focus-within {
  border-color: var(--cta);
  box-shadow: 0 0 0 5px var(--ring), 0 22px 46px -22px rgba(255, 103, 25, 0.5);
  transform: translateY(-1px);
}
.pill-field input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  padding: 14px 18px;
  font-family: var(--body);
  font-size: 1.08rem;
  font-weight: 500;
  color: var(--ink);
  outline: none;
}
.pill-field input::placeholder { color: #b3acbd; font-weight: 400; }

.btn {
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 32px;
  font-family: var(--body);
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  background: var(--cta);
  border: none;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  box-shadow: 0 10px 22px -8px rgba(255, 103, 25, 0.7);
  transition: background 0.18s, transform 0.12s, box-shadow 0.18s;
  animation: btn-breathe 3.4s ease-in-out infinite;
}
/* A diagonal shine that sweeps across periodically (and resets off-screen). */
.btn::after {
  content: "";
  position: absolute;
  top: 0; left: -150%;
  width: 60%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.5), transparent);
  transform: skewX(-18deg);
  animation: btn-shine 4.5s ease-in-out infinite;
}
.btn i { font-size: 1.1em; transition: transform 0.18s; }
.btn:hover {
  background: var(--cta-deep);
  box-shadow: 0 16px 30px -8px rgba(255, 86, 0, 0.75);
  transform: translateY(-1px);
}
.btn:hover i { transform: translateX(3px); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--ring); }
.btn:disabled { opacity: 0.6; cursor: progress; animation: none; }
/* Spinner for in-flight buttons (Turnstile verify / submit). */
.btn .spin { display: inline-block; animation: app-spin 0.8s linear infinite; }
@keyframes app-spin { to { transform: rotate(360deg); } }
@keyframes btn-breathe {
  0%, 100% { box-shadow: 0 10px 22px -8px rgba(255, 103, 25, 0.55); }
  50% { box-shadow: 0 14px 30px -6px rgba(255, 103, 25, 0.85); }
}
/* Long pause off-screen, then a quick sweep across — a catchy glint every few seconds. */
@keyframes btn-shine {
  0%, 82% { left: -150%; }
  92%, 100% { left: 150%; }
}

/* Trust block: stated once, purely typographic, sharing the column's left edge. */
.assurance {
  margin: 20px 0 0;
  font-size: 0.98rem;
  font-weight: 500;
  line-height: 1.45;
  color: var(--ink-soft);
  max-width: var(--measure, 31rem);
}
.assurance strong { color: var(--ink); font-weight: 700; }
.fineprint { margin: 8px 0 0; font-size: 0.86rem; color: var(--muted); font-weight: 500; }
.status { margin: 12px 0 0; font-size: 0.98rem; font-weight: 600; min-height: 1.2em; }
.status.ok { color: var(--purple); }
.status.err { color: #d23b6a; }

/* Social proof: overlapping avatar dots + a soft line. Clear separation above. */
.social { display: flex; align-items: center; gap: 12px; margin-top: 28px; }
.dots { display: inline-flex; flex-shrink: 0; }
.dots span {
  width: 24px; height: 24px; border-radius: 50%;
  border: 2px solid #fff; margin-left: -7px;
}
.dots span:first-child { margin-left: 0; }
.social small { font-size: 0.94rem; color: var(--muted); font-weight: 500; line-height: 1.35; }
.social strong { color: var(--ink); font-weight: 700; }

/* --------------------- Confirmation code entry --------------------- */
.confirm-row { margin-top: 16px; }
.confirm-actions { display: flex; align-items: center; gap: 18px; margin-top: 12px; }
.btn-link {
  background: none; border: none; color: var(--pink);
  cursor: pointer; font-family: var(--body); font-size: 0.95rem;
  font-weight: 700; padding: 8px 0; text-decoration: underline;
}
.btn-link:hover { color: var(--purple); }

/* --------------------------- Stories block ------------------------- */
.stories { background: var(--lavender); padding: 84px 0; }
.stories .wrap { text-align: center; }
.stories h2 {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(2rem, 3.8vw, 2.8rem);
  letter-spacing: -0.01em;
  color: var(--purple);
  margin: 0 0 14px;
}
.stories .sub { max-width: 52ch; margin: 0 auto 52px; color: var(--ink-soft); font-size: 1.12rem; }
.cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; max-width: 820px; margin: 0 auto; text-align: left; }
.card {
  background: #fff;
  border-radius: 18px;
  border: 1px solid var(--line);
  padding: 30px 30px 32px;
  box-shadow: 0 18px 44px -30px rgba(70, 40, 100, 0.4);
  transition: transform 0.2s, box-shadow 0.2s;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 26px 54px -28px rgba(70, 40, 100, 0.5); }
.card .card-top { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.card .card-top i { font-size: 1.5rem; color: var(--purple); }
.card .num { font-weight: 800; text-transform: uppercase; letter-spacing: 0.14em; color: var(--pink); font-size: 0.74rem; }
.card h3 { font-family: var(--display); font-weight: 700; font-size: 1.38rem; line-height: 1.18; margin: 0 0 10px; color: var(--ink); }
.card p { margin: 0; color: var(--ink-soft); font-size: 1.04rem; }

/* ---------------------- Final CTA with onion rings ----------------- */
.closing { position: relative; overflow: hidden; background: #fff; }
.closing::before {
  content: "";
  position: absolute;
  left: 50%; top: 44%;
  width: 1400px; height: 1400px;
  transform: translate(-50%, -50%);
  background: repeating-radial-gradient(circle, transparent 0 76px, rgba(106, 44, 147, 0.10) 76px 78px);
  pointer-events: none;
  z-index: 0;
}
.closing .wrap { position: relative; z-index: 1; max-width: 620px; text-align: center; padding: 104px 28px 112px; }
.closing .eyebrow { color: var(--muted); margin-bottom: 18px; }
.closing h2 {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(2.2rem, 4.4vw, 3.2rem);
  letter-spacing: -0.01em;
  color: var(--purple);
  margin: 0 0 16px;
}
.closing .lead { font-size: 1.14rem; color: var(--ink-soft); margin: 0 auto 32px; max-width: 40ch; }

/* ----------------------------- Footer ------------------------------ */
footer.site { border-top: 1px solid var(--line); padding: 30px 0; }
footer.site .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
footer.site small { color: var(--muted); font-size: 0.9rem; }
footer.site .brand { font-family: var(--display); font-weight: 700; color: var(--purple); font-size: 1rem; }

/* --------------------------- Thanks page --------------------------- */
.thanks { position: relative; overflow: hidden; min-height: 80vh; display: grid; place-items: center; text-align: center; }
.thanks::before {
  content: "";
  position: absolute; left: 50%; top: 50%;
  width: 1400px; height: 1400px; transform: translate(-50%, -50%);
  background: repeating-radial-gradient(circle, transparent 0 76px, rgba(106, 44, 147, 0.09) 76px 78px);
  pointer-events: none; z-index: 0;
}
.thanks .wrap { position: relative; z-index: 1; max-width: 560px; padding: 80px 28px; }
.thanks-mark { margin: 0 auto 24px; max-width: 320px; }
.thanks-mark img { width: 100%; border-radius: 18px; }
.thanks h1 {
  font-family: var(--display); font-weight: 800;
  font-size: clamp(2rem, 4vw, 2.8rem); color: var(--purple);
  margin: 8px 0 14px; letter-spacing: -0.01em;
}
.thanks .lead { font-size: 1.14rem; color: var(--ink-soft); margin: 0 auto; max-width: 44ch; }
.thanks-cta { margin-top: 30px; }

/* --------------------------- Animations ---------------------------- */
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
.load { opacity: 0; animation: rise 0.85s cubic-bezier(0.2, 0.7, 0.2, 1) forwards; }
.d1 { animation-delay: 0.05s; }
.d2 { animation-delay: 0.16s; }
.d3 { animation-delay: 0.28s; }
.d4 { animation-delay: 0.42s; }
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.2, 0.7, 0.2, 1); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .load, .reveal { animation: none; opacity: 1; transform: none; transition: none; }
  .btn, .btn::after, .subscribe .pill-field::before { animation: none; }
  .btn::after { display: none; }
  html { scroll-behavior: auto; }
}

/* --------------------------- Responsive ---------------------------- */
@media (max-width: 900px) {
  body { font-size: 17px; }
  .hero { padding: 40px 0 56px; }
  .hero .wrap { grid-template-columns: 1fr; gap: 40px; }
  .hero-banner { order: -1; max-width: 460px; margin: 0 auto; }
  .hero-copy { text-align: center; }
  .hero .lead { max-width: none; }
  .subscribe { margin: 0 auto; }
  .social { justify-content: center; }
  .cards { grid-template-columns: 1fr; max-width: 460px; }
}
@media (max-width: 540px) {
  .pill-field { flex-direction: column; gap: 10px; padding: 12px; border-radius: 20px; }
  .pill-field input { width: 100%; text-align: center; }
  .btn { width: 100%; }
}

    /* ALTCHA widget kept functional but visually hidden (proof-of-work is invisible). */
    .altcha-invisible {
      position: absolute !important;
      width: 1px; height: 1px;
      padding: 0; margin: -1px;
      overflow: hidden; clip: rect(0 0 0 0);
      white-space: nowrap; border: 0;
    }

    /* ----------------------------- Confirmation modal ------------------------ */
    /* Deliberately a soft lock (overflow only): the page stays scrollable behind the
       challenge modal so that bot sessions reveal themselves in Clarity (a human is
       stopped by the modal; a script keeps scrolling/clicking behind it). */
    body.modal-open { overflow: hidden; }
    .modal-backdrop {
      position: fixed;
      inset: 0;
      z-index: 1000;
      display: grid;
      place-items: center;
      padding: 24px;
      background: rgba(47, 30, 60, 0.55);
      backdrop-filter: blur(4px);
      animation: modal-fade 0.25s ease;
    }
    .modal-backdrop[hidden] { display: none; }
    @keyframes modal-fade { from { opacity: 0; } to { opacity: 1; } }

    /* Anti-bot challenge modal. Hidden AT REST by the HTML `hidden` attribute (the
       UA stylesheet + .modal-backdrop[hidden] above), NOT by a class here — so it can
       never render even with a missing or stale cached stylesheet, and replay tools
       like Clarity never reconstruct it as covering the page. When JS un-hides it, it
       inherits display:grid from .modal-backdrop; the classes only drive the in-flight
       state:
         - .armed (during a check): laid out so the Turnstile iframe can render, but
           invisible and click-through;
         - .armed.open: actually shown to the visitor. */
    .challenge-modal.armed { visibility: hidden; opacity: 0; pointer-events: none; animation: none; }
    .challenge-modal.armed.open { visibility: visible; opacity: 1; pointer-events: auto; animation: modal-fade 0.25s ease; }
    .challenge-modal .cf-turnstile { margin-top: 8px; width: 100%; }

    .modal {
      position: relative;
      width: 100%;
      max-width: 460px;
      background: #fff;
      border-radius: 24px;
      padding: 40px 36px 32px;
      text-align: center;
      box-shadow: 0 40px 90px -30px rgba(40, 20, 60, 0.55);
      animation: modal-pop 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    }
    @keyframes modal-pop {
      from { opacity: 0; transform: translateY(14px) scale(0.97); }
      to { opacity: 1; transform: none; }
    }
    .modal-close {
      position: absolute;
      top: 14px; right: 14px;
      width: 38px; height: 38px;
      display: grid; place-items: center;
      border: none; border-radius: 50%;
      background: var(--lavender);
      color: var(--purple);
      font-size: 1.2rem;
      cursor: pointer;
      transition: background 0.18s;
    }
    .modal-close:hover { background: #e7defa; }
    .modal-icon {
      width: 70px; height: 70px;
      margin: 0 auto 20px;
      display: grid; place-items: center;
      border-radius: 50%;
      background: rgba(255, 103, 25, 0.12);
      color: var(--cta);
      font-size: 2rem;
    }
    .modal h2 {
      font-family: var(--display);
      font-weight: 800;
      font-size: 1.7rem;
      color: var(--purple);
      margin: 0 0 12px;
    }
    .modal-text {
      font-size: 1rem;
      line-height: 1.5;
      color: var(--ink-soft);
      margin: 0 auto 24px;
      max-width: 36ch;
    }
    .modal-text strong { color: var(--ink); font-weight: 700; }
    .modal-field { margin-bottom: 4px; }
    .modal-field input { text-align: center; letter-spacing: 0.18em; font-weight: 600; text-transform: uppercase; }
    /* Keep the placeholder compact (no wide tracking / caps) so it never clips. */
    .modal-field input::placeholder { letter-spacing: normal; text-transform: none; font-weight: 400; }
    .modal-status { text-align: center; }
    .modal .js-modal-resend { margin-top: 14px; }
    .modal .js-modal-resend:disabled { color: var(--muted); cursor: not-allowed; text-decoration: none; }

    @media (max-width: 480px) {
      .modal { padding: 34px 22px 26px; border-radius: 20px; }
      /* Stack the code input (top) and the confirm button (below): side by side the
         button overflows and clips the input on narrow screens. */
      .modal-field { flex-direction: column; gap: 12px; }
      .modal-field input { width: 100%; }
      .modal-field .btn { width: 100%; }
    }

    /* ----------------------------- Cookie banner ----------------------------- */
    .cookie-banner {
      position: fixed;
      left: 50%;
      bottom: 18px;
      transform: translateX(-50%);
      z-index: 900;
      width: calc(100% - 36px);
      max-width: 860px;
      display: flex;
      align-items: center;
      gap: 18px;
      padding: 14px 18px;
      background: #2f2a36;
      color: #f3eefc;
      border-radius: 16px;
      box-shadow: 0 24px 60px -24px rgba(20, 10, 30, 0.6);
    }
    .cookie-banner[hidden] { display: none; }
    .cookie-banner p { margin: 0; font-size: 0.92rem; line-height: 1.4; flex: 1; }
    .cookie-banner a { color: #f6b79a; font-weight: 600; }
    .cookie-banner .btn { padding: 10px 22px; font-size: 0.95rem; animation: none; }
    .cookie-banner .btn::after { display: none; }
    @media (max-width: 560px) {
      .cookie-banner { flex-direction: column; align-items: stretch; text-align: center; gap: 12px; }
    }

    .footer-link { color: var(--muted); text-decoration: underline; }
    .footer-link:hover { color: var(--purple); }

    /* ------------------------- Privacy modal tweaks -------------------------- */
    .privacy-modal { max-width: 580px; text-align: left; }
    .privacy-modal h2 { text-align: left; }
    .privacy-body { max-height: 60vh; overflow-y: auto; color: var(--ink-soft); font-size: 0.96rem; line-height: 1.5; }
    .privacy-body p { margin: 0 0 12px; }
    .privacy-body ul { margin: 0 0 12px; padding-left: 20px; }
    .privacy-body li { margin-bottom: 6px; }
    .privacy-body strong { color: var(--ink); }
    .privacy-note { color: var(--muted); font-size: 0.86rem; }
