/* ============================================================
   CrewCompliance — Homepage
   Requires theme.css loaded first for design tokens + base.
   Homepage-specific body override + all homepage layout rules.
   ============================================================ */

/* Homepage body needs overflow-x: clip for sticky nav support.
   `clip` not `hidden` — `hidden` creates a scroll container which
   kills `position: sticky` for descendants (the nav). */
body {
  overflow-x: clip;
  overflow-wrap: anywhere;
}

/* ============================================================
   NAV
   ============================================================ */
.nav {
  position: sticky;
  position: -webkit-sticky;
  top: 0;
  z-index: 100;
  will-change: transform;
  padding: 14px var(--pad-x);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}
.nav-inner {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  padding: 10px 14px 10px 18px;
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: 999px;
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  letter-spacing: -0.01em;
  font-size: 15px;
}
.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: linear-gradient(180deg, #1E3354 0%, #0F2035 100%);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
  font-weight: 800;
  font-size: 12.5px;
  letter-spacing: -0.04em;
  color: var(--primary);
  box-shadow: 0 4px 14px -4px rgba(245, 124, 0, 0.5),
              inset 0 1px 0 rgba(255,255,255,.10),
              inset 0 -2px 4px rgba(0,0,0,.35),
              0 0 0 0.5px rgba(245, 124, 0, 0.25);
}
.nav-links {
  display: flex;
  gap: 4px;
}
.nav-links a {
  padding: 8px 14px;
  border-radius: 999px;
  white-space: nowrap;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--fg-1);
  transition: color .15s, background .15s;
}
.nav-links a:hover { color: var(--fg-0); background: var(--surface-2); }
.nav-cta {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 999px;
  font-size: 14.5px;
  font-weight: 500;
  letter-spacing: -0.005em;
  border: 0;
  cursor: pointer;
  transition: transform .12s cubic-bezier(.3,.7,.4,1),
              box-shadow .15s, background .15s, color .15s;
  text-decoration: none;
}
.btn-primary {
  background: linear-gradient(180deg, var(--primary-glow) 0%, var(--primary) 100%);
  color: #fff;
  box-shadow: 0 1px 0 rgba(255,255,255,.35) inset,
              0 -2px 6px rgba(0,0,0,.25) inset,
              0 10px 30px -8px rgba(59, 111, 255, 0.7),
              0 4px 12px -4px rgba(59, 111, 255, 0.5);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 1px 0 rgba(255,255,255,.4) inset,
              0 -2px 6px rgba(0,0,0,.25) inset,
              0 16px 36px -8px rgba(59, 111, 255, 0.9),
              0 6px 14px -4px rgba(59, 111, 255, 0.65);
}
.btn-ghost {
  background: var(--surface-2);
  color: var(--fg-0);
  border: 0.5px solid var(--border-strong);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.btn-ghost:hover { background: var(--surface); border-color: var(--border-strong); }
.btn-sm { padding: 8px 14px; font-size: 13px; }
.btn .arrow { transition: transform .2s; }
.btn:hover .arrow { transform: translateX(3px); }

/* ============================================================
   LAYOUT
   ============================================================ */
.shell {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: var(--hero-gap);
  padding: 24px var(--pad-x) max(var(--section-y), 160px);
  align-items: center;
  flex: 1;
}
.hero-copy { min-width: 0; }
@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; gap: 48px; }
}

/* ============================================================
   MOBILE LANDING — frozen card layout
   At ≤780px the absolute-positioned floating cards become a clean
   stacked vertical layout. No drag-to-reposition. Video on top,
   cards below in source order. Removes the previous "everything
   overlaps" problem on phones.
   ============================================================ */
@media (max-width: 780px) {
  /* Stage drops perspective + aspect-ratio constraint */
  .stage {
    aspect-ratio: auto !important;
    max-height: none !important;
    perspective: none !important;
  }
  .stage-inner {
    position: relative !important;
    inset: auto !important;
    transform: none !important;
    transform-style: flat !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 16px !important;
  }
  /* Drop the scaling layer on mobile so cards can stack as flex items */
  .float-cards-layer {
    position: relative !important;
    inset: auto !important;
    transform: none !important;
    display: contents !important;
  }
  .scene {
    position: relative !important;
    width: 100% !important;
    height: auto !important;
    min-height: 280px !important;
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    overflow: visible !important;
    padding: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 16px !important;
  }
  .scene-art { display: none; }

  /* Video card — full width, kept on top. Top edge sits flush against the
     trade-tabs card above (no gap, flat top corners → continuous board). */
  .scene-video-card {
    position: relative !important;
    left: 0 !important; top: 0 !important;
    right: auto !important; bottom: auto !important;
    transform: none !important;
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 16 / 9;
    margin-top: -16px !important;
    margin-bottom: 0;
    border-radius: 0 0 12px 12px;
    order: 1;
  }
  .scene-video-card video {
    position: absolute;
    inset: 0;
    width: 100%; height: 100%;
    object-fit: cover;
  }

  /* All three floating cards become static stacked blocks */
  .spec-chip,
  .live-card,
  .doc-preview {
    position: relative !important;
    left: 0 !important; top: 0 !important;
    right: auto !important; bottom: auto !important;
    transform: none !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 !important;
    container-type: inline-size;
  }
  /* Float card content fills the card on mobile */
  .spec-chip .spec-list li,
  .live-card .lc-list li,
  .live-card .lc-row {
    font-size: 13px;
    line-height: 1.5;
  }
  .spec-chip .spec-hd,
  .live-card .lc-hd {
    font-size: 12px;
  }
  .spec-chip .spec-foot { font-size: 11px; }
  .live-card .lc-sect-hd { font-size: 11.5px; }
  .doc-preview {
    min-height: 0 !important;
    aspect-ratio: 8.5 / 7;
    overflow: hidden;
  }
  .doc-preview .doc-page {
    width: 100%;
    height: 100%;
    padding: 22px 22px 18px;
    display: flex;
    flex-direction: column;
  }
  .doc-title { font-size: 26px; line-height: 1.05; }
  .doc-eyebrow { font-size: 11px; }
  .doc-sub { font-size: 12px; }
  .doc-toc-label { font-size: 11px; }
  .doc-toc li { font-size: 13.5px; padding: 7px 0; }
  .doc-toc .doc-num { font-size: 11px; width: 22px; }
  .doc-toc .doc-pg { font-size: 11px; }
  .doc-toc { flex: 1; gap: 5px; }
  .doc-redact-stack { flex: 1; gap: 9px; }
  .doc-redact-bar { height: 18px; }
  .doc-redact-row .doc-num { font-size: 11px; width: 22px; }
  .doc-redact-pg { width: 24px; height: 14px; }
  .doc-view-cta { font-size: 13.5px; padding: 9px 16px 9px 18px; }
  .doc-foot { font-size: 11px; }
  .spec-chip { order: 2; }
  .live-card { order: 3; }
  .doc-preview { order: 4; transform: none !important; }
  .doc-preview:hover { transform: none !important; }

  /* Hide drag affordances entirely on mobile */
  .resize-handle, .rotate-handle { display: none !important; }

  /* Trade tabs — pulled out of the video overlay on mobile as a 2×2 grid
     of attached buttons sitting flush against the top of the video card.
     No container box; buttons share edges. */
  .trade-tabs {
    position: static !important;
    top: auto !important; left: auto !important;
    transform: none !important;
    width: 100% !important;
    margin: 0 !important;
    order: 0;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 0;
    padding: 0 !important;
    background: transparent !important;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-radius: 0;
    border: 0;
    overflow: hidden;
  }
  .trade-tab {
    flex: none !important;
    font-size: 13px !important;
    padding: 11px 14px !important;
    min-height: 44px;
    white-space: normal;
    text-align: center;
    border-right: 0.5px solid var(--border) !important;
    border-bottom: 0.5px solid var(--border) !important;
  }
  /* 2×2 grid — last column has no right border; last row has no bottom border */
  .trade-tab:nth-child(2n) { border-right: 0 !important; }
  .trade-tab:nth-last-child(-n+2) { border-bottom: 0 !important; }
  /* Place tab grid above the video stack */
  .scene .trade-tabs { order: 0; }
  .scene-video-card { order: 1; }
  .spec-chip { order: 2; }
  .live-card { order: 3; }
  .doc-preview { order: 4; transform: none !important; }
  .doc-preview:hover { transform: none !important; }

  /* Tighten hero copy column on mobile */
  .hero { gap: 36px; }
  .hero-copy .headline { font-size: clamp(28px, 7vw, 38px); }
  .cta-row { margin-bottom: 28px; }
  .cta-row .btn { flex: 1 1 calc(50% - 6px); justify-content: center; }
  .trust-strip { gap: 14px 16px; }
  .trust-divider { display: none; }
}

/* Phone-narrow — single-column CTAs */
@media (max-width: 480px) {
  .cta-row .btn { flex: 1 1 100%; }
  .nav-links { display: none; }
}

/* ============================================================
   HERO LEFT — copy
   ============================================================ */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px;
  background: var(--surface-2);
  border: 0.5px solid var(--border-strong);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 1.35;
  color: var(--fg-1);
  margin-bottom: 28px;
  max-width: 100%;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.eyebrow .dot {
  display: none;
}
.eyebrow .dot-LEGACY-HIDDEN {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--success), color-mix(in oklab, var(--success), black 30%));
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--success), transparent 80%);
  position: relative;
}
.eyebrow .dot::after {
  content: "";
  position: absolute; inset: 0;
  border-radius: 50%;
  background: var(--success);
  animation: pulse 2s ease-out infinite;
}
@keyframes pulse {
  0% { transform: scale(1); opacity: .55; }
  100% { transform: scale(2.2); opacity: 0; }
}
html[data-motion="minimal"] .eyebrow .dot::after { animation: none; }

.headline {
  font-size: clamp(40px, 5vw, 72px);
  line-height: 0.98;
  letter-spacing: -0.035em;
  font-weight: 600;
  margin: 0 0 24px;
  text-wrap: balance;
}
/* Headline variant rotator + navigator */
.hero-copy-rotator {
  display: none;
}
.hero-copy-rotator.active {
  display: block;
  animation: copy-in 0.5s cubic-bezier(.2,.8,.2,1);
}
@keyframes copy-in {
  0%   { opacity: 0; transform: translateY(8px); }
  100% { opacity: 1; transform: translateY(0); }
}
.copy-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0 28px;
  width: max-content;
}
.copy-arrow {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 0.5px solid var(--border-strong);
  color: var(--fg-1);
  cursor: pointer;
  transition: background .15s, color .15s, transform .12s, border-color .15s;
}
.copy-arrow:hover {
  background: var(--surface);
  color: var(--fg-0);
  border-color: var(--primary);
  transform: translateY(-1px);
}
.copy-dots {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 8px;
}
.copy-dot {
  appearance: none;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--fg-3);
  opacity: 0.45;
  border: 0;
  padding: 0;
  cursor: pointer;
  transition: width .25s, background .2s, opacity .2s;
}
.copy-dot.active {
  background: var(--primary);
  opacity: 1;
  width: 24px;
}
.copy-dot:hover { opacity: 1; }
.headline em {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.01em;
  /* Use the primary palette color — stays in sync with palette tweaks.
     A small white blend at the top adds depth without washing the color out. */
  background: linear-gradient(180deg,
    color-mix(in oklab, var(--primary) 85%, white) 0%,
    var(--primary) 70%);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  /* Italic serif letters have left/right side bearings that visually extend
     past the text box — pad both sides so the first/last glyph isn't clipped. */
  padding-left: 0.08em;
  padding-right: 0.06em;
  margin-left: -0.04em;
}
.lede {
  font-size: clamp(16px, 1.25vw, 18.5px);
  line-height: 1.55;
  color: var(--fg-1);
  margin: 0 0 36px;
  max-width: 52ch;
  text-wrap: pretty;
}
.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 44px;
}
.trust-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 20px 28px;
  align-items: center;
}
.trust-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--fg-2);
  font-weight: 500;
}
.trust-item svg { color: var(--accent); flex-shrink: 0; }
.trust-divider {
  display: none;
}

/* ============================================================
   HERO RIGHT — stage
   ============================================================ */
.stage {
  position: relative;
  aspect-ratio: 1 / 1.05;
  max-height: 720px;
  perspective: 1400px;
  perspective-origin: 50% 50%;
}
.stage-inner {
  position: absolute;
  inset: 0;
  /* container queries so floating cards can scale with the stage */
  container-type: inline-size;
  transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* ------------------------------------------------------------------
   Floating-cards scaling layer.
   The three floating cards (spec / live / doc) live at fixed design-
   space positions (~720px-wide stage). As the browser narrows, the
   video shrinks — HeroStage's pinFloatCards() writes the matching
   scale onto this layer via the CSS `zoom` property. Using `zoom`
   (not `transform: scale`) means the cards are scaled as part of
   layout, so text + icons stay pixel-sharp. Cards also re-anchor
   horizontally to the video card's bottom-center, so they track the
   video as it gets narrower instead of floating off to the side.
   ------------------------------------------------------------------ */
.float-cards-layer {
  position: absolute;
  inset: 0;
  /* `zoom` scales children as part of layout — no raster blur on text. */
  zoom: var(--cards-zoom, 1);
  /* A small left/right offset that JS tunes so the visible cluster of
     cards re-centers on the (now-narrower) video, not on the stage. */
  margin-left: var(--cards-shift, 0px);
  transition: margin-left 0.18s cubic-bezier(.2,.8,.2,1);
  pointer-events: none;
  z-index: 5;
}
.float-cards-layer > * { pointer-events: auto; }

/* Scene card — the big glass surface */
.scene {
  position: absolute;
  inset: 0;
  border-radius: var(--r-xl);
  background:
    radial-gradient(ellipse at 50% 0%, color-mix(in oklab, var(--primary), transparent 78%) 0%, transparent 60%),
    linear-gradient(180deg, var(--surface-2) 0%, var(--surface) 100%);
  border: 0.5px solid var(--border-strong);
  box-shadow: var(--shadow-elev);
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  overflow: hidden;
}
.scene::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(160deg, rgba(255,255,255,0.10) 0%, transparent 38%);
  pointer-events: none;
}

/* Trade-switcher tab buttons — no container box; buttons attach directly. */
.trade-tabs {
  position: absolute;
  top: 18px;
  left: 18px;
  right: 18px;
  z-index: 6;
  display: flex;
  gap: 0;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  overflow: hidden;
  box-shadow: 0 6px 20px -10px rgba(0, 0, 0, 0.45);
}
html[data-theme="light"] .trade-tabs {
  background: transparent;
}
.trade-tab {
  flex: 1;
  appearance: none;
  border: 0;
  /* No divider borders. 0.5px hairlines rasterize inconsistently under the
     parallax 3D transform on .stage-inner — at certain angles they render
     as fuzzy or doubled lines that crawl as the user moves their mouse.
     The active tab's gradient already provides separation; inactive tabs
     share the same glass background, so dividers aren't needed visually. */
  background: rgba(8, 14, 28, 0.55);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  color: var(--fg-2);
  padding: 12px 6px;
  border-radius: 0;
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: -0.005em;
  cursor: pointer;
  position: relative;
  z-index: 1;
  transition: color 0.15s, background 0.15s;
}
@media (min-width: 861px) { .trade-tab { white-space: nowrap; } }
.trade-tab:last-child { /* legacy: no longer needed but harmless */ }
html[data-theme="light"] .trade-tab:not(.active) {
  background: rgba(255,255,255, 0.75);
}
.trade-tab.active {
  color: #fff;
  background: linear-gradient(180deg, var(--primary-glow) 0%, var(--primary) 100%);
  box-shadow: 0 6px 20px -6px var(--primary);
}
html[data-theme="light"] .trade-tab:not(.active) { color: var(--fg-1); }
.trade-tab:not(.active):hover { color: var(--fg-0); }

/* SVG scene container */
.scene-art {
  position: absolute;
  inset: 56px 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.scene-art svg {
  width: 92%;
  height: 92%;
  filter: drop-shadow(0 24px 40px rgba(0, 8, 30, 0.45));
}
.scene-art .scene-svg { transition: opacity 0.35s ease, transform 0.5s cubic-bezier(.2,.8,.2,1); }

/* Electrician video — JS sets width/height to fit active video's aspect. */
.scene-video-card {
  position: absolute;
  left: 50%;
  top: 62px;
  transform: translateX(-50%);
  z-index: 4;
  border-radius: 12px;
  overflow: hidden;
  filter: drop-shadow(0 24px 40px rgba(0, 8, 30, 0.55));
  cursor: default;
}
.scene-video-card video {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.scene-video-card video.active {
  opacity: 1;
  z-index: 1;
}
.scene-video-card.is-draggable {
  transform: none;
}

/* Loading overlay while a video is buffering */
.video-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: linear-gradient(180deg,
    color-mix(in oklab, var(--bg-1), transparent 20%) 0%,
    color-mix(in oklab, var(--bg-0), transparent 10%) 100%);
  color: var(--fg-1);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  pointer-events: none;
  z-index: 5;
}
.vl-spinner {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid color-mix(in oklab, var(--primary), transparent 75%);
  border-top-color: var(--primary);
  animation: vl-spin 0.8s linear infinite;
}
@keyframes vl-spin {
  to { transform: rotate(360deg); }
}

/* Video variant — full-bleed inside the scene card */
.scene-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}
.scene-video-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(8,14,28,0.10) 0%, rgba(8,14,28,0.55) 100%),
    radial-gradient(ellipse at 50% 0%, color-mix(in oklab, var(--primary), transparent 65%) 0%, transparent 55%);
  z-index: 1;
  pointer-events: none;
}
html[data-theme="light"] .scene-video-overlay {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.10) 0%, rgba(20,30,60,0.35) 100%),
    radial-gradient(ellipse at 50% 0%, color-mix(in oklab, var(--primary), transparent 70%) 0%, transparent 55%);
}

/* Floating live "program builder" card — bottom-left of stage */
.live-card {
  position: absolute;
  left: -28px;
  bottom: -180px;
  z-index: 7;
  width: 320px;
  padding: 14px 16px 16px;
  background: rgba(10, 18, 40, 0.82);
  border: 0.5px solid var(--border-strong);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  color: #fff;
  font-family: var(--font-mono);
}
html[data-theme="light"] .live-card {
  background: rgba(255,255,255,0.94);
  color: var(--fg-0);
}
.live-card .lc-hd {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-2);
  margin-bottom: 12px;
}
.live-card .lc-hd .dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--success), transparent 75%);
  animation: pulse 2s ease-out infinite;
}
.live-card .lc-meta {
  padding: 0 0 10px;
  margin-bottom: 10px;
  border-bottom: 0.5px solid var(--border);
}
.live-card .lc-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 12px;
  padding: 4px 0;
}
.live-card .lc-row .lc-k {
  color: var(--fg-3);
  font-weight: 500;
  letter-spacing: 0.02em;
}
.live-card .lc-row .lc-v {
  color: var(--fg-0);
  font-weight: 500;
}
.live-card .lc-sect-hd {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--fg-3);
  margin: 10px 0 6px;
}
.live-card .lc-sect-hd .lc-count {
  color: var(--success);
  font-variant-numeric: tabular-nums;
}
.live-card .lc-list {
  list-style: none;
  margin: 0 0 4px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.live-card .lc-list li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 11px;
  line-height: 1.3;
  color: var(--fg-1);
  opacity: 0;
  transform: translateX(-4px);
  animation: lc-item-in 0.4s cubic-bezier(.2,.8,.2,1) forwards;
}
.live-card .lc-check {
  flex-shrink: 0;
  width: 12px; height: 12px;
  border-radius: 3px;
  background: var(--success);
  margin-top: 1px;
  position: relative;
}
.live-card .lc-check::after {
  content: "";
  position: absolute;
  left: 3px; top: 1.5px;
  width: 4px; height: 7px;
  border: solid #0A1426;
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
}
.live-card .lc-bullet {
  flex-shrink: 0;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--primary);
  margin-top: 5px;
}
.live-card .lc-list.codes li {
  font-size: 10px;
  color: var(--fg-2);
  font-family: var(--font-mono);
  line-height: 1.4;
}
.live-card .lc-more {
  color: var(--fg-3) !important;
  font-style: italic;
  letter-spacing: 0.01em;
  margin-top: 2px;
}
.live-card .lc-ellipsis {
  flex-shrink: 0;
  width: 12px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.04em;
  margin-top: -2px;
}
@keyframes lc-item-in {
  0%   { opacity: 0; transform: translateX(-4px); }
  100% { opacity: 1; transform: translateX(0); }
}

/* Reposition mode — affordance + cursor for draggable floating cards */
.is-draggable {
  cursor: grab;
  outline: 1.5px dashed var(--primary);
  outline-offset: 6px;
  box-shadow: 0 0 0 1px color-mix(in oklab, var(--primary), transparent 70%),
              var(--shadow-elev);
}
.is-draggable:active { cursor: grabbing; }
.is-draggable::before {
  content: "drag to move · drag corners to resize";
  position: absolute;
  top: -22px; left: 0;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--primary);
  padding: 2px 8px;
  background: color-mix(in oklab, var(--primary), transparent 88%);
  border-radius: 4px;
  pointer-events: none;
  white-space: nowrap;
}

/* Corner resize handles */
.resize-handle {
  position: absolute;
  width: 14px; height: 14px;
  background: var(--primary);
  border: 1.5px solid #fff;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0,0,0,.4);
  z-index: 20;
  touch-action: none;
}
.resize-handle.nw { top: -7px;    left: -7px;    cursor: nwse-resize; }
.resize-handle.ne { top: -7px;    right: -7px;   cursor: nesw-resize; }
.resize-handle.sw { bottom: -7px; left: -7px;    cursor: nesw-resize; }
.resize-handle.se { bottom: -7px; right: -7px;   cursor: nwse-resize; }

/* Rotate handle — small circle above the top edge of each card */
.rotate-handle {
  position: absolute;
  top: -32px;
  left: 50%;
  transform: translateX(-50%);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--primary);
  border: 1.5px solid #fff;
  box-shadow: 0 3px 8px rgba(0,0,0,.35);
  z-index: 21;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  touch-action: none;
}
.rotate-handle:active { cursor: grabbing; }
.rotate-handle::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  width: 1px;
  height: 10px;
  background: var(--primary);
  transform: translateX(-50%);
}

/* Floating spec/codes chip — bottom-right of stage, under the video */
.spec-chip {
  position: absolute;
  right: -16px;
  bottom: -180px;
  top: auto;
  z-index: 7;
  width: 240px;
  padding: 10px 12px 12px;
  background: rgba(10, 18, 40, 0.82);
  border: 0.5px solid var(--border-strong);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  color: #fff;
  font-family: var(--font-mono);
}
html[data-theme="light"] .spec-chip {
  background: rgba(255,255,255,0.94);
  color: var(--fg-0);
}
.spec-chip .spec-hd {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--fg-2);
  margin-bottom: 8px;
}
.spec-chip .spec-hd .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent), transparent 75%);
}
.spec-chip .spec-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.spec-chip .spec-list li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 10.5px;
  line-height: 1.35;
  color: var(--fg-1);
  font-family: var(--font-mono);
  opacity: 0;
  transform: translateX(4px);
  animation: lc-item-in 0.4s cubic-bezier(.2,.8,.2,1) forwards;
}
.spec-chip .lc-bullet {
  flex-shrink: 0;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  margin-top: 4px;
}
.spec-chip .spec-foot {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 0.5px solid var(--border);
  font-family: var(--font-mono);
  font-size: 9.5px;
  line-height: 1.4;
  color: var(--fg-3);
  font-style: italic;
  letter-spacing: 0.01em;
  opacity: 0;
  transform: translateX(4px);
  animation: lc-item-in 0.4s cubic-bezier(.2,.8,.2,1) forwards;
}

/* Floating doc preview — miniature OSHA safety program */
.doc-preview {
  position: absolute;
  right: -32px;
  bottom: -28px;
  z-index: 7;
  width: 260px;
  background: transparent;
  transform: rotate(3.5deg);
  transition: transform 0.4s cubic-bezier(.2,.8,.2,1);
}
.doc-preview:hover { transform: rotate(1deg) translateY(-4px); }

/* Stacked paper layers behind the front page — fanned out */
.doc-stack {
  position: absolute;
  inset: 0;
  background: #F4F6FB;
  border-radius: var(--r-md);
  box-shadow: 0 8px 16px -6px rgba(0,8,30,0.4);
  border: 0.5px solid rgba(15,30,60,0.10);
}
.doc-stack-4 {
  transform: translate(-14px, 8px) rotate(-7deg);
  background: #E2E6F0;
  z-index: 0;
}
.doc-stack-3 {
  transform: translate(8px, 6px) rotate(5deg);
  background: #E8ECF3;
  z-index: 0;
}
.doc-stack-2 {
  transform: translate(-7px, 4px) rotate(-3deg);
  background: #EEF1F7;
  z-index: 1;
}
.doc-stack-1 {
  transform: translate(4px, 2px) rotate(2deg);
  background: #F2F5FA;
  z-index: 1;
}

/* Front page */
.doc-page {
  position: relative;
  z-index: 2;
  background: linear-gradient(180deg, #FAFBFE 0%, #ECEFF7 100%);
  border-radius: var(--r-md);
  padding: 14px 14px 12px;
  box-shadow:
    0 30px 60px -20px rgba(0,8,30,0.6),
    0 12px 24px -10px rgba(0,8,30,0.5),
    0 1px 0 rgba(255,255,255,.7) inset;
  color: #0A1426;
  font-family: var(--font-sans);
}

.doc-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.doc-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px 2px 0;
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 7.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: #6B7488;
}
.doc-badge span:first-child {
  display: inline-block;
  padding: 2px 5px;
  background: linear-gradient(180deg, #E04444, #B23030);
  color: #fff;
  border-radius: 3px;
  letter-spacing: 0.08em;
}
.doc-meta-top {
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 8px;
  color: #8A92A6;
  letter-spacing: 0.02em;
}

.doc-title-block { margin-bottom: 10px; }
.doc-eyebrow {
  font-family: var(--font-mono);
  font-size: 7.5px;
  font-weight: 600;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: #B85A00;
  margin-bottom: 3px;
}
.doc-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: #0A1426;
}
.doc-sub {
  margin-top: 3px;
  font-size: 9.5px;
  color: #6B7488;
  font-weight: 500;
}
.doc-rule {
  height: 1px;
  background: linear-gradient(90deg, #C8CDDB 0%, transparent 100%);
  margin: 8px 0 8px;
}

.doc-toc-label {
  font-family: var(--font-mono);
  font-size: 7.5px;
  font-weight: 600;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: #8A92A6;
  margin-bottom: 6px;
}
.doc-toc {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.doc-toc li {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 9.5px;
  line-height: 1.3;
  color: #2A3450;
  opacity: 0;
  transform: translateX(-3px);
  animation: lc-item-in 0.4s cubic-bezier(.2,.8,.2,1) forwards;
}
.doc-toc .doc-num {
  font-family: var(--font-mono);
  font-size: 7.5px;
  font-weight: 600;
  color: #B85A00;
  flex-shrink: 0;
  width: 14px;
}
.doc-toc .doc-sec {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
}
.doc-toc .doc-dots {
  flex: 1;
  height: 0;
  border-bottom: 1px dotted #B8C0D2;
  margin: 0 4px;
  transform: translateY(-2px);
}
.doc-toc .doc-pg {
  font-family: var(--font-mono);
  font-size: 8px;
  color: #6B7488;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}
.doc-toc-more {
  color: #8A92A6 !important;
  font-style: italic;
  margin-top: 2px;
}
.doc-toc-more .doc-num { color: #B85A00; }

/* Redaction stack — replaces the TOC list. Black bars over where section
   names would appear, with a "View Sample" call-to-action layered on top.
   The whole doc-page is an <a>, so clicking anywhere opens the PDF. */
.doc-redact-stack {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 4px;
}
.doc-redact-row {
  display: flex;
  align-items: center;
  gap: 6px;
  opacity: 0;
  transform: translateX(-3px);
  animation: lc-item-in 0.4s cubic-bezier(.2,.8,.2,1) forwards;
}
.doc-redact-row .doc-num {
  font-family: var(--font-mono);
  font-size: 7.5px;
  font-weight: 600;
  color: #B85A00;
  flex-shrink: 0;
  width: 14px;
}
.doc-redact-bar {
  display: inline-block;
  flex: 0 1 auto;
  height: 11px;
  background: linear-gradient(90deg, #0F1626 0%, #1B2538 100%);
  border-radius: 2px;
  position: relative;
  overflow: hidden;
}
.doc-redact-bar::after {
  /* faint diagonal stripe so it reads as a redaction mark, not just a bar */
  content: "";
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    -45deg,
    transparent 0,
    transparent 3px,
    rgba(255, 255, 255, 0.04) 3px,
    rgba(255, 255, 255, 0.04) 5px
  );
}
.doc-redact-pg {
  display: inline-block;
  width: 16px;
  height: 9px;
  background: #1B2538;
  border-radius: 2px;
  flex-shrink: 0;
  margin-left: auto;
}

/* "View Sample" overlay — sits on top of the redaction stack.
   Pill-style chip centered, gets a small lift on hover. */
.doc-view-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
}
.doc-view-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px 7px 13px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--primary) 0%, color-mix(in oklab, var(--primary) 80%, black) 100%);
  color: #fff;
  font-family: var(--font-sans);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
  box-shadow:
    0 0 0 3px rgba(255, 255, 255, 0.85),
    0 8px 20px -6px rgba(245, 124, 0, 0.55),
    0 2px 6px rgba(0, 0, 0, 0.25);
  transform: translateY(0);
  transition: transform 200ms cubic-bezier(.2,.8,.2,1), box-shadow 200ms;
}
.doc-view-cta svg { transition: transform 200ms cubic-bezier(.2,.8,.2,1); }

/* Make the whole page feel clickable */
.doc-page-link {
  display: block;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: transform 220ms cubic-bezier(.2,.8,.2,1), box-shadow 220ms;
}
.doc-preview:hover .doc-page-link {
  transform: translateY(-2px);
  box-shadow:
    0 36px 70px -22px rgba(0,8,30,0.7),
    0 14px 28px -10px rgba(0,8,30,0.55),
    0 1px 0 rgba(255,255,255,.7) inset;
}
.doc-preview:hover .doc-view-cta {
  transform: translateY(-1px);
  box-shadow:
    0 0 0 3px rgba(255, 255, 255, 0.95),
    0 12px 26px -6px rgba(245, 124, 0, 0.7),
    0 3px 8px rgba(0, 0, 0, 0.3);
}
.doc-preview:hover .doc-view-cta svg { transform: translateX(2px); }
.doc-page-link:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}

.doc-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 8px;
  color: #6B7488;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 0.5px solid #D8DCE6;
}
.doc-foot b { color: #0A1426; font-weight: 600; }
.doc-foot .doc-stamp {
  padding: 2px 6px;
  border: 0.5px solid #5BD4A3;
  color: #1B7A56;
  border-radius: 2px;
  font-weight: 600;
  letter-spacing: 0.04em;
  background: rgba(91, 212, 163, 0.12);
}

/* ============================================================
   BOTTOM STRIP — three-step path
   ============================================================ */
.bottom-strip {
  position: relative;
  z-index: 2;
  padding: 0 var(--pad-x) calc(var(--section-y) - 16px);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
@media (max-width: 720px) {
  .bottom-strip { grid-template-columns: 1fr; }
}
.step-card {
  position: relative;
  padding: 24px 22px 22px;
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: var(--r-lg);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition: transform .2s cubic-bezier(.2,.8,.2,1), border-color .2s;
}
.step-card:hover { transform: translateY(-3px); border-color: var(--border-strong); }
.step-card::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(180deg, rgba(255,255,255,.18), transparent 60%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}
.step-card .step-num {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.04em;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.step-card .step-num::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--accent) 0%, transparent 80%);
  opacity: 0.5;
}
.step-card h3 {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.015em;
}
.step-card p {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--fg-2);
}

/* ============================================================
   Scene animations
   ============================================================ */
@keyframes scene-in {
  0%   { opacity: 0; transform: translateY(8px) scale(0.985); }
  100% { opacity: 1; transform: translateY(0)   scale(1); }
}
@keyframes float-doc {
  0%   { transform: translateY(0); }
  100% { transform: translateY(-10px); }
}
@keyframes spark-burst {
  0%   { opacity: 0; transform: scale(0.3); }
  25%  { opacity: 1; transform: scale(1.1); }
  60%  { opacity: 0.5; transform: scale(1.5); }
  100% { opacity: 0; transform: scale(1.8); }
}
@keyframes fan-spin {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
@keyframes trace-flow {
  0%   { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: -40; }
}
@keyframes trace-flow-rev {
  0%   { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: 40; }
}
@keyframes bulb-flicker {
  0%, 14%   { opacity: 0.25; filter: brightness(0.5); }
  20%, 80%  { opacity: 1;    filter: brightness(1.4); }
  90%, 100% { opacity: 0.25; filter: brightness(0.5); }
}
@keyframes worker-bob {
  0%, 100% { transform: translateY(0) scaleX(var(--face, 1)); }
  50%      { transform: translateY(-2px) scaleX(var(--face, 1)); }
}
/* Worker bob without face flip (handled by inner element) */
@keyframes worker-bob-simple {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-2px); }
}
@keyframes arm-reach {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  50%      { transform: translate(-2px, -3px) rotate(-4deg); }
}
@keyframes hammer-swing {
  0%, 100% { transform: rotate(0deg); }
  35%      { transform: rotate(-30deg); }
  55%      { transform: rotate(8deg); }
}
@keyframes worker-climb {
  0%, 100% { transform: translate(85px, 380px); }
  50%      { transform: translate(85px, 374px); }
}
@keyframes sun-arc {
  0%   { transform: translate(0, 0); }
  100% { transform: translate(40px, -10px); }
}
@keyframes cloud-drift {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-180px); }
}
@keyframes shingle-lay {
  0%, 12%  { opacity: 0; transform: translateY(-8px); }
  18%, 95% { opacity: 1; transform: translateY(0); }
  100%     { opacity: 0; transform: translateY(-8px); }
}
@keyframes gauge-sweep {
  0%, 100% { transform: rotate(-50deg); }
  50%      { transform: rotate(50deg); }
}
@keyframes wrench-turn {
  0%, 100% { transform: rotate(0deg); }
  50%      { transform: rotate(-20deg); }
}
@keyframes vapor {
  0%   { opacity: 0; transform: translateY(0) scale(1); }
  30%  { opacity: 0.7; }
  100% { opacity: 0; transform: translateY(-30px) scale(1.6); }
}
@keyframes crane-swing {
  0%, 100% { transform: rotate(-4deg); }
  50%      { transform: rotate(12deg); }
}
@keyframes trolley-slide {
  0%, 100% { transform: translate(140px, 4px); }
  50%      { transform: translate(80px, 4px); }
}
@keyframes floor-rise {
  0%, 8%   { opacity: 0; transform: translateY(20px); }
  15%, 88% { opacity: 1; transform: translateY(0); }
  95%, 100% { opacity: 0; transform: translateY(20px); }
}
@keyframes signal-wave {
  0%, 100% { transform: rotate(0deg); }
  50%      { transform: rotate(-18deg); }
}
@keyframes pose-visible {
  0%   { opacity: 0; }
  4%   { opacity: 1; }
  30%  { opacity: 1; }
  34%  { opacity: 0; }
  100% { opacity: 0; }
}
@keyframes drill-shake {
  0%, 100% { transform: translate(0, 0); }
  25%      { transform: translate(0.6px, -0.4px); }
  75%      { transform: translate(-0.6px, 0.4px); }
}
@keyframes dust-fall {
  0%   { opacity: 0; transform: translateY(0); }
  20%  { opacity: 0.8; }
  100% { opacity: 0; transform: translateY(24px); }
}
@keyframes walk-traverse {
  /* Same 9s cycle as pose-visible, with -6s delay → enters frame at 66% of cycle */
  0%, 64%  { transform: translate(310px, 425px); }
  68%      { transform: translate(280px, 425px); }
  95%      { transform: translate(400px, 425px); }
  100%     { transform: translate(310px, 425px); }
}
html[data-motion="minimal"] .scene-svg [style*="animation"] { animation: none !important; }
html[data-motion="minimal"] .doc-preview { transform: rotate(2deg); }

/* ============================================================
   SECTIONS — shared
   ============================================================ */
.section {
  position: relative;
  z-index: 2;
  padding: clamp(60px, 8vw, 110px) var(--pad-x);
}
.section-inner {
  max-width: 1240px;
  margin: 0 auto;
}
.section-hd {
  max-width: 640px;
  margin: 0 0 48px;
}
.section-eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.10em;
  color: var(--accent);
  margin-bottom: 18px;
}
.section-title {
  margin: 0 0 16px;
  font-size: clamp(28px, 3.4vw, 44px);
  line-height: 1.06;
  letter-spacing: -0.025em;
  font-weight: 600;
  text-wrap: balance;
}
.section-lede {
  margin: 0;
  font-size: 16px;
  line-height: 1.55;
  color: var(--fg-1);
  text-wrap: pretty;
}

/* ============================================================
   WHY CHOOSE
   ============================================================ */
.section-why {
  border-top: 0.5px solid var(--border);
}
.why-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
@media (max-width: 980px) { .why-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .why-grid { grid-template-columns: 1fr; } }
.why-card {
  position: relative;
  padding: 28px 24px 26px;
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: var(--r-lg);
  backdrop-filter: blur(14px) saturate(150%);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  box-shadow: var(--shadow-card);
  transition: transform .2s cubic-bezier(.2,.8,.2,1), border-color .2s;
  overflow: hidden;
}
.why-card::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(180deg, rgba(255,255,255,.14), transparent 60%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}
.why-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-strong);
}
.why-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(180deg,
    color-mix(in oklab, var(--accent), transparent 78%) 0%,
    color-mix(in oklab, var(--accent), transparent 92%) 100%);
  border: 0.5px solid color-mix(in oklab, var(--accent), transparent 55%);
  color: var(--accent);
  margin-bottom: 18px;
}
.why-title {
  margin: 0 0 8px;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.25;
}
.why-desc {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--fg-2);
  text-wrap: pretty;
}

/* ============================================================
   FREE RESOURCES
   ============================================================ */
.section-resources {
  border-top: 0.5px solid var(--border);
}
.resources-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
@media (max-width: 880px) {
  .resources-grid { grid-template-columns: 1fr; }
}
.resource-card {
  position: relative;
  display: block;
  padding: 28px 24px 24px;
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: var(--r-lg);
  backdrop-filter: blur(14px) saturate(150%);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  box-shadow: var(--shadow-card);
  color: inherit;
  text-decoration: none;
  transition: transform .2s cubic-bezier(.2,.8,.2,1), border-color .2s, background .2s;
  overflow: hidden;
}
.resource-card::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(180deg, rgba(255,255,255,.14), transparent 60%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}
.resource-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-strong);
  background: var(--surface-2);
}
.resource-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(180deg,
    color-mix(in oklab, var(--primary), transparent 78%) 0%,
    color-mix(in oklab, var(--primary), transparent 92%) 100%);
  border: 0.5px solid color-mix(in oklab, var(--primary), transparent 55%);
  color: var(--primary);
  margin-bottom: 22px;
}
.resource-eyebrow {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--fg-3);
  margin-bottom: 8px;
}
.resource-title {
  margin: 0 0 10px;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.2;
}
.resource-desc {
  margin: 0 0 22px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--fg-2);
  text-wrap: pretty;
}
.resource-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--primary);
}
.resource-cta .arrow { transition: transform .2s; }
.resource-card:hover .resource-cta .arrow { transform: translateX(3px); }

/* ============================================================
   FINAL CTA
   ============================================================ */
.section-cta {
  border-top: 0.5px solid var(--border);
  padding-top: clamp(80px, 10vw, 140px);
  padding-bottom: clamp(80px, 10vw, 140px);
  text-align: center;
  overflow: hidden;
}
.cta-inner {
  position: relative;
  max-width: 760px;
  margin: 0 auto;
}
.cta-glow {
  position: absolute;
  inset: -200px -200px auto -200px;
  height: 360px;
  background: radial-gradient(ellipse at center,
    color-mix(in oklab, var(--primary), transparent 60%) 0%,
    transparent 65%);
  filter: blur(60px);
  z-index: -1;
  pointer-events: none;
}
.cta-headline {
  margin: 0 0 18px;
  font-size: clamp(34px, 4.5vw, 60px);
  line-height: 1.02;
  letter-spacing: -0.03em;
  font-weight: 600;
  text-wrap: balance;
}
.cta-lede {
  margin: 0 auto 36px;
  max-width: 580px;
  font-size: clamp(15px, 1.15vw, 17px);
  line-height: 1.55;
  color: var(--fg-1);
}
.cta-lede b { color: var(--fg-0); font-weight: 600; }
.section-cta .cta-row {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 28px;
}
.cta-trust {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--fg-2);
  font-weight: 500;
}
.cta-trust svg { color: var(--accent); flex-shrink: 0; }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  position: relative;
  z-index: 2;
  border-top: 0.5px solid var(--border);
  background: linear-gradient(180deg,
    color-mix(in oklab, var(--bg-1), transparent 50%) 0%,
    color-mix(in oklab, var(--bg-0), transparent 0%) 100%);
}
.footer-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 64px var(--pad-x) 40px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 40px;
  align-items: start;
}
.footer-inner > .footer-nav {
  max-width: 540px;
  justify-self: start;
  margin-left: 80px;
}
@media (max-width: 880px) {
  .footer-inner { grid-template-columns: 1fr; gap: 40px; }
}
.footer-brand .brand {
  margin-bottom: 16px;
  font-size: 17px;
}
.footer-tag {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--fg-2);
  max-width: 28ch;
}
.footer-nav {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px;
}
@media (max-width: 540px) {
  .footer-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ============================================================
   MOBILE — nav hamburger + tighter spacing + footer
   ============================================================ */
.nav-toggle {
  display: none;
  width: 36px; height: 36px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 0.5px solid var(--border-strong);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  color: var(--fg-0);
  margin-left: auto;
}
.nav-toggle:hover { background: var(--surface); border-color: var(--primary); }
.nav-toggle svg { display: block; }
.nav-mobile-panel {
  display: none;
  position: fixed;
  top: 70px; left: 12px; right: 12px;
  z-index: 49;
  background: rgba(10,20,38,.92);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  border: 0.5px solid var(--border);
  border-radius: var(--r-lg);
  padding: 16px;
  flex-direction: column;
  gap: 4px;
  box-shadow: 0 24px 60px -16px rgba(0,8,30,.8);
}
.nav-mobile-panel.open { display: flex; animation: q-screen-in .25s cubic-bezier(.2,.8,.2,1); }
.nav-mobile-panel a {
  display: block;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 500;
  color: var(--fg-0);
  text-decoration: none;
}
.nav-mobile-panel a:hover, .nav-mobile-panel a:focus { background: var(--surface-2); }
.nav-mobile-panel .mobile-cta {
  margin-top: 6px;
  background: linear-gradient(180deg, var(--primary) 0%, color-mix(in oklab, var(--primary) 78%, black) 100%);
  color: #fff;
  text-align: center;
  font-weight: 600;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.22), 0 8px 22px -8px color-mix(in oklab, var(--primary) 60%, transparent);
}
html[data-theme="light"] .nav-mobile-panel {
  background: rgba(255, 255, 255, 0.94);
  border-color: rgba(15, 30, 60, 0.10);
  box-shadow: 0 24px 60px -16px rgba(20, 40, 90, 0.22);
}

@media (max-width: 860px) {
  .nav { padding: 12px clamp(12px, 3vw, 24px); }
  .nav-inner { padding: 8px 8px 8px 14px; gap: 12px; }
  .nav-links, .nav-cta { display: none; }
  .nav-toggle { display: inline-flex; }
}

/* Tighten the stack gap between scene (cards) and the bottom strip on mobile */
@media (max-width: 780px) {
  .shell { padding-bottom: 0; }
  .hero { padding-bottom: 0 !important; margin-bottom: 0 !important; }
  .bottom-strip {
    margin-top: 0;
    padding-top: 20px;
    border-top: 0.5px solid var(--border);
  }
  .hero {
    padding-left: clamp(12px, 4vw, 24px);
    padding-right: clamp(12px, 4vw, 24px);
  }
  .stage, .scene, .stage-inner { padding: 0; }
}

/* Hard container guard — nothing breaks the viewport edge.
   `overflow-x: clip` (not `hidden`) — `hidden` creates a scroll
   container which kills `position: sticky` on the nav at this width. */
@media (max-width: 860px) {
  html, body { overflow-x: clip; }
  .nav-inner { max-width: calc(100vw - 24px); }
}

/* ============================================================
   MOBILE FOOTER — single block, condensed
   ============================================================ */
@media (max-width: 720px) {
  .site-footer { padding: 0; }
  .footer-inner {
    padding: 36px clamp(16px, 4vw, 24px) 24px;
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .footer-inner > .footer-nav { margin-left: 0; max-width: 100%; }
  .footer-brand .footer-tag { max-width: none; font-size: 13.5px; }
  .footer-nav {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr);
    gap: 20px 12px;
  }
  .footer-col-hd { font-size: 9.5px; letter-spacing: 0.08em; margin-bottom: 2px; }
  .footer-col { gap: 6px; }
  .footer-col a { font-size: 12.5px; padding: 2px 0; line-height: 1.35; }
  .footer-bottom { padding: 16px clamp(16px, 4vw, 24px); }
  .footer-bottom-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    font-size: 11px;
    line-height: 1.5;
  }
  .footer-bottom-inner .footer-sep { display: none; }
  .footer-disclaimer {
    font-size: 11px;
    color: var(--fg-3);
    line-height: 1.5;
  }
}
@media (max-width: 460px) {
  /* Keep the three columns side-by-side — just tighten everything */
  .footer-nav { gap: 16px 8px; }
  .footer-col-hd { font-size: 9px; }
  .footer-col a { font-size: 11.5px; line-height: 1.35; }
}
@media (max-width: 360px) {
  .footer-col a { font-size: 11px; }
}
.footer-col { display: flex; flex-direction: column; gap: 10px; }
.footer-col-hd {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--fg-3);
  margin-bottom: 4px;
}
.footer-col a {
  font-size: 14px;
  color: var(--fg-1);
  text-decoration: none;
  width: max-content;
  max-width: 100%;
  overflow-wrap: break-word;
  transition: color .15s;
}
.footer-col a:hover { color: var(--fg-0); }

.footer-bottom {
  border-top: 0.5px solid var(--border);
  padding: 20px var(--pad-x);
}
.footer-bottom-inner {
  max-width: 1240px;
  margin: 0 auto;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: baseline;
  font-size: 12px;
  color: var(--fg-3);
  line-height: 1.55;
}
.footer-bottom-inner > span:first-child {
  white-space: nowrap;
  font-weight: 500;
  color: var(--fg-2);
}
.footer-sep { color: var(--fg-3); opacity: 0.5; }
.footer-disclaimer {
  flex: 1;
  min-width: 280px;
}

/* ============================================================
   Trade-content visibility — driven by .stage-inner[data-active-trade]
   ============================================================
   All four trades' content lives in the HTML (good for SEO). Only the
   variant matching the active trade renders. data-active-trade lives on
   .stage-inner because it must be a common ancestor of both .scene
   (containing the videos + tabs) and .float-cards-layer (containing the
   spec-chip, live-card, and doc-preview cards).

   Specificity note: the hide rule must beat .spec-chip .spec-list (0,0,2,0)
   and .live-card .lc-list (0,0,2,0). Scoping to .stage-inner brings the
   hide rule to (0,0,2,0); source-ordered after, it wins. The show rules
   are (0,0,3,0) — they win over both.

   `display: revert` reverts to UA defaults, not to the suppressed author
   rules — so the lists (which were display:flex) and the doc-page-link
   (which was display:block) each need their original display value
   restated explicitly. Inline-by-default elements (spans) ride the
   generic show rule. */
.stage-inner [data-trade-content] { display: none; }

.stage-inner[data-active-trade="electrical"] [data-trade-content="electrical"],
.stage-inner[data-active-trade="roofing"]    [data-trade-content="roofing"],
.stage-inner[data-active-trade="hvac"]       [data-trade-content="hvac"],
.stage-inner[data-active-trade="gc"]         [data-trade-content="gc"] {
  display: revert;
}

.stage-inner[data-active-trade="electrical"] .spec-list[data-trade-content="electrical"],
.stage-inner[data-active-trade="electrical"] .lc-list[data-trade-content="electrical"],
.stage-inner[data-active-trade="roofing"]    .spec-list[data-trade-content="roofing"],
.stage-inner[data-active-trade="roofing"]    .lc-list[data-trade-content="roofing"],
.stage-inner[data-active-trade="hvac"]       .spec-list[data-trade-content="hvac"],
.stage-inner[data-active-trade="hvac"]       .lc-list[data-trade-content="hvac"],
.stage-inner[data-active-trade="gc"]         .spec-list[data-trade-content="gc"],
.stage-inner[data-active-trade="gc"]         .lc-list[data-trade-content="gc"] {
  display: flex;
}

.stage-inner[data-active-trade="electrical"] .doc-page-link[data-trade-content="electrical"],
.stage-inner[data-active-trade="roofing"]    .doc-page-link[data-trade-content="roofing"],
.stage-inner[data-active-trade="hvac"]       .doc-page-link[data-trade-content="hvac"],
.stage-inner[data-active-trade="gc"]         .doc-page-link[data-trade-content="gc"] {
  display: block;
}
