/* =========================================================
   REN & REMY'S — HOMEPAGE-SPECIFIC STYLES
   ---------------------------------------------------------
   Extracted from style.css to keep global styles lean.
   This file is loaded ONLY on pages with .home-page body class.
   ========================================================= */
:root {
  --pink: #E899F2;
  --cyan: #9BE2F2;
  --purple: #6D33A6;
  --ink: #0d0d0d;
  --ink-2: #1a1a1a;
  --ink-70: rgba(0, 0, 0, 0.70);
  --ink-50: rgba(0, 0, 0, 0.50);
  --white: #f2f2f2;
  /* Header height variable used by per-page styles */
  --site-header-height: 64px;

  /* Story color RGB tokens used for glows and alpha blends */
  --story-pink-rgb: 240,179,247; /* matches --pink */
  --story-cyan-rgb: 155,226,242; /* matches --cyan */
  --story-purple-rgb: 109,51,166; /* matches --purple (#6D33A6) */
  --story-white-rgb: 255,255,255;
}

/* ========== HERO SECTION ========== */
.hero {
  text-align: center;
  max-width: 80%;
  margin: calc(20vh + 1.5vh) auto 0;
}

.hero-subhead {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.hero h1 {
  margin: 0 0 8px;
}

.hero h2 {
  color: var(--cyan);
  font-family: var(--font-heading);
  font-size: var(--fs-lg);
  margin: 0 0 12px;
}

.hero .and-line {
  color: var(--white);
  font-family: var(--font-body);
  font-size: var(--fs-sub);
  font-weight: 400;
  margin: -4px 0;
}

.hero h3 {
  margin: 12px 0 24px;
  color: var(--pink);
  font-family: var(--font-body);
  font-size: var(--fs-2xl);
  line-height: var(--lh-tight);
  font-weight: 800;
}

.scalable {
  white-space: normal;
  display: inline-block;
  font-size: clamp(1rem, 5vw, 1.68rem) !important;
  line-height: 0.98;
  margin: 0;
}

.hero-subhead .scalable {
  font-size: clamp(0.9rem, 4vw, 1.4rem) !important;
  font-style: italic;
  font-weight: 400;
}

.scalable .line {
  display: block;
  margin: 0.06rem 0;
  padding: 0;
}

.scalable .and-line {
  color: var(--white);
  font-family: var(--font-body);
  font-size: 1.05em;
  font-weight: 400;
  line-height: 1.0;
  margin: 0.15rem 0;
  padding: 0.06rem 0;
}

/* Hero Rotator */
.hero-rotator {
  position: relative;
  width: 100%;
  min-height: 3em;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-rotator-line {
  position: absolute;
  width: 100%;
  text-align: center;
  opacity: 0;
  transition: opacity 0.6s ease-in-out, color 0.6s ease-in-out;
  pointer-events: none;
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: var(--lh-tight);
  font-weight: 800;
  font-style: normal;
  color: var(--pink);
}

.hero-rotator-line {
  z-index: 2;
}

.hero-rotator::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 35px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  z-index: 1;
  background: linear-gradient(90deg,
    rgba(13,13,13,0) 0%,
    rgba(13,13,13,0.45) 18%,
    rgba(13,13,13,0.45) 82%,
    rgba(13,13,13,0) 100%);
  border-radius: 6px;
}

@media (max-width: 640px) {
  .hero-rotator::before {
    height: 40px;
  }
}

.hero-rotator-line.active {
  opacity: 1;
  pointer-events: auto;
}

.hero-rotator-line.hidden {
  opacity: 0;
}

.hero-rotator-line.color-pink {
  color: var(--pink);
}

.hero-rotator-line.color-cyan {
  color: var(--cyan);
}

.hero-rotator-line.color-white {
  color: #f2f2f2;
}

/* ========== VIDEO CAROUSEL ========== */
.videos {
  padding: 10px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.video-carousel {
  position: relative;
  width: 80vw;
  max-width: 900px;
  margin: 10px auto;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to right, transparent 0%, black 8%, black 92%, transparent 100%);
  mask-image: linear-gradient(to right, transparent 0%, black 8%, black 92%, transparent 100%);
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-size: 100% 100%;
  mask-repeat: no-repeat;
  mask-size: 100% 100%;
}

.video-track {
  display: flex;
  transition: transform .5s ease;
  touch-action: pan-x;
}

.video-thumb {
  flex: 0 0 500px;
  width: 500px;
  margin-right: 20px;
  cursor: pointer;
  text-align: center;
  position: relative;
}

.video-thumb img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  border-radius: 12px;
  box-shadow: 0 0 15px rgba(0,0,0,.7);
  transition: transform .3s cubic-bezier(.4,0,.2,1);
}

.video-thumb:hover img {
  transform: scale(1.05);
}

.video-thumb::before {
  content: '';
  position: absolute;
  top: calc(50% - 10px);
  left: 50%;
  transform: translate(-50%,-50%);
  width: 0;
  height: 0;
  border-left: 30px solid rgba(255,255,255,.9);
  border-top: 18px solid transparent;
  border-bottom: 18px solid transparent;
  z-index: 10;
  transition: all .3s ease;
  pointer-events: none;
}

.video-thumb:hover::before {
  border-left-color: rgba(255,255,255,1);
  transform: translate(-50%,-50%) scale(1.1);
}

.video-thumb h4 {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(55% + 10px);
  transform: none;
  margin: 0;
  font-size: var(--fs-xs);
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #fff;
  padding: 8px 0;
  text-align: center;
  background: var(--pink);
  z-index: 5;
  transition: transform .3s cubic-bezier(.4,0,.2,1);
}

.video-thumb:hover h4 {
  transform: scale(1.05) translateY(4.5%);
}

/* Carousel arrows */
.carousel-arrow {
  position: absolute;
  top: 40%;
  transform: translateY(-50%);
  font-size: var(--fs-2xl);
  color: #fff;
  background: var(--ink-50);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  padding: 8px 14px;
  z-index: 20;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.carousel-arrow.left {
  left: 0;
}

.carousel-arrow.right {
  right: 0;
}

/* Mobile carousel */
.mobile-controls {
  display: none;
  justify-content: center;
  align-items: center;
  gap: 30px;
  margin: 6px 0 10px;
}

.mobile-controls button {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  font-size: var(--fs-lg);
  background: rgba(0,0,0,.70);
  color: var(--white);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

@media (max-width: 768px) {
  .video-carousel {
    width: 90vw;
    max-width: none;
    padding: 0 10px;
  }
  .carousel-arrow {
    display: none;
  }
  .mobile-controls {
    display: flex;
  }
  .video-thumb {
    flex: 0 0 80vw;
    width: 80vw;
    max-width: 880px;
    margin-right: 4vw;
  }
  .video-thumb h4 {
    font-size: .8rem;
  }
}

/* ========== HOME PAGE UTILITIES ========== */
.underline, .underline-tight {
  width: 80vw;
  max-width: 900px;
  height: 1px;
  background: var(--white);
}

.underline {
  margin: 44px auto 6px;
}

h2.tight {
  margin: 0;
}

.hero-ctas {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-top: 18px;
  flex-wrap: wrap;
}

.home-section {
  max-width: 1100px;
  margin: 30px auto;
  padding: 0 1rem;
}

/* Override for Events section to allow full-width 3D deck */
#events.home-section {
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 0;
  overflow: visible;
}

.home-section#app, #app {
  scroll-margin-top: 192px;
}

.home-section.tight {
  margin-bottom: 10px;
}

.home-section--narrow {
  max-width: 700px;
  margin: 0 auto 40px;
}

/* ========== PILLAR GRID + CARDS ========== */
.pillar-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-top: 12px;
  align-items: stretch;
}

#experience-teaser .pillar-grid {
  margin-bottom: 24px;
}

.pillar-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  flex: 1 1 calc(25% - 12px);
  max-width: calc(25% - 12px);
  min-width: 140px;
  background: rgba(0,0,0,0.6);
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.05);
}

.pillar-wrap .lightning-canvas {
  position: absolute;
  inset: -10px;
  z-index: 1;
  pointer-events: none;
}

#experience-teaser .pillar-grid {
  margin-bottom: 34px;
}

.pillar-card {
  box-sizing: border-box;
  flex: 1;
  width: 100%;
  height: 100%;
  background: transparent;
  border-radius: 12px;
  padding: 12px 12px 8px;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  position: relative;
  isolation: isolate;
  overflow: visible;
  z-index: 2;
}

.pillar-card .pillar-image {
  width: 100%;
  aspect-ratio: 3 / 2;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 8px;
  margin: 0;
  padding: 0;
}

.pillar-card .pillar-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  margin: 0;
  padding: 0;
}

.pillar-card .pill-blip {
  font-size: var(--fs-base);
  text-align: center;
  margin: 0 0 6px 0;
  padding: 0;
  width: 100%;
  box-sizing: border-box;
  max-width: 100% !important;
  display: block;
  align-self: stretch;
}

.pillar-card::before {
  content: "";
  position: absolute;
  inset: -10px;
  border-radius: 16px;
  border: none;
  box-shadow: none;
  opacity: 1;
  pointer-events: none;
}

.pillar-card.glow-fallback::before {
  border: 2px solid color-mix(in oklab, var(--elec-1, var(--cyan)) 70%, transparent);
  box-shadow:
    0 0 12px color-mix(in oklab, var(--elec-1, var(--cyan)) 80%, transparent),
    0 0 24px color-mix(in oklab, var(--elec-2, var(--pink)) 75%, transparent);
}

.pillar-card.glow-fallback:hover::before {
  animation: electric-flicker var(--pulse-speed, 0.9s) infinite;
  animation-delay: var(--pulse-delay, 0s);
}

@keyframes electric-flicker {
  0%   { opacity: 0.25; transform: translate(0,0); }
  10%  { opacity: 1;    transform: translate(1px,-1px); }
  22%  { opacity: 0.45; transform: translate(-1px,1px); }
  35%  { opacity: 1;    transform: translate(0,0); }
  55%  { opacity: 0.35; transform: translate(1px,0); }
  72%  { opacity: 0.95; transform: translate(0,-1px); }
  100% { opacity: 0.7;  transform: translate(0,0); }
}

@media (max-width: 768px) {
  .pillar-card::before {
    box-shadow: 0 0 12px rgba(0,0,0,0.35);
  }
  .pillar-card:hover::before {
    animation: electric-flicker var(--pulse-speed, 0.9s) infinite;
    animation-delay: var(--pulse-delay, 0s);
  }
  .pillar-wrap .lightning-canvas {
    display: none !important;
  }
}

.pillar-card h2 {
  margin: 0 0 6px 0;
  padding: 0;
  font-size: inherit;
  text-align: center;
}

@media (max-width: 1100px) {
  .pillar-wrap {
    flex: 1 1 48%;
    max-width: 48%;
  }
}

@media (max-width: 640px) {
  .pillar-wrap {
    flex: 1 1 100%;
    max-width: 100%;
    min-width: 0;
  }
}

/* ========== EXPERIENCE TILES ========== */
.experience-tiles {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
  margin: 18px 0 22px;
}

.experience-tile {
  flex: 1 1 260px;
  max-width: 340px;
  background: rgba(0,0,0,0.65);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.06);
}

.experience-tile img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
}

/* ========== SIMPLE UTILITIES ========== */
.text-center {
  text-align: center;
}

.mt-4 {
  margin-top: 16px;
}

.mt-2 {
  margin-top: 8px;
}

.mb-40 {
  margin-bottom: 40px;
}

/* ========== EVENTS LAYOUT ========== */
.event-row {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  justify-content: center;
  margin-top: 20px;
}

.event-image-left {
  flex: 1 1 260px;
  max-width: 340px;
}

.event-content-right {
  flex: 1 1 260px;
  max-width: 420px;
}

/* =========================================================
   SECTION 7 — Events Deck (Unified 3D Stack)
   ========================================================= */

/* Wrapper */
.events-deck-wrapper {
  max-width: 100vw;
  width: 100%;
  margin: 0;
  position: relative;
  padding: 140px 0; /* More vertical space for diagonal spread */
  perspective: var(--perspective, 1400px); /* Use variable from JS */
  perspective-origin: 50% 50%;
  transform-style: preserve-3d;
  transition: perspective 0.4s ease;
}

/* Deck Container */
.events-deck, .events-3d-stack {
  position: relative;
  width: 100%;
  display: block;
  transform-style: preserve-3d;
}

/* Base Card Styles (Mobile / Static / Fallback) */
.events-deck .event-card,
.events-3d-stack .event-card {
  --offsetY: 0px;
  --offsetZ: 0px;
  --rotate: 0deg;
  --rotateY: 0deg;
  --rotateX: 0deg;
  --scale: 1;
  --slideX: 0px;
  --fade: 1;
  box-sizing: border-box;
  width: 100%;
  max-width: min(600px, 90vw);
  height: auto;
  max-height: 400px;
  aspect-ratio: 3 / 2;
  margin: 12px auto;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  background: rgba(16,18,24,0.92);
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.06);
  box-shadow: none;
  overflow: hidden;
  position: relative;
  isolation: isolate;
  transform-origin: center center;
  transition: transform 0.7s cubic-bezier(.22,.9,.36,1), opacity 0.5s ease;
}

.events-deck .event-card .event-card-media,
.events-3d-stack .event-card .event-card-media {
  flex: 0 0 56%;
  max-width: 56%;
  height: 100%;
  aspect-ratio: 3 / 2;
  position: relative;
  overflow: hidden;
  background: #111;
}

.events-deck .event-card .event-card-media img,
.events-3d-stack .event-card .event-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.events-deck .event-card .event-card-body,
.events-3d-stack .event-card .event-card-body {
  flex: 1 1 44%;
  max-width: 44%;
  padding: 18px 18px 18px 16px;
  color: var(--white);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  min-width: 0;
}

.events-deck .event-card h3,
.events-3d-stack .event-card h3 {
  margin: 0 0 6px 0;
  font-family: var(--font-heading);
  font-size: var(--fs-lg);
  color: var(--cyan);
}

.events-deck .event-card p,
.events-3d-stack .event-card p {
  margin: 0 0 6px 0;
  color: rgba(255,255,255,0.92);
  font-size: var(--fs-base);
}

.events-deck .event-card .event-card-actions,
.events-3d-stack .event-card .event-card-actions { margin-top: 8px; }

/* When deck is active: cards center and become absolutely positioned */
#events.deck-active .events-3d-stack .event-card {
  position: absolute !important;
  top: 0;
  left: 50%;
  width: min(600px, 90vw);
  max-height: 400px;
  margin: 0 !important;
  transform: translateX(calc(-50% + var(--slideX))) translateY(var(--offsetY)) translateZ(var(--offsetZ)) rotate(var(--rotate)) rotateY(var(--rotateY)) rotateX(var(--rotateX)) scale(var(--scale));
  opacity: var(--fade);
  z-index: 1;
}

/* Active card glow and slight emphasis */
#events.deck-active .events-3d-stack .event-card.event-card--active {
  filter: none;
  box-shadow: none;
}

/* Non-active slightly dimmed */
#events.deck-active .events-3d-stack .event-card:not(.event-card--active) {
  filter: none;
}

/* Carousel motion via variables */
#events.deck-active .events-3d-stack .event-card.event-card--leaving-left {
  --slideX: -60%;
  --offsetY: -40px;
  --fade: 0;
}
#events.deck-active .events-3d-stack .event-card.event-card--leaving-right {
  --slideX: 60%;
  --offsetY: -40px;
  --fade: 0;
}
#events.deck-active .events-3d-stack .event-card.event-card--entering {
  --offsetY: 12px;
  --scale: 0.995;
  --fade: 0;
}

/* Controls */
.events-deck-controls {
  position: relative;
  margin-top: 32px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 40px; /* keep 30-50px spacing */
  pointer-events: none;
  z-index: 2000;
}
.events-deck-arrow {
  pointer-events: auto;
  position: relative;
  background: var(--ink-50);
  color: var(--white);
  border: none;
  border-radius: 999px;
  padding: 10px 14px;
  cursor: pointer;
  width: 56px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px rgba(0,0,0,0.6);
}

/* Disable 3D on small screens */
@media (max-width: 768px) {
  #events.deck-active,
  #events.deck-3d-disabled {
    perspective: none;
  }
  #events.deck-active .events-3d-stack .event-card,
  #events.deck-3d-disabled .events-3d-stack .event-card {
    position: relative !important;
    transform: none !important;
    opacity: 1 !important;
    width: 100% !important;
    max-width: 98vw !important;
    margin-bottom: 14px !important;
    left: auto !important;
  }
  .events-deck-controls { margin-top: 16px; gap: 12px; }
  .events-deck-arrow { top: auto; transform: none; left: auto; right: auto; }
  
  .events-deck .event-card,
  .events-3d-stack .event-card {
    flex-direction: column;
    max-width: 98vw;
    aspect-ratio: auto;
  }
  .events-deck .event-card .event-card-media,
  .events-3d-stack .event-card .event-card-media {
    width: 100%;
    max-width: 100%;
    aspect-ratio: 4/3;
    flex: none;
  }
  .events-deck .event-card .event-card-body,
  .events-3d-stack .event-card .event-card-body {
    width: 100%;
    max-width: 100%;
    flex: none;
  }
}

/* =========================================================
   HOMEPAGE — Header Fix Reinforcement
   Ensure the header stays fixed above effects introduced on this page.
   ========================================================= */
.home-page .site-header {
  position: fixed !important;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10050 !important; /* above content and 3D stack */
}
.home-page .header-blur-backdrop {
  position: fixed !important;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height, var(--site-header-height, 64px));
  z-index: 10000; /* beneath header chrome */
}

/* iOS/Safari: create its own layer to avoid compositing quirks */
.home-page .site-header, .home-page .header-blur-backdrop {
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
}


/* ========== HOMEPAGE SPECIFIC STYLES ========== */
.home-page .hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.home-page .hero-subhead {
  width: 100%;
  max-width: var(--container-max);
}

.home-page .hero-ctas {
  margin-top: 18px;
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
}

@media (max-width: 900px) {
  .home-page .hero-ctas {
    margin-top: 18px;
    flex-direction: column;
  }
}

@media (max-width: 520px) {
  .home-page .hero-ctas {
    margin-top: 16px;
  }
}

html:has(body.home-page), body.home-page {
  scroll-behavior: auto !important;
}

/* =========================================================
   SECTION 3 — Story Strip Styling (Aligned to Global Fonts)
   ========================================================= */

.story-strip {
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.story-strip .story-line {
  font-family: var(--font-body) !important;
  font-size: var(--fs-xs);
  line-height: var(--lh-base);
  color: var(--white);
  opacity: 0.88;
  margin: 1.2rem 0;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.story-strip .story-line.highlight {
  opacity: 1;
  color: var(--cyan);
  font-weight: 600;
  font-size: var(--fs-lg) !important;
  line-height: var(--lh-tight);
}

.story-strip .story-line {
  display: none;
  transform: translateY(8px);
  opacity: 0;
  transition: opacity 0.5s ease, transform 0.55s ease;
}

.story-strip .story-line.is-visible {
  display: block;
}

.story-strip .story-line.active {
  transform: translateY(0);
  opacity: 1;
}

.story-strip .story-line.exit {
  opacity: 0;
}

/* =========================================================
   SECTION 3 — Home Page Story Screen Effect
   ========================================================= */

body.home-page #what-is-ren-remys .story-screen-container {
  display: none;
  width: 100%;
  max-width: 900px;
  margin: -6rem auto -3.5rem;
  position: relative;
  justify-content: center;
  align-items: center;
}

body.home-page #what-is-ren-remys.story-screen-active .story-screen-container,
body.home-page #what-is-ren-remys.story-screen-complete .story-screen-container,
body.home-page #what-is-ren-remys.story-screen-initialized .story-screen-container {
  display: flex;
}

body.home-page #what-is-ren-remys .story-screen-border {
  width: auto;
  max-width: 900px;
  display: inline-flex;
  height: auto;
  min-height: 290px;
  background-color: transparent;
  border: 3px solid transparent;
  border-radius: 0;
  position: relative;
  overflow: visible;
  align-items: center;
  justify-content: center;
  padding: 2.2rem 2.4rem;
  opacity: 0; /* start hidden */
  transition: opacity 1000ms ease, box-shadow 0.4s ease, border-color 0.4s ease;
}

body.home-page #what-is-ren-remys.story-screen-static .story-screen-border,
body.home-page #what-is-ren-remys.story-screen-complete .story-screen-border {
  border-color: var(--cyan);
  box-shadow: 0 0 30px rgba(var(--story-cyan-rgb), 0.38);
  transition: box-shadow 0.2s ease;
}

/* Reveal rectangle container when marked visible */
body.home-page #what-is-ren-remys.rect-visible .story-screen-border {
    display: flex !important;
    opacity: 1 !important;
  opacity: 1;
}

@media (min-width: 701px) {
  body.home-page #what-is-ren-remys.story-screen-building .story-screen-border {
    height: 290px;
    min-height: 290px;
  }

  body.home-page #what-is-ren-remys.story-screen-static .story-screen-border,
  body.home-page #what-is-ren-remys.story-screen-complete .story-screen-border {
    height: auto;
    min-height: 290px;
  }
}

body.home-page #what-is-ren-remys .story-line-anim {
  position: absolute;
  background-color: rgba(var(--story-cyan-rgb), 1);
  box-shadow: 0 0 15px rgba(var(--story-cyan-rgb), 0.8);
  transition: background-color 0.45s ease, box-shadow 0.45s ease;
  opacity: 0;
  pointer-events: none;
  z-index: 10;
}

body.home-page #what-is-ren-remys .story-screen-border::before {
  content: "";
  position: absolute;
  inset: 3px;
  background: rgba(0,0,0,0.25);
  transform: scale(0, 0);
  transform-origin: center center;
  transition: transform 1s cubic-bezier(0.25, 1, 0.5, 1), background-color 0.45s ease, box-shadow 0.45s ease;
  border-radius: inherit;
  z-index: 0;
  pointer-events: none;
}

body.home-page #what-is-ren-remys.color-cyan .story-line-anim {
  background-color: rgba(var(--story-cyan-rgb), 1);
  box-shadow: 0 0 15px rgba(var(--story-cyan-rgb), 0.85);
}

body.home-page #what-is-ren-remys.color-cyan .story-screen-border {
  border-color: var(--cyan);
  box-shadow: 0 0 30px rgba(var(--story-cyan-rgb), 0.38);
  transition: box-shadow 0.45s ease, border-color 0.45s ease;
}

body.home-page #what-is-ren-remys.color-pink .story-line-anim {
  background-color: rgba(var(--story-pink-rgb), 1);
  box-shadow: 0 0 15px rgba(var(--story-pink-rgb), 0.85);
}

body.home-page #what-is-ren-remys.color-pink .story-screen-border {
  border-color: var(--pink);
  box-shadow: 0 0 30px rgba(var(--story-pink-rgb), 0.38);
  transition: box-shadow 0.45s ease, border-color 0.45s ease;
}

body.home-page #what-is-ren-remys.color-white .story-line-anim {
  background-color: rgba(var(--story-white-rgb), 1);
  box-shadow: 0 0 15px rgba(var(--story-white-rgb), 0.35);
}

body.home-page #what-is-ren-remys.color-white .story-screen-border {
  border-color: rgba(var(--story-white-rgb), 0.9);
  box-shadow: 0 0 30px rgba(var(--story-white-rgb), 0.18);
  transition: box-shadow 0.45s ease, border-color 0.45s ease;
}

body.home-page #what-is-ren-remys .story-screen-display {
  position: relative;
  z-index: 2;
}

body.home-page #what-is-ren-remys .story-screen-line {
  z-index: 3;
}

body.home-page #what-is-ren-remys .story-dots {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  z-index: 6;
  pointer-events: auto;
  opacity: 0; /* hidden until rectangle visible */
  visibility: hidden;
  transition: opacity 600ms ease; /* subtle fade */
}

body.home-page #what-is-ren-remys .story-speed-controls {
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  z-index: 7;
  pointer-events: auto;
  opacity: 0; /* hidden until rectangle visible */
  visibility: hidden;
  transition: opacity 1000ms ease;
}

/* Reveal pagination bullets and 1x/2x buttons when rectangle is visible */
body.home-page #what-is-ren-remys.rect-visible .story-dots,
body.home-page #what-is-ren-remys.rect-visible .story-speed-controls {
  opacity: 1;
  visibility: visible;
}

body.home-page #what-is-ren-remys .story-speed-controls .speed-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 22px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.95);
  font-weight: 700;
  font-size: var(--fs-xs);
  cursor: pointer;
  transition: background 180ms ease, transform 180ms ease, color 180ms ease;
  border: 1px solid rgba(255,255,255,0.06);
}

body.home-page #what-is-ren-remys .story-speed-controls .speed-btn.active {
  background: rgba(255,255,255,0.98);
  color: #0d0d0d;
  transform: scale(1.03);
}

body.home-page #what-is-ren-remys .story-speed-controls .speed-btn {
  font-family: var(--font2) !important;
  font-size: var(--fs-xs) !important;
}

body.home-page #what-is-ren-remys .story-dots .story-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.28);
  box-shadow: 0 1px 0 rgba(0,0,0,0.12) inset;
  transition: background 220ms ease, transform 220ms ease, opacity 220ms ease;
  opacity: 0.95;
}

body.home-page #what-is-ren-remys .story-dots .story-dot {
  cursor: pointer;
}

body.home-page #what-is-ren-remys .story-dots .story-dot.active {
  background: rgba(255,255,255,0.98);
  transform: scale(1.2);
  opacity: 1;
}

body.home-page #what-is-ren-remys .story-line-anim.top,
body.home-page #what-is-ren-remys .story-line-anim.bottom {
  height: 3px;
  width: 0;
  left: 50%;
  transform: translateX(-50%);
}

body.home-page #what-is-ren-remys .story-line-anim.top {
  top: 50%;
}

body.home-page #what-is-ren-remys .story-line-anim.bottom {
  bottom: 50%;
}

body.home-page #what-is-ren-remys .story-line-anim.left,
body.home-page #what-is-ren-remys .story-line-anim.right {
  width: 3px;
  height: 0;
  top: 50%;
  transform: translateY(-50%);
}

body.home-page #what-is-ren-remys .story-line-anim.left {
  left: 50%;
}

body.home-page #what-is-ren-remys .story-line-anim.right {
  right: 50%;
}

body.home-page #what-is-ren-remys.story-screen-building .story-line-anim {
  opacity: 1;
  transition: none;
}

body.home-page #what-is-ren-remys.story-screen-building .story-screen-border::before {
  transform: scale(1, 1);
}

body.home-page #what-is-ren-remys.story-screen-building .story-line-anim.top {
  width: 100%;
  top: 0;
  transition: width 1s cubic-bezier(0.25, 1, 0.5, 1), top 1s cubic-bezier(0.25, 1, 0.5, 1);
}

body.home-page #what-is-ren-remys.story-screen-building .story-line-anim.bottom {
  width: 100%;
  bottom: 0;
  transition: width 1s cubic-bezier(0.25, 1, 0.5, 1), bottom 1s cubic-bezier(0.25, 1, 0.5, 1);
}

body.home-page #what-is-ren-remys.story-screen-building .story-line-anim.left {
  height: 100%;
  left: 0;
  transition: height 1s cubic-bezier(0.25, 1, 0.5, 1), left 1s cubic-bezier(0.25, 1, 0.5, 1);
}

body.home-page #what-is-ren-remys.story-screen-building .story-line-anim.right {
  height: 100%;
  right: 0;
  transition: height 1s cubic-bezier(0.25, 1, 0.5, 1), right 1s cubic-bezier(0.25, 1, 0.5, 1);
}

body.home-page #what-is-ren-remys.story-screen-static .story-line-anim,
body.home-page #what-is-ren-remys.story-screen-complete .story-line-anim {
  opacity: 0;
  transition: opacity 0.4s ease 0.15s;
}

body.home-page #what-is-ren-remys.story-screen-static .story-screen-border::before,
body.home-page #what-is-ren-remys.story-screen-complete .story-screen-border::before {
  transform: scale(1, 1);
  transition: transform 0.2s ease;
}

body.home-page #what-is-ren-remys .story-screen-display {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

body.home-page #what-is-ren-remys.story-screen-static .story-screen-display,
body.home-page #what-is-ren-remys.story-screen-complete .story-screen-display {
  background: rgba(0,0,0,0.15);
}

body.home-page #what-is-ren-remys .story-screen-line {
  font-family: var(--font-body) !important;
  font-size: var(--fs-xs) !important;
  line-height: var(--lh-tight);
  font-weight: 700;
  position: absolute;
  inset: 25px 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  box-sizing: border-box;
  width: auto;
  height: auto;
  max-width: none;
  transform: none;
  opacity: 0;
  transition: opacity var(--story-transition, 600ms) ease, transform var(--story-transition, 600ms) ease;
  pointer-events: none;
  padding-bottom: 0;
}

body.home-page #what-is-ren-remys .story-screen-line .story-source {
  position: absolute;
  right: 32px;
  bottom: 30px;
  text-align: right;
  white-space: nowrap;
  font-size: calc(var(--fs-xs) * 0.88);
  opacity: 0.96;
  color: rgba(255,255,255,0.96);
  font-weight: 600;
  pointer-events: none;
  line-height: 1.12;
}

body.home-page #what-is-ren-remys .story-screen-line .story-text {
  display: inline-block;
  text-align: center;
  width: 100%;
}

body.home-page #what-is-ren-remys .legacy-story-lines .story-line {
  font-family: var(--font-body) !important;
  font-size: var(--fs-xs) !important;
  line-height: var(--lh-tight);
  font-weight: 700;
}

@media (max-width: 700px) {
  body.home-page #what-is-ren-remys .story-screen-line {
    padding-bottom: 110px;
  }
  body.home-page #what-is-ren-remys .story-screen-line .story-source {
    bottom: 45px;
    right: 24px;
    white-space: nowrap;
  }
}

body.home-page #what-is-ren-remys .story-screen-line.preload-center {
  opacity: 0 !important;
  transform: none !important;
  pointer-events: none !important;
}

body.home-page #what-is-ren-remys .story-screen-line.active {
  opacity: 1;
  pointer-events: auto;
  transform: none;
}

body.home-page #what-is-ren-remys .story-screen-line.exit {
  opacity: 0;
  transform: translateY(-12px);
}

body.home-page #what-is-ren-remys .color-pink {
  color: var(--pink);
}

body.home-page #what-is-ren-remys .color-cyan {
  color: var(--cyan);
}

body.home-page #what-is-ren-remys .color-white {
  color: var(--white);
}

body.home-page #what-is-ren-remys h2,
body.home-page #what-is-ren-remys .story-line {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

body.home-page #what-is-ren-remys {
  min-height: 30vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

body.home-page #what-is-ren-remys .story-screen-line.first-line-slow {
  transition: opacity calc(var(--story-transition, 600ms) * 2.9) ease-in-out, transform calc(var(--story-transition, 600ms) * 2.9) ease-in-out;
}

body.home-page #what-is-ren-remys .story-screen-line.first-line-slow.active {
  opacity: 1;
  transform: translateY(0);
}

body.home-page #what-is-ren-remys .story-screen-line.first-line-slow.exit {
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.story-source {
  font-size: var(--fs-sm) !important;
  line-height: 1.2;
  opacity: 0.96;
  color: rgba(255,255,255,0.96);
  font-weight: 600;
  display: inline-block;
}

body.home-page #what-is-ren-remys .highlight-cb,
body.home-page #what-is-ren-remys .legacy-story-lines .highlight-cb {
  transition: color 0.45s ease;
}

body.home-page #what-is-ren-remys .story-width-ghost {
  position: relative;
  visibility: hidden;
  white-space: nowrap;
  pointer-events: none;
  height: 0;
  overflow: hidden;
  max-width: 100%;
  font-family: var(--font-body) !important;
  font-weight: 700;
  font-size: var(--fs-xs) !important;
  line-height: var(--lh-tight);
}

.legacy-story-lines {
  position: absolute;
  left: -9999px;
  top: auto;
  height: 0;
  overflow: hidden;
  pointer-events: none;
  visibility: hidden;
}

body.home-page #what-is-ren-remys :not(.story-source) {
  font-size: var(--fs-xl) !important;
  line-height: var(--lh-tight) !important;
  font-family: var(--font-body) !important;
  font-weight: 700 !important;
}

body.home-page #what-is-ren-remys .story-screen-line,
body.home-page #what-is-ren-remys .legacy-story-lines .story-line,
body.home-page #what-is-ren-remys .story-width-ghost {
  font-family: var(--font-body) !important;
  font-size: var(--fs-xs) !important;
}

/* ========== RESPONSIVE TUNING ========== */
@media (max-width: 600px) {
  .hero {
    margin: calc(17vh + 1vh) auto 0;
  }
}

/* ============================================
   APP FEATURE PANEL (Homepage Section 6)
   ============================================ */
.app-reveal-heading,
.app-reveal-heading .app-heading-base,
.app-reveal-heading .app-heading-fill {
  font-family: var(--font1) !important;
  font-size: var(--fs-xl) !important;
  line-height: var(--lh-tight) !important;
}

.app-feature-content,
.app-feature-list,
.app-feature-list li,
.app-reveal-line,
.app-reveal-line .base,
.app-reveal-line .fill {
  font-family: var(--font2) !important;
  font-size: var(--fs-lg) !important;
  line-height: var(--lh-base) !important;
}
.app-feature-container {
  display: flex;
  align-items: center;
  gap: 3rem;
  padding: 3rem 2rem;
  background: rgba(0, 0, 0, 0.45); /* matches other sections */
  border-radius: 24px;
  backdrop-filter: blur(8px);
  margin-top: 2rem;
}

.app-feature-image {
  overflow: hidden;
  border-radius: 20px; /* keep container radius in sync with image */
}

.app-feature-image img {
  /* Keep images responsive but cap the visual height to 400px */
  max-height: 300px;
  width: auto;
  max-width: 100%;
  height: auto;
  border-radius: 20px;
  box-shadow: 0 0 12px rgba(155, 226, 242, 0.35);
  display: block;
  transition: opacity 420ms linear;
  will-change: opacity;
}

.app-feature-content {
  flex: 1;
}

.app-feature-list {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
}

.app-feature-list li {
  margin-bottom: 1.2rem;
  font-size: var(--fs-lg);
  line-height: var(--lh-base);
  position: relative;
  padding-left: 1.8rem;
}

/* Neon bullets */
.app-feature-list li::before {
  content: '⚡';
  position: absolute;
  left: 0;
  top: 0;
  color: var(--cyan);
  font-size: var(--fs-xl);
  line-height: 1;
}

/* =========================================================
   APP SECTION — Scroll-Synced Text Reveal
   ========================================================= */

/* Remove decorative neon bullets for the app reveal list only */
#app .app-feature-list li::before { display: none; }

#app .app-reveal-heading { position: relative; display: block; }
#app .app-reveal-heading h3 { position: relative; margin: 0; }
#app .app-reveal-heading .app-heading-base {
  display: block;
  color: rgba(255,255,255,0.05);
}
#app .app-reveal-heading .app-heading-fill {
  display: block;
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  overflow: hidden;
  color: var(--cyan);
  pointer-events: none;
  /* Default progress 0 */
  --appHeadingProgress: 0;
  /* fill height will be derived by inline style via JS or computed using the custom property below */
  height: calc(var(--appHeadingProgress) * 100%);
}

#app .app-feature-list { margin-top: 1rem; }
#app .app-feature-list li { position: relative; padding-left: 0; }
#app .app-reveal-line { position: relative; display: block; overflow: visible; }
#app .app-reveal-line .base {
  display: block;
  color: rgba(255,255,255,0.05);
}
#app .app-reveal-line .fill {
  display: block;
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 0%;
  overflow: hidden;
  color: var(--white);
  pointer-events: none;
  white-space: normal;
}

/* control the fill width via the --lineProgress custom property (0..1) */
#app .app-reveal-line { --lineProgress: 0; }
#app .app-reveal-line .fill {
  width: calc(var(--lineProgress, 0) * 100%);
}

/* Ensure responsive layout: block-level fills sized to container */
@media (max-width: 900px) {
  #app .app-feature-container { flex-direction: column; }
  #app .app-reveal-heading h3 { text-align: center; }
  #app .app-reveal-line { text-align: center; }
  #app .app-reveal-line .fill { left: 50%; transform: translateX(-50%); }
}

/* MOBILE */
@media (max-width: 900px) {
  .app-feature-container {
    flex-direction: column;
    text-align: center;
    padding: 2rem 1.5rem;
  }

  .app-feature-list li {
    padding-left: 0;
  }

  .app-feature-list li::before {
    display: none;
  }
}
