/* Project pages. Builds on ../assets/css/tokens.css so every page shares the homepage palette and type. */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; text-underline-offset: 3px; }

.wrap { max-width: 920px; margin: 0 auto; padding: 0 24px; }
.wrap-wide { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

/* top bar */
.topbar { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.topbar .wrap-wide { display: flex; align-items: center; justify-content: space-between; height: 56px; gap: 16px; }
.back { font-weight: 600; color: var(--ink); font-size: 0.95rem; display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.back:hover { color: var(--accent); text-decoration: none; }
.toc { display: flex; gap: 20px; list-style: none; margin: 0; padding: 0; overflow-x: auto; scrollbar-width: none; }
.toc::-webkit-scrollbar { display: none; }
.toc a { color: var(--text-muted); font-size: 0.88rem; white-space: nowrap; }
.toc a:hover { color: var(--ink); text-decoration: none; }

/* hero */
.p-hero { text-align: center; padding: 64px 0 40px; }
.venue-pill { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 0.74rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); background: var(--accent-soft); padding: 6px 12px; border-radius: 999px; }
.venue-pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.p-hero h1 { font-size: clamp(2rem, 4.6vw, 3rem); line-height: 1.12; letter-spacing: -0.02em; font-weight: 650; margin: 20px auto 12px; max-width: 18ch; }
.p-hero .tagline { font-size: clamp(1.05rem, 2vw, 1.25rem); color: var(--text-muted); max-width: 46ch; margin: 0 auto 26px; line-height: 1.5; }
.authors { font-size: 1rem; margin: 0 auto 6px; max-width: 60ch; }
.authors .me { font-weight: 650; color: var(--ink); border-bottom: 2px solid var(--accent); }
.affil { font-size: 0.9rem; color: var(--text-subtle); margin: 0 auto; max-width: 64ch; }
.advisors { display: flex; flex-direction: column; align-items: center; gap: 4px; margin: 20px auto 0; font-size: 0.9rem; color: var(--text-muted); max-width: 64ch; }
.advisors b { color: var(--ink); font-weight: 600; }
.advisors .lbl { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-subtle); margin-bottom: 2px; }
.actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 28px; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--ink); font-size: 0.92rem; font-weight: 550; transition: border-color .15s, color .15s, transform .15s; }
.btn:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; transform: translateY(-1px); }
.btn.primary { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.btn.primary:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn svg { width: 16px; height: 16px; }
.btn.disabled { color: var(--text-subtle); pointer-events: none; }

/* figures */
.teaser { margin: 8px 0 0; }
figure { margin: 0; }
.frame { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 14px; box-shadow: 0 1px 2px rgba(10,22,34,.04), 0 12px 32px rgba(10,22,34,.06); overflow: hidden; }
.frame.dark { background: var(--media-dark); border-color: #1a2a3c; }
.frame img { border-radius: 10px; width: 100%; height: auto; }
figcaption { font-size: 0.88rem; color: var(--text-muted); margin: 12px auto 0; max-width: 72ch; line-height: 1.55; }
figcaption b { color: var(--ink); }
.fig-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px 24px; }
.fig-grid figure figcaption { margin-left: 0; }

/* stats */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--border); border-radius: 16px; background: var(--surface); overflow: hidden; margin: 40px 0 0; }
.stats.three { grid-template-columns: repeat(3, 1fr); }
.stat { padding: 20px 22px; }
.stat + .stat { border-left: 1px solid var(--border); }
.stat b { display: block; font-size: 1.7rem; font-weight: 650; letter-spacing: -0.02em; color: var(--accent); line-height: 1.15; }
.stat span { font-size: 0.86rem; color: var(--text-muted); }

/* sections */
.p-section { padding: 56px 0 8px; }
.eyebrow { font-family: var(--font-mono); font-size: 0.74rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-subtle); margin: 0 0 10px; }
.p-section h2 { font-size: 1.7rem; letter-spacing: -0.015em; font-weight: 650; margin: 0 0 18px; line-height: 1.2; }
.p-section h3 { font-size: 1.12rem; font-weight: 650; margin: 0 0 6px; }
.p-section p { margin: 0 0 16px; }
.lead { font-size: 1.12rem; color: var(--ink); }
.abstract { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 28px 32px; }
.abstract p { color: var(--text-muted); }
.abstract p:last-child { margin-bottom: 0; }
.abstract strong { color: var(--ink); }

.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 8px; }
.cards.two { grid-template-columns: repeat(2, 1fr); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 22px; }
.card .num { font-family: var(--font-mono); font-size: 0.74rem; font-weight: 600; color: var(--accent); letter-spacing: 0.06em; margin-bottom: 10px; display: block; }
.card p { font-size: 0.94rem; color: var(--text-muted); margin: 0; }

.steps { list-style: none; padding: 0; margin: 8px 0 0; counter-reset: s; }
.steps li { position: relative; padding: 0 0 22px 52px; counter-increment: s; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 34px; height: 34px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); font-weight: 650; display: grid; place-items: center; font-size: 0.9rem; }
.steps li::after { content: ""; position: absolute; left: 16px; top: 40px; bottom: 6px; width: 2px; background: var(--border); }
.steps li:last-child::after { display: none; }
.steps p { color: var(--text-muted); font-size: 0.96rem; margin: 0; }

.quote { border-left: 3px solid var(--accent); padding: 4px 0 4px 20px; margin: 24px 0; font-size: 1.1rem; color: var(--ink); }

/* table */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; font-variant-numeric: tabular-nums; }
th, td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-subtle); font-weight: 600; background: var(--surface-muted); }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; }
td.good { color: var(--accent); font-weight: 650; }
.table-note { font-size: 0.85rem; color: var(--text-subtle); margin-top: 10px; }

.note { background: var(--surface-muted); border-radius: 14px; padding: 16px 20px; font-size: 0.92rem; color: var(--text-muted); }

/* more projects */
.more { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.more a { display: block; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 18px; color: var(--ink); transition: border-color .15s, transform .15s; }
.more a:hover { border-color: var(--accent); text-decoration: none; transform: translateY(-2px); }
.more .v { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
.more .t { display: block; font-weight: 650; margin-top: 6px; line-height: 1.35; }

.p-footer { border-top: 1px solid var(--border); margin-top: 72px; padding: 28px 0 40px; color: var(--text-subtle); font-size: 0.88rem; }
.p-footer .wrap-wide { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

@media (max-width: 760px) {
  body { font-size: 16px; }
  .wrap, .wrap-wide { padding-left: 16px; padding-right: 16px; }
  .toc { display: none; }
  .p-hero { padding: 40px 0 28px; }
  .stats, .stats.three { grid-template-columns: 1fr 1fr; }
  .stat:nth-child(odd) { border-left: 0; }
  .stat:nth-child(n+3) { border-top: 1px solid var(--border); }
  .stats.three .stat:nth-child(3) { grid-column: 1 / -1; }
  .fig-grid, .cards, .cards.two, .more { grid-template-columns: 1fr; }
  .abstract { padding: 22px 20px; }
  .frame { padding: 8px; border-radius: 14px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .btn, .more a { transition: none; } }
