/* ==========================================================================
   Hero showreel — a 15s code-driven motion graphic.
   The stage is a size container, so every scene is laid out in container
   units (cqw / cqh / cqmin) and recomposes for portrait screens.
   Default (no-JS) state = the final brand composition.
   ========================================================================== */

.hero {
  position: relative; isolation: isolate;
  height: 100svh; min-height: 620px; max-height: 1200px;
  background: var(--navy-950); color: var(--on-dark);
  overflow: hidden;
}

.reel {
  position: absolute; inset: 0;
  container-type: size; container-name: reel;
  overflow: hidden;
}

/* Backdrop -------------------------------------------------------------- */
.reel__bg { position: absolute; inset: 0; }
.reel__glow {
  position: absolute; inset: -20%;
  background:
    radial-gradient(45% 40% at 50% 55%, rgba(29, 92, 142, 0.38), transparent 70%),
    radial-gradient(30% 30% at 80% 20%, rgba(15, 145, 227, 0.12), transparent 70%),
    radial-gradient(35% 30% at 15% 85%, rgba(140, 198, 63, 0.06), transparent 70%);
}
.reel__grid {
  position: absolute; inset: 0; opacity: 0.5;
  background-image:
    linear-gradient(rgba(124, 196, 242, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(124, 196, 242, 0.05) 1px, transparent 1px);
  background-size: 8cqmin 8cqmin; background-position: center;
  -webkit-mask-image: radial-gradient(70% 70% at 50% 50%, #000, transparent 75%);
          mask-image: radial-gradient(70% 70% at 50% 50%, #000, transparent 75%);
}
.reel__grain {
  position: absolute; inset: 0; opacity: 0.08; mix-blend-mode: overlay; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.reel__vignette { position: absolute; inset: 0; background: radial-gradient(120% 90% at 50% 50%, transparent 55%, rgba(2, 6, 14, 0.75)); pointer-events: none; }

.reel__cam { position: absolute; inset: 0; transform-origin: 50% 50%; }
.s { position: absolute; inset: 0; will-change: transform, opacity; }
.js .s { opacity: 0; visibility: hidden; }
.s .mono, .hud .mono { font-family: var(--font-mono); letter-spacing: 0.16em; text-transform: uppercase; }

/* HUD ------------------------------------------------------------------- */
.hud { position: absolute; inset: 0; pointer-events: none; z-index: 5; font-size: clamp(9px, 0.7cqw + 4px, 11px); color: var(--on-dark-3); }
.hud__c { position: absolute; display: grid; gap: 0.35em; }
.hud__c::before {
  content: ""; position: absolute; width: 14px; height: 14px; border: solid rgba(124, 196, 242, 0.45);
}
.hud__tl { top: calc(var(--header-h) + 18px); left: var(--gutter); padding: 6px 0 0 22px; }
.hud__tl::before { left: 0; top: 0; border-width: 1px 0 0 1px; }
.hud__tr { top: calc(var(--header-h) + 18px); right: var(--gutter); padding: 6px 22px 0 0; text-align: right; }
.hud__tr::before { right: 0; top: 0; border-width: 1px 1px 0 0; }
.hud__bl { bottom: 92px; left: var(--gutter); padding: 0 0 6px 22px; }
.hud__bl::before { left: 0; bottom: 0; border-width: 0 0 1px 1px; }
.hud__br { bottom: 92px; right: var(--gutter); padding: 0 22px 6px 0; text-align: right; }
.hud__br::before { right: 0; bottom: 0; border-width: 0 1px 1px 0; }
.hud b { color: var(--on-dark); font-weight: 500; }
.hud__rec { display: inline-flex; align-items: center; gap: 0.6em; }
.hud__rec i { width: 6px; height: 6px; border-radius: 50%; background: var(--leaf-500); box-shadow: 0 0 10px var(--leaf-500); }
.hud__progress { width: 120px; height: 1px; background: rgba(255,255,255,0.15); margin-left: auto; position: relative; }
.hud__progress i { position: absolute; inset: 0; background: var(--blue-300); transform-origin: left; transform: scaleX(var(--p, 1)); }
@container reel (max-width: 640px) {
  .hud__tr, .hud__br { display: none; }
  .hud__bl { bottom: 88px; }
}

/* S1 — Pulse ------------------------------------------------------------ */
.ecg { position: absolute; left: 0; right: 0; top: 50%; height: 26cqmin; translate: 0 -50%; }
.ecg svg { width: 100%; height: 100%; overflow: visible; }
.ecg path { fill: none; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.ecg__line { stroke: var(--blue-300); stroke-width: 2; }
.ecg__glow { stroke: var(--blue-500); stroke-width: 10; opacity: 0.35; filter: blur(6px); }
.ecg__dot {
  position: absolute; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%;
  background: #fff; box-shadow: 0 0 12px 4px rgba(124, 196, 242, 0.9), 0 0 50px 14px rgba(15, 145, 227, 0.55);
}
.s1__copy { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; gap: 3cqmin; padding: 0 var(--gutter); }
.s1__title {
  font-family: var(--font-display); font-weight: 400; line-height: 0.95; letter-spacing: -0.02em;
  font-size: clamp(2.6rem, 11cqmin, 10rem);
}
.s1__title em { color: var(--blue-300); }
.s1__sub { font-size: clamp(10px, 1.4cqmin, 13px); color: var(--on-dark-2); min-height: 1.4em; }
.w { display: inline-block; }

/* S2 — Ecosystem -------------------------------------------------------- */
.s2__wrap {
  position: absolute; inset: 0; display: grid; align-items: center;
  grid-template-columns: 1fr 1fr; gap: 4cqw; padding: calc(var(--header-h) + 4cqh) 8cqw 12cqh;
}
.s2__list { display: grid; gap: 0.4cqh; }
.s2__list li {
  position: relative; width: max-content;
  font-family: var(--font-display); font-size: clamp(2rem, 7.4cqmin, 7rem); line-height: 1.04; letter-spacing: -0.02em;
}
.s2__list li i { position: absolute; left: 0; right: 0; bottom: 0.06em; height: 2px; background: var(--blue-500); transform-origin: left; transform: scaleX(0); box-shadow: 0 0 12px rgba(15,145,227,0.8); }
.s2__card {
  justify-self: end; width: min(100%, 560px);
  border-radius: 20px; padding: 14px;
  background: linear-gradient(180deg, rgba(18, 50, 90, 0.75), rgba(7, 22, 41, 0.85));
  border: 1px solid rgba(124, 196, 242, 0.18);
  box-shadow: 0 40px 80px -30px rgba(0,0,0,0.7), inset 0 1px 0 rgba(255,255,255,0.06);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.s2__head { display: flex; justify-content: space-between; align-items: center; padding: 4px 6px 12px; font-size: 10px; color: var(--on-dark-3); }
.s2__head span:first-child { display: inline-flex; align-items: center; gap: 8px; }
.s2__head span:first-child::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--leaf-500); box-shadow: 0 0 8px var(--leaf-500); }
.s2__media { position: relative; aspect-ratio: 16 / 9.5; border-radius: 12px; overflow: hidden; background: var(--navy-900); }
.s2__media > .m { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.s2__media .network-art { display: block; }
.s2__media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 55%, rgba(7,22,41,0.7)); pointer-events: none; }
.s2__label { position: absolute; left: 12px; bottom: 10px; z-index: 2; font-size: 10px; color: #fff; }
.s2__rows { position: relative; margin-top: 12px; height: 132px; }
.s2__group { position: absolute; inset: 0; display: grid; gap: 6px; align-content: start; }
.s2__row {
  position: relative; display: flex; justify-content: space-between; align-items: center;
  padding: 10px 12px; border-radius: 10px; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.06);
  font-size: 13px; color: var(--on-dark-2); overflow: hidden;
}
.s2__row b { font-family: var(--font-mono); font-weight: 500; color: #fff; font-size: 12px; letter-spacing: 0.06em; }
.s2__row i { position: absolute; left: 0; bottom: 0; height: 2px; width: 100%; background: linear-gradient(90deg, var(--blue-500), var(--leaf-500)); transform-origin: left; transform: scaleX(0); }
.s2__group:nth-child(2) .s2__row i { background: linear-gradient(90deg, var(--blue-300), var(--blue-500)); }

@container reel (orientation: portrait) {
  .s2__wrap { grid-template-columns: 1fr; grid-template-rows: auto auto; align-content: center; gap: 4cqh; padding: calc(var(--header-h) + 2cqh) 6cqw 14cqh; }
  .s2__list { grid-template-columns: 1fr 1fr; gap: 0.4cqh 4cqw; }
  .s2__list li { font-size: clamp(1.5rem, 7.6cqw, 3rem); }
  .s2__card { justify-self: center; }
}
@container reel (orientation: portrait) and (max-height: 700px) {
  .s2__rows { height: 96px; }
  .s2__row:nth-child(3) { display: none; }
}

/* Flash bloom ----------------------------------------------------------- */
.flash {
  position: absolute; inset: -30%; z-index: 4; pointer-events: none; opacity: 0;
  background: radial-gradient(circle at 50% 50%, #fff 0%, rgba(227, 242, 252, 0.95) 22%, rgba(124, 196, 242, 0.4) 45%, transparent 70%);
}

/* S3 — Identity --------------------------------------------------------- */
.s3__center { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 3.2cqmin; text-align: center; padding: 0 var(--gutter); }
.s3__orbits { position: absolute; left: 50%; top: 50%; width: 90cqmin; height: 90cqmin; translate: -50% -58%; }
.s3__orbits svg { width: 100%; height: 100%; overflow: visible; }
.s3__orbits ellipse { fill: none; stroke-width: 1.4; vector-effect: non-scaling-stroke; }
.tile {
  width: clamp(88px, 18cqmin, 170px); aspect-ratio: 1; border-radius: 26%;
  background: linear-gradient(160deg, #fff, #e9f3fb);
  display: grid; place-items: center;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.6), 0 30px 60px -20px rgba(0,0,0,0.6), 0 0 120px 10px rgba(15,145,227,0.35);
  position: relative; z-index: 1;
}
.tile img { width: 76%; height: auto; }
.s3__word { font-family: var(--font-display); font-size: clamp(2.6rem, 9cqmin, 7rem); line-height: 1; letter-spacing: -0.02em; position: relative; z-index: 1; }
.s3__word em { color: var(--blue-300); }
.s3__sub { font-size: clamp(9px, 1.25cqmin, 12px); color: var(--on-dark-2); min-height: 1.4em; position: relative; z-index: 1; }

/* S4 — Network ---------------------------------------------------------- */
.s4__wrap { position: absolute; inset: 0; display: grid; grid-template-columns: 1.15fr 0.85fr; align-items: center; gap: 2cqw; padding: calc(var(--header-h) + 2cqh) 7cqw 12cqh; }
.radar { position: relative; width: min(100%, 78cqh); aspect-ratio: 1; justify-self: center; perspective: 1200px; }
.radar__plane { position: absolute; inset: 0; transform: rotateX(62deg) rotateZ(var(--rz, 0deg)); transform-style: preserve-3d; }
.radar__ring { position: absolute; border-radius: 50%; border: 1px solid rgba(124, 196, 242, 0.28); inset: var(--in); }
.radar__ring:nth-child(1) { --in: 0%; border-color: rgba(124, 196, 242, 0.18); }
.radar__ring:nth-child(2) { --in: 16%; }
.radar__ring:nth-child(3) { --in: 32%; border-color: rgba(140, 198, 63, 0.35); }
.radar__ring:nth-child(4) { --in: 44%; border-style: dashed; }
.radar__sweep {
  position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(from 0deg, rgba(15, 145, 227, 0.35), transparent 22%);
  -webkit-mask-image: radial-gradient(circle, #000 69%, transparent 70%); mask-image: radial-gradient(circle, #000 69%, transparent 70%);
}
.radar__node { position: absolute; left: 50%; top: 50%; width: 10px; height: 10px; margin: -5px; border-radius: 50%; background: var(--blue-300); box-shadow: 0 0 10px rgba(124,196,242,0.9); }
.radar__node--hosp { background: #fff; width: 14px; height: 14px; margin: -7px; box-shadow: 0 0 16px rgba(255,255,255,0.9); }
.radar__node--lab { background: var(--leaf-500); box-shadow: 0 0 10px rgba(140,198,63,0.9); }
.radar__node--hq { width: 22px; height: 22px; margin: -11px; background: var(--blue-500); box-shadow: 0 0 0 6px rgba(15,145,227,0.2), 0 0 30px rgba(15,145,227,0.9); }
.radar__legend { position: absolute; left: 50%; bottom: -2%; translate: -50% 0; display: flex; gap: 14px; font-size: 9px; color: var(--on-dark-3); white-space: nowrap; }
.radar__legend span { display: inline-flex; align-items: center; gap: 6px; }
.radar__legend i { width: 7px; height: 7px; border-radius: 50%; }

.s4__panel { display: grid; gap: 2.4cqh; align-content: center; }
.s4__eyebrow { font-size: 10px; color: var(--blue-300); }
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.08); border-radius: 14px; overflow: hidden; }
.kpi { background: rgba(7, 22, 41, 0.9); padding: 1.6cqh 1.4cqw; display: grid; gap: 2px; }
.kpi b { font-family: var(--font-display); font-weight: 400; font-size: clamp(2rem, 6cqmin, 4.4rem); line-height: 1; font-variant-numeric: tabular-nums; }
.kpi span { font-size: 9.5px; color: var(--on-dark-3); }
.chart { position: relative; border-radius: 14px; border: 1px solid rgba(255,255,255,0.08); background: rgba(7,22,41,0.7); padding: 14px 14px 10px; }
.chart__top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.chart__top span { font-size: 9.5px; color: var(--on-dark-3); }
.chart__top b { font-family: var(--font-display); font-weight: 400; font-size: clamp(1.8rem, 4.6cqmin, 3.2rem); line-height: 1; color: var(--leaf-300); font-variant-numeric: tabular-nums; }
.chart svg { width: 100%; height: clamp(54px, 12cqh, 120px); overflow: visible; margin-top: 8px; }
.chart .c-line { fill: none; stroke: var(--leaf-500); stroke-width: 2; vector-effect: non-scaling-stroke; }
.chart .c-area { fill: url(#cArea); }
.chart .c-base { stroke: rgba(255,255,255,0.12); stroke-dasharray: 3 4; vector-effect: non-scaling-stroke; }
.chart__axis { display: flex; justify-content: space-between; font-size: 9px; color: var(--on-dark-3); margin-top: 6px; }

@container reel (orientation: portrait) {
  .s4__wrap { grid-template-columns: 1fr; grid-template-rows: auto auto; align-content: center; gap: 2cqh; padding: calc(var(--header-h) + 1cqh) 6cqw 14cqh; }
  .radar { width: min(76cqw, 38cqh); }
  .kpi { padding: 1.2cqh 3cqw; }
  .chart svg { height: 9cqh; }
}

/* S5 — Split flap ------------------------------------------------------- */
.flap { position: absolute; inset: 0; display: grid; place-content: center; gap: 1.4cqmin; padding: 0 var(--gutter); }
.flap__line { display: flex; justify-content: center; gap: 0.7cqmin; }
.flap__tile {
  --size: min(5.6cqw, 9cqh);
  width: var(--size); height: calc(var(--size) * 1.32);
  display: grid; place-items: center; position: relative;
  font-family: var(--font-mono); font-weight: 500; font-size: calc(var(--size) * 0.78); line-height: 1;
  color: #fff; background: linear-gradient(180deg, #102a4a 0 49.4%, #0b2140 50.6% 100%);
  border-radius: calc(var(--size) * 0.1);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), 0 10px 20px -10px rgba(0,0,0,0.6);
}
.flap__tile::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: rgba(0,0,0,0.55); }
.flap__line--accent .flap__tile { color: var(--blue-300); }
.flap__tile.is-blank { background: rgba(255,255,255,0.03); box-shadow: none; }
.flap__tile.is-blank::after { display: none; }
@container reel (orientation: portrait) { .flap__tile { --size: min(11cqw, 7cqh); } }

/* S6 — Brand orbits (final state is the default) ------------------------ */
.s6__orbits { position: absolute; left: 50%; top: 50%; width: min(150cqw, 170cqh); aspect-ratio: 2 / 1; translate: -50% -50%; }
.s6__orbits svg { width: 100%; height: 100%; overflow: visible; }
.s6__orbits ellipse { fill: none; vector-effect: non-scaling-stroke; }
.s6__a { stroke: rgba(124, 196, 242, 0.42); stroke-width: 1.2; }
.s6__b { stroke: rgba(140, 198, 63, 0.38); stroke-width: 1.2; }
.s6__g { transform-box: view-box; transform-origin: 50% 50%; }
.s6__ga { transform: rotate(-24deg); }
.s6__gb { transform: rotate(24deg); }
.s6__dot { fill: #fff; filter: drop-shadow(0 0 6px rgba(124, 196, 242, 0.95)); }
.s6__dot--leaf { fill: var(--leaf-300); filter: drop-shadow(0 0 6px rgba(140, 198, 63, 0.95)); }
.s6__line {
  position: absolute; left: 0; right: 0; top: 50%; height: 2px; margin-top: -1px;
  background: linear-gradient(90deg, transparent, var(--blue-300) 20%, #fff 50%, var(--blue-300) 80%, transparent);
  box-shadow: 0 0 20px rgba(124, 196, 242, 0.8); opacity: 0;
}
.s6__core { position: absolute; left: 50%; top: 50%; width: 60cqmin; height: 60cqmin; translate: -50% -50%; border-radius: 50%; background: radial-gradient(circle, rgba(15,145,227,0.22), transparent 65%); }
.no-js .s6, .s6 { opacity: 1; visibility: visible; }
.js .s6 { opacity: 0; }

/* Final composition (live, accessible text) ----------------------------- */
.hero__final {
  position: absolute; inset: 0; z-index: 6;
  display: grid; place-content: center; justify-items: center; text-align: center;
  gap: clamp(1.25rem, 2.4cqmin, 2rem);
  padding: calc(var(--header-h) + 2rem) var(--gutter) 7rem;
  container-type: inline-size;
  pointer-events: none;
}
.hero__final > * { pointer-events: auto; }
.hero__final .eyebrow { color: var(--blue-300); }
.hero__final .eyebrow::after { content: ""; width: 28px; height: 1px; background: currentColor; opacity: 0.6; }
.hero__title {
  font-family: var(--font-display); font-weight: 400; letter-spacing: -0.025em; line-height: 0.92;
  font-size: clamp(2.75rem, min(1.4rem + 7.4vw, 12.5svh), 9.5rem);
  max-width: 14ch; text-wrap: balance;
}
.hero__title em { color: var(--blue-300); }
.hero__title .w { white-space: pre; }
.hero__sub { max-width: 46ch; color: var(--on-dark-2); font-size: var(--fs-lead); line-height: 1.55; text-wrap: balance; }
.hero__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.75rem; }
.js .hero__final [data-f] { opacity: 0; }

/* Controls / persistent bar --------------------------------------------- */
.hero__bar {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 7;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1.25rem var(--gutter) 1.5rem;
}
.reel-ctrls { display: flex; align-items: center; gap: 0.5rem; }
.reel-btn {
  display: inline-flex; align-items: center; gap: 0.5rem; height: 40px; padding: 0 0.95rem;
  border-radius: 999px; border: 1px solid rgba(255,255,255,0.18); color: var(--on-dark-2);
  font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.14em; text-transform: uppercase;
  background: rgba(7, 22, 41, 0.45); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  transition: color var(--dur-fast), border-color var(--dur-fast), background-color var(--dur-fast), transform var(--dur-fast);
}
.reel-btn:hover { color: #fff; border-color: rgba(255,255,255,0.4); }
.reel-btn:active { transform: scale(0.96); }
.reel-btn svg { width: 12px; height: 12px; }
.reel-btn[hidden] { display: none; }
.scroll-cue { display: inline-flex; align-items: center; gap: 0.75rem; color: var(--on-dark-3); font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.16em; text-transform: uppercase; }
.scroll-cue i { width: 1px; height: 36px; background: rgba(255,255,255,0.18); position: relative; overflow: hidden; }
.scroll-cue i::after { content: ""; position: absolute; left: 0; top: -40%; width: 100%; height: 40%; background: var(--blue-300); animation: cue 2.2s var(--ease-in-out) infinite; }
@keyframes cue { to { top: 100%; } }
@media (max-width: 560px) { .scroll-cue { display: none; } .hero__bar { justify-content: center; } }

/* Bottom fade into the page */
.hero::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 120px; z-index: 4; background: linear-gradient(transparent, rgba(4,12,24,0.6)); pointer-events: none; }

@media (max-height: 560px) and (orientation: landscape) {
  .hero__sub { display: none; }
  .hud__tl, .hud__tr { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .reel__grain { display: none; }
}
@container reel (max-height: 720px) {
  .radar__legend { display: none; }
}
@container reel (orientation: portrait) {
  .hud__bl { display: none; }
}
