/* =============================================================================
   12. SITE — PLATFORM OVERVIEW
   Split layout: narrative copy + a system-orchestration diagram panel with
   ambient glow, floating capability chips, and animated data-flow lines.
   ============================================================================= */
/* Depends on: tokens.css, base/utilities.css (.grid-split), base/motion.css (glow-pulse, dot-travel, core-ring keyframes). */
.platform {
  overflow: hidden;
}

.platform__content {
  animation: reveal-up 0.8s var(--ease-out-expo) both;
}

.platform .grid-split {
  grid-template-columns: 1fr;
}

@media (min-width: 900px) {
  .platform .grid-split {
    grid-template-columns: repeat(12, minmax(0, 1fr));
  }

  .platform .grid-split > :first-child {
    grid-column: span 5;
  }

  .platform .grid-split > :last-child {
    grid-column: span 7;
  }
}

.platform__heading {
  font-size: var(--text-heading-lg);
  line-height: var(--lh-heading-tight);
}

.platform__lead {
  font-size: var(--text-lead-md);
  line-height: var(--lh-body);
  max-width: 46ch;
}

/* --- Visual column: ambient glow + glass panel, centered and capped ------- */
.platform__visual {
  position: relative;
  width: 100%;
  max-width: 460px;
  aspect-ratio: 1 / 1;
  margin-inline: auto;
  justify-self: center;
}

@media (min-width: 900px) {
  .platform__visual {
    max-width: 520px;
  }
}

@media (max-width: 480px) {
  .platform__visual {
    max-width: 340px;
  }
}

.platform__glow {
  position: absolute;
  border-radius: 50%;
}

.platform__glow--a {
  top: -8%;
  left: -6%;
  width: 60%;
  height: 60%;
  background: radial-gradient(circle, var(--color-accent-soft) 0%, transparent 72%);
  filter: blur(6px);
  animation: glow-pulse 6s ease-in-out infinite;
}

.platform__glow--b {
  bottom: -10%;
  right: -8%;
  width: 55%;
  height: 55%;
  background: radial-gradient(circle, var(--color-bg-secondary) 0%, transparent 70%);
  filter: blur(4px);
  animation: glow-pulse 7s 1s ease-in-out infinite;
}

/* --- Glass panel: system orchestration readout ---------------------------- */
.platform__panel {
  position: absolute;
  inset: 8%;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-xl);
  background: var(--color-glass-subtle);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-panel);
  padding: 7% 8%;
  transition: transform var(--transition-panel), box-shadow var(--transition-panel);
}

.platform__panel:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-panel-hover);
}

.platform__panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.platform__panel-header .text-mono-label {
  font-size: var(--text-label-sm);
  letter-spacing: var(--ls-label-2xl);
  text-transform: uppercase;
}

.platform__status {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.platform__status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-highlight);
  animation: glow-pulse 2.4s ease-in-out infinite;
}

.platform__status-label {
  font-family: var(--font-mono);
  font-size: var(--text-label-sm);
  letter-spacing: var(--ls-label-xl);
  color: var(--color-text-tertiary);
}

/* --- Orchestration diagram: core node + 3 connected capability nodes ------ */
.platform__diagram {
  position: relative;
  width: 72%;
  aspect-ratio: 1 / 1;
  margin: 6% auto;
  flex-shrink: 0;
}

.platform__connector {
  position: absolute;
  left: 50%;
  top: 48%;
  height: 1px;
  background: var(--color-border);
  transform-origin: left center;
}

.platform__connector--security {
  width: 36.9%;
  transform: rotate(-139.4deg);
}

.platform__connector--automation {
  width: 36.9%;
  transform: rotate(-40.6deg);
}

.platform__connector--scale {
  width: 36%;
  transform: rotate(90deg);
}

.platform__connector-dot {
  position: absolute;
  left: 0;
  top: 50%;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--color-accent);
  transform: translateY(-50%);
  animation: dot-travel 4s ease-in-out infinite;
}

.platform__connector--automation .platform__connector-dot {
  animation-duration: 4.6s;
  animation-delay: 0.6s;
}

.platform__connector--scale .platform__connector-dot {
  animation-duration: 5.2s;
  animation-delay: 1.1s;
}

.platform__core-ring,
.platform__core {
  position: absolute;
  left: 50%;
  top: 48%;
  width: 26%;
  aspect-ratio: 1 / 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
}

.platform__core-ring {
  border: 2px solid var(--color-accent-border);
  animation: core-ring 3.2s ease-in-out infinite;
}

.platform__core {
  background: var(--color-glass-medium);
  border: 1px solid var(--color-accent);
  display: flex;
  align-items: center;
  justify-content: center;
}

.platform__core-label {
  font-family: var(--font-mono);
  font-size: var(--text-label-2xs);
  letter-spacing: var(--ls-label-md);
  color: var(--color-accent-strong);
  font-weight: var(--fw-medium);
}

.platform__node {
  position: absolute;
  width: 20%;
  aspect-ratio: 1 / 1;
  transform: translate(-50%, -50%);
  border-radius: var(--radius-node);
  background: var(--color-glass-medium);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-node);
  display: flex;
  align-items: center;
  justify-content: center;
}

.platform__node-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-accent);
}

.platform__node--security {
  left: 22%;
  top: 24%;
}

.platform__node--automation {
  left: 78%;
  top: 24%;
}

.platform__node--scale {
  left: 50%;
  top: 84%;
}

.platform__node-label {
  position: absolute;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  /* --text-label-2xs (not the slightly larger -xs used elsewhere): at the
     diagram's smallest rendered size (~113px on a phone) these labels sit
     close enough to the core ring that anything bigger collides with it —
     see the top-offset comment below for the rest of that fix. */
  font-size: var(--text-label-2xs);
  color: var(--color-text-tertiary);
  white-space: nowrap;
}

/* Security/Automation labels sit BELOW the core ring (top: 66%, clear of
   its ~35%-61% vertical span) rather than beside it (the original 38% put
   them at the same height as the core). At every diagram size from a
   320px phone up through desktop, "Automation" — the longer of the two
   labels — is wide enough relative to the core that no top offset between
   the node (24%) and the core's own edge avoids overlap; clearing the
   core vertically is the only fix that holds at every width without
   shrinking the text below a legible size. */
.platform__node-label--security {
  left: 22%;
  top: 66%;
}

.platform__node-label--automation {
  left: 78%;
  top: 66%;
}

.platform__node-label--scale {
  left: 50%;
  top: 98%;
}

/* --- Panel footer: stat readouts ------------------------------------------- */
.platform__stats {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 6%;
  border-top: 1px solid var(--color-border);
}

.platform__stat {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.platform__stat-value {
  font-family: var(--font-heading);
  font-weight: var(--fw-semibold);
  font-size: 0.9rem;
  color: var(--color-text-primary);
}

.platform__stat-label {
  font-family: var(--font-mono);
  font-size: var(--text-label-xs);
  color: var(--color-text-tertiary);
}

.platform__divider {
  width: 1px;
  height: 24px;
  background: var(--color-border);
}

/* --- Floating capability chips (depth layer above the panel) -------------- */
.platform__chip {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--color-glass-medium);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  padding: 0.55rem 0.95rem;
  box-shadow: var(--shadow-chip);
}

.platform__chip-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.platform__chip-label {
  font-family: var(--font-mono);
  font-size: var(--text-label-md);
  letter-spacing: var(--ls-label-sm);
  color: var(--color-text-primary);
}

.platform__chip--integration {
  top: 2%;
  left: 0%;
  animation: float-a 7s ease-in-out infinite;
}

.platform__chip--integration .platform__chip-dot {
  background: var(--color-highlight);
}

.platform__chip--compliance {
  bottom: 4%;
  right: -2%;
  animation: float-b 8s 0.4s ease-in-out infinite;
}

.platform__chip--compliance .platform__chip-dot {
  background: var(--color-accent-strong);
}

/* Keep the technical diagram visible in dark mode without changing its
   geometry, labels or animated data dots. */
:root[data-theme="dark"] .platform__connector {
  background: color-mix(in oklch, var(--color-glow), transparent 72%);
}

:root[data-theme="dark"] .platform__connector-dot,
:root[data-theme="dark"] .platform__node-dot {
  background: var(--color-glow);
  box-shadow: 0 0 7px oklch(68% 0.18 215 / 0.42);
}

:root[data-theme="dark"] .platform__core,
:root[data-theme="dark"] .platform__node {
  border-color: color-mix(in oklch, var(--color-glow), var(--color-accent) 32%);
}

:root[data-theme="dark"] .platform__core-label,
:root[data-theme="dark"] .platform__node-label,
:root[data-theme="dark"] .platform__chip-label,
:root[data-theme="dark"] .platform__status-label {
  color: var(--color-text-primary);
}
