/* ============================================================================
   AimTrap — academic project page.
   Layout follows the StarVector / Nerfies project-page pattern (centered).
   Type, color, buttons and elevation follow DESIGN.md (Vercel design language).
   ========================================================================= */

:root {
  /* ink & surfaces */
  --ink: #171717;
  --body: #4d4d4d;
  --mute: #888888;
  --hairline: #ebebeb;
  --hairline-strong: #a1a1a1;
  --canvas: #ffffff;
  --canvas-soft: #fafafa;
  --canvas-soft-2: #f5f5f5;
  --on-primary: #ffffff;

  /* semantic */
  --link: #0070f3;
  --link-deep: #0761d1;
  --error: #ee0000;
  --error-soft: #f7d4d6;
  --warning: #f5a623;
  --warning-deep: #ab570a;
  --success-deep: #1c7a63;
  --success-soft: #aaffec;

  /* brand gradient stops */
  --g-dev-a: #007cf0;
  --g-dev-b: #00dfd8;
  --g-prev-a: #7928ca;
  --g-prev-b: #ff0080;
  --g-ship-a: #ff4d4d;
  --g-ship-b: #f9cb28;

  /* type */
  --sans: Inter, Geist, system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  /* elevation — stacked offsets + inset hairline ring (never one heavy drop) */
  --e1: 0 0 0 1px rgba(0, 0, 0, .08);
  --e2: 0 0 0 1px rgba(0, 0, 0, .08), 0 1px 1px rgba(0, 0, 0, .02), 0 2px 2px rgba(0, 0, 0, .04);
  --e3: 0 0 0 1px rgba(0, 0, 0, .08), 0 2px 2px rgba(0, 0, 0, .04), 0 8px 8px -8px rgba(0, 0, 0, .04);
  --e4: 0 0 0 1px rgba(0, 0, 0, .08), 0 2px 2px rgba(0, 0, 0, .04), 0 8px 16px -4px rgba(0, 0, 0, .04);

  --nav-h: 64px;
}

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

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 16px); }

body {
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--sans);
  font-feature-settings: "ss01", "ss02", "cv01", "cv03";
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
sup { font-size: .68em; vertical-align: super; }

/* ---------- containers ---------- */
.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 24px; }
.col  { max-width: 760px; margin-left: auto; margin-right: auto; }
.col--wide { max-width: 900px; }

/* ---------- type scale (negative tracking is part of the voice) ---------- */
.display-xl {
  font-size: clamp(34px, 5vw, 52px); font-weight: 600; line-height: 1.06;
  letter-spacing: -.045em;
}
.display-lg { font-size: clamp(26px, 3.4vw, 32px); font-weight: 600; line-height: 1.25; letter-spacing: -.04em; }
.display-md { font-size: clamp(20px, 2.2vw, 24px); font-weight: 600; line-height: 1.34; letter-spacing: -.04em; }
.display-sm { font-size: 20px; font-weight: 600; line-height: 1.4; letter-spacing: -.03em; }

.lead { font-size: 18px; line-height: 1.62; color: var(--body); }
.body { font-size: 16px; line-height: 1.6; color: var(--body); }
.small { font-size: 14px; line-height: 1.55; letter-spacing: -.01em; color: var(--body); }
.caption { font-size: 12px; line-height: 1.5; color: var(--mute); }
.mono { font-family: var(--mono); font-size: .92em; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
strong { font-weight: 600; color: var(--ink); }

.eyebrow {
  display: block; font-family: var(--mono); font-size: 12px; line-height: 16px;
  letter-spacing: .08em; text-transform: uppercase; color: var(--mute);
}

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 60; height: var(--nav-h);
  background: rgba(255, 255, 255, .82);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--hairline);
}
.nav__in { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: var(--nav-h); }
.brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 600; letter-spacing: -.02em; }
.brand__mark {
  width: 18px; height: 18px; border-radius: 5px;
  background: url("../brand-mark.svg") center / cover no-repeat;
}
.nav__links { display: flex; align-items: center; gap: 2px; }
.nav__links a {
  padding: 8px 12px; border-radius: 9999px;
  font-size: 14px; letter-spacing: -.02em; color: var(--body);
  transition: color .15s ease, background .15s ease;
}
.nav__links a:hover { color: var(--ink); background: var(--canvas-soft-2); }
.nav__links a.is-active { color: var(--ink); }
.nav__cta { display: flex; align-items: center; gap: 8px; }
.nav__burger {
  display: none; width: 34px; height: 34px; border: 1px solid var(--hairline);
  border-radius: 6px; background: var(--canvas); cursor: pointer;
  align-items: center; justify-content: center;
}
.nav__burger span, .nav__burger span::before, .nav__burger span::after {
  content: ""; display: block; width: 14px; height: 1.5px; background: var(--ink); position: relative;
}
.nav__burger span::before { position: absolute; top: -5px; }
.nav__burger span::after { position: absolute; top: 5px; }

/* ---------- buttons — marketing pill scale (rounded.pill = 100px) ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 18px; border-radius: 100px;
  font-size: 14px; font-weight: 500; line-height: 20px; letter-spacing: -.01em;
  border: 1px solid transparent; cursor: pointer; white-space: nowrap;
  transition: background .15s ease, color .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.btn svg { width: 15px; height: 15px; flex: none; }
.btn--ink { background: var(--ink); color: var(--on-primary); }
.btn--ink:hover { background: #000; }
.btn--ghost { background: var(--canvas); color: var(--ink); border-color: var(--hairline); box-shadow: var(--e1); }
.btn--ghost:hover { border-color: var(--hairline-strong); }
.btn--on-dark { background: var(--canvas); color: var(--ink); }
.btn--on-dark:hover { background: #f0f0f0; }
.btn--ghost-dark { background: transparent; color: #fff; border-color: #333; }
.btn--ghost-dark:hover { border-color: #666; }
.btn--lg { height: 48px; padding: 0 22px; font-size: 16px; line-height: 24px; }
.btn--sm { height: 32px; padding: 0 14px; }

/* ---------- badges & chips ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 8px;
  height: 28px; padding: 0 12px 0 10px; border-radius: 9999px;
  background: var(--canvas-soft); border: 1px solid var(--hairline);
  font-family: var(--mono); font-size: 12px; font-weight: 600; letter-spacing: .06em;
  text-transform: uppercase; color: var(--body);
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--g-prev-b); flex: none; }
.chip {
  display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 9999px;
  background: var(--canvas-soft-2); color: var(--body);
  font-family: var(--mono); font-size: 11px; letter-spacing: .04em; text-transform: uppercase;
}
.chip--aht { background: #fff3d6; color: var(--warning-deep); }
.chip--act { background: #e2ecff; color: var(--link-deep); }
.chip--good { background: var(--success-soft); color: var(--success-deep); }

/* ---------- bands ---------- */
.band { padding: clamp(56px, 8vw, 96px) 0; }
.band--soft { background: var(--canvas-soft); border-block: 1px solid var(--hairline); }
.band--dark { background: var(--ink); color: var(--on-primary); }
.band--dark .lead, .band--dark .body, .band--dark .small { color: #a8a8a8; }
.band--dark .eyebrow { color: #6f6f6f; }
.band--dark strong { color: #fff; }

/* every section head is centered */
.head { text-align: center; margin-bottom: 44px; }
.head .eyebrow { margin-bottom: 14px; }
.head .lead { margin: 16px auto 0; max-width: 68ch; }

/* ---------- hero ---------- */
.hero { position: relative; overflow: hidden; padding: clamp(72px, 11vw, 132px) 0 clamp(64px, 9vw, 108px); text-align: center; }
.hero__mesh {
  position: absolute; inset: -40% -10% auto -10%; height: 880px; z-index: 0;
  filter: blur(80px); opacity: .42; pointer-events: none;
}
.hero__mesh i { position: absolute; display: block; border-radius: 50%; }
.hero__mesh i:nth-child(1) { width: 42%; height: 54%; left: 2%;  top: 32%; background: radial-gradient(circle, var(--g-dev-a), transparent 68%); }
.hero__mesh i:nth-child(2) { width: 38%; height: 48%; left: 24%; top: 24%; background: radial-gradient(circle, var(--g-dev-b), transparent 68%); }
.hero__mesh i:nth-child(3) { width: 40%; height: 52%; left: 44%; top: 34%; background: radial-gradient(circle, var(--g-prev-b), transparent 68%); }
.hero__mesh i:nth-child(4) { width: 34%; height: 44%; left: 62%; top: 26%; background: radial-gradient(circle, var(--g-prev-a), transparent 68%); }
.hero__mesh i:nth-child(5) { width: 32%; height: 42%; left: 76%; top: 38%; background: radial-gradient(circle, var(--g-ship-b), transparent 68%); }
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(255,255,255,.55), rgba(255,255,255,.15) 45%, rgba(255,255,255,0));
}
.hero__in { position: relative; z-index: 1; }
/* the catchy half of the title sits below the substantive subtitle in scale */
.hero h1 { max-width: 34ch; margin: 18px auto 0; font-size: clamp(24px, 3vw, 34px); letter-spacing: -.038em; }
.hero h1 .grad {
  background: linear-gradient(92deg, var(--g-ship-a), var(--g-prev-b) 46%, var(--g-prev-a));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero__sub {
  max-width: 40ch; margin: 16px auto 0;
  font-size: clamp(19px, 2.4vw, 26px); font-weight: 600; line-height: 1.32;
  letter-spacing: -.032em; color: var(--ink);
}

/* authors */
.authors { margin-top: 30px; }
.authors ol { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 24px; }
.authors li { font-size: 16px; font-weight: 500; letter-spacing: -.015em; }
.authors sup { font-family: var(--mono); font-size: 11px; color: var(--mute); font-weight: 400; margin-left: 2px; }
.affils { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 22px; margin-top: 12px; }
.affils span { font-size: 14px; color: var(--body); }
.affils sup { font-family: var(--mono); font-size: 11px; color: var(--mute); margin-right: 3px; }

.actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 30px; }

/* ---------- stat strip ---------- */
.stats { border-block: 1px solid var(--hairline); background: var(--canvas-soft); }
/* same strip, boxed inside a band instead of running full-bleed */
.stats--inline {
  border: 1px solid var(--hairline); border-radius: 12px; overflow: hidden;
  background: var(--canvas-soft); margin-bottom: 28px;
}
.stats__grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); text-align: center; }
.stat { padding: 26px 18px; border-left: 1px solid var(--hairline); }
.stat:first-child { border-left: 0; }
.stat__n { font-size: clamp(24px, 2.8vw, 32px); font-weight: 600; letter-spacing: -.04em; line-height: 1.1; }
.stat__n small { font-size: .55em; font-weight: 500; color: var(--mute); margin-left: 2px; }
.stat__l { margin-top: 6px; font-family: var(--mono); font-size: 11px; letter-spacing: .05em; text-transform: uppercase; color: var(--mute); }

/* ---------- figures ---------- */
.fig { margin: 0 auto; }
.fig img {
  width: 100%; border-radius: 12px; background: var(--canvas-soft-2);
  box-shadow: var(--e3); cursor: zoom-in;
}
.fig figcaption {
  margin: 14px auto 0; max-width: 76ch; text-align: center;
  font-size: 13.5px; line-height: 1.6; color: var(--mute);
}
.fig figcaption b { color: var(--ink); font-weight: 600; }
.fig figcaption .mono { color: var(--body); }

.tex { border-radius: 8px; overflow: hidden; background: var(--canvas-soft-2); box-shadow: var(--e2); }
.tex img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; cursor: zoom-in; }
.tex figcaption {
  padding: 9px 12px; text-align: center; background: var(--canvas); border-top: 1px solid var(--hairline);
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .04em; text-transform: uppercase; color: var(--mute);
}
.tex--flag figcaption { color: var(--error); background: var(--error-soft); border-top-color: #f0c2c4; }

/* ---------- grids & cards ---------- */
.grid { display: grid; gap: 20px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.card {
  background: var(--canvas); border-radius: 8px; padding: 24px;
  box-shadow: var(--e3); text-align: center;
}
.card--lg { border-radius: 12px; padding: 32px; box-shadow: var(--e4); }
.card--soft { background: var(--canvas-soft); box-shadow: var(--e1); }
.card--dark { background: #1f1f1f; box-shadow: 0 0 0 1px #2e2e2e; }
.card__num {
  display: block; font-family: var(--mono); font-size: 11px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--mute); margin-bottom: 12px;
}
.card h3 { margin-bottom: 10px; }
.card p { color: var(--body); }

/* ---------- method components ---------- */
/* the component intros run at body size — the section head above already carries the scale */
.comp .head .lead { font-size: 16px; line-height: 1.62; max-width: 64ch; }

/* ---------- tables ---------- */
.table-scroll { overflow-x: auto; border-radius: 8px; box-shadow: var(--e1); background: var(--canvas); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
thead th {
  background: var(--canvas-soft); font-family: var(--mono); font-size: 11px; font-weight: 400;
  letter-spacing: .06em; text-transform: uppercase; color: var(--mute);
  padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--hairline); white-space: nowrap;
}
tbody td { padding: 13px 16px; border-bottom: 1px solid var(--hairline); color: var(--body); }
tbody tr:last-child td { border-bottom: 0; }
thead th.c, tbody td.c { text-align: center; }
thead th.r, tbody td.r { text-align: right; }
tbody tr.is-ours td { background: var(--canvas-soft); color: var(--ink); font-weight: 500; }
.ok { color: var(--success-deep); font-weight: 600; }
.no { color: var(--error); font-weight: 600; }
.tnote { margin-top: 14px; font-size: 12.5px; line-height: 1.6; color: var(--mute); text-align: center; }
.tnote a { color: var(--link); }
.tnote a:hover { text-decoration: underline; }

/* ---------- code / bibtex ---------- */
.code {
  position: relative; background: var(--ink); border-radius: 8px; padding: 22px 24px;
  text-align: left; overflow-x: auto;
}
/* on the polarity-flipped band the block needs its own surface step */
.band--dark .code { background: #1f1f1f; box-shadow: 0 0 0 1px #2e2e2e; }
.code pre {
  font-family: var(--mono); font-size: 13px; line-height: 20px; color: #d6d6d6; white-space: pre;
}
.code .k { color: var(--g-dev-b); }
.code .s { color: #f5f5f5; }
.code__copy {
  position: absolute; top: 12px; right: 12px; height: 28px; padding: 0 12px;
  border-radius: 6px; border: 1px solid #333; background: #1f1f1f; color: #d6d6d6;
  font-family: var(--sans); font-size: 12px; font-weight: 500; cursor: pointer;
}
.code__copy:hover { border-color: #666; color: #fff; }

/* ---------- footer ---------- */
.footer { border-top: 1px solid var(--hairline); padding: 48px 0; text-align: center; }
.footer .brand { justify-content: center; }
.footer p { margin-top: 12px; font-size: 13px; color: var(--mute); }
.footer a { color: var(--link); }
.footer a:hover { text-decoration: underline; }

/* ---------- lightbox ---------- */
.lb {
  position: fixed; inset: 0; z-index: 200; display: none;
  background: rgba(10, 10, 10, .92); padding: 32px;
  align-items: center; justify-content: center; backdrop-filter: blur(4px);
}
.lb.is-open { display: flex; }
.lb img { max-width: 100%; max-height: 100%; border-radius: 8px; }
.lb__x {
  position: absolute; top: 20px; right: 24px; width: 36px; height: 36px;
  border-radius: 9999px; border: 1px solid #333; background: #171717; color: #fff;
  font-size: 20px; line-height: 1; cursor: pointer;
}

/* ---------- responsive ---------- */
@media (max-width: 1023px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stat { border-top: 1px solid var(--hairline); }
  .stat:nth-child(4) { border-left: 0; }
  .stat:nth-child(-n+3) { border-top: 0; }
}
@media (max-width: 860px) {
  .nav__links {
    display: none; position: absolute; top: var(--nav-h); left: 0; right: 0;
    flex-direction: column; gap: 2px; background: #fff; padding: 12px 16px 16px;
    border-bottom: 1px solid var(--hairline); box-shadow: var(--e4);
  }
  .nav__links.is-open { display: flex; }
  .nav__burger { display: flex; }
  .nav__cta .btn--hide-sm { display: none; }
  .g2, .g3 { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .g4 { grid-template-columns: 1fr; }
  .stats__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat:nth-child(3) { border-left: 0; }
  .stat:nth-child(-n+2) { border-top: 0; }
  .stat:nth-child(n+3) { border-top: 1px solid var(--hairline); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}
