:root {
  --text: #fff;
  --stage-w: 690px;
  --stage-h: 650px;
  --brain-w: 305px;
  --orb-size: 42px;
  --left-x: 235px;
  --right-x: 433px;
  --top-y: 269px;
  --bottom-y: 387px;
  --ease-out: cubic-bezier(.18,.88,.24,1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; min-height: 100%; }
body {
  background: #111722;
  color: var(--text);
  font-family: "Arial Narrow", "Roboto Condensed", "Helvetica Neue", Arial, sans-serif;
  overflow-x: hidden;
}
button { font: inherit; }

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

.screen {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  overflow: hidden;
  isolation: isolate;
}

.section-2 {
  display: grid;
  place-items: center;
  background-image: url("assets/control-room-website.png");
  background-image: image-set(url("assets/control-room-website.webp") type("image/webp"), url("assets/control-room-website.png") type("image/png"));
  background-size: cover;
  background-position: center center;
}

.section-2::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgba(7,12,18,.14), rgba(7,12,18,.20));
}

.capability-stage {
  position: relative;
  width: min(var(--stage-w), 92vw);
  height: var(--stage-h);
  transform-origin: center center;
}

.brain {
  position: absolute;
  z-index: 2;
  width: var(--brain-w);
  height: auto;
  left: 50%;
  top: 204px;
  transform: translateX(-50%) scale(.84);
  opacity: 0;
  filter: drop-shadow(0 0 12px rgba(0, 240, 210, .08));
  transition: opacity .8s ease, transform 1s var(--ease-out), filter .8s ease;
}

.brain.is-visible {
  opacity: 1;
  transform: translateX(-50%) scale(1);
  filter: drop-shadow(0 0 18px rgba(0, 240, 210, .14));
}

.callout {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}

.orb {
  position: absolute;
  z-index: 6;
  width: var(--orb-size);
  height: var(--orb-size);
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  opacity: 0;
  transform: scale(.25) rotate(-45deg);
  transition: opacity .48s ease, transform .68s var(--ease-out), filter .3s ease;
  pointer-events: auto;
  animation-play-state: paused;
}
.orb img { display: block; width: 100%; height: 100%; }

.callout.is-visible .orb {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}
.callout.is-settled .orb {
  /* Continuous subtle pulse: keeps the four white markers alive without moving them off-position. */
  animation: pulse-orb 2.35s ease-in-out infinite;
}
.callout--tr.is-settled .orb { animation-delay: -.45s; }
.callout--br.is-settled .orb { animation-delay: -.9s; }
.callout--bl.is-settled .orb { animation-delay: -1.35s; }

.callout--tl .orb,
.callout--bl .orb { left: calc(var(--left-x) - var(--orb-size)/2); }
.callout--tr .orb,
.callout--br .orb { left: calc(var(--right-x) - var(--orb-size)/2); }
.callout--tl .orb,
.callout--tr .orb { top: calc(var(--top-y) - var(--orb-size)/2); }
.callout--bl .orb,
.callout--br .orb { top: calc(var(--bottom-y) - var(--orb-size)/2); }

.connector {
  position: absolute;
  z-index: 3;
  width: 2px;
  opacity: 0;
  transform: scaleY(0);
  transition: opacity .18s linear, transform .72s var(--ease-out);
}
.callout.is-visible .connector { opacity: .95; transform: scaleY(1); }

.callout--tl .connector,
.callout--bl .connector { left: calc(var(--left-x) - 1px); }
.callout--tr .connector,
.callout--br .connector { left: calc(var(--right-x) - 1px); }

.connector--top {
  height: 154px;
  top: 102px;
  transform-origin: center bottom;
}
.connector--bottom {
  height: 143px;
  top: 402px;
  transform-origin: center top;
}

.copy {
  position: absolute;
  width: 240px;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .45s ease .22s, transform .55s var(--ease-out) .22s;
  pointer-events: auto;
  transform-origin: center center;
}
.callout.is-visible .copy { opacity: 1; transform: translateY(0); }

.copy h2,
.copy p { margin: 0; }
.copy h2 {
  font-weight: 800;
  font-stretch: condensed;
  font-size: 24px;
  line-height: .98;
  letter-spacing: -.035em;
  text-transform: uppercase;
  text-wrap: balance;
}
.copy p {
  margin-top: 7px;
  max-width: 225px;
  font-size: 15px;
  line-height: 1.08;
  font-weight: 400;
  letter-spacing: -.012em;
  text-transform: uppercase;
}

.callout--tl .copy {
  /* Anchor the left copy to the left of the connector, with a clear safety gap. */
  left: auto;
  right: calc(100% - var(--left-x) + 24px);
  top: 26px;
  width: 232px;
  text-align: left;
}
.callout--tr .copy {
  left: 447px;
  top: 26px;
  width: 225px;
  text-align: left;
}
.callout--bl .copy {
  /* Same alignment rule as the upper-left item: text never crosses the vertical line. */
  left: auto;
  right: calc(100% - var(--left-x) + 24px);
  top: 508px;
  width: 232px;
  text-align: left;
}
.callout--br .copy {
  left: 435px;
  top: 508px;
  width: 242px;
  text-align: center;
}
.callout--br .copy p { margin-inline: auto; }

/* Hover/focus: rotating orb + subtle copy emphasis */
.callout:has(.orb:hover) .copy,
.callout:has(.orb:focus-visible) .copy {
  transform: scale(1.045);
  text-shadow: 0 0 18px rgba(255,255,255,.14);
}
.callout:has(.orb:hover) .orb,
.callout:has(.orb:focus-visible) .orb {
  animation: spin-hover .75s var(--ease-out) both;
  filter: drop-shadow(0 0 9px rgba(255,255,255,.35));
}
.orb:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 5px;
  border-radius: 50%;
}

@keyframes pulse-orb {
  0%, 100% {
    transform: scale(1);
    filter: drop-shadow(0 0 0 rgba(255,255,255,0));
  }
  45% {
    transform: scale(1.075);
    filter: drop-shadow(0 0 8px rgba(255,255,255,.24));
  }
  58% {
    transform: scale(1.035);
    filter: drop-shadow(0 0 4px rgba(255,255,255,.12));
  }
}
@keyframes spin-hover {
  from { transform: scale(1) rotate(0deg); }
  60% { transform: scale(1.12) rotate(300deg); }
  to { transform: scale(1.09) rotate(360deg); }
}

/* Mid-sized screens: scale the composition rather than breaking the layout. */
@media (max-width: 1024px) and (min-width: 821px) {
  .capability-stage { transform: scale(.90); }
}

/* Mobile / narrow tablet: switch to a true stacked layout before the desktop
   composition starts to clip. This also covers phones whose CSS viewport is
   wider than 640px (for example some landscape/high-density devices). */
@media (max-width: 820px) {
  .screen {
    overflow-x: hidden;
    overflow-y: auto;
  }
  .section-2 {
    place-items: start center;
    padding: max(34px, env(safe-area-inset-top)) 20px max(34px, env(safe-area-inset-bottom));
    background-position: 58% center;
  }
  .section-2::before { background: rgba(7,12,18,.34); }

  .capability-stage {
    width: min(100%, 520px);
    height: auto;
    min-height: 760px;
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    gap: 14px;
    align-content: start;
  }

  .brain {
    position: relative;
    left: auto;
    top: auto;
    width: min(260px, 66vw);
    margin: 0 auto 22px;
    grid-row: 1;
    transform: scale(.84);
  }
  .brain.is-visible { transform: scale(1); }

  .callout {
    position: relative;
    inset: auto;
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr);
    align-items: center;
    gap: 16px;
    min-height: 104px;
    padding: 10px 0;
  }
  .callout--tl { grid-row: 2; }
  .callout--tr { grid-row: 3; }
  .callout--br { grid-row: 4; }
  .callout--bl { grid-row: 5; }

  .connector { display: none; }
  .orb,
  .callout--tl .orb, .callout--tr .orb,
  .callout--bl .orb, .callout--br .orb {
    position: relative;
    left: auto;
    top: auto;
    width: 42px;
    height: 42px;
    grid-column: 1;
    justify-self: center;
  }
  .copy,
  .callout--tl .copy, .callout--tr .copy,
  .callout--bl .copy, .callout--br .copy {
    position: relative;
    left: auto;
    right: auto; /* IMPORTANT: reset desktop right offset on the two left callouts */
    top: auto;
    width: auto;
    max-width: none;
    min-width: 0;
    grid-column: 2;
    justify-self: stretch;
    text-align: left;
  }
  .copy h2 {
    font-size: clamp(20px, 4.7vw, 25px);
    line-height: 1;
  }
  .copy p {
    font-size: clamp(12px, 2.5vw, 14px);
    max-width: 390px;
    line-height: 1.15;
    overflow-wrap: break-word;
  }
  .callout--br .copy p { margin-inline: 0; }
}


@media (max-width: 430px) {
  .section-2 {
    padding-left: 16px;
    padding-right: 16px;
  }

  .capability-stage {
    width: 100%;
    gap: 8px;
  }

  .brain {
    width: min(230px, 70vw);
    margin-bottom: 14px;
  }

  .callout {
    grid-template-columns: 46px minmax(0, 1fr);
    gap: 12px;
    min-height: 94px;
  }

  .orb,
  .callout--tl .orb, .callout--tr .orb,
  .callout--bl .orb, .callout--br .orb {
    width: 38px;
    height: 38px;
  }

  .copy h2 { font-size: clamp(19px, 6.1vw, 23px); }
  .copy p { font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .brain,
  .callout .orb,
  .callout .connector,
  .callout .copy {
    opacity: 1 !important;
    transform: none !important;
  }
}
