/* ==========================================================================
   NetrAI — Industries section (Chapter 04, homepage only)
   Two-column layout: left = live text, right = smaller radiant sphere
   with a rotating gradient, an icon badge, and an auto-cycling label.
   ========================================================================== */

.industries-chapter { position: relative; overflow: hidden; }

/* --------------------------------------------------------------------
   Layout — text on the left, sphere pinned to the right
   -------------------------------------------------------------------- */
.industries-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 320px);
  align-items: center;
  gap: 56px;
  max-width: 980px;
  margin: 12px auto 48px;
}

.industries-text {
  max-width: 440px;
}

.industries-text-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mist-dim);
  margin-bottom: 14px;
}

.industries-text .industry-name {
  /* left-column heading — the industry that's currently in focus */
  display: block;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.9rem, 3.2vw, 2.6rem);
  line-height: 1.08;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin: 0 0 14px;
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.45s cubic-bezier(0.28, 0.11, 0.32, 1), transform 0.45s cubic-bezier(0.28, 0.11, 0.32, 1);
}

.industry-desc {
  font-family: var(--font-body);
  font-size: 1.02rem;
  line-height: 1.6;
  color: var(--mist);
  margin: 0;
  min-height: 3.2em;
  opacity: 1;
  transition: opacity 0.45s cubic-bezier(0.28, 0.11, 0.32, 1), transform 0.45s cubic-bezier(0.28, 0.11, 0.32, 1);
}

.industries-text.is-transitioning .industry-name,
.industries-text.is-transitioning .industry-desc {
  opacity: 0;
  transform: translateY(6px);
}

/* --------------------------------------------------------------------
   Sphere stage — smaller, aligned to the right column
   -------------------------------------------------------------------- */
.industries-stage {
  position: relative;
  width: 100%;
  max-width: 280px;
  aspect-ratio: 1 / 1;
  margin: 0 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  justify-self: end;
}

.industries-stage canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* faint ambient glow bleeding out behind the sphere — echoes the hero aurora */
.industries-sphere-glow {
  position: absolute;
  inset: -14%;
  border-radius: 50%;
  background: none;
  filter: none;
  pointer-events: none;
  z-index: -1;
  animation: none;
}

@keyframes industries-glow-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* --------------------------------------------------------------------
   Icon badge + name, centered on top of the sphere
   -------------------------------------------------------------------- */
.industries-badge-wrap {
  position: relative;
  z-index: 2;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.industry-badge {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  /* Deliberately NOT a theme token. This disc sits on a saturated blue sphere
     in both themes, so it is light in both — the same way a badge printed on
     a product does not invert when the room does. Pointing it at
     --chrome-bg-solid flipped it to near-black on dark and swallowed the
     icon whole. */
  background: rgba(255, 255, 255, 0.94);
  box-shadow: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.45s cubic-bezier(0.28, 0.11, 0.32, 1), transform 0.45s cubic-bezier(0.28, 0.11, 0.32, 1);
}

.industry-badge svg {
  width: 56px;
  height: 56px;
  stroke: #1d1d1f;   /* fixed, for the same reason as the disc above */
  fill: none;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.industry-badge-name {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.32rem;
  letter-spacing: -0.005em;
  /* Printed on the sphere, not on the page — so white in both themes, like
     the disc and the icon above it. Carbon on a mid-blue sphere in light mode
     was ~4:1 and read muddy; white is 5.9:1 and matches the dark rendering. */
  color: #fff;
  text-shadow: none;
  transition: opacity 0.45s cubic-bezier(0.28, 0.11, 0.32, 1), transform 0.45s cubic-bezier(0.28, 0.11, 0.32, 1);
}

.industries-badge-wrap.is-transitioning .industry-badge {
  opacity: 0;
  transform: scale(0.82);
}
.industries-badge-wrap.is-transitioning .industry-badge-name {
  opacity: 0;
  transform: scale(0.88);
}

@media (max-width: 860px) {
  .industries-layout {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
    gap: 32px;
  }
  .industries-text { max-width: 480px; }
  .industries-stage { justify-self: center; margin: 0 auto; max-width: 240px; }
}

@media (max-width: 640px) {
  .industries-stage { max-width: 200px; }
  .industry-badge { width: 76px; height: 76px; }
  .industry-badge svg { width: 44px; height: 44px; }
  .industry-badge-name { font-size: 1.1rem; }
}

/* --------------------------------------------------------------------
   Chip row — full industry list, active one synced to the sphere
   -------------------------------------------------------------------- */
.industries-chip-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  max-width: 880px;
  margin: 0 auto;
  padding: 0;
}

.industry-chip {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--mist);
  padding: 9px 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-canvas);
  transition: color 0.4s ease, border-color 0.4s ease, background 0.4s ease, transform 0.4s ease;
  cursor: pointer;
}

.industry-chip.active {
  color: var(--ink);
  border-color: rgba(0, 113, 227, 0.5);
  background: var(--accent-tint-strong);
  transform: translateY(-1px);
}

@media (prefers-reduced-motion: reduce) {
  .industry-name,
  .industry-desc,
  .industry-badge,
  .industry-badge-name,
  .industry-chip { transition: none; }
  .industries-sphere-glow { animation: none; }
}

/* ==========================================================================
   Cosmic Orb palette (OriginKit)

   These map onto the component's own `background` and `palette` props —
   js/pages/industries.js reads them and hands them straight to the orb, re-reading
   on `themechange`. They are the component's documented extension point, not
   a modification of it.

   The values here are the component's own delivered defaults. It ships a
   cosmic violet/cyan/magenta palette, which is deliberately louder than the
   one-blue rule the rest of this site follows — that is what "Cosmic Orb" is.
   To bring it into the system instead, the site's blues are commented beneath
   each line; swapping them is a five-line edit and needs no JS change.
   ========================================================================== */
.industries-stage {
  --orb-bg:     #05050F;   /* site alternative: #000000 */
  --orb-anchor: #6A3CFF;   /* site alternative: #0a2a6b */
  --orb-a:      #3CE0FF;   /* site alternative: #2997ff */
  --orb-b:      #A24BFF;   /* site alternative: #0071e3 */
  --orb-c:      #FF5EA8;   /* site alternative: #0a84ff */
}

/* The orb renders a filled square and takes its circle from this clip, so the
   wrapper must stay square and hidden. It fills the stage rather than taking
   a fixed px size — see deviation 1 in js/effects/cosmic-orb.js. */
.industries-stage .ok-orb {
  position: absolute;
  inset: 0;
  margin: auto;
  width: min(100%, 100cqmin);
  aspect-ratio: 1 / 1;
  height: auto;
  max-height: 100%;
  border-radius: 50%;
  overflow: hidden;
  pointer-events: none;
}
.industries-stage .ok-orb canvas {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
}
