/* HelmetFest — OBX beach & crest theme */

:root {
  --sunset-1: #ff6b4a;
  --sunset-2: #ff9a56;
  --sunset-3: #ffc857;
  --ocean-deep: #0a3d5c;
  --ocean: #14577e;
  --ocean-light: #3b8fb5;
  --foam: #eaf6f6;
  --sand: #fdf3e3;
  --sand-dark: #f2e2c4;
  --ink: #1c2b33;
  --ink-soft: #4a5c66;
  --coral: #ff5c6c;
  --gold: #ffb703;
  --white: #ffffff;
  --shadow: 0 10px 30px rgba(10, 61, 92, 0.15);
  --shadow-sm: 0 4px 12px rgba(10, 61, 92, 0.12);
  --radius: 18px;
  --font-display: "Baloo 2", "Fredoka", system-ui, sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--sand);
  background-image:
    radial-gradient(circle at 15% 0%, rgba(255, 199, 87, 0.25), transparent 40%),
    radial-gradient(circle at 85% 10%, rgba(59, 143, 181, 0.18), transparent 45%);
  background-attachment: fixed;
  line-height: 1.5;
}

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

a { color: inherit; text-decoration: none; }

.wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Top nav ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: linear-gradient(120deg, var(--ocean-deep), var(--ocean) 60%, var(--ocean-light));
  box-shadow: var(--shadow-sm);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  padding-bottom: 12px;
  gap: 16px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--white);
  letter-spacing: 0.5px;
}

.brand .badge-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--sunset-3), var(--sunset-1) 70%);
  display: grid;
  place-items: center;
  font-size: 1.2rem;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,0.5);
}

.main-nav {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.main-nav a {
  color: rgba(255,255,255,0.85);
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.92rem;
  transition: background 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}

.main-nav a:hover,
.main-nav a.active {
  background: rgba(255,255,255,0.15);
  color: var(--white);
}

.main-nav .years-trigger {
  position: relative;
  display: flex;
}

.years-trigger-btn {
  display: block;
}

.years-dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  background: var(--white);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 10px;
  width: 280px;
  max-height: 340px;
  overflow-y: auto;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}

.years-dropdown.open { display: grid; }

.years-dropdown a {
  color: var(--ocean-deep);
  font-weight: 600;
  font-size: 0.85rem;
  padding: 7px 4px;
  text-align: center;
  border-radius: 8px;
}

.years-dropdown a:hover { background: var(--sand); }
.years-dropdown a.empty-year { color: #b9c3c8; }

/* ---------- Hero ---------- */

.hero {
  position: relative;
  color: var(--white);
  background: linear-gradient(160deg, var(--ocean-deep) 0%, var(--ocean) 55%, var(--ocean-light) 100%);
  overflow: hidden;
  padding: 72px 0 110px;
}

.hero::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 90px;
  background:
    radial-gradient(ellipse 60px 90px at 5% 100%, var(--sand) 60%, transparent 61%),
    linear-gradient(180deg, transparent 0%, var(--sand) 78%);
  opacity: 0.98;
}

.hero .wrap { position: relative; z-index: 2; text-align: center; }

.hero .sun {
  width: 130px;
  height: 130px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--sunset-3), var(--gold) 55%, var(--sunset-1) 100%);
  box-shadow: 0 0 0 10px rgba(255,255,255,0.08), 0 0 70px 10px rgba(255,183,3,0.45);
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 7vw, 4.6rem);
  margin: 0 0 8px;
  letter-spacing: 1px;
  text-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.hero .tagline {
  font-size: 1.15rem;
  max-width: 560px;
  margin: 0 auto 26px;
  color: rgba(255,255,255,0.9);
}

.hero .stat-row {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.stat-pill {
  background: rgba(255,255,255,0.14);
  border: 1px solid rgba(255,255,255,0.25);
  backdrop-filter: blur(4px);
  padding: 10px 20px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.95rem;
}

.stat-pill span.num {
  font-family: var(--font-display);
  color: var(--sunset-3);
  margin-right: 6px;
}

.upcoming-banner {
  display: inline-block;
  margin-top: 26px;
  padding: 10px 22px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--coral), var(--sunset-2));
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}

/* ---------- Sections ---------- */

section { padding: 56px 0; }

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 4vw, 2.4rem);
  color: var(--ocean-deep);
  margin: 0 0 8px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-sub {
  color: var(--ink-soft);
  margin: 0 0 32px;
  max-width: 640px;
}

/* ---------- Decade / timeline ---------- */

.decade-block { margin-bottom: 44px; }

.decade-label {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--ocean);
  margin: 0 0 16px;
  padding-bottom: 8px;
  border-bottom: 3px dashed var(--sand-dark);
}

.year-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
}

@media (max-width: 720px) {
  .year-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 460px) {
  .year-grid { grid-template-columns: repeat(2, 1fr); }
}

.year-card {
  background: var(--white);
  border-radius: 14px;
  padding: 16px 14px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  position: relative;
  overflow: hidden;
  border: 2px solid transparent;
}

.year-card:hover {
  transform: translateY(-4px) rotate(-0.5deg);
  box-shadow: var(--shadow);
  border-color: var(--sunset-2);
}

.year-card .yr {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--ocean-deep);
}

.year-card .house {
  font-size: 0.82rem;
  color: var(--ink-soft);
  margin-top: 4px;
  min-height: 2.2em;
}

.year-card .photo-count {
  display: inline-block;
  margin-top: 10px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--ocean);
  background: var(--sand);
  padding: 3px 9px;
  border-radius: 999px;
}

.year-card.placeholder {
  background: repeating-linear-gradient(135deg, #f6f1e4, #f6f1e4 10px, #f1e9d4 10px, #f1e9d4 20px);
  color: var(--ink-soft);
}

.year-card.placeholder .yr { color: #b9ab84; }
.year-card.placeholder .house { font-style: italic; }

/* ---------- Officers / roster ---------- */

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

.roster-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 14px;
}

.roster-card .avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--sunset-1), var(--gold));
  display: grid;
  place-items: center;
  color: var(--white);
  font-family: var(--font-display);
  font-size: 1.2rem;
}

.roster-card .role {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--coral);
  font-weight: 700;
}

.roster-card .name {
  font-weight: 700;
  color: var(--ink);
}

/* ---------- Seed / crest page ---------- */

.crest {
  width: 190px;
  height: 190px;
  margin: 0 auto 26px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 25%, var(--ocean-light), var(--ocean-deep) 75%);
  display: grid;
  place-items: center;
  box-shadow: 0 0 0 8px var(--sand), 0 0 0 11px var(--ocean-deep), var(--shadow);
  text-align: center;
  color: var(--white);
  font-family: var(--font-display);
  padding: 10px;
}

.crest .crest-year { font-size: 0.85rem; opacity: 0.8; }
.crest .crest-icon { font-size: 2.6rem; margin: 4px 0; }
.crest .crest-tag { font-size: 0.72rem; letter-spacing: 1px; text-transform: uppercase; }

.story {
  max-width: 680px;
  margin: 0 auto;
  background: var(--white);
  border-radius: var(--radius);
  padding: 36px 40px;
  box-shadow: var(--shadow-sm);
  font-size: 1.05rem;
}

.story p { margin: 0 0 18px; }
.story p:last-child { margin-bottom: 0; }

.vitals-table {
  max-width: 460px;
  margin: 34px auto 0;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.vitals-table .row {
  display: flex;
  justify-content: space-between;
  padding: 12px 22px;
  border-bottom: 1px solid var(--sand);
  font-size: 0.95rem;
}
.vitals-table .row:last-child { border-bottom: none; }
.vitals-table .row .k { font-weight: 700; color: var(--ocean); }
.vitals-table .row .v { color: var(--ink-soft); }

/* ---------- Year detail page ---------- */

.year-hero {
  color: var(--white);
  background: linear-gradient(150deg, var(--ocean-deep), var(--ocean));
  padding: 46px 0 60px;
  text-align: center;
}

.year-hero .yr-nav {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 14px;
  font-size: 0.9rem;
}

.year-hero .yr-nav a {
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,0.14);
  font-weight: 600;
}
.year-hero .yr-nav a:hover { background: rgba(255,255,255,0.25); }
.year-hero .yr-nav .disabled { opacity: 0.35; pointer-events: none; }

.year-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 6vw, 3.6rem);
  margin: 0 0 6px;
}

.year-hero .house-name {
  font-size: 1.2rem;
  color: var(--sunset-3);
  font-weight: 700;
}

.attendees-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  max-width: 720px;
  margin: 18px auto 0;
}

.attendee-chip {
  background: rgba(255,255,255,0.14);
  border: 1px solid rgba(255,255,255,0.22);
  padding: 5px 13px;
  border-radius: 999px;
  font-size: 0.82rem;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  margin-top: -40px;
  position: relative;
  z-index: 2;
}

.gallery figure {
  margin: 0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  background: var(--white);
  aspect-ratio: 1 / 1;
  cursor: zoom-in;
}

.gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.25s ease;
}

.gallery figure:hover img { transform: scale(1.07); }

.empty-year-card {
  max-width: 560px;
  margin: 0 auto;
  text-align: center;
  background: var(--white);
  border-radius: var(--radius);
  padding: 44px 36px;
  box-shadow: var(--shadow-sm);
}

.empty-year-card .big-icon { font-size: 3rem; margin-bottom: 10px; }
.empty-year-card h2 { font-family: var(--font-display); color: var(--ocean-deep); margin: 0 0 10px; }
.empty-year-card p { color: var(--ink-soft); }

/* ---------- Lightbox ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(10, 20, 25, 0.92);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 24px;
}

.lightbox.open { display: flex; }

.lightbox img {
  max-width: 90vw;
  max-height: 82vh;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.lightbox .lb-close,
.lightbox .lb-prev,
.lightbox .lb-next {
  position: absolute;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.25);
  color: var(--white);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1.3rem;
  cursor: pointer;
}

.lightbox .lb-close { top: 20px; right: 20px; }
.lightbox .lb-prev { left: 20px; top: 50%; transform: translateY(-50%); }
.lightbox .lb-next { right: 20px; top: 50%; transform: translateY(-50%); }
.lightbox .lb-close:hover,
.lightbox .lb-prev:hover,
.lightbox .lb-next:hover { background: rgba(255,255,255,0.22); }

.lightbox .lb-count {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,0.7);
  font-size: 0.85rem;
}

/* ---------- Footer ---------- */

.site-footer {
  background: var(--ocean-deep);
  color: rgba(255,255,255,0.75);
  padding: 30px 0;
  text-align: center;
  font-size: 0.88rem;
}

.site-footer strong { color: var(--sunset-3); }

/* ---------- Waves divider ---------- */

.wave-divider {
  height: 44px;
  background: var(--sand);
  position: relative;
  overflow: hidden;
}

.wave-divider svg { position: absolute; bottom: 0; width: 100%; }

@media (max-width: 640px) {
  .story { padding: 26px 22px; }
  .hero { padding: 56px 0 90px; }
}
