/* ==========================================================================
   Hero
   Fit strategy (laptops/desktops, ≥ 64em wide):
   - Height is 100svh. svh is the *small* viewport height, i.e. what is left
     once browser toolbars are showing, so the hero ends above the fold on a
     1920×1080 screen (~950px visible), 1536×864 (~740), 1440×900 (~780) and
     1366×768 (~650) alike.
   - Headline size is the smallest of: a width-based value, a height-based
     value (svh) and an absolute cap (tokens.css → --display-hero), so the
     copy block can never outgrow the space under the header.
   - The photo is sized from svh too, and a short-viewport query trims
     secondary copy before anything can overflow.
   ========================================================================== */

.hero {
  position: relative;
  isolation: isolate;
  height: 100vh;               /* fallback */
  height: 100svh;
  min-height: 34rem;
  display: flex;
  align-items: center;
  --display-hero: clamp(2.4rem, min(5.4vw, 11svh, 5.5rem), 5.5rem);
  padding-top: calc(var(--header-h) + clamp(0.5rem, 2svh, 1.5rem));
  padding-bottom: clamp(3.5rem, 9svh, 5.5rem);
  color: var(--text-on-dark);
  background: linear-gradient(180deg, #0a5f82 0%, #064058 42%, var(--abyss-950) 100%);
  overflow: hidden;
}

/* ---------- Background field: waves + thermal glows ---------- */
.hero__field { position: absolute; inset: 0; z-index: -1; pointer-events: none; }

.hero__waves {
  position: absolute;
  left: 0; top: 0;
  height: 100%;
  width: clamp(5.5rem, 14vw, 13rem);
  opacity: 0.5;
}
/* Each line is a faint solid stream with a longer bright "gust" travelling along it.
   pathLength is normalised to 1000, so every gust loops seamlessly. */
.hero__wave-base { display: none; } /* no track: only the moving gusts show */
.hero__wave {
  stroke-dasharray: 220 780;
  animation: wave-flow 16s linear infinite;
}
.hero__wave--2 { animation-duration: 20s; animation-delay: -6s; }
.hero__wave--3 { animation-duration: 24s; animation-delay: -11s; }
.hero__wave--4 { animation-duration: 28s; animation-delay: -3s; }
.hero__wave--5 { animation-duration: 32s; animation-delay: -17s; }
@keyframes wave-flow { to { stroke-dashoffset: 1000; } }

.hero__glow { position: absolute; border-radius: 50%; filter: blur(60px); }
.hero__glow--cold {
  width: 55vw; aspect-ratio: 1;
  left: -15vw; top: -20vw;
  background: radial-gradient(circle, rgb(46 196 241 / 0.4), transparent 65%);
}
.hero__glow--warm {
  width: 50vw; aspect-ratio: 1;
  right: -12vw; bottom: -22vw;
  background: radial-gradient(circle, rgb(242 137 74 / 0.5), rgb(211 171 125 / 0.2) 45%, transparent 68%);
}

/* ---------- Layout ---------- */
.hero__inner {
  display: grid;
  gap: clamp(1.5rem, 3vw, 3rem);
  align-items: center;
}

/* Headline: one <h1> in two parts. The small line keeps the keywords
   (Sydney's trusted subfloor ventilation experts); the large line is the
   promise the visitor reads first. */
.hero__title {
  font-size: var(--display-hero);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -0.012em;
  color: #fff;
  text-wrap: balance;
}
.hero__title-kicker {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: clamp(0.7rem, 2svh, 1.25rem);
  font-family: var(--font-body);
  font-size: clamp(0.74rem, 0.68rem + 0.28vw, 0.95rem);
  font-weight: 700;
  letter-spacing: 0.16em;
  line-height: 1.35;
  text-transform: uppercase;
  color: var(--cyan-300);
}
.hero__title-kicker::before {
  content: "";
  flex: none;
  width: 2.25rem; height: 2px;
  background: var(--sand-400);
}
.hero__title-main { display: block; }
.hero__em {
  color: var(--sand-400);
  white-space: nowrap;
}

.hero__lede {
  max-width: 34rem;
  margin-top: clamp(0.7rem, 2svh, 1.3rem);
  font-size: clamp(0.98rem, min(1.2vw, 2.4svh) + 0.3rem, 1.15rem);
  line-height: 1.55;
  color: var(--text-muted-on-dark);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: clamp(1rem, 3.2svh, 2rem);
}

/* ---------- Media + floating panels ---------- */
.hero__media { position: relative; justify-self: center; width: 100%; max-width: 38rem; }

.hero__photo {
  position: relative;
  margin: 0;
  aspect-ratio: 5 / 4;
  border-radius: 1.25rem 3.5rem 1.25rem 3.5rem;
  overflow: hidden;
}
/* The image is a little larger than its frame, so the pointer parallax can
   shift it without ever revealing the background behind it. */
.hero__photo { background: var(--abyss-900); }
.hero__photo img {
  position: absolute;
  inset: -4%;
  width: 108%; height: 108%;
  max-width: none;
  object-fit: cover;
}
.hero__photo::after {
  content: "";
  position: absolute; inset: 0;
  background:
    linear-gradient(135deg, rgb(9 84 115 / 0.4), transparent 55%),
    linear-gradient(315deg, rgb(242 137 74 / 0.28), transparent 50%);
  mix-blend-mode: soft-light;
}

.float-panel {
  position: absolute;
  z-index: var(--z-float);
  display: grid;
  gap: 0.2rem;
  padding: 0.85rem 1.1rem;
  border-radius: var(--radius-m);
  font-size: 0.95rem;
  animation: float-bob 7s var(--ease-in-out) infinite;
}
/* Darker glass so the text stays readable over bright or white photos */
.float-panel.glass-dark {
  background: linear-gradient(135deg, rgb(2 18 25 / 0.55), rgb(3 27 38 / 0.61));
  border-color: rgb(236 248 254 / 0.28);
  box-shadow: 0 1rem 2rem -0.75rem rgb(2 18 25 / 0.55), inset 0 1px 0 rgb(255 255 255 / 0.16);
}
.float-panel strong { font-family: var(--font-display); font-weight: 500; font-size: 1.15rem; letter-spacing: 0.03em; }
.float-panel__label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sand-400);
}
.float-panel__row { display: flex; align-items: center; gap: 0.6rem; }
.float-panel--a { top: 4%; left: -7%; }
.float-panel--b { bottom: -5%; right: 2%; animation-delay: -3.5s; }

@keyframes float-bob { 50% { translate: 0 -0.55rem; } }

/* Location pin with a slow "ping" ring: the panel says "Across Greater Sydney" */
.pin { position: relative; display: grid; place-items: center; width: 1.6rem; height: 1.6rem; color: var(--cyan-300); }
.pin svg { position: relative; width: 1.35rem; height: 1.35rem; }
.pin i {
  position: absolute; inset: 0.15rem;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  opacity: 0;
  animation: pin-ping 2.8s var(--ease-out-expo) infinite;
}
.pin i:nth-child(2) { animation-delay: 1.4s; }
@keyframes pin-ping { 0% { transform: scale(0.4); opacity: 0.8; } 100% { transform: scale(1.9); opacity: 0; } }

/* ---------- Scroll cue ---------- */
.hero__cue {
  display: none;
  position: absolute;
  left: var(--gutter);
  bottom: clamp(1.25rem, 3.6svh, 2.25rem);
  align-items: center;
  gap: 0.8rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted-on-dark);
  text-decoration: none;
}
.hero__cue i { position: relative; width: 2.5rem; height: 1px; background: rgb(236 248 254 / 0.3); overflow: hidden; }
.hero__cue i::after {
  content: ""; position: absolute; inset: 0; background: var(--sand-400);
  transform: translateX(-100%);
  animation: cue-run 2.4s var(--ease-in-out) infinite;
}
@keyframes cue-run { to { transform: translateX(100%); } }

/* ---------- Laptop / desktop: two columns, strict single-screen fit ---------- */
@media (min-width: 64em) {
  .hero__inner { grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr); }
  .hero__copy { padding-left: clamp(0rem, 4vw, 4.5rem); }
  .hero__cue {
    display: inline-flex;
    left: calc((100% - min(100% - 2 * var(--gutter), var(--container-max))) / 2 + clamp(0rem, 4vw, 4.5rem));
  }
  /* photo height tracks the visible viewport, never the other way round */
  .hero__media { max-width: calc(60svh * 1.25); }
    .hero__photo { border-radius: 1.25rem 4.5rem 1.25rem 4.5rem; }
}

/* Short laptop viewports (e.g. 1366×768 with toolbars ≈ 650px tall) */
@media (min-width: 64em) and (max-height: 44rem) {
  .hero__lede { max-width: 31rem; }
  .float-panel--b { display: none; }
}
@media (min-width: 64em) and (max-height: 36rem) {
  .hero__lede { display: none; }
}

/* ---------- Tablet & mobile: stacked, comfortably taller than one screen is fine ---------- */
@media (max-width: 63.99em) {
  .hero {
    height: auto;
    min-height: 100svh;
    align-items: flex-start;
    padding-top: calc(var(--header-h) + 1.5rem);
    padding-bottom: 6.5rem;
  }
  .hero { --display-hero: clamp(2.3rem, min(11.5vw, 9svh), 4.4rem); }
  .hero__media { max-width: 32rem; margin-top: 1rem; }
  .float-panel--a { left: 0; top: -6%; }
  .float-panel--b { right: 0; bottom: -6%; }
}

@media (max-width: 30em) {
  .hero__actions .btn { width: 100%; justify-content: space-between; }
  .float-panel { padding: 0.65rem 0.85rem; font-size: 0.85rem; }
  .float-panel strong { font-size: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  .float-panel, .hero__wave, .pin i, .hero__cue i::after { animation: none; }
  .hero__wave { display: none; }
}

/* ---------- Pre-hide for the hero intro ----------
   Applied from first paint when JS is on; js/hero.js lifts it (class
   "hero-ready") after setting its own start states, and an inline failsafe in
   index.html lifts it after 2.5s even if scripts fail. */
.js:not(.hero-ready) [data-hero-in],
.js:not(.hero-ready) .float-panel { opacity: 0; }
.js:not(.hero-ready) .hero__photo { clip-path: inset(100% 0 0 0); }

/* ---------- Proof strip (marquee) ---------- */
.proof {
  position: relative;
  z-index: 2;
  overflow: hidden;
  padding-block: 1rem;
  background: var(--sand-400);
  color: var(--abyss-900);
}
.proof__track { display: flex; width: max-content; animation: proof-run 48s linear infinite; }
.proof__list { display: flex; flex: none; }
.proof__list li {
  display: flex;
  align-items: center;
  white-space: nowrap;
  font-family: var(--font-display);
  font-size: clamp(1rem, 0.9rem + 0.5vw, 1.3rem);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 500;
}
.proof__list li::after {
  content: "";
  width: 0.55rem; height: 0.55rem;
  margin-inline: clamp(1.25rem, 3vw, 2.5rem);
  background: var(--teal-700);
  transform: rotate(45deg);
}
@keyframes proof-run { to { transform: translateX(-50%); } }

@media (prefers-reduced-motion: reduce) {
  .proof__track { width: auto; animation: none; flex-wrap: wrap; justify-content: center; padding-inline: var(--gutter); }
  .proof__list { flex-wrap: wrap; justify-content: center; row-gap: 0.5rem; }
  .proof__list[aria-hidden="true"] { display: none; }
}