/* The Burstiness Engine — paper-style site (landing + research) */
@import url('https://fonts.googleapis.com/css2?family=Source+Serif+4:opsz,wght@8..60,400;8..60,600;8..60,700&family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --ink: #16161f;
  --ink-soft: #54546a;
  --ink-faint: #6d6d82;
  --paper: #ffffff;
  --paper-2: #fafafd;
  --paper-3: #f4f4fa;
  --line: #e7e7f0;
  --line-strong: #d6d6e3;
  --brand: #9d1b54;
  --brand-2: #b13a6e;
  --brand-3: #c14d80;
  --grad: linear-gradient(95deg, #9d1b54 0%, #b13a6e 50%, #c14d80 100%);
  --green: #16a34a;
  --amber: #d97706;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --measure: 720px;
  --wide: 1040px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
::selection { background: rgba(157, 27, 84, 0.18); }

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-3); text-decoration: underline; text-underline-offset: 3px; }
p a, li a, .note a, figcaption a, td a, .burst-cap a { text-decoration: underline; text-underline-offset: 2px; }

/* ---- top nav ---- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem clamp(1.25rem, 5vw, 3rem);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar .brand {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.02rem;
  letter-spacing: -0.01em;
  color: var(--ink);
  display: flex; align-items: center; gap: 0.55rem;
}
.topbar .brand:hover { text-decoration: none; }
.dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--grad);
  box-shadow: 0 0 0 4px rgba(157, 27, 84, 0.12);
}
.topnav { display: flex; gap: clamp(0.6rem, 2vw, 1.4rem); align-items: center; font-size: 0.92rem; }
.topnav a { color: var(--ink-soft); font-weight: 500; position: relative; }
.topnav a:hover { color: var(--brand); text-decoration: none; }
.topnav a[aria-current="page"] { color: var(--ink); font-weight: 600; }
.topnav a[aria-current="page"]::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 2px;
  border-radius: 2px; background: var(--grad);
}
.topnav a.cta {
  color: #fff; background: var(--grad);
  padding: 0.38rem 0.85rem; border-radius: 999px; font-weight: 600;
}
.topnav a.cta:hover { opacity: 0.92; }
.topnav a.cta[aria-current="page"]::after { display: none; }

/* mobile hamburger */
.navtoggle {
  display: none; width: 40px; height: 40px; border: 1px solid var(--line);
  background: var(--paper); border-radius: 10px; cursor: pointer;
  padding: 0; align-items: center; justify-content: center; flex-direction: column; gap: 4px;
}
.navtoggle span { display: block; width: 18px; height: 2px; background: var(--ink); border-radius: 2px; transition: transform 0.2s ease, opacity 0.2s ease; }
.navtoggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.navtoggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.navtoggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ---- layout ---- */
.wrap { max-width: var(--measure); margin: 0 auto; padding: 0 clamp(1.25rem, 5vw, 2rem); }
.wrap-wide { max-width: var(--wide); margin: 0 auto; padding: 0 clamp(1.25rem, 5vw, 2rem); }
section { padding: clamp(2.5rem, 6vw, 4.5rem) 0; }
.divider { height: 1px; background: var(--line); border: 0; margin: 0; }

/* ---- hero ---- */
.hero { position: relative; padding: clamp(3rem, 8vw, 6rem) 0 clamp(2rem, 5vw, 3.5rem); overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: -20% -10% auto auto; width: 60vw; height: 60vw; max-width: 720px; max-height: 720px;
  background: radial-gradient(circle at 70% 30%, rgba(157,27,84,0.14), rgba(157,27,84,0.06) 40%, transparent 70%);
  pointer-events: none; z-index: 0;
}
.hero-grid { position: relative; z-index: 1; display: grid; grid-template-columns: 1.1fr 0.9fr; gap: clamp(1.5rem, 4vw, 3.5rem); align-items: center; }
.hero-text { min-width: 0; }
.hero-visual { min-width: 0; }
.hero-visual .burst-card {
  background: var(--paper); border: 1px solid var(--line); border-radius: 18px;
  padding: 1.5rem 1.6rem 1.3rem; box-shadow: 0 20px 50px rgba(22,22,31,0.07);
}
.burst-row { display: flex; align-items: flex-end; gap: 4px; height: 88px; margin: 0.5rem 0 0.3rem; }
.burst-row span { flex: 1; border-radius: 3px 3px 0 0; background: linear-gradient(180deg, var(--brand-3), var(--brand)); animation: burstrise 0.7s ease both; }
.burst-row.flat span { background: var(--line-strong); }
@keyframes burstrise { from { transform: scaleY(0.15); opacity: 0; } to { transform: scaleY(1); opacity: 1; } }
.burst-row span { transform-origin: bottom; }
.burst-label { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-faint); }
.burst-label b { color: var(--brand); font-weight: 600; }
.burst-cap { font-size: 0.84rem; color: var(--ink-soft); margin: 1rem 0 0; line-height: 1.5; }
@media (prefers-reduced-motion: reduce) { .burst-row span { animation: none; } }
@media (max-width: 820px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-visual { order: -1; max-width: 460px; }
}
.eyebrow {
  font-family: var(--mono); font-size: 0.74rem; font-weight: 500;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--brand); margin: 0 0 1.1rem;
}
h1.title {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(2.4rem, 6vw, 3.8rem);
  line-height: 1.04;
  letter-spacing: -0.025em;
  margin: 0 0 1rem;
  color: var(--ink);
}
h1.title .grad {
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.lede {
  font-family: var(--serif);
  font-size: clamp(1.15rem, 2.4vw, 1.4rem);
  line-height: 1.5;
  color: var(--ink-soft);
  margin: 0 0 1.8rem;
  max-width: 38ch;
}
.authors { font-size: 0.98rem; color: var(--ink-soft); margin: 0 0 0.4rem; }
.authors strong { color: var(--ink); font-weight: 600; }
.affil { font-size: 0.86rem; color: var(--ink-faint); margin: 0 0 1.8rem; }

.cta-row { display: flex; flex-wrap: wrap; gap: 0.7rem; margin-top: 0.5rem; }
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.62rem 1.15rem; border-radius: 10px;
  font-weight: 600; font-size: 0.94rem;
  border: 1px solid var(--line-strong);
  background: var(--paper); color: var(--ink);
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); box-shadow: 0 6px 18px rgba(22, 22, 31, 0.07); border-color: var(--brand); color: var(--brand); }
.btn.primary { background: var(--grad); color: #fff; border: 0; }
.btn.primary:hover { color: #fff; box-shadow: 0 8px 22px rgba(157, 27, 84, 0.32); }

/* ---- badges ---- */
.badges { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1.9rem 0 0; }
.badge {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-family: var(--mono); font-size: 0.74rem; font-weight: 500;
  padding: 0.3rem 0.65rem; border-radius: 999px;
  background: var(--paper-3); color: var(--ink-soft);
  border: 1px solid var(--line);
}
.badge b { color: var(--ink); font-weight: 600; }

/* ---- typography blocks ---- */
.kicker {
  font-family: var(--mono); font-size: 0.74rem; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--brand); margin: 0 0 0.7rem;
}
h2.sec {
  font-family: var(--serif); font-weight: 700;
  font-size: clamp(1.6rem, 3.4vw, 2.2rem);
  letter-spacing: -0.02em; line-height: 1.12;
  margin: 0 0 1.1rem;
}
h3.sub {
  font-family: var(--serif); font-weight: 600;
  font-size: 1.25rem; letter-spacing: -0.01em; margin: 2rem 0 0.5rem;
}
p { margin: 0 0 1.1rem; }
p.big { font-size: 1.08rem; }
.muted { color: var(--ink-soft); }
strong { font-weight: 600; color: var(--ink); }
em { font-style: italic; }

/* ---- formula callout ---- */
.formula {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-left: 3px solid var(--brand);
  border-radius: 12px;
  padding: 1.4rem 1.6rem;
  margin: 1.6rem 0;
  font-family: var(--mono);
  font-size: 1.02rem;
  line-height: 1.7;
  overflow-x: auto;
}
.formula .lbl { color: var(--ink-faint); font-size: 0.82rem; display: block; margin-bottom: 0.5rem; font-family: var(--sans); letter-spacing: 0.04em; text-transform: uppercase; }
.formula b { color: var(--brand-2); }

code {
  font-family: var(--mono); font-size: 0.86em;
  background: var(--paper-3); color: var(--brand-2);
  padding: 0.12rem 0.4rem; border-radius: 5px;
}

/* ---- contribution cards ---- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(248px, 1fr)); gap: 1rem; margin-top: 1.6rem; }
.card {
  background: var(--paper); border: 1px solid var(--line);
  border-radius: 14px; padding: 1.4rem 1.4rem 1.5rem;
  transition: transform 0.14s ease, box-shadow 0.14s ease, border-color 0.14s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(22, 22, 31, 0.06); border-color: var(--line-strong); }
.card .num {
  font-family: var(--serif); font-weight: 700; font-size: 1.5rem;
  background: var(--grad); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; margin-bottom: 0.4rem;
}
.card h3 { font-family: var(--serif); font-size: 1.12rem; font-weight: 600; margin: 0 0 0.5rem; letter-spacing: -0.01em; }
.card p { font-size: 0.96rem; color: var(--ink-soft); margin: 0; }

/* ---- table ---- */
.table-wrap { overflow-x: auto; margin: 1.6rem 0; border: 1px solid var(--line); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 0.94rem; }
thead th {
  text-align: left; font-family: var(--sans); font-weight: 600; font-size: 0.78rem;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-faint);
  padding: 0.85rem 1rem; background: var(--paper-2); border-bottom: 1px solid var(--line);
}
tbody td { padding: 0.8rem 1rem; border-bottom: 1px solid var(--line); vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--paper-2); }
td .qid { font-family: var(--mono); font-weight: 600; color: var(--brand); }
.pill { display: inline-block; font-size: 0.76rem; font-weight: 600; padding: 0.15rem 0.55rem; border-radius: 999px; white-space: nowrap; }
.pill.done { background: rgba(22, 163, 74, 0.14); color: #0b6130; }
.pill.prog { background: rgba(180, 83, 9, 0.15); color: #8a4309; }
.pill.gap { background: rgba(157, 27, 84, 0.1); color: var(--brand); }

/* ---- callout / note ---- */
.note {
  background: linear-gradient(180deg, var(--paper-3), var(--paper-2));
  border: 1px solid var(--line); border-radius: 12px;
  padding: 1.3rem 1.5rem; margin: 1.6rem 0;
  font-size: 0.98rem;
}
.note .tag { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--brand); display: block; margin-bottom: 0.45rem; }

.tinted { background: var(--paper-2); }

/* ---- step list (research) ---- */
.steps { list-style: none; counter-reset: s; padding: 0; margin: 1.6rem 0; }
.steps li { position: relative; padding: 0 0 1.4rem 3rem; }
.steps li::before {
  counter-increment: s; content: counter(s);
  position: absolute; left: 0; top: 0;
  width: 2rem; height: 2rem; border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--mono); font-weight: 600; font-size: 0.85rem; color: #fff;
  background: var(--grad);
}
.steps li:not(:last-child)::after {
  content: ""; position: absolute; left: 0.97rem; top: 2.2rem; bottom: 0.2rem;
  width: 2px; background: var(--line-strong);
}
.steps h3 { font-family: var(--serif); font-size: 1.1rem; margin: 0.1rem 0 0.35rem; }
.steps p { font-size: 0.96rem; color: var(--ink-soft); margin: 0; }

/* ---- figures ---- */
figure { margin: 1.8rem 0; }
figure img { width: 100%; height: auto; display: block; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
figure figcaption { font-size: 0.86rem; color: var(--ink-faint); margin-top: 0.6rem; line-height: 1.5; }
figure figcaption b { color: var(--ink-soft); }
.fig-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.4rem; margin: 1.8rem 0; }
.fig-grid figure { margin: 0; }

/* ---- the lab (dark band w/ convergence bg + profile cards) ---- */
.lab { position: relative; overflow: hidden; background: #0c0c14; padding: clamp(3rem, 7vw, 5.5rem) 0; }
.lab-bg {
  position: absolute; inset: 0;
  background-image: linear-gradient(120deg, rgba(12,12,20,0.92) 0%, rgba(12,12,20,0.7) 45%, rgba(157,27,84,0.28) 100%), url('/assets/lab-convergence.jpg');
  background-size: cover; background-position: center;
  opacity: 0.96;
}
.lab-bg::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(120% 80% at 80% 0%, rgba(193,77,128,0.22), transparent 60%);
}
.lab-inner { position: relative; z-index: 1; }
.kicker.light { color: #e6a8c2; }
.sec.light, .lab .sec { color: #f5f5fb; }
.lab-copy { color: #c7c7d6; max-width: 56ch; font-size: 1.05rem; margin-bottom: 2.4rem; }

.people { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.1rem; }
.person {
  display: flex; gap: 1.1rem; align-items: flex-start;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px; padding: 1.4rem;
  backdrop-filter: blur(8px);
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}
.person:hover { transform: translateY(-2px); border-color: rgba(193,77,128,0.5); background: rgba(255,255,255,0.07); }
.avatar { flex: 0 0 72px; width: 72px; height: 72px; border-radius: 14px; overflow: hidden; box-shadow: 0 0 0 1px rgba(255,255,255,0.12); }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar.mono {
  display: grid; place-items: center;
  font-family: var(--serif); font-weight: 700; font-size: 1.5rem; color: #fff;
  background: var(--grad);
}
.person-body h3 { font-family: var(--serif); font-size: 1.2rem; font-weight: 600; margin: 0 0 0.15rem; color: #fff; letter-spacing: -0.01em; }
.person-body .role { font-family: var(--mono); font-size: 0.74rem; letter-spacing: 0.1em; text-transform: uppercase; color: #e6a8c2; margin: 0 0 0.6rem; }
.person-body .bio { font-size: 0.92rem; color: #b7b7c8; margin: 0 0 0.6rem; line-height: 1.55; }
.person-body .links { font-size: 0.86rem; margin: 0; color: #8a8aa0; }
.person-body .links a { color: #e6a8c2; }
.person-body .links a:hover { color: #fff; }
.muted-link { color: #6f6f85 !important; }

/* ---- footer ---- */
footer { border-top: 1px solid var(--line); background: var(--paper-2); padding: 2.5rem 0 3rem; margin-top: 1rem; }
footer .cols { display: flex; flex-wrap: wrap; gap: 2rem; justify-content: space-between; }
footer h3 { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-faint); margin: 0 0 0.7rem; }
footer a { display: block; color: var(--ink-soft); font-size: 0.94rem; margin-bottom: 0.35rem; }
footer a:hover { color: var(--brand); text-decoration: none; }
footer .copy { margin-top: 2rem; font-size: 0.84rem; color: var(--ink-faint); }

@media (max-width: 760px) {
  body { font-size: 16px; }
  .navtoggle { display: flex; }
  .topnav {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--paper); border-bottom: 1px solid var(--line);
    padding: 0.5rem clamp(1.25rem, 5vw, 3rem) 1rem;
    box-shadow: 0 12px 24px rgba(22, 22, 31, 0.07);
    transform-origin: top; transform: scaleY(0); opacity: 0; pointer-events: none;
    transition: transform 0.18s ease, opacity 0.18s ease;
  }
  .topnav.open { transform: scaleY(1); opacity: 1; pointer-events: auto; }
  .topnav a { padding: 0.7rem 0; border-bottom: 1px solid var(--line); }
  .topnav a[aria-current="page"]::after { display: none; }
  .topnav a.cta { text-align: center; margin-top: 0.6rem; border: 0; padding: 0.7rem; }
}
