/* One hero scene, drawn in an iframe on an oxagen.sh product page. The
   site draws the words over the scene, so this stylesheet holds only the
   stage: a 1440-wide frame the script scales to the iframe's width, and
   the six scenes' parts and motion. Every colour reads a token the app's
   stylesheet defines for both themes. --hx-ground follows the site's own
   ground (theme.js), so the fades meet the page with no seam. */
:root {
  --hx-ground: var(--site-ground, var(--background));
  --hx-muted: var(--muted-foreground);
  --hx-line: var(--border);
  --hx-shade: color-mix(in oklab, var(--foreground) 16%, transparent);
  --hx-mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
.dark { --hx-shade: rgb(0 0 0 / 0.55); }

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: transparent;
}

/* ── Hero frame ────────────────────────────────────────────────────────── */
.hx-hero {
  --tint: var(--label-teal);
  position: relative;
  isolation: isolate;
  overflow: clip;
  height: 100%;
}
.hx-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(58% 72% at var(--gx, 70%) var(--gy, 62%), color-mix(in oklab, var(--tint) 13%, transparent), transparent 72%);
}
.hx-stage { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.hx-scene { position: absolute; left: 0; top: 0; width: 1440px; transform-origin: 0 0; }

/* ── Parts lifted from the app ─────────────────────────────────────────── */
.hx-part,
.hx-canvas {
  color: var(--foreground);
  font-family: var(--font-sans);
  font-size: var(--ox-a-body);
  line-height: var(--ox-a-body-leading);
  text-align: left;
}
.hx-part { position: relative; }
.hx-slim table { min-width: 0 !important; }
.hx-canvas { position: relative; width: 1440px; overflow: hidden; background: var(--background); transform-origin: 0 0; }
.hx-screen { position: relative; overflow: hidden; }
.hx-layer { position: absolute; }
.hx-in { transition: opacity 0.6s, transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1); }
.hx-shadow { filter: drop-shadow(0 28px 44px var(--hx-shade)); }

.hx-feather {
  --ft: 0%; --fr: 0%; --fb: 0%; --fl: 0%;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 var(--ft), #000 calc(100% - var(--fb)), transparent), linear-gradient(to right, transparent, #000 var(--fl), #000 calc(100% - var(--fr)), transparent);
  mask-image: linear-gradient(to bottom, transparent, #000 var(--ft), #000 calc(100% - var(--fb)), transparent), linear-gradient(to right, transparent, #000 var(--fl), #000 calc(100% - var(--fr)), transparent);
  -webkit-mask-composite: source-in;
  mask-composite: intersect;
}
.hx-radial {
  -webkit-mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, #000 34%, rgb(0 0 0 / 0.75) 56%, rgb(0 0 0 / 0.25) 80%, transparent 100%);
  mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, #000 34%, rgb(0 0 0 / 0.75) 56%, rgb(0 0 0 / 0.25) 80%, transparent 100%);
}
.hx-scroll { animation: hx-scroll 80s linear infinite alternate; }
@keyframes hx-scroll { to { transform: translateY(var(--hx-end, 0)); } }
.hx-press { transform: scale(0.95) !important; filter: brightness(1.18); transition: transform 0.2s, filter 0.2s; }
.hx-hero:not(.is-live) * { animation-play-state: paused !important; }

/* ── 01 Code graph and steering ────────────────────────────────────────── */
.hx-hero[data-hero="graph"] { --tint: var(--label-teal); --gx: 66%; --gy: 74%; }
/* The floor is drawn once and turned as one layer. */
.h1-turn { will-change: transform; animation: h1-turn 40s ease-in-out infinite alternate; }
@keyframes h1-turn { from { transform: rotate(-20deg); } to { transform: rotate(-9deg); } }
.h1-card > .hx-in { will-change: transform, opacity; transition: opacity 0.7s ease, transform 0.9s cubic-bezier(0.2, 0.8, 0.2, 1); }
.h1-card.is-out > .hx-in { opacity: 0; transform: translateY(96px); }
.h1-card .hx-part,
.h1-panel .hx-part { box-shadow: 0 24px 48px var(--hx-shade); }
.h1-panel .hx-part { border-radius: 14px; background: var(--hx-ground); }
.h1-chip { transition: opacity 0.35s ease, transform 0.35s ease; }
.h1-chip.is-out { opacity: 0; transform: translateY(6px); }

/* ── 02 Pull request review ────────────────────────────────────────────── */
.hx-hero[data-hero="review"] { --tint: var(--success); --gx: 32%; --gy: 58%; }
.h2-rule .hx-part { border-radius: 18px; background: var(--hx-ground); }
.h1-card .hx-part { border-radius: 14px; background: var(--hx-ground); }
.h2-rule > .hx-in { opacity: 0.34; }
.h2-rule.is-fired > .hx-in { opacity: 1; }
.h2-rule .hx-part::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 18px;
  box-shadow: 0 0 0 2px var(--success), 0 0 34px color-mix(in oklab, var(--success) 55%, transparent);
  opacity: 0;
}
.h2-rule.is-flash .hx-part::after { animation: h2-flash 1s ease-out; }
@keyframes h2-flash { 0% { opacity: 1; } 100% { opacity: 0; } }
.h2-ev { overflow: hidden; max-height: 80px; transition: max-height 0.5s ease, opacity 0.5s ease; }
.h2-ev.is-shut { max-height: 0; opacity: 0; }
.h2-accept .hx-part::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 999px;
  box-shadow: 0 0 0 0 color-mix(in oklab, var(--foreground) 60%, transparent);
  opacity: 0;
}
.h2-accept.is-flash .hx-part::after { animation: h2-ring 1.4s ease-out 2; }
@keyframes h2-ring { 0% { opacity: 1; box-shadow: 0 0 0 0 color-mix(in oklab, var(--foreground) 60%, transparent); } 100% { opacity: 0; box-shadow: 0 0 0 22px transparent; } }

/* ── 03 Work, run, and outcome ─────────────────────────────────────────── */
.hx-hero[data-hero="record"] { --tint: var(--label-indigo); --gx: 50%; --gy: 80%; }
.h3-plane > .hx-in { transition: transform 1.3s cubic-bezier(0.65, 0, 0.2, 1); transform: perspective(1500px) translate3d(0, 0, 0) rotateY(0deg); }
.h3-apart .h3-plane.is-a > .hx-in { transform: perspective(1500px) translate3d(-70px, 34px, -60px) rotateY(34deg); }
.h3-apart .h3-plane.is-b > .hx-in { transform: perspective(1500px) translate3d(0, -26px, 70px) rotateY(0deg); }
.h3-apart .h3-plane.is-c > .hx-in { transform: perspective(1500px) translate3d(70px, 34px, -60px) rotateY(-34deg); }
.h3-label {
  position: absolute;
  color: var(--hx-muted);
  font: 400 12px/1 var(--hx-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  transition: transform 1.3s cubic-bezier(0.65, 0, 0.2, 1);
}
.h3-thread {
  position: absolute;
  left: 0;
  top: 469px;
  width: 1440px;
  height: 2px;
  z-index: 9;
  background: linear-gradient(to right, transparent, var(--label-indigo) 12%, var(--label-indigo) 88%, transparent);
  transform-origin: 0 50%;
  transition: transform 1.1s cubic-bezier(0.65, 0, 0.2, 1) 0.5s, opacity 0.5s;
}
.h3-apart .h3-thread { transform: scaleX(0); opacity: 0; transition-delay: 0s; }
.h3-dot {
  position: absolute;
  top: 464px;
  left: 0;
  z-index: 10;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--foreground);
  box-shadow: 0 0 0 6px color-mix(in oklab, var(--label-indigo) 40%, transparent), 0 0 30px 6px var(--label-indigo);
  opacity: 0;
}
.h3-dot.is-run { animation: h3-dot 2.6s cubic-bezier(0.5, 0, 0.3, 1); }
@keyframes h3-dot { 0% { opacity: 0; transform: translateX(120px); } 12% { opacity: 1; } 88% { opacity: 1; } 100% { opacity: 0; transform: translateX(1320px); } }

/* ── 04 Fleet steering ─────────────────────────────────────────────────── */
.hx-hero[data-hero="fleet"] { --tint: var(--info); --gx: 74%; --gy: 50%; }
.h4-wires { position: absolute; inset: 0; width: 1440px; height: 800px; z-index: 1; overflow: visible; }
.h4-wire { stroke: var(--rule); stroke-width: 1; stroke-dasharray: 2 7; }
.h4-pulse { fill: var(--foreground); filter: drop-shadow(0 0 8px var(--info)); }
.h4-orbit { fill: none; stroke: var(--border); stroke-width: 1; }
.h4-sat .hx-part { border-radius: 14px; transition: background-color 0.3s, box-shadow 0.3s; }
.h4-sat.is-hit .hx-part { background: color-mix(in oklab, var(--info) 14%, transparent); box-shadow: 0 0 0 1px color-mix(in oklab, var(--info) 55%, transparent); }
.h4-tag,
.h4-note {
  position: absolute;
  left: 20px;
  top: calc(100% + 4px);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--foreground);
  font: 400 15px/1 var(--hx-mono);
  white-space: nowrap;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.3s, transform 0.3s;
}
.h4-tag[data-on],
.h4-note[data-on] { opacity: 1; transform: none; }
.h4-tag svg,
.h4-note svg { width: 15px; height: 15px; color: var(--info); }
.h4-note { left: 50%; top: calc(100% + 14px); transform: translate(-50%, -4px); font-size: 13.5px; color: var(--muted-foreground); }
.h4-note[data-on] { transform: translate(-50%, 0); }
.h4-ring {
  position: absolute;
  z-index: 2;
  width: 240px;
  height: 180px;
  margin: -90px 0 0 -120px;
  border: 1px solid var(--info);
  border-radius: 50%;
  opacity: 0;
}
.h4-ring.is-run { animation: h4-ring 1.5s ease-out; }
.h4-ring.is-run + .h4-ring { animation: h4-ring 1.5s ease-out 0.25s; }
@keyframes h4-ring { 0% { opacity: 0.9; transform: scale(0.4); } 100% { opacity: 0; transform: scale(3.6); } }

/* ── 05 The Console deck ───────────────────────────────────────────────── */
.hx-hero[data-hero="deck"] { --tint: var(--label-indigo); --gx: 30%; --gy: 46%; }
.h5-deck {
  position: absolute;
  left: 78px;
  top: 262px;
  width: 732px;
  height: 540px;
  perspective: 1500px;
  perspective-origin: 34% -6%;
  transform: scale(0.9);
  transform-origin: 0 0;
}
.h5-card {
  position: absolute;
  left: 0;
  top: 0;
  width: 732px;
  overflow: hidden;
  border-radius: 14px;
  background: var(--hx-ground);
  transform-origin: 50% 0;
  transition: transform 0.75s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.6s, filter 0.6s;
  filter: brightness(var(--b, 1)) drop-shadow(0 20px 30px var(--hx-shade));
}

.h5-card.is-clipped::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 110px;
  background: linear-gradient(to bottom, transparent, var(--hx-ground));
}

/* ── 06 Cloud sandboxes ────────────────────────────────────────────────── */
.hx-hero[data-hero="cloud"] { --tint: var(--warning); --gx: 50%; --gy: 86%; }
.h6-world { position: absolute; left: 0; top: 524px; width: 1440px; height: 500px; perspective: 1000px; perspective-origin: 50% -24%; }
.h6-field {
  --w: calc(12 * 350px + 11 * 26px);
  position: absolute;
  left: 50%;
  top: 0;
  display: grid;
  grid-template-columns: repeat(12, 350px);
  gap: 12px 26px;
  width: var(--w);
  margin-left: calc(var(--w) / -2);
  transform-origin: 50% 0;
  transform: rotateX(58deg) scale(0.46);
  transform-style: preserve-3d;
  animation: h6-drift 26s ease-in-out infinite alternate;
}
@keyframes h6-drift { to { transform: rotateX(58deg) scale(0.46) translateY(-140px); } }
.h6-tile {
  padding: 10px 14px 2px;
  border-bottom: 1px solid var(--border);
  border-radius: 12px;
  transition: opacity 0.5s var(--i, 0ms), transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.5s, background-color 0.5s;
}
.h6-field.is-off .h6-tile { opacity: 0; transition-delay: 0s; transition-duration: 0.25s; }
.h6-tile.is-wait {
  background: color-mix(in oklab, var(--foreground) 7%, var(--hx-ground));
  border-bottom-color: transparent;
  box-shadow: 0 0 0 3px var(--warning), 0 0 60px color-mix(in oklab, var(--warning) 60%, transparent), 0 60px 80px var(--hx-shade);
  transform: translateZ(56px);
  transition-delay: 0s;
}
.h6-harnesses { display: flex; align-items: center; gap: 22px; white-space: nowrap; }
.h6-harness { display: inline-flex; align-items: center; gap: 8px; color: var(--foreground); font-weight: 500; }
.h6-harness [data-harness-mark] { width: 22px !important; height: 22px !important; }
.h6-fog { position: absolute; z-index: 5; pointer-events: none; }
.h6-fog.is-top { left: 0; top: 500px; width: 1440px; height: 150px; background: linear-gradient(to bottom, var(--hx-ground) 16%, transparent); }
.h6-fog.is-l { left: 0; top: 500px; width: 190px; height: 540px; background: linear-gradient(to right, var(--hx-ground), transparent); }
.h6-fog.is-r { right: 0; top: 500px; width: 190px; height: 540px; background: linear-gradient(to left, var(--hx-ground), transparent); }

@media (prefers-reduced-motion: reduce) {
  .hx-hero *,
  .hx-hero *::after { animation: none !important; transition: none !important; }
}
/* The product page's own motion setting, which the script reads. */
.hx-hero[data-still] *,
.hx-hero[data-still] *::after { animation: none !important; transition: none !important; }
