/* Hero — Undertow + Diagnostic
 * ----------------------------------------------------------
 * Class-driven CSS for the vanilla hero. Every class is namespaced
 * `.hu-*` so it can drop into a vanilla site without collisions.
 *
 * Expects CSS custom properties from the site (--primary, --accent,
 * --accent-gold, --text-primary, --text-secondary, --text-muted,
 * --border). All already defined in styles-homepage.css / critical-css.
 */

/* ============ FRAME ============ */
.hu-frame {
  position: relative;
  width: 100%;
  /* Scale with viewport height so the hero never exceeds the visible area on
     shorter laptop screens (~768–900 vh). Floors at 720 so the content always
     fits; caps at the original 900 desktop frame. */
  min-height: clamp(720px, 88vh, 900px);
  background: linear-gradient(180deg, #050810 0%, #0a0e1a 55%, #0a1822 100%);
  color: var(--text-primary, #fff);
  overflow: hidden;
  font-family: "Inter", -apple-system, "Helvetica Neue", sans-serif;
  box-sizing: border-box;
}
.hu-frame *, .hu-frame *::before, .hu-frame *::after { box-sizing: border-box; }

/* ============ AMBIENT BACKGROUND ============ */
.hu-bg {
  position: absolute; inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}
.hu-bg-glow {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 60% 50% at 70% -10%,
              rgba(6,182,212,0.18), transparent 60%);
}
.hu-bg-particles { position: absolute; inset: 0; }
.hu-particle {
  position: absolute;
  border-radius: 50%;
  will-change: transform, opacity;
}
.hu-bg-fade {
  position: absolute; inset: 0;
  background: linear-gradient(180deg,
    rgba(5,10,22,0) 0%,
    rgba(5,10,22,0) 30%,
    rgba(5,10,22,0.6) 75%,
    rgba(5,10,22,0.9) 100%);
}

/* Slow sink with a gentle S-sway sideways — suspended underwater motes.
   --sway / --p-op are set per particle for varied drift + depth. */
@keyframes hu-sink {
  0%   { transform: translate(0, -24px); opacity: 0; }
  10%  { opacity: var(--p-op, 0.4); }
  35%  { transform: translate(var(--sway, 10px), 32vh); }
  65%  { transform: translate(calc(var(--sway, 10px) * -1), 64vh); }
  90%  { opacity: var(--p-op, 0.4); }
  100% { transform: translate(0, 122vh); opacity: 0; }
}
@keyframes hu-pulse {
  0%, 100% { box-shadow: 0 0 0 0   rgba(6,182,212,0.6), 0 0 8px #06b6d4; }
  50%      { box-shadow: 0 0 0 6px rgba(6,182,212,0),   0 0 8px #06b6d4; }
}
@keyframes hu-status-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%      { transform: scale(1.4); opacity: 0.5; }
}

/* ============ CONTENT (eyebrow + headline + copy + CTAs) ============ */
.hu-content {
  position: absolute; inset: 0;
  /* Top inset scales with viewport so content clears the nav (~80px fixed) but
     doesn't waste a third of the screen on shorter laptops. Side padding
     matches the rest of the page (.container uses 80px → 40 → 24). */
  padding: clamp(120px, 14vh, 180px) clamp(40px, 6vw, 80px) 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  z-index: 10;
  transition: opacity 0.4s ease;
}
.hu-content--dim { opacity: 0.55; }

.hu-eyebrow-row {
  display: flex; align-items: center; gap: 16px;
  margin-bottom: clamp(24px, 4vh, 40px);
}
.hu-eyebrow-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #06b6d4;
  box-shadow: 0 0 12px #06b6d4;
}
.hu-eyebrow {
  font-size: 13px; font-weight: 500;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #06b6d4;
}

.hu-title {
  /* 7vw scales smoothly between mobile breakpoint (900px → 63px) and ultrawide
     (1920+ → caps at 112). At 1366 laptop: 95px; at 1536: 107px. */
  font-size: clamp(56px, 7vw, 112px);
  font-weight: 200;
  line-height: 0.92;
  letter-spacing: -3px;
  margin: 0;
  max-width: 1100px;
  overflow: visible;
}
.hu-accent-y {
  display: inline-block;
  will-change: transform;
}
.hu-accent-x {
  display: inline-block;
  color: var(--accent-gold, #f59e0b);
  font-style: italic;
  font-weight: 300;
  will-change: transform;
}

.hu-spacer { height: 0; }   /* grows when panel opens, pushes copy + CTAs down */

.hu-description {
  font-size: clamp(16px, 1.4vw, 22px);
  font-weight: 300;
  line-height: 1.55;
  color: var(--text-secondary, #94a3b8);
  max-width: 640px;
  margin: clamp(24px, 3.5vh, 40px) 0 0;
}

.hu-actions {
  display: flex;
  gap: clamp(12px, 1.5vw, 20px);
  margin-top: clamp(28px, 4.5vh, 48px);
  align-items: center;
  flex-wrap: wrap;
}
.hu-cta-primary {
  padding: 18px 40px;
  background: var(--accent, #06b6d4);
  color: var(--primary, #0a0e1a);
  font-size: 15px; font-weight: 500;
  letter-spacing: 0.5px;
  text-decoration: none;
  display: inline-block;
  border: 0;
  cursor: pointer;
  transition: background .3s ease;
}
.hu-cta-primary:hover { background: var(--accent-gold, #f59e0b); }
.hu-cta-ghost {
  padding: 18px 40px;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.2);
  color: var(--text-primary, #fff);
  font-size: 15px; font-weight: 500;
  letter-spacing: 0.5px;
  text-decoration: none;
  display: inline-block;
  cursor: pointer;
  transition: background .3s ease, border-color .3s ease;
}
.hu-cta-ghost:hover {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.4);
}

/* ============ RIGHT-SIDE TRIGGER PILL ============ */
.hu-trigger {
  position: absolute;
  right: clamp(40px, 6vw, 80px);
  top: clamp(180px, 24vh, 268px);    /* tracks the H1 baseline as it scales */
  z-index: 15;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 12px 18px 14px 14px;
  background: rgba(10, 14, 26, 0.78);
  border: 1px solid rgba(6, 182, 212, 0.35);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #e2e8f0;
  font-size: 13px; font-weight: 400;
  letter-spacing: 0.2px;
  white-space: nowrap;
  transition: background 0.25s ease, border-color 0.25s ease,
              transform 0.25s ease, opacity 0.3s ease;
  box-shadow: 0 4px 16px rgba(0,0,0,0.35);
}
.hu-trigger:hover {
  background: rgba(10, 14, 26, 0.95);
  border-color: rgba(6, 182, 212, 0.75);
  transform: translateX(-3px);
  box-shadow: 0 6px 22px rgba(0,0,0,0.5), 0 0 18px rgba(6,182,212,0.22);
}
.hu-trigger--hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateX(8px);
}
.hu-trigger-main {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.hu-trigger-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #06b6d4;
  box-shadow: 0 0 8px #06b6d4;
  animation: hu-pulse 2.2s ease-in-out infinite;
  flex-shrink: 0;
}
.hu-trigger-arrow {
  color: #06b6d4;
  font-size: 14px;
  margin-left: 4px;
  transition: transform 0.2s ease;
}
.hu-trigger-subline {
  font-size: 10px; font-weight: 500;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: rgba(6, 182, 212, 0.85);
  padding-left: 18px;   /* aligns under the text, past the dot */
}

/* ============ BOTTOM INFO STRIP ============ */
.hu-strip {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: clamp(16px, 2.5vh, 24px) clamp(40px, 6vw, 80px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid rgba(255,255,255,0.06);
  background: rgba(5,10,22,0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 12;
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1) 0.1s,
              opacity 0.3s ease 0.2s;
}
.hu-strip--hidden {
  transform: translateX(-105%);
  opacity: 0;
  transition: transform 0.55s cubic-bezier(0.7, 0, 0.3, 1) 0s,
              opacity 0.35s ease 0.1s;
}
.hu-strip-left {
  font-size: 13px; font-weight: 500;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-secondary, #94a3b8);
}
.hu-strip-center {
  display: flex; gap: 48px;
  align-items: center;
}
.hu-strip-item {
  font-size: 13px; font-weight: 400;
  color: var(--text-muted, #64748b);
  letter-spacing: 0.5px;
}
.hu-strip-item-strong { color: #e2e8f0; }

/* ============ DIAGNOSTIC PANEL (right-side) ============ */
.hu-panel {
  position: absolute;
  right: clamp(40px, 6vw, 80px);
  top: clamp(120px, 16vh, 160px);
  bottom: clamp(80px, 8vh, 100px);
  width: clamp(420px, 42vw, 600px);
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px) scale(0.985);
  transition: opacity 0.35s ease,
              transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
  cursor: default;
}
.hu-panel--open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
  cursor: pointer;
}
.hu-panel-frame {
  width: 100%;
  height: 100%;
  max-height: 580px;   /* original design size — caps growth on tall screens */
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(10,14,26,0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  position: relative;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,0.55);
}

.hu-panel-header {
  padding: 20px 28px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.hu-panel-header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}
.hu-panel-title {
  font-size: 12px; font-weight: 500;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #06b6d4;
}
.hu-panel-status {
  font-size: 11px;
  color: var(--text-muted, #64748b);
  letter-spacing: 1px;
  text-transform: uppercase;
  display: flex; align-items: center; gap: 8px;
}
.hu-status-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #06b6d4;
  box-shadow: 0 0 8px #06b6d4;
  animation: hu-status-pulse 2s ease-in-out infinite;
}

.hu-panel-controls {
  display: flex; gap: 12px;
  align-items: center;
}
.hu-panel-cue {
  font-size: 10px; font-weight: 500;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: rgba(148,163,184,0.6);
}
.hu-panel-cue--pinned { color: #06b6d4; }
.hu-close-btn {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--text-secondary, #94a3b8);
  width: 26px; height: 26px;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  line-height: 1;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .25s ease, color .25s ease;
}
.hu-close-btn:hover {
  background: rgba(255,255,255,0.06);
  color: var(--text-primary, #fff);
}

.hu-pillars-grid {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
}
.hu-pillar {
  padding: 28px;
  cursor: pointer;
  transition: background 0.25s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}
.hu-pillar:nth-child(odd) { border-right: 1px solid rgba(255,255,255,0.06); }
.hu-pillar:nth-child(-n+2) { border-bottom: 1px solid rgba(255,255,255,0.06); }
.hu-pillar--active { background: rgba(6,182,212,0.06); }
.hu-pillar-stripe {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 2px;
  background: #06b6d4;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.hu-pillar--active .hu-pillar-stripe { opacity: 1; }
.hu-pillar-num {
  font-size: 11px; font-weight: 500;
  letter-spacing: 2px;
  color: var(--text-muted, #64748b);
}
.hu-pillar-title {
  font-size: 22px; font-weight: 300;
  letter-spacing: -0.5px;
  margin: 12px 0 8px;
  color: #e2e8f0;
}
.hu-pillar-symptom {
  font-size: 13px;
  color: var(--text-secondary, #94a3b8);
  line-height: 1.5;
  font-weight: 300;
}
.hu-pillar-cost {
  margin-top: 14px;
  font-size: 13px; font-weight: 400;
  color: var(--accent-gold, #f59e0b);
  letter-spacing: 0.3px;
  display: flex;
  align-items: center;
  gap: 6px;
  opacity: 0.35;
  transform: translateY(4px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.hu-pillar--active .hu-pillar-cost {
  opacity: 1;
  transform: translateY(0);
}
.hu-pillar-cost-line {
  display: inline-block;
  width: 14px; height: 1px;
  background: var(--accent-gold, #f59e0b);
  margin-right: 4px;
}

.hu-panel-footer {
  padding: 16px 28px;
  border-top: 1px solid rgba(255,255,255,0.06);
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted, #64748b);
  letter-spacing: 0.5px;
}
.hu-panel-footer-cta {
  color: #06b6d4;
  text-decoration: none;
  transition: color .25s ease;
}
.hu-panel-footer-cta:hover { color: var(--accent-gold, #f59e0b); }

/* ============ MOBILE (≤ 900px) ============
   Hero reflows: nav-relative padding shrinks, title scales, the
   right-side trigger drops below the CTAs as a full-width pill,
   and the diagnostic panel docks to the bottom as a drawer. */
@media (max-width: 900px) {
  /* Floor at 560px so the hero fits short phone viewports (iPhone SE-class
     ~667vh) without making CTAs require a scroll. Caps at 720 on tall phones. */
  .hu-frame { min-height: clamp(560px, 86vh, 720px); padding-bottom: 32px; }
  /* Content drops into normal flow on mobile. Use `relative` (not `static`)
     so its z-index stays live and the eyebrow/title/copy/CTAs paint ABOVE
     the .hu-bg fade — `static` nullifies z-index, letting the bottom fade
     (up to 0.9 opacity) veil the CTAs. `relative` keeps normal flow order. */
  .hu-content { position: relative; z-index: 10; inset: auto; padding: 110px 24px 0; }
  .hu-title { font-size: clamp(40px, 9vw, 60px); letter-spacing: -1.5px; line-height: 1; }
  .hu-description { font-size: 16px; margin-top: 24px; }
  .hu-actions { gap: 12px; flex-wrap: wrap; }
  .hu-cta-primary, .hu-cta-ghost { padding: 14px 22px; font-size: 13px; }
  /* The headline-drop animation depends on the right-side layout that
     doesn't exist on mobile — pin the accent in place. */
  .hu-accent-y, .hu-accent-x {
    transform: none !important;
  }
  .hu-spacer { height: 0 !important; }
  /* Trigger pill + diagnostic panel — hidden on mobile. The pill's wording
     duplicates the primary CTA ("Find what's pulling you under"), its drawer
     repeats the four Problem Cards below, and the hover/pin interaction is
     desktop-native. Removing it gives a clean eyebrow → title → copy → CTAs. */
  .hu-trigger,
  .hu-panel { display: none; }
  /* Bottom strip — hide on mobile, redundant with the banner stats */
  .hu-strip { display: none; }
}

/* Reduced motion — disable drift / pulse / status animations */
@media (prefers-reduced-motion: reduce) {
  .hu-particle,
  .hu-trigger-dot,
  .hu-status-dot { animation: none !important; }
  .hu-accent-y, .hu-accent-x, .hu-spacer, .hu-strip, .hu-panel {
    transition-duration: 0.01ms !important;
  }
}
