/* ==========================================================================
   Ghandour Global Group — subsidiaries.html stylesheet
   Requires css/base.css to be loaded first.
   ========================================================================== */

/* --------------------------------------------------------------------------
   9. Subsidiaries page - 3D portfolio journey
   -------------------------------------------------------------------------- */

.subsidiary-flow {
  --sub-progress: 0;
  --sub-accent-rgb: 77, 125, 255;
  --sub-glow-x: 72%;
  --sub-glow-y: 18%;
  isolation: isolate;
  overflow-x: clip;
}

.subsidiary-flow::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at var(--sub-glow-x, 72%) var(--sub-glow-y, 18%), rgba(var(--sub-accent-rgb), 0.2), transparent 24rem),
    radial-gradient(circle at 18% 72%, rgba(31, 204, 31, 0.08), transparent 22rem);
  opacity: 0.82;
  transition: background 0.55s ease;
}

.subsidiary-flow .container,
.subsidiary-flow section,
.subsidiary-rail {
  position: relative;
  z-index: 1;
}

.subsidiary-rail {
  position: fixed;
  top: calc(var(--header-h, 72px) + 50%);
  right: clamp(0.8rem, 2vw, 1.5rem);
  transform: translateY(-50%);
  display: grid;
  gap: 0.55rem;
  z-index: 40;
}

.subsidiary-rail a {
  min-width: 8.5rem;
  padding: 0.5rem 0.8rem;
  border-radius: var(--radius-pill);
  font-family: var(--font-primary);
  font-size: 0.72rem;
  font-weight: 700;
  color: rgba(232, 237, 247, 0.74);
  text-decoration: none;
  background: rgba(5, 12, 28, 0.78);
  border: 1px solid rgba(232, 237, 247, 0.16);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
  transition: color 0.35s ease, border-color 0.35s ease, background 0.35s ease, transform 0.35s ease;
}

.subsidiary-rail a:hover,
.subsidiary-rail a:focus,
.subsidiary-rail a:focus-visible,
.subsidiary-rail a.is-active {
  color: var(--color-white);
  border-color: rgba(var(--sub-accent-rgb), 0.72);
  background: rgba(var(--sub-accent-rgb), 0.18);
  transform: translateX(-0.35rem);
}

/* Energy rail: one thin spine threading hero -> finale, tinted to the
   active subsidiary's accent and lit by a glow that follows scroll
   progress through the whole page (see --sub-progress in subsidiaries.js). */
.energy-rail {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 1px;
  z-index: 1;
  pointer-events: none;
}

.energy-rail-track {
  position: absolute;
  inset: 0;
  width: 1px;
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(var(--sub-accent-rgb), 0.3) 8%,
    rgba(var(--sub-accent-rgb), 0.3) 92%,
    transparent 100%
  );
  transition: background 0.55s ease;
}

.energy-rail-pulse {
  position: absolute;
  left: 50%;
  top: calc(var(--sub-progress, 0) * 100%);
  width: 14px;
  height: 14px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(var(--sub-accent-rgb), 0.95), transparent 70%);
  box-shadow: 0 0 24px 6px rgba(var(--sub-accent-rgb), 0.42);
  transition: background 0.55s ease, box-shadow 0.55s ease;
}

.subsidiary-hero,
.subsidiary-world,
.subsidiary-finale {
  min-height: calc(100svh - var(--header-h, 72px));
  display: flex;
  align-items: center;
  overflow: hidden;
  padding-block: clamp(4rem, 9vw, 7rem);
}

.subsidiary-hero-grid,
.subsidiary-world-grid,
.subsidiary-finale-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(320px, 1.05fr);
  align-items: center;
  gap: clamp(2.5rem, 7vw, 6rem);
}

.subsidiary-world-grid--reverse {
  grid-template-columns: minmax(320px, 1.05fr) minmax(0, 0.95fr);
}

.subsidiary-world-grid--reverse .subsidiary-copy {
  order: 2;
}

.subsidiary-hero h1,
.subsidiary-copy h2 {
  color: var(--color-white);
  text-wrap: balance;
}

.subsidiary-hero h1 {
  max-width: 14ch;
  font-size: clamp(2.4rem, 6vw, 4.75rem);
  line-height: 0.94;
}

.subsidiary-hero .lead,
.subsidiary-copy p {
  color: rgba(232, 237, 247, 0.82);
}

.subsidiary-hero .lead {
  max-width: 54ch;
  font-size: clamp(1rem, 1.5vw, 1.18rem);
}

.subsidiary-copy {
  max-width: 620px;
}

.subsidiary-copy h2 {
  max-width: 15ch;
  font-size: clamp(2rem, 4.6vw, 3.7rem);
  line-height: 1;
}

.subsidiary-copy p {
  max-width: 52ch;
  font-size: clamp(1rem, 1.25vw, 1.1rem);
}

.subsidiary-signals {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin: 1.25rem 0 1.6rem;
  padding: 0;
}

.subsidiary-signals li {
  padding: 0.42rem 0.82rem;
  border-radius: var(--radius-pill);
  font-family: var(--font-primary);
  font-size: 0.76rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(232, 237, 247, 0.16);
}

.portfolio-orbit {
  position: relative;
  width: min(82vw, 540px);
  aspect-ratio: 1;
  margin-inline: auto;
  perspective: 1000px;
  transform-style: preserve-3d;
  transform: rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg));
  transition: transform 0.45s cubic-bezier(0.16, 0.6, 0.2, 1);
}

.portfolio-orbit::before {
  content: "";
  position: absolute;
  inset: 12%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 64, 224, 0.2), transparent 68%);
}

.portfolio-ring {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.portfolio-ring--outer {
  inset: 3%;
  border: 1px dashed rgba(77, 125, 255, 0.36);
  --ring-z: 0px;
  transform: rotateX(68deg) translateZ(var(--ring-z));
  /* Slowed from 54s/42s (kept proportional) - ambient ring pair, calmer. */
  animation: subsidiary-spin 65s linear infinite;
}

.portfolio-ring--inner {
  inset: 22%;
  border: 1px solid rgba(31, 204, 31, 0.18);
  --ring-z: 16px;
  transform: rotateX(68deg) translateZ(var(--ring-z));
  animation: subsidiary-spin 50s linear infinite reverse;
}

.portfolio-core {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 128px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  transform-style: preserve-3d;
  transform: translate(-50%, -50%) translateZ(74px);
  font-family: var(--font-primary);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--color-white);
  background:
    radial-gradient(circle at 32% 26%, rgba(255, 255, 255, 0.5), transparent 34%),
    conic-gradient(from 210deg, #061029, #0040e0 45%, #061029 100%);
  border: 1px solid rgba(232, 237, 247, 0.42);
  box-shadow:
    inset 0 0 18px rgba(255, 255, 255, 0.14),
    0 16px 0 rgba(2, 8, 20, 0.95),
    0 0 58px rgba(0, 64, 224, 0.48);
}

.portfolio-core::before {
  content: "";
  position: absolute;
  inset: 10px -16px -16px 10px;
  border-radius: 50%;
  background: linear-gradient(145deg, rgba(5, 15, 36, 0.92), rgba(0, 64, 224, 0.26));
  transform: translateZ(-18px);
  z-index: -1;
}

.portfolio-node {
  position: absolute;
  left: 50%;
  top: 50%;
  padding: 0.48rem 0.9rem;
  border-radius: var(--radius-pill);
  white-space: nowrap;
  font-family: var(--font-primary);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--color-white);
  background: rgba(8, 17, 37, 0.82);
  border: 1px solid rgba(122, 160, 255, 0.34);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.38), 0 0 20px rgba(0, 64, 224, 0.16);
}

/* Each subsidiary keeps the same accent color everywhere it appears
   site-wide (same hex values as js/subsidiaries.js's accents map). */
.portfolio-node--emagine {
  transform: translate(-50%, -50%) rotate(12deg) translateX(188px) rotate(-12deg) translateZ(42px);
  border-color: rgba(77, 125, 255, 0.44);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.38), 0 0 20px rgba(77, 125, 255, 0.18);
}

.portfolio-node--electrify {
  transform: translate(-50%, -50%) rotate(108deg) translateX(192px) rotate(-108deg) translateZ(42px);
  border-color: rgba(111, 157, 255, 0.44);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.38), 0 0 20px rgba(111, 157, 255, 0.18);
}

.portfolio-node--wattswhere {
  transform: translate(-50%, -50%) rotate(204deg) translateX(188px) rotate(-204deg) translateZ(42px);
  border-color: rgba(47, 212, 107, 0.44);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.38), 0 0 20px rgba(47, 212, 107, 0.18);
}

.portfolio-node--melon {
  transform: translate(-50%, -50%) rotate(300deg) translateX(192px) rotate(-300deg) translateZ(42px);
  border-color: rgba(31, 204, 31, 0.44);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.38), 0 0 20px rgba(31, 204, 31, 0.18);
}

@keyframes subsidiary-spin {
  to { transform: rotateX(68deg) translateZ(var(--ring-z, 0px)) rotateZ(360deg); }
}

.subsidiary-world--emagine {
  --sub-accent-rgb: 77, 125, 255;
}

.subsidiary-world--electrify {
  --sub-accent-rgb: 111, 157, 255;
}

.subsidiary-world--wattswhere {
  --sub-accent-rgb: 47, 212, 107;
}

.subsidiary-world--melon {
  --sub-accent-rgb: 31, 204, 31;
}

.subsidiary-world.is-active .subsidiary-scene {
  opacity: 1;
  --scene-enter-y: 0px;
}

.subsidiary-scene {
  position: relative;
  width: min(86vw, 560px);
  min-height: 470px;
  margin-inline: auto;
  perspective: 1100px;
  transform-style: preserve-3d;
  opacity: 0.74;
  --scene-enter-y: 28px;
  --scene-tilt-x: 0deg;
  --scene-tilt-y: 0deg;
  transform: translateY(var(--scene-enter-y)) rotateX(var(--scene-tilt-x)) rotateY(var(--scene-tilt-y));
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.16, 0.6, 0.2, 1);
  contain: layout;
}

.scene-floor {
  position: absolute;
  inset: 20% 2% 4%;
  border-radius: 50%;
  background:
    linear-gradient(90deg, transparent calc(50% - 1px), rgba(var(--sub-accent-rgb), 0.44) calc(50% - 1px) calc(50% + 1px), transparent calc(50% + 1px)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.09) 0 1px, transparent 1px 58px),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.07) 0 1px, transparent 1px 58px),
    radial-gradient(ellipse, rgba(var(--sub-accent-rgb), 0.18), transparent 70%);
  border: 1px solid rgba(var(--sub-accent-rgb), 0.3);
  transform: rotateX(68deg) translateZ(-58px);
  transform-origin: center bottom;
  box-shadow: 0 0 34px rgba(var(--sub-accent-rgb), 0.12);
}

.scene-floor,
.charging-bay,
.approval-line,
.radar-ring,
.data-stream {
  backface-visibility: hidden;
}

/* Assemble-on-scroll: floor -> main object -> supporting details, staggered
   opacity reveal the first time a section enters view. Kept independent of
   .is-active above (which stays reversible and only dims the scene as a
   whole) - .is-assembled is one-shot and sticky, set by an IntersectionObserver
   in subsidiaries.js. Opacity-only so none of the hand-placed 3D transforms
   on these elements are touched. */
.subsidiary-world .scene-floor,
.subsidiary-world .scene-object,
.subsidiary-world .scene-detail {
  opacity: 0;
  transition: opacity 0.7s ease;
}

.subsidiary-world.is-assembled .scene-floor {
  opacity: 1;
}

.subsidiary-world.is-assembled .scene-object {
  opacity: 1;
  transition-delay: 0.16s;
}

.subsidiary-world.is-assembled .scene-detail {
  opacity: 1;
  transition-delay: 0.3s;
}

.subsidiary-world.is-assembled .charging-bay--two,
.subsidiary-world.is-assembled .approval-line--two,
.subsidiary-world.is-assembled .map-pin--two,
.subsidiary-world.is-assembled .data-cube--two,
.subsidiary-world.is-assembled .data-node--two,
.subsidiary-world.is-assembled .data-stream--two {
  transition-delay: 0.36s;
}

.subsidiary-world.is-assembled .map-pin--three,
.subsidiary-world.is-assembled .data-cube--three,
.subsidiary-world.is-assembled .data-node--three {
  transition-delay: 0.42s;
}

/* Electrify's approval seal "stamps" down as its own climactic beat once
   the rest of the scene has assembled, rather than joining the plain
   opacity fade the other supporting details use. */
.subsidiary-world .scene-stamp {
  opacity: 0;
  transform: translateZ(34px) rotate(-12deg) scale(2.4);
}

.subsidiary-world.is-assembled .scene-stamp {
  animation: seal-stamp 0.6s cubic-bezier(0.32, 1.4, 0.4, 1) 0.48s forwards;
}

@keyframes seal-stamp {
  0% { opacity: 0; transform: translateZ(34px) rotate(-12deg) scale(2.4); }
  55% { opacity: 1; }
  100% { opacity: 1; transform: translateZ(34px) rotate(-12deg) scale(1); }
}

/* Hover/click interactions: --scene-tilt-x/--scene-tilt-y are written by
   subsidiaries.js (fine pointers only) and composed into .subsidiary-scene's
   own transform above. A tap or click on any pointer type also triggers a
   short glow pulse on the scene's central object via .is-pulsing. */
.subsidiary-scene {
  cursor: pointer;
}

.subsidiary-scene.is-pulsing .scene-object {
  animation: scene-click-pulse 0.5s ease-out;
}

@keyframes scene-click-pulse {
  0% { filter: brightness(1); }
  40% { filter: brightness(1.35) drop-shadow(0 0 18px rgba(var(--sub-accent-rgb), 0.55)); }
  100% { filter: brightness(1); }
}

.ev-charger {
  position: absolute;
  left: 50%;
  top: 21%;
  width: 112px;
  height: 230px;
  border-radius: 28px 28px 16px 16px;
  transform-style: preserve-3d;
  transform: translateX(-50%) translateZ(122px) rotateX(2deg) rotateY(-18deg) scale(var(--scene-object-scale, 1));
  background:
    linear-gradient(110deg, rgba(255, 255, 255, 0.18), transparent 32%),
    linear-gradient(180deg, #20375e, #07142e 58%, #020817);
  border: 1px solid rgba(122, 160, 255, 0.4);
  box-shadow: 18px 22px 0 rgba(1, 6, 16, 0.58), 0 0 46px rgba(0, 64, 224, 0.36);
}

.ev-charger::before,
.ev-charger::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.ev-charger::before {
  top: 18px;
  right: -28px;
  width: 28px;
  height: calc(100% - 30px);
  border-radius: 0 18px 16px 0;
  background: linear-gradient(180deg, #15243e, #030814);
  transform-origin: left center;
  transform: rotateY(88deg);
  border: 1px solid rgba(122, 160, 255, 0.18);
}

.ev-charger::after {
  left: 18px;
  top: -28px;
  width: calc(100% - 24px);
  height: 34px;
  border-radius: 20px 20px 6px 6px;
  background: linear-gradient(120deg, #2e4774, #09142a);
  transform-origin: bottom center;
  transform: rotateX(88deg);
  border: 1px solid rgba(232, 237, 247, 0.16);
}

.charger-screen,
.charger-port,
.charger-base,
.charger-cable {
  position: absolute;
  display: block;
}

.charger-screen {
  left: 22px;
  top: 34px;
  width: 68px;
  height: 54px;
  border-radius: var(--radius-md);
  background:
    linear-gradient(90deg, transparent 18%, rgba(31, 204, 31, 0.8) 18% 24%, transparent 24%),
    radial-gradient(circle at 72% 34%, rgba(31, 204, 31, 0.95), transparent 18%),
    linear-gradient(150deg, rgba(122, 160, 255, 0.42), rgba(2, 9, 24, 0.92));
  box-shadow: inset 0 0 16px rgba(31, 204, 31, 0.14), 0 0 18px rgba(31, 204, 31, 0.28);
  transform: translateZ(10px);
}

.charger-port {
  left: 39px;
  top: 112px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(31, 204, 31, 0.9), rgba(4, 11, 27, 0.94) 48%);
  border: 1px solid rgba(31, 204, 31, 0.55);
  transform: translateZ(12px);
}

/* Cable path: exits the charger at the port's height (top border runs
   right over the port row, so it reads as plugged into that socket),
   arcs over at the top-right, then drops straight down to the ground
   where the connector hangs. The old shape was flipped - its top end
   just stopped in mid-air, so the cable read as coming from nowhere. */
.charger-cable {
  left: 60px;
  top: 122px;
  width: 132px;
  height: 112px;
  border: 7px solid rgba(31, 204, 31, 0.62);
  border-left: 0;
  border-bottom: 0;
  border-radius: 0 66px 0 0;
  box-shadow: 0 0 14px rgba(31, 204, 31, 0.16);
  transform: translateZ(8px);
}

/* EV charging connector head hanging from the cable's end: a tapered
   metallic nozzle whose green top the cord feeds straight into, with a
   recessed connector face and one lit contact. Everything is centered
   on the cable's 7px drop line (x = right edge - 3.5px), unrotated, so
   the whole assembly hangs plumb from the cord. */
.charger-cable::before {
  content: "";
  position: absolute;
  right: -11px;
  bottom: -48px;
  width: 30px;
  height: 50px;
  clip-path: polygon(12% 0%, 88% 0%, 88% 50%, 72% 100%, 28% 100%, 12% 50%);
  /* The lower stops stay clearly lighter than the page background - the
     clip-path also clips the border off the tapered edges, so if the
     gradient fades to near-black the tip's silhouette disappears and
     the lit contact below looks orphaned. */
  background:
    linear-gradient(108deg, rgba(255, 255, 255, 0.26), transparent 34%),
    linear-gradient(180deg, rgba(31, 204, 31, 0.85) 0%, #234017 14%, #2a4166 34%, #1d3050 62%, #162642);
  border: 1px solid rgba(122, 160, 255, 0.3);
  filter: drop-shadow(2px 7px 9px rgba(1, 6, 16, 0.5));
  transform: translateZ(12px);
}

/* Junction cuff where the cord meets the top of the nozzle. */
.charger-cable::after {
  content: "";
  position: absolute;
  right: -5px;
  bottom: -6px;
  width: 17px;
  height: 10px;
  border-radius: 4px;
  background: linear-gradient(180deg, rgba(46, 220, 90, 0.9), rgba(20, 60, 30, 0.9));
  transform: translateZ(12px);
}

/* Connector face plate: the flat insertion end, sized to fit inside the
   nozzle's tapered tip (which is only ~13px wide) so it doesn't poke
   out past the silhouette and read as a separate floating square. */
.charger-plug-pin {
  position: absolute;
  right: -2px;
  bottom: -46px;
  width: 11px;
  height: 9px;
  border-radius: 2px;
  background: linear-gradient(180deg, #223a5e, #0a1626);
  border: 1px solid rgba(122, 160, 255, 0.3);
  box-shadow: inset 0 0 4px rgba(0, 0, 0, 0.6);
  transform: translateZ(12px);
}

/* One lit charge contact strip centered on the face (not two side-by-side
   dots - that was the "mouse buttons" read). */
.charger-plug-pin--two {
  right: 0px;
  bottom: -44px;
  width: 7px;
  height: 2.5px;
  border-radius: 2px;
  background: rgba(31, 204, 31, 0.95);
  border: none;
  box-shadow: 0 0 8px rgba(31, 204, 31, 0.85);
}

.charger-base {
  left: -20px;
  bottom: -28px;
  width: 152px;
  height: 34px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(77, 125, 255, 0.46), transparent 70%);
}

.charging-bay {
  position: absolute;
  width: 188px;
  height: 86px;
  border: 1px solid rgba(31, 204, 31, 0.34);
  border-radius: 16px;
  transform: rotateX(68deg) translateZ(-22px);
  transform-origin: center bottom;
}

.charging-bay--one { left: 9%; bottom: 22%; }
.charging-bay--two { right: 8%; bottom: 22%; opacity: 0.58; }

.charging-pulse {
  position: absolute;
  left: 50%;
  bottom: 28%;
  width: 18px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--color-green);
  box-shadow: 0 0 22px rgba(31, 204, 31, 0.9);
  transform: translate(-50%, -50%) translateZ(28px) scale(0.8);
  animation: charge-pulse 2.2s ease-in-out infinite;
  animation-play-state: paused;
}

.subsidiary-world.is-active .charging-pulse {
  animation-play-state: running;
}

@keyframes charge-pulse {
  0%, 100% { opacity: 0.42; transform: translate(-50%, -50%) translateZ(28px) scale(0.8); }
  50% { opacity: 1; transform: translate(-50%, -50%) translateZ(28px) scale(1.35); }
}

.permit-stack {
  position: absolute;
  left: 50%;
  top: 18%;
  width: 240px;
  height: 300px;
  transform-style: preserve-3d;
  transform: translateX(-50%) translateZ(112px) rotateX(2deg) rotateY(14deg) scale(var(--scene-object-scale, 1));
}

.permit-sheet {
  position: absolute;
  inset: 0;
  border-radius: 18px;
  transform-style: preserve-3d;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.16), transparent 32%),
    linear-gradient(180deg, #223a63, #0a1830 58%, #030913);
  border: 1px solid rgba(122, 160, 255, 0.4);
  box-shadow: 20px 24px 0 rgba(1, 6, 16, 0.5), 0 0 44px rgba(0, 64, 224, 0.3);
}

.permit-sheet::before,
.permit-sheet::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.permit-sheet::before {
  top: 12px;
  right: -18px;
  width: 18px;
  height: calc(100% - 20px);
  border-radius: 0 12px 12px 0;
  background: linear-gradient(180deg, #16273f, #040a17);
  border: 1px solid rgba(122, 160, 255, 0.18);
  transform-origin: left center;
  transform: rotateY(88deg);
}

.permit-sheet::after {
  left: 14px;
  bottom: -18px;
  width: calc(100% - 10px);
  height: 18px;
  border-radius: 0 0 14px 14px;
  background: linear-gradient(90deg, #2c4570, #0b1626);
  border: 1px solid rgba(232, 237, 247, 0.14);
  transform-origin: top center;
  transform: rotateX(-88deg);
}

.permit-sheet--back {
  transform: translate3d(24px, 28px, -34px);
  opacity: 0.42;
}

.permit-sheet--front span {
  position: absolute;
  left: 28px;
  right: 28px;
  height: 10px;
  border-radius: var(--radius-pill);
  background: rgba(0, 64, 224, 0.34);
  transform: translateZ(8px);
}

.permit-sheet--front span:nth-child(1) { top: 74px; }
.permit-sheet--front span:nth-child(2) { top: 108px; right: 72px; }
.permit-sheet--front span:nth-child(3) { top: 142px; right: 46px; background: rgba(31, 204, 31, 0.38); }

.approval-seal {
  position: absolute;
  right: 22px;
  bottom: 34px;
  width: 72px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  transform-style: preserve-3d;
  font-family: var(--font-primary);
  font-weight: 700;
  color: var(--color-green);
  border: 3px solid rgba(31, 204, 31, 0.72);
  transform: translateZ(34px) rotate(-12deg);
  box-shadow: 0 0 22px rgba(31, 204, 31, 0.32);
}

.approval-seal::after {
  content: "";
  position: absolute;
  inset: 4px -8px -8px 4px;
  border-radius: 50%;
  border: 2px solid rgba(12, 49, 107, 0.38);
  transform: translateZ(-10px);
}

.approval-check {
  display: block;
  width: 44%;
  height: 24%;
  border-left: 3px solid var(--color-green);
  border-bottom: 3px solid var(--color-green);
  transform: translateY(-12%) rotate(-45deg);
}

.compliance-shield {
  position: absolute;
  right: 16%;
  top: 18%;
  width: 86px;
  height: 100px;
  transform-style: preserve-3d;
  transform: translateZ(168px) rotateY(-18deg) rotateX(3deg);
  background:
    radial-gradient(circle at 50% 30%, rgba(255, 255, 255, 0.42), transparent 28%),
    linear-gradient(180deg, rgba(31, 204, 31, 0.55), rgba(0, 64, 224, 0.36));
  clip-path: polygon(50% 0, 92% 16%, 82% 76%, 50% 100%, 18% 76%, 8% 16%);
  box-shadow: 0 0 22px rgba(31, 204, 31, 0.18);
}

.compliance-shield::after {
  content: "";
  position: absolute;
  inset: 6px -10px -10px 8px;
  background: linear-gradient(180deg, rgba(8, 48, 40, 0.74), rgba(2, 8, 18, 0.92));
  clip-path: inherit;
  transform: translateZ(-14px);
  z-index: -1;
}

.approval-line {
  position: absolute;
  height: 2px;
  width: 220px;
  background: linear-gradient(90deg, transparent, rgba(31, 204, 31, 0.72), transparent);
  transform-origin: center;
  transform: rotateX(68deg) translateZ(10px);
}

.approval-line--one {
  left: 8%;
  top: 38%;
  transform: rotateX(68deg) translateZ(10px) rotateZ(-18deg);
}

.approval-line--two {
  right: 4%;
  bottom: 34%;
  transform: rotateX(68deg) translateZ(10px) rotateZ(14deg);
}

.network-phone {
  position: absolute;
  left: 50%;
  top: 16%;
  width: 190px;
  height: 350px;
  border-radius: 34px;
  padding: 12px;
  transform-style: preserve-3d;
  transform: translateX(-50%) translateZ(124px) rotateX(2deg) rotateY(-24deg) scale(var(--scene-object-scale, 1));
  background: linear-gradient(90deg, #2a3446, #050916 16%, #1a2539 88%, #02040a);
  border: 1px solid rgba(232, 237, 247, 0.22);
  box-shadow: 22px 26px 0 rgba(1, 6, 16, 0.56), 0 0 52px rgba(0, 64, 224, 0.3);
}

.network-phone::before,
.network-phone::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.network-phone::before {
  top: 24px;
  right: -24px;
  width: 24px;
  height: calc(100% - 48px);
  border-radius: 0 22px 22px 0;
  background: linear-gradient(180deg, #293449, #050813);
  transform-origin: left center;
  transform: rotateY(88deg);
  border: 1px solid rgba(232, 237, 247, 0.12);
}

.network-phone::after {
  left: 28px;
  top: -18px;
  width: calc(100% - 38px);
  height: 22px;
  border-radius: 20px 20px 4px 4px;
  background: linear-gradient(90deg, #48566e, #101827);
  transform-origin: bottom center;
  transform: rotateX(88deg);
}

.network-phone-screen {
  position: relative;
  display: block;
  height: 100%;
  border-radius: 25px;
  overflow: hidden;
  transform-style: preserve-3d;
  transform: translateZ(10px);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    radial-gradient(circle at 42% 58%, rgba(31, 204, 31, 0.22), transparent 34%),
    linear-gradient(160deg, #16305f, #071126 72%);
  background-size: 34px 34px, 34px 34px, auto, auto;
}

.map-route {
  position: absolute;
  left: 34px;
  top: 68px;
  width: 118px;
  height: 184px;
  border: 3px dashed rgba(31, 204, 31, 0.72);
  border-left: 0;
  border-bottom: 0;
  border-radius: 0 48px 0 0;
  box-shadow: 8px -8px 18px rgba(31, 204, 31, 0.1);
}

.map-pin {
  position: absolute;
  width: 18px;
  aspect-ratio: 1;
  border-radius: 50% 50% 50% 0;
  background: var(--color-green);
  transform: rotate(-45deg);
  box-shadow: 0 0 16px rgba(31, 204, 31, 0.72);
}

.map-pin::after {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.8);
  animation: pin-pulse 2.4s ease-in-out infinite;
  animation-play-state: paused;
}

.subsidiary-world.is-active .map-pin::after {
  animation-play-state: running;
}

.map-pin--one { left: 42px; top: 70px; }
.map-pin--two { right: 42px; top: 158px; }
.map-pin--two::after { animation-delay: 0.4s; }
.map-pin--three { left: 72px; bottom: 58px; }
.map-pin--three::after { animation-delay: 0.8s; }

@keyframes pin-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.55); }
  50% { box-shadow: 0 0 0 7px rgba(255, 255, 255, 0); }
}

.radar-ring {
  position: absolute;
  left: 50%;
  top: 48%;
  border-radius: 50%;
  border: 1px solid rgba(31, 204, 31, 0.28);
  transform: translate(-50%, -50%) rotateX(68deg) translateZ(-18px) scale(0.55);
  transform-origin: center;
  animation: radar-pulse 3s ease-out infinite;
  animation-play-state: paused;
}

.subsidiary-world.is-active .radar-ring {
  animation-play-state: running;
}

.radar-ring--one { width: 260px; aspect-ratio: 1; }
.radar-ring--two { width: 380px; aspect-ratio: 1; animation-delay: 1.2s; }

@keyframes radar-pulse {
  0% { opacity: 0; transform: translate(-50%, -50%) rotateX(68deg) translateZ(-18px) scale(0.55); }
  24% { opacity: 0.82; }
  100% { opacity: 0; transform: translate(-50%, -50%) rotateX(68deg) translateZ(-18px) scale(1.2); }
}

.data-core {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 280px;
  aspect-ratio: 1;
  /* Scroll-driven spin (js/subsidiaries.js sets --data-core-scroll-rot
     from 0deg, the resting pose, as this scene enters view) added on
     top of the fixed -18deg base tilt. */
  transform: translate(-50%, -50%) translateZ(124px) rotateX(0deg) rotateY(calc(-18deg + var(--data-core-scroll-rot, 0deg))) scale(var(--scene-object-scale, 1));
  transform-style: preserve-3d;
}

.data-core-box {
  left: 50%;
  top: 50%;
  width: 132px;
  height: 132px;
  border-radius: 22px;
  transform: translate(-50%, -50%) translateZ(32px);
  box-shadow:
    16px 18px 0 rgba(2, 8, 18, 0.42),
    0 0 42px rgba(31, 204, 31, 0.2);
}

/* An AI processor chip, not an unlabeled rounded block: pin marks along
   all four edges plus a faint circuit-trace pattern on the face. Needs
   both classes in the selector so it wins over the shared .data-cube
   background regardless of source order. */
.data-cube.data-core-box {
  background:
    repeating-linear-gradient(90deg, rgba(94, 235, 130, 0.75) 0 3px, transparent 3px 15px) top / 100% 4px no-repeat,
    repeating-linear-gradient(90deg, rgba(94, 235, 130, 0.75) 0 3px, transparent 3px 15px) bottom / 100% 4px no-repeat,
    repeating-linear-gradient(0deg, rgba(94, 235, 130, 0.75) 0 3px, transparent 3px 15px) left / 4px 100% no-repeat,
    repeating-linear-gradient(0deg, rgba(94, 235, 130, 0.75) 0 3px, transparent 3px 15px) right / 4px 100% no-repeat,
    linear-gradient(90deg, rgba(31, 204, 31, 0.16) 1px, transparent 1px),
    linear-gradient(rgba(31, 204, 31, 0.14) 1px, transparent 1px),
    linear-gradient(135deg, rgba(255, 255, 255, 0.18), transparent 30%),
    linear-gradient(160deg, rgba(31, 204, 31, 0.42), rgba(4, 14, 32, 0.92));
  background-size: auto, auto, auto, auto, 11px 11px, 11px 11px, auto, auto;
}

.data-cube {
  position: absolute;
  width: 64px;
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  transform-style: preserve-3d;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.18), transparent 30%),
    linear-gradient(160deg, rgba(31, 204, 31, 0.42), rgba(4, 14, 32, 0.92));
  border: 1px solid rgba(31, 204, 31, 0.38);
  box-shadow: 0 0 26px rgba(31, 204, 31, 0.22);
}

.data-cube::before,
.data-cube::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.data-cube::before {
  left: 8px;
  top: -18px;
  width: 100%;
  height: 18px;
  border-radius: 10px 10px 3px 3px;
  background: linear-gradient(90deg, rgba(94, 235, 130, 0.58), rgba(12, 49, 107, 0.78));
  transform-origin: bottom center;
  transform: rotateX(88deg);
  border: 1px solid rgba(31, 204, 31, 0.2);
}

.data-cube::after {
  right: -18px;
  top: 8px;
  width: 18px;
  height: 100%;
  border-radius: 3px 10px 10px 3px;
  background: linear-gradient(180deg, rgba(24, 126, 68, 0.72), rgba(4, 14, 32, 0.94));
  transform-origin: left center;
  transform: rotateY(88deg);
  border: 1px solid rgba(31, 204, 31, 0.16);
}

.data-cube--one {
  left: -6px;
  top: 2px;
  transform: rotateX(-14deg) rotateY(22deg) translateZ(96px);
  animation: cube-drift-one 5.5s ease-in-out infinite;
  animation-play-state: paused;
}

.data-cube--two {
  right: -10px;
  top: 48px;
  transform: rotateX(-10deg) rotateY(-28deg) translateZ(-24px);
  animation: cube-drift-two 6.2s ease-in-out infinite;
  animation-play-state: paused;
}

.data-cube--three {
  left: 66px;
  bottom: -14px;
  transform: rotateX(-18deg) rotateY(16deg) translateZ(120px);
  animation: cube-drift-three 4.8s ease-in-out infinite;
  animation-play-state: paused;
}

.subsidiary-world.is-active .data-cube--one,
.subsidiary-world.is-active .data-cube--two,
.subsidiary-world.is-active .data-cube--three {
  animation-play-state: running;
}

@keyframes cube-drift-one {
  0%, 100% { transform: rotateX(-14deg) rotateY(22deg) translateZ(96px); }
  50% { transform: rotateX(-14deg) rotateY(22deg) translateZ(104px) translateY(-6px); }
}

@keyframes cube-drift-two {
  0%, 100% { transform: rotateX(-10deg) rotateY(-28deg) translateZ(-24px); }
  50% { transform: rotateX(-10deg) rotateY(-28deg) translateZ(-16px) translateY(5px); }
}

@keyframes cube-drift-three {
  0%, 100% { transform: rotateX(-18deg) rotateY(16deg) translateZ(120px); }
  50% { transform: rotateX(-18deg) rotateY(16deg) translateZ(128px) translateY(-4px); }
}

.data-node {
  position: absolute;
  width: 16px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--color-green);
  box-shadow: 0 0 18px rgba(31, 204, 31, 0.78);
  transform: translateZ(80px);
  animation: node-breathe 2.6s ease-in-out infinite;
  animation-play-state: paused;
}

.subsidiary-world.is-active .data-node {
  animation-play-state: running;
}

.data-node--one { left: 19%; top: 25%; }
.data-node--two { right: 17%; top: 31%; animation-delay: 0.6s; }
.data-node--three { left: 28%; bottom: 20%; animation-delay: 1.2s; }

@keyframes node-breathe {
  0%, 100% { opacity: 0.75; box-shadow: 0 0 18px rgba(31, 204, 31, 0.78); transform: translateZ(80px) scale(1); }
  50% { opacity: 1; box-shadow: 0 0 28px rgba(31, 204, 31, 1); transform: translateZ(80px) scale(1.18); }
}

.data-stream {
  position: absolute;
  width: 280px;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(31, 204, 31, 0.7), rgba(77, 125, 255, 0.5), transparent);
  background-size: 200% 100%;
  box-shadow: 0 0 12px rgba(31, 204, 31, 0.18);
  transform-origin: center;
  transform: rotateX(68deg) translateZ(14px);
  animation: stream-flow 3.6s linear infinite;
  animation-play-state: paused;
}

.subsidiary-world.is-active .data-stream {
  animation-play-state: running;
}

@keyframes stream-flow {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.data-stream--one {
  left: 10%;
  top: 40%;
  transform: rotateX(68deg) translateZ(14px) rotateZ(22deg);
}

.data-stream--two {
  right: 7%;
  bottom: 36%;
  transform: rotateX(68deg) translateZ(14px) rotateZ(-19deg);
  animation-delay: 1.1s;
}

.subsidiary-finale {
  min-height: 82svh;
}

.subsidiary-finale-grid {
  grid-template-columns: minmax(280px, 0.85fr) minmax(0, 1fr);
}

.finale-system {
  position: relative;
  width: min(80vw, 430px);
  aspect-ratio: 1;
  margin-inline: auto;
  perspective: 1000px;
  transform-style: preserve-3d;
  transform: none;
}

.finale-orbit {
  position: absolute;
  border-radius: 50%;
  transform: rotateX(68deg);
  transform-origin: center;
}

.finale-orbit--outer {
  inset: 3%;
  border: 1px solid rgba(77, 125, 255, 0.32);
}

.finale-orbit--inner {
  inset: 24%;
  border: 1px dashed rgba(31, 204, 31, 0.28);
}

.finale-core,
.finale-dot {
  position: absolute;
  left: 50%;
  top: 50%;
  border-radius: 50%;
}

.finale-core {
  width: 112px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  transform-style: preserve-3d;
  transform: translate(-50%, -50%) translateZ(68px);
  font-family: var(--font-primary);
  font-weight: 700;
  color: var(--color-white);
  background: conic-gradient(from 210deg, #061029, #0040e0, #061029);
  border: 1px solid rgba(232, 237, 247, 0.38);
  box-shadow: 0 0 54px rgba(0, 64, 224, 0.46);
}

.finale-core::before {
  content: "";
  position: absolute;
  inset: 9px -15px -15px 9px;
  border-radius: 50%;
  background: linear-gradient(145deg, rgba(4, 12, 31, 0.92), rgba(0, 64, 224, 0.22));
  transform: translateZ(-16px);
  z-index: -1;
}

.finale-dot {
  width: 18px;
  aspect-ratio: 1;
  background: var(--color-white);
  box-shadow: 0 0 18px rgba(77, 125, 255, 0.72);
}

.finale-dot--one { transform: translate(-50%, -50%) translate3d(154px, -78px, 34px); }
.finale-dot--two { transform: translate(-50%, -50%) translate3d(-132px, -92px, 34px); }
.finale-dot--three { transform: translate(-50%, -50%) translate3d(-118px, 102px, 34px); }
.finale-dot--four {
  background: var(--color-green);
  box-shadow: 0 0 18px rgba(31, 204, 31, 0.82);
  transform: translate(-50%, -50%) translate3d(136px, 94px, 34px);
}

@media (max-width: 1400px) {
  .subsidiary-flow {
    padding-bottom: 4.5rem;
  }

  .subsidiary-rail {
    left: 50%;
    right: auto;
    top: auto;
    bottom: 1rem;
    transform: translateX(-50%);
    display: flex;
    max-width: calc(100vw - 2rem);
    overflow-x: auto;
    padding: 0.35rem;
    border-radius: var(--radius-pill);
    background: rgba(1, 6, 16, 0.68);
    border: 1px solid rgba(232, 237, 247, 0.12);
  }

  .subsidiary-rail a {
    min-width: auto;
    flex: 0 0 auto;
  }

  .subsidiary-rail a:hover,
  .subsidiary-rail a:focus,
  .subsidiary-rail a:focus-visible,
  .subsidiary-rail a.is-active {
    transform: translateY(-2px);
  }
}

@media (max-width: 900px) {
  .subsidiary-hero-grid,
  .subsidiary-world-grid,
  .subsidiary-world-grid--reverse,
  .subsidiary-finale-grid {
    grid-template-columns: 1fr;
  }

  .subsidiary-world-grid--reverse .subsidiary-copy {
    order: 0;
  }

  .subsidiary-hero,
  .subsidiary-world,
  .subsidiary-finale {
    min-height: auto;
    padding-block: clamp(4rem, 14vw, 6rem);
  }

  .portfolio-orbit {
    width: min(88vw, 390px);
  }

  .portfolio-node--emagine { transform: translate(-50%, -50%) rotate(12deg) translateX(130px) rotate(-12deg) translateZ(32px); }
  .portfolio-node--electrify { transform: translate(-50%, -50%) rotate(108deg) translateX(134px) rotate(-108deg) translateZ(32px); }
  .portfolio-node--wattswhere { transform: translate(-50%, -50%) rotate(204deg) translateX(130px) rotate(-204deg) translateZ(32px); }
  .portfolio-node--melon { transform: translate(-50%, -50%) rotate(300deg) translateX(134px) rotate(-300deg) translateZ(32px); }

  .subsidiary-scene {
    width: min(92vw, 420px);
    min-height: 360px;
  }

  .subsidiary-copy h2 {
    max-width: 18ch;
  }

  .ev-charger,
  .permit-stack,
  .network-phone,
  .data-core {
    --scene-object-scale: 0.78;
  }

  /* Mobile: scenes become centered, tappable modules - drop the continuous
     pointer-tilt term outright (hybrid-pointer devices can't sneak it back
     in), shorten the assemble stagger, and quiet the secondary loops. The
     tap-triggered glow pulse (.is-pulsing, ungated by pointer type) still
     works at every breakpoint. */
  .subsidiary-scene {
    transform: translateY(var(--scene-enter-y));
  }

  .subsidiary-world.is-assembled .scene-object {
    transition-delay: 0.1s;
  }

  .subsidiary-world.is-assembled .scene-detail {
    transition-delay: 0.18s;
  }

  .subsidiary-world.is-assembled .charging-bay--two,
  .subsidiary-world.is-assembled .approval-line--two,
  .subsidiary-world.is-assembled .map-pin--two,
  .subsidiary-world.is-assembled .data-cube--two,
  .subsidiary-world.is-assembled .data-node--two,
  .subsidiary-world.is-assembled .data-stream--two {
    transition-delay: 0.22s;
  }

  .subsidiary-world.is-assembled .map-pin--three,
  .subsidiary-world.is-assembled .data-cube--three,
  .subsidiary-world.is-assembled .data-node--three {
    transition-delay: 0.26s;
  }

  .subsidiary-world.is-assembled .scene-stamp {
    animation-delay: 0.3s;
  }

  .radar-ring--two,
  .data-cube--two,
  .data-cube--three,
  .data-stream--two {
    animation: none;
  }

  .energy-rail {
    opacity: 0.7;
  }
}

@media (max-width: 600px) {
  .subsidiary-hero h1 {
    font-size: clamp(2rem, 14vw, 3.1rem);
  }

  .subsidiary-copy h2 {
    font-size: clamp(1.7rem, 10vw, 2.6rem);
  }

  .portfolio-core {
    width: 102px;
  }

  .portfolio-node {
    font-size: 0.68rem;
    padding-inline: 0.65rem;
  }

  .subsidiary-scene {
    min-height: 320px;
  }

  .subsidiary-rail {
    gap: 0.35rem;
  }

  .subsidiary-rail a {
    font-size: 0.66rem;
    padding-inline: 0.64rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .portfolio-ring,
  .charging-pulse,
  .radar-ring,
  .data-core,
  .map-pin::after,
  .data-cube--one,
  .data-cube--two,
  .data-cube--three,
  .data-node,
  .data-stream,
  .scene-stamp,
  .subsidiary-scene.is-pulsing .scene-object {
    animation: none;
  }

  .portfolio-orbit,
  .subsidiary-scene,
  .scene-floor,
  .scene-object,
  .scene-detail,
  .energy-rail-track,
  .energy-rail-pulse {
    transition: none;
  }

  .scene-stamp {
    opacity: 1;
    transform: translateZ(34px) rotate(-12deg) scale(1);
  }
}
