/* =========================================================================
   GROUP — "One group. Five companies."
   Signature set piece: a Three.js constellation. The SAA core sits at the
   centre with five company nodes in orbit, joined by filaments of light.
   Desktop: the section pins and the system turns to bring each company
   forward while the text panel swaps. Phones and reduced motion: the scene
   sits in a sticky band and the company cards scroll beneath it.
   ========================================================================= */

/* ---------- Hero ---------- */
.gp-hero {
  min-height: 100vh; min-height: 100svh;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding-bottom: clamp(40px, 7vh, 88px);
  background:
    radial-gradient(60% 55% at 74% 30%, rgba(0, 161, 155, .17), transparent 70%),
    radial-gradient(110% 80% at 80% 0%, var(--hero-1) 0%, var(--hero-2) 35%, var(--hero-3) 85%);
}
.gp-hero canvas.bg { will-change: transform; }
.gp-wrap { position: relative; }
.gp-hero h1 {
  margin-left: -.04em; font-size: clamp(3rem, 1rem + 6.5vw, 9.8rem); font-stretch: 122%;
}
.gp-hero h1 .outline { -webkit-text-stroke: 2px var(--accent-display); }
.gp-foot {
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 28px clamp(32px, 6vw, 96px); align-items: end; margin-top: clamp(28px, 4vw, 52px);
}
.gp-hero .gp-lead { margin-top: 0; color: rgba(var(--fg-rgb), .84); }
.gp-meta { display: grid; grid-template-columns: .7fr .7fr 1.2fr; gap: 20px; margin: 0; }
.gp-meta > div { border-top: 1px solid rgba(var(--fg-rgb), .18); padding-top: 14px; min-width: 0; display: grid; gap: 8px; align-content: start; }
.gp-meta dt { color: var(--accent); }
.gp-meta dd { margin: 0; font-size: var(--t-sm); line-height: 1.45; color: var(--fg); }
.gp-meta dd.gp-big {
  font-family: var(--f-display); font-weight: 900; font-stretch: 120%; line-height: .9;
  font-size: clamp(2.2rem, 1.4rem + 2.4vw, 3.8rem); letter-spacing: -.03em;
}
.gp-cue {
  display: inline-flex; align-items: center; gap: 14px; margin-top: clamp(28px, 5vh, 56px);
  color: var(--fg-muted); transition: color .3s;
}
.gp-cue:hover { color: var(--accent); }
.gp-cue-line { position: relative; width: 56px; height: 1px; background: rgba(var(--fg-rgb), .2); overflow: hidden; }
.gp-cue-line::after { content: ""; position: absolute; inset: 0; background: var(--accent-fill); transform: translateX(-100%); animation: gpCue 2.2s var(--ease-io) infinite; }
@keyframes gpCue { 0% { transform: translateX(-100%); } 55% { transform: translateX(0); } 100% { transform: translateX(100%); } }

@media (max-width: 960px) {
  .gp-foot { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .gp-hero { justify-content: flex-end; padding-bottom: 36px; }
  .gp-hero h1 { font-size: min(12.4vw, 4.4rem); font-stretch: 118%; }
  .gp-meta { grid-template-columns: 1fr 1fr; gap: 16px; }
  .gp-meta > div:nth-child(3) { grid-column: 1 / -1; }
  .gp-cue { display: none; }
}

/* ---------- Constellation (signature) ---------- */
.cn {
  --cx: 50%; --cy: 46%;
  position: relative; background: var(--bg); color: var(--fg);
  isolation: isolate;
}
.cn-stage { position: relative; overflow: hidden; isolation: isolate; background: var(--bg); }
.cn-bg {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
}
.cn-glow {
  position: absolute; left: var(--cx); top: var(--cy); width: 150vmax; height: 150vmax; transform: translate(-50%, -50%);
  background: radial-gradient(closest-side, rgba(0, 161, 155, .22), rgba(11, 37, 69, .5) 20%, rgba(11, 37, 69, .16) 32%, transparent 42%);
}
/* daylight: a soft teal haze around the core instead of the navy depth rings */
:root[data-theme="light"] .cn-glow { background: radial-gradient(closest-side, rgba(0, 161, 155, .2), rgba(0, 161, 155, .08) 20%, rgba(11, 37, 69, .035) 32%, transparent 42%); }
.cn-grid {
  position: absolute; inset: 0; opacity: .55;
  background-image: linear-gradient(rgba(var(--fg-rgb), .03) 1px, transparent 1px), linear-gradient(90deg, rgba(var(--fg-rgb), .03) 1px, transparent 1px);
  background-size: 72px 72px; background-position: center;
  -webkit-mask-image: radial-gradient(60% 55% at var(--cx) var(--cy), #000, transparent);
  mask-image: radial-gradient(60% 55% at var(--cx) var(--cy), #000, transparent);
}
.cn-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

/* still frame without WebGL */
.cn-fallback { position: absolute; left: var(--cx); top: var(--cy); width: min(92%, 760px); aspect-ratio: 640 / 400; transform: translate(-50%, -50%); }
.cn.gl-on .cn-fallback { display: none; }
.cn-fb-art { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.fb-orbit { stroke: rgba(var(--accent-rgb), .35); stroke-width: 1.2; }
.fb-faint { stroke: rgba(var(--accent-rgb), .2); }
.fb-links path { stroke: rgba(var(--accent-rgb), .3); stroke-width: 1.2; }
/* daylight still frame: navy orbits and teal links, as in the WebGL scene */
:root[data-theme="light"] .fb-orbit { stroke: rgba(11, 37, 69, .3); }
:root[data-theme="light"] .fb-faint { stroke: rgba(11, 37, 69, .2); }
:root[data-theme="light"] .fb-links path { stroke: rgba(0, 161, 155, .55); }
.fb-n { fill: var(--bg-raise); stroke: var(--accent-fill); stroke-width: 1.6; transition: fill .4s, r .4s; }
.fb-n.on { fill: var(--accent-fill); r: 13; filter: drop-shadow(0 0 10px rgba(94, 214, 204, .9)); }
:root[data-theme="light"] .fb-n.on { filter: drop-shadow(0 0 8px rgba(0, 161, 155, .5)); }
.cn-fb-core {
  position: absolute; left: 50%; top: 50%; width: 22%; aspect-ratio: 1; transform: translate(-50%, -50%);
  display: grid; place-items: center; border-radius: 50%;
  background: radial-gradient(circle at 50% 45%, #0E2C4C, var(--navy-990) 70%);
  box-shadow: inset 0 0 0 1.5px rgba(94, 214, 204, .7), 0 0 60px rgba(0, 161, 155, .45);
}
.cn-fb-core img { width: 64%; height: auto; }
/* daylight core: a pearl sphere with a teal rim and the emblem in navy. The emblem is the official white
   file used as a mask over navy (the official navy file is too small to scale up this far). */
:root[data-theme="light"] .cn-fb-core {
  background: radial-gradient(circle at 50% 45%, #FFFFFF, #D3E9EB 72%);
  box-shadow: inset 0 0 0 1.5px rgba(0, 161, 155, .75), 0 18px 50px -12px rgba(11, 37, 69, .3), 0 0 60px rgba(0, 161, 155, .25);
}
:root[data-theme="light"] .cn-fb-core img {
  object-position: -9999px 0; background: var(--navy);
  -webkit-mask: url(../img/logo-emblem-white.png) center / contain no-repeat; mask: url(../img/logo-emblem-white.png) center / contain no-repeat;
}

/* node labels, positioned by the scene */
.cn-labels { position: absolute; inset: 0; pointer-events: none; display: none; }
.cn.gl-on .cn-labels { display: block; }
.cn-lab {
  position: absolute; left: 0; top: 0; display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
  font: 500 .68rem/1 var(--f-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--fg-muted);
  opacity: 0; will-change: transform, opacity; transition: color .4s var(--ease);
}
.cn-lab b {
  display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; font-weight: 500;
  border: 1px solid rgba(var(--accent-rgb), .45); color: var(--accent); transition: background .4s var(--ease), color .4s var(--ease);
}
/* daylight: the scene dims labels by depth (opacity), so they start from navy, not muted grey or teal, to
   stay as legible as at night; the ring keeps the teal */
:root[data-theme="light"] .cn-lab { color: var(--fg); }
:root[data-theme="light"] .cn-lab:not(.is-on) b { color: var(--fg); border-color: rgba(4, 110, 104, .55); }
.cn-lab.is-on { color: var(--fg); }
.cn-lab.is-on b { background: var(--accent-fill); color: var(--navy-990); border-color: var(--accent-fill); }
.cn-lab.flip { flex-direction: row-reverse; }
.cn.is-narrow .cn-lab:not(.is-on) .t { display: none; }

/* heading */
.cn-head { position: relative; display: grid; gap: 16px; justify-items: start; align-content: start; }
.cn-title { font-size: clamp(1.9rem, 1rem + 2.2vw, 3.1rem); font-weight: 800; font-stretch: 114%; line-height: 1; letter-spacing: -.02em; max-width: 13ch; }
.cn-hint { display: inline-flex; align-items: center; gap: 10px; color: var(--fg-faint); }
.cn-hint::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent-fill); box-shadow: 0 0 10px var(--accent-fill); animation: cnBlink 2.4s var(--ease) infinite; }
@keyframes cnBlink { 50% { opacity: .25; } }
.cn-hint-d { display: none; }

/* company cards */
.cn-list { list-style: none; margin-block: 0; }
.cn-card { position: relative; display: grid; gap: 14px; min-width: 0; }
.cn-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.cn-num { color: var(--fg-muted); }
.cn-num b { color: var(--fg); font-weight: 500; }
.cn-tag { color: var(--accent); }
.cn-name { font-size: clamp(1.6rem, 1rem + 1.8vw, 2.6rem); font-weight: 900; font-stretch: 116%; line-height: 1; letter-spacing: -.024em; }
.cn-desc { color: var(--fg-muted); max-width: 44ch; }
.cn-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 4px; }
.cn-link svg { transition: transform .4s var(--ease); }
.cn-link:hover svg { transform: translateY(3px); }
.cn-steps { display: inline-flex; gap: 5px; }
.cn-steps i { width: 16px; height: 2px; background: rgba(var(--fg-rgb), .18); }
.cn-steps i.on { background: var(--accent-fill); box-shadow: 0 0 8px rgba(var(--accent-rgb), .7); }

/* progress indicator (pinned mode) */
.cn-progwrap { display: none; align-items: flex-end; gap: 22px; }
.cn-prog { display: flex; gap: 6px; }
.cn-prog button {
  position: relative; display: grid; gap: 10px; justify-items: start; width: clamp(56px, 5.6vw, 88px);
  padding: 10px 0 8px; background: none; border: 0; cursor: pointer; color: var(--fg-faint);
  font: 500 var(--t-xs)/1 var(--f-mono); letter-spacing: .12em; transition: color .4s var(--ease);
}
.cn-prog button:hover { color: var(--fg-muted); }
.cn-prog button.is-on { color: var(--fg); }
.cn-prog button i { display: block; width: 100%; height: 2px; background: rgba(var(--fg-rgb), .16); overflow: hidden; }
.cn-prog button b { display: block; height: 100%; background: var(--accent-fill); transform-origin: left; transform: scaleX(0); }
.cn-progname { color: var(--accent); padding-bottom: 7px; min-width: 12ch; }

/* --- Flow layout (default; phones, short screens, reduced motion) --- */
.cn-flow { display: contents; }
.cn { display: flex; flex-direction: column; }
.cn-head { order: 0; padding-top: clamp(80px, 12vw, 140px); padding-bottom: 28px; }
.cn-stage {
  order: 1; position: sticky; top: 0; z-index: 3;
  height: 56vh; height: max(300px, min(56svh, calc(100svh - 330px)));
  box-shadow: 0 24px 40px -10px var(--bg-deep);
}
.cn-stage::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 72px; pointer-events: none;
  background: linear-gradient(transparent, var(--bg-deep));
}
/* daylight (sticky stage on phones): fade the scene into the page and cast a soft navy shadow, not a grey band */
@media (max-width: 860px) {
  :root[data-theme="light"] .cn-stage { box-shadow: 0 22px 36px -24px rgba(11, 37, 69, .18); }
  :root[data-theme="light"] .cn-stage::after { background: linear-gradient(rgba(var(--bg-rgb), 0), var(--bg)); }
}
.cn-list { order: 2; position: relative; z-index: 1; padding-block: 8px clamp(48px, 10vh, 96px); }
.cn-item { display: flex; align-items: center; min-height: 40vh; min-height: 40svh; padding-block: 14px; }
.cn-card {
  width: 100%; padding: 22px 20px 20px; border-radius: var(--r);
  background: linear-gradient(160deg, rgba(var(--fg-rgb), .06), rgba(var(--fg-rgb), .015));
  border: 1px solid var(--line-dark); transition: border-color .5s var(--ease), background .5s var(--ease);
}
:root[data-theme="light"] .cn-card { background: var(--card-bg); box-shadow: 0 18px 40px -30px var(--shadow); }
.cn-item.is-on .cn-card { border-color: rgba(var(--accent-rgb), .45); background: linear-gradient(160deg, rgba(0, 161, 155, .14), rgba(var(--fg-rgb), .02)); }
:root[data-theme="light"] .cn:not(.is-pin) .cn-item.is-on .cn-card { background: linear-gradient(160deg, #E3F3F2, #FFFFFF); }
.cn-progwrap { order: 3; }

@media (min-width: 861px) {
  .cn { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); grid-template-rows: auto auto; }
  .cn-head { grid-column: 1; grid-row: 1; padding-top: var(--section); }
  .cn-list { grid-column: 1; grid-row: 2; padding-bottom: var(--section); }
  .cn-head, .cn-list { padding-right: clamp(16px, 3vw, 48px); }
  .cn-stage { grid-column: 2; grid-row: 1 / span 2; align-self: start; height: 100vh; height: 100svh; box-shadow: none; }
  .cn-stage::after { display: none; }
  .cn-item { min-height: 62vh; }
  .cn-card { padding: clamp(24px, 2.6vw, 36px); }
}

/* --- Pinned layout (desktop, set by group.js) --- */
.cn.is-pin { --cx: 66%; --cy: 48%; display: block; height: 100vh; overflow: hidden; }
.cn.is-pin .cn-stage { position: absolute; inset: 0; z-index: 0; height: auto; align-self: stretch; box-shadow: none; }
.cn.is-pin .cn-stage::after { display: none; }
.cn.is-pin .cn-flow {
  display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto;
  position: absolute; inset: 0; z-index: 2; pointer-events: none;
  padding: calc(var(--nav-h) + clamp(20px, 5vh, 56px)) 0 clamp(26px, 4.6vh, 48px);
}
.cn.is-pin .cn-flow::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(90deg, rgba(var(--deep-rgb), .78) 0%, rgba(var(--deep-rgb), .38) 30%, transparent 48%);
}
/* daylight: calm the scene behind the text with the page colour, not white (no brighter slab under the hero) */
:root[data-theme="light"] .cn.is-pin .cn-flow::before { background: linear-gradient(90deg, rgba(var(--bg-rgb), .78) 0%, rgba(var(--bg-rgb), .38) 30%, transparent 48%); }
.cn.is-pin .cn-head { grid-row: 1; padding: 0 var(--gutter); }
.cn.is-pin .cn-hint-d { display: inline; }
.cn.is-pin .cn-hint-m { display: none; }
.cn.is-pin .cn-list { grid-row: 3; display: grid; padding: 0 var(--gutter); }
.cn.is-pin .cn-item { grid-area: 1 / 1; align-self: end; min-height: 0; padding: 0; display: block; opacity: 0; }
.cn.is-pin .cn-item.is-on { opacity: 1; }
.cn.is-pin .cn-card { max-width: min(560px, 40vw); padding: 0; border: 0; background: none; box-shadow: none; gap: 16px; }
.cn.is-pin .cn-name { font-size: clamp(2rem, 1rem + 2.1vw, 3.3rem); }
.cn.is-pin .cn-desc { font-size: var(--t-lg); line-height: 1.45; }
.cn.is-pin .cn-steps { display: none; }
.cn.is-pin .cn-progwrap { display: flex; grid-row: 4; margin-top: clamp(22px, 4vh, 40px); padding: 0 var(--gutter); }
.cn.is-pin .cn-head *, .cn.is-pin .cn-card *, .cn.is-pin .cn-prog { pointer-events: auto; }

@media (max-width: 560px) {
  .cn-head { padding-top: 88px; }
  .cn-card { padding: 20px 18px 18px; gap: 12px; }
  .cn-name { font-size: clamp(1.45rem, 1rem + 2.6vw, 1.8rem); font-stretch: 112%; }
  .cn-desc { font-size: .98rem; }
  .cn-meta .mono { font-size: .66rem; letter-spacing: .1em; }
  .cn-lab { font-size: .6rem; letter-spacing: .1em; gap: 6px; }
  .cn-lab b { width: 18px; height: 18px; }
}

/* ---------- Marquee ---------- */
.gp-marquee { position: relative; z-index: 1; }

/* ---------- The five companies, in detail ---------- */
.roster-head { display: grid; gap: 22px; }

.skey { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; margin-bottom: clamp(36px, 5vw, 64px); }
.skey-l { color: var(--ink-muted); }
.skey-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.skey-item, .chip {
  display: inline-flex; align-items: center; gap: 9px; padding: 9px 14px 9px 11px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--paper); color: var(--ink);
  font-size: var(--t-sm); font-weight: 500; line-height: 1.2;
  transition: background .4s var(--ease), color .4s var(--ease), border-color .4s var(--ease);
}
.skey-item { cursor: default; }
.sic { width: 20px; height: 20px; flex: none; fill: none; stroke: var(--teal-ink); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: stroke .4s var(--ease); }
.skey-item.is-hot, .chip.is-hot { background: var(--navy); color: var(--on-dark); border-color: var(--navy); }
.skey-item.is-hot .sic, .chip.is-hot .sic { stroke: var(--teal-300); }

.roster-list { list-style: none; margin: 0; padding: 0; border-bottom: 1px solid var(--line); }
.co {
  position: relative; isolation: isolate; scroll-margin-top: 96px;
  display: grid; grid-template-columns: 72px minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, .95fr);
  gap: 18px clamp(22px, 3vw, 48px); align-items: start; padding-block: clamp(30px, 3.6vw, 52px);
  transition: opacity .45s var(--ease);
}
.co-line { position: absolute; left: 0; right: 0; top: 0; height: 1px; background: var(--line); transform-origin: left; }
.co-ic {
  width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid var(--line); background: var(--paper); color: var(--teal-ink);
  transition: background .5s var(--ease), color .5s var(--ease), border-color .5s var(--ease), rotate .6s var(--ease);
}
.co-ic svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.co-id { display: grid; gap: 10px; min-width: 0; padding-top: 4px; }
.co-tag { color: var(--teal-ink); }
.co-name { font-size: clamp(1.5rem, 1rem + 1.5vw, 2.45rem); font-weight: 900; font-stretch: 114%; line-height: 1.02; letter-spacing: -.022em; transition: translate .6s var(--ease); }
.co-body { display: grid; gap: 14px; justify-items: start; min-width: 0; padding-top: 4px; }
.co-desc { color: var(--ink); font-size: var(--t-base); max-width: 40ch; }
.co-ph { font-size: .68rem; line-height: 1.5; }
.co-sec { display: grid; gap: 12px; min-width: 0; padding-top: 4px; }
.co-sec-l { color: var(--ink-muted); }
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chip { font-size: .86rem; }

.roster-list.is-filter .co { opacity: .3; }
.roster-list.is-filter .co.is-match { opacity: 1; }
.co.is-match .co-ic, .co:target .co-ic { background: var(--navy); color: var(--teal-300); border-color: var(--navy); }

@media (hover: hover) and (pointer: fine) {
  .co:hover .co-ic { background: var(--navy); color: var(--teal-300); border-color: var(--navy); rotate: -8deg; }
  .co:hover .co-name { translate: 8px 0; }
}

.roster-foot {
  margin-top: clamp(40px, 5vw, 72px); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 22px 40px;
}
.rf-copy { display: grid; gap: 12px; justify-items: start; max-width: 64ch; }
.rf-text { font-size: var(--t-lg); line-height: 1.45; font-weight: 500; color: var(--ink); text-wrap: balance; }

@media (max-width: 1080px) {
  .co { grid-template-columns: 64px minmax(0, 1fr) minmax(0, 1fr); }
  .co-sec { grid-column: 2 / -1; }
}
@media (max-width: 760px) {
  .co { grid-template-columns: 52px minmax(0, 1fr); gap: 16px; }
  .co-ic { width: 52px; height: 52px; }
  .co-ic svg { width: 24px; height: 24px; }
  .co-body, .co-sec { grid-column: 1 / -1; }
  .co-name { font-size: clamp(1.4rem, 1rem + 2.2vw, 1.85rem); font-stretch: 110%; }
  .skey { gap: 12px; }
  .skey-item, .chip { font-size: .82rem; padding: 8px 12px 8px 10px; }
}
@media (max-width: 520px) {
  .roster-foot .btn { white-space: normal; text-align: left; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .gp-cue-line::after, .cn-hint::before { animation: none; }
}

/* ---------- Launch fixes: hero call to action, small text ---------- */
.gp-copy { display: grid; gap: clamp(22px, 2.6vw, 32px); justify-items: start; min-width: 0; }
.cn-num, .cn-tag { font-size: var(--t-xs); }
.gp-hero h1 { font-kerning: none; font-variant-ligatures: none; }
/* 12px floor on phones too: the 560px rule above set these to .66rem / .6rem */
.cn-meta .cn-num, .cn-meta .cn-tag { font-size: var(--t-xs); }
.cn-lab { font-size: var(--t-xs); }
@media (max-width: 560px) { .cn-lab { letter-spacing: .06em; } .cn-lab b { width: 20px; height: 20px; } }
/* company card placeholder: 12px floor (was .68rem, 10.9px) */
.co-ph { font-size: var(--t-xs); }
