/* PG-FMM project page — dark radar hero, light card sections, results carousel. */
:root {
  --bg: #f5f7fb;
  --card: #ffffff;
  --ink: #0f172a;
  --ink-2: #334155;
  --ink-3: #64748b;
  --line: #e2e8f0;
  --line-2: #cbd5e1;
  --accent: #1e3a5f;          /* dark navy: Ours row, active dot, eyebrows */
  --accent-ink: #1e3a5f;
  --accent-soft: #eef2f8;
  --navy: #0b1220;
  --navy-2: #0f1b33;
  --radius: 16px;
  --shadow: 0 12px 34px rgba(15, 23, 42, .08), 0 1px 2px rgba(15, 23, 42, .06);
  --shadow-lg: 0 30px 80px rgba(2, 6, 23, .35);
  --display: "Newsreader", "Iowan Old Style", Georgia, serif;
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --maxw: 1120px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--sans); font-size: 17px; line-height: 1.7;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
img { max-width: 100%; display: block; }
p { margin: 0 0 16px; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.wrap.narrow { max-width: 820px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }

/* ---------- nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  transition: background .25s ease, border-color .25s ease, box-shadow .25s ease;
  color: #fff;
}
.nav-in { max-width: var(--maxw); margin: 0 auto; padding: 14px 24px; display: flex; align-items: center; gap: 24px; }
.brand { font-family: var(--display); font-weight: 600; font-size: 1.25rem; letter-spacing: .01em; color: inherit; }
.brand:hover { text-decoration: none; }
.nav-links { display: flex; gap: 22px; margin-left: 12px; font-size: .92rem; font-weight: 500; }
.nav-links a { color: inherit; opacity: .78; }
.nav-links a:hover { opacity: 1; text-decoration: none; }
.nav-cta { margin-left: auto; display: flex; gap: 8px; }
.nav.is-solid { background: rgba(255,255,255,.86); backdrop-filter: saturate(160%) blur(12px); -webkit-backdrop-filter: saturate(160%) blur(12px); color: var(--ink); border-bottom: 1px solid var(--line); box-shadow: 0 1px 0 rgba(15,23,42,.02); }
.nav.is-solid .btn-ghost { border-color: var(--line-2); color: var(--ink); }
.nav.is-solid .btn-solid { background: var(--ink); color: #fff; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 12px 22px; border-radius: 999px;
  font: 600 .93rem/1 var(--sans); letter-spacing: .01em;
  border: 1px solid transparent; cursor: pointer;
}
.btn:hover { text-decoration: none; }
.btn svg { width: 17px; height: 17px; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.btn svg.fill { fill: currentColor; stroke: none; }
.btn-solid { background: #fff; color: var(--navy); }
.btn-solid:hover { background: #eef3ff; }
.btn-ghost { border-color: rgba(255,255,255,.28); color: #fff; background: rgba(255,255,255,.04); }
.btn-ghost:hover { background: rgba(255,255,255,.1); }
.btn-sm { padding: 9px 16px; font-size: .84rem; }
.btn.is-disabled { opacity: .45; cursor: default; pointer-events: none; }
.soon { font-size: .68rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; padding: 3px 7px; border-radius: 999px; background: rgba(255,255,255,.14); }

/* ---------- hero ---------- */
.hero {
  position: relative; overflow: hidden; color: #fff; text-align: center;
  min-height: 100vh; min-height: 100svh;
  display: flex; align-items: center; justify-content: center;
  padding: 120px 24px 170px;
  background:
    radial-gradient(1100px 520px at 15% -10%, rgba(96,165,250,.22), transparent 62%),
    radial-gradient(900px 480px at 88% 8%, rgba(37,99,235,.30), transparent 60%),
    linear-gradient(180deg, var(--navy) 0%, var(--navy-2) 100%);
}
.hero::before { /* faint grid */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px);
  background-size: 52px 52px;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 20%, transparent 100%);
          mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 20%, transparent 100%);
}
.hero::after { /* radar sweep */
  content: ""; position: absolute; width: 1400px; height: 1400px; left: 50%; top: 45%; pointer-events: none;
  transform: translate(-50%, -50%);
  background: conic-gradient(from 0deg, rgba(96,165,250,0) 0deg, rgba(96,165,250,.16) 28deg, rgba(96,165,250,0) 60deg);
  border-radius: 50%; animation: sweep 14s linear infinite; opacity: .9;
}
@keyframes sweep { to { transform: translate(-50%, -50%) rotate(360deg); } }
.hero-in { position: relative; z-index: 1; max-width: 900px; margin: 0 auto; }
.badge {
  display: inline-flex; align-items: center; padding: 7px 16px; border-radius: 999px;
  border: 1px solid rgba(255,255,255,.2); background: rgba(255,255,255,.07);
  font: 600 .76rem/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: #dbe7ff;
  margin-bottom: 28px;
}
.title {
  font-family: var(--display); font-optical-sizing: auto; font-weight: 500;
  font-size: clamp(2rem, 4.6vw, 3.6rem); line-height: 1.1; letter-spacing: -.02em;
  margin: 0 auto 34px; color: #fff;
}
.title .tline { display: block; white-space: nowrap; }
@media (max-width: 760px) { .title .tline { display: inline; white-space: normal; } }
.authors { color: #eaf0fb; font-size: 1.02rem; margin: 0 0 6px; }
.authors sup, .affils sup { color: #8fb4ff; font-size: .68em; margin-left: 1px; }
.affils { color: #9fb0ca; font-size: .9rem; margin: 0 0 34px; white-space: nowrap; }
.buttons { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }

/* ---------- teaser overlapping the hero ---------- */
.teaser { margin-top: -36px; position: relative; z-index: 2; padding-bottom: 20px; }
.visual { padding: 18px; }
.visual img { width: 100%; border-radius: 8px; }
figure { margin: 0; }
figcaption { color: var(--ink-3); font-size: .9rem; line-height: 1.6; text-align: center; margin-top: 14px; padding: 0 12px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 26px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 20px 22px; box-shadow: var(--shadow); }
.stat .num { font-family: var(--display); font-weight: 500; font-size: 2.3rem; line-height: 1; letter-spacing: -.02em; color: var(--ink); }
.stat .of { font-size: 1.15rem; color: var(--ink-3); margin-left: 2px; }
.stat .lab { font-size: .86rem; color: var(--ink-3); margin-top: 8px; line-height: 1.45; }

/* ---------- sections ---------- */
section { padding: 84px 0; }
section.alt { background: #fff; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.sec-head { text-align: center; max-width: 760px; margin: 0 auto 36px; }
.eyebrow { font: 700 .74rem/1 var(--sans); letter-spacing: .22em; text-transform: uppercase; color: var(--accent-ink); margin-bottom: 14px; }
h2 { font-family: var(--display); font-optical-sizing: auto; font-weight: 500; font-size: clamp(1.9rem, 3.4vw, 2.6rem); line-height: 1.12; letter-spacing: -.015em; margin: 0 0 14px; }
.sub { color: var(--ink-3); font-size: 1rem; margin: 0; }
.lead { font-size: 1.15rem; color: var(--ink-2); line-height: 1.6; }
.two-col { display: grid; grid-template-columns: 1.15fr .85fr; gap: 40px; align-items: start; }
.prose p { color: var(--ink-2); }
.pillars { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.pillars li { display: flex; gap: 14px; align-items: flex-start; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; box-shadow: var(--shadow); }
.pillars .ico { flex: 0 0 auto; color: var(--accent-ink); font-weight: 600; font-size: 1.05rem; line-height: 1.5; }
.pillars strong { display: block; font-size: .95rem; color: var(--ink); }
.pillars span:not(.ico) { display: block; font-size: .86rem; color: var(--ink-3); line-height: 1.5; }

/* ---------- method ---------- */
.fig { padding: 16px; }
.fig img { width: 100%; margin: 0 auto; }
.stages { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 20px; }
.stage { padding: 24px 26px 18px; position: relative; }
.stage-tag { display: inline-block; margin-bottom: 10px; padding: 5px 11px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-ink); font: 700 .72rem/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; }
.stage h3 { font-family: var(--display); font-weight: 500; font-size: 1.35rem; margin: 0 0 10px; }
.stage h3 em { font-family: var(--sans); font-style: normal; font-size: .78rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); margin-left: 10px; }
.stage p { color: var(--ink-2); font-size: .95rem; margin: 0 0 8px; }
.stage .eq { margin: 6px 0 4px; color: var(--ink); }
.katex { font-size: 1em; }
.katex-display { margin: .3em 0; overflow-x: auto; overflow-y: hidden; padding: 2px 0; }
.katex-display > .katex { white-space: nowrap; }

/* ---------- results carousel ---------- */
.tabs { display: flex; gap: 4px; justify-content: center; width: max-content; max-width: 100%; margin: 0 auto 22px; padding: 5px; border-radius: 999px; background: #e9eef6; overflow-x: auto; }
.tab { border: 0; background: transparent; padding: 9px 20px; border-radius: 999px; font: 600 .9rem var(--sans); color: var(--ink-3); cursor: pointer; white-space: nowrap; transition: background .15s ease, color .15s ease; }
.tab:hover { color: var(--ink); }
.tab.is-active { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(15,23,42,.14); }
.carousel { position: relative; }
.track { display: flex; gap: 24px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; scrollbar-width: none; position: relative; padding: 6px 2px 14px; }
.track::-webkit-scrollbar { display: none; }
.slide { flex: 0 0 100%; scroll-snap-align: start; min-width: 0; }
.tcard { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.tcard header { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 22px; border-bottom: 1px solid var(--line); }
.tcard h3 { margin: 0; font-family: var(--display); font-weight: 500; font-size: 1.4rem; }
.tcard footer { padding: 10px 22px 12px; font-size: .82rem; color: var(--ink-3); border-top: 1px solid var(--line); }
.chip { font: 600 .78rem/1 var(--sans); padding: 7px 11px; border-radius: 999px; background: #eef2f7; color: var(--ink-2); white-space: nowrap; }
.chip.win { background: var(--accent-soft); color: var(--accent-ink); }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-family: var(--sans); font-size: .88rem; font-variant-numeric: tabular-nums; }
th, td { padding: 10px 16px; text-align: right; white-space: nowrap; }
th { font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); background: #f8fafc; border-bottom: 1px solid var(--line); }
td { border-bottom: 1px solid #eef2f7; color: var(--ink-2); }
tbody tr:hover td { background: #f8fafc; }
td:first-child, th:first-child { text-align: left; padding-left: 22px; }
td:first-child { color: var(--ink); font-weight: 500; }
td:nth-child(2), th:nth-child(2) { text-align: center; color: var(--ink-3); }
tbody tr:last-child td { border-bottom: none; }
.b { font-weight: 700; color: var(--ink); }
.u { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.u-demo { text-decoration: underline; text-underline-offset: 3px; }
.ours-row td { background: var(--accent-soft); border-top: 2px solid var(--accent); color: var(--ink); }
tbody tr.ours-row:hover td { background: #e4eaf3; }
.ours-row td:first-child { font-weight: 700; color: var(--accent-ink); }
.arrow {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 3;
  width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: #fff; box-shadow: var(--shadow);
  display: grid; place-items: center; cursor: pointer; color: var(--ink);
}
.arrow:hover { background: var(--accent-soft); }
.arrow svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.arrow.prev { left: -22px; } .arrow.next { right: -22px; }
.dots { display: flex; justify-content: center; gap: 8px; margin-top: 4px; }
.dot { width: 8px; height: 8px; border-radius: 999px; background: var(--line-2); transition: width .2s ease, background .2s ease; }
.dot.is-active { width: 24px; background: var(--accent); }

sup.ref { font-size: .62em; color: var(--ink-3); margin-left: 2px; font-weight: 400; }
.refs { margin-top: 26px; }
.refs-note { text-align: center; color: var(--ink-3); font-size: .88rem; max-width: 70ch; margin: 0 auto 14px; }
.refs ol { margin: 0; padding-left: 22px; columns: 2; column-gap: 32px; font-size: .82rem; line-height: 1.5; color: var(--ink-3); }
.refs li { break-inside: avoid; margin-bottom: 6px; padding-left: 4px; }
.refs a { color: var(--ink-2); }
.refs a:hover { color: var(--accent-ink); }
@media (max-width: 760px) { .refs ol { columns: 1; } }

/* ---------- qualitative ---------- */
.qual { display: grid; gap: 24px; max-width: 1000px; margin: 0 auto; }

/* ---------- bibtex ---------- */
.cite { position: relative; padding: 0; overflow: hidden; }
pre { margin: 0; background: #0f172a; color: #e2e8f0; padding: 24px 26px; overflow-x: auto; font-family: var(--mono); font-size: .84rem; line-height: 1.7; }
.copy { position: absolute; top: 12px; right: 12px; z-index: 1; background: rgba(255,255,255,.1); color: #e2e8f0; border: 1px solid rgba(255,255,255,.18); border-radius: 999px; padding: 6px 14px; font: 600 .78rem var(--sans); cursor: pointer; }
.copy:hover { background: rgba(255,255,255,.18); }

/* ---------- footer ---------- */
.foot { background: var(--navy); color: #b9c7e2; padding: 40px 0 48px; }
.foot-in { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 28px; font-size: .9rem; }
.foot-brand { font-family: var(--display); font-size: 1.15rem; color: #fff; }
.foot-brand span { font-family: var(--sans); font-size: .76rem; letter-spacing: .12em; text-transform: uppercase; color: #8fb4ff; margin-left: 10px; }
.foot-links { margin-left: auto; display: flex; gap: 18px; }
.foot-links a { color: #e7eefc; } .foot-links span { color: #7c8aa5; }

/* ---------- reveal ---------- */
html.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity .7s ease, transform .7s ease; }
html.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
  .hero::after { animation: none; }
  .track { scroll-behavior: auto; }
}

/* ---------- responsive ---------- */
@media (max-width: 1000px) {
  .two-col { grid-template-columns: 1fr; }
  .stages { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  body { font-size: 16px; }
  .nav-links { display: none; }
  .hero { padding: 110px 20px 150px; }
  .affils { white-space: normal; }
  .teaser { margin-top: -28px; }
  .visual { padding: 10px; }
  section { padding: 60px 0; }
  .arrow { display: none; }
  .track { gap: 16px; }
  th, td { padding: 9px 12px; }
  td:first-child, th:first-child { padding-left: 16px; }
  .stage { padding: 20px 18px 14px; }
  .foot-links { margin-left: 0; }
}
@media (max-width: 480px) {
  .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat { padding: 14px 14px; }
  .stat .num { font-size: 1.8rem; }
}
