/* BSBA — site styles
   Tokens first, then layout, then components. Edit tokens to retheme. */

:root {
  --paper: #0c0a08;
  --surface: #17140f;
  --ink: #f2ece1;
  --ink-2: #c7bcaa;
  --muted: #8a8072;
  --line: #2c2620;
  --accent: #f8cd4c;
  --accent-ink: #d9a82c;
  --accent-soft: #4a3d17;

  --font-display: "JetBrains Mono", "IBM Plex Mono", "Courier New", monospace;
  --font-body: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;

  --wrap: 1180px;
  --gutter: 40px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

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

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- Type ---------- */
h1, h2, h3, .display {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.08;
  margin: 0 0 0.4em;
}
h1 { font-size: clamp(40px, 6vw, 68px); }
h2 { font-size: clamp(30px, 4vw, 44px); }
h3 { font-size: 26px; line-height: 1.2; }
h4 { font-family: var(--font-body); font-size: 17px; font-weight: 600; margin: 0 0 0.3em; }

p { margin: 0 0 1em; max-width: 62ch; }
.lede { font-size: 20px; color: var(--ink-2); max-width: 56ch; }
.lede-large { font-size: 23px; line-height: 1.5; max-width: 68ch; }
.small { font-size: 14px; color: var(--muted); }
.measure { max-width: 62ch; }

/* ---------- Header ---------- */
.site-header {
  background: #1e1810;
  border-bottom: 1px solid var(--accent-soft);
  position: sticky; top: 0; z-index: 20;
  box-shadow: 0 2px 10px rgba(0,0,0,0.35);
}
.site-header .wrap {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 100px;
  height: 64px;
  max-width: none; padding: 0 80px;
}
.brand {
  font-family: var(--font-display);
  font-size: 26px;
  color: var(--ink);
  display: flex; align-items: baseline; gap: 10px;
}
.brand small {
  font-family: var(--font-body);
  font-size: 13px; color: var(--muted);
}
.brand { align-items: center; }
.brand img.mark { height: 26px; width: auto; display: block; }
.brand:hover { text-decoration: none; }
.site-nav { display: flex; gap: 44px; justify-content: center; }
.site-nav a { color: var(--ink-2); font-size: 14px; padding: 6px 0; border-bottom: 2px solid transparent; transition: color .2s, border-color .2s; white-space: nowrap; }
.site-nav a:hover { text-decoration: none; color: var(--ink); }
.site-nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--ink); }
.nav-cta-mobile { display: none; }

@media (max-width: 1000px) {
  .site-header .wrap { gap: 48px; padding: 0 32px; }
  .site-nav { gap: 24px; }
}
.header-actions { display: flex; align-items: center; gap: 8px; }
.header-cta { margin-left: 0; }
.nav-toggle {
  display: none; margin-left: auto;
  background: none; border: 1px solid var(--line); border-radius: 6px;
  padding: 8px 10px; font: inherit; font-size: 14px; color: var(--ink);
  cursor: pointer;
}

@media (max-width: 700px) {
  .site-header .wrap { padding: 0 var(--gutter); gap: 16px; }
  .site-nav {
    display: none;
    position: absolute; left: 0; right: 0; top: 64px;
    background: var(--surface); border-bottom: 1px solid var(--line);
    flex-direction: column; gap: 0; padding: 8px 24px 16px;
  }
  .site-nav a { padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 17px; }
  .site-nav a[aria-current="page"] { border-bottom-color: var(--line); font-weight: 600; }
  .site-nav.open { display: flex; }
  .btn.header-cta { display: none; }
  .nav-toggle { display: inline-block; }
  .nav-cta-mobile { display: block; color: var(--accent); font-weight: 600; }
  .brand small { display: none; }
  .cover { box-shadow: 0 1px 0 var(--line), 12px 12px 0 var(--accent-soft); }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 11px 18px;
  border: 1px solid var(--ink);
  border-radius: 4px;
  color: var(--ink);
  font-size: 15px; font-weight: 500;
  line-height: 1;
  background: transparent;
  cursor: pointer;
  transition: background-color .18s, color .18s, border-color .18s, transform .18s;
}
.btn:active { transform: translateY(1px); }
.btn:hover { text-decoration: none; background: var(--ink); color: var(--surface); }
.btn.primary { background: var(--ink); color: var(--surface); }
.btn.primary:hover { background: var(--accent-ink); border-color: var(--accent-ink); }

/* Apply form */
.apply-form { max-width: 640px; }
.form-group-head { font-family: var(--font-display); font-size: 18px; font-weight: 500; margin: 28px 0 4px; color: var(--ink); }
.form-group-head:first-child { margin-top: 0; }
.apply-table { width: 100%; border-collapse: collapse; margin-bottom: 12px; }
.apply-table tr { border-bottom: 1px solid var(--line); }
.apply-table tr:last-child { border-bottom: none; }
.apply-table th, .apply-table td { padding: 12px 0; text-align: left; vertical-align: top; }
.apply-table th { width: 160px; padding-right: 16px; font-weight: 400; }
.apply-form label { display: block; font-family: var(--font-body); font-size: 13px; color: var(--muted); }
.apply-form input, .apply-form select, .apply-form textarea {
  width: 100%; font-family: var(--font-body); font-size: 15px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); padding: 10px 12px;
}
.apply-form input:focus, .apply-form select:focus, .apply-form textarea:focus {
  outline: none; border-color: var(--accent);
}
.apply-form textarea { resize: vertical; min-height: 80px; }
.apply-form input[type="file"] { padding: 8px 0; border: none; background: none; }
.apply-form input[type="file"]::file-selector-button {
  font-family: var(--font-body); font-size: 13px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); padding: 8px 14px;
  margin-right: 10px; cursor: pointer;
}
.apply-form input[type="file"]::file-selector-button:hover { border-color: var(--accent); }
.apply-form .fee { font-family: var(--font-body); font-size: 13px; color: var(--muted); margin: 0; }
.form-note { font-family: var(--font-body); font-size: 12px; color: var(--muted); margin-top: 10px; max-width: 60ch; }
@media (max-width: 560px) {
  .apply-table th { display: block; width: auto; padding: 0 0 4px; }
  .apply-table td { display: block; padding-top: 0; }
  .apply-table tr { display: block; padding: 10px 0; }
}
.btn.accent { background: var(--accent); border-color: var(--accent); color: #17140f; }
.btn.accent:hover { background: var(--accent-ink); border-color: var(--accent-ink); color: #17140f; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

/* ---------- Sections ---------- */
.section { padding: 80px 0; }
.section + .section { border-top: 1px solid var(--line); }
.section-head {
  display: grid; grid-template-columns: 1fr 1fr; gap: 40px;
  align-items: end; margin-bottom: 40px;
}
.section-head p { margin: 0; }
@media (max-width: 760px) {
  .section { padding: 56px 0; }
  .section-head { grid-template-columns: 1fr; gap: 12px; }
}

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 48px 56px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

/* ---------- Hero ---------- */
.hero { padding: 96px 0 88px; }
.hero .wrap {
  display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 64px; align-items: center;
}
.hero h1 { margin-bottom: 20px; }
@media (max-width: 900px) {
  .hero { padding: 64px 0; }
  .hero .wrap { grid-template-columns: 1fr; gap: 48px; }
}

/* Report cover — a typographic object, rendered from data */
.cover {
  background: var(--ink);
  color: var(--surface);
  aspect-ratio: 1 / 1.3;
  padding: 28px;
  display: flex; flex-direction: column; justify-content: space-between;
  border-radius: 3px;
  box-shadow: 0 1px 0 var(--line), 24px 24px 0 var(--accent-soft);
  max-width: 380px;
  transition: transform .35s cubic-bezier(.2,.7,.2,1), box-shadow .35s cubic-bezier(.2,.7,.2,1);
}
a:hover > .cover { transform: translate(-6px, -6px); box-shadow: 0 1px 0 var(--line), 30px 30px 0 var(--accent-soft); }
.cover .series { font-size: 13px; opacity: 0.75; }
.cover .issue {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(56px, 8vw, 92px); line-height: 0.95;
  letter-spacing: -0.02em;
}
.cover .period { font-family: var(--font-display); font-size: 28px; line-height: 1.15; }
.cover .cover-foot { display: flex; justify-content: space-between; font-size: 13px; opacity: 0.8; }
.cover.article { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.cover.article .period { font-size: 24px; }
.cover-caption { margin-top: 20px; }
.cover-caption p { margin: 4px 0 0; }

/* ---------- Publication list ---------- */
.pub-filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.pub-filters button {
  font: inherit; font-size: 14px;
  background: transparent; border: 1px solid var(--line); border-radius: 999px;
  padding: 6px 14px; color: var(--ink-2); cursor: pointer;
}
.pub-filters button[aria-pressed="true"] { background: var(--ink); color: var(--surface); border-color: var(--ink); }

.pub-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.pub {
  display: grid; grid-template-columns: 150px 1fr 140px; gap: 24px;
  padding: 24px 0; border-bottom: 1px solid var(--line);
}
.pub-meta { font-size: 14px; color: var(--muted); line-height: 1.4; }
.pub-meta .issue { color: var(--ink); font-weight: 600; display: block; }
.pub h3 { font-size: 22px; margin: 0 0 6px; }
.pub h3 a { color: var(--ink); }
.pub p { margin: 0 0 8px; color: var(--ink-2); font-size: 16px; }
.pub .authors { font-size: 14px; color: var(--muted); margin: 0; }
.pub .dl { text-align: right; }
@media (max-width: 760px) {
  .pub { grid-template-columns: 1fr; gap: 8px; }
  .pub .dl { text-align: left; }
}

/* Compact list used on the home page */
.pub-compact { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
.pub-compact article { border-top: 2px solid var(--ink); padding-top: 16px; }
.pub-compact .pub-meta { margin-bottom: 8px; }
.pub-compact h3 { font-size: 22px; }
.pub-compact h3 a { color: var(--ink); }
.pub-compact p { font-size: 15px; color: var(--ink-2); margin: 0; }
@media (max-width: 900px) { .pub-compact { grid-template-columns: 1fr; } }

/* ---------- Divisions ---------- */
.division { border-top: 2px solid var(--ink); padding-top: 18px; }
.division h3 { margin-bottom: 8px; }
.division p { font-size: 16px; color: var(--ink-2); margin-bottom: 8px; }
.division .lead { font-size: 14px; color: var(--muted); margin: 0; }

/* Division list: name on the left, description on the right */
.division-list .division {
  display: grid; grid-template-columns: 240px 1fr; gap: 6px 48px;
  padding: 22px 0 28px;
}
.division-list .division h3 { grid-row: 1 / span 3; margin: 0; }
.division-list .division p { grid-column: 2; max-width: 66ch; }
.division-list .division .lead { margin-top: 2px; }
@media (max-width: 760px) {
  .division-list .division { grid-template-columns: 1fr; gap: 6px; }
  .division-list .division h3 { grid-row: auto; }
  .division-list .division p { grid-column: 1; }
}

/* ---------- Who we are: photo collage ---------- */
.who-we-are { align-items: center; }
.collage { position: relative; height: 380px; }
.collage-img {
  position: absolute; object-fit: cover;
  filter: grayscale(1) contrast(1.05);
  border: 1px solid var(--line);
  box-shadow: 0 12px 30px rgba(0,0,0,0.45);
}
.collage-1 { width: 46%; height: 42%; top: 0; left: 8%; z-index: 3; }
.collage-2 { width: 78%; height: 72%; top: 14%; left: 0; z-index: 2; }
.collage-3 { width: 52%; height: 34%; bottom: 0; right: 0; z-index: 3; }
@media (max-width: 860px) {
  .who-we-are { grid-template-columns: 1fr; }
  .collage { height: 300px; margin-top: 24px; }
}

/* ---------- Partners ---------- */
.logo-row {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
}
.logo-row .logo {
  background: var(--surface); border: 1px solid var(--line); border-radius: 4px;
  height: 92px; display: flex; align-items: center; justify-content: center;
  padding: 16px; color: var(--muted); font-size: 14px; text-align: center;
}
.logo-row .logo img { max-height: 44px; width: auto; }
@media (max-width: 760px) { .logo-row { grid-template-columns: 1fr 1fr; } }

/* ---------- Cases ---------- */
.case {
  background: var(--surface); border: 1px solid var(--line); border-radius: 4px;
  padding: 28px; display: grid; grid-template-columns: 200px 1fr; gap: 24px;
}
.case + .case { margin-top: 16px; }
.case .partner { font-family: var(--font-display); font-size: 24px; line-height: 1.15; }
.case .partner small { display: block; font-family: var(--font-body); font-size: 14px; color: var(--muted); margin-top: 6px; }
.case dl { margin: 0; display: grid; grid-template-columns: 110px 1fr; gap: 10px 20px; font-size: 16px; }
.case dt { color: var(--muted); }
.case dd { margin: 0; color: var(--ink-2); }
@media (max-width: 760px) {
  .case { grid-template-columns: 1fr; }
  .case dl { grid-template-columns: 1fr; gap: 4px; }
  .case dd { margin-bottom: 8px; }
}

/* ---------- Events ---------- */
.event-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.event { display: grid; grid-template-columns: 170px 1fr auto; gap: 24px; padding: 22px 0; border-bottom: 1px solid var(--line); align-items: start; }
.event .when { color: var(--ink); font-weight: 600; }
.event .when small { display: block; font-weight: 400; color: var(--muted); font-size: 14px; }
.event h3 { font-size: 22px; margin: 0 0 4px; }
.event p { margin: 0; color: var(--ink-2); font-size: 16px; }
@media (max-width: 760px) { .event { grid-template-columns: 1fr; gap: 6px; } }

/* ---------- Team ---------- */
.people { display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px 24px; }
.person .photo {
  aspect-ratio: 1 / 1; background: var(--surface); border: 1px solid var(--line);
  border-radius: 4px; margin-bottom: 12px; overflow: hidden;
  display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 13px;
}
.person .photo img { width: 100%; height: 100%; object-fit: cover; }
.person h4 { margin: 0; }
.person .role { color: var(--ink-2); font-size: 15px; margin: 0; }
.person .link { font-size: 14px; }
@media (max-width: 900px) { .people { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 600px) { .people { grid-template-columns: 1fr 1fr; } }

.names { columns: 3; column-gap: 40px; font-size: 16px; color: var(--ink-2); list-style: none; padding: 0; margin: 0; }
.names li { break-inside: avoid; padding: 4px 0; }
@media (max-width: 700px) { .names { columns: 2; } }

#alumni .names { columns: 1; }
#alumni .names li { padding: 8px 0; border-top: 1px solid var(--line); }

/* ---------- Steps / FAQ ---------- */
.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 56px 1fr; gap: 16px; padding: 20px 0; border-top: 1px solid var(--line); }
.steps li::before {
  content: counter(step);
  font-family: var(--font-display); font-size: 34px; line-height: 1; color: var(--accent);
}
.steps h4 { margin-bottom: 4px; }
.steps p { margin: 0; color: var(--ink-2); font-size: 16px; }

details { border-top: 1px solid var(--line); padding: 14px 0; }
details:last-of-type { border-bottom: 1px solid var(--line); }
summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; color: var(--muted); }
details[open] summary::after { content: "–"; }
details p { margin: 10px 0 0; color: var(--ink-2); font-size: 16px; }

/* ---------- Panels ---------- */
.panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: 4px; padding: 32px;
}
.panel.ink { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.panel.ink a:not(.btn) { color: #7a5f14; }
.panel.ink .btn { border-color: var(--surface); color: var(--surface); }
.panel.ink .btn:hover { background: var(--surface); color: var(--ink); }
.panel.ink p { color: #4a4030; }

/* Timeline (About) */
.timeline { list-style: none; padding: 0; margin: 0; border-left: 2px solid var(--line); }
.timeline li { padding: 0 0 22px 24px; position: relative; }
.timeline li::before {
  content: ""; position: absolute; left: -7px; top: 8px; width: 12px; height: 12px;
  border-radius: 50%; background: var(--paper); border: 2px solid var(--ink);
}
.timeline .year { font-weight: 600; margin-right: 8px; }
.timeline p { margin: 0; color: var(--ink-2); font-size: 16px; }

/* Facts strip (About) */
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 24px 0; text-align: center; }
.facts div span { display: block; font-family: var(--font-display); font-size: 40px; line-height: 1; }
.facts div { font-size: 14px; color: var(--muted); }
@media (max-width: 700px) { .facts { grid-template-columns: 1fr 1fr 1fr; } }

/* Placeholder marker — anything with this class still needs real content */
.todo { color: #9a5b00; background: #fff3d6; padding: 0 4px; border-radius: 2px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--surface); border-top: 1px solid var(--line); padding: 32px 0 18px; font-size: 13px; }
.site-footer .wrap { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 20px; }
.site-footer h4 { font-size: 13px; margin-bottom: 6px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { padding: 2px 0; }
.site-footer a { color: var(--ink-2); }
.site-footer .legal { grid-column: 1 / -1; margin-top: 14px; color: var(--muted); font-size: 11px; border-top: 1px solid var(--line); padding-top: 10px; }
@media (max-width: 760px) { .site-footer .wrap { grid-template-columns: 1fr 1fr; } }
.newsletter-form { display: flex; gap: 6px; margin-top: 6px; }
.newsletter-form input {
  flex: 1; min-width: 0; font-family: var(--font-body); font-size: 12px; color: var(--ink);
  background: var(--paper); border: 1px solid var(--line); padding: 6px 8px;
}
.newsletter-form input:focus { outline: none; border-color: var(--accent); }
.newsletter-form .btn { padding: 6px 12px; font-size: 12px; }
.newsletter-status { font-family: var(--font-body); font-size: 11px; color: var(--muted); align-self: center; }

.page-head { padding: 72px 0 40px; }
.page-head p { margin-top: 12px; }

.hero-canvas-wrap { position: relative; overflow: hidden; }
#network-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.hero-canvas-wrap .page-head { position: relative; z-index: 1; }
@media (max-width: 700px) { #network-canvas { display: none; } }

/* ---------- Motion ----------
   One page-load sequence in the hero, a quiet reveal on scroll, and
   responses to hover/click. Everything is disabled for reduced motion. */

@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: none; }
}
@keyframes cover-in {
  from { opacity: 0; transform: translate(28px, 28px); }
  to   { opacity: 1; transform: none; }
}
@keyframes rule-in {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}

.hero h1, .hero .lede, .hero .actions, .page-head h1, .page-head .lede {
  animation: rise .7s cubic-bezier(.2,.7,.2,1) both;
}
.hero .lede, .page-head .lede { animation-delay: .12s; }
.hero .actions { animation-delay: .24s; }
#latest-report > a { display: block; animation: cover-in .9s cubic-bezier(.2,.7,.2,1) .2s both; }
#latest-report .cover-caption { animation: rise .7s cubic-bezier(.2,.7,.2,1) .7s both; }

/* Scroll reveal: JS adds .reveal, then .in when visible; --i staggers siblings */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .55s ease, transform .55s cubic-bezier(.2,.7,.2,1); transition-delay: calc(var(--i, 0) * 70ms); }
.reveal.in { opacity: 1; transform: none; }

/* Division / compact-publication top rules draw in when revealed */
.division, .pub-compact article { position: relative; border-top-color: transparent; }
.division::before, .pub-compact article::before {
  content: ""; position: absolute; left: 0; right: 0; top: -2px; height: 2px; background: var(--ink);
  transform: scaleX(0); transform-origin: left;
  transition: transform .6s cubic-bezier(.2,.7,.2,1); transition-delay: calc(var(--i, 0) * 70ms + .1s);
}
.reveal.in.division::before, .reveal.in.pub-compact article::before, .pub-compact article.reveal.in::before { transform: scaleX(1); }

/* Publication rows re-enter when the filter changes */
.pub-list.swap .pub { animation: rise .4s ease both; animation-delay: calc(var(--i, 0) * 30ms); }

/* Logos and people tiles: lift on hover */
.logo-row .logo, .person .photo { transition: transform .25s cubic-bezier(.2,.7,.2,1), border-color .25s; }
.logo-row .logo:hover, .person:hover .photo { transform: translateY(-3px); border-color: var(--ink); }

/* Case cards */
.case { transition: border-color .25s; }
.case:hover { border-color: var(--ink); }

/* FAQ */
details p { animation: rise .3s ease both; }

/* Mobile nav slide */
@media (max-width: 700px) {
  .site-nav.open { animation: rise .25s ease both; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
  .division, .pub-compact article { border-top-color: var(--ink); }
  .division::before, .pub-compact article::before { display: none; }
}

/* Honeypot: off-screen for humans, visible to naive bots. Not display:none on purpose. */
.hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
