/* ========================================================================== 
   HOLLOWMOON — Dark Fantasy Editorial Design System
   Obsidian Night · Tarnished Moon Gold · Lunar Violet · Cursed Emerald
   Built for Zsian Morales (ZLYNNN) // Godot 4.7 Forward+
   ========================================================================== */

:root {
  /* Core Palette */
  --bg-void: #07060c;
  --bg-deep: #0c0a14;
  --bg-panel: #13111d;
  --bg-panel-hi: #1a1727;
  --bg-parchment: #191521;

  /* Inks */
  --ink: #f2e8d8;
  --ink-soft: #cdc3d4;
  --ink-muted: #92889e;
  --ink-dim: #665e73;

  /* Metals & Atmospheric Accents */
  --gold: #dfbd87;
  --gold-bright: #f5d896;
  --gold-deep: #9c7944;
  --violet: #a878ff;
  --violet-soft: rgba(168, 120, 255, 0.16);
  --emerald: #4ce8a2;
  --crimson: #e04f64;
  --frost: #7cc8ff;

  /* Hairlines & Frames */
  --line: rgba(223, 189, 135, 0.16);
  --line-strong: rgba(223, 189, 135, 0.36);
  --line-subtle: rgba(255, 255, 255, 0.07);

  /* Typography */
  --font-display: 'Cinzel', Georgia, serif;
  --font-game-serif: Georgia, Cambria, 'Palatino Linotype', 'Times New Roman', serif;
  --font-serif: 'Instrument Serif', Georgia, serif;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  /* Layout & Motion */
  --max-w: 1320px;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --shadow-deep: 0 28px 70px rgba(0, 0, 0, 0.65), 0 4px 16px rgba(0, 0, 0, 0.45);
}

/* --- Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  background-color: var(--bg-void);
  color-scheme: dark;
  overflow-x: clip;
}

body {
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--ink);
  background:
    radial-gradient(ellipse 80% 55% at 50% 0%, rgba(92, 42, 148, 0.14), transparent 60%),
    radial-gradient(ellipse 65% 40% at 85% 45%, rgba(76, 152, 232, 0.06), transparent 60%),
    radial-gradient(ellipse 60% 45% at 15% 70%, rgba(76, 232, 162, 0.05), transparent 60%),
    var(--bg-void);
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

[hidden] {
  display: none !important;
}

::selection {
  background: rgba(223, 189, 135, 0.28);
  color: var(--gold-bright);
}

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

img, video, svg {
  display: block;
  max-width: 100%;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  color: var(--gold-bright);
  background: rgba(223, 189, 135, 0.09);
  border: 1px solid rgba(223, 189, 135, 0.18);
  padding: 1px 6px;
  border-radius: 4px;
}

.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding-inline: clamp(18px, 4vw, 48px);
}

/* --- Ambient Canvas, Grain & Scroll Progress --- */
.lunar-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 1;
  opacity: 0.65;
}

.grain-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 90;
  opacity: 0.045;
  background-image: radial-gradient(rgba(255, 245, 225, 0.35) 0.5px, transparent 0.5px);
  background-size: 3px 3px;
}

.scroll-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0%;
  background: linear-gradient(90deg, var(--gold-deep), var(--gold-bright));
  z-index: 200;
  pointer-events: none;
  box-shadow: 0 0 12px rgba(245, 216, 150, 0.65);
}

/* --- First-Visit Veil Curtain --- */
.veil-curtain {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at center, #151024 0%, #07060c 68%);
  opacity: 1;
  animation: veilAutoDismiss 520ms var(--ease) 480ms forwards;
  transition: opacity 420ms var(--ease), visibility 420ms var(--ease);
}

.veil-curtain.is-gone {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

@keyframes veilAutoDismiss {
  to {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }
}

.veil-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  animation: veilFloat 1.2s var(--ease) both;
}

.veil-crest {
  width: 84px;
  height: auto;
  filter: drop-shadow(0 0 28px rgba(223, 189, 135, 0.45));
}

.veil-caption {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.28em;
  color: var(--gold);
  opacity: 0.85;
}

@keyframes veilFloat {
  from { opacity: 0; transform: scale(0.92) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

/* ==========================================================================
   NAVIGATION
   ========================================================================== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 120;
  padding: 14px clamp(14px, 3vw, 36px);
  transition: padding 300ms var(--ease), transform 240ms var(--ease), opacity 180ms ease;
}

.site-header.is-scrolled {
  padding-top: 10px;
  padding-bottom: 10px;
}

.site-header.is-hidden {
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;
}

.nav-shell {
  --game-frame-width: 3px;
  --game-frame-surface: linear-gradient(180deg, #312521ef, #140e12f5 74%) padding-box;
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 15px;
}

.site-header.is-scrolled .nav-shell {
  --game-frame-surface: linear-gradient(180deg, #312521, #140e12 74%) padding-box;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.nav-crest {
  width: 34px;
  height: 34px;
  object-fit: contain;
  filter: drop-shadow(0 2px 8px rgba(223, 189, 135, 0.35));
}

.nav-brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.nav-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.92rem;
  letter-spacing: 0.16em;
  color: var(--gold-bright);
}

.nav-sub {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  color: #c5af93;
  margin-top: 2px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(5px, 0.65vw, 10px);
}

.nav-links a {
  --game-button-padding: 5px clamp(8px, 1vw, 16px);
  display: grid;
  place-items: center;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.audio-pill {
  --game-button-height: 36px;
  --game-button-padding: 5px 10px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.audio-bars {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 11px;
}

.audio-bars i {
  display: block;
  width: 2px;
  height: 4px;
  background: currentColor;
  border-radius: 1px;
  transition: height 200ms ease;
}

.audio-pill.is-playing .audio-bars i:nth-child(1) { animation: eqBar 0.75s ease-in-out infinite; }
.audio-pill.is-playing .audio-bars i:nth-child(2) { animation: eqBar 0.55s ease-in-out 0.15s infinite; }
.audio-pill.is-playing .audio-bars i:nth-child(3) { animation: eqBar 0.85s ease-in-out 0.3s infinite; }

@keyframes eqBar {
  0%, 100% { height: 3px; }
  50% { height: 11px; }
}

.nav-cta {
  --game-button-height: 36px;
  --game-button-padding: 5px 12px;
}

.mobile-toggle {
  --game-button-padding: 8px;
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 36px;
  height: 36px;
}

.mobile-toggle span {
  display: block;
  width: 100%;
  height: 1.5px;
  background: var(--gold);
  transition: transform 240ms ease, opacity 240ms ease;
}

.mobile-drawer {
  --game-frame-width: 3px;
  --game-frame-surface: linear-gradient(160deg, #31251e, #160f14 78%) padding-box;
  max-width: var(--max-w);
  margin: 6px auto 0;
  padding: 12px;
  display: none;
  gap: 6px;
}

.mobile-drawer a,
.drawer-reel-btn {
  --game-button-height: 44px;
  --game-button-padding: 7px 12px;
  display: grid;
  place-items: center;
}

/* ==========================================================================
   HERO SECTION
   ========================================================================== */
.hero {
  --reel-top: 82px;
  position: relative;
  min-height: clamp(680px, 100svh, 960px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 108px 0 88px;
  overflow: hidden;
  isolation: isolate;
}

.hero-media {
  position: absolute;
  inset: 0;
  z-index: -1;
}

.hero-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(1.1) contrast(1.04) brightness(0.70);
  transform: scale(1.03);
}

.hero-scrim {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 75% 65% at 50% 42%, rgba(16, 11, 28, 0.34) 0%, rgba(7, 6, 12, 0.84) 74%, #07060c 100%),
    linear-gradient(180deg, rgba(7, 6, 12, 0.72) 0%, rgba(7, 6, 12, 0.25) 35%, rgba(7, 6, 12, 0.62) 75%, #07060c 100%);
}

.hero-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 30%, rgba(158, 107, 255, 0.14), transparent 55%);
}

/* Homage to Zsian's portfolio .hollowmoon-card::after hairline gold frame */
.hero-frame-border {
  position: absolute;
  inset: clamp(14px, 1.8vw, 28px);
  top: 84px;
  border: 1px solid rgba(223, 189, 135, 0.22);
  pointer-events: none;
}

.hero-frame-border::before,
.hero-frame-border::after {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  border-color: var(--gold);
  border-style: solid;
}

.hero-frame-border::before {
  top: -1px;
  left: -1px;
  border-width: 2px 0 0 2px;
}

.hero-frame-border::after {
  bottom: -1px;
  right: -1px;
  border-width: 0 2px 2px 0;
}

.hero.is-reel-playing {
  --reel-button-height: 44px;
  --reel-bottom: calc(max(0px, 100% - 100svh) + clamp(12px, 2.5vh, 22px));
  background: #000;
  z-index: 2;
}

.hero.is-reel-playing .hero-inner,
.hero.is-reel-playing .scroll-cue {
  visibility: hidden;
}

.hero.is-reel-playing :is(.hero-scrim, .hero-vignette, .hero-frame-border) {
  display: none;
}

.hero.is-reel-playing .hero-media {
  top: var(--reel-top);
  bottom: calc(var(--reel-bottom) + var(--reel-button-height) + 8px);
  z-index: 1;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  place-items: center;
}

.hero.is-reel-playing .hero-video {
  height: auto;
  min-height: 0;
  max-height: 100%;
  object-fit: contain;
  filter: none;
  transform: none;
}

.hero-reel-back {
  --game-button-height: var(--reel-button-height);
  --game-button-padding: 5px 12px;
  position: absolute;
  z-index: 3;
  right: clamp(12px, 3vw, 36px);
  bottom: var(--reel-bottom);
  min-width: 80px;
}

.hero-inner {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: clamp(24px, 3.6vh, 42px);
}

.hero-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(12, 10, 20, 0.7);
  backdrop-filter: blur(12px);
  border: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  color: var(--gold);
}

.status-pill .sep {
  opacity: 0.35;
}

.status-pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 10px var(--emerald);
  animation: pulseDot 2.2s ease-in-out infinite;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.8); }
}

.creator-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(12, 10, 20, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.78rem;
  color: var(--ink-soft);
  transition: border-color 220ms ease, color 220ms ease;
}

.creator-tag strong {
  color: var(--gold-bright);
  font-weight: 600;
}

.creator-tag:hover {
  border-color: var(--gold);
  color: var(--ink);
}

.creator-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--violet);
}

.hero-centerpiece {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-top: clamp(4px, 2vh, 18px);
}

.wordmark-stage {
  position: relative;
  display: inline-block;
  max-width: min(680px, 88vw);
  isolation: isolate;
  filter: drop-shadow(0 18px 44px rgba(0, 0, 0, 0.85)) drop-shadow(0 0 28px rgba(223, 189, 135, 0.18));
}

.hero-wordmark {
  width: 100%;
  height: auto;
}

.wordmark-sheen {
  display: none;
}

@supports (mask-image: linear-gradient(black, transparent)) {
  /* Mask the brightened artwork so its transparent areas stay clear. */
  .wordmark-sheen {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    filter: brightness(1.65) sepia(0.36);
    mix-blend-mode: screen;
    mask-image: linear-gradient(108deg, transparent 46%, #0004 49%, #000 50%, #0005 51.5%, transparent 54%);
    mask-size: 260% 100%;
    mask-repeat: no-repeat;
    mask-position: 100% 0;
    animation: wordmark-glint 6.6s linear infinite;
    pointer-events: none;
  }
}

@keyframes wordmark-glint {
  0%, 12% { mask-position: 100% 0; }
  40%, 100% { mask-position: 0% 0; }
}

.hero-headline {
  font: 400 clamp(1.35rem, 2.65vw, 2.625rem) / 1.13 var(--font-serif);
  letter-spacing: -0.01em;
  text-wrap: balance;
  color: #faf3e6;
  margin-top: clamp(14px, 2vh, 24px);
  text-shadow: 0 8px 28px rgba(0, 0, 0, 0.72);
}

.hero-headline em {
  font-style: italic;
  color: var(--gold-bright);
}

.hero-lead {
  max-width: 58ch;
  margin-top: 16px;
  font-size: clamp(0.98rem, 1.3vw, 1.1rem);
  color: #dbd2e2;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.8);
}

.hero-ctas {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

/* Buttons */
.btn-gilded {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 26px;
  border-radius: 6px;
  font-family: var(--font-display);
  font-size: 0.84rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #161006;
  background: linear-gradient(180deg, #f8df9f 0%, #d8ae63 55%, #b68840 100%);
  border: 1px solid #ffebb3;
  box-shadow: 0 10px 30px rgba(216, 174, 99, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.55);
  transition: transform 240ms var(--ease), box-shadow 240ms ease, filter 240ms ease;
}

.btn-gilded:hover {
  transform: translateY(-2px);
  filter: brightness(1.07);
  box-shadow: 0 14px 38px rgba(216, 174, 99, 0.44), inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.btn-obsidian {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 22px;
  border-radius: 6px;
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink);
  background: rgba(16, 14, 26, 0.78);
  backdrop-filter: blur(12px);
  border: 1px solid var(--line-strong);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
  transition: all 240ms var(--ease);
}

.btn-obsidian:hover {
  border-color: var(--gold-bright);
  background: rgba(28, 24, 42, 0.92);
  color: var(--gold-bright);
  transform: translateY(-2px);
}

.btn-obsidian.small {
  padding: 9px 15px;
  font-size: 0.8rem;
}

.btn-meta {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--gold);
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(223, 189, 135, 0.12);
}

.btn-icon-ghost {
  display: inline-grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 6px;
  background: rgba(16, 14, 26, 0.7);
  border: 1px solid var(--line);
  color: var(--gold);
  transition: all 220ms ease;
}

.btn-icon-ghost:hover {
  border-color: var(--gold-bright);
  background: rgba(223, 189, 135, 0.12);
}

/* Telemetry Bar */
.hero-telemetry {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-top: clamp(12px, 2.5vh, 28px);
  box-shadow: var(--shadow-deep);
}

.telemetry-item {
  background: rgba(11, 10, 18, 0.82);
  backdrop-filter: blur(14px);
  padding: 15px 18px;
  display: flex;
  align-items: baseline;
  gap: 11px;
}

.telemetry-num {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--gold-bright);
  line-height: 1;
}

.telemetry-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
}

.scroll-cue {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  opacity: 0.78;
  transition: opacity 220ms ease;
}

.scroll-cue:hover { opacity: 1; }

.scroll-stem {
  width: 1px;
  height: 22px;
  background: linear-gradient(180deg, var(--gold), transparent);
  animation: stemBob 2s ease-in-out infinite;
}

@keyframes stemBob {
  0%, 100% { transform: translateY(0); opacity: 0.5; }
  50% { transform: translateY(5px); opacity: 1; }
}

/* ==========================================================================
   SHARED SECTION CHROME & CREST DIVIDER
   ========================================================================== */
.section {
  position: relative;
  z-index: 2;
  padding-block: clamp(22px, 2.6vw, 38px);
  scroll-margin-top: 80px;
}

.crest-divider {
  position: relative;
  z-index: 2;
  max-width: var(--max-w);
  margin: 0 auto;
  padding-inline: clamp(18px, 4vw, 48px);
  display: flex;
  align-items: center;
  gap: 18px;
}

.crest-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(223, 189, 135, 0.38), transparent);
}

.crest-gem {
  width: 12px;
  height: 12px;
  transform: rotate(45deg);
  background: linear-gradient(135deg, #b82230, #5e1118);
  border: 1.5px solid var(--gold-bright);
  box-shadow: 0 0 16px rgba(223, 189, 135, 0.4);
}

.section-header {
  margin-bottom: clamp(16px, 2.2vw, 28px);
}

.section-header.split {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  align-items: start;
  gap: 8px clamp(20px, 4vw, 56px);
}

.section-header.centered {
  text-align: center;
  max-width: 740px;
  margin-inline: auto;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 12px;
}

.eyebrow.crimson {
  color: #f47c8b;
}

.section-title {
  font: 700 clamp(1.75rem, 3.2vw, 3rem) / 1.12 var(--font-game-serif);
  color: var(--ink);
}

.section-title em {
  font-style: normal;
  color: var(--gold-bright);
}

.section-intro {
  color: var(--ink-soft);
  font-size: 1.02rem;
  line-height: 1.7;
}

.section-header.centered .section-intro {
  margin-top: 14px;
}

/* Scroll Reveal Animation (progressive: visible by default unless JS activates reveal) */
.js-reveal .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 640ms var(--ease), transform 640ms var(--ease);
}

.js-reveal .reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-d1 { transition-delay: 80ms; }
.reveal-d2 { transition-delay: 160ms; }
.reveal-d3 { transition-delay: 240ms; }
.reveal-d4 { transition-delay: 320ms; }

/* ==========================================================================
   SECTION I — PS1 / PS2 / HD SHADER COMPARISON
   ========================================================================== */
.visuals-section {
  padding-block: clamp(18px, 2vw, 28px);
}

.visuals-section > .container {
  max-width: none;
  padding-inline: clamp(16px, 2vw, 32px);
}

.visuals-section .section-header {
  align-items: center;
  margin-bottom: clamp(10px, 1.3vw, 16px);
}

.visuals-section .section-title {
  font-size: clamp(1.55rem, 2.4vw, 2.05rem);
  text-wrap: balance;
}

.visuals-section .section-intro {
  font-size: 0.88rem;
  line-height: 1.55;
}

.shader-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-bottom: 12px;
}

.shader-preset-group {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  border-radius: 8px;
  background: var(--bg-panel);
  border: 1px solid var(--line);
}

.shader-tab {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 32px;
  padding: 4px clamp(8px, 1.15vw, 18px);
  border: 1px solid transparent;
  border-radius: 6px;
  font-size: 0.74rem;
  color: var(--ink-soft);
  transition: all 220ms ease;
}

.shader-tab:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.04);
}

.shader-tab.is-active {
  background: linear-gradient(180deg, rgba(223, 189, 135, 0.18), rgba(223, 189, 135, 0.08));
  border-color: var(--line-strong);
  color: var(--gold-bright);
}

.tab-badge {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 600;
  padding: 2px 4px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink);
}

.tab-badge.gold { background: rgba(223, 189, 135, 0.18); color: var(--gold-bright); }
.tab-badge.violet { background: rgba(168, 120, 255, 0.2); color: #d8beff; }

.drag-hint {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  color: var(--ink-muted);
}

.shader-compare {
  --tag-inset: clamp(7px, 1.15vw, 12px);
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 550px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-deep);
  background: #0b0a12;
  user-select: none;
  touch-action: none;
  cursor: ew-resize;
  --split: 50%;
}

.compare-layer {
  position: absolute;
  inset: 0;
}

.compare-layer img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 54%;
  pointer-events: none;
}

.compare-left {
  clip-path: inset(0 calc(100% - var(--split)) 0 0);
}

.compare-tag {
  position: absolute;
  bottom: var(--tag-inset);
  max-width: calc(50% - var(--tag-inset) - 3px);
  padding: 4px 8px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.07em;
  color: var(--gold-bright);
  background: rgba(8, 7, 14, 0.84);
  backdrop-filter: blur(8px);
  border: 1px solid var(--line-strong);
  pointer-events: none;
}

.compare-tag.left { left: var(--tag-inset); }
.compare-tag.right { right: var(--tag-inset); }

.compare-divider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--split);
  width: 2px;
  margin-left: -1px;
  background: linear-gradient(180deg, transparent, var(--gold-bright) 15%, var(--gold-bright) 85%, transparent);
  box-shadow: 0 0 18px rgba(245, 216, 150, 0.65);
  z-index: 4;
}

.compare-handle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 35% 30%, #262033, #0e0c17);
  border: 2px solid var(--gold-bright);
  color: var(--gold-bright);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.75), 0 0 22px rgba(223, 189, 135, 0.4);
  transition: transform 200ms var(--ease);
}

.shader-compare:hover .compare-handle {
  transform: translate(-50%, -50%) scale(1.08);
}

@media (min-width: 861px) {
  .visuals-section .section-header.split {
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    column-gap: clamp(18px, 2vw, 28px);
  }

  .visuals-section .section-intro {
    max-width: 56ch;
    justify-self: end;
  }
}

@media (pointer: coarse) {
  .shader-tab { min-height: 44px; }
}

/* Shared bronze frames and menu controls. */
.nav-shell,
.mobile-drawer,
.atlas-map-frame,
.atlas-dossier,
.equipment-menu,
.codex-shell,
.beta-notice {
  position: relative;
  border: var(--game-frame-width, 4px) solid transparent;
  background: var(--game-frame-surface),
    linear-gradient(145deg, #e9c578, #775025 24%, #30201b 49%, #af8046 76%, #4c2e1c) border-box;
  box-shadow: 0 22px 60px #000c, 0 0 0 1px #100a06, inset 0 0 0 1px #b48949a6, inset 0 0 0 5px #0f0b0b;
}

.nav-shell::before,
.mobile-drawer::before,
.atlas-map-frame::before,
.atlas-dossier::before,
.equipment-menu::before,
.codex-shell::before,
.beta-notice::before {
  content: '';
  position: absolute;
  inset: 4px;
  border: 1px solid #a579474d;
  pointer-events: none;
  --corner-rivet: radial-gradient(circle at 6px 6px, #f6dc9a 0 1px, #99703b 1.5px 2.5px, #24160f 3px 4px, transparent 4.5px);
  background: var(--corner-rivet) top left, var(--corner-rivet) top right,
    var(--corner-rivet) bottom left, var(--corner-rivet) bottom right;
  background-size: 12px 12px;
  background-repeat: no-repeat;
}

.nav-links a,
.audio-pill,
.nav-cta,
.mobile-toggle,
.mobile-drawer a,
.drawer-reel-btn,
.hero-reel-back,
.zone-pill,
.hero-card-action,
.cast-skill-btn,
.armory-cat-btn,
.armory-nav-btn,
.armory-view-btn,
.codex-tab,
.clock-action,
.waystone-btn,
.lore-filter {
  min-height: var(--game-button-height, 31px);
  padding: var(--game-button-padding, 4px 8px);
  border: 1px solid #97724b;
  color: #f4d99e;
  background: linear-gradient(#48382b, #2c221e 48%, #1d1718 50%, #2d211b);
  box-shadow: inset 0 0 0 1px #211510, inset 0 2px #ffffff13, 0 2px 4px #0009;
  font: 700 0.8rem / 1.2 var(--font-display);
  letter-spacing: 0.055em;
  text-shadow: 0 1px 2px #000;
}

.zone-pill,
.hero-card-action,
.cast-skill-btn {
  display: grid;
  place-items: center;
}

.nav-links a.is-active,
.nav-cta,
.drawer-reel-btn,
.zone-pill.is-active,
.hero-card.is-active .hero-card-action,
.cast-skill-btn,
.armory-cat-btn.is-active,
.codex-tab[aria-selected="true"],
.clock-action,
.lore-filter[aria-pressed="true"] {
  background: linear-gradient(#7e3633, #582124 48%, #3e141b 50%, #562020);
  border-color: #d6ac66;
}

.nav-links a:hover,
.audio-pill:hover,
.audio-pill.is-playing,
.nav-cta:hover,
.mobile-toggle:hover,
.mobile-toggle[aria-expanded="true"],
.mobile-drawer a:hover,
.drawer-reel-btn:hover,
.hero-reel-back:hover,
.zone-pill:hover,
.zone-pill:focus-visible,
.hero-card:hover .hero-card-action,
.cast-skill-btn:hover,
.armory-cat-btn:hover,
.armory-nav-btn:hover,
.armory-view-btn:hover,
.codex-tab:hover,
.clock-action:hover,
.waystone-btn:hover,
.lore-filter:hover {
  border-color: #ffe1a1;
  color: #fff3ca;
  box-shadow: inset 0 0 0 1px #302016, inset 0 2px #ffffff24, 0 0 10px #da96373d;
}

/* ========================================================================== 
   SECTION II — INTERACTIVE CARTOGRAPHIC ATLAS
   ========================================================================== */
.atlas-grid {
  --atlas-trim: #a5794773;
  --atlas-ink: #f3e5cc;
  --atlas-muted: #d1bea1;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.85fr);
  gap: 24px;
  align-items: stretch;
}

.atlas-map-frame {
  --game-frame-surface:
    repeating-linear-gradient(119deg, #bba88004 0 1px, transparent 1px 5px) padding-box,
    radial-gradient(ellipse at 50% 0%, #352922, #171116 75%) padding-box;
  display: flex;
  flex-direction: column;
  padding: 12px;
}

.atlas-hud-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 9px 12px;
  border: 1px solid var(--atlas-trim);
  border-bottom: 0;
  background: linear-gradient(#392b24, #211917);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  color: var(--atlas-muted);
}

.atlas-legend {
  display: inline-flex;
  align-items: center;
  gap: 16px;
}

.atlas-legend i {
  font-style: normal;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.dot-shrine, .dot-landmark {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.dot-shrine { background: var(--emerald); box-shadow: 0 0 8px var(--emerald); }
.dot-landmark { background: var(--gold); }

.atlas-svg-wrap {
  flex: 1;
  padding: 10px;
  min-height: 360px;
  display: grid;
  place-items: center;
  border: 1px solid var(--atlas-trim);
  background: radial-gradient(ellipse at 45% 50%, #151225, #0b0a13 80%);
  box-shadow: inset 0 0 24px #060408b3;
}

#atlas-svg {
  width: 100%;
  height: 100%;
  max-height: 490px;
}

.atlas-road {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.atlas-road.cobble { stroke: rgba(223, 189, 135, 0.42); stroke-width: 2.6; }
.atlas-road.dirt { stroke: rgba(168, 120, 255, 0.4); stroke-width: 2.2; stroke-dasharray: 5 4; }
.atlas-road.snow { stroke: rgba(124, 200, 255, 0.55); stroke-width: 2.8; }
.atlas-road.alpine { stroke: rgba(184, 232, 255, 0.65); stroke-width: 2.6; stroke-dasharray: 6 3; }

.atlas-pin {
  cursor: pointer;
  transition: opacity 200ms ease;
}

.atlas-pin .pin-halo {
  fill: none;
  stroke-width: 1.5;
  opacity: 0.35;
  transform-box: fill-box;
  transform-origin: center;
  transition: all 240ms ease;
}

.atlas-pin .pin-core {
  stroke: #09080f;
  stroke-width: 2;
  transition: stroke 180ms ease;
}

.atlas-pin .pin-label {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  fill: #e8decb;
  paint-order: stroke;
  stroke: #09080f;
  stroke-width: 4px;
  stroke-linejoin: round;
  pointer-events: none;
  opacity: 0.82;
  transition: opacity 220ms ease, fill 220ms ease;
}

.atlas-pin:hover .pin-label,
.atlas-pin:focus-visible .pin-label,
.atlas-pin.is-active .pin-label {
  opacity: 1;
  fill: var(--gold-bright);
}

.atlas-pin:hover .pin-core,
.atlas-pin:focus-visible .pin-core,
.atlas-pin.is-active .pin-core {
  stroke: var(--gold-bright);
}

.atlas-pin.is-active .pin-halo {
  opacity: 0.95;
  stroke-width: 2.2;
  animation: atlasPulse 2s ease-out infinite;
}

@keyframes atlasPulse {
  0% { transform: scale(1); opacity: 0.9; }
  100% { transform: scale(1.9); opacity: 0; }
}

.atlas-quick-pills {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 9rem), 1fr));
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--atlas-trim);
  border-top: 0;
  background: linear-gradient(#241a17, #151015);
}

.zone-pill {
  min-height: 36px;
  letter-spacing: 0;
  overflow-wrap: anywhere;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

/* Dossier Aside */
.atlas-dossier {
  --game-frame-surface:
    repeating-linear-gradient(117deg, #edcea005 0 1px, transparent 1px 5px) padding-box,
    linear-gradient(120deg, #3b2a20, #251a16 57%, #1b1414) padding-box;
  display: flex;
  flex-direction: column;
  padding: 12px;
}

.dossier-media {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #0a0910;
  border: 1px solid var(--atlas-trim);
}

.dossier-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 300ms ease, transform 600ms var(--ease);
}

.dossier-media img.is-swapping {
  opacity: 0.35;
  transform: scale(1.03);
}

.dossier-media-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #07060c40, transparent 45%, #181010e6);
}

.shrine-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  padding: 5px 10px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  color: var(--emerald);
  background: #151d14ed;
  border: 1px solid #748650;
}

.shrine-badge[hidden] { display: none; }

.coords-badge {
  position: absolute;
  bottom: 12px;
  right: 14px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--gold);
  background: #191211e8;
  border: 1px solid var(--atlas-trim);
  padding: 4px 8px;
}

.dossier-body {
  padding: 20px 24px 24px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.dossier-region {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
}

.dossier-title {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 600;
  color: var(--gold-bright);
  margin-top: 6px;
}

.dossier-tagline {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.15rem;
  color: var(--atlas-ink);
  margin-top: 4px;
}

.dossier-desc {
  margin-top: 14px;
  font-size: 0.92rem;
  color: var(--atlas-ink);
  line-height: 1.68;
}

.dossier-features-wrap {
  padding-top: 18px;
  border-top: 1px solid var(--atlas-trim);
  margin-top: 20px;
}

.dossier-sublabel {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--atlas-muted);
  margin-bottom: 10px;
}

.dossier-features {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.dossier-features li {
  font-size: 0.78rem;
  color: var(--atlas-ink);
  padding: 5px 10px;
  background: #19131296;
  border: 1px solid var(--atlas-trim);
}

@media (max-width: 500px) {
  .atlas-quick-pills {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .zone-pill {
    min-height: 44px;
    padding-inline: 5px;
  }
}

/* ==========================================================================
   SECTION III — PLAYABLE HEROES
   ========================================================================== */
.equipment-menu-wrap {
  max-width: none;
  margin-block: clamp(14px, 1.6vw, 24px);
  padding-inline: clamp(8px, 1.25vw, 24px);
}

.equipment-menu,
.armory-section {
  --equipment-gold: #f3d38a;
  --equipment-ink: #f3e5cc;
  --equipment-muted: #d1bea1;
  --equipment-trim: #8a633e;
  --equipment-paper:
    repeating-linear-gradient(117deg, #edcea005 0 1px, transparent 1px 5px),
    linear-gradient(120deg, #3b2a20, #251a16 57%, #1b1414);
}

.equipment-menu {
  --game-frame-width: clamp(3px, 0.32vw, 4px);
  --game-frame-surface:
    radial-gradient(ellipse at 50% 0%, #5942345c, transparent 50%) padding-box,
    repeating-linear-gradient(119deg, #bba88004 0 1px, transparent 1px 5px) padding-box,
    linear-gradient(180deg, #20181dc2, #110d13e8 36%, #181111 72%) padding-box,
    url('../assets/shots/graveyard-cinema.webp') center top / 100% auto no-repeat padding-box;
  padding-inline: clamp(8px, 1.4vw, 24px);
}

.equipment-menu > .section {
  padding-block: clamp(14px, 1.6vw, 24px);
}

.equipment-heading {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  column-gap: 10px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid #a579474d;
}

.equipment-crest {
  grid-row: 1 / span 2;
}

.equipment-crest img {
  width: clamp(30px, 2.6vw, 38px);
  height: auto;
  filter: drop-shadow(0 0 10px #d4a46b54);
}

.equipment-title {
  font: 700 clamp(1.3rem, 2.5vw, 2.1rem) / 1.12 var(--font-display);
  color: var(--equipment-gold);
  text-shadow: 0 2px #422516, 0 4px 14px #000;
}

.equipment-heading p {
  margin-top: 3px;
  color: var(--equipment-muted);
  font: 1rem / 1.45 Georgia, serif;
}

.hero-roster {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(6px, 1vw, 15px);
}

.hero-card {
  --card-rim: #75604b;
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr auto;
  color: var(--equipment-ink);
  min-width: 0;
  padding: clamp(4px, 0.5vw, 7px);
  border: 2px solid var(--card-rim);
  background:
    repeating-linear-gradient(119deg, #c2a47e08 0 1px, transparent 1px 4px),
    linear-gradient(#2b2320, #18121a 57%, #261c17);
  box-shadow: 0 0 0 1px #060407, 0 6px 14px #0009, inset 0 0 0 2px #120d0c;
  text-align: center;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.hero-card:hover {
  --card-rim: #c0a077;
}

.hero-card.is-active {
  --card-rim: #e9ba66;
  background:
    repeating-linear-gradient(119deg, #e5b66a0a 0 1px, transparent 1px 4px),
    linear-gradient(#66482c, #261a17 60%, #3b261a);
  box-shadow: 0 0 0 1px #472a11, 0 0 20px #d893433b, inset 0 0 0 2px #30200f;
}

.hero-card-img-wrap {
  position: relative;
  isolation: isolate;
  display: grid;
  overflow: hidden;
  height: clamp(110px, 15vw, 176px);
  place-items: center;
  border: 1px solid #b5986d70;
  background: #161321;
}

.hero-card-img-wrap::before,
.hero-card-img-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.hero-card-img-wrap::before {
  z-index: -1;
  background: var(--hero-portrait) center 58% / cover no-repeat;
  filter: blur(10px) brightness(0.6);
  transform: scale(1.16);
}

.hero-card-img-wrap::after {
  box-shadow: inset 0 0 26px 4px #08060c80;
}

.hero-card-img-wrap img {
  height: 100%;
  width: auto;
  max-width: 100%;
  min-height: 0;
  object-fit: cover;
  object-position: center 35%;
  mask-image: linear-gradient(90deg, transparent, #000 13%, #000 87%, transparent);
  filter: brightness(0.87) saturate(0.85);
  transition: filter 180ms ease;
}

.hero-card:hover img,
.hero-card.is-active img {
  filter: brightness(1.08) saturate(1.06);
}

.hero-card-name {
  display: grid;
  place-items: center;
  padding: 7px 2px;
  font: 700 clamp(0.85rem, 1.35vw, 1.12rem) / 1.2 var(--font-display);
  color: var(--hero-accent);
  text-shadow: 0 2px 2px #080507;
}

.hero-pulse-ring {
  position: absolute;
  z-index: 1;
  top: 76%;
  left: 50%;
  width: 40px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid var(--active-skill-color);
  box-shadow: 0 0 22px var(--active-skill-color), inset 0 0 16px var(--active-skill-accent);
  opacity: 0;
  pointer-events: none;
}

.hero-stage.is-casting .hero-card.is-active .hero-pulse-ring {
  animation: vessel-cast 780ms cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes vessel-cast {
  from { transform: translate(-50%, -50%) scale(0.45); opacity: 1; }
  to { transform: translate(-50%, -50%) scale(10); opacity: 0; }
}

.hero-dossier {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.04fr);
  gap: clamp(10px, 1.25vw, 18px);
  margin-top: 12px;
  padding: clamp(10px, 1.25vw, 18px);
  border: 1px solid var(--equipment-trim);
  background: var(--equipment-paper);
  box-shadow: inset 0 0 0 3px #1c1311, inset 0 0 24px #140f0e8c, 0 4px 12px #0008;
}

.hero-role,
.skill-kicker,
.metric-label {
  font: 600 0.75rem / 1.4 var(--font-display);
  letter-spacing: 0.07em;
  color: var(--equipment-muted);
}

.hero-role {
  color: var(--active-hero-accent, var(--equipment-gold));
}

.hero-dossier-title {
  margin-top: 3px;
  font: 700 clamp(1.2rem, 1.7vw, 1.52rem) / 1.15 var(--font-display);
  color: var(--equipment-ink);
  text-shadow: 0 2px #160e0d;
}

.hero-dossier-bio {
  margin-top: 6px;
  font: italic 1rem / 1.4 Georgia, serif;
  color: var(--equipment-ink);
}

.hero-playstyle {
  display: grid;
  gap: 4px;
  margin-top: 9px;
  padding-top: 8px;
  border-top: 1px solid #b58a5059;
  list-style: none;
  color: var(--equipment-muted);
  font: 1rem / 1.4 Georgia, serif;
}

.hero-playstyle li {
  position: relative;
  padding-left: 16px;
}

.hero-playstyle li::before {
  content: '';
  position: absolute;
  top: 0.55em;
  left: 2px;
  width: 5px;
  height: 5px;
  background: #c59654;
  transform: rotate(45deg);
}

.skill-panel {
  min-width: 0;
  padding: clamp(9px, 1vw, 14px);
  border: 1px solid #785a3c;
  background: linear-gradient(145deg, #21191e, #120f14 72%);
  box-shadow: inset 0 0 0 2px #110d12, 0 2px 6px #120b09c9;
}

.skill-panel-top {
  display: flex;
  align-items: center;
  gap: 8px;
}

.skill-keycap {
  display: grid;
  place-items: center;
  flex: 0 0 34px;
  height: 34px;
  border: 1px solid #97734d;
  background: linear-gradient(#38292c, #1d1418);
  box-shadow: inset 0 0 0 2px #120e13, 0 2px 4px #0008;
  color: var(--active-skill-color, var(--equipment-gold));
  font: 700 1rem var(--font-display);
}

.hero-stage.is-casting .skill-keycap {
  animation: vessel-key-flare 780ms ease-out;
}

@keyframes vessel-key-flare {
  20% {
    border-color: var(--active-skill-color);
    box-shadow: inset 0 0 12px var(--active-skill-accent), 0 0 20px var(--active-skill-color);
  }
}

.skill-name {
  margin-top: 2px;
  color: var(--equipment-gold);
  font: 700 clamp(1rem, 1.18vw, 1.15rem) / 1.25 var(--font-display);
}

.skill-desc {
  margin-top: 7px;
  color: var(--equipment-ink);
  font: 1rem / 1.45 Georgia, serif;
}

.skill-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 8px;
  border: 1px solid #665039;
  background: #100d10;
}

.metric-box {
  padding: 4px 2px;
  text-align: center;
}

.metric-box + .metric-box {
  border-left: 1px solid #665039;
}

.metric-label {
  font-size: 0.68rem;
  letter-spacing: 0.015em;
}

.metric-val {
  color: var(--equipment-gold);
  font: 600 0.98rem / 1.4 Georgia, serif;
}

.skill-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px 12px;
  margin-top: 8px;
}

.cast-skill-btn {
  min-height: 36px;
  padding-inline: 14px;
}

.skill-status {
  color: var(--equipment-muted);
  font: italic 0.9rem / 1.35 Georgia, serif;
}

@media (min-width: 1050px) {
  .hero-stage {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    align-items: start;
    gap: clamp(12px, 1.25vw, 20px);
  }

  .hero-stage .equipment-heading {
    grid-column: 1 / -1;
    margin-bottom: 0;
  }

  .hero-dossier {
    grid-template-columns: minmax(0, 1fr);
    margin-top: 0;
  }
}

@media (min-width: 1440px) {
  .hero-dossier {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  }
}

@media (max-width: 760px) {
  .hero-dossier {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 500px) {
  .hero-card-img-wrap {
    height: clamp(84px, 27vw, 115px);
  }

  .hero-card-img-wrap img {
    width: 100%;
    object-fit: contain;
  }

  .hero-card-name {
    font-size: clamp(0.75rem, 3vw, 0.95rem);
    padding-block: 7px;
  }

  .hero-card-action {
    padding-inline: 1px;
    font-size: 0.68rem;
    letter-spacing: 0;
  }
}

@media (max-width: 380px) {
  .skill-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric-box:nth-child(3) {
    border-left: 0;
  }

  .metric-box:nth-child(n + 3) {
    border-top: 1px solid #665039;
  }
}

/* ==========================================================================
   SECTION IV — ARMORY RELIQUARY
   ========================================================================== */
.armory-section {
  isolation: isolate;
}

.armory-section::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, #08070d, #100d16a1 30%, #0d0a13d9 75%, #08070d),
    url('../assets/shots/noctis-keep.webp') center 57% / cover no-repeat;
}

.armory-wrap {
  max-width: 1720px;
  padding-inline: clamp(14px, 3vw, 50px);
}

.armory-crest {
  --armory-crest-size: clamp(30px, 2.6vw, 38px);
  display: grid;
  place-items: center;
  width: var(--armory-crest-size);
  height: var(--armory-crest-size);
  padding: 3px;
  border: 1px solid var(--equipment-trim);
  background: linear-gradient(#38292c, #1d1418);
  box-shadow: inset 0 0 0 2px #120e13;
}

.armory-crest img {
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: contain;
}

.armory-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 14px;
}

.armory-cat-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.armory-cat-btn {
  --game-button-height: 38px;
  --game-button-padding: 5px 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.armory-cat-btn span {
  color: var(--equipment-muted);
  font: 600 0.72rem var(--font-mono);
}

.rarity-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 13px;
  color: var(--equipment-muted);
  font: 600 0.73rem / 1.45 var(--font-display);
}

.rarity-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.rarity-legend span::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--tier-c);
  box-shadow: 0 0 6px var(--tier-c);
  transform: rotate(45deg);
}

.armory-display {
  position: relative;
  display: grid;
  grid-template-columns: minmax(215px, 0.78fr) minmax(0, 1.75fr) minmax(224px, 0.83fr);
  gap: clamp(10px, 2vw, 32px);
  align-items: center;
  margin-block: 12px 16px;
}

.armory-profile,
.armory-ledger {
  min-width: 0;
  padding: clamp(12px, 1.3vw, 21px);
  border-block: 1px solid #a57947a8;
  background: linear-gradient(110deg, #2e2124ee, #171318e8);
  box-shadow: inset 0 0 0 3px #120e1266, 0 12px 26px #05040877;
}

.armory-profile {
  border-left: 2px solid var(--tier-c, var(--equipment-gold));
}

.armory-ledger {
  border-right: 2px solid var(--tier-c, var(--equipment-gold));
}

.armory-ledger h4 {
  color: var(--equipment-gold);
  font: 700 0.87rem / 1.3 var(--font-display);
}

.armory-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
  height: clamp(400px, 40vw, 610px);
}

.armory-stage::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 47%, var(--weapon-glow, #ffe69440), transparent 65%);
  pointer-events: none;
}

.armory-orbit-ring {
  position: absolute;
  top: 48%;
  left: 50%;
  width: min(86%, 420px);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border: 1px solid #bd955b50;
  border-radius: 50%;
  box-shadow: 0 0 0 8px #100c1359, 0 0 0 9px #a5794747, inset 0 0 70px #0d0a10a8;
  pointer-events: none;
}

.armory-orbit-ring::before {
  content: '';
  position: absolute;
  inset: 9%;
  border: 1px dashed #cba16638;
  border-radius: 50%;
}

.armory-weapon-img {
  position: absolute;
  width: auto;
  height: 73%;
  object-fit: contain;
  filter: drop-shadow(0 14px 18px #000d) drop-shadow(0 0 16px var(--weapon-glow, #ffe69444));
  transform: rotate(-12deg);
  pointer-events: none;
}

.armory-canvas,
.armory-callout-lines {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.armory-canvas {
  z-index: 1;
  cursor: grab;
  overflow: hidden;
  touch-action: none;
  user-select: none;
}

.armory-canvas canvas {
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.armory-stage.is-dragging .armory-canvas {
  cursor: grabbing;
}

.armory-callout-lines {
  z-index: 2;
  pointer-events: none;
}

.armory-controls,
.armory-viewer-status {
  position: absolute;
  z-index: 3;
  inset: auto 0 4px;
  width: fit-content;
  max-width: 100%;
  margin-inline: auto;
  text-align: center;
}

.armory-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 5px 12px;
  padding: 4px 6px;
  background: #100c15ee;
  border: 1px solid #8a633e85;
  color: var(--equipment-muted);
  font: 0.85rem / 1.35 Georgia, serif;
}

.armory-controls > div {
  display: flex;
  gap: 4px;
}

.armory-view-btn {
  --game-button-height: 34px;
  --game-button-padding: 4px 8px;
  min-width: 34px;
  letter-spacing: 0;
}

.armory-viewer-status {
  padding: 5px 8px;
  color: var(--equipment-ink);
  background: #100c15e6;
  font-size: 0.8rem;
}

.armory-selector {
  position: absolute;
  z-index: 3;
  inset: 48% 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: start;
  transform: translateY(-50%);
  pointer-events: none;
}

.armory-nav-btn {
  --game-button-padding: 5px;
  display: grid;
  grid-template: "arrow preview" auto "name name" auto / 14px minmax(0, 1fr);
  justify-items: center;
  align-items: center;
  gap: 3px;
  width: clamp(66px, 7.6vw, 104px);
  min-height: 64px;
  pointer-events: auto;
  letter-spacing: 0;
}

.armory-nav-btn[data-armory-step="1"] {
  grid-template: "preview arrow" auto "name name" auto / minmax(0, 1fr) 14px;
}

.armory-nav-arrow {
  grid-area: arrow;
  width: 8px;
  height: 8px;
  border: solid currentColor;
  border-width: 2px 2px 0 0;
  transform: rotate(-135deg);
}

.armory-nav-btn[data-armory-step="1"] .armory-nav-arrow {
  transform: rotate(45deg);
}

.armory-nav-btn img {
  grid-area: preview;
  width: 100%;
  height: clamp(40px, 5vw, 70px);
  object-fit: contain;
  filter: drop-shadow(0 0 6px color-mix(in srgb, var(--preview-tier, #ecc678) 50%, transparent));
}

.armory-nav-name {
  grid-area: name;
  color: var(--equipment-ink);
  font-size: clamp(0.61rem, 0.78vw, 0.78rem);
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.armory-tier-pill,
.price-chip {
  display: inline-block;
  padding: 4px 7px;
  background: #1a1314;
  font: 600 0.7rem / 1.35 var(--font-display);
}

.armory-tier-pill {
  color: var(--tier-c, var(--equipment-gold));
  border: 1px solid var(--tier-c, var(--equipment-trim));
}

.ledger-subtitle {
  display: block;
  margin-top: 10px;
  color: var(--equipment-muted);
  font: 600 0.73rem / 1.4 var(--font-display);
  letter-spacing: 0.06em;
}

.ledger-title {
  margin-top: 3px;
  color: var(--equipment-ink);
  font: 700 clamp(1.35rem, 2.15vw, 2.24rem) / 1.05 var(--font-display);
  text-shadow: 0 2px #160e0d;
}

.ledger-perk {
  margin-top: 10px;
  color: var(--equipment-gold);
  font: 600 0.78rem / 1.45 var(--font-display);
}

.ledger-desc {
  margin-top: 7px;
  color: var(--equipment-ink);
  font: 1rem / 1.45 Georgia, serif;
}

.ledger-stats {
  display: grid;
  gap: 6px;
  margin-top: 9px;
}

.stat-row {
  padding: 6px 7px;
  border: 1px solid #a5794759;
  background: #191317;
}

.stat-row-head {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 2px 8px;
  margin-bottom: 4px;
  font: 0.71rem / 1.4 var(--font-mono);
}

.stat-row-head span { color: var(--equipment-muted); }
.stat-row-head strong { color: var(--equipment-ink); font-weight: 600; }

.stat-track {
  height: 5px;
  border: 1px solid #68503b;
  background: #0e0b0e;
  overflow: hidden;
}

.stat-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold-deep), var(--tier-c, var(--equipment-gold)));
}

.armory-weapon-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 6px 12px;
  margin-top: 10px;
}

.trail-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--equipment-muted);
  font: 0.72rem var(--font-mono);
}

.trail-chip i {
  width: 8px;
  height: 8px;
  background: var(--trail-c, #ffe694);
  box-shadow: 0 0 8px var(--trail-c, #ffe694);
  transform: rotate(45deg);
}

.price-chip {
  color: var(--equipment-gold);
  border: 1px solid #a5794773;
}

.apothecary-note {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 14px;
  margin-top: 10px;
  color: var(--equipment-muted);
  font: 0.875rem / 1.4 Georgia, serif;
}

.apothecary-note strong {
  color: var(--equipment-gold);
  font: 700 0.72rem / 1.35 var(--font-display);
}

.apothecary-note em {
  color: var(--emerald);
  font: 0.72rem var(--font-mono);
}

@media (max-width: 860px) {
  .armory-display {
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    gap: 10px;
  }

  .armory-stage {
    grid-column: 1 / -1;
    grid-row: 1;
    height: clamp(345px, 57vw, 490px);
  }

  .armory-profile {
    align-self: stretch;
  }
}

@media (max-width: 620px) {
  .armory-cat-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .armory-cat-btn,
  .armory-view-btn {
    --game-button-height: 44px;
  }

  .armory-cat-btn {
    --game-button-padding: 4px 6px;
    gap: 4px;
  }

  .armory-display {
    grid-template-columns: minmax(0, 1fr);
  }

  .armory-stage {
    --armory-controls-space: 78px;
    height: clamp(385px, 110vw, 470px);
  }

  .armory-canvas {
    height: calc(100% - var(--armory-controls-space));
  }

  .armory-orbit-ring {
    top: calc((100% - var(--armory-controls-space)) / 2);
    width: min(82%, 340px);
  }

  .armory-weapon-img {
    top: 8%;
    height: 61%;
  }

  .armory-profile,
  .armory-ledger {
    margin-inline: 0 12px;
  }

  .armory-selector {
    top: calc((100% - var(--armory-controls-space)) / 2);
  }

  .armory-nav-btn,
  .armory-nav-btn[data-armory-step="1"] {
    grid-template-columns: 1fr;
    grid-template-areas: "preview" "arrow" "name";
    width: clamp(68px, 19vw, 84px);
  }
}

/* ==========================================================================
   SECTION V — SHATTERED COVENANT (CHAPEL CLOCK, QUEST & LORE CODEX)
   ========================================================================== */
.codex-wrap,
.beta-wrap {
  max-width: none;
  padding-inline: clamp(8px, 1.25vw, 24px);
}

.codex-shell {
  --journal-gold: #f3d38a;
  --journal-ink: #f3e5cc;
  --journal-muted: #d1bea1;
  --journal-trim: #8a633e;
  --journal-paper:
    repeating-linear-gradient(117deg, #edcea007 0 1px, transparent 1px 5px),
    linear-gradient(125deg, #3b2a20, #251a17 62%, #1a1417);
  --game-frame-width: clamp(3px, 0.32vw, 4px);
  --game-frame-surface:
    repeating-linear-gradient(119deg, #bba88004 0 1px, transparent 1px 5px) padding-box,
    linear-gradient(160deg, #271b1d, #161015 54%, #201517) padding-box;
  padding: clamp(10px, 1.1vw, 16px);
}

.codex-banner {
  display: flex;
  align-items: center;
  gap: clamp(8px, 1.1vw, 14px);
  padding: clamp(10px, 1.35vw, 17px);
  border: 1px solid var(--journal-trim);
  background:
    linear-gradient(90deg, #160f17 8%, #170f19e6 38%, #170f1954 85%, #160f1799),
    url('../assets/shots/graveyard-cinema.webp') right 55% / cover no-repeat;
  box-shadow: inset 0 0 0 3px #160e13b3, 0 4px 12px #0008;
}

.codex-banner img {
  width: clamp(26px, 2.8vw, 40px);
  height: auto;
  flex-shrink: 0;
  filter: drop-shadow(0 0 10px #d4a46b54);
}

.codex-kicker {
  margin-bottom: 2px;
  color: var(--journal-muted);
  font: 700 0.73rem / 1.4 var(--font-display);
  letter-spacing: 0.09em;
}

.codex-banner h2 {
  color: var(--journal-gold);
  font: 700 clamp(1.25rem, 2.5vw, 2.2rem) / 1.1 var(--font-display);
  text-shadow: 0 2px #422516, 0 4px 14px #000;
}

.codex-intro {
  max-width: 82ch;
  margin-top: 5px;
  color: var(--journal-ink);
  font: 1rem / 1.38 Georgia, serif;
}

.codex-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-block: 8px;
  padding-bottom: 7px;
  border-bottom: 1px solid #a5794773;
}

.codex-tab,
.codex-panel,
.clock-action,
.waystone-btn,
.lore-filter {
  scroll-margin-top: 86px;
}

.codex-tab {
  --game-button-height: 36px;
  --game-button-padding: 5px 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 3px 9px;
  letter-spacing: 0;
}

.codex-tab span {
  color: var(--journal-muted);
  font: 500 0.68rem / 1.2 var(--font-mono);
}

.quest-layout {
  display: grid;
  grid-template-columns: clamp(224px, 21vw, 295px) minmax(0, 1fr);
  gap: clamp(7px, 0.85vw, 12px);
  align-items: start;
}

.chapel-clock-card,
.quest-journal,
.waystones-bar,
.lore-card {
  min-width: 0;
  border: 1px solid var(--journal-trim);
  box-shadow: inset 0 0 0 3px #191211, 0 4px 12px #0008;
}

.chapel-clock-card {
  position: sticky;
  top: 86px;
  padding: clamp(10px, 1.05vw, 14px);
  background:
    linear-gradient(180deg, #170f1880, #19111680 31%, #1b1319ed 58%, #201616 81%),
    url('../assets/shots/chapel.webp') center top / 100% auto no-repeat,
    #201616;
  text-align: center;
  transition: border-color 450ms ease, box-shadow 450ms ease;
}

.chapel-clock-card.is-midnight {
  border-color: #69bc97;
  box-shadow: inset 0 0 0 3px #10241e, 0 0 24px #4ce8a238;
}

.clock-kicker,
.quest-journal h3,
.waystones-heading h3,
.lore-toolbar h3 {
  color: var(--journal-gold);
  font: 700 clamp(0.95rem, 1.2vw, 1.1rem) / 1.22 var(--font-display);
  text-shadow: 0 2px #160e0d;
}

.clock-kicker {
  margin-bottom: 5px;
}

.clock-face {
  width: min(100%, clamp(106px, 10vw, 144px));
  margin-inline: auto;
}

.clock-svg {
  width: 100%;
  height: auto;
  filter: drop-shadow(0 6px 12px #000c);
}

.clock-rim {
  fill: #1c141b;
  stroke: url(#codex-clock-bronze);
  stroke-width: 7;
}

.clock-inner {
  fill: url(#codex-clock-face);
  stroke: #ad834c;
  stroke-width: 1.2;
}

.chapel-clock-card.is-midnight .clock-rim {
  stroke: var(--emerald);
}

.clock-ticks {
  color: #e2bd7dcc;
}

.clock-xii {
  fill: var(--gold-bright);
  font: 700 13px var(--font-display);
}

.clock-hand {
  stroke-linecap: round;
  transform-origin: 100px 100px;
  transition: transform 1.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.clock-hand.hour {
  stroke: var(--gold-bright);
  stroke-width: 4;
  transform: rotate(-3deg);
}

.clock-hand.minute {
  stroke: #f5ebd6;
  stroke-width: 2.6;
  transform: rotate(-30deg);
}

.chapel-clock-card.is-midnight .clock-hand {
  transform: rotate(0deg);
  stroke: var(--emerald);
}

.clock-pin {
  fill: var(--gold-bright);
}

.clock-readout {
  margin: 2px auto 0;
  color: var(--journal-gold);
  font: 700 clamp(1.16rem, 1.6vw, 1.4rem) / 1.15 var(--font-display);
  letter-spacing: 0.08em;
}

.chapel-clock-card.is-midnight .clock-readout {
  color: var(--emerald);
}

.clock-status {
  max-width: 38ch;
  margin: 5px auto 8px;
  color: var(--journal-ink);
  font: 1rem / 1.35 Georgia, serif;
}

.clock-action {
  --game-button-height: 36px;
  --game-button-padding: 5px 11px;
}

.quest-journal {
  padding: clamp(8px, 1.05vw, 14px);
  background: var(--journal-paper);
}

.quest-journal h3 {
  margin-bottom: 7px;
  padding-bottom: 6px;
  border-bottom: 1px solid #a5794773;
}

.quest-timeline {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  list-style: none;
}

.quest-step {
  --quest-rim: #88643f;
  --quest-seal: #38251e;
  --quest-mark: var(--journal-gold);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 7px;
  padding: clamp(7px, 0.75vw, 10px);
  border: 1px solid var(--quest-rim);
  background: linear-gradient(135deg, #2a1f1d, #191316 72%);
}

.quest-step.is-climax {
  --quest-rim: #be8057;
  --quest-seal: #5b2326;
  background: linear-gradient(135deg, #422324, #201618 78%);
}

.quest-step.is-awakened {
  --quest-rim: #69bc97;
  --quest-seal: #1d382c;
  --quest-mark: var(--emerald);
  background: linear-gradient(135deg, #20372d, #161a19 78%);
}

.quest-roman {
  display: grid;
  place-content: center;
  min-width: 32px;
  min-height: 34px;
  padding: 2px;
  border: 1px solid var(--quest-rim);
  color: var(--quest-mark);
  background: var(--quest-seal);
  box-shadow: inset 0 0 0 2px #140f14b3;
  text-align: center;
  font: 700 0.95rem / 1.1 var(--font-display);
}

.quest-roman span {
  font: 500 0.58rem / 1.2 var(--font-mono);
}

.quest-loc {
  display: block;
  color: var(--journal-muted);
  font: 500 0.75rem / 1.3 Georgia, serif;
}

.quest-step h4,
.lore-card h4 {
  margin-top: 2px;
  color: var(--journal-ink);
  font: 700 clamp(0.93rem, 1.1vw, 1.04rem) / 1.2 var(--font-display);
}

.quest-step p,
.lore-body {
  margin-top: 4px;
  color: var(--journal-ink);
  font: 1rem / 1.38 Georgia, serif;
}

.waystones-bar {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(0, 1.25fr);
  align-items: center;
  gap: 8px;
  padding: clamp(8px, 1.05vw, 14px);
  background: var(--journal-paper);
}

.waystones-heading {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 10px;
}

#waystones-count {
  padding: 3px 6px;
  border: 1px solid #a5794773;
  color: var(--emerald);
  background: #151814;
  font: 500 0.75rem / 1.25 var(--font-mono);
}

.waystones-intro p {
  margin-top: 4px;
  color: var(--journal-ink);
  font: 1rem / 1.38 Georgia, serif;
}

.waystones-buttons {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.waystone-btn {
  --game-button-height: 42px;
  --game-button-padding: 5px 7px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-content: center;
  align-items: center;
  gap: 2px 7px;
  min-width: 0;
  text-align: left;
  letter-spacing: 0;
}

.waystone-gem {
  grid-row: 1 / span 2;
  width: 9px;
  height: 9px;
  border: 1px solid #bc985e;
  background: #35252a;
  transform: rotate(45deg);
}

.waystone-state {
  color: var(--journal-muted);
  font: 500 0.68rem / 1.2 var(--font-mono);
}

.waystone-btn[aria-pressed="true"] {
  color: #d4f5d9;
  border-color: #69bc97;
  background: linear-gradient(#2e4a3a, #19352b 48%, #13261f 50%, #1a3128);
}

.waystone-btn[aria-pressed="true"] .waystone-gem {
  border-color: #c1ffdb;
  background: var(--emerald);
  box-shadow: 0 0 9px var(--emerald);
}

.waystone-btn[aria-pressed="true"] .waystone-state {
  color: var(--emerald);
}

.lore-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-block: 8px;
}

.lore-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.lore-filter {
  --game-button-height: 32px;
  --game-button-padding: 4px 8px;
  letter-spacing: 0;
}

.lore-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(6px, 0.75vw, 10px);
}

.lore-card {
  --entry-accent: #e6c282;
  padding: clamp(9px, 1vw, 14px);
  background: var(--journal-paper);
}

.lore-card[data-lore-kind="tablet"] { --entry-accent: #a6c3d4; }
.lore-card[data-lore-kind="relic"] { --entry-accent: #d5aaf7; }

.lore-card.is-secret-locked {
  --entry-accent: #d5aaf7;
  border-color: #9670ad;
  background: linear-gradient(125deg, #31233a, #1b1421 78%);
}

.lore-card.is-secret-unlocked {
  --entry-accent: var(--emerald);
  border-color: #69bc97;
  background: linear-gradient(125deg, #253c2c, #171d19 78%);
}

.lore-kind-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 3px 10px;
  margin-bottom: 6px;
  padding-bottom: 5px;
  border-bottom: 1px solid #a5794759;
}

.lore-kind-pill {
  color: var(--entry-accent);
  font: 700 0.73rem / 1.3 var(--font-display);
}

.lore-zone-pill {
  color: var(--journal-muted);
  font: 0.76rem / 1.3 Georgia, serif;
}

.lore-epigraph {
  margin-top: 4px;
  color: var(--journal-gold);
  font: italic 0.95rem / 1.4 Georgia, serif;
}

@media (min-width: 1540px) {
  .lore-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 920px) {
  .quest-layout {
    grid-template-columns: minmax(215px, 0.85fr) minmax(0, 1.3fr);
  }

  .quest-timeline {
    grid-template-columns: minmax(0, 1fr);
  }

  .lore-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .waystones-bar {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 640px) {
  .codex-banner {
    align-items: flex-start;
  }

  .codex-tabs,
  .lore-filters {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .lore-filters {
    width: 100%;
  }

  .codex-tab {
    flex-direction: column;
    --game-button-padding: 6px;
  }

  .codex-tab,
  .clock-action,
  .waystone-btn,
  .lore-filter {
    --game-button-height: 44px;
  }

  .quest-layout,
  .lore-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .chapel-clock-card {
    position: static;
  }

  .waystone-btn {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto;
    justify-items: center;
    gap: 5px;
    text-align: center;
  }

  .waystone-gem {
    grid-row: auto;
  }
}

@media (max-width: 460px) {
  .waystones-buttons {
    grid-template-columns: minmax(0, 1fr);
  }

  .waystone-btn {
    grid-template-columns: auto minmax(0, 1fr) auto;
    justify-items: start;
    gap: 8px;
    text-align: left;
  }
}

/* ==========================================================================
   CLOSED BETA NOTICE
   ========================================================================== */
.beta-section {
  padding-block: 0 clamp(16px, 2vw, 26px);
}

.beta-notice {
  --game-frame-width: 3px;
  --game-frame-surface:
    radial-gradient(ellipse at 8% 15%, #5940496e, transparent 65%) padding-box,
    linear-gradient(110deg, #281c20, #151117 72%) padding-box;
  display: flex;
  align-items: center;
  gap: clamp(12px, 1.6vw, 24px);
  padding: clamp(14px, 2vw, 26px);
}

.beta-notice img {
  flex-shrink: 0;
  width: clamp(36px, 4vw, 54px);
  height: auto;
}

.beta-notice h2 {
  color: var(--gold-bright);
  font: 700 clamp(1.2rem, 2vw, 1.85rem) / 1.15 var(--font-game-serif);
  text-wrap: balance;
}

.beta-notice p {
  margin-top: 5px;
  color: var(--ink-soft);
  font-size: clamp(0.84rem, 1.2vw, 0.98rem);
  line-height: 1.5;
}

/* ===========================================================================
   FOOTER & PORTFOLIO BRIDGE
   ========================================================================== */
.site-footer {
  position: relative;
  z-index: 2;
  padding: clamp(24px, 3.15vw, 44px) 0 clamp(22px, 2.6vw, 38px);
  background: linear-gradient(180deg, transparent, #050409 30%);
  border-top: 1px solid var(--line);
}

.footer-top {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: clamp(20px, 3vw, 36px);
  align-items: start;
  padding-bottom: clamp(20px, 2.4vw, 34px);
  border-bottom: 1px solid var(--line);
}

.footer-logos {
  --footer-logo-gap: clamp(8px, 1.5vw, 16px);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--footer-logo-gap);
  margin-bottom: 20px;
}

.footer-logo-entry {
  display: inline-flex;
  align-items: center;
  gap: var(--footer-logo-gap);
}

.footer-crest {
  width: clamp(34px, 11vw, 52px);
  height: auto;
}

.footer-x {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  color: var(--ink-muted);
}

.zlynnn-lockup {
  height: clamp(18px, 5.6vw, 28px);
  width: auto;
  opacity: 0.92;
}

.footer-az-lockup {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #e8faff;
  font: 700 0.72rem / 1.1 var(--font-sans);
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

@media (max-width: 500px) {
  .footer-az-lockup {
    flex-direction: column;
    gap: 3px;
    font-size: 0.63rem;
  }

  .footer-az-lockup img {
    width: 53px;
    height: auto;
  }
}

.footer-statement {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(1.6rem, 2.8vw, 2.45rem);
  line-height: 1.15;
  color: var(--ink);
  max-width: 24ch;
}

.footer-credit {
  margin-top: 14px;
  font-size: 0.92rem;
  color: var(--ink-soft);
}

.footer-credit .muted {
  color: var(--ink-muted);
}

.footer-links-col .eyebrow {
  display: block;
  margin-bottom: 8px;
}

.footer-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.footer-pill {
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--ink);
  background: var(--bg-panel);
  border: 1px solid var(--line);
  transition: all 220ms ease;
}

.footer-pill:hover {
  border-color: var(--gold);
  color: var(--gold-bright);
  transform: translateY(-1px);
}

.footer-pill.primary {
  background: linear-gradient(135deg, #f3d796, #cfa45e);
  color: #130f09;
  border-color: transparent;
  font-weight: 600;
}

.footer-bottom {
  margin-top: 24px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  color: var(--ink-muted);
}

/* Prevent any grid child from forcing horizontal page overflow */
.atlas-map-frame,
.atlas-dossier,
.hero-dossier,
.armory-ledger,
.arena-visual-card,
.orc-roster-panel,
.chapel-clock-card,
.footer-brand-block,
.footer-links-col {
  min-width: 0;
}

/* ==========================================================================
   RESPONSIVE BREAKPOINTS
   ========================================================================== */
@media (max-width: 1120px) {
  .hero-telemetry { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .atlas-grid,
  .footer-top { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 860px) {
  .nav-links, .nav-cta { display: none; }
  .mobile-toggle { display: flex; }
  .mobile-drawer { display: grid; }
  .section-header.split { grid-template-columns: minmax(0, 1fr); }
  .hero-telemetry { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 600px) {
  .site-header { padding: 10px 12px; }
  .nav-shell { padding: 8px 12px; gap: 8px; }
  .nav-title { font-size: 0.8rem; letter-spacing: 0.12em; }
  .nav-sub { display: none; }
  .audio-label { display: none; }
  .audio-pill { padding: 8px 10px; }
  .hero { --reel-top: 76px; padding-top: 90px; padding-bottom: 72px; }
  .hero-frame-border { inset: 8px; top: 70px; }
  .status-pill { font-size: 0.62rem; gap: 6px; padding: 6px 11px; letter-spacing: 0.08em; }
  .wordmark-stage { max-width: 94%; }
  .hero-headline { font-size: clamp(1.25rem, 5.7vw, 1.65rem); }
  .hero-lead { font-size: 0.94rem; }
  .hero-telemetry { grid-template-columns: minmax(0, 1fr); }
  .compare-tag { font-size: 0.6rem; padding: 4px 6px; }
  .scroll-cue { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .veil-curtain { display: none; }
  .lunar-canvas { display: none; }
  .wordmark-sheen { display: none; }
  .reveal { opacity: 1; transform: none; }
}
