/* .Astronomy — Design system with light/dark modes */
/* Space Grotesk (headings) + JetBrains Mono (accents) + Inter (body) */

/* =====================================================
   DARK MODE (default)
   ===================================================== */
:root {
  --bg:           #080810;
  --bg-1:         #0e0e1a;
  --bg-2:         #141422;
  --bg-3:         #1c1c2e;
  --bg-4:         #24243c;
  --border:       #252540;
  --border-hi:    #353560;

  --blue:         #4a9eff;
  --blue-dark:    #2b7de9;
  --blue-dim:     rgba(74, 158, 255, 0.12);
  --blue-glow:    rgba(74, 158, 255, 0.25);
  --blue-border:  rgba(74, 158, 255, 0.3);

  --text:         #eceef8;
  --text-muted:   #a0a0c0;
  --text-dim:     #666688;
  --text-bright:  #ffffff;

  --dot:          #4a9eff;
  --hero-grid:    rgba(74,158,255,0.07);
  --hero-bloom:   rgba(74,158,255,0.07);
  --card-top:     linear-gradient(to right, #4a9eff, transparent);
  --shadow:       rgba(0,0,0,0.4);

  --radius:       6px;
  --radius-lg:    10px;
  --max-width:    1080px;
  --nav-h:        64px;

  --font-head:    'Space Grotesk', system-ui, sans-serif;
  --font-body:    'Inter', system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', 'Fira Code', monospace;

  color-scheme: dark;
}

/* =====================================================
   LIGHT MODE
   ===================================================== */
[data-theme="light"] {
  --bg:           #f5f6fa;
  --bg-1:         #ffffff;
  --bg-2:         #f0f1f8;
  --bg-3:         #e8eaf4;
  --bg-4:         #dde0ef;
  --border:       #d0d4e8;
  --border-hi:    #b0b8d8;

  --blue:         #1a6fd4;
  --blue-dark:    #1458b0;
  --blue-dim:     rgba(26, 111, 212, 0.08);
  --blue-glow:    rgba(26, 111, 212, 0.2);
  --blue-border:  rgba(26, 111, 212, 0.25);

  --text:         #1a1c2e;
  --text-muted:   #42466a;
  --text-dim:     #6a6e98;
  --text-bright:  #0d0f1e;

  --dot:          #1a6fd4;
  --hero-grid:    rgba(26,111,212,0.05);
  --hero-bloom:   rgba(26,111,212,0.05);
  --card-top:     linear-gradient(to right, #1a6fd4, transparent);
  --shadow:       rgba(0,0,0,0.08);

  color-scheme: light;
}

/* =====================================================
   TRANSITIONS — smooth theme switch
   ===================================================== */
body,
.site-header,
.event-card,
.hack-card,
.repo-card,
.site-footer,
.btn,
.nav-links a,
.hero-kicker {
  transition: background-color 0.25s ease, border-color 0.25s ease, color 0.2s ease;
}

/* =====================================================
   RESET & BASE
   ===================================================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.75;
  min-height: 100vh;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue); text-decoration: none; transition: color 0.15s; }
a:hover { color: var(--blue-dark); text-decoration: underline; }

/* =====================================================
   TYPOGRAPHY
   ===================================================== */
h1, h2, h3, h4 {
  font-family: var(--font-head);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--text-bright);
}

h1 { font-size: clamp(2rem, 5vw, 3rem); margin-bottom: 1rem; }

h2 {
  font-size: clamp(1.2rem, 2.5vw, 1.6rem);
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

h3 { font-size: 1.1rem; margin-top: 1.5rem; margin-bottom: 0.4rem; }

p { margin-bottom: 1rem; }
ul, ol { margin: 0.75rem 0 1rem 1.5rem; }
li { margin-bottom: 0.3rem; }

/* =====================================================
   NAV
   ===================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 9000;
  height: var(--nav-h);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

[data-theme="light"] .site-header {
  background: color-mix(in srgb, var(--bg-1) 92%, transparent);
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  text-decoration: none;
}

.site-logo img {
  height: 26px;
  width: auto;
}

/* Logo needs inversion in light mode */
[data-theme="light"] .site-logo img {
  filter: invert(1) brightness(0.2);
}

.site-logo:hover { opacity: 0.8; text-decoration: none; }

.nav-right {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0;
}

.nav-links a {
  display: block;
  padding: 6px 13px;
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  border-radius: var(--radius);
  transition: color 0.15s, background 0.15s;
}

.nav-links a:hover {
  color: var(--text);
  background: var(--bg-3);
  text-decoration: none;
}

.nav-github {
  border: 1px solid var(--border-hi) !important;
  margin-left: 0.5rem;
  font-family: var(--font-mono) !important;
  font-size: 0.75rem !important;
  color: var(--text-muted) !important;
}

.nav-github:hover {
  border-color: var(--blue) !important;
  color: var(--blue) !important;
  background: var(--blue-dim) !important;
}

/* =====================================================
   THEME TOGGLE BUTTON
   ===================================================== */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius);
  border: 1px solid var(--border-hi);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  flex-shrink: 0;
  margin-left: 0.5rem;
  font-size: 1rem;
  line-height: 1;
}

.theme-toggle:hover {
  border-color: var(--blue);
  color: var(--blue);
  background: var(--blue-dim);
}

/* Show correct icon per mode */
.theme-toggle .icon-dark  { display: block; }
.theme-toggle .icon-light { display: none; }

[data-theme="light"] .theme-toggle .icon-dark  { display: none; }
[data-theme="light"] .theme-toggle .icon-light { display: block; }

/* Fallback: if span is empty, use CSS content */
.theme-toggle .icon-dark:empty::before  { content: "\2600"; }
.theme-toggle .icon-light:empty::before { content: "\263D"; }

/* =====================================================
   MAIN CONTENT
   ===================================================== */
.main-content {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 3rem 1.5rem 6rem;
  position: relative;
}

/* =====================================================
   HERO
   ===================================================== */
.hero {
  min-height: calc(90vh - var(--nav-h));
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: 5rem 0 4rem;
  position: relative;
  overflow: hidden;
}

/* Dot grid */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, var(--hero-grid) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
  z-index: 0;
}

/* Blue bloom */
.hero::after {
  content: "";
  position: absolute;
  top: -20%;
  right: -10%;
  width: 60%;
  height: 80%;
  background: radial-gradient(ellipse, var(--hero-bloom) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 680px;
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--blue);
  border: 1px solid var(--blue-border);
  background: var(--blue-dim);
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 1.75rem;
  letter-spacing: 0.04em;
}

.hero-kicker::before {
  content: "●";
  font-size: 0.45rem;
  animation: blink 2s step-end infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

.hero h1 {
  font-family: var(--font-head);
  font-size: clamp(2.8rem, 7vw, 5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.0;
  color: var(--text-bright);
  margin-bottom: 1.25rem;
}

.hero-dot {
  color: var(--blue);
  font-family: var(--font-mono);
}

.hero-sub {
  font-size: 1.05rem;
  color: var(--text);
  line-height: 1.7;
  max-width: 520px;
  margin-bottom: 2.25rem;
}

.hero-ctas {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 3.5rem;
}

.hero-stats {
  display: flex;
  gap: 2.5rem;
  flex-wrap: wrap;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.hero-stat .num {
  font-family: var(--font-head);
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-bright);
  display: block;
  line-height: 1;
  letter-spacing: -0.03em;
}

.hero-stat .label {
  font-size: 0.73rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
}

/* =====================================================
   BUTTONS
   ===================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 600;
  font-family: var(--font-body);
  text-decoration: none;
  transition: all 0.15s;
  cursor: pointer;
  border: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--blue);
  color: #fff;
}
.btn-primary:hover {
  background: var(--blue-dark);
  color: #fff;
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px var(--blue-glow);
}

.btn-outline {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border-hi);
}
.btn-outline:hover {
  border-color: var(--blue);
  color: var(--blue);
  background: var(--blue-dim);
  text-decoration: none;
}

/* =====================================================
   SECTION LABEL (monospaced)
   ===================================================== */
.section-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--blue);
  letter-spacing: 0.1em;
  margin-bottom: 0.5rem;
  margin-top: 3.5rem;
  display: block;
}

/* First section-label on a page shouldn't have extra top margin */
.main-content > .section-label:first-child,
.event-page-nav + .section-label,
h1 + .section-label {
  margin-top: 2.5rem;
}

.section-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--blue);
  border: 1px solid var(--blue-border);
  background: var(--blue-dim);
  padding: 3px 10px;
  border-radius: 4px;
  margin-bottom: 0.75rem;
}

/* =====================================================
   EVENTS TIMELINE
   ===================================================== */
.events-timeline {
  margin-top: 2rem;
  position: relative;
}

.events-timeline::before {
  content: "";
  position: absolute;
  left: 5.75rem;
  top: 0;
  bottom: 0;
  width: 1px;
  background: linear-gradient(to bottom, var(--blue), rgba(74,158,255,0.05));
}

[data-theme="light"] .events-timeline::before {
  background: linear-gradient(to bottom, var(--blue), rgba(26,111,212,0.05));
}


.event-row {
  display: grid;
  grid-template-columns: 5rem 1fr;
  gap: 1.5rem;
  position: relative;
}

.event-year {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-dim);
  padding-top: 1.1rem;
  text-align: right;
  line-height: 1;
  padding-right: 1rem;
}

.event-card {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.4rem;
  margin-bottom: 0.5rem;
  position: relative;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.event-card::before {
  display: none;
}

.event-card:hover {
  border-color: var(--blue-border);
  background: var(--bg-2);
  box-shadow: 0 4px 20px var(--shadow);
}

.event-card a { text-decoration: none; color: inherit; }
.event-card a:hover { text-decoration: none; }

.event-card-head {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 0.3rem;
  flex-wrap: wrap;
}

.event-num-badge {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--blue);
  background: var(--blue-dim);
  border: 1px solid var(--blue-border);
  padding: 2px 8px;
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}

.event-card-title {
  font-family: var(--font-head);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-bright);
  line-height: 1.2;
}

.event-card-meta {
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  font-family: var(--font-mono);
}

.event-card-desc {
  font-size: 0.875rem;
  color: var(--text);
  line-height: 1.55;
}

.event-card-stats {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.65rem;
  flex-wrap: wrap;
}

.event-chip {
  font-family: var(--font-mono);
  font-size: 0.67rem;
  color: var(--text-dim);
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--bg-2);
}

/* =====================================================
   EVENT DETAIL PAGE
   ===================================================== */
.event-hero {
  padding: 2.5rem 0;
  margin-bottom: 2.5rem;
  border-bottom: 1px solid var(--border);
}

.event-num {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--blue);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

.event-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.75rem;
}

/* =====================================================
   HACKS GRID
   ===================================================== */
.hacks-count {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.hacks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 1rem;
  margin-top: 1.25rem;
}

.hack-card {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.35rem 1.4rem;
  position: relative;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}

.hack-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--card-top);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  opacity: 0;
  transition: opacity 0.2s;
}

.hack-card:hover {
  border-color: var(--blue-border);
  transform: translateY(-2px);
  box-shadow: 0 6px 24px var(--shadow);
}

.hack-card:hover::before { opacity: 1; }

.hack-title {
  font-family: var(--font-head);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-bright);
  margin-bottom: 0.35rem;
}

.hack-creators {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--blue);
  margin-bottom: 0.75rem;
}

.hack-desc {
  font-size: 0.875rem;
  color: var(--text);
  line-height: 1.6;
  margin-bottom: 0.9rem;
}

.hack-links {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.hack-link {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 3px 10px;
  border-radius: 4px;
  border: 1px solid var(--border-hi);
  color: var(--text-muted);
  transition: all 0.15s;
  text-decoration: none;
}

.hack-link:hover {
  border-color: var(--blue);
  color: var(--blue);
  background: var(--blue-dim);
  text-decoration: none;
}

/* =====================================================
   REPO CARDS
   ===================================================== */
.repo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}

.repo-card {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  transition: border-color 0.15s;
}

.repo-card:hover { border-color: var(--blue-border); }

.repo-name {
  font-family: var(--font-mono);
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--blue);
  margin-bottom: 0.35rem;
}

.repo-desc {
  font-size: 0.82rem;
  color: var(--text);
  line-height: 1.5;
}

/* =====================================================
   FOOTER
   ===================================================== */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 1.5rem;
  margin-top: 6rem;
  background: var(--bg-1);
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--text-dim);
}

.footer-inner img {
  height: 18px;
  width: auto;
  max-width: 100px;
  opacity: 0.4;
  flex-shrink: 0;
}

[data-theme="light"] .footer-inner img {
  filter: invert(1) brightness(0.2);
}

.footer-inner a { color: var(--text-dim); }
.footer-inner a:hover { color: var(--blue); text-decoration: none; }

/* =====================================================
   PROSE
   ===================================================== */
.prose p { margin-bottom: 1rem; }
.prose ul, .prose ol { margin: 0.75rem 0 1rem 1.5rem; }
.prose li { margin-bottom: 0.35rem; }
.prose h2 { margin-top: 2.5rem; }
.prose h3 { margin-top: 1.75rem; }

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 768px) {
  /* Layout */
  .main-content { padding: 2rem 1rem 4rem; }
  .hero { padding: 3rem 0 2rem; min-height: auto; }
  .hero h1 { font-size: 2.4rem; }
  .hero-stats { gap: 1.5rem; padding-top: 1.5rem; }
  .hacks-grid { grid-template-columns: 1fr; }
  .events-timeline::before { left: 3.7rem; }
  .event-row { grid-template-columns: 3.2rem 1fr; gap: 1rem; }

  /* Nav: hide desktop links, show hamburger */
  .nav-links { display: none; }
  .nav-search-btn { display: none; }  /* hide search on mobile too -- use menu */
  .hamburger { display: flex !important; }

  /* Nav right: just logo and hamburger */
  .nav-right {
    gap: 0.5rem;
  }

  /* Mobile nav overlay */
  .nav-links.mobile-open {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: var(--nav-h);
    left: 0;
    right: 0;
    bottom: 0;
    background: color-mix(in srgb, var(--bg) 97%, transparent);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 9500;
    padding: 1.25rem 1rem 2rem;
    gap: 0.4rem;
    border-top: 1px solid var(--border);
    overflow-y: auto;
  }

  .nav-links.mobile-open a,
  .nav-links.mobile-open .nav-more {
    width: 100%;
  }

  .nav-links.mobile-open a {
    padding: 13px 16px;
    font-size: 1rem;
    font-weight: 500;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: color-mix(in srgb, var(--bg-2) 80%, transparent);
    color: var(--text);
  }

  .nav-links.mobile-open a:hover,
  .nav-links.mobile-open a:active {
    background: color-mix(in srgb, var(--bg-3) 90%, transparent);
    border-color: var(--blue-border);
    color: var(--blue);
  }

  /* More button full width on mobile */
  .nav-links.mobile-open .nav-more-btn {
    width: 100%;
    padding: 13px 16px;
    font-size: 1rem;
    font-weight: 500;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: color-mix(in srgb, var(--bg-2) 80%, transparent);
    color: var(--text);
    justify-content: space-between;
  }

  /* More submenu inline */
  .nav-links.mobile-open .nav-more-menu {
    position: static;
    display: none;
    border: none;
    border-radius: 0;
    box-shadow: none;
    padding: 0.25rem 0 0 1rem;
    background: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    margin-top: 0;
  }

  .nav-links.mobile-open .nav-more-menu.is-open { display: block; }

  .nav-links.mobile-open .nav-more-menu a {
    border: 1px solid var(--border-dim, var(--border));
    background: color-mix(in srgb, var(--bg-1) 60%, transparent);
    margin-bottom: 0.3rem;
    border-radius: 8px;
    font-size: 0.95rem;
    padding: 10px 14px;
    color: var(--text-muted);
  }

  .nav-more-divider { margin: 0.25rem 0; }

  /* Footer: fix overlap */
  .site-footer {
    margin-top: 3rem;
    padding: 1.5rem 1rem 4rem; /* extra bottom padding for corner credit */
  }

  .footer-inner {
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-start;
    font-size: 0.72rem;
  }

  /* Corner credit: move above footer on mobile */
  .bg-corner-credit {
    position: fixed;
    bottom: 4.5rem;
    right: 0.75rem;
    font-size: 0.6rem;
    max-width: 180px;
    padding: 3px 8px;
  }

  /* Braintrust grid: single column */
  .braintrust-grid { grid-template-columns: 1fr; }

  /* Paper cards */
  .paper-card { padding: 1.25rem; }
}

@media (max-width: 480px) {
  .hero h1 { font-size: 2rem; }
  .event-row { grid-template-columns: 2.8rem 1fr; gap: 0.75rem; }
  .events-timeline::before { left: 3.1rem; }
}

@media (min-width: 900px) {
  .hacks-grid { grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); }
}

/* =====================================================
   BRAIN TRUST GRID
   ===================================================== */
.braintrust-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  margin-top: 2rem;
}

.person-card {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.4rem;
  transition: border-color 0.2s;
}

.person-card:hover { border-color: var(--blue-border); }

.person-card-top {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 0.85rem;
}

.person-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid var(--border-hi);
  background: var(--bg-3);
}

.person-name {
  font-family: var(--font-head);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-bright);
  margin-bottom: 0.1rem;
  line-height: 1.2;
}

.person-role {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--blue);
  margin-bottom: 0.15rem;
}

.person-handle {
  font-family: var(--font-mono);
  font-size: 0.67rem;
  color: var(--text-dim);
}

.person-handle a { color: var(--text-dim); }
.person-handle a:hover { color: var(--blue); text-decoration: none; }

.person-bio {
  font-size: 0.85rem;
  color: var(--text);
  line-height: 1.6;
  margin-bottom: 0;
}

/* =====================================================
   FORMS
   ===================================================== */
.form-card {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem 2rem 1.5rem;
  max-width: 680px;
  margin-top: 2rem;
}

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

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

@media (max-width: 560px) {
  .form-row { grid-template-columns: 1fr; }
}

label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  margin-bottom: 0.4rem;
}

.required {
  color: var(--blue);
}

input[type="text"],
input[type="email"],
input[type="url"],
textarea {
  width: 100%;
  background: var(--bg-2);
  border: 1px solid var(--border-hi);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.9rem;
  padding: 10px 12px;
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
  -webkit-appearance: none;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="url"]:focus,
textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-dim);
}

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

textarea {
  resize: vertical;
  min-height: 120px;
  line-height: 1.6;
}

[data-theme="light"] input[type="text"],
[data-theme="light"] input[type="email"],
[data-theme="light"] input[type="url"],
[data-theme="light"] textarea {
  background: var(--bg);
  color: var(--text);
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

.form-note {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-dim);
  line-height: 1.4;
}

.form-message {
  margin-top: 1.25rem;
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
}

.form-success {
  background: rgba(74, 222, 128, 0.08);
  border: 1px solid rgba(74, 222, 128, 0.3);
  color: #4ade80;
}

.form-error {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
}

.form-error a { color: #f87171; }


/* =====================================================
   CONTRIBUTE CARDS (about page)
   ===================================================== */
.contribute-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.contribute-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  text-decoration: none;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
  color: inherit;
}

.contribute-card:hover {
  border-color: var(--blue-border);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--shadow);
  text-decoration: none;
  color: inherit;
}

.contribute-card-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--blue);
  letter-spacing: 0.1em;
  margin-bottom: 0.75rem;
  background: var(--blue-dim);
  border: 1px solid var(--blue-border);
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
}

.contribute-card-title {
  font-family: var(--font-head);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-bright);
  margin-bottom: 0.5rem;
}

.contribute-card-desc {
  font-size: 0.85rem;
  color: var(--text);
  line-height: 1.6;
  flex: 1;
  margin-bottom: 1rem !important;
}

.contribute-card:hover .btn-outline {
  border-color: var(--blue);
  color: var(--blue);
  background: var(--blue-dim);
}

/* =====================================================
   COMMUNITY PAGE
   ===================================================== */
.page-lead {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 600px;
  margin-bottom: 2.5rem;
  line-height: 1.7;
}

.slack-hero {
  background: var(--bg-1);
  border: 1px solid var(--blue-border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin-bottom: 3rem;
}

.slack-hero-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
}

.slack-icon {
  color: var(--blue);
  flex-shrink: 0;
  display: block;
}

.slack-hero-title {
  font-family: var(--font-head);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-bright);
  line-height: 1.2;
}

.slack-hero-desc {
  color: var(--text);
  font-size: 0.975rem;
  max-width: 520px;
  margin-bottom: 1.25rem;
}

.slack-signin {
  font-family: var(--font-mono);
  font-size: 0.72rem !important;
  color: var(--text-dim) !important;
  margin-top: 0.6rem !important;
  margin-bottom: 0 !important;
}

.slack-signin a { color: var(--text-dim); }
.slack-signin a:hover { color: var(--blue); text-decoration: none; }

@media (max-width: 560px) {
  .slack-hero-body { flex-direction: column; gap: 1rem; }
}

.community-links {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-top: 1.25rem;
}

@media (max-width: 560px) {
  .community-links { grid-template-columns: 1fr; }
}

.community-link-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.4rem 1.5rem;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s, transform 0.15s, box-shadow 0.15s;
}

.community-link-card:hover {
  border-color: var(--blue-border);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--shadow);
  text-decoration: none;
  color: inherit;
}

.clc-title {
  font-family: var(--font-head);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-bright);
  margin-bottom: 0.4rem;
}

.clc-desc {
  font-size: 0.875rem;
  color: var(--text);
  line-height: 1.6;
  flex: 1;
  margin-bottom: 1rem;
}

.clc-cta {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--blue);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.community-link-card:hover .clc-cta {
  text-decoration: underline;
}

/* =====================================================
   UPCOMING EVENTS PAGE
   ===================================================== */
.upcoming-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.upcoming-card {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  transition: border-color 0.2s;
}

.upcoming-card:hover { border-color: var(--blue-border); }

.upcoming-status { margin-bottom: 1rem; }

.status-pill {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 4px;
  letter-spacing: 0.06em;
}

.status-pill.planned {
  background: var(--blue-dim);
  color: var(--blue);
  border: 1px solid var(--blue-border);
}

.status-pill.confirmed {
  background: rgba(74,222,128,0.1);
  color: #4ade80;
  border: 1px solid rgba(74,222,128,0.3);
}

.status-pill.open {
  background: rgba(251,191,36,0.1);
  color: #fbbf24;
  border: 1px solid rgba(251,191,36,0.3);
}

.upcoming-num {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--blue);
  margin-bottom: 0.4rem;
  letter-spacing: 0.06em;
}

.upcoming-title {
  font-family: var(--font-head);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-bright);
  margin: 0 0 0.75rem;
  padding: 0;
  border: none;
}

.upcoming-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.upcoming-desc {
  font-size: 0.925rem;
  color: var(--text);
  line-height: 1.65;
  margin-bottom: 0.75rem;
}

.upcoming-contact-note {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-dim);
  margin-top: 0.6rem !important;
  margin-bottom: 0 !important;
}

/* =====================================================
   LIVE EVENT PAGE
   ===================================================== */
.live-header {
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: #ef4444;
  border: 1px solid rgba(239,68,68,0.35);
  background: rgba(239,68,68,0.1);
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 1rem;
  letter-spacing: 0.05em;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ef4444;
  display: inline-block;
  animation: pulse-red 1.5s ease-in-out infinite;
}

@keyframes pulse-red {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.7); }
}

.live-title {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  margin-bottom: 0.75rem;
}

.live-grid {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 2rem;
  align-items: start;
}

@media (max-width: 780px) {
  .live-grid { grid-template-columns: 1fr; }
}

.live-section { margin-bottom: 2.5rem; }
.live-section h2 { font-size: 1.2rem; }

.liveblog {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin-top: 1rem;
}

.liveblog-entry {
  display: grid;
  grid-template-columns: 5rem 1fr;
  gap: 1.25rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}

.liveblog-time {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--blue);
  padding-top: 0.15rem;
  flex-shrink: 0;
}

.liveblog-body p { margin-bottom: 0.5rem; font-size: 0.95rem; }
.liveblog-body p:last-child { margin-bottom: 0; }

.liveblog-empty {
  padding: 2rem;
  background: var(--bg-1);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.live-schedule {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.sched-item {
  display: flex;
  gap: 1.25rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border-dim, var(--border));
  font-size: 0.9rem;
}

.sched-time {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  width: 4rem;
  flex-shrink: 0;
  padding-top: 0.1rem;
}

.sched-title { color: var(--text); }

.live-sidebar { display: flex; flex-direction: column; gap: 1rem; }

.live-sidebar-card {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
}

.live-sidebar-title {
  font-family: var(--font-head);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-bright);
  margin-bottom: 0.5rem;
}

.live-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.live-links li { margin-bottom: 0.35rem; font-size: 0.875rem; }

/* =====================================================
   BACKGROUND IMAGE SYSTEM
   ===================================================== */

/* Fixed background layer */
.bg-layer {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image: var(--bg-image);
  background-size: cover;
  background-position: center 30%;
  background-repeat: no-repeat;
  opacity: 0.18;
  transition: opacity 0.6s ease;
}

[data-theme="light"] .bg-layer {
  opacity: 0.12;
}

body.bg-transitioning .bg-layer {
  opacity: 0;
}

/* Glassmorphism on key surfaces */
.site-header {
  background: color-mix(in srgb, var(--bg) 70%, transparent) !important;
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
}

[data-theme="light"] .site-header {
  background: color-mix(in srgb, var(--bg-1) 75%, transparent) !important;
}

/* Glass cards */
.event-card,
.hack-card,
.repo-card,
.community-link-card,
.contribute-card,
.upcoming-card,
.live-sidebar-card,
.person-card,
.form-card,
.slack-hero {
  background: color-mix(in srgb, var(--bg-1) 92%, transparent) !important;
  backdrop-filter: blur(12px) saturate(1.2);
  -webkit-backdrop-filter: blur(12px) saturate(1.2);
}

[data-theme="light"] .event-card,
[data-theme="light"] .hack-card,
[data-theme="light"] .repo-card,
[data-theme="light"] .community-link-card,
[data-theme="light"] .contribute-card,
[data-theme="light"] .upcoming-card,
[data-theme="light"] .person-card,
[data-theme="light"] .form-card,
[data-theme="light"] .slack-hero {
  background: color-mix(in srgb, #ffffff 88%, transparent) !important;
  backdrop-filter: blur(16px) saturate(1.3);
}

/* Footer glass */
.site-footer {
  background: color-mix(in srgb, var(--bg-1) 80%, transparent) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* Hero -- slightly more transparent so the bg shows through */
.hero::before {
  opacity: 0.5; /* soften the dot grid over the background image */
}

/* =====================================================
   CORNER IMAGE CREDIT
   ===================================================== */
.bg-corner-credit {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: rgba(255,255,255,0.4);
  background: rgba(0,0,0,0.3);
  backdrop-filter: blur(8px);
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.1);
  max-width: 280px;
  transition: opacity 0.2s, color 0.2s;
  pointer-events: auto;
}

.bg-corner-credit:hover {
  color: rgba(255,255,255,0.8);
  border-color: rgba(255,255,255,0.25);
}

.bg-corner-label {
  flex-shrink: 0;
  opacity: 0.7;
}

.bg-corner-credit a {
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bg-corner-credit a:hover {
  color: var(--blue);
  text-decoration: underline;
}

[data-theme="light"] .bg-corner-credit {
  background: rgba(255,255,255,0.7);
  color: rgba(0,0,0,0.5);
  border-color: rgba(0,0,0,0.1);
}

/* =====================================================
   ABOUT PAGE - IMAGE CREDIT WIDGET
   ===================================================== */
.bg-credit-widget {
  background: color-mix(in srgb, var(--bg-1) 80%, transparent);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin: 2rem 0;
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  flex-wrap: wrap;
}

.bg-credit-preview {
  width: 120px;
  height: 70px;
  border-radius: var(--radius);
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid var(--border);
}

.bg-credit-preview-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background-image: var(--bg-image);
  background-size: cover;
  background-position: center;
}

.bg-credit-info {
  flex: 1;
  min-width: 200px;
}

.bg-credit-info-title {
  font-family: var(--font-head);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-bright);
  margin-bottom: 0.25rem;
}

.bg-credit-info-instrument {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--blue);
  margin-bottom: 0.5rem;
}

.bg-credit-info-credit {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.bg-credit-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.bg-count-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-dim);
}

/* Archive reconstruction note */
.archive-note {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-dim);
  margin-top: 3rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}
.archive-note a { color: var(--text-dim); }
.archive-note a:hover { color: var(--blue); }

/* =====================================================
   MORE DROPDOWN
   ===================================================== */
.nav-more {
  position: relative;
}

.nav-more-btn {
  gap: 0.35rem;
  cursor: pointer;
  /* Reset browser button defaults */
  appearance: none;
  -webkit-appearance: none;
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 500;
  /* Match nav link pill exactly */
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  color: var(--text);
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg-3) 60%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid transparent;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}

.nav-more-btn:hover {
  color: var(--text);
  background: color-mix(in srgb, var(--bg-4) 80%, transparent);
  border-color: var(--border);
}

.nav-more-btn[aria-expanded="true"] {
  color: var(--text);
  background: color-mix(in srgb, var(--bg-4) 80%, transparent);
  border-color: var(--border);
}

.nav-more-chevron {
  font-size: 0.65rem;
  opacity: 0.55;
  transition: transform 0.2s;
  display: inline-block;
}

.nav-more-btn[aria-expanded="true"] .nav-more-chevron {
  transform: rotate(180deg);
}

.nav-more-menu {
  display: none;
  position: absolute;
  top: calc(100% + 0.6rem);
  right: 0;
  min-width: 170px;
  background: color-mix(in srgb, var(--bg-2) 92%, transparent);
  backdrop-filter: blur(24px) saturate(1.5);
  -webkit-backdrop-filter: blur(24px) saturate(1.5);
  border: 1px solid var(--border-hi);
  border-radius: 14px;
  padding: 0.35rem;
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
  z-index: 9999;
}

.nav-more-menu.is-open {
  display: block;
}

.nav-more-menu a {
  display: block;
  padding: 8px 14px;
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--text-muted);
  border-radius: 9px;
  transition: color 0.12s, background 0.12s;
  text-decoration: none;
  white-space: nowrap;
}

.nav-more-menu a:hover {
  color: var(--text);
  background: var(--bg-3);
  text-decoration: none;
}

.nav-more-highlight {
  color: var(--blue) !important;
  font-weight: 600 !important;
}

.nav-more-highlight:hover {
  background: var(--blue-dim) !important;
}

.nav-more-divider {
  height: 1px;
  background: var(--border);
  margin: 0.3rem 0.6rem;
}

[data-theme="light"] .nav-more-menu {
  background: color-mix(in srgb, #ffffff 94%, transparent);
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
}

/* =====================================================
   SINGLE EVENT PAGE
   ===================================================== */
.event-page-hero {
  padding: 3rem 0 2.5rem;
  margin-bottom: 0;
  border-bottom: 1px solid var(--border);
}

.event-page-kicker {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--blue);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.event-page-kicker::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--blue);
}

.event-page-title {
  font-family: var(--font-head);
  font-size: clamp(2.2rem, 6vw, 4rem);
  font-weight: 700;
  color: var(--text-bright);
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin-bottom: 1rem;
  border: none;
  padding: 0;
}

.event-page-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.event-page-desc {
  font-size: 1.05rem;
  color: var(--text);
  line-height: 1.7;
  max-width: 680px;
}

/* In-page jump nav */
.event-page-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2.5rem;
}

.event-page-nav a {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid var(--border-hi);
  color: var(--text-muted);
  background: color-mix(in srgb, var(--bg-2) 70%, transparent);
  transition: all 0.15s;
  text-decoration: none;
}

.event-page-nav a:hover {
  color: var(--blue);
  border-color: var(--blue-border);
  background: var(--blue-dim);
  text-decoration: none;
}

/* Section headings with large label style */
.main-content h2 {
  font-family: var(--font-head);
  font-size: clamp(1.3rem, 3vw, 1.8rem);
  font-weight: 700;
  color: var(--text-bright);
  letter-spacing: -0.02em;
  margin-top: 3rem;
  margin-bottom: 1rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border);
  scroll-margin-top: calc(var(--nav-h) + 1rem);
}

.main-content h3 {
  font-family: var(--font-head);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  margin-top: 1.75rem;
  margin-bottom: 0.6rem;
  scroll-margin-top: calc(var(--nav-h) + 1rem);
}

/* Participant list -- compact columns */
.participants-list {
  columns: 2;
  column-gap: 2rem;
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.8;
  list-style: none;
  padding: 0;
  margin: 0.75rem 0;
}

.participants-list li::before {
  content: "·";
  color: var(--blue);
  margin-right: 0.4rem;
}

@media (max-width: 560px) {
  .participants-list { columns: 1; }
}

/* =====================================================
   SITE SEARCH
   ===================================================== */
.search-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(8, 8, 16, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 6rem 1.5rem 2rem;
  align-items: flex-start;
  justify-content: center;
}

.search-overlay.is-open {
  display: flex;
}

[data-theme="light"] .search-overlay {
  background: rgba(240, 241, 250, 0.88);
}

.search-box {
  width: 100%;
  max-width: 660px;
}

.search-input-wrap {
  position: relative;
  margin-bottom: 1rem;
}

.search-input {
  width: 100%;
  background: var(--bg-1);
  border: 1px solid var(--blue-border);
  border-radius: 14px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.15rem;
  padding: 1rem 3.5rem 1rem 1.25rem;
  outline: none;
  box-shadow: 0 0 0 3px var(--blue-dim), 0 16px 48px rgba(0,0,0,0.5);
  -webkit-appearance: none;
}

[data-theme="light"] .search-input {
  background: #fff;
  box-shadow: 0 0 0 3px var(--blue-dim), 0 16px 48px rgba(0,0,0,0.15);
}

.search-close {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}

.search-close:hover { color: var(--text); }

.search-results {
  background: var(--bg-1);
  border: 1px solid var(--border-hi);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 16px 48px rgba(0,0,0,0.4);
  max-height: 60vh;
  overflow-y: auto;
}

[data-theme="light"] .search-results {
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
}

.search-result-item {
  display: block;
  padding: 0.9rem 1.25rem;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  transition: background 0.12s;
}

.search-result-item:last-child { border-bottom: none; }

.search-result-item:hover {
  background: var(--bg-2);
  text-decoration: none;
}

.search-result-title {
  font-family: var(--font-head);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-bright);
  margin-bottom: 0.15rem;
}

.search-result-title mark {
  background: var(--blue-dim);
  color: var(--blue);
  border-radius: 3px;
  padding: 0 2px;
}

.search-result-context {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.search-empty {
  padding: 2rem 1.25rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.search-hint {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-dim);
  text-align: center;
  margin-top: 0.75rem;
}

/* Search button in nav */
.nav-search-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 6px 13px;
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text);
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg-3) 60%, transparent);
  backdrop-filter: blur(8px);
  border: 1px solid transparent;
  cursor: pointer;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
  appearance: none;
  -webkit-appearance: none;
}

.nav-search-btn:hover {
  color: var(--text);
  background: color-mix(in srgb, var(--bg-4) 80%, transparent);
  border-color: var(--border);
}

.nav-search-icon {
  font-size: 0.85rem;
  font-weight: 400;
}

.nav-search-kbd {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  background: var(--bg-3);
  border: 1px solid var(--border-hi);
  border-radius: 4px;
  padding: 1px 5px;
  color: var(--text-dim);
  margin-left: 0.1rem;
}

/* =====================================================
   HAMBURGER BUTTON (mobile only)
   ===================================================== */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  background: color-mix(in srgb, var(--bg-3) 60%, transparent);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-hi);
  border-radius: 999px;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}

.hamburger span {
  display: block;
  width: 16px;
  height: 1.5px;
  background: var(--text-muted);
  border-radius: 2px;
  transition: all 0.2s;
}

.hamburger.is-open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.hamburger.is-open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger.is-open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* Prevent body scroll when mobile nav open */
body.nav-open { overflow: hidden; }

/* Global overflow fix */
html, body { overflow-x: hidden; max-width: 100vw; }

/* =====================================================
   EVENT PAGE GHOST NUMBER
   ===================================================== */
.event-page-hero {
  position: relative;
  overflow: visible;
}

.event-page-hero::after {
  content: attr(data-num);
  position: absolute;
  top: -0.1em;
  right: -0.02em;
  font-family: var(--font-head);
  font-size: clamp(10rem, 30vw, 26rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--blue);
  opacity: 0.07;
  pointer-events: none;
  user-select: none;
  z-index: 0;
  white-space: nowrap;
  /* Prevent clipping -- allow overflow to right */
  overflow: visible;
}

[data-theme="light"] .event-page-hero::after {
  opacity: 0.05;
}

/* Ensure hero content sits above the ghost number */
.event-page-hero > * {
  position: relative;
  z-index: 1;
}

/* Corner cycle button */
.bg-corner-cycle {
  background: none;
  border: none;
  color: rgba(255,255,255,0.4);
  cursor: pointer;
  font-size: 0.85rem;
  padding: 0 0 0 0.4rem;
  line-height: 1;
  transition: color 0.15s, transform 0.15s;
  flex-shrink: 0;
  appearance: none;
  -webkit-appearance: none;
  border-left: 1px solid rgba(255,255,255,0.1);
  margin-left: 0.3rem;
}

.bg-corner-cycle:hover {
  color: rgba(255,255,255,0.9);
  transform: translateX(2px);
}

[data-theme="light"] .bg-corner-cycle {
  color: rgba(0,0,0,0.35);
  border-left-color: rgba(0,0,0,0.1);
}

[data-theme="light"] .bg-corner-cycle:hover {
  color: rgba(0,0,0,0.8);
}

/* =====================================================
   CONTRIBUTE BAR (event pages)
   ===================================================== */
.contribute-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding: 0.75rem 1rem;
  background: color-mix(in srgb, var(--bg-2) 80%, transparent);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 2rem;
  font-size: 0.8rem;
}

.contribute-bar-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-right: 0.25rem;
  flex-shrink: 0;
}

.contribute-bar-link {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  border: 1px solid var(--border-hi);
  border-radius: 999px;
  padding: 3px 11px;
  text-decoration: none;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
  white-space: nowrap;
}

.contribute-bar-link:hover {
  color: var(--blue);
  border-color: var(--blue-border);
  background: var(--blue-dim);
  text-decoration: none;
}

/* Contribute section wrapper */
.contribute-section {
  margin-top: 4rem;
  padding-top: 0;
  border-top: 1px solid var(--border);
}

.contribute-section .section-label {
  margin-top: 2rem;
  margin-bottom: 1rem;
}

.contribute-section .contribute-bar {
  margin-bottom: 0;
  background: none;
  border: none;
  padding: 0;
}

/* Pending submissions pill */
.pending-pill {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-muted);
  background: color-mix(in srgb, var(--bg-3) 70%, transparent);
  border: 1px solid var(--border-hi);
  border-radius: 999px;
  padding: 3px 11px;
  margin-bottom: 1rem;
  text-decoration: none;
  transition: color 0.15s, border-color 0.15s;
}

.pending-pill::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--blue);
  margin-right: 0.45rem;
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.pending-pill:hover {
  color: var(--blue);
  border-color: var(--blue-border);
  text-decoration: none;
}

/* =====================================================
   RESEARCH / PUBLICATIONS PAGE
   ===================================================== */
.paper-grid {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-top: 2rem;
}

.paper-card {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem 2rem;
  transition: border-color 0.2s;
}

.paper-card:hover { border-color: var(--blue-border); }

.paper-card.featured {
  border-color: var(--blue-border);
  background: color-mix(in srgb, var(--bg-1) 95%, transparent);
}

.paper-meta {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 0.75rem;
}

.paper-year {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--blue);
}

.paper-type {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 8px;
}

.paper-title {
  font-family: var(--font-head);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-bright);
  margin: 0 0 0.5rem;
  padding: 0;
  border: none;
  letter-spacing: -0.01em;
}

.paper-authors {
  font-size: 0.85rem;
  color: var(--blue);
  font-weight: 500;
  margin-bottom: 0.75rem;
}

.paper-abstract {
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.7;
  margin-bottom: 1rem;
}

.paper-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
}

.paper-links {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* =====================================================
   PARTICIPANTS DIRECTORY
   ===================================================== */

/* Stats */
.dir-stats { margin: 2rem 0; }
.dir-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.dir-stat {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  text-align: center;
}
.dir-stat-num {
  display: block;
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 700;
  color: var(--blue);
}
.dir-stat-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.25rem;
}

/* Event breakdown */
.dir-event-breakdown {
  margin-bottom: 1rem;
}
.dir-event-breakdown summary {
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.dir-event-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  margin-top: 0.75rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.dir-event-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

/* Event badge (tiny pill) */
.event-badge-xs {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 600;
  line-height: 1;
  padding: 2px 5px;
  border-radius: 3px;
  color: #fff;
  text-align: center;
  min-width: 1.1rem;
}
.eb-one    { background: #e74c3c; }
.eb-two    { background: #e67e22; }
.eb-three  { background: #f1c40f; color: #222; }
.eb-four   { background: #2ecc71; }
.eb-five   { background: #1abc9c; }
.eb-six    { background: #3498db; }
.eb-seven  { background: #9b59b6; }
.eb-eight  { background: #e84393; }
.eb-nine   { background: #00cec9; }
.eb-ten    { background: #6c5ce7; }
.eb-eleven { background: #fd79a8; }
.eb-twelve { background: #00b894; }
.eb-thirteen { background: #0984e3; }
.eb-alpha  { background: var(--blue); }

/* Search input */
.dir-search {
  width: 100%;
  max-width: 400px;
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
  font-family: var(--font-body);
  background: var(--bg-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  outline: none;
  margin-bottom: 1rem;
  transition: border-color 0.2s;
}
.dir-search:focus {
  border-color: var(--blue);
}
.dir-search::placeholder {
  color: var(--text-muted);
}

/* Attendance grid */
.attendance-section { margin: 2rem 0; }
.attendance-grid-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.attendance-grid {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) repeat(14, 28px);
  gap: 0;
  font-size: 0.75rem;
  min-width: 600px;
}
.ag-row {
  display: contents;
}
.ag-row:hover .ag-name,
.ag-row:hover .ag-cell {
  background: var(--bg-3);
}
.ag-header .ag-header-cell {
  background: var(--bg-2);
  font-weight: 600;
  color: var(--text-muted);
  font-family: var(--font-mono);
}
.ag-name {
  padding: 3px 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-bottom: 1px solid var(--border);
  font-size: 0.78rem;
  display: flex;
  align-items: center;
  gap: 4px;
}
.ag-cell {
  border-bottom: 1px solid var(--border);
  border-left: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
}
.ag-filled {
  position: relative;
}
.ag-filled::after {
  content: '';
  width: 14px;
  height: 14px;
  border-radius: 3px;
  display: block;
}
.ag-filled.eb-one::after    { background: #e74c3c; }
.ag-filled.eb-two::after    { background: #e67e22; }
.ag-filled.eb-three::after  { background: #f1c40f; }
.ag-filled.eb-four::after   { background: #2ecc71; }
.ag-filled.eb-five::after   { background: #1abc9c; }
.ag-filled.eb-six::after    { background: #3498db; }
.ag-filled.eb-seven::after  { background: #9b59b6; }
.ag-filled.eb-eight::after  { background: #e84393; }
.ag-filled.eb-nine::after   { background: #00cec9; }
.ag-filled.eb-ten::after    { background: #6c5ce7; }
.ag-filled.eb-eleven::after { background: #fd79a8; }
.ag-filled.eb-twelve::after { background: #00b894; }
.ag-filled.eb-thirteen::after { background: #0984e3; }
.ag-filled.eb-alpha::after  { background: var(--blue); }

/* Bluesky link in grid */
.bsky-link {
  text-decoration: none;
  font-size: 0.7rem;
  opacity: 0.6;
  transition: opacity 0.2s;
}
.bsky-link:hover { opacity: 1; }

/* Participants table */
.participants-table-wrap {
  overflow-x: auto;
  margin: 1rem 0 2rem;
}
.participants-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}
.participants-table th {
  text-align: left;
  padding: 0.5rem 0.75rem;
  border-bottom: 2px solid var(--border-hi);
  font-family: var(--font-heading);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  white-space: nowrap;
}
.participants-table td {
  padding: 0.4rem 0.75rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.participants-table tbody tr:hover {
  background: var(--bg-2);
}
.dir-name {
  font-weight: 500;
  white-space: nowrap;
}
.dir-events {
  white-space: nowrap;
}
.dir-events .event-badge-xs {
  margin-right: 1px;
}
.dir-affiliation {
  color: var(--text-muted);
  font-size: 0.75rem;
  max-width: 250px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Role tags */
.role-tag {
  display: inline-block;
  font-size: 0.65rem;
  padding: 1px 5px;
  border-radius: 3px;
  font-family: var(--font-mono);
  margin-right: 2px;
}
.role-organiser {
  background: rgba(231, 76, 60, 0.15);
  color: #e74c3c;
  border: 1px solid rgba(231, 76, 60, 0.3);
}
.role-speaker {
  background: rgba(52, 152, 219, 0.15);
  color: #3498db;
  border: 1px solid rgba(52, 152, 219, 0.3);
}
.role-attendee {
  background: rgba(255,255,255,0.05);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

/* Bluesky handle link */
.bsky-handle {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--blue);
  text-decoration: none;
  white-space: nowrap;
}
.bsky-handle:hover {
  text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
  .attendance-grid {
    grid-template-columns: minmax(120px, 1fr) repeat(14, 22px);
    font-size: 0.65rem;
  }
  .ag-filled::after {
    width: 10px;
    height: 10px;
  }
  .dir-affiliation { display: none; }
  .dir-search { max-width: 100%; }
}

/* =====================================================
   PARTICIPANTS DIRECTORY TABLE
   ===================================================== */
.dir-search-wrap { position: relative; }

.dir-search {
  width: 100%;
  max-width: 480px;
  background: var(--bg-1);
  border: 1px solid var(--border-hi);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.9rem;
  padding: 9px 14px;
  outline: none;
  -webkit-appearance: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.dir-search:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-dim);
}

.participants-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  margin-top: 0.5rem;
}

.participants-table thead th {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  padding: 8px 12px 8px 0;
  text-align: left;
}

.participants-table tbody td {
  padding: 8px 12px 8px 0;
  border-bottom: 1px solid rgba(37,37,64,0.4);
  vertical-align: middle;
}

.participants-table tbody tr:hover td {
  background: var(--bg-1);
}

.participants-table tr.p-multi .p-name {
  font-weight: 600;
  color: var(--text-bright);
}

.p-aff {
  font-size: 0.78rem;
  color: var(--text-muted);
  max-width: 220px;
}

.p-events {
  white-space: nowrap;
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  align-items: center;
}

.p-bsky a.bsky-link {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--blue);
  white-space: nowrap;
}

/* Event badge XS */
.event-badge-xs {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 700;
  min-width: 20px;
  height: 20px;
  padding: 0 4px;
  border-radius: 4px;
  background: var(--blue-dim);
  color: var(--blue);
  border: 1px solid var(--blue-border);
  cursor: default;
}

/* Role-specific badge colours -- !important to beat per-event rainbow colours */
.event-badge-xs.eb-role-org {
  background: rgba(245,158,11,0.15) !important;
  color: #f59e0b !important;
  border-color: rgba(245,158,11,0.4) !important;
}

.event-badge-xs.eb-role-spk {
  background: rgba(74,222,128,0.12) !important;
  color: #4ade80 !important;
  border-color: rgba(74,222,128,0.35) !important;
}

/* Dir stats */
.dir-stats { margin-bottom: 1.5rem; }

.dir-stats-grid {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
}

.dir-stat .dir-stat-num {
  font-family: var(--font-head);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-bright);
  display: block;
  line-height: 1;
  letter-spacing: -0.02em;
}

.dir-stat .dir-stat-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

@media (max-width: 640px) {
  .participants-table thead th:nth-child(2),
  .participants-table tbody td:nth-child(2) { display: none; }
  .p-bsky { display: none; }
}

.dir-footer-actions {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.dir-footer-links {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
  margin-bottom: 0.5rem;
}

/* =====================================================
   ATTENDANCE GRID
   ===================================================== */
.ag-scroll {
  overflow-x: auto;
  margin-bottom: 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.attendance-grid {
  display: table;
  min-width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}

.ag-row {
  display: table-row;
}

.ag-row:hover .ag-name,
.ag-row:hover .ag-cell {
  background: var(--bg-2);
}

.ag-header .ag-name,
.ag-header .ag-cell {
  background: var(--bg-2) !important;
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--text-muted);
  font-size: 0.7rem;
  border-bottom: 2px solid var(--border);
}

.ag-name {
  display: table-cell;
  padding: 7px 14px 7px 12px;
  white-space: nowrap;
  min-width: 160px;
  border-bottom: 1px solid var(--border-dim, var(--border));
  color: var(--text);
  font-weight: 500;
  position: sticky;
  left: 0;
  background: var(--bg-1);
  z-index: 1;
}

.ag-cell {
  display: table-cell;
  width: 32px;
  min-width: 32px;
  height: 34px;
  border-bottom: 1px solid var(--border-dim, var(--border));
  border-left: 1px solid var(--border-dim, var(--border));
  vertical-align: middle;
  text-align: center;
}

.ag-header-cell {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--blue);
  padding: 0;
  line-height: 34px;
}

.ag-filled {
  background: var(--blue-dim);
  border-radius: 4px;
}

.ag-filled.ag-org {
  background: rgba(245,158,11,0.2);
}

.ag-filled.ag-spk {
  background: rgba(74,222,128,0.15);
}

.ag-empty {
  background: transparent;
}

/* Dot inside filled cell */
.ag-filled::after {
  content: "";
  display: block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin: 0 auto;
  background: var(--blue);
  opacity: 0.7;
}

.ag-filled.ag-org::after { background: #f59e0b; }
.ag-filled.ag-spk::after { background: #4ade80; }

.attendance-section { margin-bottom: 1rem; }

/* Affiliation with history indicator */
.p-aff-tip {
  position: relative;
  cursor: help;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.p-aff-hist-dot {
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--blue);
  opacity: 0.55;
  flex-shrink: 0;
  vertical-align: middle;
}

.p-aff-tip:hover .p-aff-hist-dot {
  opacity: 1;
}

/* Per-event colours for attendance grid */
.ag-filled.ev-one     { background: rgba(239,68,68,0.35); }
.ag-filled.ev-one::after     { background: #ef4444; }
.ag-filled.ev-two     { background: rgba(249,115,22,0.35); }
.ag-filled.ev-two::after     { background: #f97316; }
.ag-filled.ev-three   { background: rgba(234,179,8,0.35); }
.ag-filled.ev-three::after   { background: #eab308; }
.ag-filled.ev-four    { background: rgba(132,204,22,0.35); }
.ag-filled.ev-four::after    { background: #84cc16; }
.ag-filled.ev-five    { background: rgba(34,197,94,0.35); }
.ag-filled.ev-five::after    { background: #22c55e; }
.ag-filled.ev-six     { background: rgba(20,184,166,0.35); }
.ag-filled.ev-six::after     { background: #14b8a6; }
.ag-filled.ev-seven   { background: rgba(6,182,212,0.35); }
.ag-filled.ev-seven::after   { background: #06b6d4; }
.ag-filled.ev-eight   { background: rgba(59,130,246,0.35); }
.ag-filled.ev-eight::after   { background: #3b82f6; }
.ag-filled.ev-nine    { background: rgba(99,102,241,0.35); }
.ag-filled.ev-nine::after    { background: #6366f1; }
.ag-filled.ev-ten     { background: rgba(168,85,247,0.35); }
.ag-filled.ev-ten::after     { background: #a855f7; }
.ag-filled.ev-eleven  { background: rgba(236,72,153,0.35); }
.ag-filled.ev-eleven::after  { background: #ec4899; }
.ag-filled.ev-alpha   { background: rgba(244,114,182,0.35); }
.ag-filled.ev-alpha::after   { background: #f472b6; }
.ag-filled.ev-twelve  { background: rgba(251,146,60,0.35); }
.ag-filled.ev-twelve::after  { background: #fb923c; }
.ag-filled.ev-thirteen { background: rgba(163,230,53,0.35); }
.ag-filled.ev-thirteen::after { background: #a3e635; }

/* Organiser/speaker: brighter version of same event colour */
.ag-filled.ag-org  { opacity: 1; filter: brightness(1.3) saturate(1.4); }
.ag-filled.ag-spk  { opacity: 0.85; filter: brightness(1.15); }

/* =====================================================
   TRENDS CHART
   ===================================================== */
.trends-wrap {
  margin: 1.5rem 0 2rem;
}

.trends-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.trend-leg-btn {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--tc) 40%, transparent);
  background: color-mix(in srgb, var(--tc) 10%, transparent);
  color: var(--tc);
  cursor: pointer;
  transition: all 0.15s;
  appearance: none;
  -webkit-appearance: none;
  opacity: 0.7;
}

.trend-leg-btn:hover,
.trend-leg-btn.tl-active {
  opacity: 1;
  background: color-mix(in srgb, var(--tc) 20%, transparent);
  border-color: var(--tc);
}

.trends-chart-outer {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0.75rem;
  overflow: hidden;
}

.trends-note {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-dim);
  margin-top: 0.6rem;
}

.search-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.75rem;
  gap: 1rem;
}

.search-close-btn {
  display: none;
  padding: 10px 24px;
  border-radius: 999px;
  border: 1px solid var(--border-hi);
  background: var(--bg-2);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s;
}

.search-close-btn:active {
  background: var(--bg-3);
}

@media (max-width: 768px) {
  .search-hint { display: none; }
  .search-close-btn { display: block; }
  .search-footer { justify-content: center; margin-top: 1rem; }
}

/* =====================================================
   MOBILE NAV OVERLAY (separate from header)
   ===================================================== */
.mobile-nav-overlay {
  display: none;
  position: fixed;
  top: var(--nav-h);
  left: 0;
  right: 0;
  bottom: 0;
  background: color-mix(in srgb, var(--bg) 97%, transparent);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 9500;
  overflow-y: auto;
}

.mobile-nav-overlay.is-open {
  display: block;
}

.mobile-nav-inner {
  display: flex;
  flex-direction: column;
  padding: 1.25rem 1rem 2rem;
  gap: 0.4rem;
}

.mobile-nav-inner a {
  display: block;
  padding: 13px 16px;
  font-size: 1rem;
  font-weight: 500;
  color: var(--text);
  border-radius: 10px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg-2) 80%, transparent);
  text-decoration: none;
  transition: background 0.12s, border-color 0.12s;
}

.mobile-nav-inner a:hover,
.mobile-nav-inner a:active {
  background: color-mix(in srgb, var(--bg-3) 90%, transparent);
  border-color: var(--blue-border);
  color: var(--blue);
  text-decoration: none;
}

.mobile-nav-highlight {
  color: var(--blue) !important;
  background: var(--blue-dim) !important;
  border-color: var(--blue-border) !important;
  font-weight: 600 !important;
}

.mobile-nav-section {
  margin-top: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.mobile-nav-section-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-dim);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.25rem 0.5rem;
}

/* Trends chart mobile fixes */
@media (max-width: 640px) {
  .trends-legend {
    max-height: 7rem;
    overflow-y: auto;
    padding-bottom: 0.25rem;
  }

  .trends-chart-outer {
    padding: 0.5rem;
    overflow: hidden;
  }

  #trends-canvas {
    display: block;
    max-width: 100%;
  }
}

/* Hero stats: keep on one line on mobile */
@media (max-width: 640px) {
  .hero-stats {
    flex-wrap: nowrap;
    gap: 0;
    justify-content: space-between;
    padding-top: 1.25rem;
  }

  .hero-stat {
    flex: 1;
    text-align: center;
    min-width: 0;
  }

  .hero-stat .num {
    font-size: 1.4rem;
  }

  .hero-stat .label {
    font-size: 0.58rem;
    letter-spacing: 0.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

/* ── API page ── */

.api-page h2 {
  font-family: 'Space Grotesk', sans-serif;
}

.api-page h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.1rem;
  margin-top: 2rem;
  color: #e0e0e0;
}

.api-page code,
.api-page pre code {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.85rem;
}

.api-example {
  margin: 1rem 0;
}

.api-example pre {
  background: #1a1a2e;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  overflow-x: auto;
}

.api-response {
  margin: 1rem 0;
}

.api-response pre {
  background: #0f0f1a;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  overflow-x: auto;
  max-height: 400px;
  overflow-y: auto;
}

.api-response-live {
  background: #0f0f1a;
  border: 1px solid rgba(100,200,255,0.15);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  overflow-x: auto;
  max-height: 500px;
  overflow-y: auto;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.8rem;
  color: #a0d0ff;
  white-space: pre-wrap;
  word-break: break-word;
}

.try-btn {
  display: inline-block;
  background: transparent;
  border: 1px solid rgba(100,200,255,0.3);
  color: #8ac4ff;
  padding: 0.4rem 1rem;
  border-radius: 6px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
  margin: 0.5rem 0.5rem 0.5rem 0;
}

.try-btn:hover {
  background: rgba(100,200,255,0.1);
  border-color: rgba(100,200,255,0.5);
  color: #fff;
}

.api-page hr {
  border: none;
  border-top: 1px solid rgba(255,255,255,0.06);
  margin: 2.5rem 0;
}

#api-result-container {
  margin: 1.5rem 0;
  padding: 1rem;
  background: #0a0a14;
  border: 1px solid rgba(100,200,255,0.12);
  border-radius: 10px;
}

/* =====================================================
   API PAGE
   ===================================================== */
.api-base-url {
  background: var(--bg-2);
  border: 1px solid var(--blue-border);
  border-radius: var(--radius);
  padding: 0.75rem 1.25rem;
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--blue);
  margin: 1rem 0 1.5rem;
  display: inline-block;
}

.api-endpoints {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-top: 1.25rem;
}

.api-endpoint-block {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}

.api-method-path {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.api-method {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  background: var(--blue-dim);
  color: var(--blue);
  border: 1px solid var(--blue-border);
  border-radius: 4px;
  padding: 3px 8px;
  letter-spacing: 0.08em;
}

.api-path {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-bright);
}

.api-desc {
  font-size: 0.9rem;
  color: var(--text);
  margin-bottom: 1rem;
}

.api-code-block {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin: 0.6rem 0;
  overflow: hidden;
}

.api-code-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-dim);
  padding: 4px 12px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.api-code-block pre {
  margin: 0;
  padding: 0.75rem 1rem;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--text);
}

.api-code-block code {
  font-family: var(--font-mono);
  font-size: inherit;
  color: inherit;
  background: none;
  padding: 0;
}

[data-theme="light"] .api-code-block {
  background: #f8f9fc;
}

.api-try-btn {
  display: inline-flex;
  align-items: center;
  margin-top: 0.75rem;
  padding: 6px 14px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--blue);
  background: var(--blue-dim);
  border: 1px solid var(--blue-border);
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s;
  appearance: none;
}

.api-try-btn:hover {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}

.api-response-wrap {
  margin: 0.5rem 0;
}

.api-response-wrap summary {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 0;
}

.api-response {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
  margin-top: 0.5rem;
}

.api-response-output {
  position: sticky;
  bottom: 1rem;
  margin: 2rem 0;
  background: var(--bg-1);
  border: 1px solid var(--blue-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  max-height: 50vh;
  z-index: 10;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}

.api-response-output-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 1rem;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  gap: 1rem;
}

.api-response-output-header button {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 4px;
  padding: 2px 8px;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  flex-shrink: 0;
}

#api-response-body {
  padding: 1rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text);
  overflow-y: auto;
  max-height: calc(50vh - 3rem);
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Community posts (social archive snippets on event pages) */
.community-posts {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
}

.community-post {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
}

.cp-text {
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.6;
  margin-bottom: 0.5rem;
}

.cp-meta {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-dim);
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.cp-author { color: var(--blue); }
.cp-link { color: var(--text-dim); }
.cp-link:hover { color: var(--blue); }
.cp-source {
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
  color: var(--text-dim);
}
