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

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

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

/* Light Theme Overrides */
html[data-theme="light"] {
  --bg: #f6eee3 !important;
  --text: #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"] .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,
html[data-theme="light"] .m-thumb,
html[data-theme="light"] .video-card {
  background: rgba(126,30,37,0.04);
  border-color: rgba(126,30,37,0.2);
}

html[data-theme="light"] .m-thumb:hover,
html[data-theme="light"] .video-card:hover {
  box-shadow: 0 14px 36px rgba(126,30,37,.12), 0 3px 8px rgba(0,0,0,.06);
}

html[data-theme="light"] .story-stat-block > div:nth-child(n+3),
html[data-theme="light"] .story-stat-block > div:nth-child(odd) {
  border-color: rgba(126,30,37,0.14);
}

html[data-theme="light"] .mv-card:hover {
  box-shadow: 0 14px 36px rgba(126,30,37,.12), 0 4px 10px rgba(0,0,0,.07);
}

html[data-theme="light"] .pillar-logo img.invert-light {
  filter: invert(1) brightness(0.85);
}

html[data-theme="light"] .pillar {
  background: rgba(126,30,37,0.03);
  border-color: rgba(126,30,37,0.15);
  border-top-color: rgba(126,30,37,0.5);
}

html[data-theme="light"] .pillar:hover {
  box-shadow: 0 14px 36px rgba(126,30,37,.1), 0 3px 8px rgba(0,0,0,.06);
}

html[data-theme="light"] .mv-card::before {
  opacity: .07;
}

html[data-theme="light"] .mv-card:hover::before {
  opacity: .28;
  text-shadow: 0 0 48px rgba(126,30,37,.4), 0 0 16px rgba(126,30,37,.2);
}

html[data-theme="light"] .mv-card:active::before {
  opacity: .45;
  text-shadow: 0 0 60px rgba(126,30,37,.6), 0 0 20px rgba(126,30,37,.35);
}


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);
  border-color: rgba(0,0,0,0.15);
  color: var(--text);
}

/* Hide scroll/star canvases in light mode — replaced by CSS texture.
   Keep #bang-canvas and #menu-star-canvas visible so the bigbang + menu stars still render. */
html[data-theme="light"] #canvas,
html[data-theme="light"] #star-canvas {
  display: none;
}

/* Warm corner glow texture */
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%);
}

/* Handmade paper texture tile */
html[data-theme="light"] body {
  background-color: #f6eee3;
  background-image: url("/assets/textures/handmade-paper.png");
}

/* 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;
}

/* Ghost CTA button fix in light mode */
html[data-theme="light"] .btn-secondary {
  border-color: rgba(126,30,37,0.4);
  color: var(--crimson);
}
html[data-theme="light"] .btn-secondary:hover {
  border-color: var(--crimson);
  color: #fff;
}

/* Restore system cursor sitewide — overrides cursor:none scattered across page inline styles */
* { cursor: auto !important; }
a, button, [role="button"], [role="switch"], [tabindex]:not([tabindex="-1"]) { cursor: pointer !important; }
input[type="text"], input[type="email"], input[type="search"], textarea, select { cursor: auto !important; }

/* Glow follower — created by shared.js, visible on hover-capable devices */
#cursor-glow {
  position: fixed;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 1;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(255,255,255,0.09) 0%, transparent 65%);
  will-change: left, top;
}
html[data-theme="light"] #cursor-glow {
  background: radial-gradient(circle, rgba(126,30,37,0.07) 0%, transparent 65%);
}
/* On touch devices the glow drifts autonomously (see shared.js) */

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

/* 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);
}

/* Clear the fixed nav — nav ≈ 158px desktop, 135px mobile (logo + padding) */
.page-hero { padding-top: 10rem !important; }

@media(max-width:767px) {
  /* Consistent nav logo size across all pages */
  #nav-logo img { height: 100px; }
  .page-hero { padding-top: 11rem !important; }
}

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

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%);
}

/* Logo theme swap */
.logo-light { display: none; }
.logo-dark  { display: block; }
html[data-theme="light"] .logo-dark  { display: none; }
html[data-theme="light"] .logo-light { display: block; }

html[data-theme="light"] footer {
  border-top-color: rgba(26,17,16,0.08);
}
html[data-theme="light"] .f-brand-col {
  border-right-color: rgba(26,17,16,0.08);
  border-bottom-color: rgba(26,17,16,0.08);
}
html[data-theme="light"] .f-newsletter input {
  background: rgba(0,0,0,0.03);
  border-color: rgba(0,0,0,0.12);
}
html[data-theme="light"] .f-social a {
  border-color: rgba(26,17,16,0.15);
}
html[data-theme="light"] .f-bottom {
  border-top-color: rgba(26,17,16,0.06);
}

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

#theme-toggle {
  width: 44px;
  height: 24px;
  border-radius: 12px;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.2);
  padding: 0;
  position: relative;
  flex-shrink: 0;
  transition: background 0.3s, border-color 0.3s;
}

html[data-theme="light"] #theme-toggle {
  background: rgba(0,0,0,0.08);
  border-color: rgba(0,0,0,0.15);
}

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

html[data-theme="light"] #theme-toggle::after {
  left: 22px;
  background: #7e1e25;
}

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

/* Focus styles */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[role="button"]:focus-visible,
[role="switch"]:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}

html[data-theme="light"] a:focus-visible,
html[data-theme="light"] button:focus-visible,
html[data-theme="light"] input:focus-visible,
html[data-theme="light"] textarea:focus-visible,
html[data-theme="light"] select:focus-visible,
html[data-theme="light"] [role="button"]:focus-visible,
html[data-theme="light"] [role="switch"]:focus-visible {
  outline-color: var(--crimson);
}

/* Skip link */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  padding: .6rem 1.2rem;
  background: var(--crimson);
  color: #fff;
  font-family: "Geist Mono", monospace;
  font-size: .7rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  text-decoration: none;
  z-index: 9999;
  border-radius: 0 0 4px 4px;
}
.skip-link:focus {
  top: 0;
}

/* ═══ Menu button — ghost-cta arrow + lift + crimson accent bar ═══
   Combines three hover moves consistent with the rest of the site:
   1. Arrow reveal (matches .ghost-cta / .press-headline pattern)
   4. Lift + crimson glow shadow (matches .mv-card / .press-card / .video-card)
   6. Middle bar is always crimson at rest; all bars turn crimson on hover. */
#menu-btn {
  transition: border-color .35s, transform .35s, box-shadow .35s;
}
#menu-btn::after {
  content: "\2192";               /* → */
  font-family: "Geist Mono", monospace;
  font-size: .8rem;
  line-height: 1;
  color: var(--crimson);
  opacity: 0;
  display: inline-block;
  max-width: 0;
  margin-left: 0;
  overflow: hidden;
  transform: translateX(-4px);
  transition: opacity .25s ease, max-width .3s ease, margin-left .3s ease, transform .3s ease;
  pointer-events: none;
}
#menu-btn:hover {
  border-color: var(--crimson);
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(126,30,37,.25), 0 2px 6px rgba(0,0,0,.12);
}
#menu-btn:hover::after {
  opacity: 1;
  max-width: 1.5em;
  margin-left: .45rem;
  transform: translateX(0);
}
#menu-btn .bar {
  transition: background .3s;
}
#menu-btn .bar:nth-child(2) {
  background: var(--crimson);
}
#menu-btn:hover .bar {
  background: var(--crimson);
}

/* Light mode: warm border + dark outer bars so the button reads on paper */
html[data-theme="light"] #menu-btn {
  border-color: rgba(126,30,37,.22);
}
html[data-theme="light"] #menu-btn .bar:nth-child(1),
html[data-theme="light"] #menu-btn .bar:nth-child(3) {
  background: #3D0000;
}
html[data-theme="light"] #menu-btn:hover {
  box-shadow: 0 10px 22px rgba(126,30,37,.2), 0 2px 6px rgba(0,0,0,.08);
}

/* ═══ Menu overlay — Split-screen (list left, preview right) ═══
   Shared across all 12 pages via theme.css (overrides per-page inline rules
   because theme.css loads AFTER inline <style> and has equal specificity).
   Mobile (<=900px): preview hides, menu recentres to single column. */

#menu-overlay {
  /* Override inline flex-column centering — split layout handles its own positioning */
  display: flex;
  align-items: center;
  justify-content: center;
}
html[data-theme="light"] #menu-overlay {
  background: #FDFBF7;
}

.menu-split {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1280px;
  padding: 6rem 5rem 4rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5rem;
  align-items: center;
}

.menu-list-col {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
  align-items: flex-start;
}

/* Override the inline "align-items:center" on #menu-links so links left-align in the split layout */
#menu-overlay #menu-links {
  align-items: flex-start;
  gap: .4rem;
}

#menu-overlay #menu-links .menu-parent-link {
  font-family: "Geist", sans-serif;
  font-size: clamp(1.6rem, 3vw, 2.6rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -.01em;
  transition: opacity .3s, color .3s, transform .3s, text-shadow .3s;
}
#menu-overlay #menu-links .menu-parent-link:hover {
  transform: translateX(8px);
  text-shadow: 0 0 40px rgba(126,30,37,.4);
}

#menu-overlay #menu-sub {
  position: static;
  margin-top: 0;
  justify-content: flex-start;
}

/* Preview column */
.menu-preview-col {
  position: relative;
  aspect-ratio: 4 / 5;
  max-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 8px;
  background: rgba(238,224,201,.03);
  border: 1px solid rgba(238,224,201,.08);
}
html[data-theme="light"] .menu-preview-col {
  background: rgba(126,30,37,.04);
  border-color: rgba(126,30,37,.15);
}

/* Section image — fills the column, fades in on hover */
.menu-preview-img-wrap {
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 0;
  transition: opacity .5s ease;
  pointer-events: none;
}
.menu-preview-col.mode-active .menu-preview-img-wrap {
  opacity: 1;
}
#menu-preview-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

/* Logo — centred, sits above image panel */
.menu-preview-logo {
  position: absolute;
  inset: 0;
  margin: auto;
  max-width: 62%;
  max-height: 52%;
  object-fit: contain;
  transition: opacity .45s ease;
  pointer-events: none;
  z-index: 2;
}
/* Hide logo when a section image is active */
.menu-preview-col.mode-active .menu-preview-logo {
  opacity: 0;
}

/* Tagline — shown when a link is hovered (tag-active) */
.menu-preview-tagline {
  position: absolute;
  left: 1.5rem;
  right: 1.5rem;
  bottom: 1.5rem;
  font-family: "Geist Mono", monospace;
  font-size: .7rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: rgba(238,224,201,.9);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .45s, transform .45s;
  z-index: 3;
  pointer-events: none;
  text-shadow: 0 1px 4px rgba(0,0,0,.7);
}
html[data-theme="light"] .menu-preview-tagline {
  color: var(--crimson, #7e1e25);
  text-shadow: none;
}
.menu-preview-col.tag-active .menu-preview-tagline {
  opacity: 1;
  transform: translateY(0);
}

/* Logo theme swap inside the preview column */
.menu-preview-col .logo-light { display: none; }
.menu-preview-col .logo-dark  { display: block; }
html[data-theme="light"] .menu-preview-col .logo-light { display: block; }
html[data-theme="light"] .menu-preview-col .logo-dark  { display: none; }

/* Mobile: drop the preview, centre the menu list */
@media(max-width: 900px) {
  .menu-split {
    grid-template-columns: 1fr;
    padding: 4rem 2rem 2rem;
    gap: 2rem;
    max-width: 500px;
  }
  .menu-preview-col { display: none; }
  .menu-list-col { align-items: center; }
  #menu-overlay #menu-links { align-items: center; text-align: center; }
  #menu-overlay #menu-sub { justify-content: center; }
  #menu-overlay #menu-links .menu-parent-link:hover { transform: none; }
}

/* ── Info card: shimmer sweep + gradient border on hover ─────────── */
.info-card {
  position: relative;
  overflow: hidden;
}
.info-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 30%, rgba(255,255,255,.09) 50%, transparent 70%);
  transform: translateX(-130%);
  transition: transform .65s ease;
  pointer-events: none;
  z-index: 1;
}
.info-card:hover::before { transform: translateX(130%); }
.info-card::after {
  content: '';
  position: absolute;
  inset: 0;
  padding: 1px;
  background: linear-gradient(to right, #AA1B4C, #5C6EAD, #0E277A);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity .4s;
  pointer-events: none;
}
.info-card:hover { border-color: transparent !important; box-shadow: 0 4px 28px rgba(38,170,225,.1); }
.info-card:hover::after { opacity: 1; }
/* Shimmer tint adjusted for light backgrounds */
html[data-theme="light"] .info-card::before {
  background: linear-gradient(105deg, transparent 30%, rgba(126,30,37,.06) 50%, transparent 70%);
}
