/* ═══════════════════════════════════════
   Hopkins AI Safety & Biosecurity (ASBS)
   Rosé Pine Dawn · geometric grotesk
   ═══════════════════════════════════════ */

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

:root {
  /* Rosé Pine Dawn, from github.com/rose-pine/neovim palette.lua
       base #faf4ed · surface #fffaf3 · overlay #f2e9e1
       text #464261 · subtle #797593 · muted #9893a5 · pine #286983 · love #b4637a
     Subtle and muted are editor-chrome tones (3.67:1 and 2.48:1 on overlay),
     so they are darkened here until they carry body text on the deepest
     surface. Everything else is used at its published value. */
  --bg:        #faf4ed;  /* base — page */
  --panel:     #f2e9e1;  /* overlay — large panels */
  --panel-2:   #fffaf3;  /* surface — cards, lifted lighter than the page */
  --ink:       #464261;  /* text */
  --ink-soft:  #6a6684;  /* subtle, darkened to 4.5:1 */
  --ink-faint: #898496;  /* muted, darkened to 3.0:1 */
  --accent:    #286983;  /* pine — reads as text (5.09:1) and as a fill */
  --accent-ink: #faf4ed; /* base, for text on pine — 5.59:1 */
  --accent-dim: rgba(40, 105, 131, 0.24);
  --field:     rgba(70, 66, 97, 0.05);
  --line:      rgba(70, 66, 97, 0.14);
  --line-strong: rgba(70, 66, 97, 0.28);
  --error:     #a24e6d;  /* love, darkened to 4.5:1 */

  --sans: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --radius-lg: 32px;
  --radius-md: 20px;
  --radius-pill: 72px;
}

html {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 18px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}

body { overflow-x: hidden; background: var(--bg); }

/* ── Lenis smooth scroll ───────────────── */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: hidden; }

a { color: inherit; text-decoration: none; }
ul { list-style: none; }

::selection { background: var(--accent); color: var(--accent-ink); }

.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* ── Wordmark ─────────────────────────── */
.wordmark {
  display: inline-flex;
  align-items: baseline;
  gap: 0.5rem;
  line-height: 1;
}

.wordmark-main {
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.wordmark-sub {
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--ink-soft);
  letter-spacing: 0;
}

/* ── Header / Nav ──────────────────────── */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: transparent;
  padding: 1rem clamp(1rem, 3vw, 2rem) 0;
  transition: padding 0.3s ease;
}

/* Content floats in a pill; glass only appears on scroll */
.header-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0.5rem 0.5rem 0.5rem 1.6rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  transition: background 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.site-header.scrolled .header-inner {
  background: rgba(250, 244, 237, 0.70);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border-color: var(--line);
  box-shadow: 0 6px 24px rgba(70, 66, 97, 0.08);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.site-nav .nav-link {
  font-size: 0.95rem;
  color: var(--ink-soft);
  padding: 0.5rem 0.9rem;
  transition: color 0.2s ease;
}

.site-nav .nav-link:hover { color: var(--ink); }

/* Pill buttons */
.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 46px;
  padding: 0 1.5rem;
  border-radius: var(--radius-pill);
  font-size: 0.95rem;
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease, color 0.2s ease;
  white-space: nowrap;
}

.pill-outline {
  border-color: var(--line-strong);
  color: var(--ink);
  background: transparent;
}
.pill-outline:hover { border-color: var(--ink); background: rgba(70, 66, 97, 0.05); }

.pill-accent {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}
.pill-accent:hover { transform: translateY(-2px); box-shadow: 0 10px 26px var(--accent-dim); }

.pill-solid {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}
.pill-solid:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(70, 66, 97, 0.16); }

.nav-actions { display: flex; align-items: center; gap: 0.6rem; }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}
.nav-toggle span {
  display: block;
  width: 24px; height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: var(--bg);
  display: none;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 1.4rem;
  padding: 0 2.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.mobile-menu.open { display: flex; opacity: 1; pointer-events: auto; }
.mobile-menu a {
  font-size: 2.4rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--ink);
}

/* ── Reveal on scroll ──────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(48px);
  transition:
    opacity 1.1s cubic-bezier(0.16, 1, 0.3, 1),
    transform 1.1s cubic-bezier(0.16, 1, 0.3, 1),
    filter 1.1s cubic-bezier(0.16, 1, 0.3, 1);
  filter: blur(6px);
  will-change: opacity, transform;
}
.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
}

/* Staggered siblings — cards cascade in instead of snapping together */
.reveal { transition-delay: calc(var(--stagger, 0) * 90ms); }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; filter: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ── Hero ──────────────────────────────── */
.hero {
  position: relative;
  min-height: 86vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 9rem 0 3.5rem;
  overflow: hidden;
}

#neural-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.hero .container { position: relative; z-index: 1; }

.hero-inner {
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  gap: 3rem;
  align-items: end;
}

.hero-headline {
  font-size: clamp(3rem, 7.6vw, 6.6rem);
  font-weight: 500;
  line-height: 0.98;
  letter-spacing: -0.035em;
  color: var(--ink);
}
.hero-headline em {
  font-style: normal;
  color: var(--accent);
}

.hero-aside { padding-bottom: 0.8rem; }

.eyebrow {
  font-size: 0.9rem;
  color: var(--ink-soft);
  margin-bottom: 1.2rem;
}

.hero-sub {
  font-size: 1.35rem;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin-bottom: 2rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.hero-scroll {
  align-self: flex-start;
  margin-top: 4rem;
  width: 64px; height: 44px;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: var(--accent-ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: transform 0.2s ease;
}
.hero-scroll:hover { transform: translateY(3px); }

/* ── Section scaffolding ───────────────── */
.section { padding: 4.5rem 0; }

.section-label {
  font-size: 0.95rem;
  color: var(--ink-soft);
  margin-bottom: 2.5rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.section-label::before {
  content: '';
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

/* ── Focus cards ───────────────────────── */
.track-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
.track-card {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 2.2rem;
  transition: background 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}
.track-card:hover {
  background: var(--panel);
  border-color: var(--line-strong);
  transform: translateY(-3px);
}
.track-num {
  font-size: 0.92rem;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.track-title {
  font-size: 1.45rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-top: 3.5rem;
}

/* ── Partners ──────────────────────────── */
.partner-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}
.partner-card {
  display: block;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 2rem;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), background 0.25s ease, border-color 0.25s ease;
}
a.partner-card:hover {
  transform: translateY(-3px);
  background: var(--panel);
  border-color: var(--line-strong);
}
.partner-mark {
  font-size: 1.6rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.partner-full {
  font-size: 0.95rem;
  color: var(--ink-soft);
  margin-top: 0.4rem;
}

/* Seeded-by note under the partner grid */
.seed-note {
  position: relative;
  padding-left: 1.1rem;
  margin-top: 2rem;
  font-size: 0.98rem;
  line-height: 1.5;
  color: var(--ink-soft);
  max-width: 62ch;
}
.seed-note::before {
  content: '*';
  position: absolute;
  left: 0;
  top: 0;
  color: var(--ink-faint);
}
.seed-note a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--line-strong);
}
.seed-note a:hover { text-decoration-color: var(--accent); }

.arrow-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--ink);
  transition: color 0.2s ease;
}
.arrow-link span { display: inline-block; transition: transform 0.2s ease; }
.arrow-link:hover { color: var(--accent); }
.arrow-link:hover span { transform: translateX(4px); }

/* ── Join (accent-edged panel) ─────────── */
.join .panel {
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  padding: clamp(3rem, 6vw, 5.5rem);
  text-align: center;
}
.join .section-label { justify-content: center; }

.join-headline {
  font-size: clamp(2.4rem, 5.5vw, 4rem);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--ink);
  margin-bottom: 2.4rem;
}

.join-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.7rem;
  max-width: 480px;
  margin: 0 auto;
}
.join-form input {
  width: 100%;
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  padding: 0.9rem 1.5rem;
  outline: none;
  transition: border-color 0.2s ease;
}
.join-form input::placeholder { color: var(--ink-faint); }
.join-form input:focus { border-color: var(--accent); }

.join-form button {
  position: relative;
  overflow: hidden;
  width: 100%;
  background: var(--accent);
  border: none;
  border-radius: var(--radius-pill);
  color: var(--accent-ink);
  cursor: pointer;
  font-family: var(--sans);
  font-size: 0.98rem;
  font-weight: 500;
  height: 52px;
  margin-top: 0.3rem;
  transition: transform 0.2s ease;
}
.join-form button:hover { transform: translateY(-1px); }

.btn-sent {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
  background: var(--accent);
  color: var(--accent-ink);
}
.submitted .btn-text { opacity: 0; }
.submitted .btn-sent { opacity: 1; }
.submitted input,
.submitted textarea,
.submitted select { pointer-events: none; opacity: 0.5; }
.submitted button { pointer-events: none; }

.form-error {
  font-size: 0.9rem;
  color: var(--error);
  min-height: 1rem;
}

.form-note {
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--ink-faint);
  margin-top: 0.4rem;
}
.form-note a {
  color: var(--ink-soft);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.form-note a:hover { color: var(--accent); }

/* ── Footer ────────────────────────────── */
.site-footer { padding: 3rem 0 2.5rem; }

.footer-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  border-top: 1px solid var(--line);
  padding-top: 2.5rem;
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.75rem;
}
.footer-links a {
  font-size: 0.98rem;
  color: var(--ink-soft);
  transition: color 0.2s ease;
}
.footer-links a:hover { color: var(--accent); }

.footer-bottom {
  border-top: 1px solid var(--line);
  margin-top: 2.5rem;
  padding-top: 1.5rem;
}
.footer-copy {
  font-size: 0.9rem;
  color: var(--ink-faint);
}

/* ── Subpages ──────────────────────────── */
.page { padding-top: 9rem; }
.page-head { padding-bottom: 2.5rem; }
.page-title {
  font-size: clamp(2.6rem, 6vw, 4.6rem);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.035em;
  margin-bottom: 1.2rem;
}
/* ── Contact cards ─────────────────────── */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}
.contact-card {
  display: block;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 1.8rem;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}
a.contact-card:hover {
  transform: translateY(-3px);
  background: var(--panel);
  border-color: var(--line-strong);
}
.contact-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--ink-faint);
  margin-bottom: 0.6rem;
}
.contact-value { font-size: 1.15rem; font-weight: 500; letter-spacing: -0.01em; }
.contact-sub { font-size: 0.95rem; color: var(--ink-soft); margin-top: 0.3rem; }

/* ── Contact form panel ────────────────── */
.form-panel {
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  padding: clamp(2.25rem, 5vw, 3.75rem);
}
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.contact-form .field-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}
.contact-form input,
.contact-form textarea,
.contact-form select {
  width: 100%;
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  padding: 0.85rem 1.2rem;
  outline: none;
  transition: border-color 0.2s ease;
}
.contact-form select { appearance: none; cursor: pointer; }
/* Keep the placeholder option as muted as the text placeholders. */
.contact-form select:has(option[value='']:checked) { color: var(--ink-faint); }
.contact-form select option { background: var(--panel); color: var(--ink); }
.contact-form textarea { resize: vertical; min-height: 148px; line-height: 1.5; }
.contact-form input::placeholder,
.contact-form textarea::placeholder { color: var(--ink-faint); }
.contact-form input:focus,
.contact-form textarea:focus,
.contact-form select:focus { border-color: var(--accent); }

.contact-form button {
  position: relative;
  overflow: hidden;
  align-self: flex-start;
  background: var(--accent);
  border: none;
  border-radius: var(--radius-pill);
  color: var(--accent-ink);
  cursor: pointer;
  font-family: var(--sans);
  font-size: 0.95rem;
  font-weight: 500;
  padding: 0 1.8rem;
  height: 48px;
  margin-top: 0.4rem;
  transition: transform 0.2s ease;
}
.contact-form button:hover { transform: translateY(-1px); }

/* ── Responsive ────────────────────────── */
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; gap: 2.5rem; align-items: start; }
  .hero-aside { padding-bottom: 0; max-width: 480px; }
  .track-grid { grid-template-columns: 1fr; }
  .partner-grid { grid-template-columns: 1fr; }
  .section { padding: 3.5rem 0; }
}

@media (max-width: 720px) {
  .site-nav .nav-link { display: none; }
  .site-nav .nav-partner { display: none; }
  .nav-toggle { display: flex; }
}

@media (max-width: 560px) {
  html { font-size: 16px; }
  .container { padding: 0 1.25rem; }

  .hero { min-height: auto; padding: 7rem 0 3rem; }
  .hero-scroll { margin-top: 2.5rem; }
  .hero-actions { gap: 0.6rem; }
  .hero-actions .pill { flex: 1 1 auto; }

  .section { padding: 3rem 0; }
  .track-card { padding: 1.6rem; }
  .track-title { margin-top: 2rem; }
  .partner-card { padding: 1.5rem; }
  .join .panel { padding: 2.5rem 1.4rem; }

  .contact-grid { grid-template-columns: 1fr; }
  .contact-form .field-row { grid-template-columns: 1fr; }
  .contact-form button { width: 100%; }
  .form-panel { padding: 2rem 1.4rem; }

  .footer-top { flex-direction: column; align-items: flex-start; gap: 1.75rem; }
  .footer-links { gap: 1rem 1.5rem; }

  .header-inner { padding-left: 1.1rem; gap: 0.75rem; }
  .wordmark-sub { display: none; }
}

/* ── Subpage top clearance ─────────────── */
/* The `.section { padding: … }` shorthands in the responsive blocks above
   reset `.page`'s top padding, which drops subpage headings underneath the
   fixed header. Restate it after the media queries so it survives. */
.section.page { padding-top: 9rem; }

@media (max-width: 900px) {
  .section.page { padding-top: 8rem; }
}
@media (max-width: 560px) {
  .section.page { padding-top: 7rem; }
}
