/* ══════════════════════════════════════════════════════════════
   BRØDRA V2 — hero (Figma "brodra v2", 1440 × 1024)
   Loaded after index.css; the navbar lives in css/nav.css.
   ══════════════════════════════════════════════════════════════ */

:root {
  --h2-bg: #090f1e;
  --h2-blue: #0047ff;
  --h2-serif: 'Instrument Serif', 'Times New Roman', serif;
  --h2-sans: 'Instrument Sans', 'Inter', system-ui, sans-serif;
  --h2-geist: 'Geist', 'Inter', system-ui, sans-serif;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}

/* ── HERO ── */
.hero2 {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: max(100vh, 900px);
  padding-top: clamp(130px, 15.6vw, 225px);
  background: var(--h2-bg);
  color: #fff;
}

.hero2-bg { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.hero2-glow { position: absolute; max-width: none; opacity: .55; }
.hero2-glow--l { left: -689px; top: -344px; width: 1463px; height: 1463px; }
.hero2-glow--r { right: -774px; top: 115px; width: 1783px; height: 1783px; opacity: .5; }

.hero2-chev { position: absolute; display: block; max-width: none; }
.hero2-chev--l { left: 0; top: clamp(130px, 15.6vw, 225px); }
.hero2-chev--r { right: 0; top: calc(clamp(130px, 15.6vw, 225px) + 107px); }

.hero2-text {
  position: relative;
  z-index: 2;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0 20px;
}

.hero2-title {
  width: 512px;
  max-width: 100%;
  min-height: calc(2 * 0.875em);
  margin: 0;
  font-family: var(--h2-serif);
  font-weight: 400;
  font-size: 96px;
  line-height: .7696;
  letter-spacing: 0;
  color: #fff;
}
.hero2-hl {
  display: inline-block;
  margin-top: 16px;
  padding: 0 8px;
  line-height: 84px;
}

.hero2-sub {
  width: 536px;
  max-width: 100%;
  margin: 20px 0 0;
  font-family: var(--h2-geist);
  font-weight: 600;
  font-size: 24px;
  line-height: normal;
  letter-spacing: .24px;
  color: #fff;
}

.hero2-cta {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: auto;
  min-width: 320px;
  height: 65px;
  margin-top: 23px;
  padding: 0 8px 0 16px;
  background: #fff;
  color: #000;
  font-family: var(--h2-sans);
  font-weight: 500;
  font-size: 24px;
  text-decoration: none;
  transition: transform .35s cubic-bezier(.2,.7,.1,1), box-shadow .35s ease;
}
.hero2-cta img {
  display: block;
  width: 74px;
  height: 57px;
  margin-right: -2px;
  transition: transform .35s cubic-bezier(.2,.7,.1,1);
}
/* Hover: the blue arrow tile grows to fill the whole button, label turns white */
.hero2-cta {
  isolation: isolate; overflow: hidden;
  --tile-w: 74px; --tile-h: 57px; --tile-r: 6px;   /* tile size + gap to the right edge */
  transition: color .5s var(--h2-ease, ease), transform .3s ease, opacity .9s ease;
}
.hero2-cta::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: var(--h2-blue);
  clip-path: inset(calc((100% - var(--tile-h)) / 2) var(--tile-r) calc((100% - var(--tile-h)) / 2) calc(100% - var(--tile-r) - var(--tile-w)));
  transition: clip-path .65s var(--h2-ease, ease);
}
.hero2-cta:hover, .hero2-cta:focus-visible { color: #fff; }
.hero2-cta:hover::before, .hero2-cta:focus-visible::before { clip-path: inset(-2px -2px -2px -2px); }   /* overshoot: no hairline at the edges */
.hero2-cta:hover img { transform: translateX(4px); }
.hero2-cta:active { transform: scale(.985); }
.hero2-cta:focus-visible { outline: 2px solid #9db4ff; outline-offset: 4px; }

/* ── CLIENT LOGOS: seamless marquee ── */
.hero2-clients {
  position: relative;
  z-index: 2;
  width: 100%;
  margin-top: 70px;
  opacity: 1;
  transform: none;
}
.hero2-marquee {
  display: flex;
  width: max-content;
  animation: hero2-marquee 40s linear infinite;
}
.hero2-clients:hover .hero2-marquee { animation-play-state: paused; }
.hero2-logos {
  display: flex;
  align-items: center;
  gap: 66px;
  height: 86px;
  margin: 0;
  padding: 0 33px;
  list-style: none;
}
.hero2-logos li { flex-shrink: 0; }
.hero2-logos img { display: block; max-width: none; opacity: .92; }
@keyframes hero2-marquee { to { transform: translateX(-50%); } }

/* ── MOUNTAIN RANGE (ridgeline dither canvas) ── */
.hero2-range {
  position: relative;
  z-index: 1;
  flex: 1 0 auto;
  width: 100%;
  min-height: clamp(280px, 30vw, 420px);
  margin-top: -40px;
  overflow: hidden;
}
.hero2-range canvas {
  position: absolute; left: 0; bottom: 0; display: block; max-width: none;
  image-rendering: pixelated; image-rendering: crisp-edges;
}
.rdg-alt {
  position: absolute; left: 0; top: 0; z-index: 2; pointer-events: none; opacity: 0;
  transition: opacity .35s ease;
  font: 500 11px/1 var(--h2-geist); letter-spacing: .08em; color: #fff;
}
.rdg-alt i {
  position: absolute; left: -4px; top: -4px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--h2-bg); box-shadow: 0 0 0 1.5px #fff;
}
.rdg-alt b { position: absolute; left: -.5px; bottom: 6px; width: 1px; height: 26px; background: #fff; opacity: .6; }
.rdg-alt span {
  position: absolute; left: 0; bottom: 34px; transform: translateX(-50%); white-space: nowrap;
  padding: 6px 8px 5px; border-radius: 6px;
  background: rgba(9, 15, 30, .78); box-shadow: 0 0 0 1px rgba(98, 138, 249, .45);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}

/* ── RESPONSIVE ── */
@media (max-width: 1100px) {
  .hero2-chev { width: 130px; height: auto; opacity: .7; }
}
@media (max-width: 768px) {
  .hero2 { min-height: 100svh; padding-top: 128px; }
  .hero2-chev, .hero2-glow--r { display: none; }
  .hero2-title { font-size: 64px; }
  .hero2-hl { line-height: 58px; margin-top: 10px; padding: 0 6px; }
  .hero2-sub { font-size: 18px; margin-top: 18px; }
  .hero2-cta { width: auto; min-width: 280px; max-width: calc(100vw - 40px); height: 58px; font-size: 20px; }
  .hero2-cta img { width: 62px; height: 48px; }
  .hero2-cta { --tile-w: 62px; --tile-h: 48px; }
  .hero2-clients { margin-top: 48px; }
  .hero2-logos { gap: 44px; padding: 0 22px; height: 64px; }
  .hero2-logos img { height: auto; max-height: 44px; width: auto; }
  .hero2-range { min-height: 320px; margin-top: -90px; }
}
@media (max-width: 400px) {
  .hero2-title { font-size: 54px; }
  .hero2-hl { line-height: 50px; }
}
@media (prefers-reduced-motion: reduce) {
  .hero2-marquee { animation: none; }
  .hero2-cta, .hero2-cta img { transition: none; }
}

/* ── PREMIUM TYPING ──
   The headline types itself letter by letter: each glyph eases in out of a
   soft blur with a faint blue ink-glow, behind a slim blue caret. The blue
   block grows behind "Growth." as it is typed. Subtitle, CTA, logos and nav
   then follow on a long, quiet ease. */
:root { --h2-ease: cubic-bezier(.16, 1, .3, 1); }

.hero2-title .h2word { display: inline-block; white-space: nowrap; }
.hero2-title .h2c {
  display: inline-block;
  opacity: 0;
  filter: blur(8px);
  transform: translateY(.14em) scale(.96);
}
.hero2-title .h2c.on { animation: h2-type .7s var(--h2-ease) forwards; }
@keyframes h2-type {
  0%   { opacity: 0; filter: blur(8px); transform: translateY(.14em) scale(.96); text-shadow: 0 0 .5em rgba(98, 138, 249, .9); }
  45%  { opacity: 1; text-shadow: 0 0 .35em rgba(98, 138, 249, .55); }
  100% { opacity: 1; filter: blur(0); transform: none; text-shadow: 0 0 0 rgba(98, 138, 249, 0); }
}
.h2-caret {
  display: inline-block;
  width: .04em;
  height: .74em;
  margin: 0 -.02em;
  vertical-align: baseline;
  background: #628af9;
  box-shadow: 0 0 .25em rgba(98, 138, 249, .8);
  animation: h2-blink 1.05s steps(1) infinite;
  transition: opacity .6s ease;
}
.h2-caret.typing { animation: none; }
.h2-caret.gone { opacity: 0; animation: none; }
.hero2-hl .h2-caret { background: #fff; box-shadow: 0 0 .25em rgba(255, 255, 255, .7); }
@keyframes h2-blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

.hero2-hl { position: relative; background: none; }
.hero2-hl::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: var(--h2-blue);
  transform: scaleX(var(--p, 0)); transform-origin: 0 50%;
  transition: transform .32s var(--h2-ease);
}

/* Load order: background and navbar are there at once; the mountains develop,
   logos and button fade in (no blur); then the headline types; the subtitle
   follows once the headline is done. */
body { animation: none; opacity: 1; }   /* background + navbar are there from the first paint */

.hero2-sub, .hero2-cta, .hero2-clients {
  opacity: 0;
  transition: opacity .9s var(--h2-ease), transform 1s var(--h2-ease), box-shadow .35s ease, color .5s var(--h2-ease);
}
.hero2-clients { transform: translateY(10px); transition-delay: .35s; }
.hero2-cta     { transform: translateY(10px); transition-delay: .35s; }   /* after the subtitle */
.hero2-sub     { transform: translateY(10px); transition-delay: 0s; }

.h2-ready .hero2-clients { opacity: 1; transform: none; }
/* Order: headline types → subtitle → button */
.h2-in .hero2-sub, .h2-in .hero2-cta { opacity: 1; transform: none; }
.h2-in .hero2-cta:hover { transition-delay: 0s; }

/* CTA: label slides on hover, arrow tile glows */
.hero2-cta span { position: relative; white-space: nowrap; transition: transform .5s var(--h2-ease); }

@media (prefers-reduced-motion: reduce) {
  .hero2-title .h2c, .hero2-hl::before,
  .hero2-sub, .hero2-cta, .hero2-clients {
    transition: none !important; transform: none !important; filter: none !important; opacity: 1 !important;
  }
}

/* ══════════════════════════════════════════════════════════════
   DESKTOP: the hero is the Figma frame (1440 × 1024) scaled to fit
   the first screen, so nav, headline, CTA, logos and the mountains
   are all visible on load at any desktop size.
   1 design px = var(--u). Extra height (tall screens) goes to the range.
   ══════════════════════════════════════════════════════════════ */
@media (min-width: 769px) {
  :root {
    --page-zoom: 1.1;            /* matches html { zoom } in index.css */
    --u: min(calc(100vw / 1440), calc(100vh / 1024));
  }
  /* Undo the page zoom here so the frame maps 1:1 onto the viewport. */
  .hero2 { zoom: calc(1 / var(--page-zoom)); }


  .hero2 {
    display: block;
    height: 100vh;
    min-height: calc(1024 * var(--u));
    padding: 0;
  }
  .hero2-glow--l { left: calc(-689 * var(--u)); top: calc(-344 * var(--u)); width: calc(1463 * var(--u)); height: calc(1463 * var(--u)); }
  .hero2-glow--r { right: calc(-774 * var(--u)); top: calc(115 * var(--u)); width: calc(1783 * var(--u)); height: calc(1783 * var(--u)); }
  .hero2-chev--l { top: calc(225 * var(--u)); width: calc(195 * var(--u)); height: auto; opacity: 1; }
  .hero2-chev--r { top: calc(332 * var(--u)); width: calc(221 * var(--u)); height: auto; opacity: 1; }

  .hero2-text { position: absolute; left: 0; right: 0; top: calc(200 * var(--u)); padding: 0; }
  .hero2-title { width: calc(660 * var(--u)); font-size: calc(124 * var(--u)); }
  .hero2-hl { margin-top: calc(18 * var(--u)); padding: 0 calc(10 * var(--u)); line-height: calc(108 * var(--u)); }
  .hero2-sub { width: calc(536 * var(--u)); margin-top: calc(22 * var(--u)); font-size: calc(24 * var(--u)); letter-spacing: calc(.24 * var(--u)); }
  .hero2-cta {
    width: auto; min-width: calc(320 * var(--u)); gap: calc(16 * var(--u)); height: calc(65 * var(--u)); margin-top: calc(23 * var(--u));
    padding: 0 calc(8 * var(--u)) 0 calc(16 * var(--u)); font-size: calc(24 * var(--u));
  }
  .hero2-cta img { width: calc(74 * var(--u)); height: calc(57 * var(--u)); }
  .hero2-cta { --tile-w: calc(74 * var(--u)); --tile-h: calc(57 * var(--u)); --tile-r: calc(6 * var(--u)); }

  .hero2-clients { position: absolute; left: 0; right: 0; top: calc(660 * var(--u)); margin: 0; }
  .hero2-logos { gap: calc(66 * var(--u)); height: calc(86 * var(--u)); padding: 0 calc(33 * var(--u)); }
  .hero2-logos img { height: calc(var(--h) * var(--u)); width: auto; }

  .hero2-range { position: absolute; left: 0; right: 0; top: calc(625 * var(--u)); bottom: 0; min-height: 0; margin: 0; }
}

/* ── No visible scrollbar (page still scrolls; see js/smooth-scroll.js) ── */
html { scrollbar-width: none; -ms-overflow-style: none; }
html::-webkit-scrollbar, body::-webkit-scrollbar { display: none; width: 0; height: 0; }

/* ── Hero chevrons as SVG (js/chevrons.js): draw on, ripple on hover ── */
.chev-svg { display: block; overflow: hidden; height: auto; }
.chev-svg.hero2-chev--l { width: 195px; aspect-ratio: 195 / 260; }
.chev-svg.hero2-chev--r { width: 221px; aspect-ratio: 221 / 260; }
.chev-svg polyline {
  fill: none; stroke: #fff; stroke-width: 2; stroke-linejoin: miter;
  stroke-dasharray: 1; stroke-dashoffset: 1;
  transition: stroke-dashoffset 1.5s cubic-bezier(.65, 0, .35, 1);
  transition-delay: calc(var(--k, 0) * 70ms);
}
.chev-svg.chev-in polyline { stroke-dashoffset: 0; }
@media (max-width: 1100px) { .chev-svg.hero2-chev--l, .chev-svg.hero2-chev--r { width: 130px; } }
@media (min-width: 769px) {
  .chev-svg.hero2-chev--l { width: calc(195 * var(--u)); }
  .chev-svg.hero2-chev--r { width: calc(221 * var(--u)); }
}
@media (prefers-reduced-motion: reduce) { .chev-svg polyline { transition: none; stroke-dashoffset: 0; } }

@media (max-width: 768px) { .hero2 .chev-svg { display: none; } }
