/* ==========================================================================
   1. CORE THEME & VARIABLES
   ========================================================================== */
:root {
  --ui-grey: #8B8589;        
  --accent: #FDEE00;         
  --ui-hover: rgba(0, 0, 0, 0.2); 
  --content-bg: rgba(255, 255, 255, 0.45);    
  --content-area-bg: linear-gradient(180deg, #cbd5e1 0%, #94a3b8 100%);
  --text-light: #ffffff;     
  --text-main: #1e293b;      
  --text-muted: #475569;     
}

[data-theme="dark"] {
  --ui-grey: #334155;        
  --content-bg: rgba(15, 23, 42, 0.55);    
  --content-area-bg: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
  --text-main: #f8fafc;      
  --text-muted: #cbd5e1;     
  --ui-hover: rgba(0, 0, 0, 0.4);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body {
  background-color: var(--ui-grey);
  padding: 24px;
  height: 100vh;
  overflow: hidden;
  transition: background-color 0.35s ease;
}

/* ==========================================================================
   2. MAIN APP LAYOUT & SIDEBAR ENGINE
   ========================================================================== */
.app-container {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 17fr);
  height: 100%;
  gap: 24px;
  transition: grid-template-columns 0.45s cubic-bezier(0.25, 1, 0.5, 1), gap 0.45s ease;
}

.app-container.sidebar-hidden {
  grid-template-columns: minmax(0, 0px) minmax(0, 1fr);
  gap: 0px;
}

aside.sidebar-ui {
  position: relative;
  display: flex;
  flex-direction: column;
  color: var(--text-light);
  padding: 0; 
  perspective: 1000px;
  overflow: visible !important;
}

.sidebar-content-wrapper {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  min-width: 260px; 
  overflow: hidden; 
  opacity: 1;
  transform: translateX(0);
  transition: opacity 0.25s ease, transform 0.45s cubic-bezier(0.25, 1, 0.5, 1);
}

.app-container.sidebar-hidden .sidebar-content-wrapper {
  opacity: 0;
  transform: translateX(-40px);
  pointer-events: none;
}

/* --- 3D SWIVEL GLASS BADGE --- */
.brand-badge {
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 2px solid var(--accent);
  border-radius: 0px; 
  padding: 1.25rem 1rem 1rem 1rem;
  text-align: center;
  margin-top: 0; 
  margin-bottom: 2rem; 
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.2);
  cursor: pointer;
  transform-style: preserve-3d;
  will-change: transform;
  transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1), box-shadow 0.3s ease;
}

.brand-badge:hover {
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.35), 0 0 15px rgba(253, 238, 0, 0.2);
}

.brand-title {
  font-family: 'Cinzel', serif;
  font-size: 1.85rem;
  font-weight: 700;
  color: var(--text-light);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.1;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  transform: translateZ(20px);
}

.brand-subtitle {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.05rem;
  font-style: italic;
  color: #e2e8f0;
  letter-spacing: 0.05em;
  margin-top: 0.35rem;
  opacity: 0.9;
  transform: translateZ(10px);
}

/* --- NAVIGATION MENU --- */
nav {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;       
  margin-top: 1.25rem; 
  transition: max-height 0.4s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.3s ease;
  overflow: hidden;
  max-height: 800px;
  opacity: 1;
}

nav.collapsed {
  max-height: 0;
  opacity: 0;
  margin-top: 0;
}

nav a {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: #f1f5f9;
  text-decoration: none;
  padding: 0.9rem 1.25rem; 
  border-radius: 8px;
  background-color: rgba(255, 255, 255, 0.08);
  transition: all 0.2s ease;
  cursor: pointer;
  display: flex;
  align-items: center;
  border-left: 0px solid var(--accent);
}

nav a:hover, nav a.active {
  background-color: var(--ui-hover);
  color: var(--accent);
  transform: translateX(4px);
  border-left: 4px solid var(--accent);
  padding-left: calc(1.25rem - 4px);
}

/* --- FOOTER & THEME SWITCH --- */
.sidebar-footer {
  margin-top: auto;
  padding-left: 0.5rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
}

.footer-left {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  font-size: 0.85rem;
  color: #e2e8f0;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  opacity: 0.85;
}

.footer-links a {
  color: #e2e8f0;
  text-decoration: none;
  transition: color 0.2s ease, opacity 0.2s ease;
  cursor: pointer;
}

.footer-links a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.footer-separator {
  opacity: 0.4;
  font-size: 0.75rem;
}

.copyright-text {
  opacity: 0.7;
}

.theme-switch-oval {
  background: rgba(0, 0, 0, 0.35); 
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px; 
  cursor: pointer;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden; 
  padding: 0;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.15rem; 
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
  flex-shrink: 0;
  outline: none;
}

.theme-switch-oval:hover {
  border-color: rgba(253, 238, 0, 0.5);
  box-shadow: 0 0 15px rgba(253, 238, 0, 0.15);
}

.theme-highlight {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 60%; 
  background-color: var(--accent);
  z-index: 1;
  transform: skewX(-20deg); 
  transition: left 0.35s cubic-bezier(0.25, 1, 0.5, 1);
  pointer-events: none;
}

.theme-switch-oval[data-active="light"] .theme-highlight {
  left: -10%; 
}

.theme-switch-oval[data-active="dark"] .theme-highlight {
  left: 50%; 
}

.theme-option {
  flex: 1;
  padding: 0.55rem 1.5rem; 
  color: #f1f5f9;
  opacity: 0.65;
  font-weight: 600;
  transition: color 0.25s ease, opacity 0.25s ease;
  text-align: center;
  position: relative;
  z-index: 2; 
  user-select: none;
}

.theme-option.active {
  color: #1e293b;
  opacity: 1;
  font-weight: 700;
}

/* --- TRAPEZOID EDGE TOGGLE TAB --- */
.sidebar-edge-toggle {
  position: absolute;
  top: 50%;
  right: -24px; 
  transform: translateY(-50%);
  width: 16px;
  height: 80px;
  background: var(--accent);
  color: #0f172a;
  border: none;
  clip-path: polygon(0 18%, 100% 0%, 100% 100%, 0 82%);
  cursor: pointer;
  z-index: 1500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-left: 2px; 
  box-shadow: -2px 0 10px rgba(0, 0, 0, 0.25);
  transition: right 0.45s cubic-bezier(0.25, 1, 0.5, 1), width 0.2s ease, background-color 0.2s ease;
}

.sidebar-edge-toggle:hover {
  background: #fff433;
  width: 20px; 
  right: -24px;
}

.app-container.sidebar-hidden .sidebar-edge-toggle {
  right: -12px; 
}

.app-container.sidebar-hidden .sidebar-edge-toggle:hover {
  right: -13px;
  width: 32px;
}

.sidebar-edge-toggle .arrow-icon {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  transition: transform 0.45s cubic-bezier(0.25, 1, 0.5, 1);
}

.app-container.sidebar-hidden .sidebar-edge-toggle .arrow-icon {
  transform: rotate(180deg);
}

/* ==========================================================================
   3. SCREEN EDGE TRIGGERS & FLOATING CONTROLS
   ========================================================================== */
.left-screen-edge-trigger {
  position: fixed;
  top: 0;
  left: 0;
  width: 28px; 
  height: 100vh;
  z-index: 1400;
  cursor: pointer;
  pointer-events: none; 
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.app-container.sidebar-hidden ~ .left-screen-edge-trigger,
.app-container.sidebar-hidden .left-screen-edge-trigger {
  pointer-events: auto; 
}

.screen-edge-trigger {
  position: fixed;
  z-index: 1600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.screen-edge-trigger.top-edge {
  top: 0;
  left: 0;
  width: 100vw;
  height: 16px;
}

.screen-edge-trigger.top-edge .edge-glow-bar {
  width: 0%;
  height: 4px;
  border-radius: 0 0 4px 4px;
}

.screen-edge-trigger.top-edge:hover .edge-glow-bar {
  width: 40%;
  opacity: 1;
}

.screen-edge-trigger.right-edge {
  top: 0;
  right: 0;
  width: 16px;
  height: 100vh;
}

.screen-edge-trigger.right-edge .edge-glow-bar {
  width: 4px;
  height: 0%;
  border-radius: 4px 0 0 4px;
}

.screen-edge-trigger.right-edge:hover .edge-glow-bar {
  height: 40%;
  opacity: 1;
}

.screen-edge-trigger.bottom-edge {
  bottom: 0;
  left: 0;
  width: 100vw;
  height: 16px;
}

.screen-edge-trigger.bottom-edge .edge-glow-bar {
  width: 0%;
  height: 4px;
  border-radius: 4px 4px 0 0;
}

.screen-edge-trigger.bottom-edge:hover .edge-glow-bar {
  width: 40%;
  opacity: 1;
}

.edge-glow-bar {
  background: var(--accent);
  box-shadow: 0 0 15px var(--accent);
  opacity: 0;
  transition: all 0.35s cubic-bezier(0.25, 1, 0.5, 1);
  pointer-events: none;
}

.left-screen-edge-trigger:hover .edge-glow-bar {
  height: 40%; 
  opacity: 1;
}

/* --- PAGE BORDER BUBBLE BUTTONS --- */
.page-border-bubble {
  position: fixed;
  right: 0; 
  width: 64px; 
  height: 64px;
  background-color: var(--ui-grey); 
  border: 0 none !important; 
  outline: none !important;
  box-shadow: none !important; 
  border-radius: 50%;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1000;
  padding: 0;
  transition: color 0.25s ease;
}

.page-border-bubble:hover {
  color: var(--accent);
  background-color: var(--ui-grey);
  transform: none !important;
}

.page-border-bubble svg {
  width: 30px;
  height: 30px;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  transition: stroke 0.25s ease, color 0.25s ease;
  transform: none !important;
}

.page-border-bubble:hover svg {
  transform: none !important;
}

#btn-menu-toggle {
  top: 6px; 
}

#btn-back-to-top {
  bottom: 6px; 
}

.page-border-bubble svg.progress-ring {
  position: absolute;
  top: 0;
  left: 0;
  width: 64px;
  height: 64px;
  stroke-width: 3;
  pointer-events: none;
  z-index: 10;
  transform: none !important; 
}

.progress-ring__circle {
  stroke: var(--accent);
  fill: transparent;
  stroke-linecap: round;
  stroke-dasharray: 65.69 188.5;
  stroke-dashoffset: 65.69; 
  transition: stroke-dashoffset 0.05s linear;
}

.page-border-bubble .menu-icon {
  position: relative;
  z-index: 11;
}

/* ==========================================================================
   4. DRAWERS, POPUPS & MODALS
   ========================================================================== */
/* --- TABLE OF CONTENTS (TOC) DRAWER --- */
.toc-drawer {
  position: fixed;
  top: 76px; 
  right: 24px; 
  width: 320px;
  max-height: calc(100vh - 120px); 
  background-color: var(--content-bg);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-top: 3px solid var(--accent);
  border-radius: 16px;
  z-index: 2000;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.35);
  transform: translateY(-15px) scale(0.95);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.3s ease;
  overflow-y: auto;
}

.toc-drawer.open {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: auto;
}

.toc-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(139, 133, 137, 0.3);
  padding-bottom: 0.75rem;
}

.toc-header h2 {
  font-family: 'Cinzel', serif;
  font-size: 1.25rem;
  color: var(--text-main);
  letter-spacing: 0.05em;
}

.toc-close-btn {
  background: transparent;
  border: none;
  color: var(--text-main);
  cursor: pointer;
  padding: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease, transform 0.2s cubic-bezier(0.25, 1, 0.5, 1);
}

.toc-close-btn:hover {
  color: var(--accent);
  transform: rotate(90deg);
}

.toc-close-btn svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
}

#toc-links {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

#toc-links a {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-main);
  text-decoration: none;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  background: rgba(139, 133, 137, 0.08);
  transition: all 0.2s ease;
  cursor: pointer;
  display: block;
}

#toc-links a:hover {
  background-color: var(--ui-hover);
  color: var(--accent);
}

/* --- TOP COMMAND SEARCH DRAWER --- */
.search-drawer {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: var(--content-bg);
  backdrop-filter: blur(24px) saturate(150%);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
  border-bottom: 2px solid var(--accent);
  z-index: 1550;
  padding: 2rem 24px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.3s ease;
  display: flex;
  justify-content: center;
}

.search-drawer.open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.search-container {
  position: relative;
  width: 100%;
  max-width: 800px;
  display: flex;
  align-items: center;
  gap: 1rem;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 0.75rem 1.5rem;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.3);
}

.search-container svg {
  width: 24px;
  height: 24px;
  stroke: var(--accent);
  stroke-width: 2.2;
  fill: none;
}

.search-container input {
  background: transparent;
  border: none;
  outline: none;
  width: 100%;
  color: #ffffff;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.4rem;
  letter-spacing: 0.03em;
}

.search-container input::placeholder {
  color: #94a3b8;
  font-style: italic;
}

.search-close-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 0.25rem;
  display: flex;
  align-items: center;
  transition: color 0.2s ease, transform 0.2s ease;
}

.search-close-btn:hover {
  color: var(--accent);
  transform: scale(1.1);
}

/* --- GLOBAL SEARCH DROPDOWN POPUP --- */
.global-search-dropdown {
  position: absolute;
  top: calc(100% + 12px);
  left: 0;
  right: 0;
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
  transition: all 0.25s cubic-bezier(0.25, 1, 0.5, 1);
  z-index: 1600;
}

.global-search-dropdown.active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.search-result-item {
  display: flex;
  flex-direction: column;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  text-decoration: none;
  color: #ffffff;
  transition: background 0.15s ease, padding-left 0.2s ease;
}

.search-result-item:hover {
  background: rgba(255, 255, 255, 0.05);
  padding-left: 1.5rem;
}

.search-result-title {
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--text-light);
}

.search-result-meta {
  font-size: 0.8rem;
  color: var(--accent);
  margin-top: 0.2rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.search-view-more-btn {
  display: block;
  width: 100%;
  padding: 1rem;
  background: rgba(255, 244, 51, 0.1);
  color: var(--accent);
  text-align: center;
  font-weight: 700;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.search-view-more-btn:hover {
  background: var(--accent);
  color: #0f172a;
}

/* --- BOTTOM QUICK-JUMP & BOOKMARKS TRAY --- */
.bottom-dock-tray {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--content-bg);
  backdrop-filter: blur(24px) saturate(150%);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
  border-top: 2px solid var(--accent);
  z-index: 1550;
  padding: 1.5rem 2rem;
  box-shadow: 0 -15px 35px rgba(0, 0, 0, 0.4);
  transform: translateY(100%);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.3s ease;
}

.bottom-dock-tray.open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.dock-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
}

.dock-section h4 {
  color: var(--accent);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.75rem;
}

.dock-links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.dock-links a {
  color: var(--text-light);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
  cursor: pointer;
}

.dock-links a:hover {
  color: var(--accent);
}

/* ==========================================================================
   5. MAIN CONTENT AREA & HERO BANNER
   ========================================================================== */
main#content-area {
  position: relative;
  background: var(--content-area-bg); 
  border-radius: 0 16px 16px 0; 
  padding: 0; 
  color: var(--text-main);
  overflow-y: auto;
  overflow-x: hidden; 
  box-shadow: -4px 0 25px rgba(0, 0, 0, 0.15);
  transition: background 0.35s ease, color 0.35s ease, border-radius 0.45s ease;
  scrollbar-width: none; 
  -ms-overflow-style: none; 
}

main#content-area::-webkit-scrollbar {
  display: none; 
}

.app-container.sidebar-hidden main#content-area {
  border-radius: 16px;
}

.page-top-banner {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  height: 0; 
  overflow: visible;
  user-select: none;
  z-index: 1;
}

.banner-bg {
  position: absolute;
  top: 0; 
  left: 0;
  width: 100%;
  height: 540px; 
  object-fit: cover;
  object-position: center 35%;
  display: block;
  z-index: 1;
  will-change: transform;
  border-radius: 0 16px 0 0;
  -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 0%, rgba(0,0,0,1) 45%, rgba(0,0,0,0) 100%);
  mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 0%, rgba(0,0,0,1) 45%, rgba(0,0,0,0) 100%);
}

.scrolling-content {
  position: relative;
  z-index: 2;
  margin-top: 440px; 
  background-color: var(--content-bg);
  backdrop-filter: blur(14px) saturate(120%);
  -webkit-backdrop-filter: blur(14px) saturate(120%);
  border-radius: 24px 24px 16px 0; 
  padding: 3.5rem;
  color: var(--text-main);
  box-shadow: 0 -15px 35px rgba(0, 0, 0, 0.1);
  transition: background-color 0.35s ease, color 0.35s ease;
  min-height: calc(100% - 440px);
}

.hero-banner {
  position: relative;
  min-height: 460px;
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  padding: 3rem 2.5rem;
  margin-bottom: 3rem;
  border-left: 4px solid var(--accent);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.25);
  user-select: none;
}

.hero-bg {
  position: absolute;
  top: -24px; 
  left: -24px;
  right: -24px;
  bottom: -24px;
  width: calc(100% + 48px);
  height: calc(100% + 48px);
  object-fit: cover;
  object-position: center;
  display: block;
  z-index: 1;
  transform: translate3d(0, 0, 0) scale(1);
  will-change: filter, transform;
}

.hero-glass {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to top, rgba(15, 23, 42, 0.9) 0%, rgba(15, 23, 42, 0.35) 100%);
  z-index: 2;
  will-change: background;
}

.hero-content {
  position: relative;
  z-index: 3;
  width: 100%;
  max-width: 880px;
  color: #ffffff;
  display: flex;
  flex-direction: column;
}

.app-container.sidebar-hidden .hero-content {
  max-width: 1100px;
  transition: max-width 0.45s ease;
}

.hero-content h1 {
  font-family: 'Cinzel', serif;
  font-size: 2.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #ffffff;
  line-height: 1.1;
  margin-bottom: 0.5rem;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

.hero-content .tagline {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.4rem;
  font-style: italic;
  color: var(--accent);
  margin-bottom: 1rem;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

.hero-content p {
  line-height: 1.7;
  color: #f1f5f9;
  font-size: 1.05rem;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
  margin-bottom: 2rem;
}

.hero-action-bar {
  display: flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 14px;
  padding: 0.55rem 2rem 0.55rem 0.55rem;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  gap: 2.25rem; 
  flex-wrap: wrap;
}

.hero-btn {
  background-color: var(--accent);
  color: #0f172a;
  font-family: 'Cinzel', serif;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: none;
  border-radius: 10px;
  padding: 0.85rem 2.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.25, 1, 0.5, 1);
  box-shadow: 0 4px 15px rgba(253, 238, 0, 0.2);
  text-decoration: none;
}

.hero-btn:hover {
  transform: translateY(-2px);
  background-color: #fff433;
  box-shadow: 0 8px 25px rgba(253, 238, 0, 0.4);
}

.hero-btn svg {
  fill: currentColor;
  width: 14px;
  height: 14px;
  transition: transform 0.2s ease;
}

.hero-btn:hover svg {
  transform: translateX(3px);
}

.hero-stats-group {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.hero-stat {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.hero-stat-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #94a3b8;
}

.hero-stat-value {
  font-size: 1.15rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.03em;
}

.hero-stat-value.highlight {
  color: var(--accent);
  font-family: system-ui, sans-serif;
  text-transform: uppercase;
}

.hero-stat-divider {
  width: 1px;
  height: 38px;
  background-color: rgba(255, 255, 255, 0.18);
}

/* ==========================================================================
   6. GRID LAYOUTS & FEATURE CARDS
   ========================================================================== */
.section-header {
  font-family: 'Cinzel', serif;
  font-size: 1.4rem;
  color: var(--text-main);
  border-bottom: 1px solid rgba(139, 133, 137, 0.2);
  padding-bottom: 0.5rem;
  margin-top: 3rem;
  margin-bottom: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.section-header span {
  font-family: system-ui, sans-serif;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

.card-grid {
  display: grid;
  gap: 1.5rem;
}

.card-grid.featured-grid {
  grid-template-columns: repeat(12, 1fr);
}

.card-grid.featured-grid > .feature-card:nth-child(-n+3) {
  grid-column: span 4;
}

.card-grid.featured-grid > .feature-card:nth-child(n+4) {
  grid-column: span 3;
}

.app-container.sidebar-hidden .card-grid.featured-grid > .feature-card:nth-child(-n+2) {
  grid-column: span 6; 
}

.app-container.sidebar-hidden .card-grid.featured-grid > .feature-card:nth-child(n+3) {
  grid-column: span 3; 
}

.card-grid.news-grid {
  grid-template-columns: repeat(2, 1fr);
}

.app-container.sidebar-hidden .card-grid.news-grid {
  grid-template-columns: repeat(3, 1fr);
}

.feature-card {
  background: rgba(139, 133, 137, 0.05);
  border: 1px solid rgba(139, 133, 137, 0.2);
  border-radius: 12px;
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
  position: relative;
  overflow: hidden;
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background-color: transparent;
  transition: background-color 0.3s ease;
}

.feature-card:hover {
  transform: translateY(-5px);
  border-color: rgba(253, 238, 0, 0.6);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
  background: rgba(139, 133, 137, 0.08);
}

.feature-card:hover::before {
  background-color: var(--accent);
}

.card-meta {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-meta .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--accent);
}

.feature-card h3 {
  font-family: 'Cinzel', serif;
  font-size: 1.35rem;
  color: var(--text-main);
  margin-bottom: 0.75rem;
  line-height: 1.3;
}

.feature-card p {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.card-cta {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.35rem;
  transition: gap 0.2s ease, color 0.2s ease, transform 0.25s cubic-bezier(0.25, 1, 0.5, 1);
}

.feature-card:hover .card-cta {
  gap: 0.65rem;
  color: #bfa800; 
  transform: translateX(6px);
}

[data-theme="dark"] .feature-card:hover .card-cta {
  color: var(--accent);
}

/* ==========================================================================
   7. ZEN MODE FULL-SCREEN OVERRIDES
   ========================================================================== */
body.zen-mode {
  padding: 0 !important;
}

body.zen-mode .app-container {
  grid-template-columns: minmax(0, 0px) minmax(0, 1fr) !important;
  gap: 0px !important;
}

body.zen-mode aside.sidebar-ui,
body.zen-mode .page-border-bubble,
body.zen-mode .sidebar-edge-toggle,
body.zen-mode .toc-drawer {
  opacity: 0 !important;
  pointer-events: none !important;
}

body.zen-mode main#content-area {
  border-radius: 0px !important;
  box-shadow: none !important;
}

.zen-progress-track {
  position: fixed;
  top: 0;
  right: 0;
  width: 4px;
  height: 100vh;
  background: rgba(255, 255, 255, 0.05);
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

body.zen-mode .zen-progress-track {
  opacity: 1;
}

.zen-progress-bar {
  width: 100%;
  height: 0%;
  background: var(--accent);
  box-shadow: -2px 0 12px var(--accent);
  border-radius: 0 0 4px 4px;
  transition: height 0.1s out-quad;
}

/* ==========================================================================
   8. MEDIA QUERIES & RESPONSIVENESS
   ========================================================================== */
@media (max-width: 1200px) {
  .card-grid.featured-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .card-grid.featured-grid > .feature-card:nth-child(-n+3),
  .card-grid.featured-grid > .feature-card:nth-child(n+4) {
    grid-column: span 1;
  }
}

@media (max-width: 768px) {
  .hero-action-bar {
    flex-direction: column;
    align-items: stretch;
    padding: 1rem;
    width: 100%;
  }
  .hero-stats-group {
    justify-content: space-around;
    width: 100%;
    padding-top: 0.5rem;
  }
  .hero-btn {
    justify-content: center;
  }
  .card-grid.featured-grid,
  .card-grid.news-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   9. GAME REVIEWS: PILL SORTERS & FILTERING
   ========================================================================== */
.review-filters-wrapper {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2.5rem;
}

/* Base style matching your .theme-switch-oval design */
.pill-sorter-row {
  display: flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  padding: 0.35rem;
  width: fit-content;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.pill-sorter-row::-webkit-scrollbar {
  display: none;
}

.pill-sorter-row:hover {
  border-color: rgba(253, 238, 0, 0.4);
}

/* Secondary sorter animation container */
.secondary-sorter-container {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transform: translateY(-10px);
  transition: all 0.35s cubic-bezier(0.25, 1, 0.5, 1);
}

.secondary-sorter-container.active {
  max-height: 80px;
  opacity: 1;
  transform: translateY(0);
}

.sorter-pill {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.15rem;
  font-weight: 600;
  color: #f1f5f9;
  background: transparent;
  border: none;
  border-radius: 999px;
  padding: 0.5rem 1.5rem;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.25s cubic-bezier(0.25, 1, 0.5, 1);
  opacity: 0.7;
}

.sorter-pill:hover {
  opacity: 1;
  color: var(--accent);
}

.sorter-pill.active {
  background-color: var(--accent);
  color: #0f172a;
  font-weight: 700;
  opacity: 1;
  box-shadow: 0 0 15px rgba(253, 238, 0, 0.25);
  transform: scale(1.02);
}

/* ==========================================================================
   10. GAME REVIEWS: DYNAMIC REVIEW CARDS
   ========================================================================== */
.review-card {
  position: relative;
  background: rgba(139, 133, 137, 0.05);
  border: 1px solid rgba(139, 133, 137, 0.2);
  border-radius: 16px;
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.5rem;
  overflow: hidden;
  transition: all 0.35s cubic-bezier(0.25, 1, 0.5, 1);
  cursor: pointer;
}

/* >= 9.5 Card Border Glow */
.review-card[data-border-glow="true"] {
  border: 2px solid var(--accent) !important;
  box-shadow: 0 0 25px rgba(253, 238, 0, 0.25), inset 0 0 15px rgba(253, 238, 0, 0.05);
}

.review-card[data-border-glow="true"]:hover {
  box-shadow: 0 10px 35px rgba(253, 238, 0, 0.4), inset 0 0 20px rgba(253, 238, 0, 0.1);
  transform: translateY(-6px);
}

/* Card Header: Platforms, Date, Score */
.review-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 1rem;
  z-index: 2;
}

.header-left-meta {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.platform-badges-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.platform-badge {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-light);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.review-date {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-style: italic;
}

/* Dynamic Score Badge */
.score-badge {
  font-family: 'Cinzel', serif;
  font-size: 1.4rem;
  font-weight: 700;
  padding: 0.4rem 0.8rem;
  border-radius: 10px;
  min-width: 54px;
  text-align: center;
  line-height: 1;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5);
  transition: all 0.3s ease;
}

/* >= 9.0 Score Glow */
.score-badge[data-score-glow="true"] {
  color: var(--accent);
  border-color: var(--accent);
  text-shadow: 0 0 10px var(--accent);
  box-shadow: 0 0 18px rgba(253, 238, 0, 0.5), inset 0 0 8px rgba(253, 238, 0, 0.3);
}

/* Card Body */
.review-card-body {
  z-index: 2;
}

.review-card-body h3 {
  font-family: 'Cinzel', serif;
  font-size: 1.5rem;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

.review-card-body p {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Card Footer with Read Review CTA & Fading Cover Art */
.review-card-footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  position: relative;
  min-height: 90px;
  margin-top: auto;
  z-index: 2;
}

.read-review-cta {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  z-index: 3;
  padding-bottom: 0.5rem;
  transition: gap 0.2s ease, color 0.2s ease;
}

.review-card:hover .read-review-cta {
  gap: 0.75rem;
  color: var(--accent);
}

/* Cover Art Container - Scaled up for visual impact */
.box-cover-art-container {
  position: absolute;
  right: -1.75rem;
  bottom: -1.75rem;
  width: 240px;  /* Increased from 140px */
  height: 280px; /* Increased from 150px */
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
  border-radius: 0 0 16px 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.box-cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transform: rotate(-8deg) translateY(15px) scale(1.05);
  transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
  /* Smoother radial mask so the larger image fades gently into the card text */
  -webkit-mask-image: radial-gradient(circle at 85% 85%, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0) 70%);
  mask-image: radial-gradient(circle at 85% 85%, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0) 70%);
}

.review-card:hover .box-cover-img {
  transform: rotate(-4deg) translateY(0px) scale(1.15);
}

/* ==========================================================================
   11. GAME REVIEWS: DYNAMIC BANNER & FIXED GRID LAYOUT
   ========================================================================== */
/* Fixes the thin card bug by ensuring auto-fitting responsive columns */
.reviews-grid-layout {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 1.75rem;
  width: 100%;
}

@media (max-width: 768px) {
  .reviews-grid-layout {
    grid-template-columns: 1fr;
  }
}

/* Dynamic Platform Header Banner */
.platform-banner-container {
  position: relative;
  width: 100%;
  height: 220px;
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 2rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.3);
  background: #0f172a;
}

.platform-banner-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 1;
  transform: scale(1);
  transition: opacity 0.35s ease, transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
  will-change: opacity, transform;
}

.platform-banner-container.is-switching .platform-banner-img {
  opacity: 0;
  transform: scale(1.05);
}

.platform-banner-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(15, 23, 42, 0.9) 0%, rgba(15, 23, 42, 0.2) 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.75rem 2.5rem;
  pointer-events: none;
}

.platform-banner-title {
  font-family: 'Cinzel', serif;
  font-size: 2.2rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.05em;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
  transition: transform 0.35s cubic-bezier(0.25, 1, 0.5, 1);
}

.platform-banner-subtitle {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.2rem;
  font-style: italic;
  color: var(--accent);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}

/* Card Filtering Animation State */
.review-card.is-hidden {
  display: none !important;
}

/* ==========================================================================
   12. GAME REVIEWS: TOOLBAR CONTROLS & SPACING FIXES
   ========================================================================== */
/* Removes the home page banner margin when applied to scrolling-content */
.scrolling-content.no-banner {
  margin-top: 0 !important;
  min-height: 100% !important;
}

/* Hides the head image container when viewing All Platforms */
.platform-banner-container.is-hidden {
  display: none !important;
}

/* Multi-variable sorting and filtering ribbon */
.review-controls-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.25rem;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 14px;
  padding: 1rem 1.5rem;
  margin-bottom: 2rem;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.control-group {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex: 1 1 auto;
}

.control-label {
  font-family: system-ui, sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #94a3b8;
  white-space: nowrap;
}

.control-select {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: #ffffff;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.15rem;
  font-weight: 600;
  padding: 0.4rem 2.2rem 0.4rem 1rem;
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  width: 100%;
  min-width: 160px;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23FDEE00' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 16px;
}

.control-select:hover, .control-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 10px rgba(253, 238, 0, 0.2);
}

.control-select option {
  background: #0f172a;
  color: #ffffff;
  font-family: system-ui, sans-serif;
  font-size: 0.95rem;
}

/* ==========================================================================
   13. GAME REVIEWS: TOOLBAR, SLIDER & VISIBILITY CONTROLS
   ========================================================================== */
/* Crucial: Forces filtered cards to disappear completely */
.review-card.is-hidden {
  display: none !important;
}

.score-slider-container {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: rgba(15, 23, 42, 0.6);
  padding: 0.5rem 1.25rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  flex: 1 1 auto;
}

.slider-val {
  font-family: 'Cinzel', serif;
  font-size: 1.1rem;
  color: var(--accent);
  min-width: 42px;
  display: inline-block;
  text-align: right;
}

.glass-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  min-width: 130px;
  height: 6px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  outline: none;
  cursor: pointer;
  transition: background 0.2s ease;
}

.glass-slider:hover {
  background: rgba(255, 255, 255, 0.35);
}

.glass-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px rgba(253, 238, 0, 0.6);
  cursor: pointer;
  transition: transform 0.15s cubic-bezier(0.25, 1, 0.5, 1);
}

.glass-slider::-webkit-slider-thumb:hover {
  transform: scale(1.25);
}

.glass-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border: none;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px rgba(253, 238, 0, 0.6);
  cursor: pointer;
  transition: transform 0.15s ease;
}

.glass-slider::-moz-range-thumb:hover {
  transform: scale(1.25);
}

/* Ensure jump targets account for sticky headers/top bars */
[data-jump-anchor="true"] {
    scroll-margin-top: 2rem; /* Adjust this value if you have a fixed top header */
}

/* Quick-Jump Dock Styling */
.quick-jump-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 1.5rem;
    padding: 0.5rem 0;
}

.jump-pill {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 999px;
    color: #e0e0e0;
    padding: 0.35rem 0.85rem;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.jump-pill:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}