:root {
  --bg: #14182b;
  --bg-deep: #101426;
  --card: #181e3c;
  --card-2: #212848;
  --line: rgba(255, 255, 255, 0.1);
  --text: #f5f7fb;
  --muted: #b7c0d4;
  --faint: #8e98ae;
  --gold: #f0b838;
  --gold-deep: #d89a2c;
  --ink: #14182b;
  --green: #3dbe86;
  --danger: #ffb4b4;
  --sans: "Instrument Sans", "Segoe UI", sans-serif;
  --serif: "Newsreader", Georgia, serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
  --radius: 18px;
  --header: 76px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  color-scheme: dark;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-family: var(--sans); font-weight: 680; letter-spacing: -0.03em; }
.wrap {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
}
.skip {
  position: absolute;
  left: 12px;
  top: -40px;
  background: var(--gold);
  color: var(--ink);
  padding: 8px 12px;
  z-index: 40;
}
.skip:focus { top: 12px; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  height: var(--header);
  display: flex;
  align-items: center;
  background: rgba(20, 24, 43, 0.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.nav {
  display: flex;
  align-items: center;
  gap: 28px;
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 650;
  letter-spacing: -0.03em;
  flex: 0 0 auto;
}
.brand img { display: block; height: 44px; width: auto; }
.nav-links {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-left: auto;
}
.nav-links a {
  text-decoration: none;
  color: var(--muted);
  font-size: 0.94rem;
}
.nav-links a:hover,
.nav-links a[aria-current="page"] { color: var(--text); }
.nav-actions { display: flex; align-items: center; gap: 10px; }
.nav-toggle {
  display: none;
  margin-left: auto;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 10px;
  padding: 8px 12px;
  cursor: pointer;
}
.subnav {
  position: sticky;
  top: var(--header);
  z-index: 29;
  background: rgba(16, 20, 38, 0.96);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.subnav-row {
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: 48px;
  overflow-x: auto;
  scrollbar-width: none;
}
.subnav-row::-webkit-scrollbar { display: none; }
.subnav-row > a,
.subnav .nav-actions,
.subnav .btn { flex: 0 0 auto; }
.subnav-row > a:not(.btn) {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.88rem;
  white-space: nowrap;
  padding: 14px 0;
}
.subnav-row > a:not(.btn):hover,
.subnav-row > a:not(.btn)[aria-current] { color: var(--text); }
.subnav-row > a:not(.btn)[aria-current] { box-shadow: inset 0 -2px 0 var(--gold); }
.subnav a.btn {
  padding: 0 12px;
  color: var(--text);
}
.subnav a.btn-gold { color: var(--ink); }
.subnav .nav-actions { margin-left: auto; flex: 0 0 auto; }
[id] { scroll-margin-top: calc(var(--header) + 56px); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 10px;
  border: 1px solid transparent;
  text-decoration: none;
  cursor: pointer;
  font-weight: 600;
  letter-spacing: -0.01em;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-gold { background: var(--gold); color: var(--ink); }
.btn-gold:hover { background: #ffc857; }
.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.22);
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.06); }
.btn-ink { background: var(--ink); color: white; }
.btn-ink:hover { background: #0c1020; }
.btn-ink-ghost {
  background: transparent;
  color: var(--ink);
  border-color: rgba(20, 24, 43, 0.35);
}
.btn-ink-ghost:hover { background: rgba(20, 24, 43, 0.08); }
.btn-small { min-height: 36px; padding: 0 12px; font-size: 0.88rem; border-radius: 8px; }
.btn.is-active, .chip.is-active {
  background: var(--gold);
  color: var(--ink);
  border-color: var(--gold);
}

.hero { padding: 72px 0 28px; }
.kicker {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  margin-bottom: 22px;
  font-size: 0.92rem;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 4px 10px;
  background: rgba(61, 190, 134, 0.14);
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 700;
}
.pill::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
}
.hero-grid, .split, .banner, .city {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 36px;
  align-items: center;
}
h1 {
  font-family: var(--sans);
  font-weight: 680;
  font-size: clamp(2.7rem, 5vw, 4.5rem);
  line-height: 0.98;
  letter-spacing: -0.045em;
}
.lede { color: var(--muted); font-size: 1.05rem; max-width: 46ch; margin-top: 18px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.hero-art {
  display: flex;
  flex-direction: column;
  align-items: stretch;
}
.honeycomb {
  display: block;
  width: 100%;
  height: 240px;
  margin: 0;
  border: 0;
  background: transparent;
  pointer-events: none;
}
.terminal {
  margin-top: 18px;
  position: relative;
  background: #0c1020;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 16px 18px 18px;
  box-shadow: var(--shadow);
  font-family: var(--mono);
  font-size: 0.82rem;
  line-height: 1.7;
}
.terminal p { color: #d5dced; }
.terminal .ok { color: #7ddea2; }
.terminal .cmd { color: #f0b838; }
.tracks { display: flex; flex-wrap: wrap; gap: 8px; margin: 28px 0 8px; align-items: center; }
.tracks span, .section-label { color: var(--faint); font-size: 0.82rem; margin-right: 4px; }
.chip {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  border-radius: 999px;
  min-height: 34px;
  padding: 0 12px;
  cursor: pointer;
}
.chip:hover { color: var(--text); border-color: rgba(255, 255, 255, 0.28); }

.section { padding: 34px 0; }
.section h2 {
  font-family: var(--sans);
  font-weight: 680;
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  letter-spacing: -0.04em;
  line-height: 1.1;
}
.sub { color: var(--muted); margin: 8px 0 22px; }

.event-grid, .project-grid, .agenda-grid, .collab-grid {
  display: grid;
  gap: 16px;
}
.event-grid { grid-template-columns: 1fr 1fr; }
.event-lead { grid-column: 1 / -1; }
.project-grid, .collab-grid { grid-template-columns: repeat(3, 1fr); }
.agenda-grid { grid-template-columns: 1fr 1fr; }

.card {
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius);
  padding: 24px;
}
.card h3 { font-size: 1.45rem; letter-spacing: -0.03em; margin: 8px 0; }
.card p { color: var(--muted); }
.gold-card {
  background: var(--gold);
  color: var(--ink);
}
.gold-card p, .gold-card .meta { color: rgba(20, 24, 43, 0.78); }
.gold-card h3 { color: var(--ink); }
.eyebrow {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--gold);
}
.gold-card .eyebrow { color: rgba(20, 24, 43, 0.7); }
.stats {
  display: flex;
  gap: 22px;
  margin: 22px 0;
}
.stats strong { display: block; font-size: 1rem; }
.stats span, .meta { color: var(--faint); font-size: 0.88rem; }
.gold-card .stats span { color: rgba(20, 24, 43, 0.72); }
.more {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--muted);
}
.gold-card .more { border-top-color: rgba(20, 24, 43, 0.15); color: rgba(20, 24, 43, 0.8); }

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  margin-top: 8px;
}
.step { padding-top: 14px; border-top: 2px solid var(--gold); }
.step strong { display: block; margin-bottom: 8px; }
.step p { color: var(--muted); font-size: 0.95rem; }
.step .btn { margin-top: 14px; }

.project h3 { font-family: var(--mono); font-size: 0.98rem; font-weight: 500; }
.tags { display: flex; gap: 8px; color: var(--faint); font-size: 0.85rem; margin: 14px 0; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 6px; }
.lang-ts { background: #3b82f6; }
.lang-py { background: #f0b838; }
.lang-md { background: #c4b5fd; }

.banner {
  background: #1b2344;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 22px;
  padding: 28px;
  align-items: start;
}
.banner ul { margin: 18px 0 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.banner li { color: var(--muted); }
.banner li::before { content: "→ "; color: var(--gold); }

.city { align-items: start; margin-top: 18px; }
.map-layout {
  display: grid;
  grid-template-columns: 1.45fr 0.55fr;
  gap: 16px;
  align-items: stretch;
}
.hive-map {
  height: 480px;
  min-height: 320px;
  border-radius: 18px;
  overflow: hidden;
  background: #101426;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.map-list {
  list-style: none;
  margin: 0;
  padding: 8px;
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.map-list button {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 12px;
  color: var(--text);
  padding: 12px 14px;
  cursor: pointer;
}
.map-list button:hover,
.map-list button.is-active { background: rgba(240, 184, 56, 0.12); }
.map-list strong { font-weight: 650; }
.map-list span { color: var(--faint); font-size: 0.85rem; }
.map-pin {
  background: var(--gold);
  border: 2px solid #14182b;
  border-radius: 50%;
  box-shadow: 0 0 0 6px rgba(240, 184, 56, 0.35);
}
.leaflet-container { background: #101426; font-family: var(--sans); }
.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
  background: #181e3c;
  color: var(--text);
  box-shadow: none;
}
.leaflet-popup-content-wrapper { border-radius: 12px; border: 1px solid rgba(255, 255, 255, 0.08); }
.leaflet-popup-content { margin: 12px 14px; }
.leaflet-popup-content strong { display: block; }
.leaflet-popup-content span { color: var(--muted); }
.leaflet-bar a {
  background: #181e3c;
  color: var(--text);
  border-bottom-color: rgba(255, 255, 255, 0.08);
}
.leaflet-bar a:hover { background: #24304e; }
.leaflet-control-attribution {
  background: rgba(16, 20, 38, 0.85);
  color: var(--faint);
}
.leaflet-control-attribution a { color: var(--muted); }
.form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.form .wide { grid-column: 1 / -1; }
label { display: grid; gap: 6px; font-size: 0.82rem; color: var(--faint); }
input, select, textarea {
  width: 100%;
  background: rgba(8, 10, 20, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  min-height: 44px;
  padding: 10px 12px;
}
textarea { min-height: 120px; resize: vertical; }
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--gold);
  border-color: transparent;
}
.form .btn { justify-self: start; }
.success {
  background: var(--card);
  border-radius: 16px;
  padding: 18px;
  border: 1px solid rgba(61, 190, 134, 0.35);
}
.success p { color: var(--muted); margin: 8px 0 14px; }
.error { color: var(--danger); font-size: 0.85rem; }

.rules { margin-top: 8px; }
.rules ul { margin: 16px 0 20px; padding-left: 18px; color: var(--muted); }

.site-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  margin-top: 28px;
  padding: 22px 0 32px;
}
.footer-row {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  color: var(--faint);
  font-size: 0.9rem;
}
.footer-row nav { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; }
.footer-row a {
  color: var(--muted);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.footer-row a:hover { color: var(--text); }
.social-icon {
  width: 16px;
  height: 16px;
  flex: none;
  display: block;
}
.ahoy-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.ahoy-mark {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  display: block;
}

.home-hero { padding-top: 84px; padding-bottom: 20px; }
.home-hero h1 {
  font-family: var(--sans);
  font-weight: 680;
  font-size: clamp(3rem, 6vw, 5.3rem);
  line-height: 0.96;
  max-width: 11ch;
}
.home-top {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 32px;
  align-items: end;
}
.home-cards {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 16px;
  margin-top: 36px;
}
.home-card { min-height: 420px; position: relative; overflow: hidden; }
.deep-card { padding-bottom: 220px; background: #101426; }
.home-card h2 {
  font-family: var(--sans);
  font-size: clamp(2rem, 3vw, 2.8rem);
  font-weight: 680;
  letter-spacing: -0.04em;
  max-width: 12ch;
  margin: 10px 0 12px;
}
.honey {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 62%;
  height: 210px;
  margin: 0;
}
.quote {
  margin-top: 28px;
  padding-left: 16px;
  border-left: 2px solid var(--gold);
  color: var(--gold);
  font-family: var(--sans);
  font-style: normal;
  font-weight: 500;
  font-size: 1.25rem;
  line-height: 1.35;
}
.quote span { display: block; margin-top: 8px; color: var(--faint); font-family: var(--sans); font-style: normal; font-size: 0.85rem; }
.status {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 22px 4px 8px;
  color: var(--muted);
  font-size: 0.92rem;
}
.status a { color: var(--text); text-decoration: none; font-weight: 650; }
.status a:hover { color: var(--gold); }

.glance { font-size: 0.92rem; }
.glance h2 { font-family: var(--sans); font-size: 1rem; margin-bottom: 14px; }
.glance dt { color: var(--faint); margin-top: 12px; }
.glance dd { margin: 4px 0 0; }
.research-hero h1 {
  font-family: var(--sans);
  font-weight: 680;
  font-size: clamp(2.8rem, 5vw, 4.4rem);
  max-width: 16ch;
}
.note {
  color: var(--gold);
  font-size: 0.92rem;
  border-left: 2px solid var(--gold);
  padding-left: 14px;
}
.paper {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 16px;
  align-items: start;
  padding: 18px 0;
  border-top: 1px solid var(--line);
}
.paper .year { color: var(--faint); }
.paper-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.linkish {
  background: transparent;
  border: 0;
  color: var(--gold);
  cursor: pointer;
  padding: 0;
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 680px; }
th, td { text-align: left; padding: 14px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--faint); font-weight: 600; font-size: 0.82rem; }
.cite {
  font-family: var(--mono);
  font-size: 0.82rem;
  background: var(--bg-deep);
  border-radius: 12px;
  padding: 16px;
  color: #d5dced;
  white-space: pre-wrap;
}
.empty {
  padding: 18px;
  border: 1px dashed rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  color: var(--muted);
}
dialog {
  width: min(520px, calc(100% - 28px));
  background: #1a2140;
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  padding: 22px;
}
dialog::backdrop { background: rgba(6, 8, 16, 0.72); }
dialog h2 { font-family: var(--sans); letter-spacing: -0.03em; margin-bottom: 8px; }
dialog .form { margin-top: 16px; }
.dialog-head { display: flex; justify-content: space-between; gap: 12px; align-items: start; }
.close-x {
  background: transparent;
  border: 0;
  color: var(--muted);
  cursor: pointer;
  font-size: 1.4rem;
  line-height: 1;
}

@media (max-width: 980px) {
  .brand img { height: 34px; }
  .hero-grid, .split, .banner, .city, .home-top, .home-cards, .event-grid, .project-grid, .collab-grid, .steps, .agenda-grid, .map-layout {
    grid-template-columns: 1fr;
  }
  .hive-map { height: 340px; }
  .paper { grid-template-columns: 1fr; }
  .nav-toggle { display: inline-flex; }
  .site-header .nav-links,
  .site-header .nav-actions {
    display: none;
  }
  .nav.is-open .nav-links, .nav.is-open .nav-actions {
    display: flex;
  }
  .nav.is-open {
    position: absolute;
    top: var(--header);
    z-index: 31;
    left: 0;
    right: 0;
    background: #12162a;
    border-bottom: 1px solid var(--line);
    padding: 8px 20px 18px;
    flex-wrap: wrap;
  }
  .nav.is-open .nav-links, .nav.is-open .nav-actions {
    width: 100%;
    margin-left: 0;
    flex-direction: column;
    align-items: flex-start;
  }
}
