/* Factory by Razor. Tokens from razor-brand references/tokens.json and factory-brand guidelines. */

:root {
  --razor-purple: #271e3b;
  --razor-red: #f15a5d;
  --red-600: #cd4d4f;
  --red-700: #a93f41;
  --light-purple: #d3c9fa;
  --off-white: #fafafa;
  --white: #ffffff;
  --neutral-500: #7b7687;
  --neutral-600: #666074;
  --neutral-700: #5c556b;
  --purple-800: #362e49;

  /* Factory: one hue in three tones (product family guide) */
  --factory-light: #d1c4f5;
  --factory-mid: #9a7bf2;
  --factory-shadow: #7b38e9;
  --factory-tint: #f3f0fd;
  /* the one emphasised colour: Shadow on light, Mid on dark */
  --accent: var(--factory-shadow);

  /* Light semantic */
  --text-primary: var(--razor-purple);
  --text-secondary: var(--neutral-700);
  --text-subtle: var(--neutral-500);
  --text-eyebrow: var(--neutral-600);
  --surface-page: var(--off-white);
  --surface-card: var(--white);
  --border-card: rgba(39, 30, 59, 0.08);
  --border-subtle: rgba(39, 30, 59, 0.1);
  --border-strong: rgba(39, 30, 59, 0.3);

  /* Dark semantic */
  --dark-text-primary: var(--off-white);
  --dark-text-secondary: var(--light-purple);
  --dark-text-subtle: rgba(211, 201, 250, 0.7);
  --dark-border-subtle: rgba(211, 201, 250, 0.18);
  --dark-border-strong: rgba(211, 201, 250, 0.4);
  --dark-surface-card: rgba(211, 201, 250, 0.06);

  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-mono: "Space Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --font-display: "Sora", "Inter", system-ui, sans-serif;

  --radius-s: 8px;
  --radius-l: 16px;
  --gutter: 24px;
  --measure: 36rem;
  --container: 1200px;
}

@media (min-width: 720px) {
  :root { --gutter: 48px; }
}
@media (min-width: 1100px) {
  :root { --gutter: 64px; }
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--surface-page);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 18px;
  line-height: 1.5;
  font-feature-settings: "tnum" 1;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
p { margin: 0; }
h1, h2, h3 { margin: 0; font-weight: 700; text-wrap: balance; }
h1, h2, .display { font-family: var(--font-display); font-weight: 600; }

.container {
  width: 100%;
  max-width: calc(var(--container) + 2 * var(--gutter));
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 8px;
  background: var(--accent);
  color: var(--off-white);
  padding: 8px 16px;
  border-radius: var(--radius-s);
  z-index: 100;
}
.skip-link:focus { left: 16px; }

/* Type */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.3;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-eyebrow);
  margin: 0 0 20px;
}
.dark .eyebrow { color: var(--dark-text-subtle); }

.h1 {
  font-size: clamp(2.5rem, 1.25rem + 5.2vw, 5.25rem);
  line-height: 1;
  letter-spacing: -0.03em;
  max-width: 14ch;
}
.h2 {
  font-size: clamp(2rem, 1.3rem + 2.6vw, 3.5rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  max-width: 20ch;
}
.h3 {
  font-size: 1.375rem;
  line-height: 1.2;
  letter-spacing: -0.005em;
  font-weight: 600;
}
.lead {
  font-size: clamp(1.125rem, 1rem + 0.6vw, 1.5rem);
  line-height: 1.4;
  color: var(--text-secondary);
  max-width: var(--measure);
}
.dark .lead { color: var(--dark-text-secondary); }
.body {
  color: var(--text-secondary);
  max-width: var(--measure);
}
.dark .body { color: var(--dark-text-secondary); }
.highlight { color: var(--accent); }

.section-head { margin-bottom: 48px; }
.section-head .h2 { margin-top: 0; }
.section-head .lead { margin-top: 20px; }
@media (min-width: 900px) {
  .section-head { margin-bottom: 64px; }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 24px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.2;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background-color 120ms ease, border-color 120ms ease;
}
.btn-primary {
  background: linear-gradient(135deg, var(--factory-mid), var(--factory-shadow));
  color: #fff;
  box-shadow: 0 6px 20px rgba(123, 56, 233, 0.25);
}
.btn-primary:hover { background: linear-gradient(135deg, #8d6bf0, #6a2fd0); }
.btn-primary:active { background: var(--factory-shadow); }
.btn-ghost {
  background: transparent;
  color: var(--dark-text-primary);
  border-color: var(--dark-border-strong);
}
.btn-ghost:hover { border-color: var(--off-white); }
.btn:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 40px;
}

/* Sections */
.section {
  padding: 80px 0;
}
@media (min-width: 900px) {
  .section { padding: 120px 0; }
}
.dark {
  background: var(--razor-purple);
  color: var(--dark-text-primary);
  --accent: var(--factory-mid);
}
.verdict { --accent: var(--factory-mid); }
.tint { background: var(--factory-tint); }
.bg {
  position: relative;
  isolation: isolate;
  background-repeat: no-repeat;
  background-size: cover;
  background-position: right bottom;
}
.bg-dotted-waves-dark { background-image: url("assets/dotted-waves-dark.svg"); }
.bg-dotted-waves-light { background-image: url("assets/dotted-waves-light.svg"); }
.bg-curtain-dark { background-image: url("assets/curtain-dark.svg"); }
.bg-dots-dark { background-image: url("assets/dots-dark.svg"); }
/* The product family patterns: the Factory surface (its own colour) and the Razor folded surface */
.bg-factory-surface { background-color: var(--factory-mid); background-image: url("assets/factory-surface.svg"); background-position: center; }
.bg-folded-surface { background-color: var(--razor-purple); background-image: url("assets/folded-surface.svg"); background-position: center; }
/* On tall narrow sections, cover would blow the pattern up: pin it to a fixed width, still anchored bottom-right */
@media (max-width: 899px) {
  .bg-dotted-waves-light { background-size: 1400px auto; }
}

/* Header: fixed, transparent over the hero, frosted purple once you scroll */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  padding: 24px 0;
  transition: background-color 240ms ease, padding 240ms ease, border-color 240ms ease;
  border-bottom: 1px solid transparent;
}
.site-header.is-scrolled {
  padding: 12px 0;
  background: rgba(123, 56, 233, 0.86);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  backdrop-filter: blur(16px) saturate(140%);
  border-bottom-color: rgba(255, 255, 255, 0.22);
}
.site-header .btn-primary { background: #fff; color: var(--factory-shadow); box-shadow: 0 6px 20px rgba(39, 30, 59, 0.18); }
.site-header .btn-primary:hover { background: #f3f0fd; }
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.site-header .lockup { width: 160px; }
@media (min-width: 720px) {
  .site-header { padding: 32px 0; }
  .site-header.is-scrolled { padding: 14px 0; }
  .site-header .lockup { width: 182px; }
}
.site-header .btn { min-height: 40px; padding: 8px 20px; font-size: 0.9375rem; }

/* Hero */
.hero {
  padding-top: 144px;
  padding-bottom: 96px;
  min-height: 100svh;
  display: flex;
  align-items: center;
}
@media (min-width: 720px) {
  .hero { padding-top: 176px; padding-bottom: 128px; }
}
.hero .h1 { margin-bottom: 28px; }
.hero-meta {
  margin-top: 64px;
  padding-top: 24px;
  border-top: 1px solid var(--dark-border-subtle);
  display: flex;
  flex-wrap: wrap;
  gap: 12px 32px;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dark-text-subtle);
  max-width: 48rem;
}

/* Problem band */
.problem-grid {
  display: grid;
  gap: 40px;
  margin-top: 48px;
}
@media (min-width: 900px) {
  .problem-grid {
    grid-template-columns: 1fr 1fr;
    gap: 64px;
  }
}
.problem-col {
  padding-top: 24px;
  border-top: 1px solid var(--border-subtle);
}
.problem-col .label {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 20px;
}
.problem-col .h3 { margin-bottom: 16px; max-width: 22ch; }
.problem-col .body + .body { margin-top: 16px; }

.verdict {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 32px;
  margin-top: 56px;
  padding: 24px 32px;
  background: var(--razor-purple);
  color: var(--off-white);
  border-radius: var(--radius-l);
}
.verdict .label {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  white-space: nowrap;
}
.verdict p {
  font-weight: 600;
  font-size: clamp(1.125rem, 1rem + 0.5vw, 1.5rem);
  line-height: 1.3;
  letter-spacing: -0.01em;
}

/* Differentiator cards */
.cards {
  display: grid;
  gap: 16px;
  list-style: none;
  margin: 0;
  padding: 0;
}
@media (min-width: 640px) {
  .cards { grid-template-columns: 1fr 1fr; gap: 24px; }
}
@media (min-width: 1100px) {
  .cards { grid-template-columns: repeat(4, 1fr); }
}
.card {
  background: var(--surface-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-l);
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.card .num {
  font-family: var(--font-mono);
  font-size: 1rem;
  letter-spacing: 0.04em;
  color: var(--accent);
}
.card .h3 { margin-top: 8px; }
.card .body { font-size: 1rem; }

/* Three engines: one white panel, square corners, one-product line as its bottom band */
.engines-panel {
  margin-top: 64px;
  background: var(--surface-card);
  border: 1px solid var(--border-card);
  border-radius: 0;
}
.engines {
  display: grid;
  list-style: none;
  margin: 0;
  padding: 0;
}
@media (min-width: 900px) {
  .engines { grid-template-columns: repeat(3, 1fr); }
}
.engine {
  padding: 28px 32px;
  border-bottom: 1px solid var(--border-subtle);
}
@media (min-width: 900px) {
  .engine { padding: 32px; }
  .engine + .engine { border-left: 1px solid var(--border-subtle); }
}
.engine .label {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-eyebrow);
  margin-bottom: 12px;
}
.engine .body { font-size: 1rem; }
.engines-line {
  padding: 24px 32px;
  font-weight: 600;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
}

/* Timeline */
.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
}
.stage {
  position: relative;
  padding: 0 0 40px 40px;
}
.stage::before {
  /* track */
  content: "";
  position: absolute;
  left: 7px;
  top: 8px;
  bottom: -8px;
  width: 1px;
  background: var(--border-strong);
}
.stage:last-child::before { bottom: auto; height: 0; }
.stage::after {
  /* node */
  content: "";
  position: absolute;
  left: 0;
  top: 4px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--accent);
}
.stage .day {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-eyebrow);
  margin-bottom: 12px;
}
.stage .h3 { margin-bottom: 8px; }
.stage .body { font-size: 1rem; }

@media (min-width: 900px) {
  .timeline {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    padding-top: 0;
  }
  .stage {
    padding: 0 32px 0 0;
  }
  .stage .day {
    margin-bottom: 0;
    padding-bottom: 20px;
  }
  .stage::before {
    /* horizontal track under the numbers */
    left: 0;
    right: 0;
    top: 43px;
    bottom: auto;
    width: auto;
    height: 1px;
  }
  .stage:last-child::before { height: 1px; right: 0; }
  .stage::after {
    left: 0;
    top: 36px;
  }
  .stage .h3 { margin-top: 36px; }
  /* gate ticks between stages */
  .stage + .stage .tick {
    position: absolute;
    left: -16px;
    top: 35px;
    width: 1px;
    height: 17px;
    background: var(--border-strong);
  }
}

.timeline-line {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--border-subtle);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2.25rem);
  letter-spacing: -0.015em;
  line-height: 1.15;
}
.timeline-line .highlight { color: var(--accent); }

/* Showcase video: a square-cornered frame on the Factory tint, plays when it comes into view */
.see { background: var(--factory-tint); }
.showcase {
  position: relative;
  margin: 0;
  background: var(--razor-purple);
  border: 1px solid var(--border-card);
  box-shadow: 0 24px 64px rgba(39, 30, 59, 0.22);
}
.showcase-video { display: block; width: 100%; aspect-ratio: 16 / 9; background: var(--razor-purple); cursor: pointer; }
.showcase-play {
  position: absolute;
  left: 50%;
  top: calc(50% - 22px);
  width: 96px;
  height: 96px;
  transform: translate(-50%, -50%);
  border: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--factory-mid), var(--factory-shadow));
  box-shadow: 0 12px 40px rgba(123, 56, 233, 0.5);
  cursor: pointer;
  transition: transform 160ms ease, opacity 240ms ease;
}
.showcase-play:hover { transform: translate(-50%, -50%) scale(1.06); }
.showcase-play span {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0;
  height: 0;
  transform: translate(-40%, -50%);
  border-left: 26px solid #fff;
  border-top: 16px solid transparent;
  border-bottom: 16px solid transparent;
}
.showcase.is-playing .showcase-play { opacity: 0; pointer-events: none; }

/* Proof points: a dark band, five cards each led by a big red stat and a live figure */
.pillars {
  display: grid;
  gap: 16px;
  list-style: none;
  margin: 0;
  padding: 0;
}
@media (min-width: 640px) {
  .pillars { grid-template-columns: 1fr 1fr; gap: 24px; }
}
@media (min-width: 1100px) {
  .pillars { grid-template-columns: repeat(6, 1fr); }
  .pillar { grid-column: span 2; }
  /* the two wide cards put the figure beside the copy */
  .pillar:nth-child(n+4) {
    grid-column: span 3;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
    grid-template-areas: "num fig" "stat fig" "title fig" "body fig" "body axis";
    grid-template-rows: auto auto auto 1fr auto;
    column-gap: 32px;
    align-items: start;
  }
  .pillar:nth-child(n+4) .num { grid-area: num; }
  .pillar:nth-child(n+4) .stat { grid-area: stat; }
  .pillar:nth-child(n+4) .h3 { grid-area: title; }
  .pillar:nth-child(n+4) .figure { grid-area: fig; margin-top: 0; height: auto; min-height: 240px; align-self: stretch; }
  .pillar:nth-child(n+4) .figure-axis { grid-area: axis; align-self: end; }
  .pillar:nth-child(n+4) .body { grid-area: body; align-self: end; }
}
.pillar {
  background: var(--surface-card);
  color: var(--text-primary);
  border: 1px solid rgba(39, 30, 59, 0.08);
  box-shadow: 0 12px 32px rgba(39, 30, 59, 0.14);
  border-radius: var(--radius-l);
  padding: 28px 28px 32px;
  display: flex;
  flex-direction: column;
}
@media (min-width: 900px) {
  .pillar { padding: 32px; }
}
.pillar { --accent: var(--factory-shadow); }
.pillar .num {
  font-family: var(--font-mono);
  font-size: 1rem;
  letter-spacing: 0.04em;
  color: var(--accent);
}
.pillar .stat {
  margin-top: 20px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.75rem, 2rem + 2.4vw, 4rem);
  line-height: 0.95;
  letter-spacing: -0.03em;
  color: var(--accent);
}
.pillar .h3 { margin-top: 12px; color: var(--text-primary); }
.pillar .figure {
  position: relative;
  height: 200px;
  margin: 28px 0 0;
}
@media (min-width: 900px) {
  .pillar .figure { height: 220px; }
}
.pillar .figure canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
.figure-axis {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-subtle);
}
.figure-axis span { white-space: nowrap; }
.figure-axis-mid { color: var(--factory-shadow); flex: 1 1 100%; order: 3; margin-top: 4px; }
/* a plain sentence under a figure, where a left/right axis would not explain it */
.figure-axis .figure-note { flex: 1 1 100%; white-space: normal; text-transform: none; letter-spacing: 0; font-family: var(--font-sans); font-size: 0.9375rem; color: var(--text-secondary); }
.pillar .body { font-size: 1rem; margin-top: 16px; color: var(--text-secondary); }

/* Objection panel: square, dark, inset */
.objection-wrap { padding: 96px 0; }
@media (min-width: 900px) {
  .objection-wrap { padding: 120px 0; }
}
.objection {
  padding: 64px var(--gutter);
  border-radius: 0;
}
@media (min-width: 900px) {
  .objection { padding: 96px 96px; }
}
.objection .rule {
  width: 56px;
  height: 3px;
  background: var(--accent);
  margin: 0 0 32px;
}
.objection .question {
  font-size: clamp(2rem, 1.3rem + 2.8vw, 3.75rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  max-width: 19ch;
  margin-bottom: 40px;
}
.objection .answer {
  font-size: clamp(1.25rem, 1.05rem + 1vw, 1.75rem);
  line-height: 1.3;
  letter-spacing: -0.01em;
  font-weight: 600;
  max-width: 30ch;
  margin-bottom: 24px;
}
.objection .answer .highlight { color: var(--accent); }
.objection .body { max-width: 36rem; }

/* Closing, on the Factory surface: everything in white */
.surface { color: #fff; --accent: #fff; }
.surface .eyebrow { color: rgba(255, 255, 255, 0.75); }
.surface .lead, .surface .body, .surface address, .surface .contact ul, .surface .contact .big { color: rgba(255, 255, 255, 0.9); }
.surface .contact .label, .surface .site-footer p { color: rgba(255, 255, 255, 0.7); }
.surface .closing-grid, .surface .site-footer { border-color: rgba(255, 255, 255, 0.28); }
.surface .btn-primary { background: #fff; color: var(--factory-shadow); box-shadow: 0 6px 20px rgba(39, 30, 59, 0.2); }
.surface .btn-primary:hover { background: #f3f0fd; }
.surface .btn-ghost { color: #fff; border-color: rgba(255, 255, 255, 0.55); }
.surface .btn-ghost:hover { border-color: #fff; }
.closing .lockup-white { width: 182px; margin-bottom: 40px; }
.closing { padding: 96px 0 64px; }
@media (min-width: 900px) {
  .closing { padding: 128px 0 80px; }
}
.closing .h2 { margin-top: 0; max-width: 16ch; }
.closing .lead { margin-top: 24px; }
.closing-grid {
  display: grid;
  gap: 48px;
  margin-top: 64px;
  padding-top: 40px;
  border-top: 1px solid var(--dark-border-subtle);
}
@media (min-width: 900px) {
  .closing-grid { grid-template-columns: 1fr 1fr 1fr; gap: 32px; }
}
.contact .label {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dark-text-subtle);
  margin-bottom: 12px;
}
.contact a { text-decoration: none; }
.contact a:hover { text-decoration: underline; }
.contact .big {
  font-weight: 600;
  font-size: 1.25rem;
  letter-spacing: -0.005em;
  color: var(--dark-text-primary);
}
.contact address {
  font-style: normal;
  color: var(--dark-text-secondary);
}
.contact ul { list-style: none; margin: 0; padding: 0; color: var(--dark-text-secondary); }
.contact li + li { margin-top: 6px; }

.site-footer {
  margin-top: 80px;
  padding-top: 32px;
  border-top: 1px solid var(--dark-border-subtle);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.site-footer .marque { width: 160px; }
.site-footer p {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dark-text-subtle);
}

/* Ghost button on light ground (mid-page CTA) */
.btn-ghost-light {
  background: transparent;
  color: var(--razor-purple);
  border-color: var(--border-strong);
}
.btn-ghost-light:hover { border-color: var(--razor-purple); }
.timeline-foot .btn-group { margin-top: 32px; }

/* Scroll cue, bottom-left of the hero */
.scroll-cue {
  position: absolute;
  left: var(--gutter);
  bottom: 28px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dark-text-subtle);
}
.scroll-cue i {
  display: block;
  width: 48px;
  height: 1px;
  background: var(--dark-border-strong);
  position: relative;
  overflow: hidden;
}
.scroll-cue i::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--accent);
  transform: translateX(-100%);
  animation: cue 2.2s cubic-bezier(0.6, 0, 0.3, 1) infinite;
}
@keyframes cue {
  0% { transform: translateX(-100%); }
  60%, 100% { transform: translateX(100%); }
}

/* WebGL canvases sit behind the content of the section they belong to */
.gl-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: -1;
  pointer-events: none;
}
.gl-on { background-image: none; }
.hero.gl-on, .closing.gl-on {
  background-image: radial-gradient(120% 90% at 85% 100%, rgba(211, 201, 250, 0.10), rgba(211, 201, 250, 0) 60%);
}
/* Keeps the type zone legible over the live surface */
.hero.gl-on { background-image: linear-gradient(135deg, var(--factory-mid), var(--factory-shadow)); }
.hero.gl-on::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(74, 28, 156, 0.5) 0%, rgba(74, 28, 156, 0.3) 55%, rgba(74, 28, 156, 0) 100%);
}
.closing.gl-on::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(39, 30, 59, 0) 0%, rgba(39, 30, 59, 0.45) 55%, rgba(39, 30, 59, 0.7) 100%);
}
@media (min-width: 720px) {
  .hero.gl-on::before {
    background: linear-gradient(90deg, rgba(74, 28, 156, 0.62) 0%, rgba(74, 28, 156, 0.38) 40%, rgba(74, 28, 156, 0) 72%);
  }
}
.surface .hero-meta { color: rgba(255, 255, 255, 0.78); border-color: rgba(255, 255, 255, 0.3); }
.surface .scroll-cue { color: rgba(255, 255, 255, 0.78); }
.surface .scroll-cue i { background: rgba(255, 255, 255, 0.4); }
.surface .scroll-cue i::after { background: #fff; }

/* Drift figure */
.drift { margin: 8px 0 0; }
.drift-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 24px;
  margin-bottom: 8px;
}
.drift-toggle {
  display: none;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
}
.drift.has-gl .drift-toggle { display: inline-flex; }
.drift-toggle button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  font: 600 0.875rem/1.2 var(--font-sans);
  padding: 7px 16px;
  min-height: 40px;
  border-radius: 999px;
  cursor: pointer;
  transition: background-color 160ms ease, color 160ms ease;
}
.drift-toggle button[aria-pressed="true"] {
  background: var(--razor-purple);
  color: var(--off-white);
}
/* The Factory choice carries the icon's gradient and glows when it is on */
.drift-toggle button[data-mode="factory"] {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #7b38e9;
}
/* The lockup cropped to its icon and wordmark: the file is 390 x 106 and the by Razor line sits below 84 */
.drift-toggle .lockup-crop { display: block; height: 22px; aspect-ratio: 352 / 84; overflow: hidden; }
.drift-toggle button[data-mode="factory"] img { height: calc(22px * 106 / 84); width: auto; display: block; }
.drift-toggle button[data-mode="factory"] .lockup-dark,
.drift-toggle button[data-mode="factory"][aria-pressed="true"] .lockup-light { display: none; }
.drift-toggle button[data-mode="factory"][aria-pressed="true"] .lockup-dark { display: block; }
.drift-toggle button[data-mode="factory"][aria-pressed="true"] {
  color: #fff;
  background: linear-gradient(135deg, #b49ef4 0%, #9a7bf2 45%, #7b38e9 100%);
  box-shadow: 0 0 0 1px rgba(154, 123, 242, 0.35), 0 6px 22px rgba(123, 56, 233, 0.45);
  animation: factory-glow 2.6s ease-in-out infinite;
}
@keyframes factory-glow {
  0%, 100% { box-shadow: 0 0 0 1px rgba(154, 123, 242, 0.35), 0 6px 22px rgba(123, 56, 233, 0.45); }
  50% { box-shadow: 0 0 0 1px rgba(154, 123, 242, 0.55), 0 8px 32px rgba(123, 56, 233, 0.75); }
}
@media (prefers-reduced-motion: reduce) {
  .drift-toggle button[data-mode="factory"][aria-pressed="true"] { animation: none; }
}
.drift-toggle button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.drift-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  list-style: none;
  margin: 0;
  padding: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-eyebrow);
}
.drift-legend li { display: inline-flex; align-items: center; gap: 8px; }
.drift-legend li::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}
.k-spec { color: var(--razor-purple); }
.k-code { color: var(--neutral-500); }
.k-prompt { color: var(--razor-red); }
/* Legend, labels and note follow the simulation mode */
.drift.is-factory .drift-legend .k-code { display: none; }
.drift.is-factory .k-prompt { color: var(--factory-shadow); }
.drift-note { color: var(--text-secondary); text-transform: none; letter-spacing: 0; font-family: var(--font-sans); font-size: 0.9375rem; text-align: center; flex: 1 1 100%; order: 3; }
.drift .when-factory, .drift.is-factory .when-drift { display: none; }
.drift.is-factory .when-factory { display: inline; }
@media (min-width: 900px) {
  .drift-note { flex: 0 1 auto; order: 0; }
}
.drift-stage {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  height: 240px;
}
@media (min-width: 900px) {
  .drift-stage { height: 320px; }
}
.drift-stage .gl-canvas { z-index: 0; }
.drift-label {
  position: absolute;
  z-index: 1;
  transform: translate(12px, -50%);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 500ms ease;
}
.drift-label:not(.is-on) { visibility: hidden; }
.drift-label.is-on { opacity: 1; }
/* A marker at each spec change in the With Factory view: a vertical hairline from the step down to a label under the plot */
.drift-change {
  position: absolute;
  bottom: 0;
  z-index: 1;
  width: 0;
  border-left: 1px solid var(--accent);
  opacity: 0;
  transition: opacity 400ms ease;
}
.drift-change::before {
  content: "";
  position: absolute;
  left: -3.5px;
  top: -3px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}
.drift-change b, .drift-change i {
  position: absolute;
  left: 8px;
  white-space: nowrap;
  font-style: normal;
}
.drift-change b {
  bottom: 6px;
  width: 13ch;
  white-space: normal;
  line-height: 1.35;
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}
.drift-change i {
  bottom: 2px;
  font-size: 0.8125rem;
  color: var(--text-secondary);
}
@media (max-width: 719px) {
  .drift-change i { display: none; }
  .drift-change b { width: 9ch; }
  .drift-change + .drift-change .cr { display: none; }
}
.drift.is-factory .drift-change.is-on { opacity: 1; }
.drift-change + .drift-change { transition-delay: 250ms; }
.drift-change + .drift-change + .drift-change { transition-delay: 500ms; }

.drift-axis {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  align-items: baseline;
  justify-content: space-between;
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-subtle);
}
.drift + .problem-grid { margin-top: 64px; }

/* Graph band */
.graph-grid {
  display: grid;
  gap: 48px;
}
@media (min-width: 900px) {
  .graph-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: center;
    gap: 64px;
  }
}
.graph-copy .lead + .lead { margin-top: 20px; }
.graph-copy .h2 { margin-bottom: 24px; }
.graph-stage {
  position: relative;
  isolation: isolate;
  width: 100%;
  max-width: 560px;
  aspect-ratio: 1 / 1;
  border: 1px solid var(--dark-border-subtle);
  justify-self: end;
}
.graph-stage .gl-canvas { z-index: 0; }
/* The Factory icon at the centre, on its own ground: clear space of half the icon width all round */
.graph-mark {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 1;
  width: 112px;
  height: 112px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, var(--razor-purple) 52%, rgba(39, 30, 59, 0) 72%);
  display: grid;
  place-items: center;
  pointer-events: none;
}
.graph-mark img { width: 56px; height: 56px; }
.graph-stage.has-icon3d .graph-mark { display: none; }
@media (min-width: 900px) {
  .graph-mark { width: 128px; height: 128px; }
  .graph-mark img { width: 64px; height: 64px; }
}
.graph-caption {
  position: absolute;
  left: 20px;
  bottom: 16px;
  z-index: 1;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dark-text-subtle);
}
.graph-caption::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.7);
  margin-right: 10px;
  vertical-align: 1px;
}

/* Reveal on scroll (only when the script is running, so content is never hidden without it) */
.js .reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 760ms cubic-bezier(0.2, 0.6, 0.2, 1), transform 760ms cubic-bezier(0.2, 0.6, 0.2, 1);
  transition-delay: calc(var(--i, 0) * 90ms);
}
.js .reveal.is-in {
  opacity: 1;
  transform: none;
}
.js .reveal .reveal { transition-delay: calc(var(--i, 0) * 90ms + 200ms); }
/* Timeline draws itself in: track grows, then the nodes land */
.js .timeline .stage::before {
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 700ms ease;
  transition-delay: calc(var(--i, 0) * 180ms + 200ms);
}
.js .timeline .stage::after {
  transform: scale(0);
  transition: transform 420ms cubic-bezier(0.3, 1.6, 0.5, 1);
  transition-delay: calc(var(--i, 0) * 180ms + 120ms);
}
.js .timeline.is-in .stage::before,
.js .timeline.is-in .stage::after { transform: none; }
@media (min-width: 900px) {
  .js .timeline .stage::before { transform: scaleX(0); transform-origin: left; }
  .js .timeline.is-in .stage::before { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .js .reveal, .js .timeline .stage::before, .js .timeline .stage::after {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .scroll-cue i::after { animation: none; transform: none; }
}
