/* ═══════════════════════════════════════════════════════════════
   Amazify — Immersive layer (loaded AFTER style.css)
   Restraint over decoration. The 3D constellation appears only at the
   focal moments (hero, CONTEXTUA, final CTA); every content section
   keeps its solid, legible background. The base look & feel is intact.
   ═══════════════════════════════════════════════════════════════ */

html { scroll-padding-top: 90px; }
body { background: #0b0d1a; }
::selection { background: hsla(35, 85%, 53%, 0.25); color: var(--white); }

@media (pointer: fine) {
  * { scrollbar-width: thin; scrollbar-color: hsla(35, 85%, 53%, 0.4) transparent; }
  *::-webkit-scrollbar { width: 10px; height: 10px; }
  *::-webkit-scrollbar-thumb { background: hsla(251, 32%, 40%, 0.5); border-radius: 10px; border: 2px solid transparent; background-clip: content-box; }
  *::-webkit-scrollbar-thumb:hover { background: hsla(35, 85%, 53%, 0.6); background-clip: content-box; }
}

/* ── Scroll progress bar ─────────────────────────────────────────── */
.scroll-progress {
  position: fixed; top: 0; left: 0;
  width: 100%; height: 2px; z-index: 9999;
  transform: scaleX(0); transform-origin: 0 50%;
  background: linear-gradient(90deg, var(--growth-amber), var(--clarity-sky));
  box-shadow: 0 0 10px hsla(35, 85%, 53%, 0.4);
  will-change: transform;
}

/* ── Reveal on scroll (clean — no blur) ──────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1), transform 0.55s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}
.reveal.vis { opacity: 1; transform: none; }
.has-parallax { will-change: transform; }

/* ═══ The 3D constellation (three.js) — fixed, behind content ═══
   Visible only through the transparent focal sections below. */
#bg3d {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0;                 /* fades in once three.js has a frame */
  transition: opacity 1.2s ease;
}
#bg3d.ready { opacity: 1; }

/* Page content rides above the 3D layer. (nav keeps its own fixed/sticky
   position from style.css — do NOT override it here.) */
.hero, .ticker, .section, .ctx-section, .faq-section, .final-cta, footer { position: relative; z-index: 1; }

/* Focal sections are transparent so the constellation shows through them.
   A soft scrim keeps their text crisp. */
.hero { background: transparent !important; }
.hero::before {
  content: '';
  position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(100deg, hsla(251, 40%, 8%, 0.92) 0%, hsla(251, 40%, 8%, 0.72) 38%, hsla(251, 40%, 9%, 0.18) 75%, transparent 100%);
}
/* Calmer than the hero: a translucent veil dims the warp so it's a quiet
   backdrop here (the founder found it too strong even at rest). */
.ctx-section { background-color: hsla(240, 30%, 6%, 0.62) !important; }
.final-cta { background-color: hsla(240, 30%, 6%, 0.62) !important; }

/* Card-based dark sections stay legible but let the warp drift faintly
   behind the content (continuous immersion). The text-dense #replace
   (comparison table) keeps its solid background from style.css. */
#pillars, .ci-section, .faq-section-dark {
  background-color: hsla(251, 32%, 15%, 0.86) !important;
}

/* ── 3D tilt on cards (subtle) ───────────────────────────────────── */
.tilt { position: relative; transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease; transform-style: preserve-3d; }
.tilt::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit;
  background: radial-gradient(circle at var(--gx, 50%) var(--gy, 50%), hsla(0, 0%, 100%, 0.10), transparent 45%);
  opacity: 0; transition: opacity 0.35s ease; pointer-events: none; z-index: 2;
}
.tilt:hover::after { opacity: 1; }
.tilt:hover { box-shadow: 0 24px 50px rgba(0, 0, 0, 0.22); }
.hero-right { transform-style: preserve-3d; transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1); }

/* ── Process steps light up as you scroll (NO horizontal rail) ───── */
.process-steps .pstep .pstep-num {
  transition: color 0.5s ease, transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.5s ease;
}
.process-steps .pstep.step-active .pstep-num {
  color: var(--growth-amber);
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 10px 30px hsla(35, 85%, 53%, 0.28);
}

/* ── Magnetic buttons (very gentle) ──────────────────────────────── */
.btn-amber, .btn-outline {
  transition: box-shadow 0.3s ease, background 0.3s ease, color 0.3s ease;
  will-change: transform;
}

/* ── Nav dropdown ────────────────────────────────────────────────── */
.nav-has-dropdown { position: relative; }
.nav-caret { font-size: 0.6em; margin-left: 0.25rem; opacity: 0.6; }
.nav-dropdown {
  position: absolute; top: 100%; left: 50%;
  transform: translateX(-50%) translateY(8px);
  min-width: 200px; padding: 0.5rem;
  display: flex; flex-direction: column; gap: 0.15rem;
  background: hsla(251, 32%, 12%, 0.97); backdrop-filter: blur(20px);
  border: 1px solid hsla(35, 85%, 53%, 0.12); border-radius: 12px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  opacity: 0; visibility: hidden;
  transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 120;
}
.nav-has-dropdown:hover .nav-dropdown { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(2px); }
.nav-dropdown a { padding: 0.5rem 0.75rem; border-radius: 8px; font-size: 0.85rem; white-space: nowrap; }
.nav-dropdown a:hover { background: hsla(35, 85%, 53%, 0.1); }

/* The nav "Free Audit" pill: solid, high-contrast, no gloss washing the label. */
nav .nav-links .btn-amber {
  color: var(--trust-navy);
  font-weight: 800;
  letter-spacing: 0.01em;
}
nav .nav-links .btn-amber.shimmer::after { display: none; }

/* ── Live dashboard: pulsing badge + eased breathing bar ─────────── */
.dash-live { position: relative; }
.dash-live::before {
  content: ''; display: inline-block; width: 6px; height: 6px; margin-right: 5px;
  border-radius: 50%; background: var(--success, #34c759); vertical-align: middle;
  animation: dashLivePulse 1.8s ease-in-out infinite;
}
@keyframes dashLivePulse {
  0%, 100% { box-shadow: 0 0 0 0 hsla(142, 71%, 45%, 0.5); opacity: 1; }
  50% { box-shadow: 0 0 0 5px hsla(142, 71%, 45%, 0); opacity: 0.7; }
}
.dash-bar-fill { transition: width 1.2s cubic-bezier(0.16, 1, 0.3, 1); }

/* Blog article TL;DR / key-takeaway callout (also an LLM-quotable summary). */
.blog-tldr {
  position: relative;
  margin: 0 0 2rem;
  padding: 1.1rem 1.25rem 1.1rem 1.4rem;
  border-left: 3px solid var(--growth-amber);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: hsla(35, 85%, 53%, 0.06);
  color: var(--trust-navy);
  font-size: 1.02rem;
  line-height: 1.6;
}
.blog-tldr-label {
  display: inline-block;
  margin-right: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--growth-amber-dark, hsl(35, 85%, 43%));
}

/* ════════════════════════════════════════════════════════════════════
   PREMIUM FOOTER (overrides the legacy base footer)
   ════════════════════════════════════════════════════════════════════ */
.ftr {
  position: relative; isolation: isolate; overflow: hidden;
  background: radial-gradient(120% 140% at 50% -20%, hsla(251, 32%, 18%, 0.55) 0%, transparent 55%), var(--trust-navy-dark);
  border-top: 1px solid hsla(35, 85%, 53%, 0.10);
  padding: 5.5rem 0 2.25rem; color: var(--white);
}
.ftr-glow {
  position: absolute; top: -1px; left: 50%; transform: translateX(-50%);
  width: min(680px, 80%); height: 1px;
  background: linear-gradient(90deg, transparent, var(--growth-amber), transparent);
  opacity: 0.5; pointer-events: none;
}
.ftr-glow::after {
  content: ""; position: absolute; top: -34px; left: 50%; transform: translateX(-50%);
  width: 320px; height: 70px;
  background: radial-gradient(60% 100% at 50% 0%, hsla(35, 85%, 53%, 0.16), transparent 70%);
  filter: blur(8px);
}
.ftr-grid { display: grid; grid-template-columns: 1.6fr 2.4fr; gap: 4rem; padding-bottom: 3.5rem; }
.ftr-brand { max-width: 340px; }
.ftr-logo { display: inline-block; transition: opacity 0.25s ease; }
.ftr-logo:hover { opacity: 0.82; }
.ftr-logo .nav-logo-svg { height: 38px; width: auto; }
.ftr-constellation { display: flex; align-items: center; gap: 6px; margin: 1.1rem 0 0.25rem; }
.ftr-constellation i { width: 3px; height: 3px; border-radius: 50%; background: var(--growth-amber); opacity: 0.85; }
.ftr-constellation i:nth-child(2) { opacity: 0.45; }
.ftr-constellation i:nth-child(3) { opacity: 0.2; }
.ftr-blurb { color: var(--silver); font-size: 0.9rem; line-height: 1.75; margin: 0.75rem 0 1.75rem; }
.ftr-social { display: flex; gap: 0.6rem; }
.ftr-social-link {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 50%; color: var(--silver);
  border: 1px solid hsla(0, 0%, 100%, 0.10); background: hsla(0, 0%, 100%, 0.02);
  transition: color 0.25s ease, border-color 0.25s ease, background 0.25s ease, transform 0.25s ease;
}
.ftr-social-link:hover { color: var(--growth-amber); border-color: hsla(35, 85%, 53%, 0.45); background: hsla(35, 85%, 53%, 0.08); transform: translateY(-2px); }
.ftr-social-link svg, .ftr-social-link img { width: 17px; height: 17px; fill: currentColor; }
.ftr-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 2.5rem 2rem; }
.ftr-col-heading { font-family: var(--font-mono); font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.16em; color: var(--slate); margin: 0 0 1.25rem; }
.ftr-col-list { list-style: none; margin: 0; padding: 0; }
.ftr-col-list li { margin-bottom: 0.7rem; }
.ftr-col-list li:last-child { margin-bottom: 0; }
.ftr-link { position: relative; display: inline-block; color: var(--silver); font-size: 0.9rem; line-height: 1.4; transition: color 0.25s ease, transform 0.25s ease; }
.ftr-link::after { content: ""; position: absolute; left: 0; bottom: -2px; width: 100%; height: 1px; background: var(--growth-amber); transform: scaleX(0); transform-origin: left; transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1); }
.ftr-link:hover { color: var(--white); transform: translateX(3px); }
.ftr-link:hover::after { transform: scaleX(1); }
.ftr-link:focus-visible { outline: 2px solid hsla(35, 85%, 53%, 0.6); outline-offset: 3px; border-radius: 2px; }
.ftr-news {
  position: relative; overflow: hidden; display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 1.5rem; padding: 1.75rem 2rem; border-radius: var(--radius);
  border: 1px solid hsla(0, 0%, 100%, 0.08);
  background: linear-gradient(180deg, hsla(0, 0%, 100%, 0.035), hsla(0, 0%, 100%, 0.012));
  box-shadow: inset 0 1px 0 hsla(0, 0%, 100%, 0.05), 0 18px 40px hsla(240, 26%, 4%, 0.4);
}
.ftr-news-glow { position: absolute; right: -40px; top: 50%; transform: translateY(-50%); width: 240px; height: 240px; border-radius: 50%; background: radial-gradient(circle, hsla(35, 85%, 53%, 0.12), transparent 65%); pointer-events: none; }
.ftr-news-text { position: relative; z-index: 1; }
.ftr-news-heading { font-family: var(--font-heading); font-size: 1.05rem; font-weight: 600; color: var(--white); margin: 0 0 0.3rem; letter-spacing: 0.01em; }
.ftr-news-copy { font-size: 0.85rem; line-height: 1.6; color: var(--silver); margin: 0; max-width: 46ch; }
.ftr-news-cta { position: relative; z-index: 1; padding: 0.7rem 1.7rem; font-size: 0.82rem; white-space: nowrap; flex-shrink: 0; }
.ftr-bottom { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem 1.5rem; margin-top: 3.5rem; padding-top: 2rem; border-top: 1px solid hsla(0, 0%, 100%, 0.06); }
.ftr-copy { font-size: 0.78rem; color: var(--slate); margin: 0; letter-spacing: 0.01em; }
.ftr-copy span { color: var(--silver); }
.ftr-legal { display: flex; flex-wrap: wrap; gap: 0.4rem 1.5rem; }
.ftr-legal-link { font-size: 0.78rem; color: var(--slate); transition: color 0.25s ease; }
.ftr-legal-link:hover { color: var(--growth-amber); }
.ftr-legal-link:focus-visible { outline: 2px solid hsla(35, 85%, 53%, 0.6); outline-offset: 3px; border-radius: 2px; }
@media (max-width: 900px) {
  .ftr-grid { grid-template-columns: 1fr; gap: 3rem; }
  .ftr-brand { max-width: none; }
}
@media (max-width: 768px) {
  .ftr { padding-top: 4rem; }
  .ftr-news { flex-direction: column; align-items: flex-start; padding: 1.5rem; }
  .ftr-news-cta { width: 100%; justify-content: center; }
}
@media (max-width: 560px) {
  .ftr-cols { grid-template-columns: repeat(2, 1fr); gap: 2rem 1.5rem; }
  .ftr-bottom { flex-direction: column; align-items: flex-start; }
}

/* ── Keyboard focus visibility (WCAG 2.4.7) ──────────────────────── */
/* Loaded after style.css so these win where it sets outline:none. */
.nav-links a:focus-visible,
.nav-dropdown a:focus-visible,
.nav-blog-dropdown a:focus-visible {
  outline: 2px solid hsla(35, 85%, 53%, 0.85);
  outline-offset: 4px;
  border-radius: 2px;
}
.nav-toggle:focus-visible {
  outline: 2px solid var(--white);
  outline-offset: 3px;
  border-radius: 3px;
}
.faq-q:focus-visible {
  outline: 2px solid hsla(35, 85%, 53%, 0.85);
  outline-offset: -2px;
  border-radius: 6px;
}
.btn-amber:focus-visible {
  outline: 2px solid var(--white);
  outline-offset: 3px;
}
.btn-outline:focus-visible {
  outline: 2px solid hsla(35, 85%, 53%, 0.85);
  outline-offset: 3px;
}
.contact-form input:focus-visible,
.contact-form textarea:focus-visible,
.contact-form select:focus-visible {
  outline: 2px solid hsla(35, 85%, 53%, 0.85);
  outline-offset: 2px;
}
.nl-popup-close:focus-visible {
  outline: 2px solid hsla(35, 85%, 53%, 0.85);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ── Reduced motion ──────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
  .has-parallax { transform: none !important; }
  .scroll-progress { display: none; }
  .tilt, .hero-right { transform: none !important; transition: none !important; }
  .tilt::after { display: none; }
}

/* ════════════════════════════════════════════════════════════════════
   MOBILE FIXES — audited at 375px (overflow / overlap / off-centre)
   ════════════════════════════════════════════════════════════════════ */
@media (max-width: 600px) {
  /* Hero */
  .hero { padding: 6rem 0 4rem; }
  .hero h1 { font-size: clamp(2rem, 9vw, 2.8rem); line-height: 1.15; word-break: break-word; overflow-wrap: anywhere; }
  .hero-ai-line, .hero-species { max-width: 100%; }
  .nav-links.mob-open .btn-amber { display: flex; justify-content: center; width: 100%; }

  /* Problem — collapse nested stat grid, tame figures */
  .problem-stats { grid-template-columns: 1fr; gap: 1rem; padding: 1.25rem !important; }
  .pstat { padding: 1.25rem; }
  .pstat-val { font-size: 1.6rem; overflow-wrap: anywhere; }
  .pstat-text { font-size: 0.8rem; }
  .problem-text { padding-left: 1rem !important; }
  .problem-text h3 { font-size: 1.3rem; }

  /* Edge / Replace */
  .ecard { padding: 1.75rem 1.35rem; }
  #replace [style*="grid-template-columns:repeat(3"] > div { padding: 1.25rem !important; }
  .cmp-wrap { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .loss-total-box { padding: 1.5rem 1.25rem; gap: 1.25rem; }
  .loss-box-left, .loss-box-right { min-width: 0; flex: 1 1 100%; text-align: left; }
  .loss-box-val, .recov-box-val { overflow-wrap: anywhere; word-break: break-word; }
  #replace .btn-amber.shimmer { font-size: 1rem !important; padding: 0.95rem 1.5rem !important; display: inline-block; max-width: 100%; }

  /* Metrics watermark — was 18vw + nowrap → overflowed + overlapped title/cards */
  .metrics { overflow: hidden; }
  .metrics-bg { font-size: 13vw; max-width: 100%; opacity: 0.5; }

  /* Deep dive — long label/value collisions + fixed track */
  .tabs-nav { padding: 0.4rem; gap: 0.3rem; }
  .tab-btn { padding: 0.7rem 1rem; font-size: 0.78rem; gap: 0.45rem; }
  .svc-visual { padding: 1.25rem; }
  .sv-row { gap: 0.75rem; align-items: baseline; font-size: 0.78rem; }
  .sv-lbl { min-width: 0; overflow-wrap: anywhere; line-height: 1.35; }
  .sv-val { white-space: nowrap; flex-shrink: 0; }
  .sv-bar-track { width: 72px; flex-shrink: 0; }
  .sv-chrome .sv-title { overflow-wrap: anywhere; }
  #tab-listing .svc-visual > div[style*="justify-content:center"] { gap: 0.75rem !important; }

  /* Creative intelligence — stack flow, fix orphaned arrows */
  .ci-flow { gap: 0.6rem; }
  .ci-flow-arrow { transform: rotate(90deg); font-size: 1rem; }
  .ci-flow-step { width: 100%; max-width: 280px; justify-content: center; }
  .ci-card { padding: 1.5rem; }

  /* Pricing */
  .prcard { padding: 1.5rem; }
  .prcard-target, .prcard-list li { overflow-wrap: anywhere; }

  /* Final CTA — inline-padded button crowded the edge */
  .final-cta { padding: 5rem 0; }
  .final-actions { flex-direction: column; align-items: stretch; }
  .final-actions .btn-amber, .final-actions .btn-outline { width: 100%; text-align: center; padding: 0.95rem 1.25rem !important; font-size: 1rem !important; }
  .final-cta-glow { width: 360px; height: 360px; }

  /* Footer */
  .ftr-news-copy { max-width: 100%; }
}

@media (max-width: 480px) {
  .process-steps { grid-template-columns: 1fr; gap: 1.75rem; }
  .pstep { padding: 0 0.5rem; }
  .mcard { padding: 1.5rem 1.25rem; }
  .mcard-abbr { font-size: 2.1rem; word-break: break-word; }
  .pcard, .pcard-wide, .mini-metrics, .counter-row { max-width: 100%; }
  .pcard-desc, .ctx-text, .mm-label, .counter-label { overflow-wrap: anywhere; }
}

@media (max-width: 380px) {
  .ftr-cols { grid-template-columns: 1fr; gap: 1.5rem; }
}

/* Accessibility: skip-to-content link (visible only on keyboard focus) */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 10000;
  background: var(--growth-amber);
  color: var(--trust-navy);
  padding: 0.7rem 1.2rem;
  font-weight: 700;
  border-radius: 0 0 8px 0;
  text-decoration: none;
}
.skip-link:focus {
  left: 0;
}
