/* ===================================================================
   MAXI MALT — hero section
   Drop this in alongside hero3d.js. Everything is namespaced `malt-hero`.
   Layout: the WebGL stage is full-bleed; copy is absolutely positioned
   top (eyebrow) and bottom (sub + CTAs) so it never fights the lettering.
   =================================================================== */

.malt-hero {
  --malt-amber: #d9821f;
  --malt-ink: #f4f1ec;
  --malt-muted: rgba(244, 241, 236, 0.66);
  /* Deep navy, matching the nav bar and the section below. The WebGL stage
     paints the same palette as a cyclorama, so the canvas edge is invisible;
     this shows before the canvas fades in and behind the fallback. */
  --malt-bg: #070c1c;

  position: relative;
  isolation: isolate;
  width: 100%;
  min-height: 100svh;
  overflow: hidden;
  background:
    radial-gradient(70% 52% at 46% 46%, #16244f 0%, #0d1533 48%, #070c1c 100%),
    var(--malt-bg);
  color: var(--malt-ink);
}

/* ---------- WebGL stage ---------- */

.malt-hero__stage {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.malt-hero__canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
  opacity: 0;
  transition: opacity 900ms ease;
}

.malt-hero__stage.is-ready .malt-hero__canvas { opacity: 1; }

/* Cheap, GPU-free bloom: a soft warm pool behind, a vignette in front.
   Doing this in CSS instead of a post-processing pass costs zero frame
   time and reads near-identically on a dark stage. */
.malt-hero__glow,
.malt-hero__grain,
.malt-hero__vignette {
  position: absolute;
  z-index: 1;
  pointer-events: none;
}

/* Screen-blended over the canvas: this is the bloom pass. It only ever adds
   light, so the stage stays dark and the lit areas gain a halo. */
.malt-hero__glow {
  inset: -10%;
  background:
    radial-gradient(38% 32% at 46% 48%, rgba(255, 168, 76, 0.20), transparent 70%),
    radial-gradient(66% 52% at 58% 44%, rgba(120, 160, 235, 0.10), transparent 72%);
  mix-blend-mode: screen;
  filter: blur(8px);
}

/* Film grain — kills the banding big soft gradients produce on 8-bit
   displays, and gives the flat areas a little tooth. */
.malt-hero__grain {
  inset: 0;
  z-index: 2;
  opacity: 0.42;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.4'/%3E%3C/svg%3E");
  background-size: 140px 140px;
}

.malt-hero__vignette {
  inset: 0;
  z-index: 3;
  background:
    radial-gradient(116% 96% at 50% 40%, transparent 38%, rgba(2, 5, 14, 0.62) 100%),
    linear-gradient(to bottom, rgba(2, 5, 14, 0.6) 0%, transparent 20%,
                                transparent 62%, rgba(2, 5, 14, 0.85) 100%);
}

/* ---------- copy ---------- */

.malt-hero__eyebrow {
  position: absolute;
  z-index: 5;
  top: clamp(6.5rem, 13vh, 9rem);
  left: 50%;
  translate: -50% 0;
  margin: 0;
  font-size: clamp(0.64rem, 0.9vw, 0.76rem);
  letter-spacing: 0.42em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--malt-amber);
  opacity: 0;
  animation: malt-rise 900ms 250ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* The 3D lettering IS the headline, so the real <h1> is visually hidden
   but still available to search engines and screen readers. */
.malt-hero__headline {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.malt-hero__content {
  position: absolute;
  z-index: 5;
  left: 50%;
  bottom: clamp(5.5rem, 12vh, 8rem);
  translate: -50% 0;
  width: min(100%, 46rem);
  display: grid;
  justify-items: center;
  gap: 1.6rem;
  padding: 0 1.5rem;
  text-align: center;
}

.malt-hero__sub {
  max-width: 44ch;
  margin: 0;
  font-size: clamp(0.95rem, 1.3vw, 1.05rem);
  line-height: 1.65;
  color: var(--malt-muted);
  opacity: 0;
  animation: malt-rise 900ms 460ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.malt-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  justify-content: center;
  opacity: 0;
  animation: malt-rise 900ms 600ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.malt-btn {
  --_bg: var(--malt-amber);
  --_fg: #100b05;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.95rem 1.9rem;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--_bg);
  color: var(--_fg);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: transform 240ms cubic-bezier(0.22, 1, 0.36, 1),
              border-color 240ms ease, box-shadow 240ms ease;
}

.malt-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px -12px rgba(200, 118, 31, 0.85);
}

.malt-btn--ghost {
  --_bg: transparent;
  --_fg: var(--malt-ink);
  border-color: rgba(244, 241, 236, 0.22);
  backdrop-filter: blur(6px);
}

.malt-btn--ghost:hover {
  border-color: rgba(244, 241, 236, 0.5);
  box-shadow: none;
}

.malt-btn:focus-visible {
  outline: 2px solid var(--malt-amber);
  outline-offset: 3px;
}


/* ---------- fallback for no-WebGL / load failure ---------- */

.malt-hero__fallback {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: none;
  /* The still we fall back to is the logo lockup, not a full-bleed render, so
     it is contained rather than cropped. Swap for a still render + `cover`. */
  object-fit: contain;
  padding: 12vh 8vw;
}

.malt-hero__stage.is-unsupported .malt-hero__fallback,
.malt-hero__stage.is-error .malt-hero__fallback { display: block; }

/* ---------- motion ---------- */

@keyframes malt-rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}


@media (prefers-reduced-motion: reduce) {
  .malt-hero__eyebrow,
  .malt-hero__sub,
  .malt-hero__actions { opacity: 1; animation: none; }
  .malt-hero__canvas { transition: none; }
}

@media (max-width: 720px) {
  .malt-hero__content { bottom: 4.5rem; gap: 1.25rem; }
  .malt-hero__eyebrow { top: 5.5rem; letter-spacing: 0.3em; }
  .malt-btn { padding: 0.85rem 1.5rem; }
}

/* Short phones (375x667, 320x568): a tighter copy block, so the sub line stays one
   line, the buttons one row, and the 3D stack keeps its band (BugHerd #46). */
@media (max-width: 720px) and (max-height: 700px) {
  .malt-hero__content { bottom: 2.75rem; gap: 0.9rem; }
  .malt-hero__sub { font-size: 0.8rem; line-height: 1.5; }
  .malt-hero__actions { gap: 0.6rem; }
  .malt-btn { padding: 0.7rem 1.1rem; font-size: 0.72rem; letter-spacing: 0.12em; }
}
