:root {
      --story-bg: #080b22;
      --story-card: rgba(255, 255, 255, 0.065);
      --story-line: rgba(221, 236, 255, 0.14);
      --story-muted: #c8ccee;
      --story-text: #f7f8ff;
      --story-gold: #ffd27a;
      --story-amber: #ffb95c;
      --story-violet: #a983ff;
      --story-teal: #63f2ff;
      --story-blue: #6af2ff;
    }

    body {
      background:
        radial-gradient(circle at 12% 8%, rgba(255, 210, 122, 0.11), transparent 28%),
        radial-gradient(circle at 76% 18%, rgba(169, 131, 255, 0.18), transparent 30%),
        radial-gradient(circle at 48% 74%, rgba(99, 242, 255, 0.08), transparent 30%),
        linear-gradient(180deg, #07091e 0%, #10143b 48%, #07091f 100%);
      color: var(--story-text);
    }

    .story-header {
      position: sticky;
      top: 0;
      z-index: 50;
      background: rgba(6, 9, 27, 0.82);
      backdrop-filter: blur(18px);
      -webkit-backdrop-filter: blur(18px);
      border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }

    .story-nav {
      max-width: 1180px;
      margin: 0 auto;
      padding: 16px 22px;
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 20px;
    }

    .story-brand {
      display: inline-flex;
      align-items: center;
      gap: 10px;
      color: #fff;
      text-decoration: none;
      font-weight: 900;
      letter-spacing: -0.03em;
    }

    .story-brand img {
      width: 34px;
      height: 34px;
      object-fit: contain;
    }

    .story-nav-links {
      display: flex;
      gap: 18px;
      align-items: center;
      flex-wrap: wrap;
      font-size: 0.92rem;
    }

    .story-nav-links a {
      color: rgba(244, 248, 255, 0.78);
      text-decoration: none;
      font-weight: 700;
    }

    .story-nav-links a:hover {
      color: var(--story-gold);
    }

    .story-shell {
      width: min(1120px, calc(100% - 40px));
      margin: 0 auto;
    }

    .story-hero {
      padding: clamp(54px, 8vw, 92px) 0 42px;
      display: grid;
      grid-template-columns: minmax(0, 0.88fr) minmax(430px, 1.12fr);
      gap: clamp(2rem, 4vw, 4.5rem);
      align-items: center;
    }

    .story-kicker {
      display: inline-flex;
      align-items: center;
      gap: 9px;
      color: var(--story-gold);
      text-transform: uppercase;
      font-size: 0.82rem;
      font-weight: 900;
      letter-spacing: 0.18em;
      margin-bottom: 20px;
    }

    .story-kicker::before {
      content: "";
      width: 9px;
      height: 9px;
      border-radius: 999px;
      background: var(--story-gold);
      box-shadow: 0 0 22px rgba(255, 210, 122, 0.86);
    }

    .story-hero h1 {
      font-family: "Space Grotesk", Inter, system-ui, sans-serif;
      font-size: clamp(2.75rem, 6vw, 5rem);
      line-height: 1.05;
      letter-spacing: -0.045em;
      margin: 0 0 24px;
    }

    .story-gradient {
  background: linear-gradient(90deg, #fff, var(--teal), var(--violet), var(--pink));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

    .story-subtitle {
      color: var(--story-muted);
      font-size: clamp(1.06rem, 1.6vw, 1.32rem);
      line-height: 1.65;
      max-width: 680px;
      margin: 0 0 28px;
    }

    .story-quote-line {
      margin: 24px 0 0;
      padding: 20px 22px;
      border-left: 3px solid var(--story-gold);
      background: rgba(255, 210, 122, 0.08);
      color: #fff7e9;
      border-radius: 0 20px 20px 0;
      font-size: 1.08rem;
      line-height: 1.55;
      font-weight: 750;
    }

    .story-actions {
      display: flex;
      flex-wrap: wrap;
      gap: 12px;
      margin-top: 30px;
    }

    .story-btn {
      display: inline-flex;
      justify-content: center;
      align-items: center;
      min-height: 48px;
      padding: 0 18px;
      border-radius: 999px;
      text-decoration: none;
      font-weight: 900;
      border: 1px solid rgba(255, 255, 255, 0.14);
    }

    .story-btn.primary {
      color: #0f1128;
      background: linear-gradient(90deg, #ffd27a, #ffe6ad);
      box-shadow: 0 16px 40px rgba(255, 210, 122, 0.18);
    }

    .story-btn.secondary {
      color: #f5f9ff;
      background: rgba(255, 255, 255, 0.075);
    }

    .story-cover {
      position: relative;
      width: 100%;
      max-width: 680px;
      justify-self: end;
      aspect-ratio: 3 / 2;
      border-radius: 34px;
      overflow: hidden;
      background: rgba(255, 255, 255, 0.06);
      border: 1px solid rgba(255, 255, 255, 0.14);
      box-shadow: 0 28px 90px rgba(0, 0, 0, 0.42);
    }

    .story-cover img {
      display: block;
      width: 100%;
      height: 100%;
      min-height: 0;
      object-fit: cover;
      object-position: center center;
    }

    .story-cover-wide {
      max-width: 760px;
    }

    .story-meta-strip {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 12px;
      margin: 22px 0 60px;
    }

    .story-meta-strip span {
      min-height: 82px;
      padding: 18px;
      border-radius: 24px;
      background: var(--story-card);
      border: 1px solid var(--story-line);
      color: var(--story-muted);
      line-height: 1.35;
    }

    .story-meta-strip strong {
      display: block;
      color: #fff;
      margin-bottom: 5px;
      font-size: 0.92rem;
    }

    .story-layout {
      display: grid;
      grid-template-columns: minmax(0, 1fr) 290px;
      gap: 44px;
      align-items: start;
      padding-bottom: 80px;
    }

    .story-content {
      display: grid;
      gap: 28px;
    }

    .story-section {
      padding: clamp(28px, 4vw, 48px);
      border-radius: 32px;
      background:
        radial-gradient(circle at top right, rgba(255, 210, 122, 0.08), transparent 34%),
        radial-gradient(circle at bottom left, rgba(169, 131, 255, 0.10), transparent 34%),
        rgba(255, 255, 255, 0.052);
      border: 1px solid rgba(255, 255, 255, 0.11);
      box-shadow: 0 20px 70px rgba(0, 0, 0, 0.20);
    }

    .story-section h2 {
      font-family: "Space Grotesk", Inter, system-ui, sans-serif;
      font-size: clamp(2rem, 4.4vw, 3.45rem);
      line-height: 1.02;
      letter-spacing: -0.055em;
      margin: 0 0 20px;
    }

    .story-section p {
      color: rgba(231, 239, 255, 0.86);
      font-size: 1.05rem;
      line-height: 1.82;
      margin: 0 0 18px;
    }

    .story-section p:last-child {
      margin-bottom: 0;
    }

    .pull-signal {
      margin: 28px 0;
      padding: 24px;
      border-radius: 26px;
      background:
        linear-gradient(135deg, rgba(255, 210, 122, 0.14), rgba(169, 131, 255, 0.10));
      border: 1px solid rgba(255, 210, 122, 0.24);
      color: #ffffff;
      font-size: clamp(1.25rem, 2vw, 1.58rem);
      font-weight: 900;
      line-height: 1.34;
    }

    .signal-tools {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 14px;
      margin-top: 24px;
    }

    .signal-card {
      padding: 20px;
      border-radius: 24px;
      background: rgba(5, 10, 32, 0.42);
      border: 1px solid rgba(255, 255, 255, 0.12);
    }

    .signal-card h3 {
      margin: 0 0 12px;
      color: var(--story-gold);
      font-size: 0.95rem;
      letter-spacing: 0.1em;
      text-transform: uppercase;
    }

    .signal-card ul,
    .signal-card ol {
      margin: 0;
      padding-left: 20px;
      color: var(--story-muted);
      line-height: 1.62;
    }

    .signal-card li {
      margin-bottom: 8px;
    }

    .story-side {
      position: sticky;
      top: 94px;
      display: grid;
      gap: 16px;
    }

    .side-card {
      padding: 22px;
      border-radius: 26px;
      background: rgba(255, 255, 255, 0.064);
      border: 1px solid rgba(255, 255, 255, 0.12);
    }

    .side-card h3 {
      margin: 0 0 12px;
      font-size: 1.04rem;
    }

    .side-card p,
    .side-card a {
      color: var(--story-muted);
      line-height: 1.55;
      font-size: 0.94rem;
    }

    .side-card a {
      display: block;
      text-decoration: none;
      margin: 9px 0;
    }

    .side-card a:hover {
      color: var(--story-gold);
    }

    .signal-pill-list {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      margin-top: 14px;
    }

    .signal-pill-list span {
      padding: 8px 10px;
      border-radius: 999px;
      background: rgba(255, 210, 122, 0.09);
      border: 1px solid rgba(255, 210, 122, 0.16);
      color: #fff3d7;
      font-size: 0.78rem;
      font-weight: 800;
    }

    .story-ending {
      margin: 32px 0 96px;
      padding: clamp(34px, 6vw, 64px);
      border-radius: 38px;
      background:
        radial-gradient(circle at top, rgba(255, 210, 122, 0.16), transparent 35%),
        linear-gradient(135deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.04));
      border: 1px solid rgba(255, 255, 255, 0.14);
      text-align: center;
    }

    .story-ending h2 {
      font-family: "Space Grotesk", Inter, system-ui, sans-serif;
      font-size: clamp(2.2rem, 6vw, 5rem);
      line-height: 0.96;
      letter-spacing: -0.07em;
      margin: 0 0 18px;
    }

    .story-ending p {
      max-width: 780px;
      margin: 0 auto 26px;
      color: var(--story-muted);
      font-size: 1.12rem;
      line-height: 1.72;
    }

    .story-footer {
      padding: 34px 22px;
      border-top: 1px solid rgba(255, 255, 255, 0.08);
      color: rgba(255, 255, 255, 0.58);
      text-align: center;
      font-size: 0.92rem;
    }

    @media (max-width: 980px) {
      .story-hero,
      .story-layout {
        grid-template-columns: 1fr;
      }

      .story-side {
        position: static;
        grid-template-columns: repeat(2, 1fr);
      }

      .story-meta-strip {
        grid-template-columns: repeat(2, 1fr);
      }
    }

    @media (max-width: 680px) {
      .story-shell {
        width: min(100% - 26px, 1120px);
      }

      .story-nav {
        align-items: flex-start;
        flex-direction: column;
      }

      .story-nav-links {
        gap: 12px;
      }

      .story-meta-strip,
      .signal-tools,
      .story-side {
        grid-template-columns: 1fr;
      }

      .story-section {
        border-radius: 26px;
      }

      .story-cover {
        border-radius: 26px;
      }
    }


/* =========================================================
   Shared VS Story Header
   Uses the same logo lockup logic as VibeQuest pages.
========================================================= */
.story-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(6, 9, 27, 0.82);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.story-nav {
  max-width: 1180px;
  margin: 0 auto;
  padding: 16px 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.story-brand.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 220px;
  color: var(--story-text, #f5f7ff);
  text-decoration: none;
  flex-shrink: 0;
  letter-spacing: 0;
}

.story-brand.brand .brand-logo-icon {
  width: 56px;
  height: 56px;
  object-fit: contain;
  flex-shrink: 0;
  filter:
    drop-shadow(0 0 10px rgba(82,255,224,.14))
    drop-shadow(0 0 16px rgba(185,150,255,.08));
}

.story-brand.brand .brand-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  line-height: 1;
}

.story-brand.brand .brand-text {
  display: block;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 1.32rem;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1;
  color: var(--story-text, #f5f7ff);
}

.story-brand.brand .brand-sub {
  display: block;
  color: var(--story-muted, #c9d2ee);
  font-size: .82rem;
  font-weight: 400;
  margin-top: 2px;
  letter-spacing: 0;
  line-height: 1.1;
  text-transform: none;
}

.story-brand.brand .gradient-text-q {
  background: linear-gradient(
    135deg,
    #DDFBFF 15%,
    #42E8FF 30%,
    #4B5CFF 45%,
    #FF4FD8 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.story-brand.brand .gradient-text-t {
  background: linear-gradient(
    90deg,
    #FFFFFF 0%,
    #FFFFFF 13%,
    #DDFBFF 35%,
    #6AF2FF 58%,
    #8A5CFF 78%,
    #FF7BE5 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.story-nav-links a:hover,
.story-nav-links a[aria-current="page"] {
  color: var(--story-teal, #6af2ff);
}

@media (max-width: 760px) {
  .story-nav {
    align-items: flex-start;
    flex-direction: column;
  }

  .story-brand.brand {
    min-width: 0;
  }

  .story-brand.brand .brand-logo-icon {
    width: 50px;
    height: 50px;
  }

  .story-brand.brand .brand-sub {
    display: block;
  }

  .story-nav-links {
    gap: 12px;
  }
}

/* Story-page active sidebar and reading progress */
.story-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  transform: scaleX(0);
  transform-origin: left center;
  z-index: 9999;
  background: linear-gradient(90deg, var(--story-teal), var(--story-gold), var(--story-violet));
  box-shadow: 0 0 18px rgba(99, 242, 255, 0.45);
  pointer-events: none;
}

.story-side a.is-active {
  color: var(--story-gold);
  font-weight: 900;
}

/* Website hero gradient helper — mirrored for VS pages */
.gradient-text {
  background: linear-gradient(90deg, #fff, var(--teal), var(--violet), var(--pink));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

/* Sidebar CTA button fix: keep story buttons compact and centred */
.side-card a.story-btn,
.side-card .story-btn {
  display: inline-flex;
  width: auto;
  min-width: 0;
  max-width: max-content;
  min-height: 42px;
  padding: 0 18px;
  margin-top: 12px;
  margin-bottom: 0;
  align-items: center;
  justify-content: center;
  line-height: 1;
  text-align: center;
  border-radius: 999px;
  font-size: 0.92rem;
  white-space: nowrap;
}

.side-card a.story-btn.primary,
.side-card .story-btn.primary {
  color: #0f1128;
}

.story-ending .story-actions .story-btn {
  min-height: 46px;
  align-items: center;
  justify-content: center;
}

/* VS hero title size — match homepage hero */
.story-hero h1 {
  font-size: clamp(2.75rem, 6vw, 5rem);
  line-height: 1.05;
  letter-spacing: -0.045em;
}

@media (max-width: 680px) {
  .story-hero h1 {
    font-size: clamp(2rem, 12vw, 3.5rem);
  }
}


/* =========================================================
   Book Mode mobile turn controls
   On mobile, hide side arrows and use compact bottom controls.
========================================================= */
.book-mobile-turn-row {
  display: none;
}

@media (max-width: 920px) {
  .book-stage {
    grid-template-columns: 1fr !important;
  }

  .book-nav-arrow {
    display: none !important;
  }

  .book-edge-control {
    display: none !important;
  }

  .book-bottom-controls {
    grid-template-columns: 1fr !important;
  }

  .book-mobile-turn-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .75rem;
    width: min(100%, 420px);
    justify-self: center;
  }

  .book-mobile-turn-row .book-control-pill {
    width: 100%;
    justify-self: stretch;
  }

  .book-mobile-turn-row .book-control-pill:disabled {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }
}

/* =========================================================
   Mobile VS hero image alignment
   Centre story cover images when the hero stacks on mobile/tablet.
========================================================= */
@media (max-width: 980px) {
  .story-cover {
    justify-self: center;
    margin-left: auto;
    margin-right: auto;
    width: min(100%, 680px);
  }
}

@media (max-width: 680px) {
  .story-cover {
    width: min(100%, 520px);
  }
}

/* =========================================================
   Vibe Story hero image 3D feature frame
   Appended override for .story-cover used by VS story pages.
   Keeps the image itself the same, but makes the frame feel
   more dimensional, elevated and VibeQ-branded.
========================================================= */
.story-cover {
  position: relative;
  overflow: visible;
  isolation: isolate;
  padding: 12px;
  border-radius: 34px;
  transform: perspective(1100px) rotateX(2deg) rotateY(-4deg);
  transform-style: preserve-3d;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, .22), rgba(106, 242, 255, .09) 38%, rgba(169, 131, 255, .18) 100%),
    linear-gradient(145deg, rgba(21, 40, 92, .96), rgba(8, 18, 50, .98));
  border: 1px solid rgba(154, 237, 255, .36);
  box-shadow:
    0 32px 76px rgba(0, 0, 0, .44),
    0 0 48px rgba(99, 242, 255, .18),
    0 0 90px rgba(169, 131, 255, .13),
    inset 0 1px 0 rgba(255, 255, 255, .34),
    inset 0 -18px 34px rgba(0, 0, 0, .22);
}

.story-cover::before {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  background:
    linear-gradient(135deg, rgba(255,255,255,.72), rgba(99,242,255,.24) 32%, rgba(169,131,255,.34) 68%, rgba(255,255,255,.16));
  opacity: .82;
  z-index: -1;
  filter: blur(.2px);
}

.story-cover::after {
  content: "";
  position: absolute;
  inset: 14px;
  border-radius: 25px;
  pointer-events: none;
  background:
    linear-gradient(135deg, rgba(255,255,255,.28), transparent 28%),
    radial-gradient(circle at 50% 0%, rgba(120, 246, 255, .22), transparent 48%);
  mix-blend-mode: screen;
  opacity: .55;
  z-index: 2;
}

.story-cover img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: cover;
  object-position: center center;
  border-radius: 24px;
  transform: translateZ(26px);
  box-shadow:
    0 18px 34px rgba(0, 0, 0, .34),
    0 0 28px rgba(98, 232, 255, .16);
}

.story-cover:hover {
  transform: perspective(1100px) rotateX(0deg) rotateY(-2deg) translateY(-4px);
}

@media (max-width: 760px) {
  .story-cover {
    padding: 9px;
    border-radius: 26px;
    transform: none;
  }

  .story-cover img {
    border-radius: 19px;
    transform: none;
  }

  .story-cover::after {
    inset: 10px;
    border-radius: 20px;
  }
}
