/* Base Readability Enhancements */
body {
  font-weight: 400 !important;
}

p, a, span:not(.faq-icon) {
  opacity: 0.92 !important;
}

h1, h2, h3, h4, h5, h6 {
  opacity: 1 !important;
}

/* Light Theme Overrides */
html[data-theme="light"] {
  --black: #FDFBF7 !important;
  --cream: #1A1110 !important;
  --c0: #006E7A !important;
  --c1: #4A6600 !important;
  --c2: #006B40 !important;
  --c3: #8A4800 !important;
  --c4: #B33000 !important;
  --c5: #0047B3 !important;
  --c6: #5200CC !important;
}

/* Adapt backgrounds and borders in light mode */
html[data-theme="light"] .prog-card,
html[data-theme="light"] .mv-card,
html[data-theme="light"] .src-chairman-card,
html[data-theme="light"] .contact-form,
html[data-theme="light"] .faq-contact,
html[data-theme="light"] .placeholder-section,
html[data-theme="light"] .team-photo-placeholder,
html[data-theme="light"] .team-photo,
html[data-theme="light"] .story-stat-block {
  background: rgba(126,30,37,0.04) !important;
  border-color: rgba(126,30,37,0.2) !important;
}

html[data-theme="light"] .prog-card:hover,
html[data-theme="light"] .prog-card.mobile-hover {
  background: rgba(240, 210, 215, 0.95) !important; /* light tint of #7e1e25 */
}

html[data-theme="light"] .faq-search input,
html[data-theme="light"] .form-group input,
html[data-theme="light"] .form-group textarea,
html[data-theme="light"] .form-group select {
  background: rgba(0,0,0,0.02) !important;
  border-color: rgba(0,0,0,0.15) !important;
  color: var(--cream) !important;
}

/* Hide canvas in light mode — replaced by CSS texture */
html[data-theme="light"] canvas {
  display: none;
}

/* Warm corner glow texture — static ambient base in light mode */
html[data-theme="light"] body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 55% 45% at 10% 20%, rgba(126,30,37,0.08) 0%, transparent 70%),
    radial-gradient(ellipse 45% 55% at 90% 10%, rgba(204,68,0,0.05) 0%, transparent 65%),
    radial-gradient(ellipse 60% 50% at 75% 85%, rgba(126,30,37,0.07) 0%, transparent 70%),
    radial-gradient(ellipse 40% 60% at 20% 80%, rgba(61,0,0,0.05) 0%, transparent 60%);
}

/* Per-layer bloom overlay */
#layer-bloom {
  display: none;
}

html[data-theme="light"] #layer-bloom {
  display: block;
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.7s ease;
}

/* Cursor fix in light mode */
html[data-theme="light"] #cursor {
  background: var(--crimson);
  mix-blend-mode: normal;
}

html[data-theme="light"] #cursor-ring {
  border-color: rgba(126,30,37,0.35);
}

/* Progress dots fix in light mode */
html[data-theme="light"] .pdot {
  background: rgba(26,17,16,0.18) !important;
}

/* Fix gradients and overlays that use hardcoded blacks/darks */
html[data-theme="light"] #nav {
  background: linear-gradient(to bottom, rgba(253, 251, 247, 0.95), transparent) !important;
}

html[data-theme="light"] #menu-overlay {
  background: #FDFBF7 !important;
}

html[data-theme="light"] #menu-overlay::before {
  background: radial-gradient(ellipse at 50% 38%, rgba(126,30,37,0.1) 0%, rgba(253, 251, 247,0.1) 45%, transparent 72%) !important;
}

html[data-theme="light"] #nav-logo img,
html[data-theme="light"] .f-logo img {
  filter: invert(1) hue-rotate(180deg) brightness(0.2);
}

html[data-theme="light"] .f-tagline {
  border-top-color: rgba(26,17,16,0.18) !important;
}

/* Theme Toggle Button Styles */
.nav-buttons {
  display: flex;
  gap: 1rem;
  align-items: center;
}

#theme-toggle {
  width: 44px;
  height: 24px;
  border-radius: 100px;
  background: rgba(238,224,201,0.1);
  border: 1px solid rgba(238,224,201,0.28);
  padding: 0;
  position: relative;
  cursor: none;
  flex-shrink: 0;
  transition: background 0.3s, border-color 0.3s;
}

#theme-toggle::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--cream);
  top: 3px;
  left: 3px;
  transition: transform 0.35s cubic-bezier(.34,1.56,.64,1), background 0.3s;
}

#theme-toggle:hover {
  border-color: rgba(238,224,201,0.55);
}

html[data-theme="light"] #theme-toggle {
  background: rgba(126,30,37,0.08);
  border-color: rgba(126,30,37,0.28);
}

html[data-theme="light"] #theme-toggle::after {
  transform: translateX(20px);
  background: var(--crimson);
}

html[data-theme="light"] #theme-toggle:hover {
  border-color: var(--crimson);
}

@media(max-width: 480px) {
  .nav-buttons { gap: 0.5rem; }
}
