/* ==========================================================================
   LeadsReach — "Emerald editorial" redesign
   Fixed emerald backdrop (parallax) · sticky top bar with reading progress ·
   full-width hero · ivory reading sheet with a sticky, scroll-spied contents list.
   Fonts: Fraunces (display) + Manrope (body). All layout on flexbox.
   ========================================================================== */

:root {
  /* Palette */
  --bg:        #0b1f1a;                 /* deep emerald backdrop */
  --ivory:     #f7f3ea;                 /* reading sheet */
  --ink:       #171a19;
  --ink-2:     #363c39;
  --muted:     #6b726e;
  --emerald:   #0f6b4f;
  --emerald-2: #0a4a37;
  --amber:     #d9a441;
  --amber-2:   #f0c96b;
  --rule:      rgba(23, 26, 25, 0.12);
  --on-dark:   rgba(247, 243, 234, 0.78);

  /* Type */
  --ff-display: "Fraunces", Georgia, "Times New Roman", serif;
  --ff-body:    "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;

  /* Layout */
  --wrap:      1180px;
  --gutter:    clamp(20px, 4vw, 48px);
  --topbar-h:  72px;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--topbar-h) + 24px);
}

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--ivory);
  font-family: var(--ff-body);
  font-weight: 400;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; }
h1, h2, p, ol { margin: 0; }
a { color: inherit; text-decoration: none; }

/* ---------- Page shell + fixed backdrop (the parallax layer) ---------- */
.page {
  position: relative;
  min-height: 100vh;
  isolation: isolate;
}

/* bg.jpg: deep emerald with an amber light leak and a teal glow, film grain — generated for this site */
.page__bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  background: url("/assets/images/bg.jpg?v=6") center top / cover no-repeat;
  pointer-events: none;
}

.page__bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 90% at 50% 0%, rgba(0, 0, 0, 0) 45%, rgba(4, 12, 10, 0.6) 100%);
}

/* ---------- Reading progress ---------- */
.progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 60;
  background: rgba(247, 243, 234, 0.08);
}

.progress__bar {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--amber), var(--amber-2));
  transform: scaleX(var(--p, 0));
  transform-origin: left center;
}

/* ---------- Top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(11, 31, 26, 0.62);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(247, 243, 234, 0.08);
}

.topbar__inner {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--gutter);
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.logo { display: flex; align-items: center; }

.logo img {
  height: 40px;
  width: auto;
  max-width: min(320px, calc(100vw - 200px));
  object-fit: contain;
  object-position: left center;
}

/* placeholder wordmark (only until a per-domain logo file is dropped in) */
.brand-mark { display: inline-flex; align-items: center; gap: 10px; }
.brand-emblem { width: 36px; height: 36px; flex: none; }
.brand-name { font-family: var(--ff-display); font-size: 22px; font-weight: 600; letter-spacing: 0.01em; white-space: nowrap; }

.topbar__nav { display: flex; align-items: center; gap: 20px; }

.chip {
  display: inline-flex;
  align-items: center;
  padding: 7px 13px;
  border: 1px solid rgba(240, 201, 107, 0.5);
  border-radius: 999px;
  color: var(--amber-2);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.topbar__link {
  font-size: 14px;
  font-weight: 500;
  color: var(--on-dark);
  text-decoration: underline;
  text-decoration-color: rgba(247, 243, 234, 0.3);
  text-underline-offset: 5px;
  transition: color 0.2s;
}

.topbar__link:hover { color: var(--ivory); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(72px, 9vw, 130px) 0 clamp(64px, 8vw, 110px);
}

.hero__inner {
  position: relative;
  z-index: 1;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 26px;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--amber-2);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 36px;
  height: 1px;
  background: var(--amber);
}

.hero__title {
  font-family: var(--ff-display);
  font-weight: 600;
  font-size: clamp(40px, 5.6vw, 80px);
  line-height: 1.02;
  letter-spacing: -0.02em;
  color: var(--ivory);
  max-width: 18ch;
  text-wrap: balance;
}

.hero__lead {
  max-width: 720px;
  font-size: clamp(17px, 1.4vw, 21px);
  line-height: 1.6;
  color: var(--on-dark);
  text-wrap: pretty;
}

.hero__meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 6px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(247, 243, 234, 0.55);
}

.hero__meta span + span::before {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-right: 18px;
  border-radius: 50%;
  background: var(--amber);
  vertical-align: middle;
}

/* decorative layer — pure CSS, each item drifts at its own speed (data-speed → --py in main.js) */
.hero__decor { position: absolute; inset: 0; pointer-events: none; }

.hero__decor > span {
  position: absolute;
  display: block;
  transform: translateY(var(--py, 0px));
  will-change: transform;
}

.hero__ring {
  right: -6%;
  top: -32%;
  width: min(640px, 62vw);
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid rgba(240, 201, 107, 0.38);
}

.hero__ring::before,
.hero__ring::after { content: ""; position: absolute; border-radius: 50%; }

.hero__ring::before {            /* inner ring */
  inset: 14%;
  border: 1px solid rgba(240, 201, 107, 0.22);
}

.hero__ring::after {             /* glowing bead on the ring */
  width: 14px;
  height: 14px;
  left: 50%;
  top: -7px;
  transform: translateX(-50%);
  background: var(--amber-2);
  box-shadow: 0 0 24px 6px rgba(240, 201, 107, 0.45);
}

.hero__orb {
  aspect-ratio: 1;
  border-radius: 50%;
  filter: blur(22px);
}

.hero__orb--teal {
  left: -12%;
  bottom: -28%;
  width: min(560px, 70vw);
  background: radial-gradient(circle at 40% 40%, rgba(31, 138, 112, 0.6), rgba(31, 138, 112, 0) 66%);
}

.hero__orb--amber {
  right: 16%;
  bottom: -14%;
  width: 280px;
  background: radial-gradient(circle, rgba(217, 164, 65, 0.42), rgba(217, 164, 65, 0) 66%);
}

.hero__dots {
  left: 58%;
  top: 14%;
  width: 240px;
  height: 150px;
  background-image: radial-gradient(rgba(247, 243, 234, 0.4) 1px, transparent 1.6px);
  background-size: 14px 14px;
  -webkit-mask-image: linear-gradient(90deg, #000, transparent);
  mask-image: linear-gradient(90deg, #000, transparent);
}

/* ---------- Reading sheet ---------- */
.sheet {
  position: relative;
  z-index: 1;
  width: min(var(--wrap), calc(100% - 2 * var(--gutter)));
  margin: 0 auto;
  padding: clamp(32px, 5vw, 72px) var(--gutter);
  background: var(--ivory);
  color: var(--ink);
  border-radius: 28px;
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(247, 243, 234, 0.06);
  display: flex;
  align-items: flex-start;
  gap: clamp(40px, 6vw, 88px);
}

/* contents list */
.toc {
  flex: 0 0 240px;
  position: sticky;
  top: calc(var(--topbar-h) + 28px);
}

.toc__label {
  margin-bottom: 16px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.toc__list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.toc a {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 10px 14px;
  border-left: 2px solid transparent;
  border-radius: 0 12px 12px 0;
  color: var(--ink-2);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.3;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}

.toc a:hover { color: var(--ink); background: rgba(15, 107, 79, 0.05); }

.toc a.is-active {
  color: var(--ink);
  background: rgba(15, 107, 79, 0.09);
  border-left-color: var(--emerald);
}

.toc__num {
  min-width: 22px;
  font-family: var(--ff-display);
  font-size: 13px;
  font-weight: 600;
  color: var(--amber);
  font-variant-numeric: tabular-nums;
}

/* sections */
.content {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.section {
  position: relative;
  padding: clamp(36px, 4vw, 56px) 0;
  border-top: 1px solid var(--rule);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.section:first-child { padding-top: 0; border-top: 0; }

.section__num {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--ff-display);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--amber);
}

.section__num::after {
  content: "";
  width: 40px;
  height: 1px;
  background: currentColor;
}

.section__title {
  font-family: var(--ff-display);
  font-weight: 600;
  font-size: clamp(26px, 2.6vw, 38px);
  line-height: 1.12;
  letter-spacing: -0.015em;
  color: var(--ink);
  max-width: 24ch;
  text-wrap: balance;
}

.section__text {
  max-width: 70ch;
  font-size: clamp(16px, 1.2vw, 18.5px);
  line-height: 1.7;
  color: var(--ink-2);
  text-wrap: pretty;
}

/* conclusion panel */
.section--conclusion {
  margin-top: clamp(24px, 3vw, 40px);
  padding: clamp(32px, 4vw, 48px) clamp(24px, 3.5vw, 48px);
  border-top: 0;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--emerald), var(--emerald-2));
  color: var(--ivory);
  overflow: hidden;
}

.section--conclusion::before {
  content: "";
  position: absolute;
  right: -90px;
  top: -90px;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  border: 1px solid rgba(240, 201, 107, 0.35);
  pointer-events: none;
}

.section--conclusion .section__num { color: var(--amber-2); }
.section--conclusion .section__title { color: var(--ivory); }
.section--conclusion .section__text { color: rgba(247, 243, 234, 0.86); }

/* ---------- Footer ---------- */
.footer {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: clamp(40px, 5vw, 64px) var(--gutter) clamp(48px, 6vw, 80px);
}

.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px 28px;
  color: rgba(247, 243, 234, 0.6);
  font-size: 14px;
}

.footer__brand img { height: 28px; width: auto; }
.footer__brand .brand-emblem { width: 26px; height: 26px; }
.footer__brand .brand-name { font-size: 17px; }

.footer__top {
  font-weight: 700;
  color: var(--amber-2);
  text-decoration: underline;
  text-decoration-color: rgba(240, 201, 107, 0.35);
  text-underline-offset: 5px;
}

/* ---------- Adaptive ---------- */
@media (max-width: 900px) {
  :root { --topbar-h: 64px; }

  html { scroll-padding-top: calc(var(--topbar-h) + 72px); }   /* top bar + sticky contents strip */

  .logo img { height: 32px; }
  .topbar__link { display: none; }

  .hero { padding: 56px 0 56px; }
  .hero__ring { right: -24%; top: -18%; width: 78vw; }

  .sheet {
    flex-direction: column;
    gap: 28px;
    border-radius: 22px;
  }

  /* the contents list becomes a sticky strip of chips */
  .toc {
    flex: none;
    position: sticky;
    top: var(--topbar-h);
    z-index: 2;
    width: calc(100% + 2 * var(--gutter));
    margin: 0 calc(-1 * var(--gutter));
    padding: 12px var(--gutter);
    background: var(--ivory);
    border-bottom: 1px solid var(--rule);
    border-radius: 22px 22px 0 0;
  }

  .toc__label { display: none; }

  .toc__list {
    flex-direction: row;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .toc__list::-webkit-scrollbar { display: none; }

  .toc a {
    flex: none;
    gap: 8px;
    padding: 8px 12px;
    border: 1px solid var(--rule);
    border-radius: 999px;
    font-size: 13px;
    white-space: nowrap;
  }

  .toc a.is-active {
    background: var(--emerald);
    border-color: var(--emerald);
    color: var(--ivory);
  }

  .toc a.is-active .toc__num { color: var(--amber-2); }
}

@media (max-width: 600px) {
  .sheet { padding: 24px var(--gutter) 28px; border-radius: 18px; }
  .toc { border-radius: 18px 18px 0 0; }
  .hero__title { font-size: clamp(34px, 9.5vw, 44px); }
  .section { padding: 30px 0; }
  .section--conclusion { padding: 28px 22px; }
  .footer__inner { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

/* ---------- Multi-paragraph copy (client text) ---------- */
.hero__lead + .hero__lead { margin-top: -8px; }
