/* ── Apex Scanner — landing page (loads after public-site.css) ─────────────
   Landing-only layout/motion styles (ld-*). Shared components (tokens, buttons,
   .shot-frame, .pricing-grid, pricing-card) live in public-site.css.
   PUBLIC_SITE_REDESIGN_PLAN.md §5; copy owned by the compliance spec §2. */

.ld-main { display: block; }

/* The landing sections own their horizontal rhythm (full-bleed bands + an inner column). */
.ld-hero__inner,
.ld-proof__inner,
.ld-tour,
.ld-loop__inner,
.ld-pricing,
.ld-faq__inner,
.ld-final__inner {
  width: min(100% - 48px, 1180px);
  margin-inline: auto;
}

/* ── 1 · Hero ─────────────────────────────────────────────────────────────── */

.ld-hero {
  position: relative;
  overflow: hidden;
  padding: 84px 0 72px;
}
.ld-hero__glow {
  position: absolute;
  inset: -40% -20% auto;
  height: 130%;
  background:
    radial-gradient(46% 60% at 28% 38%, rgba(47, 92, 255, 0.22), transparent 70%),
    radial-gradient(38% 52% at 78% 30%, rgba(56, 166, 255, 0.14), transparent 70%);
  pointer-events: none;
}
.ld-hero__grid {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(120, 160, 220, 0.13) 1px, transparent 1px);
  background-size: 26px 26px;
  -webkit-mask-image: radial-gradient(70% 70% at 40% 40%, rgba(0, 0, 0, 0.8), transparent 75%);
  mask-image: radial-gradient(70% 70% at 40% 40%, rgba(0, 0, 0, 0.8), transparent 75%);
  pointer-events: none;
}
.ld-hero__inner {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 6fr);
  gap: 48px;
  align-items: center;
}
.ld-hero__copy h1 {
  margin: 14px 0 0;
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 5.4vw, 4.4rem);
  line-height: 1.06;
  letter-spacing: -0.02em;
}
.ld-hero__sub {
  margin: 18px 0 0;
  max-width: 34rem;
  font-size: 1.13rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.78);
}
.ld-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  margin-top: 28px;
}
.ld-hero__cta { font-size: 1.02rem; padding: 13px 26px; }
.ld-hero__micro {
  margin-top: 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.55);
}

/* Hero visual: two depth-staggered framed screenshots (static poster — the
   Phase 3 canvas upgrades this; the markup stays the no-JS fallback). */
.ld-hero__visual {
  position: relative;
  min-height: 360px;
}
.ld-hero__visual .shot-frame { position: absolute; width: 86%; }
.shot-frame--back {
  top: 0;
  right: 0;
  transform: rotate(2.2deg);
  opacity: 0.88;
}
.shot-frame--front {
  bottom: 0;
  left: 0;
  transform: rotate(-1.6deg);
  box-shadow: 0 32px 80px rgba(2, 8, 18, 0.7);
}

/* Phase 3 canvas upgrade (poster-first): the canvas sits behind the hero copy,
   never interactive; the scrim keeps H1/sub at ≥4.5:1 in every scene state. The
   DOM poster fades once the scene confirms live (spec §6 acceptance). */
.ld-hero__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.9s ease;
}
.ld-hero__canvas.is-live { opacity: 1; }
.ld-hero__scrim {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(70% 85% at 26% 45%, rgba(6, 11, 18, 0.82), rgba(6, 11, 18, 0.28) 60%, transparent 85%);
}
.ld-hero__visual { transition: opacity 0.9s ease; }
.ld-hero__visual.is-upgraded { opacity: 0; }

/* Sphere scene: drag to look around. pan-y keeps vertical page scroll working on
   touch; the grab cursor advertises the interaction without stealing clicks. */
.ld-hero--sphere { cursor: grab; touch-action: pan-y; }
.ld-hero--sphere.is-dragging { cursor: grabbing; user-select: none; }
.ld-hero--sphere a, .ld-hero--sphere button { cursor: pointer; }

/* ── 2 · Proof strip ──────────────────────────────────────────────────────── */

.ld-proof {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(10, 18, 32, 0.55);
  padding: 34px 0;
}
.ld-proof__stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 22px;
  margin: 0;
}
.ld-stat { display: flex; flex-direction: column-reverse; gap: 6px; }
.ld-stat__value {
  margin: 0;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: clamp(1.6rem, 2.6vw, 2.2rem);
  font-weight: 700;
  color: var(--mint);
}
.ld-stat__label {
  font-size: 0.92rem;
  color: rgba(255, 255, 255, 0.62);
}
.ld-proof__cred {
  margin-top: 22px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
}

/* ── 3 · Product tour ─────────────────────────────────────────────────────── */

.ld-tour { padding: 86px 0 30px; }
.ld-tour-block {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 52px;
  align-items: center;
  padding: 44px 0;
}
.ld-tour-block--flip .ld-tour-block__media { order: 2; }
.ld-tour-block--flip .ld-tour-block__copy { order: 1; }
.ld-tour-block__copy h2 {
  margin: 12px 0 0;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  line-height: 1.12;
  letter-spacing: -0.015em;
}
.ld-tour-block__copy > p {
  margin: 14px 0 0;
  color: rgba(255, 255, 255, 0.76);
  line-height: 1.6;
}
.ld-tour-block__bullets {
  margin: 18px 0 22px;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}
.ld-tour-block__bullets li {
  position: relative;
  padding-left: 22px;
  color: rgba(255, 255, 255, 0.82);
}
.ld-tour-block__bullets li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.52em;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--mint);
}
.ld-tour-block__note {
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.03em;
}
.ld-tour-block__note a { color: rgba(255, 255, 255, 0.5); }

/* ── 4 · Loop band ────────────────────────────────────────────────────────── */

.ld-loop {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(10, 18, 32, 0.55);
  padding: 64px 0;
  text-align: center;
}
.ld-loop__inner h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 3.4vw, 2.8rem);
  letter-spacing: -0.015em;
}
.ld-loop__inner > p {
  max-width: 44rem;
  margin: 14px auto 0;
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.6;
}
.ld-loop__diagram { position: relative; margin-top: 44px; }
/* The 4 steps are grid-centered in equal columns, so the outer dot centers sit
   at 12.5% and 87.5% — the rail must span exactly dot-to-dot or it overshoots.
   top aligns the stroke (center = top + 4px) with the 19px dot's center (9.5px). */
.ld-loop__line {
  position: absolute;
  top: 3.5px;
  left: 12.5%;
  width: 75%;
  height: 8px;
}
.ld-loop__line line { stroke: var(--blue); opacity: 0.65; }
.ld-loop__steps {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: none;
}
.ld-loop__step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
}
.ld-loop__dot {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--panel-strong);
  border: 2px solid var(--blue);
}
.ld-loop__step--repeat .ld-loop__dot { border-color: var(--mint); }
.ld-loop__step--repeat { color: var(--mint); }

/* ── 6.5 · Full-workbook band (the closing visual argument) ───────────────── */

.ld-desk {
  border-top: 1px solid var(--line);
  padding: 72px 0 28px;
  text-align: center;
}
.ld-desk__inner { width: min(100% - 48px, 1180px); margin-inline: auto; }
.ld-desk__inner h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 3.4vw, 2.8rem);
  letter-spacing: -0.015em;
}
.ld-desk__inner > p {
  max-width: 46rem;
  margin: 14px auto 0;
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.6;
}
.ld-desk__shot { margin: 34px 0 0; }
.ld-desk__shot .shot-frame img { width: 100%; height: auto; display: block; }

/* ── 5 · Pricing ──────────────────────────────────────────────────────────── */

.ld-pricing { padding: 86px 0 40px; }
.ld-pricing__head { max-width: 46rem; }
.ld-pricing__head h2 {
  margin: 12px 0 0;
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 3.4vw, 2.8rem);
  letter-spacing: -0.015em;
}
.ld-pricing__head p { margin: 12px 0 0; color: rgba(255, 255, 255, 0.72); }
.ld-pricing__grid {
  display: grid;
  /* auto-fit: the card count varies with the replay pricing switch (5 with Pro+, 4
     without) — every visible card gets an equal column, no orphan gap either way. */
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 16px;
  /* default (stretch) row alignment — every card in a row gets the same height */
  margin-top: 30px;
}
.ld-pricing__more { margin-top: 20px; }

/* ── 6 · FAQ ──────────────────────────────────────────────────────────────── */

.ld-faq { padding: 56px 0 30px; }
.ld-faq__inner h2 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  letter-spacing: -0.015em;
  margin: 0 0 22px;
}
.ld-faq__list { display: grid; gap: 10px; max-width: 52rem; }
.ld-faq__item {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  padding: 0 18px;
}
.ld-faq__item summary {
  cursor: pointer;
  padding: 15px 0;
  font-weight: 600;
  list-style: none;
  position: relative;
  padding-right: 30px;
}
.ld-faq__item summary::-webkit-details-marker { display: none; }
.ld-faq__item summary::after {
  content: '+';
  position: absolute;
  right: 2px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-mono);
  font-size: 1.1rem;
  color: var(--blue);
}
.ld-faq__item[open] summary::after { content: '−'; }
.ld-faq__item summary:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 6px; }
.ld-faq__item p {
  margin: 0;
  padding: 0 0 16px;
  color: rgba(255, 255, 255, 0.74);
  line-height: 1.6;
}
.ld-faq__item p a { color: var(--blue); }

/* ── 7 · Final CTA band ───────────────────────────────────────────────────── */

.ld-final {
  position: relative;
  overflow: hidden;
  border-top: 1px solid var(--line);
  padding: 84px 0 90px;
  text-align: center;
}
.ld-final__glow {
  position: absolute;
  inset: auto -20% -60%;
  height: 150%;
  background: radial-gradient(50% 55% at 50% 80%, rgba(47, 92, 255, 0.26), transparent 72%);
  pointer-events: none;
}
.ld-final__inner { position: relative; }
.ld-final__inner h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3.2rem);
  letter-spacing: -0.018em;
}
.ld-final__inner p {
  margin: 14px 0 26px;
  color: rgba(255, 255, 255, 0.74);
  font-size: 1.08rem;
}
.ld-final .ld-hero__micro { margin-top: 14px; }

/* ── Motion (JS adds .ld-will-reveal before animating; no-JS never hides) ── */

.ld-will-reveal { opacity: 0; transform: translateY(24px); }
@media (prefers-reduced-motion: reduce) {
  .ld-will-reveal { opacity: 1; transform: none; }
}

/* ── Responsive ───────────────────────────────────────────────────────────── */

@media (max-width: 1100px) {
  .ld-pricing__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 960px) {
  .ld-hero { padding: 56px 0 48px; }
  .ld-hero__inner { grid-template-columns: 1fr; gap: 40px; }
  /* container height comes from aspect (frames are absolutely positioned) */
  .ld-hero__visual { min-height: 0; padding-bottom: 80%; }
  .ld-tour-block { grid-template-columns: 1fr; gap: 26px; padding: 32px 0; }
  /* mobile stacks image-first (plan §5) */
  .ld-tour-block--flip .ld-tour-block__media { order: 0; }
  .ld-tour-block--flip .ld-tour-block__copy { order: 1; }
  .ld-proof__stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .ld-hero__inner,
  .ld-proof__inner,
  .ld-tour,
  .ld-loop__inner,
  .ld-pricing,
  .ld-faq__inner,
  .ld-final__inner { width: min(100% - 24px, 1180px); }
  .ld-loop__steps { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
  .ld-loop__line { display: none; }
  .ld-pricing__grid { grid-template-columns: 1fr; }
}
