/* global.css — Template design system · Astro + Tailwind v4 (pure static SSG)
 * Dark mode + theme toggle, Baloo font, custom prose typography (accent line),
 * FAQ <details> accordion, star-burst animations, glowing play button, 3D cards,
 * back-to-top jelly. Brand color is the template "gothic blood-crimson" — re-skin via
 * the CSS custom properties in :root / .dark below. */





/* ── Design tokens (gothic blood-crimson palette, includes dark mode) ── */
:root {
  --background: #f3ede4;        /* warm bone / parchment */
  --surface: #ffffff;
  --surface-hover: #f6f0e7;
  --text-primary: #1b1714;      /* near-black warm */
  --text-secondary: #6a5e55;
  --border-color: #e6ddd0;
  --primary: #a50f1c;           /* blood crimson (light-mode contrast) */
  --brand-deep: #7a0c15;
  --accent: #9a7322;            /* muted amber */
  --font-baloo: "Baloo 2", ui-sans-serif, system-ui, sans-serif;

  /* logo wordmark: word 1 = crimson, word 2 = dark warm (readable on light parchment) */
  --logo-1-a: #c1121f;
  --logo-1-b: #9a0d18;
  --logo-2-a: #3a2f28;
  --logo-2-b: #5a4a3f;

  /* route map (light mode) — blends with the parchment page instead of a
     stark white card; tinted nodes + borders carry the structure */
  --rm-bg: var(--background);
  --rm-border: color-mix(in oklab, var(--primary) 18%, var(--border-color));
  --rm-spine: #c98ba0;
  --rm-node-bg: #f7f1e8;
  --rm-node-border: #e0d4c4;
  --rm-node-text: #4a4039;
  --rm-root-bg: #c1121f;  --rm-root-text: #ffffff; --rm-root-border: #8a0f1a;
  --rm-decay-bg: #d6eef2; --rm-decay-text: #0f5b6b; --rm-decay-border: #9ccdd6;
  --rm-burial-bg: #f6dde3; --rm-burial-text: #8a1f33; --rm-burial-border: #e0a9b8;
  --rm-choice-bg: #f2ece3; --rm-choice-text: #4a4039; --rm-choice-border: #ddcfbd;
  --rm-ending-bg: #f6edcf; --rm-ending-text: #8a6a12; --rm-ending-border: #e0c989;
  --rm-gameover-bg: #f7dcdf; --rm-gameover-text: #9a1222; --rm-gameover-border: #e6a9b0;
}

.dark {
  --background: #0e0d10;        /* near-black, slight warm */
  --surface: #18161c;
  --surface-hover: #221f27;
  --text-primary: #ece6dd;      /* bone / cream */
  --text-secondary: #a89c93;
  --border-color: #2c2832;
  --primary: #e5383b;           /* blood crimson, brightened for dark-bg text contrast (>=4.5:1) */
  --brand-deep: #8a0f1a;
  --accent: #cf9b3f;            /* muted amber */

  --logo-1-a: #e5383b;
  --logo-1-b: #c1121f;
  --logo-2-a: #f2ebdc;
  --logo-2-b: #d6cab2;

  --rm-bg: #14121a;
  --rm-border: #3a1f28;
  --rm-spine: #c78ea0;
  --rm-node-bg: #211d27;
  --rm-node-border: #3a343f;
  --rm-node-text: #d8cfc4;
  --rm-root-bg: #c1121f;  --rm-root-text: #ffffff; --rm-root-border: #8a0f1a;
  --rm-decay-bg: #0f2e36; --rm-decay-text: #8fd0dd; --rm-decay-border: #1d5663;
  --rm-burial-bg: #2a1017; --rm-burial-text: #e89aae; --rm-burial-border: #6e2233;
  --rm-choice-bg: #211d27; --rm-choice-text: #d8cfc4; --rm-choice-border: #3a343f;
  --rm-ending-bg: #2a2110; --rm-ending-text: #e9c772; --rm-ending-border: #6e561f;
  --rm-gameover-bg: #1a0608; --rm-gameover-text: #e8808c; --rm-gameover-border: #5e121b;
}

:root,.dark{--color-background:var(--background);--color-surface:var(--surface);--color-surface-hover:var(--surface-hover);--color-text-primary:var(--text-primary);--color-text-secondary:var(--text-secondary);--color-border-color:var(--border-color);--color-primary:var(--primary);--color-brand:var(--primary);--color-brand-deep:var(--brand-deep);--color-bg:var(--background);--color-fg:var(--text-primary);--color-muted:var(--text-secondary);--color-line:var(--border-color);--color-accent:var(--accent);--font-baloo:"Baloo 2",ui-sans-serif,system-ui,sans-serif;--font-sans:"Baloo 2",ui-sans-serif,system-ui,sans-serif;}

/* Theme transition — background/border only. NO color transition:
   interpolating text color between themes passes through an ugly
   mid-gray flash on large headings. Text color snaps instantly. */
* {
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

/* Logo wordmark gradient stops — driven by theme tokens so the second
   word stays readable on both light parchment and dark backgrounds */
.logo-grad-1-a { stop-color: var(--logo-1-a); }
.logo-grad-1-b { stop-color: var(--logo-1-b); }
.logo-grad-2-a { stop-color: var(--logo-2-a); }
.logo-grad-2-b { stop-color: var(--logo-2-b); }

html {
  line-height: 1.5;
  background: var(--background);
  color: var(--text-primary);
  font-family: var(--font-baloo), sans-serif;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--text-primary);
}

main {
  flex: 1 0 auto;
}

/* Layered so Tailwind utilities (text-*) can override the default link color.
   Unlayered rules always beat @layer utilities regardless of specificity. */
@layer base {
  a {
    color: var(--primary);
    text-decoration: none;
  }
  a:hover {
    text-decoration: underline;
  }
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Search input: remove UA square focus outline + browser autofill background */
.search-input:focus-visible {
  outline: none;
}
.search-input:-webkit-autofill,
.search-input:-webkit-autofill:hover,
.search-input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text-primary);
  -webkit-box-shadow: 0 0 0 1000px var(--background) inset;
  transition: background-color 9999s ease-in-out 0s;
}

/* ============================================================
   ARTICLE CONTENT TYPOGRAPHY (Custom Prose)
   ============================================================ */
.prose {
  color: var(--text-secondary);
  font-family: var(--font-baloo), sans-serif;
  font-size: 1.0625rem;
  line-height: 1.7;
  font-weight: 500;
  max-width: 1200px;
  margin-inline: auto;
  padding: 1.5rem 1rem;
}

.prose h1, .prose h2, .prose h3, .prose h4, .section-title {
  color: var(--text-primary);
  font-family: var(--font-baloo), sans-serif;
  font-weight: 800;
  margin-top: 2.5rem;
  margin-bottom: 1.25rem;
  line-height: 1.3;
}

.prose > *:first-child {
  margin-top: 0 !important;
}

.prose h1 { font-size: 1.875rem; }
.prose h2 {
  font-size: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--border-color);
  position: relative;
}
.prose h2::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 60px;
  height: 2px;
  background-color: var(--color-primary);
}

.prose h3 {
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.prose h3::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 1em;
  background-color: var(--color-primary);
  border-radius: 4px;
}

.prose p {
  margin-bottom: 1.5rem;
}

.prose ul, .prose ol {
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
}
.prose ul { list-style-type: disc; }
.prose ol { list-style-type: decimal; }
.prose li {
  margin-bottom: 0.625rem;
  padding-left: 0.25rem;
}
.prose li::marker {
  color: var(--color-primary);
  font-weight: bold;
}
.prose strong, .prose b {
  color: var(--text-primary);
  font-weight: 700;
}
.prose a {
  color: var(--color-primary);
  text-decoration: underline;
  text-underline-offset: 4px;
  transition: opacity 0.2s;
}
.prose a:hover { opacity: 0.8; }
.prose a.game-card-lift { text-decoration: none; color: inherit; }
.prose .hero-player-aspect a,
.prose .game-action-bar a,
.prose #share-modal a {
  text-decoration: none;
  color: inherit;
}
.prose img {
  border-radius: 8px;
  margin: 2rem 0;
  border: 1px solid var(--border-color);
}
.prose blockquote {
  border-left: 4px solid var(--border-color);
  padding: 0.5rem 0 0.5rem 1.5rem;
  margin: 1.5rem 0;
  font-style: italic;
  color: var(--text-primary);
  opacity: 0.9;
}

/* ============================================================
   TABLE STYLES
   ============================================================ */
.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  border: 1px solid var(--border-color);
}
.prose thead {
  background-color: var(--surface-hover);
  border-bottom: 2px solid var(--border-color);
}
.prose th {
  padding: 1rem;
  text-align: left;
  font-weight: 700;
  color: var(--text-primary);
}
.prose td {
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-secondary);
}
.prose tbody tr:last-child td { border-bottom: none; }

/* ============================================================
   FAQ ACCORDION STYLES (<details> & <summary>)
   ============================================================ */
.prose details {
  background-color: var(--surface-hover);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  margin-bottom: 1rem;
  overflow: hidden;
  transition: all 0.3s ease;
}
.prose details[open] {
  background-color: var(--surface);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  border-color: rgba(193, 18, 31, 0.3);
}
.prose summary {
  padding: 1.25rem;
  padding-right: 3rem;
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--text-primary);
  cursor: pointer;
  list-style: none;
  display: block;
  position: relative;
  transition: color 0.2s ease;
}
.prose summary::-webkit-details-marker { display: none; }
.prose summary::after {
  content: "+";
  font-size: 1.5rem;
  line-height: 1;
  font-weight: 300;
  color: var(--text-secondary);
  transition: transform 0.3s ease;
  position: absolute;
  right: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
}
.prose details[open] summary {
  color: var(--color-primary);
  border-bottom: 1px solid var(--border-color);
}
.prose details[open] summary::after {
  content: "−";
  color: var(--color-primary);
  transform: translateY(-50%) rotate(180deg);
}
.prose details > *:not(summary) {
  padding: 0 1.25rem 1.25rem 1.25rem;
  margin-top: 1.25rem;
  color: var(--text-secondary);
}
.prose details > *:not(summary):last-child { margin-bottom: 0; }

.prose summary .faq-question {
  display: inline;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
  color: inherit;
}
.prose summary .faq-question::before,
.prose summary .faq-question::after {
  display: none !important;
}

/* ============================================================
   STAR RATING ANIMATIONS
   ============================================================ */
@keyframes star-burst {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.5); opacity: 0.8; }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes particle-fade {
  0% { transform: translate(-50%, -50%) scale(0); opacity: 1; }
  100% { transform: translate(var(--tw-translate-x), var(--tw-translate-y)) scale(1); opacity: 0; }
}
.star-active-pulse { animation: star-burst 0.5s ease-out forwards; }
.burst-particle {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 4px;
  height: 4px;
  background: var(--color-primary);
  border-radius: 50%;
  pointer-events: none;
}

/* ============================================================
   PLAY BUTTON — crimson glow / breathing
   ============================================================ */
@keyframes aura-flow-zenith {
  0%, 100% {
    box-shadow: 0 0 14px 0px rgba(255, 255, 255, 0.8);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 20px 0px rgba(255, 255, 255, 1);
    transform: scale(1.02);
  }
}
@keyframes hover-glow-pulse-zenith {
  0%, 100% {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.6);
  }
  50% {
    transform: scale(1.08);
    box-shadow: 0 0 40px rgba(255, 255, 255, 1),
                0 8px 30px rgba(193, 18, 31, 0.5);
    filter: brightness(1.1);
  }
}
.play-btn-fx {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  height: 50px !important;
  padding: 0 32px !important;
  min-width: 106px;
  background-color: rgb(193, 18, 31) !important;
  border: none !important;
  border-radius: 16px !important;
  color: white !important;
  font-family: var(--font-baloo), sans-serif !important;
  font-size: 22px !important;
  font-weight: 700 !important;
  text-transform: none !important;
  cursor: pointer !important;
  position: relative;
  z-index: 20;
  transition: all 0.3s ease;
  animation: aura-flow-zenith 4s ease-in-out infinite;
  box-shadow: 0 0 16px 0px rgb(255, 255, 255);
}
.play-btn-fx::after {
  content: "" !important;
  display: block !important;
  position: absolute;
  bottom: 0.5px;
  left: 50%;
  transform: translateX(-50%);
  width: 54px;
  height: 6px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='54' height='6' viewBox='0 0 54 6'%3E%3Cpath d='M0%2C6 L54%2C6 L47.5%2C1 C46.8%2C0.3 45.8%2C0 44.8%2C0 L9.2%2C0 C8.2%2C0 7.2%2C0.3 6.5%2C1 L0%2C6 Z' fill='white'/%3E%3C/svg%3E") !important;
  background-size: 100% 100% !important;
  background-repeat: no-repeat !important;
  z-index: 1;
  pointer-events: none;
}
.play-btn-fx:hover {
  animation: hover-glow-pulse-zenith 1s ease-in-out infinite !important;
  background-color: rgb(193, 18, 31) !important;
}
.play-btn-fx span {
  position: relative;
  z-index: 10;
  pointer-events: none;
}

/* ============================================================
   BACK TO TOP / JELLY
   ============================================================ */
@keyframes gelatine {
  from, to { transform: scale(1, 1); }
  25% { transform: scale(0.9, 1.1); }
  50% { transform: scale(1.1, 0.9); }
  75% { transform: scale(0.95, 1.05); }
}
.animate-gelatine {
  animation: gelatine 0.5s cubic-bezier(0.51, 0.92, 0.24, 1.15) forwards;
}
@keyframes jelly-bounce {
  0% { transform: translateY(0) scale(1, 1); }
  8% { transform: translateY(-20px) scale(0.95, 1.05); }
  14% { transform: translateY(0) scale(1, 1); }
  16% { transform: translateY(0) scale(1.2, 0.8); }
  20% { transform: translateY(-8px) scale(0.95, 1.05); }
  24% { transform: translateY(0) scale(1.05, 0.95); }
  27% { transform: translateY(-3px) scale(0.98, 1.02); }
  30% { transform: translateY(0) scale(1, 1); }
  100% { transform: translateY(0) scale(1, 1); }
}
.animate-jelly-bounce {
  animation: jelly-bounce 3s infinite;
  transform-origin: bottom center;
}

#back-to-top {
  transition: transform 0.5s cubic-bezier(0.51, 0.92, 0.24, 1.15), opacity 0.3s ease;
}

/* ============================================================
   3D CARD FLIP / HOVER
   ============================================================ */
.card-3d-wrapper { perspective: 1000px; }
.card-3d-inner {
  transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  transform-style: preserve-3d;
}
.card-front, .card-back {
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.card-back { transform: rotateY(180deg); }
.is-flipped { transform: rotateY(180deg) !important; }

.game-card-lift {
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.game-card-lift:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 24px -8px rgba(193, 18, 31, 0.35);
  border-color: var(--primary);
}

/* ============================================================
   HERO PLAYER RESPONSIVE HEIGHT
   ============================================================ */
.hero-player-aspect { aspect-ratio: 3 / 4; }
@media (min-width: 640px) {
  .hero-player-aspect { aspect-ratio: 16 / 9; }
}

/* Utility: hide scrollbars */
.scrollbar-none::-webkit-scrollbar { display: none; }
.scrollbar-none {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* line-clamp fallback (Tailwind v4 may not include it by default) */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ============================================================
   TOC — right sticky "On this page" navigation (Toc.astro)
   ============================================================ */
.toc-article {
  max-width: none;
  margin-inline: 0;
}
.toc {
  width: 260px;
  flex-shrink: 0;
  align-self: flex-start;
  position: sticky;
  top: 84px;
  max-height: calc(100vh - 104px);
  overflow-y: auto;
  /* align "ON THIS PAGE" title with the article's first heading
     (.prose has 1.5rem top padding) */
  padding-top: 1.5rem;
  padding-left: 1.25rem;
  border-left: 1px solid var(--border-color);
}
.toc__title {
  font-family: var(--font-baloo), sans-serif;
  font-weight: 800;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}
.toc__nav {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}
.toc__link {
  display: block;
  padding: 0.3rem 0.6rem;
  font-size: 0.875rem;
  line-height: 1.4;
  color: var(--text-secondary);
  border-radius: 6px;
  border-left: 2px solid transparent;
  text-decoration: none;
  transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}
.toc__link:hover {
  color: var(--text-primary);
  background-color: var(--surface-hover);
}
.toc__link--sub {
  padding-left: 1.5rem;
  font-size: 0.82rem;
}
.toc__link.is-active {
  color: var(--color-primary);
  border-left-color: var(--color-primary);
  background-color: var(--surface-hover);
  font-weight: 600;
}

/* ============================================================
   HEADER ACTIVE NAV BAR — pseudo-element (minify-proof)
   ============================================================ */
.nav-active { position: relative; }
.nav-active::after {
  content: "";
  position: absolute;
  bottom: 4px;
  left: 12px;
  right: 12px;
  height: 2px;
  border-radius: 9999px;
  background-color: var(--color-primary);
}
.nav-active:hover {
  text-decoration: none;
}

/* ============================================================
   FAQ ACCORDION STYLES (<details> & <summary>) — ported from the-falsesun
   ============================================================ */
.prose details {
  background-color: var(--surface-hover);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  margin-bottom: 1rem;
  overflow: hidden;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}
.prose details[open] {
  background-color: var(--surface);
  box-shadow: 0 4px 14px -6px rgba(0, 0, 0, 0.18);
  border-color: color-mix(in oklab, var(--primary) 30%, var(--border-color));
}
.prose summary {
  padding: 1.1rem 3rem 1.1rem 1.25rem;
  font-weight: 700;
  font-size: 1.0625rem;
  line-height: 1.4;
  color: var(--text-primary);
  cursor: pointer;
  list-style: none;
  display: block;
  position: relative;
  transition: color 0.2s ease;
}
.prose summary::-webkit-details-marker { display: none; }
.prose summary::after {
  content: "+";
  font-size: 1.6rem;
  line-height: 1;
  font-weight: 300;
  color: var(--text-secondary);
  transition: transform 0.3s ease, color 0.3s ease;
  position: absolute;
  right: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
}
.prose details[open] summary {
  color: var(--primary);
  border-bottom: 1px solid var(--border-color);
}
.prose details[open] summary::after {
  content: "\2212"; /* minus sign */
  color: var(--primary);
  transform: translateY(-50%) rotate(180deg);
}
.prose details > *:not(summary) {
  padding: 0 1.25rem 1.25rem 1.25rem;
  margin-top: 1.1rem;
  color: var(--text-secondary);
}
.prose details > *:not(summary):last-child { margin-bottom: 0; }

/* FAQ question promoted to <h3> to keep heading levels correct while
   inheriting the summary's weight/size */
.prose summary .faq-question {
  display: inline;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
  color: inherit;
}
.prose summary .faq-question::before,
.prose summary .faq-question::after {
  display: none !important;
}

/* Light mode: an open FAQ card in pure white (--surface) is too stark against
   the parchment background — blend it toward the page tone instead.
   Dark mode keeps the original --surface lift (subtle, already dark). */
html:not(.dark) .prose details[open] {
  background-color: color-mix(in oklab, var(--surface) 40%, var(--background));
}


  .hero {
    position: relative;
    width: 100%;
    min-height: 72vh;
    padding: 2rem 1rem 2.5rem;
  }
  /* official screenshot backdrop, full-bleed across the viewport and near
     full-screen tall; fades to the page background at the bottom so it
     blends into the content below instead of ending on a hard edge.
     Split into two layers: the art on ::before (masked to zero alpha well
     before its own bottom edge — otherwise the last pixel row of the hero
     lets the dark image bleed through as a 1px seam in light mode), and
     the tint gradient on ::after, painted above the art. */
  .hero::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
    background-image: url('/_a/hero-bg.360e4222d3.webp');
    background-size: cover;
    background-position: center;
    -webkit-mask-image: linear-gradient(to bottom, black 55%, transparent 90%);
    mask-image: linear-gradient(to bottom, black 55%, transparent 90%);
    pointer-events: none;
  }
  .hero::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
    background-image: linear-gradient(
      to bottom,
      color-mix(in oklab, var(--surface) 30%, transparent) 0%,
      color-mix(in oklab, var(--surface) 52%, transparent) 42%,
      /* fade fully to transparent at the bottom — the photo (::before) is
         already masked to alpha 0 by 90%, so nothing needs hiding here,
         and leaving the seam as a transparent cut-out means it always shows
         the body background underneath. Painting var(--background) here
         instead made the bottom band snap to the new theme color instantly
         while the page body transitioned over 0.3s, causing a flicker at
         the hero/content seam on light/dark toggle. */
      transparent 100%
    );
    pointer-events: none;
  }
  .hero__inner {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin-inline: auto;
    display: grid;
    grid-template-columns: 1fr;
    gap: 2.5rem;
    align-items: start;
  }
  @media (min-width: 880px) {
    .hero__inner {
      grid-template-columns: 1.05fr 0.95fr;
      gap: 3.5rem;
    }
  }

  /* ── Left copy ── */
  .hero__badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.85rem 0.45rem 1rem;
    border-radius: 9999px;
    border: 1px solid var(--border-color);
    background: color-mix(in oklab, var(--primary) 10%, var(--surface));
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--primary);
  }
  .hero__badge-text {
    /* cancel the trailing letter-space after the last glyph so the
       text sits visually centered between dot and right padding */
    margin-right: -0.04em;
    line-height: 1;
  }
  .hero__badge-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 9999px;
    background: var(--primary);
    box-shadow: 0 0 8px var(--primary);
    /* nudge up to the optical center of the uppercase glyph
       (line-box center sits below the cap-height center) */
    transform: translateY(-0.06rem);
  }

  .hero__title {
    margin: 1.1rem 0 0;
    font-family: var(--font-baloo), sans-serif;
    font-weight: 800;
    font-size: clamp(1.9rem, 4.5vw, 3rem);
    line-height: 1.12;
    color: var(--text-primary);
    letter-spacing: -0.01em;
  }

  .hero__subtitle {
    margin: 1rem 0 0;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
  }
  .hero__lead {
    margin: 0.75rem 0 0;
    max-width: 52ch;
    color: var(--text-secondary);
    line-height: 1.6;
    font-size: 1rem;
  }

  .hero__cta {
    margin-top: 1.75rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
  }
  .hero__btn {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.8rem 1.4rem;
    border-radius: 12px;
    font-family: var(--font-baloo), sans-serif;
    font-weight: 700;
    font-size: 1rem;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease,
      border-color 0.18s ease;
  }
  .hero__icon {
    width: 1.15rem;
    height: 1.15rem;
  }
  .hero__btn--primary {
    background: var(--primary);
    color: #fff;
    border: 1px solid var(--brand-deep);
    box-shadow: 0 8px 22px -8px color-mix(in oklab, var(--primary) 70%, transparent);
  }
  .hero__btn--primary:hover {
    transform: translateY(-2px);
    background: var(--brand-deep);
    box-shadow: 0 12px 28px -8px color-mix(in oklab, var(--primary) 80%, transparent);
  }
  .hero__btn--ghost {
    /* frosted backing so the label stays readable over the hero photo */
    background: color-mix(in oklab, var(--background) 80%, transparent);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: var(--text-primary);
    border: 1px solid color-mix(in oklab, var(--text-primary) 35%, transparent);
  }
  .hero__btn--ghost:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
  }

  .hero__meta {
    margin: 1.25rem 0 0;
    font-size: 0.8rem;
    color: var(--text-secondary);
    opacity: 0.85;
  }

  /* ── Right poster card ── */
  .hero__visual {
    display: flex;
    justify-content: center;
    position: relative;
  }
  /* blood bleeding from the bottom edge of the poster card */
  .hero__visual::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: 240px;
    height: 52px;
    background-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20240%2052'%3E%3Crect%20x='40'%20y='0'%20width='4'%20height='21'%20fill='%23c1121f'/%3E%3Ccircle%20cx='42'%20cy='23'%20r='5'%20fill='%23c1121f'/%3E%3Crect%20x='92'%20y='0'%20width='3'%20height='34'%20fill='%23c1121f'/%3E%3Ccircle%20cx='93.5'%20cy='34'%20r='6'%20fill='%23c1121f'/%3E%3Crect%20x='148'%20y='0'%20width='4'%20height='18'%20fill='%23c1121f'/%3E%3Ccircle%20cx='150'%20cy='18'%20r='4.5'%20fill='%23c1121f'/%3E%3Crect%20x='196'%20y='0'%20width='3'%20height='28'%20fill='%23c1121f'/%3E%3Ccircle%20cx='197.5'%20cy='28'%20r='5.5'%20fill='%23c1121f'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center top;
    background-size: 240px 52px;
    pointer-events: none;
    z-index: 1;
  }
  /* fanned deck: the stack wrapper sizes to the front card so the
     back card can hang off it without affecting layout */
  .hero__stack {
    position: relative;
    width: 100%;
    max-width: 420px;
  }
  .hero__poster {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 420px;
    aspect-ratio: 3 / 4;
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid color-mix(in oklab, var(--primary) 35%, var(--border-color));
    /* official key art base, darkened toward the bottom so the
       poster copy stays readable */
    background-image: url('/_a/card01.64af4034b2.webp');
    background-size: cover;
    background-position: center top;
    box-shadow:
      0 16px 40px -14px color-mix(in oklab, var(--brand-deep) 75%, transparent),
      0 0 20px -6px color-mix(in oklab, var(--primary) 50%, transparent);
    padding: 1.75rem 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
  }
  /* bottom-up dark wash: dense at the bottom where the poster copy sits,
     fading to fully transparent toward the top so the key art shows through */
  .hero__poster::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(
      to top,
      rgba(8, 2, 4, 0.9) 0%,
      rgba(8, 2, 4, 0.6) 28%,
      rgba(8, 2, 4, 0) 62%
    );
    pointer-events: none;
  }
  .hero__poster-kicker,
  .hero__poster-title,
  .hero__poster-rule {
    position: relative;
    z-index: 2;
  }
  .hero__poster-kicker {
    font-family: var(--font-baloo), sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    color: #efe6d8;
    letter-spacing: 0.02em;
  }
  .hero__poster-title {
    font-family: var(--font-baloo), sans-serif;
    font-weight: 800;
    font-size: clamp(1.6rem, 5vw, 2.3rem);
    line-height: 0.95;
    margin-top: 0.25rem;
    color: #f4ede4;
    text-shadow: 0 2px 18px color-mix(in oklab, var(--primary) 80%, transparent);
    display: flex;
    flex-direction: column;
  }
  .hero__amp {
    color: var(--primary);
    font-size: 0.7em;
    margin: 0.1rem 0;
  }
  .hero__poster-rule {
    height: 2px;
    width: 56px;
    margin: 1rem 0;
    background: linear-gradient(90deg, var(--primary), transparent);
    border-radius: 9999px;
  }
  @media (prefers-reduced-motion: reduce) {
    .hero__btn {
      transition: none;
    }
  }



  .inner-hero {
    position: relative;
    width: 100%;
    min-height: 62vh;
    display: flex;
    align-items: flex-start;
    /* clear the overlay breadcrumb (top ~12px) and give the banner air */
    padding: 5rem 1rem 3rem;
    overflow: hidden;
  }
  /* game-art backdrop, full-bleed; masked so it fades to alpha 0 well before
     its bottom edge — otherwise the last row lets the photo bleed through as a
     hard seam into the content below. */
  .inner-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
    background-image: var(--hero-img);
    background-size: cover;
    background-position: center;
    -webkit-mask-image: linear-gradient(to bottom, black 52%, transparent 92%);
    mask-image: linear-gradient(to bottom, black 52%, transparent 92%);
    pointer-events: none;
  }
  /* theme-aware tint: dense at the top where the title sits, fading fully to
     transparent at the bottom so it blends into the page (no painted band, so
     no flicker when toggling light/dark — same fix as the homepage hero). */
  .inner-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
    background-image: linear-gradient(
      to bottom,
      color-mix(in oklab, var(--surface) 58%, transparent) 0%,
      color-mix(in oklab, var(--surface) 30%, transparent) 55%,
      transparent 100%
    );
    pointer-events: none;
  }
  .inner-hero__inner {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 1200px;
    margin-inline: auto;
  }

  .inner-hero__badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.85rem 0.45rem 1rem;
    border-radius: 9999px;
    border: 1px solid var(--border-color);
    background: color-mix(in oklab, var(--primary) 12%, var(--surface));
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--primary);
  }
  .inner-hero__dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 9999px;
    background: var(--primary);
    box-shadow: 0 0 8px var(--primary);
  }

  .inner-hero__title {
    margin: 1.1rem 0 0;
    font-family: var(--font-baloo), sans-serif;
    font-weight: 800;
    font-size: clamp(2rem, 5vw, 3.25rem);
    line-height: 1.1;
    letter-spacing: -0.01em;
    color: var(--text-primary);
  }

  .inner-hero__lead {
    margin: 1rem 0 0;
    max-width: 56ch;
    font-size: 1.05rem;
    line-height: 1.6;
    color: var(--text-secondary);
  }

  @media (prefers-reduced-motion: reduce) {
    .inner-hero::before,
    .inner-hero::after {
      transition: none;
    }
  }



  .stats-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
  }

  .stat-band {
    /* flat strip: one hairline on top to separate from the hero, no full box */
    border-top: 1px solid var(--border-color);
    padding: 1.5rem 0 0.5rem;
    margin: 1.25rem 0 2rem;
  }
  .stat-band__grid {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 1.1rem 2rem;
  }
  .stat-band__stat {
    /* a single fact: crimson left bar + figure + label on one baseline.
       no border, no background — just content on the strip. */
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    padding-left: 0.85rem;
    border-left: 2px solid var(--primary);
    flex: 1 1 150px;
    min-width: 140px;
  }
  .stat-band__value {
    font-family: var(--font-baloo), sans-serif;
    font-size: 2.7rem;
    font-weight: 800;
    line-height: 1;
    color: var(--primary);
    letter-spacing: -0.02em;
    font-style: italic;
    flex-shrink: 0;
  }
  .stat-band__label {
    font-size: 0.8125rem;
    line-height: 1.3;
    color: var(--text-secondary);
  }
  /* small screens: tighter strip, still no boxes */
  @media (max-width: 640px) {
    .stat-band {
      padding-top: 1.1rem;
      margin-bottom: 1.5rem;
    }
    .stat-band__grid {
      gap: 0.9rem 1.25rem;
    }
    .stat-band__stat {
      flex-basis: 130px;
      min-width: 0;
    }
    .stat-band__value {
      font-size: 2.2rem;
    }
    .stat-band__label {
      font-size: 0.72rem;
    }
  }



  /* Overlay mode: breadcrumb floats on top of the cinematic hero (no background block). */
  .breadcrumb-overlay {
    padding-top: 0.25rem;
    color: rgba(255, 255, 255, 0.92);
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.75);
  }
  .breadcrumb-overlay a {
    color: rgba(255, 255, 255, 0.92);
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.75);
  }
  .breadcrumb-overlay a:hover {
    color: #ffffff;
  }
  .breadcrumb-overlay [aria-current="page"] {
    color: #ffffff;
  }



.article-content[data-page-path="/burial-route"] hr,
.article-content[data-page-path="/characters"] hr,
.article-content[data-page-path="/decay-route"] hr,
.article-content[data-page-path="/news"] hr,
.article-content[data-page-path="/walkthrough"] hr {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 2.5rem 0;
}

.site-header{position:sticky;top:0;z-index:50;height:70px;border-bottom:1px solid var(--border-color);background:color-mix(in oklab,var(--background) 80%,transparent);backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px)}
.header-inner{display:flex;align-items:center;justify-content:space-between;height:100%;width:100%;padding:0 48px}
.header-left{display:flex;min-width:0;flex:1;align-items:center;gap:8px}
.logo-link{display:flex;flex-shrink:0;align-items:center;user-select:none}
.logo-mark{display:block;width:160px;height:auto;overflow:visible;filter:drop-shadow(0 2px 10px rgba(193,18,31,.35))}
.desktop-nav{display:none;align-items:center;margin-left:8px}
.nav-link{position:relative;display:block;padding:6px 12px;font-size:14px;line-height:1.5;font-weight:500;color:color-mix(in oklab,var(--text-primary) 85%,transparent);transition:color .2s}
.nav-link:hover{color:var(--primary);text-decoration:none}
.nav-link.nav-active{color:var(--primary)}
.nav-link.nav-active:after{content:"";position:absolute;bottom:4px;left:12px;right:12px;height:2px;border-radius:9999px;background:var(--color-primary)}
.header-actions{display:flex;flex-shrink:0;align-items:center;gap:8px;margin-right:0}
.mobile-menu-btn{display:flex;width:36px;height:36px;align-items:center;justify-content:center;border:0;border-radius:9px;background:transparent;color:var(--text-secondary);cursor:pointer}
.mobile-menu-btn:hover{background:var(--surface-hover);color:var(--text-primary)}
.theme-toggle{display:inline-flex;width:36px;height:36px;align-items:center;justify-content:center;margin-left:8px;border:1px solid var(--border-color);border-radius:9px;background:var(--surface-hover);color:var(--text-secondary);box-shadow:0 1px 2px rgba(0,0,0,.08);cursor:pointer;transition:color .2s,border-color .2s,background-color .2s}
.theme-toggle:hover{border-color:var(--primary);color:var(--primary);background:var(--surface)}
.theme-toggle .sun{display:block}.theme-toggle .moon{display:none}.dark .theme-toggle .sun{display:none}.dark .theme-toggle .moon{display:block}
.mobile-menu{position:absolute;left:0;right:0;top:100%;border-bottom:1px solid var(--border-color);background:color-mix(in oklab,var(--background) 95%,transparent);padding:8px 16px;backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px)}
.mobile-nav{display:flex;flex-direction:column}
.mobile-nav a{display:block;padding:10px 12px;border-radius:8px;font-size:14px;font-weight:500;color:var(--text-primary)}
.mobile-nav a:hover{background:var(--surface-hover);color:var(--primary);text-decoration:none}.mobile-nav a.mobile-active{color:var(--primary)}
.site-shell{display:flex;width:100%;flex:1}
.site-main-col{display:flex;min-width:0;flex:1;flex-direction:column}
.site-main{position:relative;width:100%;flex:1 0 auto}
.site-footer{margin-top:auto;border-top:1px solid var(--border-color);background:var(--background);padding:24px 0}
.footer-inner{display:flex;max-width:80rem;margin:0 auto;flex-direction:column;align-items:center;padding:0 24px}
.footer-links{display:flex;flex-wrap:wrap;justify-content:center;gap:12px 24px}
.footer-links a{font-size:15px;font-weight:500;color:var(--text-secondary);transition:color .2s}
.footer-links a:hover{color:var(--primary);text-decoration:none}
.footer-copy{max-width:48rem;margin:16px 0 0;text-align:center;font-size:12px;line-height:1.6;color:var(--text-secondary);opacity:.7}
.breadcrumb-wrap{max-width:1200px;margin:0 auto;padding:24px 16px 0}
.breadcrumb-overlay-wrap{position:absolute;top:12px;left:0;right:0;z-index:20;padding:0 16px;pointer-events:none}
.breadcrumb-overlay-wrap .breadcrumb{max-width:1200px;margin:0 auto;pointer-events:auto}
.breadcrumb{font-size:14px;color:var(--text-secondary)}
.breadcrumb ol{display:flex;flex-wrap:wrap;align-items:center;gap:4px;margin:0;padding:0;list-style:none}
.breadcrumb li{display:flex;align-items:center;gap:4px}
.breadcrumb a:hover{text-decoration:underline}
.breadcrumb-overlay{padding-top:4px;color:rgba(255,255,255,.92);text-shadow:0 1px 6px rgba(0,0,0,.75)}
.breadcrumb-overlay a{color:rgba(255,255,255,.92);text-shadow:0 1px 6px rgba(0,0,0,.75)}
.breadcrumb-overlay a:hover,.breadcrumb-overlay [aria-current=page]{color:#fff}
.article-layout{max-width:1200px;margin:0 auto}
.article-row{display:flex;align-items:flex-start;gap:40px}
.article-content{min-width:0;flex:1}
.article-content.prose{max-width:none;margin:0}
.toc{display:none}
.back-to-top{position:fixed;right:15px;bottom:15px;z-index:9999;padding:0;border:0;background:transparent;transform:translateX(120px);opacity:0;pointer-events:none;cursor:pointer}
.back-to-top-inner{display:flex;align-items:center;justify-content:center;width:40px;height:40px;border-radius:10px;background:var(--primary);color:white;box-shadow:0 4px 8px rgba(0,0,0,.15);transition:all .3s}
.back-to-top:hover .back-to-top-inner{filter:brightness(1.1);box-shadow:0 8px 16px rgba(0,0,0,.2)}
.text-sm{font-size:.875rem;line-height:1.25rem}.text-text-secondary{color:var(--text-secondary)}
@media(min-width:640px){.logo-mark{width:200px}}
@media(min-width:768px){.header-inner{padding-left:96px;padding-right:96px}.header-actions{gap:12px;margin-right:40px}}
@media(min-width:1024px){.logo-mark{width:220px}.header-left{gap:16px}.desktop-nav{display:flex}.mobile-menu-btn{display:none}.header-actions{margin-right:64px}.toc{display:block}}
@media(max-width:1023px){.article-row{display:block}.toc{display:none}}
@media(max-width:639px){.header-inner{padding-left:48px;padding-right:48px}}

/* Source 404 page styles */

  .not-found {
    max-width: 48rem;
    margin: 3.5rem auto 4.5rem;
    padding: 0 1rem;
    text-align: center;
  }
  .not-found__code {
    font-size: clamp(4rem, 18vw, 8rem);
    font-weight: 900;
    line-height: 1;
    margin: 0;
    color: var(--primary, #c1121f);
    letter-spacing: -0.03em;
  }
  .not-found__title {
    font-size: 1.5rem;
    font-weight: 800;
    margin: 0.5rem 0 0.75rem;
    color: var(--text-primary, #fbeede);
  }
  .not-found__text {
    color: var(--text-primary, #fbeede);
    opacity: 0.72;
    margin: 0 auto 1.75rem;
    max-width: 30rem;
    line-height: 1.6;
  }
  .not-found__actions {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: center;
    gap: 0.75rem;
    align-items: center;
  }
  .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.7rem 1.25rem;
    border-radius: 0.75rem;
    font-weight: 700;
    text-decoration: none;
    transition: transform 0.08s ease, background 0.15s ease;
  }
  .btn:active {
    transform: translateY(1px);
  }
  .btn--primary {
    background: var(--primary, #c1121f);
    color: #fff;
  }
  .btn--ghost {
    background: var(--surface, #1f1812);
    color: var(--text-primary, #fbeede);
  }
  .not-found__actions .btn {
    flex: 1 1 0;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  @media (max-width: 640px) {
    .not-found__actions {
      flex-direction: column;
      flex-wrap: nowrap;
    }
    .btn--primary,
    .btn--ghost {
      flex: 1 1 auto;
      width: 100%;
      max-width: 100%;
    }
    .not-found__actions .btn {
      white-space: nowrap;
      overflow: visible;
    }
  }

.hidden{display:none!important}.mobile-menu{display:block}.mobile-menu.hidden{display:none!important}@media(min-width:1024px){.mobile-menu{display:none}}

/* Tailwind preflight essentials retained for the original static layout */
*,*::before,*::after{box-sizing:border-box;border:0 solid var(--border-color)}
hr{height:0;color:inherit;border-top-width:1px}
html,body{margin:0;padding:0}
h1,h2,h3,h4,h5,h6,p,figure,blockquote,dl,dd{margin:0}
button,input,select,textarea{font:inherit;letter-spacing:inherit;color:inherit}
button{cursor:pointer}
img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}
img,video{max-width:100%;height:auto}

.breadcrumb [aria-current="page"]{font-weight:600;color:var(--text-primary)}.breadcrumb-overlay [aria-current="page"]{color:#fff}
