/**
 * Home Spatial Render Field.
 *
 * One continuous near-black surface with a fixed sequence of static renders
 * extracted from T3X2R product imagery. Each render belongs to exactly one
 * chapter, never paints over media/controls, and stops before the footer.
 * No canvas, script or additional motion.
 */
body.home {
  --home-spatial-surface: #060809;
  --home-spatial-footer: #030405;
  --home-blackroom-text-muted: #7e898e;
  --home-blackroom-link: #a4adb1;
  background-color: var(--home-spatial-footer);
}

body.home .site-content {
  overflow-x: clip;
  background-color: var(--home-spatial-surface);
}

body.home .entry-content {
  position: relative;
  isolation: isolate;
  background-color: var(--home-spatial-surface);
}

body.home .entry-content > * {
  position: relative;
  z-index: 1;
}

/* The parent theme prints the page title between the Hero Reel and Home body. */
body.home .entry-title {
  display: none;
}

/*
 * The chapter cards share the exact commerce width used by the Shop grid:
 * 1140px maximum with 60px viewport gutters below that cap.
 */
body.home .entry-content > .wp-block-media-text.alignwide {
  width: min(1140px, calc(100vw - 120px));
  margin-inline: auto;
}

/* Mobile: match the navbar capsule (80% viewport width, 10% side gutters) so
 * Home panels align with the menu edges; measured 41.2px per side at 412px. */
@media (max-width: 700px) {
  body.home .entry-content > .wp-block-media-text.alignwide {
    width: min(1140px, 80vw);
  }

  body.home
    .entry-content
    > .wp-block-media-text.alignwide
    > .wp-block-media-text__content {
    padding-inline: 0;
  }
}

/* Keep only intentional chapter pauses; the original 100–150px gaps dragged. */
body.home
  .entry-content
  > .t3x2r-accordion-gallery
  + .wp-block-spacer:has(+ .wp-block-media-text) {
  height: clamp(72px, 6vw, 88px) !important;
}

body.home
  .entry-content
  > .wp-block-media-text
  + .wp-block-spacer:has(+ .wp-block-media-text) {
  height: clamp(56px, 5vw, 72px) !important;
}

/*
 * Chapter renders. Every host gets its own bounded ::before; the background
 * never overflows the chapter box, so media and copy always paint above it.
 * Order: FBM object -> FBM field -> Crackle left -> Crackle right -> FBM object
 * -> FBM field -> Crackle left -> Crackle right (footer is the hard limit).
 */
body.home .entry-content > .wp-block-media-text {
  position: relative;
  z-index: 0;
}

body.home .entry-content > .wp-block-media-text::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  left: 50%;
  width: 100vw;
  transform: translateX(-50%);
  background-repeat: no-repeat;
  background-size: 100% auto;
  pointer-events: none;
  -webkit-mask-image:
    linear-gradient(105deg, transparent 1%, #000 25%, #000 77%, transparent 99%),
    linear-gradient(to bottom, transparent, #000 22%, #000 78%, transparent);
  -webkit-mask-composite: source-in;
  mask-image:
    linear-gradient(105deg, transparent 1%, #000 25%, #000 77%, transparent 99%),
    linear-gradient(to bottom, transparent, #000 22%, #000 78%, transparent);
  mask-composite: intersect;
}

/* 1 - Visuals in Ableton Live: FBM object. */
body.home
  .entry-content
  > .wp-block-media-text:has(.t3x2r-device-circle)::before {
  background-image: url("../images/home-spatial-object.webp");
  background-position: 50% 55%;
  opacity: 0.16;
}

/* 3 - Real-Time Visual Rendering: FBM field. */
body.home
  .entry-content
  > .t3x2r-accordion-gallery
  + .wp-block-spacer
  + .wp-block-media-text::before {
  background-image: url("../images/home-spatial-field.webp");
  background-position: 50% 30%;
  opacity: 0.18;
}

/* 4 - Visuals for Live Performance: Crackle left. */
body.home
  .entry-content
  > .t3x2r-accordion-gallery
  + .wp-block-spacer
  + .wp-block-media-text
  + .wp-block-spacer
  + .wp-block-media-text::before {
  background-image: url("../images/home-spatial-crackle-left.webp");
  background-position: 50% 50%;
  opacity: 0.16;
}

/* 5 - Native Audio-Reactive Modulation: Crackle right. */
body.home
  .entry-content
  > .t3x2r-accordion-gallery
  + .wp-block-spacer
  + .wp-block-media-text
  + .wp-block-spacer
  + .wp-block-media-text
  + .wp-block-spacer
  + .wp-block-media-text::before {
  background-image: url("../images/home-spatial-crackle-right.webp");
  background-position: 50% 50%;
  opacity: 0.16;
}

/* 6 - MIDI Control and Parameter Banks: FBM object. */
body.home
  .entry-content
  > .t3x2r-accordion-gallery
  + .wp-block-spacer
  + .wp-block-media-text
  + .wp-block-spacer
  + .wp-block-media-text
  + .wp-block-spacer
  + .wp-block-media-text
  + .wp-block-spacer
  + .wp-block-media-text::before {
  background-image: url("../images/home-spatial-object.webp");
  background-position: 50% 55%;
  opacity: 0.16;
}

/*
 * 7 - Best Selling Devices: FBM field. The commerce group keeps the render
 * bounded; covers, cards and headings above it stay in a higher level.
 */
body.home
  .entry-content
  > .wp-block-group.alignfull:has(+ .wp-block-cover) {
  position: relative;
  z-index: 0;
}

body.home
  .entry-content
  > .wp-block-group.alignfull:has(+ .wp-block-cover)::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  left: 50%;
  width: 100vw;
  transform: translateX(-50%);
  background-image: url("../images/home-spatial-field.webp");
  background-repeat: no-repeat;
  background-position: 50% 45%;
  background-size: 100% auto;
  opacity: 0.12;
  pointer-events: none;
  -webkit-mask-image:
    linear-gradient(to bottom, transparent, #000 18%, #000 82%, transparent);
  mask-image:
    linear-gradient(to bottom, transparent, #000 18%, #000 82%, transparent);
}

body.home
  .entry-content
  > .wp-block-group.alignfull:has(+ .wp-block-cover)
  ~ .wp-block-cover,
body.home
  .entry-content
  > .wp-block-group.alignfull:has(+ .wp-block-cover)
  ~ .wp-block-heading,
body.home
  .entry-content
  > .wp-block-group.alignfull:has(+ .wp-block-cover)
  ~ .wp-block-group {
  position: relative;
  z-index: 1;
}

/* 8 - Features: Crackle left, bounded by the actual Features group. */
body.home
  .entry-content
  > .wp-block-heading
  + .wp-block-spacer
  + .wp-block-group {
  position: relative;
  z-index: 1;
}

body.home
  .entry-content
  > .wp-block-heading
  + .wp-block-spacer
  + .wp-block-group::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  left: 50%;
  width: 100vw;
  transform: translateX(-50%);
  background-image: url("../images/home-spatial-crackle-left.webp");
  background-repeat: no-repeat;
  background-position: 50% 45%;
  background-size: 100% auto;
  opacity: 0.14;
  pointer-events: none;
  -webkit-mask-image:
    linear-gradient(to bottom, transparent, #000 20%, #000 80%, transparent);
  mask-image:
    linear-gradient(to bottom, transparent, #000 20%, #000 80%, transparent);
}

/*
 * 9 - Closing Crackle right. As an entry-content background layer it is
 * anchored to bottom: 0 and therefore cannot paint inside the following footer.
 */
body.home .entry-content::after {
  content: "";
  position: absolute;
  z-index: 0;
  right: auto;
  bottom: 0;
  left: 50%;
  width: 100vw;
  height: clamp(280px, 28vw, 440px);
  transform: translateX(-50%);
  background-image: url("../images/home-spatial-crackle-right.webp");
  background-repeat: no-repeat;
  background-position: 50% 100%;
  background-size: 100% auto;
  opacity: 0.14;
  pointer-events: none;
  -webkit-mask-image:
    linear-gradient(to bottom, transparent, #000 25%, #000 80%, transparent);
  mask-image:
    linear-gradient(to bottom, transparent, #000 25%, #000 80%, transparent);
}

/*
 * Footer: a colder, deeper register with deliberately quieter typography.
 * This is Home-only because this stylesheet is enqueued only on the front page.
 */
body.home #colophon.site-footer {
  border-top-color: rgba(137, 177, 194, 0.09);
  background-color: var(--home-spatial-footer);
  color: var(--home-blackroom-text-muted);
}

body.home #colophon .widget,
body.home #colophon .widget p {
  color: var(--home-blackroom-text-muted);
}

body.home #colophon .widget a {
  color: var(--home-blackroom-link);
}

body.home #colophon .widget a:hover,
body.home #colophon .widget a:focus-visible {
  color: #c8d0d3;
}

body.home #colophon .wp-block-social-link {
  background-color: #080a0b;
  color: #788388;
}

body.home #colophon .wp-block-separator,
body.home #colophon .site-footer-separator {
  border-color: rgba(137, 177, 194, 0.09);
  background-color: rgba(137, 177, 194, 0.09);
  color: rgba(137, 177, 194, 0.09);
}

@media (max-width: 700px) {
  body.home
    .entry-content
    > .wp-block-media-text:has(.t3x2r-device-circle)::before {
    background-position: 50% 62%;
    background-size: auto 85%;
    opacity: 0.12;
  }

  body.home
    .entry-content
    > .t3x2r-accordion-gallery
    + .wp-block-spacer
    + .wp-block-media-text::before {
    background-position: 50% 12%;
    opacity: 0.14;
  }

  body.home .entry-content > .wp-block-media-text::before {
    background-position: 50% 50%;
  }

}

@media (forced-colors: active) {
  body.home,
  body.home .site-content,
  body.home .entry-content,
  body.home #colophon.site-footer {
    background: Canvas;
    color: CanvasText;
  }

  body.home .entry-content > .wp-block-media-text::before,
  body.home
    .entry-content
    > .wp-block-group.alignfull:has(+ .wp-block-cover)::before,
  body.home
    .entry-content
    > .wp-block-heading
    + .wp-block-spacer
    + .wp-block-group::before,
  body.home .entry-content::after {
    content: none;
  }
}
