/* =====================================================================
   GLOBAL DESIGN TOKENS & THEMING (CSS Variables)
   ===================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@500;600;700&family=Cormorant+Garamond:ital,wght@0,400;0,600;1,400&display=swap');

@font-face {
  font-family: 'MatrixBold';
  src: url('matrix-bold.ttf') format('truetype');
  font-weight: bold;
  font-style: normal;
}

@font-face {
  font-family: 'Mplantin';
  src: url('Mplantin.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}

:root {
  /* Color Palette */
  --bg-dark: #121214;
  --bg-card: #18171a;
  --bg-surface: #1a1815;
  --bg-button: #1e1b17;
  
  --color-gold: #c5a059;
  --color-gold-bright: #ffd700;
  --color-gold-dim: #a88a4e;
  --color-gold-muted: #b89752;
  
  --text-primary: #d4ceb8;
  --text-heading: #e5dfd0;
  --text-muted: #b8af9c;
  --text-disabled: #666053;
  
  --border-dark: #28241e;
  --border-muted: #363027;
  --border-gold: #c5a059;
  --border-gold-subtle: rgba(197, 160, 89, 0.3);

  /* Typography */
  --font-serif: 'Cormorant Garamond', serif;
  --font-heading: 'Cinzel', serif;

  /* Layout & Utility */
  --radius-sm: 3px;
  --radius-md: 4px;
  --radius-lg: 6px;
  --transition-fast: all 0.2s ease;
}

/* =====================================================================
   BASE & CONTAINER UTILITIES
   ===================================================================== */
body {
  background-color: var(--bg-dark);
  color: var(--text-primary);
  font-family: var(--font-serif);
  margin: 0;
  min-height: 100vh;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 30px 20px;
}

.container-md {
  max-width: 1050px;
}

.container-wide {
  max-width: 1400px;
}

.header-container {
  width: 100%;
  margin: 0 auto;
  padding: 30px 20px 0 20px;
  box-sizing: border-box;
  flex-shrink: 0;
}

.container.tight-top {
  padding-top: 10px;
  margin-top: 10px;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--color-gold-dim); /* Matches the Quick Start text color */
}

/* =====================================================================
   BORDERLESS ZEBRA CONTENT BLOCKS (SUBTLE SURFACE SHIFT)
   ===================================================================== */
.zebrablock1,
.zebrablock2 {
  border: none;
  margin: 0;
  padding: 50px 0;
  width: 100%;
}

/* Darker aged paper / parchment surface block */
.zebrablock1 {
  background-color: #e8dfcc; /* Muted, deeper antique paper tone */
  color: #24201c; /* Deep dark brown for high-contrast body text */
  border-top: 1px solid #cfc2a9;
  border-bottom: 1px solid #cfc2a9;
}

.zebrablock1 h1,
.zebrablock1 h2,
.zebrablock1 h3,
.zebrablock1 h4 {
  color: #6b501b; /* Dark antique bronze for strong heading visibility */
}

.zebrablock1 h1,
.zebrablock1 h2,
.zebrablock1 h3,
.zebrablock1 h4 {
  color: #8c6d28; /* Deep rich gold/bronze for heading contrast */
}

.zebrablock1 h1,
.zebrablock1 h2,
.zebrablock1 h3,
.zebrablock1 h4 {
  color: var(--color-gold-dim);
}

/* Base dark header/body background block */
.zebrablock2 {
  background-color: var(--bg-dark); /* #121214 */
  color: var(--text-primary);
}

.zebrablock2 h1,
.zebrablock2 h2,
.zebrablock2 h3,
.zebrablock2 h4 {
  color: var(--color-gold-dim);
}

/* =====================================================================
   SHARED BUTTON & FLEX UTILITIES
   ===================================================================== */
.btn-base {
  font-family: var(--font-heading);
  border-radius: var(--radius-md);
  cursor: pointer;
  text-decoration: none;
  transition: var(--transition-fast);
  box-sizing: border-box;
}

.flex-between-center {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.flex-center-column {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* =====================================================================
   HEADER & NAVIGATION BAR
   ===================================================================== */
.navbar {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  padding: 15px 0 !important;
  margin-bottom: 20px !important;
  border-bottom: 1px solid var(--border-dark) !important;
  min-height: 60px !important;
  box-sizing: border-box;
}

.brand-logo-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.brand-logo-container:hover {
  opacity: 0.85;
}

.brand-logo-svg {
  width: 48px !important;
  height: 28px !important;
  margin-bottom: 4px;
  flex-shrink: 0;
}

.brand-logo {
  font-family: var(--font-heading);
  font-size: 1.25rem !important;
  font-weight: 600;
  color: var(--text-heading);
  letter-spacing: 2px;
  text-transform: uppercase;
  line-height: 1.2 !important;
}

.nav-links {
  display: flex !important;
  gap: 16px !important;
  align-items: center;
}

.nav-btn {
  composes: btn-base;
  font-family: var(--font-heading);
  border-radius: var(--radius-md);
  cursor: pointer;
  text-decoration: none;
  transition: var(--transition-fast);
  padding: 6px 14px;
  background-color: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border-muted);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 1px;
}

.nav-btn.active {
  color: var(--color-gold-muted);
  border-color: #6a583d;
  background-color: rgba(197, 160, 89, 0.05);
}

.nav-btn:hover:not(:disabled) {
  color: var(--color-gold);
  border-color: var(--color-gold);
  background-color: rgba(197, 160, 89, 0.08);
}

.nav-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  border-color: var(--border-dark);
  color: var(--text-disabled);
}

/* =====================================================================
   PRIMARY ACTION BUTTONS
   ===================================================================== */
.action-btn {
  font-family: var(--font-heading);
  border-radius: var(--radius-md);
  cursor: pointer;
  text-decoration: none;
  transition: var(--transition-fast);
  padding: 5px 12px;
  background-color: var(--bg-surface);
  color: var(--text-heading);
  border: 1px solid var(--border-gold);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.action-btn:hover:not(:disabled) {
  background-color: var(--color-gold);
  color: var(--bg-dark);
  border-color: var(--text-heading);
  box-shadow: 0 0 12px rgba(197, 160, 89, 0.4);
}

.action-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  border-color: var(--border-muted);
  background-color: #141311;
  color: var(--text-disabled);
  box-shadow: none;
}

/* =====================================================================
   INDEX & DECKS GRID STYLES
   ===================================================================== */
.quick-start-box {
  margin-bottom: 50px;
}

.quick-start-title {
  font-family: var(--font-heading);
  color: var(--color-gold-dim);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  text-align: center;
  margin-top: 0;
  margin-bottom: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
}

.quick-start-title::before,
.quick-start-title::after {
  content: '';
  height: 1px;
  width: 45px;
  background: linear-gradient(90deg, transparent, var(--color-gold-dim), transparent);
}

.decks-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 30px;
}

.deck-card {
  background-color: var(--bg-card);
  border: 1px solid #262320;
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.deck-card:hover {
  border-color: #544733;
  transform: translateY(-2px);
}

.deck-cover-link {
  width: 100%;
  aspect-ratio: 850 / 560;
  display: block;
  overflow: hidden;
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  border: none;
}

.deck-cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: sepia(15%) contrast(105%);
  transition: filter 0.3s ease, transform 0.3s ease;
}

.deck-card:hover .deck-cover-img {
  filter: sepia(0%);
  transform: scale(1.015);
}

.study-btn {
  font-family: var(--font-heading);
  border-radius: var(--radius-md);
  cursor: pointer;
  text-decoration: none;
  transition: var(--transition-fast);
  width: 100%;
  padding: 11px 10px;
  background-color: var(--bg-button);
  color: #d8b467;
  border: 1px solid #4a3e2e;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 1.2px;
  text-align: center;
  box-sizing: border-box;
}

.study-btn:hover {
  background-color: var(--color-gold);
  color: var(--bg-dark);
  border-color: var(--color-gold);
  box-shadow: 0 0 12px rgba(197, 160, 89, 0.25);
}

.promo-section {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 25px;
  padding-top: 20px;
  border-top: 1px solid #23201b;
}

.promo-card {
  background-color: transparent;
  border: 1px dashed #2e2820;
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: center;
  color: #b3a996;
}

.promo-card h3 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 1.2rem;
  margin-top: 0;
  margin-bottom: 15px;
  color: var(--text-primary);
}

/* =====================================================================
   DECK CONTROLS & SUBMENU STYLES
   ===================================================================== */
.deck-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  position: relative;
}

.deck-submenu {
  display: none;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  width: 95%;
  min-width: 260px;
  background: var(--bg-surface);
  border: 1px solid var(--border-gold);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.85);
  border-radius: var(--radius-md);
  padding: 0.6rem 0.75rem;
  z-index: 20;
  flex-direction: column;
  gap: 0.35rem;
}

.deck-submenu.active {
  display: flex;
}

.submenu-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-heading);
  font-size: 0.75rem;
  color: var(--color-gold);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border-gold-subtle);
  padding-bottom: 0.3rem;
  margin-bottom: 0.2rem;
}

.submenu-btn {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.4rem 0.5rem;
  font-family: var(--font-heading);
  font-size: 0.8rem;
  color: #e6dac3;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.02);
  transition: var(--transition-fast);
}

.submenu-btn:hover {
  background: rgba(197, 160, 89, 0.2);
  border-color: var(--border-gold);
  color: #fff;
}

/* Star Rating / Difficulty Label Styling */
.star-rating {
  font-size: 0.85rem;
  letter-spacing: 2px;
  display: inline-flex;
  align-items: center;
  user-select: none;
}

.star-rating .varied-text {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  font-style: italic;
}

.star {
  color: #38342e;
  transition: color 0.2s;
}

.star.filled {
  color: var(--color-gold);
  text-shadow: 0 0 4px rgba(197, 160, 89, 0.4);
}

.submenu-btn:hover .star.filled {
  color: var(--color-gold-bright);
}

/* =====================================================================
   RESPONSIVE MEDIA QUERIES
   ===================================================================== */
@media (max-width: 768px) {
  .navbar {
    flex-direction: column !important;
    gap: 18px !important;
  }
  .decks-grid, 
  .promo-section {
    grid-template-columns: 1fr;
  }
}