/* ============ HERO COVER — adopted from heroweave (3D tiled wall) ============
   Scene layer + poster fallback + content placement only.
   Typography/colors/buttons reuse the site design system (editorial.css). */

.hw-hero {
  isolation: isolate;
  position: relative;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  min-height: clamp(680px, 92svh, 1100px);
  /* poster = static frame of the live scene (also the fallback for mobile,
     reduced-motion, low-end and failed loads) */
  background: #121118 url("/assets/01a11ce3-2215-7bce-a1b3-4d57c207760f/hero-tiles-poster.webp") center/cover no-repeat;
}

/* live scene layer — fades in over the poster once loaded */
.hw-scene-layer {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: var(--paper);
  opacity: 0;
  transition: opacity .7s ease;
  filter: hue-rotate(135deg) saturate(.68);
}
.hw-scene-layer spline-viewer { display: block; width: 100%; height: 100%; }
.hw-scene-live .hw-scene-layer { opacity: 1; }

/* legibility shade (identical gradients to the cover) */
.hw-shade {
  pointer-events: none;
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(90deg, #121118, #121118f0 12%, #121118c7 32%, #12111824 60%, #0000 78%),
    linear-gradient(#12111880, #0000 18%, #0000 78%, #121118);
}

/* content column */
.hw-content {
  position: relative;
  z-index: 2;
  pointer-events: none;
  width: 100%;
  max-width: 800px;
  padding: clamp(96px, 16vh, 160px) 24px clamp(88px, 13vh, 142px) 5.4%;
}
.hw-content .kicker { margin: 0 0 27px; }
.hw-content .display-1 {
  margin: 0 0 29px;
  font-size: clamp(3.25rem, 6.5vw, 6.4rem);
  line-height: 1.035;
}
.hw-content .lede { margin: 0 0 30px; }
.hw-actions { display: flex; flex-wrap: wrap; gap: 12px; pointer-events: none; }
.hw-actions .btn { pointer-events: auto; }

/* entrance (cover's fade-up; delay via --hw-delay) */
.hw-enter { animation: hw-fade-up .8s cubic-bezier(.16, 1, .3, 1) both; animation-delay: var(--hw-delay, 0ms); }
@keyframes hw-fade-up {
  0%   { opacity: 0; filter: blur(4px); transform: translateY(20px); }
  100% { opacity: 1; filter: blur(0);  transform: translateY(0); }
}

/* scene tools (pause/play + reset) — desktop, live scene only */
.hw-tools {
  position: absolute;
  z-index: 4;
  top: 110px;
  right: 5.4%;
  display: none;
  gap: 8px;
}
.hw-tools button {
  width: 39px; height: 39px; min-height: 39px;
  display: grid; place-items: center;
  color: var(--ink-dim);
  background: #12111866;
  border: 1px solid #edecef26;
  border-radius: 2px;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  cursor: pointer;
  transition: color .2s, border-color .2s;
}
.hw-tools button:hover { color: var(--iris-soft); border-color: var(--iris-soft); }
.hw-tools button[disabled] { opacity: .35; pointer-events: none; }
.hw-tools svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.hw-hint {
  position: absolute;
  z-index: 3;
  bottom: 116px;
  right: 5.4%;
  display: none;
  align-items: center;
  gap: 12px;
  pointer-events: none;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .02em;
  color: var(--ink-dim);
}
.hw-hint svg { width: 24px; height: 24px; fill: none; stroke: var(--iris-soft); stroke-width: 1.5; }
@media (min-width: 768px) {
  .hw-hero:not(.hw-static) .hw-tools,
  .hw-hero:not(.hw-static) .hw-hint { display: flex; }
}

/* when 3D is unavailable/degraded, tools + hint are pointless */
.hw-hero.hw-static .hw-tools,
.hw-hero.hw-static .hw-hint { display: none !important; }

@media (min-width: 1600px) {
  .hw-content { max-width: 950px; }
}

@media (max-width: 640px) {
  /* dedicated portrait poster = heroweave's actual mobile scene framing
     (canvas shifted left -80%, bottom 25%) */
  .hw-hero {
    min-height: 100vh;                 /* fallback */
    min-height: 100svh;                /* hero fills the screen; content bottom-anchored */
    max-height: none;
    background-image: url("/assets/01a11cfa-bba8-7907-80b7-3c142b355df0/hero-tiles-poster-mobile.webp");
    background-position: center top;
  }
  .hw-shade {
    background: linear-gradient(#12111866, #0000 18%, #12111821 38%, #121118f0 65%, #121118 84%, #121118);
  }
  /* content anchored to the hero's bottom edge: scene band scales with the
     phone, kicker ~25% down, CTAs + trust rows always inside the fold */
  .hw-content { max-width: 100%; padding: 24px 24px clamp(72px, 10svh, 110px); }
  .hw-actions { gap: 10px; }
  .hw-actions .btn { flex: 1 1 100%; justify-content: center; }
  .hw-content .display-1 { margin-bottom: 20px; font-size: clamp(2.6rem, 11.8vw, 4.6rem); }
  .hw-content .kicker { margin-bottom: 19px; }
  .hw-content .lede { margin-bottom: 24px; font-size: 1rem; line-height: 1.6; }
  /* second trust row (AI names) drops on phones — keeps everything inside the fold
     (mobile-hero discipline: caption lines collapse on small screens) */
  .hw-content > p.font-mono:last-of-type { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .hw-enter { animation: none; }
  .hw-scene-layer { transition: none; }
}
