/* ==========================================================================
   Bulnes Global Hub — Design System & Editorial Styles
   ========================================================================== */

:root {
  /* Heritage Palette — Blasón Bulnes (Gules Carmesí, Oro Heráldico Cálido, Plata y Acero) */
  --bg-dark: #0b0d11;
  --bg-card: #12161f;
  --bg-surface: #181d28;
  --bg-card-hover: #1e2433;
  
  /* Gules / Rojo Noble (Carmesí heráldico profundo, no chillón) */
  --gules-primary: #b91c1c;
  --gules-dark: #7f1d1d;
  --gules-deep: #450a0a;
  --gules-light: #dc2626;
  --gules-subtle: rgba(185, 28, 28, 0.12);
  --gules-border: rgba(185, 28, 28, 0.35);

  /* Oro Heráldico y Lambrequines (Dorado envejecido/cálido noble) */
  --gold-primary: #d4af37;
  --gold-rich: #b38f24;
  --gold-light: #f3e5ab;
  --gold-dark: #8c6d1f;
  --gold-glow: rgba(212, 175, 55, 0.18);
  --gold-border: rgba(212, 175, 55, 0.28);

  /* Plata de la Cruz y Celada de Hidalgo (Plata y Acero pulido) */
  --silver-primary: #f8fafc;
  --silver-light: #ffffff;
  --silver-muted: #cbd5e1;
  --silver-steel: #94a3b8;
  --silver-dark: #475569;
  --silver-border: rgba(226, 232, 240, 0.15);

  --text-main: #f8fafc;
  --text-muted: #cbd5e1;
  --text-dim: #8fa0b5;
  --text-gold: #f3e5ab;

  --border-subtle: rgba(212, 175, 55, 0.18);
  --border-focus: rgba(212, 175, 55, 0.5);
  --border-card: rgba(255, 255, 255, 0.07);

  --font-serif-title: 'Cinzel', Georgia, 'Times New Roman', serif;
  --font-serif-body: 'Playfair Display', Georgia, serif;
  --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --shadow-gold: 0 10px 25px -8px rgba(212, 175, 55, 0.2);
  --shadow-card: 0 12px 32px -6px rgba(0, 0, 0, 0.55);
  --shadow-modal: 0 25px 60px -15px rgba(0, 0, 0, 0.85);
  --transition-smooth: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-family: var(--font-sans);
  background-color: var(--bg-dark);
  color: var(--text-main);
  line-height: 1.6;
}

body {
  overflow-x: hidden;
  min-height: 100vh;
  background-image: 
    radial-gradient(circle at 50% 0%, rgba(185, 28, 28, 0.08) 0%, transparent 55%),
    radial-gradient(circle at 85% 30%, rgba(212, 175, 55, 0.04) 0%, transparent 45%),
    radial-gradient(circle at 15% 70%, rgba(127, 29, 29, 0.06) 0%, transparent 45%);
  background-attachment: fixed;
}

/* Typography Utilities */
.font-cinzel { font-family: var(--font-serif-title); }
.font-playfair { font-family: var(--font-serif-body); }
.font-sans { font-family: var(--font-sans); }

.text-gold { color: var(--gold-primary); }
.text-gold-light { color: var(--gold-light); }
.text-gules { color: var(--gules-light); }
.text-silver { color: var(--silver-primary); }
.text-muted { color: var(--text-muted); }

/* Layout & Containers */
.container {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Header & Navbar */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: rgba(11, 13, 17, 0.92);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.85rem 0;
  transition: var(--transition-smooth);
}

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

.brand-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-main);
}

.brand-shield-mini {
  width: 34px;
  height: 40px;
  filter: drop-shadow(0 2px 6px rgba(212, 175, 55, 0.25));
}

.brand-title {
  font-family: var(--font-serif-title);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--silver-light);
}

.nav-menu {
  display: flex;
  list-style: none;
  align-items: center;
  gap: 1.5rem;
}

.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  transition: var(--transition-smooth);
  position: relative;
  padding: 0.35rem 0;
}

.nav-link:hover, .nav-link.active {
  color: var(--gold-light);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--gold-primary);
  transition: width 0.3s ease;
}

.nav-link:hover::after, .nav-link.active::after {
  width: 100%;
}

.btn-cta-nav {
  padding: 0.5rem 1.15rem;
  font-size: 0.82rem;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--gold-primary), var(--gold-rich));
  color: #0b0d11;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 2px 10px var(--gold-glow);
  transition: var(--transition-smooth);
  cursor: pointer;
  border: 1px solid var(--gold-light);
}

.btn-cta-nav:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(212, 175, 55, 0.35);
}

/* Hero Section */
.hero {
  position: relative;
  padding: 5rem 0 3.5rem;
  text-align: center;
  overflow: hidden;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 1rem;
  border-radius: var(--radius-full);
  background: rgba(212, 175, 55, 0.08);
  border: 1px solid var(--border-subtle);
  color: var(--gold-light);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 1.5rem;
}

.hero-title {
  font-family: var(--font-serif-title);
  font-size: 3.1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.2;
  margin-bottom: 1.25rem;
  color: var(--silver-light);
}

.hero-subtitle {
  font-family: var(--font-serif-body);
  font-size: 1.2rem;
  color: var(--text-muted);
  max-width: 800px;
  margin: 0 auto 2.25rem;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn-primary {
  padding: 0.8rem 1.85rem;
  font-size: 0.95rem;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--gold-primary), var(--gold-rich));
  color: #0b0d11;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 4px 15px var(--gold-glow);
  transition: var(--transition-smooth);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid rgba(243, 229, 171, 0.4);
  cursor: pointer;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(212, 175, 55, 0.35);
}

.btn-secondary {
  padding: 0.8rem 1.85rem;
  font-size: 0.95rem;
  border-radius: var(--radius-full);
  background: rgba(248, 250, 252, 0.04);
  border: 1px solid var(--border-card);
  color: var(--silver-primary);
  font-weight: 500;
  text-decoration: none;
  transition: var(--transition-smooth);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}

.btn-secondary:hover {
  background: rgba(248, 250, 252, 0.08);
  border-color: var(--border-subtle);
  transform: translateY(-2px);
  color: var(--silver-light);
}

/* Stats Counter Ribbon */
.stats-ribbon {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  padding: 2.25rem;
  margin: 3rem 0 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.stat-item {
  text-align: center;
}

.stat-num {
  font-family: var(--font-serif-title);
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--gold-primary);
  margin-bottom: 0.25rem;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
}

/* Sections Base */
.section {
  padding: 4.5rem 0;
}

.section-header {
  text-align: center;
  max-width: 750px;
  margin: 0 auto 3rem;
}

.section-tag {
  color: var(--gold-primary);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.5rem;
  display: block;
}

.section-title {
  font-family: var(--font-serif-title);
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--silver-light);
  margin-bottom: 0.85rem;
}

.section-desc {
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.65;
}

/* Heraldry Card Section */
.heraldry-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 3.5rem;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 3rem;
  box-shadow: var(--shadow-card);
}

.shield-container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1.5rem;
  position: relative;
}

.shield-glow {
  position: absolute;
  width: 260px;
  height: 260px;
  background: radial-gradient(circle, var(--gold-glow) 0%, transparent 70%);
  z-index: 0;
}

.shield-frame {
  position: relative;
  z-index: 1;
  padding: 0.5rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 20px rgba(212, 175, 55, 0.1);
  transition: var(--transition-smooth);
}

.shield-frame:hover {
  border-color: rgba(212, 175, 55, 0.4);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.7), 0 0 25px rgba(212, 175, 55, 0.2);
}

.heraldic-img-main {
  display: block;
  width: 100%;
  max-width: 320px;
  height: auto;
  border-radius: var(--radius-sm);
}

.heraldic-info h3 {
  font-family: var(--font-serif-title);
  font-size: 1.75rem;
  color: var(--silver-light);
  margin-bottom: 0.75rem;
}

.heraldry-info p {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  font-size: 0.98rem;
  line-height: 1.65;
}

.quarters-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.quarter-item {
  display: flex;
  gap: 1.15rem;
  align-items: flex-start;
  background: rgba(248, 250, 252, 0.02);
  padding: 0.9rem 1.15rem;
  border-radius: var(--radius-md);
  border-left: 3px solid var(--gold-rich);
  border-top: 1px solid var(--border-card);
  border-right: 1px solid var(--border-card);
  border-bottom: 1px solid var(--border-card);
  transition: var(--transition-smooth);
}

.quarter-item:hover {
  background: rgba(248, 250, 252, 0.04);
  border-left-color: var(--gold-primary);
}

.quarter-badge {
  font-family: var(--font-serif-title);
  font-weight: 700;
  color: var(--gold-primary);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.5rem;
  background: rgba(212, 175, 55, 0.08);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  white-space: nowrap;
  flex-shrink: 0;
}

.quarter-text strong {
  color: var(--silver-light);
  display: block;
  font-size: 0.95rem;
  margin-bottom: 0.2rem;
}

.quarter-text span {
  font-size: 0.86rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Timeline & Primary Sources */
.timeline-container {
  position: relative;
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 0;
}

.timeline-container::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, var(--gold-primary), var(--asturias-blue), transparent);
  transform: translateX(-50%);
}

.timeline-item {
  position: relative;
  margin-bottom: 2.5rem;
  width: 50%;
}

.timeline-item:nth-child(odd) {
  left: 0;
  padding-right: 2.5rem;
  text-align: right;
}

.timeline-item:nth-child(even) {
  left: 50%;
  padding-left: 2.5rem;
  text-align: left;
}

.timeline-dot {
  position: absolute;
  top: 15px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--gold-primary);
  border: 3px solid var(--bg-dark);
  box-shadow: 0 0 10px var(--gold-primary);
  z-index: 2;
}

.timeline-item:nth-child(odd) .timeline-dot {
  right: -8px;
}

.timeline-item:nth-child(even) .timeline-dot {
  left: -8px;
}

.timeline-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  transition: var(--transition-smooth);
}

.timeline-card:hover {
  border-color: var(--border-subtle);
  transform: translateY(-3px);
  box-shadow: var(--shadow-card);
}

.timeline-year {
  font-family: var(--font-serif-title);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--gold-primary);
  margin-bottom: 0.35rem;
}

.timeline-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

.timeline-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.timeline-source {
  margin-top: 0.75rem;
  font-size: 0.75rem;
  color: var(--gold-dark);
  font-style: italic;
  display: block;
}

/* 3 Hypotheses Section */
.hypotheses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.75rem;
}

.hypothesis-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 2.25rem;
  display: flex;
  flex-direction: column;
  transition: var(--transition-smooth);
  position: relative;
  overflow: hidden;
}

.hypothesis-card:hover {
  border-color: var(--border-subtle);
  transform: translateY(-4px);
  box-shadow: var(--shadow-card);
}

.hypothesis-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--gules-primary), var(--gold-rich));
}

.hypo-badge {
  font-family: var(--font-serif-title);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--gold-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
}

.hypo-title {
  font-family: var(--font-serif-title);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--silver-light);
  margin-bottom: 0.85rem;
}

.hypo-body {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.6;
  flex-grow: 1;
}

/* ==========================================================================
   Leaflet Map Section
   ========================================================================== */
.map-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  position: relative;
  min-height: 520px;
}

#leaflet-map {
  width: 100%;
  height: 520px;
  min-height: 520px;
  background: #0e1219;
  z-index: 10;
}

/* Elegante filtro cartográfico oscuro para OpenStreetMap */
.leaflet-tile-pane {
  filter: brightness(0.65) invert(1) contrast(3) hue-rotate(200deg) saturate(0.35) brightness(0.75);
}

/* Custom Leaflet Dark Popup Styles */
.leaflet-popup-content-wrapper {
  background: var(--bg-surface) !important;
  color: var(--text-main) !important;
  border: 1px solid var(--border-subtle) !important;
  border-radius: var(--radius-md) !important;
  box-shadow: var(--shadow-card) !important;
}

.leaflet-popup-tip {
  background: var(--bg-surface) !important;
}

.popup-title {
  font-family: var(--font-serif-title);
  color: var(--gold-light);
  font-size: 1.1rem;
  margin-bottom: 0.35rem;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 0.35rem;
}

.popup-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.popup-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-full);
  background: rgba(212, 175, 55, 0.2);
  color: var(--gold-light);
}

/* ==========================================================================
   Historical Document Archive Section
   ========================================================================== */
.archive-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.75rem;
}

.archive-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  transition: var(--transition-smooth);
}

.archive-card:hover {
  border-color: var(--border-subtle);
  transform: translateY(-4px);
  box-shadow: var(--shadow-card);
}

.archive-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}

.archive-badge-type {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-full);
  background: rgba(153, 27, 27, 0.35);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.archive-year {
  font-family: var(--font-serif-title);
  font-weight: 700;
  color: var(--gold-primary);
  font-size: 1.1rem;
}

.archive-title {
  font-family: var(--font-serif-title);
  font-size: 1.15rem;
  color: #ffffff;
  margin-bottom: 0.5rem;
  line-height: 1.35;
}

.archive-region {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.archive-notes {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 1.25rem;
  flex-grow: 1;
}

.archive-footer {
  border-top: 1px solid var(--border-card);
  padding-top: 0.85rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.archive-source {
  font-size: 0.75rem;
  color: var(--text-dim);
  font-style: italic;
  max-width: 65%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-view-doc {
  background: transparent;
  border: none;
  color: var(--gold-primary);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: color 0.2s;
}

.btn-view-doc:hover {
  color: var(--gold-light);
  text-decoration: underline;
}

/* ==========================================================================
   Professionals Directory Preview Grid
   ========================================================================== */
.prof-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.75rem;
}

.prof-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  transition: var(--transition-smooth);
  display: flex;
  flex-direction: column;
}

.prof-card:hover {
  border-color: var(--border-subtle);
  transform: translateY(-4px);
  box-shadow: var(--shadow-card);
}

.prof-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.prof-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gules-dark), var(--gules-primary));
  border: 1.5px solid var(--gold-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif-title);
  font-weight: 700;
  color: var(--silver-light);
  font-size: 1rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}

.prof-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--silver-light);
}

.prof-title {
  font-size: 0.82rem;
  color: var(--gold-light);
}

.prof-badge {
  display: inline-block;
  align-self: flex-start;
  padding: 0.2rem 0.6rem;
  background: rgba(212, 175, 55, 0.08);
  border: 1px solid var(--border-subtle);
  color: var(--gold-light);
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 600;
  margin-bottom: 0.85rem;
}

.prof-desc {
  font-size: 0.86rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 1.25rem;
  flex-grow: 1;
}

.prof-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border-card);
  padding-top: 1rem;
  font-size: 0.85rem;
}

.prof-loc {
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.prof-link {
  color: var(--gold-primary);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s;
}

.prof-link:hover {
  color: var(--gold-light);
  text-decoration: underline;
}

/* ==========================================================================
   Modal Dialog & Forms
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(4, 7, 12, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 2000;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition-smooth);
}

.modal-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.modal-box {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-modal);
  width: 100%;
  max-width: 650px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  transform: translateY(20px) scale(0.98);
  transition: var(--transition-smooth);
  padding: 2.5rem;
}

.modal-backdrop.active .modal-box {
  transform: translateY(0) scale(1);
}

.modal-close-btn {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
  transition: color 0.2s;
}

.modal-close-btn:hover {
  color: #ffffff;
}

.form-group {
  margin-bottom: 1.25rem;
  text-align: left;
}

.form-label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 0.4rem;
}

.form-label .required {
  color: #f87171;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  color: #ffffff;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  transition: var(--transition-smooth);
}

.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon-inside {
  position: absolute;
  left: 1rem;
  width: 17px;
  height: 17px;
  color: var(--text-dim);
  pointer-events: none;
}

.form-input.with-icon {
  padding-left: 2.75rem;
}

.icon-inline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  vertical-align: middle;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--border-focus);
  background: rgba(255, 255, 255, 0.07);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.15);
}

.form-input::placeholder, .form-textarea::placeholder {
  color: var(--text-dim);
}

.form-select option {
  background: var(--bg-card);
  color: var(--text-main);
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-hint {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 0.3rem;
  display: block;
}

.form-alert {
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
  display: none;
}

.form-alert.error {
  display: block;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}

.form-alert.success {
  display: block;
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(34, 197, 94, 0.4);
  color: #86efac;
}

/* Spinner */
.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(0, 0, 0, 0.2);
  border-top-color: #000;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Footer */
.footer {
  background: #04070b;
  border-top: 1px solid var(--border-subtle);
  padding: 4rem 0 2rem;
  margin-top: 5rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-brand h4 {
  font-family: var(--font-serif-title);
  font-size: 1.3rem;
  color: var(--gold-light);
  margin-bottom: 0.75rem;
}

.footer-brand p {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.6;
  max-width: 420px;
}

.footer-col h5 {
  font-family: var(--font-serif-title);
  font-size: 1rem;
  color: var(--text-main);
  margin-bottom: 1rem;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--gold-primary);
}

.footer-bottom {
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 2rem;
  color: var(--text-dim);
  font-size: 0.85rem;
}

/* ==========================================================================
   Visual Effects, Interactive Animations & Micro-Interactions
   ========================================================================== */

/* Shimmer Highlight Effect on Hero Badge & Primary Buttons */
.btn-primary {
  position: relative;
  overflow: hidden;
}

.btn-primary::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -60%;
  width: 40%;
  height: 200%;
  background: linear-gradient(
    60deg,
    rgba(255, 255, 255, 0) 20%,
    rgba(255, 255, 255, 0.35) 50%,
    rgba(255, 255, 255, 0) 80%
  );
  transform: rotate(25deg);
  animation: shimmerButton 5s ease-in-out infinite;
}

@keyframes shimmerButton {
  0%, 75% { left: -60%; }
  100% { left: 140%; }
}

/* Scroll Reveal States (Graceful Degradation: visibles por defecto) */
.reveal {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1), transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

/* Solo si JS está activo y agrega la clase js-reveal-init */
.js-reveal-init .reveal:not(.is-visible) {
  opacity: 0;
  transform: translateY(20px);
}

.reveal.is-visible {
  opacity: 1 !important;
  transform: translateY(0) !important;
}

/* Stagger delay classes */
.delay-1 { transition-delay: 0.1s; }
.delay-2 { transition-delay: 0.2s; }
.delay-3 { transition-delay: 0.3s; }
.delay-4 { transition-delay: 0.4s; }

/* Interactive Spotlight Glow for Cards */
.archive-card, .prof-card, .hypothesis-card, .quarter-item {
  position: relative;
  isolation: isolate;
}

.archive-card::after, .prof-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(
    400px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
    rgba(212, 175, 55, 0.08),
    transparent 40%
  );
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: 1;
}

.archive-card:hover::after, .prof-card:hover::after {
  opacity: 1;
}

/* Ambient Pulse for Shield and Badges */
@keyframes shieldAmbient {
  0%, 100% { transform: scale(1); opacity: 0.6; }
  50% { transform: scale(1.08); opacity: 0.9; }
}

.shield-glow {
  animation: shieldAmbient 6s ease-in-out infinite;
}

/* Subtle Floating Animation for Mini Shield */
@keyframes floatMini {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

.brand-shield-mini {
  animation: floatMini 4s ease-in-out infinite;
}

/* Focus and input interaction glow */
.form-input:focus, .form-select:focus, .form-textarea:focus {
  transform: translateY(-1px);
}

/* Nav Toggle (Mobile) */
.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--silver-light);
  padding: 0.45rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
}

.nav-toggle:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--gold-primary);
  color: var(--gold-light);
}

/* ==========================================================================
   Comprehensive Responsive System
   ========================================================================== */

/* Tablets and small laptops (<= 992px) */
@media (max-width: 992px) {
  .hero-title { font-size: 2.6rem; }
  .heraldry-grid { grid-template-columns: 1fr; gap: 2.5rem; padding: 2rem; }
  .shield-container { padding: 0.5rem; }
  .timeline-container::before { left: 20px; }
  .timeline-item { width: 100%; left: 0 !important; padding-left: 50px !important; padding-right: 0 !important; text-align: left !important; }
  .timeline-dot { left: 12px !important; right: auto !important; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 2.5rem; }
  .footer-brand { grid-column: 1 / -1; }
}

/* Mobile Devices (<= 768px) */
@media (max-width: 768px) {
  .nav-toggle { display: flex; }
  
  .nav-drawer {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(11, 13, 17, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-subtle);
    padding: 1.5rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.85);
    display: none;
    animation: fadeInDown 0.25s ease-out forwards;
  }

  .nav-drawer.active {
    display: block;
  }

  .nav-menu {
    flex-direction: column;
    align-items: stretch;
    gap: 0.85rem;
  }

  .nav-link {
    display: block;
    padding: 0.6rem 0;
    font-size: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  }

  .btn-cta-nav {
    text-align: center;
    margin-top: 0.5rem;
    padding: 0.75rem;
  }

  .hero { padding: 3.5rem 0 2.5rem; }
  .hero-title { font-size: 2.1rem; }
  .hero-subtitle { font-size: 1.05rem; }
  .hero-actions { flex-direction: column; width: 100%; max-width: 320px; margin: 0 auto; }
  .hero-actions .btn-primary, .hero-actions .btn-secondary { width: 100%; justify-content: center; }

  .stats-ribbon { grid-template-columns: 1fr 1fr; gap: 1.25rem; padding: 1.5rem; }
  .stat-num { font-size: 1.75rem; }
  .stat-label { font-size: 0.72rem; }

  .section { padding: 3.5rem 0; }
  .section-title { font-size: 1.85rem; }

  .archive-grid, .prof-grid, .hypotheses-grid {
    grid-template-columns: 1fr;
  }

  #leaflet-map {
    height: 400px;
    min-height: 400px;
  }
  .map-wrapper {
    min-height: 400px;
  }

  .modal-backdrop {
    padding: 1rem 0.5rem;
  }
  .modal-box {
    padding: 1.5rem 1.25rem;
    max-height: 95vh;
  }

  .form-grid-2 {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

/* Small Smart Phones (<= 480px) */
@media (max-width: 480px) {
  .hero-title { font-size: 1.75rem; }
  .stats-ribbon { grid-template-columns: 1fr; }
  .heraldry-grid { padding: 1.25rem; }
  .quarter-item { flex-direction: column; gap: 0.5rem; }
  .brand-title { font-size: 1rem; }
  .brand-shield-mini { width: 28px; height: 34px; }
  #leaflet-map { height: 320px; min-height: 320px; }
  .map-wrapper { min-height: 320px; }
}

/* Ko-fi Donation System Styles */
.btn-kofi {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, #ff5e5b, #e0245e);
  color: #ffffff !important;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 0.88rem;
  text-decoration: none;
  box-shadow: 0 4px 15px rgba(224, 36, 94, 0.35);
  transition: var(--transition-smooth);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-kofi:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 6px 20px rgba(224, 36, 94, 0.55);
  color: #ffffff !important;
}

.btn-kofi svg, .btn-kofi i {
  width: 18px;
  height: 18px;
}

/* Floating Ko-fi Widget Button */
.kofi-floating-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 990;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.75rem 1.25rem;
  background: linear-gradient(135deg, #1b212f, #11151f);
  color: var(--gold-light);
  border: 1.5px solid var(--border-gold);
  border-radius: var(--radius-full);
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 0.85rem;
  text-decoration: none;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.6), 0 0 15px var(--gold-glow);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  backdrop-filter: blur(10px);
}

.kofi-floating-btn:hover {
  transform: translateY(-4px) scale(1.04);
  background: linear-gradient(135deg, #242c3d, #161b27);
  border-color: var(--gold-primary);
  box-shadow: 0 12px 30px rgba(212, 175, 55, 0.35);
  color: #ffffff;
}

.kofi-cup-icon {
  animation: cupFloat 3s ease-in-out infinite;
}

@keyframes cupFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-3px) rotate(-4deg); }
}

@media (max-width: 640px) {
  .kofi-floating-btn {
    bottom: 16px;
    right: 16px;
    padding: 0.6rem 0.95rem;
    font-size: 0.78rem;
  }
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}
