/**
 * site.css — authored additions on top of the mirrored theme CSS.
 * Scope: multi-page navigation (PLATFORMS dropdown, current-page marker) and
 * the small component kit the platform pages use. Everything else must come
 * from the theme's own classes; do not restyle theme components here.
 */

/* ------------------------------------------------ nav dropdown (desktop) */

.nav .nav-drop {
  position: relative;
}

.nav .nav-drop__menu {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  position: absolute;
  top: calc(100% + 14px);
  left: 50%;
  transform: translateX(-50%) translateY(6px);
  min-width: 21rem;
  padding: 1rem 0;
  background: rgba(12, 3, 6, 0.96);
  border: 1px solid rgba(251, 1, 61, 0.25);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
  z-index: 60;
}

.nav .nav-drop:hover .nav-drop__menu,
.nav .nav-drop:focus-within .nav-drop__menu {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.nav .nav-drop__menu li {
  display: block;
  margin: 0;
}

.nav .nav-drop__menu a {
  display: block;
  padding: 0.9rem 1.8rem;
  white-space: nowrap;
}

/* The theme's underline system assumes the horizontal bar: it positions the
   line at top: 50% + header-height/2 (a full row low inside a vertical menu)
   and lights it via ancestor hover (li:hover a:after) — so hovering the
   PLATFORMS trigger li lights every child underline at once. Rebuild it
   per-item here: own-row geometry, lit only by the item's own hover or by
   being the current page. */
.nav:not(.nav--mobile) .nav-drop__menu li a::after {
  top: auto;
  bottom: 0.55rem;
  left: 1.8rem;
  right: 1.8rem;
  margin: 0;
  width: auto;
  transform: none;
  opacity: 0;
}

.nav:not(.nav--mobile) .nav-drop__menu li:hover a::after,
.nav:not(.nav--mobile) .nav-drop__menu li.is-current a::after {
  opacity: 1;
}

/* keeps the hover bridge alive between the item and the panel */
.nav .nav-drop::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 16px;
}

/* current page marker (matches the theme's active-section underline) */
.nav li.is-current > a {
  position: relative;
}

.nav li.is-current > a::after {
  content: '';
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: auto;
  bottom: -0.8rem;
  width: 2.4rem;
  height: 2px;
  background: #fb013d;
  opacity: 1;
}

/* ------------------------------------------------ subpage component kit */

/* Slimmer hero for platform pages; pairs with .module--hero markup. */
.module--page-hero .hero__inner {
  min-height: 62vh;
}

/* Kicker line above a page h1: mono caps in brand red. */
.page-kicker {
  display: block;
  margin-bottom: 2.4rem;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 1.4rem;
  font-weight: 400;
  letter-spacing: 0.45em;
  text-transform: uppercase;
  color: #fb013d;
}

/* Abstract product frame: stands in for a real screenshot until one is
   approved; label bottom-left, brand gradient field, subtle grid. */
.platform-frame {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border: 1px solid rgba(251, 1, 61, 0.35);
  background:
    linear-gradient(135deg, rgba(73, 0, 15, 0.95), rgba(12, 3, 6, 0.98)),
    repeating-linear-gradient(0deg, transparent 0 39px, rgba(251, 1, 61, 0.09) 39px 40px),
    repeating-linear-gradient(90deg, transparent 0 39px, rgba(251, 1, 61, 0.09) 39px 40px);
  background-blend-mode: normal, screen, screen;
}

.platform-frame__label {
  position: absolute;
  left: 2rem;
  bottom: 1.6rem;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 1.2rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.65);
}

.platform-frame__mark {
  position: absolute;
  right: 2rem;
  top: 1.6rem;
  width: 4.2rem;
  height: 4.2rem;
  opacity: 0.5;
}

/* The hero closer sets "redcell" in the wordmark's letterforms, matched to
   the running text size and colour. */
.redcell-word {
  display: inline-block;
  height: 0.82em;
  width: auto;
  vertical-align: -0.06em;
  fill: currentColor;
}

/* ------------------------------------------------ v3 kit: pixelfield + slabs */

/* Hero pixelfield canvas sits behind the hero content. */
.module--page-hero {
  position: relative;
  overflow: hidden;
  background: #49000f;
}

.pixelfield {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.pixelfield-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.module--page-hero .shell {
  position: relative;
  z-index: 1;
}

/* Art heroes: the text block flows first, then the glyph field in its own
   band below it. Flow layout: collision is structurally impossible. */
.module--page-hero.hero--art .hero__inner {
  min-height: 76vh;
  justify-content: flex-start;
  padding-top: calc(var(--header-height, 12rem) + 6rem);
}

/* The theme absolutely centres hero__head; art heroes return it to flow so
   the glyph band can stack beneath it without overlap. */
.module--page-hero.hero--art .hero__head {
  position: static;
  transform: none;
  inset: auto;
  margin: 0;
  width: 100%;
}

.hero--art .hero__head h1 {
  margin-bottom: 0;
}

.hero--art .hero-sub {
  margin-top: 2.4rem;
}

.hero--art .pixelfield {
  position: relative;
  inset: auto;
  width: 100%;
  height: 40vh;
  min-height: 280px;
  margin-top: 2rem;
}

/* Solid slab sections: the platform pages' section system. No inherited
   module gradients, no background morphing: hard-edged colour slabs like the
   home page's own rhythm. */
.module--platform {
  position: relative;
  padding: 9rem 0;
}

@media (max-width: 1023px) {
  .module--platform {
    padding: 6.5rem 0;
  }
}

.module--platform.plat--red {
  background: #4d0010;
  color: #fff;
}

.module--platform.plat--white {
  background: #fff;
  color: #4d0010;
}

.module--platform.plat--ink {
  background: #2b0009;
  color: #fff;
}

.module--platform .module__title {
  margin-bottom: 2.4rem;
}

.module--platform .sticky-element {
  position: sticky;
  top: calc(var(--header-height, 8rem) + 2.4rem);
}

.module--platform .module__body > h2 {
  margin-bottom: 3.2rem;
}

.module--platform .module__body > h2:last-child {
  margin-bottom: 0;
}

.module--platform .list-stats {
  margin-top: 4.8rem;
}

.module--platform .shot-grid,
.module--platform .spec-list,
.module--platform .pipeline,
.module--platform .split-wall,
.module--platform .metric-pair {
  margin-top: 4.8rem;
}

/* Film band: the recursys.ai title film as a framed exhibit, not wallpaper. */
.film-band {
  border: 1px solid rgba(251, 1, 61, 0.35);
  background: #05070c;
  overflow: hidden;
}

.film-band__bar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 1.2rem 1.8rem;
  border-bottom: 1px solid rgba(251, 1, 61, 0.3);
}

.film-band__bar i {
  width: 0.9rem;
  height: 0.9rem;
  border-radius: 50%;
  background: rgba(251, 1, 61, 0.35);
}

.film-band__label {
  margin-left: 1rem;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 1.1rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.6);
}

.film-band__replay {
  margin-left: auto;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 1.1rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: #fb013d;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 0.4rem 0;
}

.film-band__replay:hover,
.film-band__replay:focus-visible {
  text-decoration: underline;
  text-underline-offset: 0.4em;
}

.film-band video {
  display: block;
  width: 100%;
  height: auto;
}

.film-band__caption {
  padding: 1.4rem 1.8rem;
  border-top: 1px solid rgba(251, 1, 61, 0.3);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 1.2rem;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.65);
}

/* Pixel icons: new glyphs in the services-icon artform. Rects assemble in
   when the section's js-animate wrapper gains is-animated. */
.pixicon {
  display: block;
  width: 4.6rem;
  height: 4.6rem;
  margin-bottom: 1.2rem;
}

.pixicon rect {
  fill: #fb013d;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.pixicon rect.px-dim {
  fill: rgba(251, 1, 61, 0.45);
}

.is-animated .pixicon rect {
  opacity: 1;
}

.plat--white .pixicon rect,
.plat--red .pixicon rect {
  fill: currentColor;
}

.plat--red .pixicon rect,
.plat--ink .pixicon rect {
  fill: #fb013d;
}

/* Alix lives on the page: transparent mark floating at the dial's centre,
   gentle bob, periodic blink on the white eye layers (captn-pilot pattern). */
.alix-live {
  position: absolute;
  left: 50%;
  top: 50%;
  width: clamp(96px, 16vh, 150px);
  transform: translate(-50%, -50%);
  pointer-events: none;
  animation: alix-bob 5.2s ease-in-out infinite;
}

.alix-live svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.alix-live .cls-7 {
  transform-box: fill-box;
  transform-origin: center;
  animation: alix-blink 4.6s infinite;
}

@keyframes alix-bob {
  0%, 100% { transform: translate(-50%, -50%); }
  50% { transform: translate(-50%, calc(-50% - 10px)); }
}

@keyframes alix-blink {
  0%, 92%, 100% { transform: scaleY(1); }
  95% { transform: scaleY(0.08); }
}

@media (prefers-reduced-motion: reduce) {
  .alix-live,
  .alix-live .cls-7 {
    animation: none;
  }
}

/* ------------------------------------------------ v2 kit: platform pages */

/* The theme's .module--overview hardcodes --bg-color at equal specificity to
   the bg utilities and later in source order, so on platform pages the
   white-section variant needs a compound override. Likewise the CTA sections
   (module--services) define no background of their own. */
.module--overview.bg--white {
  --bg-color: #fff;
}

.module--overview.text--red {
  --text-color: #4d0010;
}

.module--services.bg--white {
  --bg-color: #fff;
  background-color: var(--bg-color);
}

.module--services.text--red {
  --text-color: #4d0010;
  color: var(--text-color);
}

/* Product screenshot in a browser-chrome frame. Click to enlarge. */
.shot-card {
  border: 1px solid rgba(251, 1, 61, 0.3);
  background: #0c0306;
  overflow: hidden;
  cursor: zoom-in;
  transition: border-color 0.2s ease;
}

.shot-card:hover,
.shot-card:focus-visible {
  border-color: #fb013d;
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem 2rem;
  background: rgba(12, 3, 6, 0.94);
}

.lightbox.is-open {
  display: flex;
}

body.lightbox-open {
  overflow: hidden;
}

.lightbox__figure {
  margin: 0;
  max-width: min(94vw, 1700px);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.lightbox__figure img {
  display: block;
  max-width: 100%;
  max-height: 82vh;
  width: auto;
  height: auto;
  border: 1px solid rgba(251, 1, 61, 0.4);
}

.lightbox__figure figcaption {
  padding: 1.4rem 0 0;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 1.2rem;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.7);
}

.lightbox__close {
  position: absolute;
  top: 2rem;
  right: 2.4rem;
  background: none;
  border: 1px solid rgba(251, 1, 61, 0.5);
  color: #fb013d;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 1.2rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  padding: 1rem 1.8rem;
  cursor: pointer;
}

.lightbox__close:hover,
.lightbox__close:focus-visible {
  background: #fb013d;
  color: #fff;
}

.shot-card__bar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 1.1rem 1.6rem;
  border-bottom: 1px solid rgba(251, 1, 61, 0.25);
}

.shot-card__bar i {
  width: 0.9rem;
  height: 0.9rem;
  border-radius: 50%;
  background: rgba(251, 1, 61, 0.35);
}

.shot-card__bar span {
  margin-left: 1rem;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 1.1rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}

.shot-card img {
  display: block;
  width: 100%;
  height: auto;
}

.shot-card figcaption {
  padding: 1.4rem 1.6rem;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 1.2rem;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.7);
  border-top: 1px solid rgba(251, 1, 61, 0.25);
}

.bg--white .shot-card,
.plat--white .shot-card,
.text--red .shot-card {
  background: #fff;
}

.bg--white .shot-card figcaption,
.plat--white .shot-card figcaption,
.text--red .shot-card figcaption {
  color: rgba(73, 0, 15, 0.75);
}

.bg--white .shot-card__bar span,
.plat--white .shot-card__bar span,
.text--red .shot-card__bar span {
  color: rgba(73, 0, 15, 0.6);
}

/* Two-column screenshot layout; stacks on mobile. */
.shot-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
}

.shot-grid .shot-card--wide {
  grid-column: 1 / -1;
}

@media (max-width: 1023px) {
  .shot-grid {
    grid-template-columns: 1fr;
  }
}

/* CSS-only marquee of module/keyword names. Content is duplicated once in
   markup; the track scrolls by exactly half its width for a seamless loop. */
.marquee {
  overflow: hidden;
  border-top: 1px solid rgba(251, 1, 61, 0.3);
  border-bottom: 1px solid rgba(251, 1, 61, 0.3);
  padding: 1.8rem 0;
}

.marquee__track {
  display: inline-flex;
  gap: 4rem;
  white-space: nowrap;
  animation: marquee-scroll 36s linear infinite;
  will-change: transform;
}

.marquee__track span {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 1.4rem;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: #fb013d;
}

@keyframes marquee-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
  .marquee__track {
    animation: none;
  }
}

/* Numbered pipeline rail (Atlas turn pipeline). */
.pipeline {
  counter-reset: step;
  border-left: 2px solid rgba(251, 1, 61, 0.4);
  margin-left: 1rem;
}

.pipeline__step {
  position: relative;
  padding: 0 0 3.2rem 3.6rem;
}

.pipeline__step:last-child {
  padding-bottom: 0;
}

.pipeline__step::before {
  counter-increment: step;
  content: counter(step, decimal-leading-zero);
  position: absolute;
  left: -2.4rem;
  top: -0.2rem;
  width: 4.4rem;
  height: 4.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0c0306;
  border: 1px solid #fb013d;
  color: #fb013d;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 1.3rem;
  letter-spacing: 0.1em;
}

.bg--white .pipeline__step::before,
.plat--white .pipeline__step::before,
.text--red .pipeline__step::before {
  background: #fff;
}

/* Pixel numerals injected by site.js replace the text counters. */
.pipeline--pix .pipeline__step {
  padding-left: 4.2rem;
}

.pipeline--pix .pipeline__step::before {
  content: none;
}

.pipeline__num {
  position: absolute;
  left: -2.6rem;
  top: -0.3rem;
  width: 5rem;
  height: 5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0c0306;
  border: 1px solid #fb013d;
  color: #fb013d;
}

.plat--white .pipeline__num,
.bg--white .pipeline__num,
.plat--white .pipeline__num,
.text--red .pipeline__num {
  background: #fff;
}

.pipeline__num svg {
  width: 2.7rem;
  height: auto;
  display: block;
}

.pipeline__step h4 {
  margin: 0 0 0.6rem;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 1.5rem;
  font-weight: 400;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: #fb013d;
}

.pipeline__step p {
  margin: 0;
  max-width: 56rem;
}

/* Split wall (Myra): two locked-together panels, code vs narration. */
.split-wall {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid rgba(251, 1, 61, 0.35);
}

.split-wall__side {
  padding: 3rem;
}

.split-wall__side + .split-wall__side {
  border-left: 1px solid rgba(251, 1, 61, 0.35);
}

.split-wall__side h4 {
  margin: 0 0 1.6rem;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 1.3rem;
  font-weight: 400;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: #fb013d;
}

.split-wall__side pre {
  margin: 0;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 1.25rem;
  line-height: 1.8;
  white-space: pre-wrap;
  color: rgba(255, 255, 255, 0.8);
}

.bg--white .split-wall__side pre,
.plat--white .split-wall__side pre,
.text--red .split-wall__side pre {
  color: rgba(73, 0, 15, 0.85);
}

@media (max-width: 767px) {
  .split-wall {
    grid-template-columns: 1fr;
  }
  .split-wall__side + .split-wall__side {
    border-left: 0;
    border-top: 1px solid rgba(251, 1, 61, 0.35);
  }
}

/* Big paired metric (ADMRL: 20 min vs 3 hrs). */
.metric-pair {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 3rem;
  text-align: center;
}

.metric-pair__vs {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 1.4rem;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
}

.bg--white .metric-pair__vs,
.plat--white .metric-pair__vs,
.text--red .metric-pair__vs {
  color: rgba(73, 0, 15, 0.5);
}

.metric-pair .list-stats {
  margin: 0;
}

@media (max-width: 767px) {
  .metric-pair {
    grid-template-columns: 1fr;
    gap: 1.6rem;
  }
}

/* Definition rows: label + copy pairs used for capability breakdowns. */
.spec-list {
  border-top: 1px solid rgba(251, 1, 61, 0.25);
}

.spec-list__row {
  display: grid;
  grid-template-columns: minmax(16rem, 24rem) 1fr;
  gap: 2.4rem;
  padding: 2.4rem 0;
  border-bottom: 1px solid rgba(251, 1, 61, 0.25);
}

.spec-list__label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 1.3rem;
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #fb013d;
}

@media (max-width: 767px) {
  .spec-list__row {
    grid-template-columns: 1fr;
    gap: 0.8rem;
  }
}
