/**
 * hero-variants.css — Phase 7 — hero carousel V1–V5 visual styles.
 *
 * Ported verbatim from design_handoff_koallabs_homepage/prototype/hero-variants.css.
 * Loaded only on / via koallabs/homepage. Activation logic lives in
 * js/hero-carousel.js (Drupal.behavior — random variant per page-load per D-07).
 *
 * V1: Shadow-AI audit terminal (CSS @keyframes blink + pulse)
 * V2: Cycling pain phrase (JS setInterval swap; CSS transition .cycling.out)
 * V3: Before/After columns (CSS @keyframes float on .tool-chaos .chip)
 * V4: Readiness gauge mockup (CSS transition width 1.2s cubic-bezier(.2,.8,.2,1))
 * V5: Data-flow SVG (SMIL animation — CSS only styles the container)
 *
 * Reduced-motion (D-12 handoff default): all decorative animations stay on.
 * Mobile <900px (D-12): handoff defaults preserved verbatim.
 */

.hero { padding: 80px 0 60px; position: relative; overflow: hidden; }

/* ---------- V1: Shadow-AI audit (split asymmetric + live terminal) ---------- */
.hero.v1 { padding: 96px 0 80px; }
.hero.v1 .bg {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(800px 500px at 82% 10%, rgba(0,212,170,0.10), transparent 60%),
    radial-gradient(600px 400px at 10% 90%, rgba(0,212,170,0.05), transparent 60%);
}
.hero.v1 .grid {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: 1.05fr 1fr; gap: 72px; align-items: center;
}
.hero.v1 h1 { max-width: 14ch; }
.hero.v1 .lead { max-width: 46ch; }

/* Audit panel */
.audit-panel {
  background: var(--color-card); border: 1px solid var(--color-border);
  border-radius: 10px; overflow: hidden;
  box-shadow: 0 30px 80px -30px rgba(0,0,0,0.55);
}
.audit-panel .head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--color-border);
  background: linear-gradient(180deg, rgba(26,26,36,0.8), rgba(19,19,26,0.4));
}
.audit-panel .head .title {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.12em; color: var(--color-foreground);
  display: flex; align-items: center; gap: 10px;
}
.audit-panel .head .dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--color-accent);
  box-shadow: 0 0 0 4px rgba(0,212,170,0.18); animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 4px rgba(0,212,170,0.18);} 50% { box-shadow: 0 0 0 8px rgba(0,212,170,0.05);} }
.audit-panel .head .status { font-family: var(--font-mono); font-size: 11px; color: var(--color-foreground-subtle); letter-spacing: 0.1em; }

.audit-panel .body { padding: 6px 0 14px; }
.audit-row {
  display: grid; grid-template-columns: auto 1fr auto auto; gap: 16px; align-items: center;
  padding: 12px 18px; border-bottom: 1px solid rgba(34,34,46,0.6);
  font-family: var(--font-mono); font-size: 13px;
}
.audit-row:last-child { border-bottom: none; }
.audit-row .tool { color: var(--color-foreground); letter-spacing: 0.02em; }
.audit-row .meta { color: var(--color-foreground-subtle); font-size: 11px; }
.audit-row .users { color: var(--color-foreground-muted); font-size: 12px; }
.audit-row .tag {
  font-size: 10px; letter-spacing: 0.1em; padding: 3px 8px; border-radius: 4px;
  border: 1px solid currentColor; font-weight: 600;
}
.audit-row .tag.risk { color: var(--color-score-weak); }
.audit-row .tag.watch { color: var(--color-score-mid); }
.audit-row .tag.ok { color: var(--color-score-strong); }
.audit-row .icon {
  width: 28px; height: 28px; border-radius: 6px; background: var(--color-background-secondary);
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 11px; color: var(--color-foreground-muted); font-weight: 600;
}
.audit-panel .foot {
  padding: 14px 18px; border-top: 1px solid var(--color-border);
  display: flex; justify-content: space-between; align-items: center;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; color: var(--color-foreground-subtle);
  background: rgba(10,10,15,0.4);
}
.audit-panel .foot .right { color: var(--color-accent); }

/* Caret */
.caret { display: inline-block; width: 2px; height: 0.9em; background: var(--color-accent); animation: blink 1s step-end infinite; vertical-align: -2px; margin-left: 4px; }
@keyframes blink { 50% { opacity: 0; } }

/* ---------- V2: Centered + cycling pain list ---------- */
.hero.v2 { padding: 120px 0 96px; text-align: center; position: relative; }
.hero.v2 .bg {
  position: absolute; inset: 0; z-index: 0;
  background-image:
    linear-gradient(rgba(34,34,46,0.5) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34,34,46,0.5) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, #000 30%, transparent 75%);
  opacity: 0.5;
}
.hero.v2 .content { position: relative; z-index: 1; max-width: 900px; margin: 0 auto; padding: 0 32px; }
.hero.v2 .eyebrow { justify-content: center; margin: 0 auto 28px; display: inline-flex; }
.hero.v2 h1 { font-size: clamp(44px, 6.2vw, 76px); margin-bottom: 28px; line-height: 1.15; }
/* Fixed 2-line height on cycling-wrap stops page jump during phrase swap (founder QA).
   Padding: 6px top/bottom → total height = 2 * 1.15em + 12px via box-sizing: border-box.
   Overflow hidden + line-clamp 2 clip overly long phrases to ellipsis rather than
   letting them bleed out and reintroduce the layout shift. */
.hero.v2 .cycling-wrap {
  display: inline-block; position: relative; min-width: 560px;
  background: linear-gradient(90deg, transparent 0%, rgba(0,212,170,0.08) 20%, rgba(0,212,170,0.08) 80%, transparent 100%);
  padding: 6px 24px; border-radius: 8px;
  height: calc(2.3em + 12px);
  box-sizing: border-box;
  overflow: hidden;
  vertical-align: top;
}
.hero.v2 .cycling {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  color: var(--color-accent);
  font-weight: 600;
  line-height: 1.15;
  overflow: hidden;
  transition: opacity .35s ease, transform .35s ease;
  width: 100%;
  text-align: center;
}
.hero.v2 .cycling.out { opacity: 0; transform: translateY(-8px); }
.hero.v2 .lead { margin: 32px auto 40px; max-width: 62ch; font-size: 19px; }
.hero.v2 .btn-row { justify-content: center; }
.hero.v2 .under-cta { text-align: center; }

/* ---------- V3: Before / After split ---------- */
.hero.v3 { padding: 80px 0 48px; }
.hero.v3 .top {
  max-width: 900px; margin: 0 auto 56px; text-align: center; padding: 0 32px;
}
.hero.v3 .top h1 { margin: 0 auto 20px; max-width: 18ch; }
.hero.v3 .top .lead { margin: 0 auto 28px; }
.hero.v3 .top .btn-row { justify-content: center; }

.compare {
  display: grid; grid-template-columns: 1fr auto 1fr; gap: 0;
  max-width: 1280px; margin: 24px auto 0; padding: 0 32px;
  align-items: stretch;
}
.compare .col {
  padding: 32px; border: 1px solid var(--color-border); border-radius: 12px;
  background: var(--color-card); min-height: 360px; position: relative;
}
.compare .col.before { background: linear-gradient(180deg, rgba(255,68,68,0.04), transparent); }
.compare .col.after { background: linear-gradient(180deg, rgba(0,212,170,0.06), transparent); border-color: rgba(0,212,170,0.25); }
.compare .col h3 { margin: 0 0 4px; font-size: 13px; font-family: var(--font-mono); letter-spacing: 0.18em; text-transform: uppercase; color: var(--color-foreground-muted); }
.compare .col.after h3 { color: var(--color-accent); }
.compare .col .cap { margin: 0 0 24px; font-size: 22px; font-weight: 600; line-height: 1.25; }

.tool-chaos { position: relative; height: 220px; margin-top: 12px; }
.tool-chaos .chip {
  position: absolute; padding: 8px 12px; border-radius: 6px;
  background: var(--color-background-secondary); border: 1px solid var(--color-border);
  font-family: var(--font-mono); font-size: 11px; color: var(--color-foreground-muted);
  white-space: nowrap;
  animation: float 5s ease-in-out infinite;
}
.tool-chaos .chip.r { border-color: rgba(255,68,68,0.35); color: #FF9999; background: rgba(255,68,68,0.06); }
.tool-chaos .chip.w { border-color: rgba(245,158,11,0.3); color: #FBC058; background: rgba(245,158,11,0.05); }
@keyframes float { 0%,100% { transform: translateY(0);} 50% { transform: translateY(-6px);} }

.order-diagram { margin-top: 12px; }
.order-row {
  display: grid; grid-template-columns: 28px 1fr auto; gap: 14px; align-items: center;
  padding: 10px 0; border-bottom: 1px dashed rgba(34,34,46,0.8);
}
.order-row:last-child { border-bottom: none; }
.order-row .n {
  width: 24px; height: 24px; border-radius: 50%; background: rgba(0,212,170,0.15);
  color: var(--color-accent); font-family: var(--font-mono); font-size: 11px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center;
}
.order-row .t { font-size: 14px; color: var(--color-foreground); }
.order-row .b { font-family: var(--font-mono); font-size: 11px; color: var(--color-foreground-subtle); letter-spacing: 0.08em; }

.compare .divider {
  width: 72px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: var(--color-accent); font-size: 22px; gap: 8px;
}
.compare .divider .line { width: 1px; flex: 1; background: linear-gradient(180deg, transparent, var(--color-border), transparent); min-height: 40px; }

/* ---------- V4: Scorecard preview (data-led) ---------- */
.hero.v4 { padding: 96px 0 80px; }
.hero.v4 .grid {
  display: grid; grid-template-columns: 1fr 1.1fr; gap: 72px; align-items: center;
}
.hero.v4 .counter {
  font-family: var(--font-mono); font-size: 12px; color: var(--color-foreground-subtle);
  letter-spacing: 0.1em; margin-bottom: 24px;
}
.scorecard-preview {
  background: var(--color-card); border: 1px solid var(--color-border);
  border-radius: 12px; padding: 28px; box-shadow: 0 30px 80px -30px rgba(0,0,0,0.55);
  position: relative;
}
.scorecard-preview::before {
  content: ''; position: absolute; inset: -1px; border-radius: 12px; pointer-events: none;
  background: linear-gradient(180deg, rgba(0,212,170,0.3), transparent 40%);
  mask: linear-gradient(#000, #000) content-box, linear-gradient(#000, #000);
  -webkit-mask-composite: xor; mask-composite: exclude;
  padding: 1px;
}
.scorecard-preview .sc-head {
  display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 24px;
}
.scorecard-preview .sc-head .l { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.18em; color: var(--color-foreground-subtle); text-transform: uppercase; }
.scorecard-preview .sc-head .r { font-family: var(--font-mono); font-size: 12px; color: var(--color-foreground-muted); }
.scorecard-preview .overall {
  display: flex; align-items: baseline; gap: 16px; margin-bottom: 6px;
}
.scorecard-preview .overall .big {
  font-size: 56px; font-weight: 600; color: var(--color-accent);
  letter-spacing: -0.02em; line-height: 1;
}
.scorecard-preview .overall .band {
  font-size: 13px; color: var(--color-foreground-muted); font-family: var(--font-mono);
  padding: 4px 8px; border: 1px solid var(--color-border); border-radius: 4px;
}
.scorecard-preview .cohort {
  font-size: 13px; color: var(--color-foreground-subtle); margin-bottom: 28px;
}
.scorecard-preview .cohort strong { color: var(--color-foreground-muted); }

.pillar-row { margin-bottom: 14px; }
.pillar-row:last-child { margin-bottom: 0; }
.pillar-row .head {
  display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px;
  font-size: 14px;
}
.pillar-row .head .name { color: var(--color-foreground); }
.pillar-row .head .val { font-family: var(--font-mono); color: var(--color-foreground-muted); font-size: 13px; }
.pillar-row .track { height: 8px; background: var(--color-background-secondary); border-radius: 4px; overflow: hidden; }
.pillar-row .fill { height: 100%; border-radius: 4px; transition: width 1.2s cubic-bezier(.2,.8,.2,1); }
.pillar-row .fill.weak { background: var(--color-score-weak); }
.pillar-row .fill.mid { background: var(--color-score-mid); }
.pillar-row .fill.strong { background: var(--color-score-strong); }

/* ---------- V5: Data-flow full-bleed ---------- */
.hero.v5 { padding: 80px 0 64px; position: relative; }
.hero.v5 .intro {
  max-width: 900px; margin: 0 auto 40px; text-align: center; padding: 0 32px;
}
.hero.v5 .intro h1 { margin: 0 auto 20px; max-width: 20ch; }
.hero.v5 .intro .lead { margin: 0 auto 28px; }
.hero.v5 .intro .btn-row { justify-content: center; }

.flow-stage {
  max-width: 1280px; margin: 8px auto 0; padding: 40px 32px 0;
  position: relative;
}
.flow-svg { width: 100%; height: auto; display: block; }
.flow-legend {
  display: flex; justify-content: center; gap: 36px; margin-top: 18px;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.1em; color: var(--color-foreground-muted);
}
.flow-legend span { display: inline-flex; align-items: center; gap: 8px; }
.flow-legend .d { width: 8px; height: 8px; border-radius: 50%; }
.flow-legend .d.r { background: var(--color-score-weak); }
.flow-legend .d.g { background: var(--color-accent); }

/* responsive — D-12: mobile <900px handoff defaults preserved verbatim. */
@media (max-width: 900px) {
  .hero.v1 .grid, .hero.v4 .grid { grid-template-columns: 1fr; gap: 40px; }
  .compare { grid-template-columns: 1fr; }
  .compare .divider { width: auto; flex-direction: row; padding: 12px 0; }
  .compare .divider .line { min-height: 1px; height: 1px; width: 40px; background: linear-gradient(90deg, transparent, var(--color-border), transparent); }
  .hero.v2 .cycling-wrap { min-width: 0; width: 100%; }
}

/* Mobile (<768px) — Option D: strip decorative hero panels + shrink typography.
   Applied during Task 4 founder QA: decorative panels (audit terminal, chip-
   chaos + roadmap, scorecard preview, data-flow SVG) don't scale cleanly at
   390-767px so each variant shows just headline + lead + CTAs. Variant
   rotation still runs so the A/B copy-test remains intact on mobile. */
@media (max-width: 767px) {
  /* Shrink headline clamp so 44px minimum doesn't wrap ugly on 390px width */
  .hero h1 { font-size: clamp(30px, 8vw, 44px); line-height: 1.1; margin-bottom: 20px; }
  .hero.v2 h1 { font-size: clamp(30px, 8vw, 44px); line-height: 1.15; }
  .hero p.lead { font-size: 16px; margin-bottom: 24px; }

  /* Tighten vertical padding — legacy padding feels cavernous on mobile */
  .hero.v1, .hero.v4 { padding: 56px 0 48px; }
  .hero.v2 { padding: 64px 0 56px; }
  .hero.v3 { padding: 56px 0 32px; }
  .hero.v5 { padding: 56px 0 48px; }
  .hero.v5 .intro { padding-bottom: 0; }

  /* Strip decorative panels per variant — preserve copy + CTAs only */
  .audit-panel,          /* V1 — shadow-AI discovery terminal */
  .compare,              /* V3 — chip chaos + 5-row "Where SAFE-AI takes you" */
  .scorecard-preview,    /* V4 — readiness gauge bars */
  .flow-stage            /* V5 — data-flow SVG */
  {
    display: none;
  }

  /* Hide the "Take the free Scorecard" primary CTA in hero btn-rows on mobile:
     the sticky header already shows "Take the Scorecard" at all times, so the
     hero repeat is redundant. Center the remaining "Book a discovery call". */
  .hero .btn-row .btn-primary { display: none; }
  .hero .btn-row { justify-content: center; }
}

/* D-12 handoff default: reduced-motion leaves decorative hero animations ON.
   (V2 cycling + V5 SMIL are purely decorative; there is no posture stricter
   than the prototype default.) Blocks exist so future tightening lives here. */
@media (prefers-reduced-motion: reduce) {
  /* No overrides — handoff defaults preserved verbatim per D-12. */
}
