/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg-dark: #0a0a0f;
  --bg-card: #12121a;
  --bg-nav: rgba(10, 10, 15, 0.95);
  --gold: #e53935;
  --gold-light: #ef5350;
  --gold-dim: #b71c1c;
  --text: #d4d4d8;
  --text-muted: #71717a;
  --text-bright: #fafafa;
  --border: #27272a;
  --red: #b91c1c;
  --red-dim: #7f1d1d;
  --max-w: 1200px;
  --nav-h: 64px;
}

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-dark);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--gold); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--gold-light); }

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4 {
  color: var(--text-bright);
  font-weight: 700;
  line-height: 1.2;
}

/* ===== NAV ===== */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-h);
  background: var(--bg-nav);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
  display: flex;
  align-items: center;
}

.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--gold);
  letter-spacing: 2px;
  text-transform: uppercase;
}

.nav-links {
  display: flex;
  gap: 32px;
  list-style: none;
}

.nav-links a {
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: color 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--gold);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.5rem;
  cursor: pointer;
}

/* ===== HERO ===== */
.hero {
  padding: 160px 24px 100px;
  text-align: center;
  background: linear-gradient(180deg, rgba(198, 40, 40, 0.1) 0%, transparent 60%);
}

.hero h1 {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.hero h1 span { color: var(--gold); }

.hero .tagline {
  font-size: 1.125rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto 40px;
}

.hero-logo {
  max-width: 480px;
  margin: 0 auto 32px;
}

.hero .meta {
  font-size: 0.875rem;
  color: var(--gold-dim);
  text-transform: uppercase;
  letter-spacing: 2px;
}

/* ===== SECTIONS ===== */
.section {
  padding: 80px 24px;
  max-width: var(--max-w);
  margin: 0 auto;
}

.section-header {
  margin-bottom: 48px;
}

.section-header h2 {
  font-size: 2rem;
  margin-bottom: 8px;
}

.section-header .accent-line {
  width: 60px;
  height: 3px;
  background: var(--gold);
  margin-bottom: 16px;
}

.section-header p {
  color: var(--text-muted);
  max-width: 600px;
}

/* ===== PAGE HEADER ===== */
.page-header {
  padding: 120px 24px 60px;
  text-align: center;
  background: linear-gradient(180deg, rgba(198, 40, 40, 0.08) 0%, transparent 100%);
}

.page-header h1 {
  font-size: 2.5rem;
  text-transform: uppercase;
  letter-spacing: 3px;
  margin-bottom: 12px;
}

.page-header p {
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto;
}

/* ===== CARDS ===== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 32px;
  transition: border-color 0.2s, transform 0.2s;
}

.card:hover {
  border-color: var(--gold-dim);
  transform: translateY(-2px);
}

.card h3 {
  font-size: 1.125rem;
  margin-bottom: 8px;
}

.card p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.card .card-meta {
  font-size: 0.8rem;
  color: var(--gold-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 12px;
}

/* ===== GALLERY ===== */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
}

.gallery-grid a {
  display: block;
  aspect-ratio: 4/3;
  overflow: hidden;
  border-radius: 4px;
  border: 1px solid var(--border);
  transition: border-color 0.2s, opacity 0.2s;
}

.gallery-grid a:hover {
  border-color: var(--gold-dim);
  opacity: 0.85;
}

.gallery-grid img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: var(--bg-card);
}

/* Gallery index cards */
.gallery-index {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.gallery-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  transition: border-color 0.2s, transform 0.2s;
  display: block;
}

.gallery-card:hover {
  border-color: var(--gold-dim);
  transform: translateY(-2px);
}

.gallery-card-thumb {
  aspect-ratio: 16/10;
  overflow: hidden;
  background: #1a1a24;
}

.gallery-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-card-info {
  padding: 16px 20px;
}

.gallery-card-info h3 {
  font-size: 1rem;
  margin-bottom: 4px;
}

.gallery-card-info .count {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ===== LIGHTBOX ===== */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.95);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.lightbox.active { display: flex; }

.lightbox img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 4px;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 24px;
  background: none;
  border: none;
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.lightbox-close:hover { opacity: 1; }

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #fff;
  font-size: 2.5rem;
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.2s;
  padding: 20px;
}

.lightbox-nav:hover { opacity: 1; }
.lightbox-prev { left: 10px; }
.lightbox-next { right: 10px; }

.lightbox-counter {
  position: absolute;
  bottom: 20px;
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* ===== HISTORY TIMELINE ===== */
.timeline {
  position: relative;
  padding-left: 32px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border);
}

.timeline-entry {
  position: relative;
  margin-bottom: 48px;
  padding-bottom: 48px;
  border-bottom: 1px solid var(--border);
}

.timeline-entry:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.timeline-entry::before {
  content: '';
  position: absolute;
  left: -38px;
  top: 6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--gold);
  border: 2px solid var(--bg-dark);
}

.timeline-entry .year {
  font-size: 0.8rem;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 8px;
  font-weight: 600;
}

.timeline-entry h3 {
  font-size: 1.25rem;
  margin-bottom: 12px;
}

.timeline-entry p {
  color: var(--text-muted);
  margin-bottom: 8px;
}

.timeline-entry h4 {
  font-size: 1.05rem;
  margin-top: 24px;
  margin-bottom: 10px;
  color: var(--gold-light);
}

.timeline-entry ul.history-list {
  list-style: none;
  padding: 0;
  margin: 12px 0;
}

.timeline-entry ul.history-list li {
  color: var(--text-muted);
  padding: 6px 0 6px 20px;
  position: relative;
  font-size: 0.95rem;
}

.timeline-entry ul.history-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 14px;
  width: 8px;
  height: 2px;
  background: var(--gold-dim);
}

.story-quote {
  border-left: 3px solid var(--gold-dim);
  margin: 20px 0;
  padding: 16px 20px;
  background: rgba(198, 40, 40, 0.04);
  border-radius: 0 6px 6px 0;
  font-style: italic;
  color: var(--text);
  line-height: 1.7;
}

.story-quote cite {
  display: block;
  margin-top: 10px;
  font-style: normal;
  font-size: 0.85rem;
  color: var(--gold);
  font-weight: 600;
}

.roster-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}

.roster-grid span {
  display: block;
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 10px 16px;
  border-radius: 6px;
  font-size: 0.875rem;
  color: var(--text);
  text-align: center;
  transition: border-color 0.2s;
}

.roster-grid span:hover {
  border-color: var(--gold-dim);
}

/* ===== MEMBERS TABLE ===== */
.members-table {
  width: 100%;
  border-collapse: collapse;
}

.members-table th,
.members-table td {
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.members-table th {
  color: var(--gold);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
}

.members-table tr:hover td {
  background: rgba(198, 40, 40, 0.06);
}

.members-table .name { color: var(--text-bright); font-weight: 600; }
.members-table .rank { color: var(--gold-dim); font-size: 0.875rem; }
.members-table .era { color: var(--text-muted); font-size: 0.875rem; }

.member-status {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 8px;
}
.member-status.founder { background: var(--gold-light); }
.member-status.veteran { background: #3b82f6; }
.member-status.member { background: #22c55e; }
.member-status.inactive { background: var(--text-muted); }

/* ===== CONTACT FORM ===== */
.contact-form {
  max-width: 600px;
  margin: 0 auto;
}

.form-group {
  margin-bottom: 24px;
}

.form-group label {
  display: block;
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 500;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--gold-dim);
}

.form-group textarea { min-height: 150px; resize: vertical; }

.btn {
  display: inline-block;
  padding: 12px 32px;
  background: var(--gold);
  color: #fff;
  font-weight: 700;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
}

.btn:hover { background: var(--gold-light); color: #fff; }

.btn-outline {
  background: transparent;
  border: 1px solid var(--gold-dim);
  color: var(--gold);
}

.btn-outline:hover {
  background: rgba(198, 40, 40, 0.12);
  color: var(--gold-light);
}

/* ===== FOOTER ===== */
.footer {
  border-top: 1px solid var(--border);
  padding: 40px 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.footer .brand {
  color: var(--gold-dim);
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 8px;
}

/* ===== STATS ROW ===== */
.stats {
  display: flex;
  justify-content: center;
  gap: 64px;
  padding: 48px 24px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.stat {
  text-align: center;
}

.stat .number {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--gold);
}

.stat .label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-top: 4px;
}

/* ===== BACK LINK ===== */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 24px;
  transition: color 0.2s;
}

.back-link:hover { color: var(--gold); }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: var(--nav-h);
    left: 0;
    right: 0;
    background: var(--bg-nav);
    padding: 24px;
    gap: 20px;
    border-bottom: 1px solid var(--border);
  }
  .nav-toggle { display: block; }

  .stats { flex-wrap: wrap; gap: 32px; }

  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }

  .members-table { font-size: 0.85rem; }
  .members-table th, .members-table td { padding: 10px 8px; }

  .hero { padding: 120px 24px 60px; }
  .section { padding: 48px 24px; }
}

@media (max-width: 480px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 4px;
  }

  .gallery-index {
    grid-template-columns: 1fr;
  }
}

/* ===== LAZY LOAD ===== */
img[loading="lazy"] {
  opacity: 0;
  transition: opacity 0.3s;
}
img[loading="lazy"].loaded,
img.loaded { opacity: 1; }
