/* ═══════════════════════════════════════════════════════════════
   DE-ACT — the shared scroll-pinned act chassis (marketing + sales)
   ═══════════════════════════════════════════════════════════════
   One class system for the act component on every deep-dive page, so
   the act becomes a single component when the site moves into the CMS.

   Load order: style.css → de-act.css → <page>.css
   Page CSS owns ONLY page-unique stage content (.m-roster, .s-browser…)
   and page overrides hung off page marker classes (.s-act--team …).

   Anatomy (see CLAUDE.md "Page architecture" for the full skeleton):
     section.de-act.de-act--<scenes>.de-act--<good|bad> [data-act] [data-act-intro] [data-phase]
       └ .de-act-inner                  sticky 100vh pin
           ├ .de-act-watermark(--good/--bad)   top pill (pair = phase crossfade)
           ├ .de-act-head                intro scene 0 → docks on .is-engaged
           │   ├ .de-act-tag(--good/--bad)
           │   └ .de-act-headline (+ -faded / -accent spans)
           ├ .de-act-copy > .de-act-lines > .de-act-line (one per beat, <b> accent)
           └ .de-act-stage > .de-act-stage-sticky > .de-beat (one per beat)

   Scene math: scenes = beats + 1 (intro). Desktop 80vh/scene,
   mobile 115vh/scene — set via .de-act--4/--5/--6/--7.
   Phase: [data-phase="bad|good"] recolors line accents + headline accent
   and crossfades a --bad/--good watermark pair. Sales sets it statically
   per act; marketing's JS rewrites it per beat (red→green couplets).
   ─────────────────────────────────────────────────────────────── */

:root {
  --de-good: #4ade80;
  --de-good-dim: rgba(74, 222, 128, 0.12);
  --de-bad: #ee3a39;
  --de-bad-dim: rgba(238, 58, 57, 0.12);
  --de-line: rgba(255, 255, 255, 0.08);
  --de-line-strong: rgba(255, 255, 255, 0.16);
  --de-mid: rgba(255, 255, 255, 0.75);
  --de-dim: rgba(255, 255, 255, 0.45);
  --de-mono: 'JetBrains Mono', 'SF Mono', Menlo, monospace;
}

/* ─── act section ─── */
.de-act {
  position: relative;
  background: #000;
}

/* scene-count heights — desktop scenes are 80vh each */
.de-act--4 { height: 320vh; }
.de-act--5 { height: 400vh; }
.de-act--6 { height: 480vh; }
.de-act--7 { height: 560vh; }

/* phase background tints */
.de-act--bad {
  background: linear-gradient(180deg, #000 0%, #0a0606 50%, #000 100%);
}
.de-act--good {
  background: linear-gradient(180deg, #000 0%, #060a08 50%, #000 100%);
}

/* ─── sticky pin ─── */
.de-act-inner {
  position: sticky;
  top: 0;
  height: 100vh;
  display: grid;
  grid-template-columns: minmax(300px, 0.92fr) minmax(0, 1.18fr);
  grid-template-rows: auto 1fr;
  gap: 26px 64px;
  align-items: center;
  align-content: center;
  max-width: 1480px;
  margin: 0 auto;
  padding: calc(var(--nav-height, 72px) + 52px) 64px 52px;
  box-sizing: border-box;
}

/* ─── watermark pill ─── */
.de-act-watermark {
  position: absolute;
  top: calc(var(--nav-height, 72px) + 10px);
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--de-mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.28em;
  color: rgba(255, 140, 138, 0.92);
  text-transform: uppercase;
  z-index: 10;
  padding: 8px 18px;
  border: 1px solid rgba(238, 58, 57, 0.48);
  border-radius: 100px;
  background: rgba(238, 58, 57, 0.14);
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  white-space: nowrap;
  pointer-events: none;
  transition: opacity 0.45s ease;
}
.de-act-watermark--good {
  color: rgba(130, 255, 175, 0.95);
  border-color: rgba(74, 222, 128, 0.5);
  background: rgba(74, 222, 128, 0.12);
}
/* phase crossfade — acts with a --bad/--good watermark pair show one at a time */
.de-act[data-phase="good"] .de-act-watermark--bad,
.de-act[data-phase="bad"] .de-act-watermark--good {
  opacity: 0;
  pointer-events: none;
}

/* ─── scene head (tag + headline) ─── */
.de-act-head {
  grid-column: 1 / -1;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  width: 100%;
  transition: transform 0.55s cubic-bezier(0.4, 0, 0.2, 1);
  transform-origin: left bottom;
}

.de-act-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  font-family: var(--de-mono);
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  padding: 6px 14px;
  border-radius: 100px;
}
.de-act-tag--bad {
  color: var(--de-bad);
  background: var(--de-bad-dim);
  border: 1px solid rgba(238, 58, 57, 0.3);
}
.de-act-tag--good {
  color: var(--de-good);
  background: var(--de-good-dim);
  border: 1px solid rgba(74, 222, 128, 0.3);
}

.de-act-headline {
  font-size: clamp(2rem, 4vw, 3.65rem);
  font-weight: 850;
  line-height: 1.02;
  letter-spacing: -0.04em;
  color: #fff;
  margin: 0;
  width: 100%;
  max-width: 1100px;
  text-wrap: balance;
}
.de-act-headline-faded {
  color: var(--de-dim);
}
.de-act-headline-accent {
  color: var(--de-bad);
}
.de-act[data-phase="good"] .de-act-headline-accent {
  color: var(--de-good);
}

/* ─── intro scene (data-act-intro): the headline owns scene 0 at display
   size, then shrinks to a muted docked label once .is-engaged ─── */
.de-act[data-act-intro] .de-act-headline {
  transition: font-size 0.55s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.45s ease;
}
.de-act[data-act-intro] .de-act-tag {
  transition: opacity 0.45s ease;
}
.de-act[data-act-intro] .de-act-copy,
.de-act[data-act-intro] .de-act-stage {
  transition: opacity 0.5s ease;
}
.de-act[data-act-intro]:not(.is-engaged) .de-act-headline {
  font-size: clamp(2.7rem, 5.6vw, 5rem);
  line-height: 1.04;
}
.de-act[data-act-intro]:not(.is-engaged) .de-act-copy,
.de-act[data-act-intro]:not(.is-engaged) .de-act-stage {
  opacity: 0;
  pointer-events: none;
}
.de-act[data-act-intro]:not(.is-engaged) .de-act-watermark {
  opacity: 0;
}
.de-act[data-act-intro].is-engaged .de-act-headline {
  font-size: clamp(1.15rem, 1.7vw, 1.6rem);
  opacity: 0.5;
}
.de-act[data-act-intro].is-engaged .de-act-tag {
  opacity: 0.7;
}

/* ─── copy column: one big morphing line per beat ─── */
.de-act-copy {
  position: relative;
  grid-column: 1;
  grid-row: 2;
  align-self: center;
  width: 100%;
  max-width: 34rem;
  min-width: 0;
}

.de-act-lines {
  position: relative;
  display: grid;
}
.de-act-line {
  grid-area: 1 / 1;
  margin: 0;
  font-size: clamp(1.6rem, 3vw, 2.85rem);
  line-height: 1.18;
  font-weight: 750;
  letter-spacing: -0.02em;
  color: #fff;
  opacity: 0;
  visibility: hidden;
  transform: translateY(22px);
  transition: opacity 0.5s ease, transform 0.55s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.5s;
}
.de-act-line.is-active {
  opacity: 1;
  visibility: visible;
  transform: none;
}
.de-act-line b {
  color: var(--de-good);
  font-weight: 800;
}
.de-act[data-phase="bad"] .de-act-line b {
  color: var(--de-bad);
}

/* ─── stage column ─── */
.de-act-stage {
  position: relative;
  grid-column: 2;
  grid-row: 2;
  align-self: center;
  width: 100%;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.35s ease;
}
/* the controller adds .is-locked while the act is pinned fullscreen */
.de-act.is-locked .de-act-stage {
  opacity: 1;
}

.de-act-stage-sticky {
  position: relative;
  width: 100%;
  height: min(62vh, 600px);
  min-height: 430px;
  max-height: 600px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ─── stage beats ─── */
.de-beat {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  opacity: 0;
  transform: scale(0.96) translateY(20px);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
}
.de-beat.is-active {
  opacity: 1;
  transform: scale(var(--de-beat-fit-scale, 1)) translateY(0);
  pointer-events: auto;
}

/* generic per-step reveal inside a beat (JS adds .is-in) */
.de-beat [data-step] {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.55s ease, transform 0.55s ease, border-color 0.55s ease, background 0.55s ease;
}
.de-beat [data-step].is-in {
  opacity: 1;
  transform: translateY(0);
}

/* ─── beat caption pill ─── */
.de-beat-cap {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: 100%;
  font-family: var(--de-mono);
  font-size: 0.74rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--de-mid);
  padding: 8px 14px;
  border: 1px solid var(--de-line-strong);
  border-radius: 100px;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
}
.de-beat-cap i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--de-good);
  box-shadow: 0 0 12px var(--de-good);
  flex: 0 0 auto;
}
.de-beat-cap--bad {
  color: #fff;
  border-color: rgba(238, 58, 57, 0.4);
  background: rgba(238, 58, 57, 0.08);
}
.de-beat-cap--bad i {
  background: var(--de-bad);
  box-shadow: 0 0 12px var(--de-bad);
}
.de-beat-cap--good {
  color: #fff;
  border-color: rgba(74, 222, 128, 0.4);
  background: rgba(74, 222, 128, 0.08);
}
/* enlarged "takeaway" caption — the line that should land hardest */
.de-beat-cap--takeaway {
  font-size: clamp(1.05rem, 1.9vw, 1.55rem);
  padding: 14px 26px;
  gap: 14px;
  letter-spacing: 0.04em;
  margin-top: 6px;
}
.de-beat-cap--takeaway i {
  width: 12px;
  height: 12px;
}
@media (max-width: 700px) {
  .de-beat-cap--takeaway {
    font-size: clamp(0.92rem, 4.4vw, 1.2rem);
    padding: 12px 16px;
    letter-spacing: 0.03em;
  }
}

/* ═══ mobile ≤1100px — scenes are 115vh each, single column inside the pin ═══ */
@media (max-width: 1100px) {
  .de-act--4 { height: 460vh; }
  .de-act--5 { height: 575vh; }
  .de-act--6 { height: 690vh; }
  .de-act--7 { height: 805vh; }

  .de-act-inner {
    position: sticky;
    top: 0;
    height: 100svh;
    min-height: 100svh;
    overflow: hidden;
    grid-template-columns: 1fr;
    grid-template-rows: auto max-content minmax(0, 1fr);
    gap: 6px;
    padding: calc(var(--nav-height, 72px) + 24px + env(safe-area-inset-top, 0px)) 16px calc(18px + env(safe-area-inset-bottom, 0px));
    align-content: start;
    box-sizing: border-box;
  }
  @supports (height: 100dvh) {
    .de-act-inner {
      height: 100dvh;
      min-height: 100dvh;
    }
  }

  .de-act-watermark {
    display: none;
  }

  .de-act-head {
    grid-column: 1;
    grid-row: 1;
    align-self: start;
    max-width: none;
    gap: 8px;
    flex-shrink: 0;
  }
  .de-act-tag {
    font-size: 0.58rem;
    padding: 6px 11px;
  }
  .de-act-headline {
    font-size: clamp(1.6rem, 4.8vw, 2.15rem);
    line-height: 1.08;
  }
  .de-act[data-act-intro]:not(.is-engaged) .de-act-headline {
    font-size: clamp(1.9rem, 8vw, 2.9rem);
    line-height: 1.04;
  }
  .de-act[data-act-intro].is-engaged .de-act-headline {
    font-size: clamp(0.92rem, 3.6vw, 1.08rem);
    opacity: 0.5;
  }

  .de-act-copy {
    grid-column: 1;
    grid-row: 2;
    max-width: none;
    align-self: start;
    min-height: 0;
    overflow: visible;
    flex-shrink: 0;
  }
  .de-act-line {
    font-size: clamp(1.25rem, 5.2vw, 1.7rem);
    line-height: 1.22;
  }

  .de-act-stage {
    grid-column: 1;
    grid-row: 3;
    align-self: stretch;
    min-height: 0;
    flex-shrink: 0;
    display: flex;
    align-items: flex-start;
    align-content: flex-start;
    overflow: clip;
  }
  .de-act-stage-sticky {
    position: relative;
    top: 0;
    width: 100%;
    height: 100%;
    min-height: 0;
    max-height: none;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    overflow: clip;
  }

  .de-beat {
    justify-content: flex-start;
    align-items: center;
    overflow: hidden;
    gap: 12px;
    padding-top: 2px;
    transform-origin: top center;
  }
  .de-beat > * {
    flex-shrink: 0;
  }

  .de-beat-cap {
    width: 100%;
    justify-content: flex-start;
    white-space: normal;
    border-radius: 14px;
    font-size: 0.62rem;
    letter-spacing: 0.13em;
    padding: 9px 12px;
  }
}

/* ═══════════════════════════════════════════════════════════════
   DE SHARED STATIC SECTIONS — includes checklist + before/after table
   ═══════════════════════════════════════════════════════════════
   Two more deep-dive components shared by marketing + sales (same
   CMS-componentization goal as the act chassis above). Both are
   static data-fade sections — DE.initFade adds .is-visible, which
   drives the per-item stagger via the --i custom property.

   .de-includes  3-column "everything included" checklist
   .de-compare   row-per-offering table: label | red cell | green cell.
                 Mobile column labels come from --de-compare-label-old /
                 --de-compare-label-new (string custom properties set
                 inline on the section; defaults match marketing).
   ─────────────────────────────────────────────────────────────── */

.de-section-label {
  display: inline-flex;
  color: var(--de-good);
  font-family: var(--de-mono);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  margin-bottom: 18px;
}

/* ── "Everything included" checklist ── */
.de-includes {
  padding: 90px 0;
  border-top: 1px solid var(--de-line);
  background: linear-gradient(180deg, #000, #05080a);
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.de-includes.is-visible { opacity: 1; transform: none; }

.de-includes-inner { max-width: 1100px; margin: 0 auto; padding: 0 32px; }

.de-includes-head { text-align: center; margin-bottom: 44px; }

.de-includes-head h2 {
  margin: 12px 0 0;
  font-size: clamp(1.8rem, 3.4vw, 2.8rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.05;
}

.de-includes-head h2 span { color: var(--de-good); }

.de-includes-head p {
  margin: 14px auto 0;
  max-width: 560px;
  color: var(--de-mid);
  line-height: 1.5;
}

.de-includes-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.de-includes-col {
  border: 1px solid var(--de-line-strong);
  border-radius: 16px;
  padding: 22px;
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.015));
}

.de-includes-pillar {
  color: var(--de-good);
  font: 700 0.66rem/1 var(--de-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--de-line);
}

.de-includes-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 11px;
}

.de-includes-col li {
  position: relative;
  padding-left: 28px;
  color: #fff;
  font-size: 0.92rem;
  line-height: 1.3;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.de-includes.is-visible .de-includes-col li {
  opacity: 1;
  transform: none;
  transition-delay: calc(var(--i, 0) * 55ms);
}

.de-includes-col li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 1px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(74,222,128,0.14);
  border: 1px solid rgba(74,222,128,0.5);
}

.de-includes-col li::after {
  content: '';
  position: absolute;
  left: 6px;
  top: 4px;
  width: 5px;
  height: 9px;
  border-right: 2px solid var(--de-good);
  border-bottom: 2px solid var(--de-good);
  transform: rotate(45deg);
}

@media (max-width: 880px) {
  .de-includes { padding: 64px 0; }
  .de-includes-inner { padding: 0 20px; }
  .de-includes-grid { grid-template-columns: 1fr; gap: 14px; }
  .de-includes-head { margin-bottom: 32px; }
}

/* ── Before/after comparison table ── */
.de-compare {
  padding: 90px 0;
  border-top: 1px solid var(--de-line);
  background: linear-gradient(180deg, #05080a, #000);
  --de-compare-label-old: 'THE COMPETITION';
  --de-compare-label-new: 'DEALEREDGE';
}

.de-compare-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 32px;
}

.de-compare-head {
  text-align: center;
  margin-bottom: 44px;
}

.de-compare-head h2 {
  margin: 12px 0 0;
  font-size: clamp(1.8rem, 3.4vw, 2.8rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.05;
}

.de-compare-head h2 span { color: var(--de-good); }

.de-compare-head p {
  margin: 14px auto 0;
  max-width: 560px;
  color: var(--de-mid);
  line-height: 1.5;
}

/* grid: label column narrower, two equal copy columns; 1px gap over a
   --de-line background renders hairline gridlines without a <table> */
.de-compare-grid {
  display: grid;
  grid-template-columns: 0.8fr 1.1fr 1.1fr;
  gap: 1px;
  border: 1px solid var(--de-line-strong);
  border-radius: 16px;
  overflow: hidden;
  background: var(--de-line);
}

.de-compare-cell {
  padding: 18px 22px;
  background: #05080a;
  font-size: 0.92rem;
  line-height: 1.35;
  color: var(--de-mid);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.de-compare.is-visible .de-compare-cell {
  opacity: 1;
  transform: none;
  transition-delay: calc(var(--i, 0) * 45ms);
}

/* header row — always visible, no stagger */
.de-compare-cell--head {
  background: #0a0e10;
  font: 700 0.66rem/1 var(--de-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--de-dim);
  opacity: 1;
  transform: none;
}

.de-compare-cell--head.de-compare-col-old { color: var(--de-bad); }
.de-compare-cell--head.de-compare-col-new { color: var(--de-good); }

.de-compare-service b {
  color: #fff;
  font-weight: 700;
}

/* old-way cell: red accent + faint tint */
.de-compare-old {
  border-left: 2px solid var(--de-bad);
  background: linear-gradient(180deg, var(--de-bad-dim), rgba(238, 58, 57, 0.04));
  color: rgba(255, 255, 255, 0.78);
}

/* DealerEdge cell: green accent + faint tint */
.de-compare-new {
  border-left: 2px solid var(--de-good);
  background: linear-gradient(180deg, var(--de-good-dim), rgba(74, 222, 128, 0.04));
  color: #fff;
}

.de-compare-new:hover {
  background: linear-gradient(180deg, rgba(74, 222, 128, 0.18), rgba(74, 222, 128, 0.06));
}

/* mobile: cells are in source order (label → old → new), so a 1-column
   grid stacks each offering into a card; header row hides, ::before labels
   take over the column naming */
@media (max-width: 880px) {
  .de-compare { padding: 64px 0; }
  .de-compare-inner { padding: 0 20px; }
  .de-compare-head { margin-bottom: 32px; }

  .de-compare-cell--head { display: none; }

  .de-compare-grid {
    grid-template-columns: 1fr;
    gap: 0;
    background: transparent;
    border: none;
    border-radius: 0;
    overflow: visible;
  }

  .de-compare-service {
    margin-top: 14px;
    padding: 14px 16px 8px;
    border: 1px solid var(--de-line-strong);
    border-bottom: none;
    border-radius: 14px 14px 0 0;
    background: #0a0e10;
  }

  /* first card (directly after the hidden header row) loses the gap */
  .de-compare-cell--head + .de-compare-service { margin-top: 0; }

  .de-compare-service b { font-size: 1rem; }

  .de-compare-old,
  .de-compare-new {
    padding: 12px 16px;
    border: 1px solid var(--de-line-strong);
    border-top: none;
  }

  .de-compare-old { border-left: 2px solid var(--de-bad); }

  .de-compare-new {
    border-radius: 0 0 14px 14px;
    border-left: 2px solid var(--de-good);
  }

  .de-compare-old::before {
    content: var(--de-compare-label-old);
    display: block;
    font: 700 0.6rem/1 var(--de-mono);
    letter-spacing: 0.14em;
    color: var(--de-bad);
    margin-bottom: 6px;
  }

  .de-compare-new::before {
    content: var(--de-compare-label-new);
    display: block;
    font: 700 0.6rem/1 var(--de-mono);
    letter-spacing: 0.14em;
    color: var(--de-good);
    margin-bottom: 6px;
  }
}
