/* v12.1 homepage hero: back to the Hero Lab "Floor to P&L" look. Four photographs drawn as coloured points across the whole hero
   settle into the chart of a result on the right; a glass stat card beside the chart always shows the current fact, and a hairline
   chapter strip with a small pause sits inside the card. The section is .hb; the inline script in src/_hero.html sets html.hb-page
   plus hb-motion or hb-static before first paint. */
.hb { --hb-ease: cubic-bezier(.23, 1, .32, 1); --hb-scrim: .9; --hb-deep: #071d31;
  position: relative; overflow: hidden; isolation: isolate; display: grid; grid-template-rows: minmax(0, 1fr);
  min-height: clamp(640px, 100svh, 980px); margin-top: calc(-1 * var(--header-h)); padding-top: var(--header-h);
  background: radial-gradient(1200px 700px at 72% 40%, #123f63 0%, #0c2f4c 46%, var(--hb-deep) 100%); }
.hb::before, .hb::after { display: none; }
html.hb-page { scrollbar-gutter: stable; }
.hb > .wrap { width: 100%; }
/* preview builds carry a notice bar above the header (its height is measured into --hb-pv before the hero is parsed) */
html.hb-page .hb { min-height: clamp(640px, calc(100svh - var(--hb-pv, 0px)), 980px); }

/* media layer: the photograph pre-rendered as points (first paint and static mode) under the WebGL canvas */
.hb-media { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.hb-still { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: opacity .4s var(--hb-ease); }
.hb-gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; opacity: 0; transition: opacity .4s var(--hb-ease); }
html.hb-gl-on .hb-gl { opacity: 1; }
html.hb-gl-on .hb-still { opacity: 0; }
.hb-shade { position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(7,29,49,var(--hb-scrim)) 0, rgba(7,29,49,calc(var(--hb-scrim) * .55)) calc(var(--header-h) + 10px), rgba(7,29,49,0) calc(var(--header-h) + 90px)),
    linear-gradient(90deg, rgba(7,29,49,.86) 0%, rgba(7,29,49,.55) 34%, rgba(7,29,49,0) 62%); }

/* copy on the left; the chart is drawn inside .hb-stage; the stat card sits under it, aligned to the right edge of the page */
.hb .hb-wrap { position: relative; z-index: 2; display: grid; grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr); grid-template-rows: minmax(0, 1fr) auto;
  column-gap: 48px; padding-block: clamp(28px, 5vh, 64px) clamp(24px, 5vh, 56px); }
.hb .hb-copy { grid-column: 1; grid-row: 1 / -1; align-self: center; min-width: 0; }
.hb h1 { max-width: 12ch; font-size: clamp(2.5rem, 3.6vw + 1rem, 4.6rem); line-height: 1.02; letter-spacing: -0.035em; text-wrap: balance; color: #fff; }
.hb .one-liner { max-width: 30ch; margin-top: 22px; font-size: clamp(1.1rem, .7vw + .9rem, 1.4rem); line-height: 1.4; font-weight: 600; color: var(--on-dark); text-wrap: pretty; }
.hb .actions { margin-top: 30px; }
.hb-stage { grid-column: 2; grid-row: 1; min-height: 340px; margin-top: -24px; } /* a larger chart area */

/* the stat card: always on screen; only its text changes */
.hb-card { grid-column: 2; grid-row: 2; justify-self: end; width: min(21.25rem, 100%); margin-top: 12px; padding: 18px 20px 10px; border-radius: 18px;
  background: rgba(7,29,49,.62); border: 1px solid rgba(179,200,218,.22); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.hb-fact { transition: opacity .24s var(--hb-ease), transform .24s var(--hb-ease); }
.hb-fact.swap { opacity: 0; transform: translateY(5px); transition-duration: .16s; transition-timing-function: ease-in; }
.hb-k { margin: 0; font-size: .8rem; font-weight: 700; line-height: 1.3; color: var(--steel); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hb-nums { margin: 8px 0 0; display: flex; align-items: baseline; gap: 10px; height: 2.7rem; }
.hb-from { font-size: 1.15rem; font-weight: 700; color: var(--on-dark-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.hb-from:empty { display: none; }
.hb-v { font-size: 2.7rem; line-height: 1; letter-spacing: -0.03em; color: var(--gain-on-dark); font-variant-numeric: tabular-nums; white-space: nowrap; }
.hb-l { margin: 8px 0 0; height: 2.8em; font-size: .95rem; line-height: 1.4; color: var(--on-dark); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* chapter strip: four hairlines that fill with the scene, plus a small pause */
.hb-nav { margin-top: 12px; display: flex; align-items: center; gap: 12px; }
.hb-chaps { flex: 1; display: flex; gap: 6px; }
.hb-chap { position: relative; flex: 1 1 0; height: 24px; padding: 0; border: 0; background: none; cursor: pointer; display: grid; align-items: center; -webkit-tap-highlight-color: transparent; }
.hb-chap::before { content: ""; position: absolute; inset: -10px -3px; } /* 44 px tall hit area without a taller strip */
.hb-chap i { display: block; height: 2px; border-radius: 2px; background: rgba(179,200,218,.22); overflow: hidden; transition: background-color .2s var(--hb-ease); }
.hb-chap em { display: block; height: 100%; background: var(--gain-on-dark); transform-origin: left; transform: scaleX(0); }
.hb-pause { position: relative; flex: none; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 50%; background: rgba(238,244,250,.08); color: var(--on-dark-muted); cursor: pointer;
  display: grid; place-items: center; transition: background-color .15s var(--hb-ease), color .15s var(--hb-ease), transform .12s var(--hb-ease); }
.hb-pause::before { content: ""; position: absolute; inset: -8px; }
.hb-pause span { width: 8px; height: 9px; border-left: 2.5px solid currentColor; border-right: 2.5px solid currentColor; box-sizing: border-box; }
.hb-pause[aria-pressed="true"] span { width: 0; height: 0; border-style: solid; border-width: 4.5px 0 4.5px 8px; border-color: transparent transparent transparent currentColor; margin-left: 2px; }
@media (hover: hover) and (pointer: fine) { .hb-chap:hover i { background: rgba(179,200,218,.45); } .hb-pause:hover { background: rgba(238,244,250,.16); color: #fff; } }
.hb-pause:active { transform: scale(.94); }
.hb-chap:focus-visible { outline: 2px solid var(--steel); outline-offset: 3px; border-radius: 4px; }
.hb-pause:focus-visible { outline: 2px solid var(--steel); outline-offset: 3px; }
html.hb-static .hb-pause { visibility: hidden; }
html.hb-static .hb-chap.on em { transform: scaleX(1); }

/* the site header sits over the hero and stays readable through every tone change (shade above follows --hb-scrim);
   it turns solid again once a menu opens or the hero scrolls away. Browsers without :has() keep the solid header. */
html.hb-over .site-header:not(:has([aria-expanded="true"])) { background: transparent; border-bottom-color: transparent; box-shadow: none; transition: background-color .2s var(--hb-ease); }
/* once the page moves, the header over the hero gets its own navy glass so it never sits on the headline */
html.hb-over.hb-scrolled .site-header:not(:has([aria-expanded="true"])) { background: rgba(7,29,49,.84); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-bottom-color: rgba(179,200,218,.14); }
html.hb-over .site-header:not(:has([aria-expanded="true"])) .brand img { filter: brightness(0) invert(1); }
html.hb-over .site-header:not(:has([aria-expanded="true"])) :is(.nav-link, .nav-btn) { color: #fff; text-shadow: 0 1px 12px rgba(7,29,49,.7); }
html.hb-over .site-header:not(:has([aria-expanded="true"])) .nav-btn::after { border-color: rgba(255,255,255,.85); }
html.hb-over .site-header:not(:has([aria-expanded="true"])) :is(.nav-link, .nav-btn):hover { background: rgba(238,244,250,.12); color: #fff; }
html.hb-over .site-header:not(:has([aria-expanded="true"])) .header-ctas .text-link { color: #fff; text-shadow: 0 1px 12px rgba(7,29,49,.7); }
html.hb-over .site-header:not(:has([aria-expanded="true"])) .header-ctas .btn-primary { background: var(--steel); border-color: var(--steel); color: var(--navy); }
html.hb-over .site-header:not(:has([aria-expanded="true"])) .header-ctas .btn-primary:hover { background: var(--steel-hover); border-color: var(--steel-hover); }
html.hb-over .site-header:not(:has([aria-expanded="true"])) .menu-btn { color: #fff; background: rgba(7,29,49,.35); border-color: rgba(238,244,250,.45); }
html.hb-over .site-header:not(:has([aria-expanded="true"])) :focus-visible { outline-color: var(--steel); }

@media (max-width: 1020px) {
  html.hb-page .hb { min-height: calc(100svh - var(--hb-pv, 0px)); }
  /* phones and tablets: the chart on top, its stat card under it, then the copy (the Hero Lab phone layout) */
  .hb .hb-wrap { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto auto; align-content: end; row-gap: 12px; padding-block: 4px 18px; }
  .hb-stage { grid-column: 1; grid-row: 1; min-height: 0; height: clamp(130px, 21svh, 250px); }
  .hb-card { grid-column: 1; grid-row: 2; justify-self: start; width: min(380px, 100%); margin: 0; padding: 12px 14px 6px; border-radius: 16px; }
  .hb .hb-copy { grid-row: 3; align-self: end; margin-top: 6px; }
  .hb-shade { background:
    linear-gradient(180deg, rgba(7,29,49,var(--hb-scrim)) 0, rgba(7,29,49,calc(var(--hb-scrim) * .5)) calc(var(--header-h) + 8px), rgba(7,29,49,.15) 30%, rgba(7,29,49,.8) 56%, rgba(7,29,49,.93) 100%); }
  .hb h1 { font-size: clamp(2.3rem, 6vw + 1rem, 3.6rem); max-width: 13ch; }
  .hb .one-liner { margin-top: 14px; font-size: 1.05rem; }
  .hb .actions { margin-top: 20px; }
  .hb .actions .btn { width: auto; flex: 1 1 auto; padding-inline: 16px; }
  .hb-nums { height: 2.1rem; margin-top: 6px; }
  .hb-v { font-size: 2rem; } .hb-from { font-size: 1rem; }
  .hb-l { font-size: .88rem; margin-top: 4px; }
  .hb-k { font-size: .74rem; }
  .hb-nav { margin-top: 6px; }
}
@media (max-width: 420px) { .hb .actions { gap: 10px; } }
/* short phones: a smaller chart and headline keep both buttons above the fold */
@media (max-width: 1020px) and (max-height: 700px) { .hb-stage { height: 92px; } .hb h1 { font-size: 2.05rem; } .hb .one-liner { font-size: .98rem; margin-top: 10px; } .hb .actions { margin-top: 14px; } .hb .hb-wrap { row-gap: 8px; } }
@media (prefers-reduced-motion: reduce) { .hb-fact, .hb-still, .hb-gl { transition: none; } }
/* landscape phones: copy on the left, the chart and its card on the right, so the headline and buttons are on the first screen */
@media (max-width: 1020px) and (orientation: landscape) and (max-height: 560px) {
  html.hb-page .hb { min-height: calc(100svh - var(--hb-pv, 0px)); }
  .hb .hb-wrap { grid-template-columns: minmax(0, 1fr) minmax(0, .92fr); grid-template-rows: auto auto; align-content: center; column-gap: 24px; row-gap: 8px; padding-block: 6px 14px; }
  .hb .hb-copy { grid-column: 1; grid-row: 1 / span 2; align-self: center; margin: 0; }
  .hb-stage { grid-column: 2; grid-row: 1; height: 84px; }
  .hb-card { grid-column: 2; grid-row: 2; justify-self: stretch; width: auto; }
  .hb h1 { font-size: clamp(1.7rem, 3.4vw + .6rem, 2.2rem); max-width: 14ch; }
  .hb .one-liner { font-size: .92rem; margin-top: 8px; }
  .hb .actions { margin-top: 12px; }
  .hb .actions .btn { flex: 0 1 auto; }
  .hb-shade { background: linear-gradient(180deg, rgba(7,29,49,var(--hb-scrim)) 0, rgba(7,29,49,.5) calc(var(--header-h) + 8px), rgba(7,29,49,.35) 40%), linear-gradient(90deg, rgba(7,29,49,.9) 0%, rgba(7,29,49,.6) 45%, rgba(7,29,49,.3) 100%); }
}
/* short portrait phones (e.g. 320 x 568): a slimmer chart, card and type keep both buttons on the first screen */
@media (max-width: 1020px) and (orientation: portrait) and (max-height: 620px) {
  .hb-stage { height: 56px; }
  .hb .hb-wrap { row-gap: 8px; }
  .hb h1 { font-size: 1.85rem; }
  .hb .one-liner { font-size: .92rem; margin-top: 8px; }
  .hb .actions { margin-top: 12px; }
  .hb-card { padding: 10px 12px 4px; }
  .hb-nums { height: 1.8rem; margin-top: 4px; } .hb-v { font-size: 1.6rem; } .hb-from { font-size: .9rem; }
  .hb-l { font-size: .82rem; } .hb-nav { margin-top: 2px; }
}
/* the narrowest phones: both hero buttons on one line */
@media (max-width: 360px) { .hb .actions { flex-wrap: nowrap; gap: 8px; } .hb .actions .btn { padding-inline: 12px; font-size: .88rem; min-width: 0; white-space: nowrap; } }

/* chart annotations (HTML over the WebGL chart): crisp at any size, fade in once a chart has formed */
.hb-stage { position: relative; }
.hb-labels { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .45s var(--hb-ease); }
.hb-labels.on { opacity: 1; transition-delay: .1s; }
.hb-lab { position: absolute; font-size: .78rem; font-weight: 600; line-height: 1.2; color: var(--on-dark-muted); white-space: nowrap; text-shadow: 0 1px 10px rgba(7,29,49,.95); font-variant-numeric: tabular-nums; }
.hb-lab.a-center { transform: translate(-50%, 50%); } .hb-lab.a-left { transform: translate(0, 50%); } .hb-lab.a-right { transform: translate(-100%, 50%); }
.hb-lab.g { color: var(--gain-on-dark); } .hb-lab.w { color: #fff; } .hb-lab.big { font-size: 1.05rem; font-weight: 800; letter-spacing: -.01em; }
.hb-lab.legend i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.hb-lab.legend .dw { background: #e6f0fa; } .hb-lab.legend .dg { background: var(--gain-on-dark); margin-left: 14px; }
@media (max-width: 760px) { .hb-labels { display: none; } }
/* shorter desktop screens (e.g. 1024 x 768, 1280 x 720): a lower chart and a one-line ROI prompt keep the stat card on screen */
@media (min-width: 1021px) and (max-height: 880px) {
  .hb-stage { min-height: 150px; }
  .hb .hb-wrap { padding-block: clamp(16px, 3vh, 40px) clamp(16px, 3vh, 32px); }
}
