/* ==========================================================================
   D04 — Kairon Robotics
   Division page: FluxField robot hero with footage card, sticky on-page nav,
   exploded Forma viewer, capability clips, use-case tabs + standards,
   RaaS plans, TCO calculator, spec sheet, CTA band, mobile sticky pilot bar.
   Behavior: js/pages/d04-robotics.js
   ========================================================================== */

/* --------------------------------------------------------------------------
   Page building blocks (bands, titles, splits, links, annotations)
   -------------------------------------------------------------------------- */

/* Full-width content band (separated by a bottom hairline on this page) */
.band {
  position: relative;
  padding: clamp(80px, 9vw, 136px) 0;
  border-bottom: 1px solid var(--line);
}

.band--surface {
  background: var(--surface-1);
}

.band--cta {
  padding: clamp(96px, 11vw, 168px) 0;
  border-bottom: 0;
}

/* Use with .heading-section.heading-section--lg (60px max); --xl caps at 64px */
.band__title {
  margin-top: 14px;
}

.band__title--xl {
  font-size: clamp(34px, 4.4vw, 64px);
}

.band__footnote {
  margin-top: 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-3);
}

/* Closing CTA headline */
.cta-title {
  font-size: clamp(40px, 6vw, 96px);
  line-height: .92;
  font-weight: 700;
  font-stretch: 125%;
  letter-spacing: -.04em;
}

/* Two-column split that stacks below 2 × 440px (--narrow: 2 × 420px) */
.split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr));
  gap: 48px;
}

.split--narrow {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
}

.split--tight  { gap: 40px; }
.split--start  { align-items: start; }
.split--center { align-items: center; }
.split--end    { align-items: end; }

/* Bordered text link (secondary action next to a primary button) */
.outline-link {
  display: inline-flex;
  align-items: center;
  height: 48px;
  padding: 0 18px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-1);
}

.outline-link--lg {
  height: 56px;
  padding: 0 22px;
  white-space: nowrap;
}

/* Pause / play control for the hero field animation */
.motion-toggle {
  height: 36px;
  padding: 0 14px;
  white-space: nowrap;
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  color: var(--text);
  cursor: pointer;
}

/* Range slider in the instrument style */
.viewer__range,
.tco__range {
  accent-color: #FFB020;
}

/* Conversion annotations, shown via the footer pill (<html data-annotations="on">) */
/* Annotation boxes: components/annotation.css */

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  display: flex;
  min-height: calc(100vh - 100px);
  overflow: hidden;
}

.hero__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.hero__inner {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: clamp(14px, 2.4vh, 24px);
  max-width: 1440px;
  margin: 0 auto;
  padding: clamp(28px, 5vh, 64px) var(--gutter-site) 28px;
}

.hero__title {
  margin-top: auto;
  font-size: clamp(50px, min(10vw, 13vh), 168px);
  line-height: .86;
  font-weight: 750;
  font-stretch: 125%;
  letter-spacing: -.045em;
}

.hero__lead {
  max-width: 520px;
  font-size: clamp(17px, 1.4vw, 20px);
  color: var(--text-2);
}

.hero__proof {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-2);
}

.hero__status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 28px;
  padding: 0 12px 0 10px;
  white-space: nowrap;
  border: 1px solid rgba(61, 220, 151, .5);
  border-radius: var(--r-pill);
  color: var(--text);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero__secondary {
  padding: 0 22px;
}

.hero__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 20px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-3);
}

/* Footage card (placeholder for the 1× video), wide screens only */
.hero-video {
  display: none;
  position: absolute;
  right: var(--gutter-site);
  top: clamp(24px, 5vh, 56px);
  width: min(38vw, 600px);
  aspect-ratio: 16 / 10;
  border: 1px solid var(--line-strong);
  background:
    repeating-linear-gradient(135deg, rgba(237, 239, 242, .05) 0 1px, transparent 1px 10px),
    linear-gradient(160deg, #1c2a33, #07080B);
}

@media (min-width: 1280px) {
  .hero-video {
    display: block;
  }
}

.hero-video__chip {
  position: absolute;
  left: 12px;
  top: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 10px;
  white-space: nowrap;
  background: #EDEFF2;
  color: #07080B;
  border-radius: var(--r-1);
  font-family: var(--font-mono);
  font-size: 10px;
}

.hero-video__chip-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #07080B;
}

.hero-video__caption {
  position: absolute;
  left: 12px;
  bottom: 12px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: #AEB4BE;
}

/* Keeps the browser's default control font, as in the original */
.hero-video__play {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 72px;
  height: 72px;
  transform: translate(-50%, -50%);
  border: 1.5px solid #EDEFF2;
  border-radius: 50%;
  background: rgba(7, 8, 11, .5);
  color: #EDEFF2;
  font: 400 20px Arial, sans-serif;
  cursor: pointer;
}

/* --------------------------------------------------------------------------
   On-page navigation (sticky below the site header)
   -------------------------------------------------------------------------- */
.page-nav {
  position: sticky;
  top: 100px;
  z-index: 40;
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.page-nav__inner {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 52px;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 var(--gutter-site);
  overflow-x: auto;
}

.page-nav__link {
  display: flex;
  align-items: center;
  height: 52px;
  padding: 0 12px;
  font-size: 14px;
  white-space: nowrap;
}

.page-nav__link,
.page-nav__link:hover {
  color: var(--text-2);
}

.page-nav__cta {
  display: flex;
  align-items: center;
  height: 40px;
  margin-left: auto;
  padding: 0 16px;
  white-space: nowrap;
  background: var(--action);
  border-radius: var(--r-1);
  font-size: 14px;
  font-weight: 600;
}

.page-nav__cta,
.page-nav__cta:hover {
  color: var(--on-action);
}

/* --------------------------------------------------------------------------
   Exploded viewer
   -------------------------------------------------------------------------- */
.viewer__intro {
  max-width: 44ch;
  margin-top: 16px;
  color: var(--text-2);
}

/* Part list — buttons keep the browser's default control font, as in the original */
.part-list {
  display: flex;
  flex-direction: column;
  margin-top: 24px;
  border-top: 1px solid var(--line-strong);
}

.part-list__item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 12px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  font: 400 13.3333px Arial, sans-serif;
  text-align: left;
  opacity: .55;
  cursor: pointer;
}

.part-list__item[aria-pressed="true"] {
  opacity: 1;
}

.part-list__text {
  font-size: 14px;
  color: var(--text-2);
}

.part-list__spec {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-2);
  white-space: nowrap;
}

.viewer {
  position: relative;
  display: flex;
  flex-direction: column;
  height: min(70vh, 600px);
  border: 1px solid var(--line);
  background: radial-gradient(ellipse at 50% 90%, rgba(127, 219, 255, .12), transparent 60%), var(--surface-1);
  outline-offset: 4px;
}

.viewer__stage {
  position: relative;
  flex: 1;
  display: grid;
  place-items: center;
  overflow: hidden;
  perspective: 900px;
}

/* Schematic humanoid: --rot rotates the figure, --e (0…1) explodes the parts */
.forma {
  --rot: -20deg;
  --e: 0;
  position: relative;
  width: 180px;
  height: 420px;
  transform-style: preserve-3d;
  transform: rotateY(var(--rot));
  transition: transform 400ms var(--ease-inertia);
}

/* Each part: box via left/top/width/height, explode vector via --ex/--ey/--ez (px at 100 %) */
.forma__part {
  position: absolute;
  border: 1.5px solid rgba(237, 239, 242, .6);
  background: rgba(237, 239, 242, .03);
  transform:
    translate(calc(var(--ex) * var(--e) * 1px), calc(var(--ey) * var(--e) * 1px))
    translateZ(calc(var(--ez) * var(--e) * 1px));
  transition: transform 700ms var(--ease-inertia), border-color 250ms;
}

.forma__part.is-selected {
  border-color: #FFB020;
  background: rgba(255, 176, 32, .08);
}

.forma__part--head   { left: 62px;  top: 0;     width: 56px;  height: 62px;  border-radius: 20px; --ex: 0;   --ey: -60; --ez: 40; }
.forma__part--torso  { left: 40px;  top: 72px;  width: 100px; height: 130px; border-radius: 6px;  --ex: 0;   --ey: -10; --ez: 0; }
.forma__part--arm-l  { left: 0;     top: 76px;  width: 32px;  height: 120px; border-radius: 14px; --ex: -60; --ey: -10; --ez: 20; }
.forma__part--arm-r  { left: 148px; top: 76px;  width: 32px;  height: 120px; border-radius: 14px; --ex: 60;  --ey: -10; --ez: 20; }
.forma__part--hand-l { left: 4px;   top: 202px; width: 26px;  height: 34px;  border-radius: 6px;  --ex: -90; --ey: 20;  --ez: 50; }
.forma__part--hand-r { left: 150px; top: 202px; width: 26px;  height: 34px;  border-radius: 6px;  --ex: 90;  --ey: 20;  --ez: 50; }
.forma__part--leg-l  { left: 48px;  top: 212px; width: 36px;  height: 200px; border-radius: 14px; --ex: -30; --ey: 60;  --ez: 0; }
.forma__part--leg-r  { left: 96px;  top: 212px; width: 36px;  height: 200px; border-radius: 14px; --ex: 30;  --ey: 60;  --ez: 0; }

.viewer__controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding: 14px 16px;
  border-top: 1px solid var(--line);
}

.viewer__control {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-3);
}

.viewer__range {
  height: 32px;
}

.viewer__note {
  position: absolute;
  left: 12px;
  top: 10px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-3);
}

/* --------------------------------------------------------------------------
   Capabilities — footage cards
   -------------------------------------------------------------------------- */
.capability-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 16px;
  margin-top: 40px;
}

.capability {
  border: 1px solid var(--line);
  background: var(--canvas);
}

.capability__media {
  --tint: #1c2a33;
  position: relative;
  aspect-ratio: 16 / 10;
  background:
    repeating-linear-gradient(135deg, rgba(237, 239, 242, .05) 0 1px, transparent 1px 10px),
    linear-gradient(160deg, var(--tint), #07080B);
}

.capability__media--kitting  { --tint: #1c2a33; }
.capability__media--totes    { --tint: #2a2433; }
.capability__media--teaching { --tint: #33291c; }

.capability__chip {
  position: absolute;
  left: 10px;
  top: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 8px;
  white-space: nowrap;
  background: #EDEFF2;
  color: #07080B;
  border: 1px solid #EDEFF2;
  border-radius: var(--r-1);
  font-family: var(--font-mono);
  font-size: 9px;
}

.capability__chip--outline {
  background: transparent;
  color: #EDEFF2;
}

.capability__play {
  position: absolute;
  left: 50%;
  top: 50%;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  transform: translate(-50%, -50%);
  border: 1.5px solid #EDEFF2;
  border-radius: 50%;
  color: #EDEFF2;
}

.capability__duration {
  position: absolute;
  right: 10px;
  bottom: 10px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: #EDEFF2;
}

.capability__body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px;
}

.capability__title {
  font-size: 18px;
}

.capability__text {
  font-size: 14px;
  color: var(--text-2);
}

.capability__metric {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text);
}

/* --------------------------------------------------------------------------
   Use cases (tabs) and safety standards
   -------------------------------------------------------------------------- */
.usecase-tabs {
  display: flex;
  margin-top: 28px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
}

.usecase-tabs__tab {
  height: 48px;
  padding: 0 16px;
  white-space: nowrap;
  border: 0;
  background: transparent;
  color: var(--text-2);
  font: 500 15px var(--font-sans);
  cursor: pointer;
}

.usecase-tabs__tab[aria-selected="true"] {
  color: var(--text);
  box-shadow: inset 0 -2px 0 var(--action);
}

.usecase {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-top: 24px;
}

.usecase__text {
  font-size: 19px;
}

.usecase__metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.usecase__metric {
  padding: 16px;
  background: var(--canvas);
}

.usecase__value {
  font-size: 26px;
  font-weight: 600;
  font-stretch: 125%;
  font-variant-numeric: tabular-nums;
}

.usecase__label {
  font-size: 12px;
  color: var(--text-2);
}

.usecase__link {
  align-self: flex-start;
  font-size: 15px;
  border-bottom: 1px solid currentColor;
}

.usecase__link,
.usecase__link:hover {
  color: var(--action-text);
}

.standards {
  display: flex;
  flex-direction: column;
  margin-top: 28px;
  border-top: 1px solid var(--line-strong);
}

.standards__item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.standards__name {
  font-family: var(--font-mono);
  font-size: 14px;
}

.standards__text {
  font-size: 14px;
  color: var(--text-2);
}

.standards__status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  white-space: nowrap;
}

.standards__status .status-dot {
  --dot-size: 9px;
}

.standards__note {
  margin-top: 16px;
  font-size: 14px;
  color: var(--text-2);
}

/* --------------------------------------------------------------------------
   RaaS plans
   -------------------------------------------------------------------------- */
.plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 16px;
  margin-top: 40px;
}

.plan {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 28px;
  border: 1px solid var(--line);
  background: var(--canvas);
  transition: transform 700ms var(--ease-inertia);
}

.plan--featured {
  border-color: var(--text);
}

.plan__head {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-3);
}

.plan__name {
  font-size: 28px;
  font-weight: 650;
  font-stretch: 118%;
}

.plan__price {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.plan__amount {
  font-size: 40px;
  font-weight: 600;
  font-stretch: 125%;
  letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
}

.plan__unit {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-2);
}

/* ul.plan__features: outranks the shared `ul[class]` reset to keep the bullets */
ul.plan__features {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0 0 0 18px;
  list-style: disc;
  font-size: 14px;
  color: var(--text-2);
}

.plan__cta {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  margin-top: auto;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-1);
  font-weight: 600;
}

.plan__cta:hover {
  border-color: var(--action);
  color: var(--action-text);
}

/* --------------------------------------------------------------------------
   TCO calculator
   -------------------------------------------------------------------------- */
.tco__inputs {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-top: 28px;
}

.tco__input {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tco__input-head {
  display: flex;
  justify-content: space-between;
  font-size: 15px;
  font-weight: 500;
}

.tco__output {
  font-family: var(--font-mono);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.tco__range {
  height: 36px;
}

.tco__result {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 28px;
  background: var(--surface-1);
}

.tco__figures {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
}

.tco__figure {
  padding: 16px;
  background: var(--canvas);
}

.tco__figure-label {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-3);
}

.tco__figure-value {
  font-size: clamp(24px, 2.4vw, 32px);
  font-weight: 600;
  font-stretch: 125%;
  letter-spacing: -.02em;
}

/* Payback bar: --pct = share filled (shorter payback → fuller bar) */
.payback-bar {
  position: relative;
  height: 10px;
  background: var(--line);
}

.payback-bar__fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--pct, 0%);
  background: var(--viz-4);
  transition: width 400ms var(--ease-inertia);
}

.tco__note {
  font-size: 13px;
  color: var(--text-2);
}

.tco__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tco__cta {
  display: flex;
  align-items: center;
  height: 52px;
  padding: 0 22px;
  background: var(--action);
  border-radius: var(--r-1);
  font-weight: 600;
  font-stretch: 112%;
}

.tco__cta,
.tco__cta:hover {
  color: var(--on-action);
}

.tco__email {
  display: flex;
  align-items: center;
  height: 52px;
  font-size: 15px;
}

.tco__email,
.tco__email:hover {
  color: var(--text-2);
}

/* --------------------------------------------------------------------------
   Spec sheet
   -------------------------------------------------------------------------- */
.specs__head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  flex-wrap: wrap;
  gap: 16px;
}

.specs__download {
  gap: 10px;
}

.specs__download .icon {
  color: #EDEFF2;
}

.specs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr));
  gap: 0 48px;
  margin-top: 32px;
}

.specs__group {
  display: grid;
  grid-template-columns: 1fr auto;
  margin-bottom: 24px;
  font-size: 15px;
}

.specs__group dt,
.specs__group dd {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.specs__group dt {
  color: var(--text-2);
}

.specs__group dd {
  font-family: var(--font-mono);
  font-size: 13px;
  text-align: right;
}

.specs__group .specs__heading {
  grid-column: 1 / -1;
  border-bottom-color: var(--line-strong);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-3);
}

/* --------------------------------------------------------------------------
   CTA band
   -------------------------------------------------------------------------- */
.cta-band__aside {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.cta-band__text {
  max-width: 44ch;
  color: var(--text-2);
}

.cta-band__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* --------------------------------------------------------------------------
   Sticky pilot bar (< 768px) — lifts the footer's FLUX pill above it
   -------------------------------------------------------------------------- */
.sticky-cta {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 55;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: var(--surface-2);
  border-top: 1px solid var(--line-strong);
}

.sticky-cta__text {
  font-size: 13px;
}

.sticky-cta__btn {
  display: inline-flex;
  align-items: center;
  height: 48px;
  padding: 0 18px;
  background: var(--action);
  border-radius: var(--r-1);
  font-size: 15px;
  font-weight: 600;
}

.sticky-cta__btn,
.sticky-cta__btn:hover {
  color: var(--on-action);
}

@media (max-width: 767.98px) {
  .sticky-cta {
    display: flex;
  }

  .flux-pill {
    --pill-bottom: 84px;
  }
}
