@view-transition {
  navigation: auto;
}

@font-face {
  font-family: 'Fraunces Sanctum';
  src: url('/assets/fonts/fraunces-latin-wght-normal.woff2') format('woff2');
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Jakarta Sanctum';
  src: url('/assets/fonts/plus-jakarta-sans-latin-wght-normal.woff2') format('woff2');
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Plex Tactical Mono';
  src: url('/assets/fonts/ibm-plex-mono-latin-500-normal.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg-abyss: #09110E;
  --bg-sanctum: #0D1914;
  --bg-glass: rgba(11, 22, 18, 0.86);
  --bg-elevated: #12241D;
  --border-subtle: #1D3B2F;
  --border-glow: rgba(52, 211, 153, 0.48);
  --jade: #34D399;
  --jade-bright: #6EE7B7;
  --jade-ink: #041A11;
  --amber: #F59E0B;
  --amber-bright: #FDE68A;
  --crimson: #EF4444;
  --crimson-bright: #FCA5A5;
  --sapphire: #38BDF8;
  --text-main: #ECFDF5;
  --text-body: #D5E5DD;
  --text-muted: #94AEA2;
  --rail-w: 252px;
  --spring: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  background-color: var(--bg-abyss);
  color: var(--text-main);
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--bg-abyss);
  color: var(--text-body);
  font-family: 'Jakarta Sanctum', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.7;
  overflow-x: hidden;
}

/* Ambient Particle Canvas */
#bg-particles-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.55;
}

/* Skip Link */
.skip-link {
  position: fixed;
  top: -100px;
  left: 16px;
  z-index: 9999;
  background: var(--jade);
  color: var(--jade-ink);
  font-weight: 700;
  padding: 10px 16px;
  border-radius: 8px;
  text-decoration: none;
}
.skip-link:focus {
  top: 12px;
}

/* =========================================================================
   LEFT FIXED TACTICAL RAIL (Desktop) & MOBILE TOP/BOTTOM BARS
   ========================================================================= */
.tactical-rail {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--rail-w);
  z-index: 40;
  background: linear-gradient(180deg, rgba(8, 16, 13, 0.97) 0%, rgba(11, 23, 18, 0.95) 100%);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  padding: 20px 16px;
  gap: 16px;
  view-transition-name: sanctum-rail;
}

.rail-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-main);
  padding: 6px 8px;
  border-radius: 12px;
  border: 1px solid transparent;
  transition: border-color 200ms ease, background 200ms ease;
}
.rail-brand:hover {
  border-color: var(--border-glow);
  background: rgba(52, 211, 153, 0.06);
}

.brand-sigil {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: radial-gradient(circle, #143629 0%, #091410 100%);
  border: 1.5px solid var(--jade);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.brand-sigil::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 14px;
  border: 1.5px solid rgba(52, 211, 153, 0.45);
  animation: tickHalo 0.6s infinite ease-out;
}
.brand-diamond {
  color: var(--jade-bright);
  font-size: 18px;
  line-height: 1;
}
.brand-title {
  display: block;
  font-family: 'Fraunces Sanctum', Georgia, serif;
  font-weight: 700;
  font-size: 16.5px;
  letter-spacing: 0.2px;
  color: var(--text-main);
}
.brand-sub {
  display: block;
  font-family: 'Plex Tactical Mono', monospace;
  font-size: 10.5px;
  color: var(--jade-bright);
  letter-spacing: 0.5px;
}

@keyframes tickHalo {
  0% { transform: scale(0.96); opacity: 0.85; }
  100% { transform: scale(1.13); opacity: 0; }
}

.rail-search-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: #0A1511;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  color: var(--text-body);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: border-color 200ms ease, transform 200ms var(--spring);
}
.rail-search-trigger:hover {
  border-color: var(--jade);
  transform: translateY(-1px);
}
.rail-search-trigger kbd {
  font-family: 'Plex Tactical Mono', monospace;
  font-size: 11px;
  background: #132820;
  color: var(--jade-bright);
  padding: 2px 6px;
  border-radius: 5px;
  border: 1px solid #234739;
}

.rail-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.rail-section-label {
  font-family: 'Plex Tactical Mono', monospace;
  font-size: 10.5px;
  letter-spacing: 1px;
  color: var(--text-muted);
  padding: 4px 10px 2px;
  text-transform: uppercase;
}
.rail-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--text-body);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  border: 1px solid transparent;
  transition: background 180ms ease, color 180ms ease, border-color 180ms ease, transform 220ms var(--spring);
}
.rail-link:hover {
  background: rgba(52, 211, 153, 0.08);
  color: var(--text-main);
  transform: translateX(3px);
}
.rail-link.is-active {
  background: linear-gradient(90deg, rgba(52, 211, 153, 0.18), rgba(52, 211, 153, 0.04));
  border-color: rgba(52, 211, 153, 0.45);
  color: var(--jade-bright);
}
.rail-glyph {
  width: 22px;
  text-align: center;
  color: var(--jade);
  font-size: 14px;
  flex-shrink: 0;
}

/* Live 0.6s Tick Metronome Box inside Rail */
.rail-tick-box {
  margin-top: auto;
  padding: 12px;
  border-radius: 12px;
  background: #0A1511;
  border: 1px solid var(--border-subtle);
}
.tick-box-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: 'Plex Tactical Mono', monospace;
  font-size: 11px;
  color: var(--jade-bright);
  margin-bottom: 8px;
}
.tick-bar-track {
  height: 5px;
  border-radius: 99px;
  background: #132820;
  overflow: hidden;
}
.tick-bar-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, var(--jade), var(--amber));
  transform-origin: left center;
  animation: tickSweep 0.6s infinite linear;
}
@keyframes tickSweep {
  0% { transform: scaleX(0.08); }
  100% { transform: scaleX(1); }
}
.rail-fan-note {
  margin-top: 8px;
  font-size: 11px;
  line-height: 1.45;
  color: var(--text-muted);
}

/* Mobile Header & Mobile Bottom Thumb Dock */
.mobile-topbar {
  display: none;
}
.mobile-bottom-dock {
  display: none;
}

/* =========================================================================
   MAIN STAGE SHELL & FULL-BLEED SANCTUM HEROES
   ========================================================================= */
.app-stage {
  margin-left: var(--rail-w);
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.hero-sanctum {
  position: relative;
  padding: 34px 36px 42px;
  background-color: #08110E;
  background-image: var(--hero-bg);
  background-size: cover;
  background-position: center;
  border-bottom: 1px solid var(--border-subtle);
  overflow: hidden;
}

.hero-backdrop-vignette {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 68% 32%, rgba(9, 17, 14, 0.32) 0%, rgba(9, 17, 14, 0.78) 70%),
    linear-gradient(180deg, rgba(9, 17, 14, 0.48) 0%, rgba(9, 17, 14, 0.92) 100%);
  pointer-events: none;
}

.hero-bento-grid {
  position: relative;
  z-index: 2;
  max-width: 1360px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(420px, 1.25fr);
  gap: 28px;
  align-items: start;
}

.inner-hero-shell {
  position: relative;
  z-index: 2;
  max-width: 1120px;
  margin: 0 auto;
}

.breadcrumb-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-family: 'Plex Tactical Mono', monospace;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 14px;
}
.breadcrumb-bar a {
  color: var(--jade-bright);
  text-decoration: none;
}
.breadcrumb-bar a:hover {
  text-decoration: underline;
}

.eyebrow-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(12, 34, 26, 0.88);
  border: 1px solid rgba(52, 211, 153, 0.45);
  font-family: 'Plex Tactical Mono', monospace;
  font-size: 11.5px;
  color: var(--jade-bright);
  margin-bottom: 14px;
}

.tick-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--jade);
  box-shadow: 0 0 10px var(--jade);
  animation: tickDotBlink 0.6s infinite alternate;
}
@keyframes tickDotBlink {
  from { transform: scale(0.85); opacity: 0.65; }
  to { transform: scale(1.2); opacity: 1; }
}

h1, h2, h3 {
  font-family: 'Fraunces Sanctum', Georgia, serif;
  color: var(--text-main);
  line-height: 1.24;
  margin-top: 0;
}

h1 {
  font-size: clamp(1.75rem, 2.6vw, 2.55rem);
  margin-bottom: 16px;
  letter-spacing: -0.01em;
  text-shadow: 0 4px 22px rgba(0, 0, 0, 0.85);
}

h2 {
  font-size: clamp(1.38rem, 2vw, 1.88rem);
  margin-bottom: 14px;
}

h3 {
  font-size: 1.16rem;
  margin-bottom: 8px;
  color: #F0FDF4;
}

.lead-answer {
  font-size: 1.02rem;
  line-height: 1.72;
  color: #E2EFE9;
  background: rgba(9, 19, 15, 0.78);
  border-left: 3px solid var(--jade);
  padding: 14px 18px;
  border-radius: 0 12px 12px 0;
  margin: 0 0 18px;
  backdrop-filter: blur(8px);
}

a {
  color: var(--jade-bright);
  text-underline-offset: 3px;
}
a:hover {
  color: #A7F3D0;
}

.quick-jump-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}
.jump-chip {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(15, 34, 27, 0.9);
  border: 1px solid var(--border-subtle);
  color: var(--jade-bright);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: transform 220ms var(--spring), border-color 180ms ease, background 180ms ease;
}
.jump-chip:hover {
  transform: translateY(-2px);
  border-color: var(--jade);
  background: rgba(20, 48, 38, 0.95);
}

.hotkey-legend-card {
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 16px 18px;
  backdrop-filter: blur(12px);
}
.card-kicker {
  font-family: 'Plex Tactical Mono', monospace;
  font-size: 11px;
  color: var(--amber-bright);
  letter-spacing: 0.7px;
  margin-bottom: 10px;
}
.hotkey-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
  font-size: 13.5px;
}
.hotkey-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  color: var(--text-body);
}
kbd {
  font-family: 'Plex Tactical Mono', monospace;
  font-size: 11.5px;
  padding: 2px 7px;
  border-radius: 5px;
  background: #12271F;
  border: 1px solid #295443;
  color: #F8FAFC;
}

/* =========================================================================
   INTERACTIVE OCELLUS 0.6s TICK SIMULATOR COCKPIT
   ========================================================================= */
.simulator-cockpit {
  background: rgba(9, 18, 15, 0.92);
  border: 1.5px solid #254D3D;
  border-radius: 18px;
  padding: 16px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(110, 231, 183, 0.14);
  backdrop-filter: blur(16px);
}

.sim-top-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.sim-mode-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.sim-mode-btn, .sim-util-btn {
  padding: 7px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: #0D1C16;
  color: var(--text-body);
  font-family: 'Jakarta Sanctum', sans-serif;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 180ms ease;
}
.sim-mode-btn:hover, .sim-util-btn:hover {
  border-color: var(--jade);
  color: var(--text-main);
}
.sim-mode-btn.is-active {
  background: var(--jade);
  border-color: var(--jade);
  color: var(--jade-ink);
  font-weight: 700;
}
.sim-mode-enrage.is-active {
  background: #F59E0B;
  border-color: #F59E0B;
  color: #1C1102;
}
.sim-utility-btns {
  display: flex;
  gap: 6px;
}

.sim-keybind-drawer[hidden],
.sim-status-banner[hidden],
.sim-replay-card[hidden],
.sanctum-toast[hidden] {
  display: none !important;
}

.sim-keybind-drawer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  margin-bottom: 12px;
  background: #0C1813;
  border: 1px dashed var(--amber);
  border-radius: 10px;
  font-size: 12.5px;
}
.remap-slot {
  padding: 5px 10px;
  border-radius: 6px;
  border: 1px solid #285241;
  background: #11231C;
  color: var(--text-main);
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
}
.remap-slot.is-listening {
  border-color: var(--amber);
  background: #2C1E08;
  color: var(--amber-bright);
}

.sim-hud-compact {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.hud-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border-radius: 999px;
  background: #0B1712;
  border: 1px solid #1C3A2E;
  font-family: 'Plex Tactical Mono', monospace;
  font-size: 12px;
  color: var(--text-muted);
}
.hud-chip strong { color: var(--text-main); }
.hud-hp strong { color: #6EE7B7; }
.hud-pray strong { color: #7DD3FC; }
.hud-phase strong { color: #FDE68A; }
.hud-tick { margin-left: auto; }

.sim-canvas-wrap {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  border: 1.5px solid #285643;
  background: radial-gradient(circle at 50% 48%, #10281F 0%, #050B09 100%);
  box-shadow: inset 0 0 42px rgba(0, 0, 0, 0.85), 0 12px 32px rgba(0, 0, 0, 0.45);
}
#ocellus-arena-canvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 15 / 13;
  cursor: pointer;
  touch-action: manipulation;
}
.sim-status-banner {
  padding: 8px 12px;
  background: rgba(10, 22, 17, 0.95);
  border-top: 1px solid #1B382C;
  font-size: 12.5px;
  color: #D1FAE5;
}

.sim-controls-deck {
  margin-top: 12px;
  display: grid;
  gap: 10px;
}

.prayer-switch-cluster {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.pray-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 58px;
  padding: 8px 6px;
  border-radius: 11px;
  background: #0D1B15;
  border: 1.5px solid #234638;
  color: var(--text-main);
  font-family: inherit;
  cursor: pointer;
  transition: transform 140ms var(--spring), border-color 140ms ease, box-shadow 140ms ease;
}
.pray-btn:hover {
  transform: translateY(-2px);
}
.pray-icon {
  font-size: 17px;
  line-height: 1;
}
.pray-name {
  font-size: 12.5px;
  font-weight: 700;
}
.pray-magic.is-active {
  background: rgba(14, 52, 79, 0.85);
  border-color: var(--sapphire);
  box-shadow: 0 0 18px rgba(56, 189, 248, 0.35);
}
.pray-missiles.is-active {
  background: rgba(74, 41, 10, 0.85);
  border-color: #FB923C;
  box-shadow: 0 0 18px rgba(251, 146, 60, 0.35);
}
.pray-melee.is-active {
  background: rgba(76, 18, 30, 0.85);
  border-color: #F43F5E;
  box-shadow: 0 0 18px rgba(244, 63, 94, 0.35);
}

.combat-action-cluster {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.style-btn, .brew-btn {
  flex: 1 1 auto;
  min-height: 40px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid #244839;
  background: #0E1D17;
  color: var(--text-body);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.style-btn.is-selected {
  background: #17382B;
  border-color: var(--jade);
  color: var(--jade-bright);
}
.style-hold.is-selected {
  background: #332309;
  border-color: var(--amber);
  color: var(--amber-bright);
}
.brew-btn {
  background: #28210B;
  border-color: #785A17;
  color: var(--amber-bright);
}

.sim-run-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.btn-primary-jade {
  flex: 1 1 200px;
  min-height: 46px;
  padding: 10px 18px;
  border-radius: 10px;
  border: none;
  background: var(--jade);
  color: var(--jade-ink);
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 180ms var(--spring), background 180ms ease;
}
.btn-primary-jade:hover {
  background: var(--jade-bright);
  transform: translateY(-1px);
}
.btn-ghost-slate {
  min-height: 46px;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: #0D1B15;
  color: var(--text-main);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
}
.btn-ghost-slate:hover {
  border-color: var(--jade);
}

/* Post-Drill Replay Timeline */
.sim-replay-card {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #0A1410;
  border: 1px solid #1C382D;
}
.replay-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px;
  font-size: 12px;
  margin-bottom: 8px;
}
.replay-header strong {
  font-family: 'Plex Tactical Mono', monospace;
  color: var(--jade-bright);
}
.replay-header span {
  color: var(--text-muted);
}
.replay-tick-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 8px;
}
.replay-placeholder {
  font-size: 12px;
  color: var(--text-muted);
}
.tick-chip {
  font-family: 'Plex Tactical Mono', monospace;
  font-size: 10.5px;
  padding: 3px 6px;
  border-radius: 5px;
  border: 1px solid transparent;
}
.tick-chip.is-ok {
  background: rgba(16, 66, 48, 0.8);
  border-color: #34D399;
  color: #A7F3D0;
}
.tick-chip.is-parry {
  background: rgba(74, 49, 10, 0.85);
  border-color: #F59E0B;
  color: #FDE68A;
}
.tick-chip.is-fail {
  background: rgba(79, 18, 29, 0.9);
  border-color: #EF4444;
  color: #FECDD3;
}
.replay-mistake-list {
  margin: 0;
  padding-left: 18px;
  font-size: 12.5px;
  color: var(--text-body);
}

/* =========================================================================
   EDITORIAL CONTENT SANCTUM, SWIMLANES, FIGURES, TABLES & TILES
   ========================================================================= */
.content-sanctum {
  max-width: 1140px;
  width: 100%;
  margin: 0 auto;
  padding: 36px 36px 64px;
  display: grid;
  gap: 36px;
}

.phase-swimlane-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 20px;
}
.swimlane-node {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(10, 22, 18, 0.88);
  border: 1px solid var(--border-subtle);
  text-decoration: none;
  color: var(--text-body);
  transition: transform 220ms var(--spring), border-color 180ms ease;
}
.swimlane-node:hover {
  transform: translateY(-3px);
  border-color: var(--jade);
}
.swimlane-danger {
  border-color: rgba(245, 158, 11, 0.5);
}
.swim-tag {
  font-family: 'Plex Tactical Mono', monospace;
  font-size: 11px;
  color: var(--jade-bright);
}
.swimlane-danger .swim-tag {
  color: var(--amber-bright);
}
.swimlane-node strong {
  color: var(--text-main);
  font-size: 14.5px;
}
.swimlane-node span:last-child {
  font-size: 12.5px;
  color: var(--text-muted);
}

.prose-section {
  background: rgba(12, 24, 19, 0.78);
  border: 1px solid var(--border-subtle);
  border-radius: 18px;
  padding: 28px 30px;
  min-width: 0;
}

.section-tag {
  font-family: 'Plex Tactical Mono', monospace;
  font-size: 11.5px;
  letter-spacing: 0.9px;
  color: var(--jade-bright);
  margin-bottom: 8px;
}

.prose-section p {
  margin: 0 0 16px;
}
.prose-section p:last-child {
  margin-bottom: 0;
}

.blueprint-figure {
  margin: 22px 0;
  background: #08110D;
  border: 1px solid #224637;
  border-radius: 14px;
  overflow: hidden;
}
.blueprint-figure img {
  display: block;
  width: 100%;
  height: auto;
}
.blueprint-figure figcaption {
  padding: 12px 16px;
  font-size: 13px;
  color: var(--text-muted);
  border-top: 1px solid #19352A;
}
.blueprint-figure figcaption strong {
  color: var(--text-main);
}

.three-drill-cards, .relay-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 20px;
}
.drill-card, .state-box {
  background: #0B1712;
  border: 1px solid #1E3E31;
  border-radius: 14px;
  padding: 18px 20px;
}
.drill-step {
  font-family: 'Plex Tactical Mono', monospace;
  font-size: 11px;
  color: var(--amber-bright);
  margin-bottom: 6px;
}
.dual-state-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 18px 0;
}

.tactical-bullets, .protocol-steps {
  margin: 14px 0;
  padding-left: 22px;
  display: grid;
  gap: 10px;
}

/* Tables */
.table-scroll-frame {
  width: 100%;
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid #204234;
  background: #09130F;
  margin-top: 16px;
}
.master-table-frame {
  max-height: 680px;
  overflow-y: auto;
}
.sanctum-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  min-width: 660px;
}
.sanctum-table caption {
  text-align: left;
  padding: 12px 16px;
  font-family: 'Plex Tactical Mono', monospace;
  font-size: 12px;
  color: var(--jade-bright);
  background: #0C1A15;
  border-bottom: 1px solid #1D3B2F;
}
.sanctum-table th, .sanctum-table td {
  padding: 11px 14px;
  border-bottom: 1px solid #162E24;
  text-align: left;
  vertical-align: top;
}
.sanctum-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #10241C;
  color: #ECFDF5;
  font-weight: 700;
}
.sanctum-table tbody tr:hover td {
  background: rgba(52, 211, 153, 0.05);
}
.phase-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  background: #132C22;
  border: 1px solid #285946;
  color: var(--jade-bright);
  font-family: 'Plex Tactical Mono', monospace;
  font-size: 11px;
  white-space: nowrap;
}
.pray-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  background: #1A2332;
  color: #BAE6FD;
  font-size: 12px;
  font-weight: 600;
}
.mono-cell {
  font-family: 'Plex Tactical Mono', monospace;
  font-size: 12px;
  color: var(--amber-bright);
}
.cell-sub, .cell-muted {
  font-size: 12px;
  color: var(--text-muted);
}
.penalty-cell {
  color: #FECDD3;
}
.jade-highlight {
  color: var(--jade-bright);
}
.sort-th-btn {
  background: none;
  border: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  padding: 0;
  text-align: left;
}
.sort-th-btn:hover {
  color: var(--jade-bright);
}

/* Tile Marker Cards & Mini Grid */
.tile-packs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 16px;
  margin-top: 20px;
}
.tile-pack-card {
  background: #0A1612;
  border: 1px solid #214436;
  border-radius: 14px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}
.pack-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}
.pack-room-badge {
  display: inline-block;
  font-family: 'Plex Tactical Mono', monospace;
  font-size: 11px;
  color: var(--amber-bright);
  margin-bottom: 4px;
}
.pack-count-pill {
  font-family: 'Plex Tactical Mono', monospace;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 99px;
  background: #132B21;
  color: var(--jade-bright);
  white-space: nowrap;
}
.pack-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
}
.tile-mini-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px;
  padding: 8px;
  border-radius: 10px;
  background: #070F0C;
  border: 1px solid #183328;
}
.grid-cell {
  aspect-ratio: 1;
  border-radius: 4px;
  background: #0D1B16;
  border: 1px solid #162C23;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.grid-cell.is-marked {
  background: rgba(16, 42, 33, 0.9);
  border: 1.5px solid var(--mark, #34D399);
  box-shadow: inset 0 0 8px var(--mark, #34D399);
}
.grid-cell b {
  font-family: 'Plex Tactical Mono', monospace;
  font-size: 8.5px;
  color: #F8FAFC;
  text-align: center;
  line-height: 1;
}
.pack-actions {
  margin-top: auto;
  display: grid;
  gap: 8px;
}
.btn-copy-tiles {
  width: 100%;
  min-height: 42px;
  padding: 9px 14px;
  border-radius: 9px;
  border: 1px solid var(--jade);
  background: rgba(52, 211, 153, 0.14);
  color: var(--jade-bright);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 180ms ease, color 180ms ease, transform 180ms var(--spring);
}
.btn-copy-tiles:hover {
  background: var(--jade);
  color: var(--jade-ink);
  transform: translateY(-1px);
}
.raw-json-Preview summary {
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
}
.raw-json-Preview pre {
  margin: 8px 0 0;
  padding: 10px;
  border-radius: 8px;
  background: #060C09;
  border: 1px solid #193328;
  max-height: 120px;
  overflow: auto;
  font-size: 11px;
  white-space: pre-wrap;
  word-break: break-all;
}

/* Gear Tier Tabs */
.gear-tab-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0;
}
.gear-tab-btn {
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: #0B1713;
  color: var(--text-body);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
}
.gear-tab-btn.is-active {
  background: var(--jade);
  border-color: var(--jade);
  color: var(--jade-ink);
}
html.js-ready .gear-tab-panel:not(.is-active) {
  display: none;
}

/* 120-Row Database Filter Toolbar */
.db-filter-toolbar {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr auto;
  gap: 12px;
  align-items: end;
  padding: 16px;
  border-radius: 12px;
  background: #0B1712;
  border: 1px solid #1E3F32;
  margin-top: 16px;
}
.filter-field {
  display: grid;
  gap: 5px;
  font-size: 12px;
  color: var(--text-muted);
}
.filter-field input, .filter-field select {
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid #264F3E;
  background: #07100D;
  color: var(--text-main);
  font-family: inherit;
  font-size: 13.5px;
}
.db-count-readout {
  font-family: 'Plex Tactical Mono', monospace;
  font-size: 12.5px;
  color: var(--jade-bright);
  padding-bottom: 10px;
}

/* FAQ & Next Steps Relay */
.faq-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
}
.faq-item {
  background: #0A1611;
  border: 1px solid #1C3A2E;
  border-radius: 12px;
  padding: 18px 20px;
}
.faq-item p {
  font-size: 14px;
  color: var(--text-body);
  margin: 0;
}

.next-steps-relay {
  background: linear-gradient(135deg, rgba(13, 32, 25, 0.92), rgba(9, 19, 15, 0.94));
  border: 1px solid #254E3E;
  border-radius: 18px;
  padding: 28px 30px;
}
.relay-card {
  display: block;
  padding: 18px 20px;
  border-radius: 14px;
  background: #0A1511;
  border: 1px solid #1F4033;
  text-decoration: none;
  color: var(--text-body);
  transition: transform 220ms var(--spring), border-color 180ms ease;
}
.relay-card:hover {
  transform: translateY(-3px);
  border-color: var(--jade);
}
.relay-kicker {
  display: block;
  font-family: 'Plex Tactical Mono', monospace;
  font-size: 10.5px;
  color: var(--amber-bright);
  margin-bottom: 6px;
}
.relay-card p {
  margin: 0;
  font-size: 13.5px;
  color: var(--text-muted);
}

.disclaimer-callout-box {
  padding: 18px 20px;
  border-radius: 12px;
  background: #141912;
  border: 1px solid var(--amber);
}

/* Footer */
.sanctum-footer {
  margin-top: auto;
  border-top: 1px solid var(--border-subtle);
  background: #070E0B;
  padding: 28px 36px 36px;
}
.footer-inner {
  max-width: 1140px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 20px;
  font-size: 13px;
  color: var(--text-muted);
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}
.footer-links a {
  color: var(--jade-bright);
  text-decoration: none;
}
.footer-links a:hover {
  text-decoration: underline;
}

/* Global Toast & Ctrl+K Command Palette Modal */
.sanctum-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 90;
  padding: 12px 18px;
  border-radius: 10px;
  background: #0E2B20;
  border: 1.5px solid var(--jade);
  color: #ECFDF5;
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
}

.cmdk-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(4, 9, 7, 0.82);
  backdrop-filter: blur(6px);
  display: grid;
  place-items: start center;
  padding: 9vh 16px 24px;
}
.cmdk-backdrop[hidden] {
  display: none;
}
.cmdk-dialog {
  width: min(680px, 100%);
  background: #0C1914;
  border: 1.5px solid var(--jade);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.75);
}
.cmdk-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid #1E3E31;
}
.cmdk-header input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-main);
  font-family: inherit;
  font-size: 15px;
  outline: none;
}
.cmdk-close-btn {
  padding: 5px 10px;
  border-radius: 6px;
  border: 1px solid #264D3D;
  background: #11241C;
  color: var(--text-muted);
  cursor: pointer;
}
.cmdk-results {
  list-style: none;
  margin: 0;
  padding: 8px;
  max-height: 380px;
  overflow-y: auto;
}
.cmdk-item a {
  display: block;
  padding: 10px 12px;
  border-radius: 9px;
  text-decoration: none;
  color: var(--text-body);
}
.cmdk-item a:hover, .cmdk-item a:focus {
  background: rgba(52, 211, 153, 0.14);
}
.cmdk-item-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-main);
}
.cmdk-item-sub {
  font-size: 12px;
  color: var(--text-muted);
}

/* Progressive Scroll Reveal (Zero JS-disabled trap!) */
html.js-ready .reveal-block.will-animate {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 420ms ease, transform 420ms var(--spring);
}
html.js-ready .reveal-block.will-animate.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* =========================================================================
   RESPONSIVE BREAKPOINTS (960px / 768px / 390px / 320px ZERO OVERFLOW)
   ========================================================================= */
@media (max-width: 1120px) {
  .hero-bento-grid {
    grid-template-columns: 1fr;
  }
  .phase-swimlane-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .three-drill-cards, .relay-grid {
    grid-template-columns: 1fr;
  }
  .db-filter-toolbar {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 960px) {
  .tactical-rail {
    display: none;
  }
  .mobile-topbar {
    position: sticky;
    top: 0;
    z-index: 45;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: rgba(8, 16, 13, 0.96);
    border-bottom: 1px solid var(--border-subtle);
    backdrop-filter: blur(10px);
    view-transition-name: sanctum-mobile-top;
  }
  .mobile-brand-link {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--text-main);
    font-family: 'Fraunces Sanctum', serif;
    font-weight: 700;
    font-size: 15px;
  }
  .mobile-search-btn {
    padding: 7px 11px;
    border-radius: 8px;
    border: 1px solid #264E3E;
    background: #10231B;
    color: var(--jade-bright);
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 700;
  }
  .mobile-bottom-dock {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    background: rgba(7, 15, 12, 0.98);
    border-top: 1px solid #23493A;
    padding: 4px 4px calc(4px + env(safe-area-inset-bottom));
    view-transition-name: sanctum-mobile-dock;
  }
  .dock-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 4px 2px;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 10.5px;
    font-weight: 700;
    border-radius: 8px;
  }
  .dock-link.is-active {
    color: var(--jade-bright);
    background: rgba(52, 211, 153, 0.12);
  }
  .dock-icon {
    font-size: 15px;
    line-height: 1.1;
  }

  .app-stage {
    margin-left: 0;
    padding-bottom: 66px;
  }
  .hero-sanctum {
    padding: 20px 16px 26px;
  }
  .content-sanctum {
    padding: 22px 16px 40px;
    gap: 22px;
  }
  .prose-section, .next-steps-relay {
    padding: 20px 16px;
  }
  .sanctum-footer {
    padding: 22px 16px 84px;
  }
  .dual-state-grid, .faq-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .sim-telemetry-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .phase-swimlane-strip, .db-filter-toolbar {
    grid-template-columns: 1fr;
  }
  .prayer-switch-cluster {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
  }
  .pray-btn {
    padding: 6px 3px;
  }
  .pray-name {
    font-size: 11px;
  }
  .pray-btn kbd, .combat-action-cluster kbd {
    display: none;
  }
  .tile-packs-grid {
    grid-template-columns: 1fr;
  }
  .sanctum-toast {
    left: 12px;
    right: 12px;
    bottom: 72px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  #bg-particles-canvas {
    display: none !important;
  }
}
