/* ===========================================================
   SuRe project page
   palette: blue -> violet -> pink (matches the logo)
   =========================================================== */

:root {
  --g1: #2f6fed;
  --g2: #7b3ff2;
  --g3: #e0457b;
  --grad: linear-gradient(100deg, var(--g1) 0%, var(--g2) 52%, var(--g3) 100%);
  --grad-soft: linear-gradient(100deg, rgba(47, 111, 237, .12), rgba(123, 63, 242, .12) 52%, rgba(224, 69, 123, .12));

  --ink: #10151c;
  --ink-2: #2b3442;
  --muted: #5b6675;
  --line: #e5e9f0;
  --bg: #fbfcfe;
  --card: #ffffff;
  --shadow-sm: 0 1px 2px rgba(16, 21, 28, .04), 0 4px 14px rgba(16, 21, 28, .05);
  --shadow-md: 0 10px 34px rgba(16, 21, 28, .08);
  --radius: 18px;
  --maxw: 1080px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 84px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Helvetica, Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--g1); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { width: min(var(--maxw), calc(100% - 48px)); margin: 0 auto; }

.grad-text {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: saturate(180%) blur(14px);
  background: rgba(251, 252, 254, .82);
  border-bottom: 1px solid transparent;
  transition: border-color .25s ease, box-shadow .25s ease;
}
.nav.is-stuck { border-bottom-color: var(--line); box-shadow: 0 6px 24px rgba(16, 21, 28, .05); }

.nav-inner {
  display: flex; align-items: center; gap: 18px;
  height: 64px;
}
.nav-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -.01em; color: var(--ink); }
.nav-brand:hover { text-decoration: none; }
.nav-brand img { width: 30px; height: 30px; object-fit: contain; }

.nav-links { display: flex; gap: 22px; margin-left: auto; }
.nav-links a { color: var(--muted); font-size: 14.5px; font-weight: 500; position: relative; }
.nav-links a:hover { color: var(--ink); text-decoration: none; }
.nav-links a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 2px;
  background: var(--grad); border-radius: 2px; transform: scaleX(0); transform-origin: left;
  transition: transform .22s ease;
}
.nav-links a:hover::after, .nav-links a.is-active::after { transform: scaleX(1); }
.nav-links a.is-active { color: var(--ink); }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px; border-radius: 999px;
  font-size: 14.5px; font-weight: 600; line-height: 1;
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  box-shadow: var(--shadow-sm); transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); box-shadow: var(--shadow-md); border-color: #d7dde8; }
.btn-primary { background: var(--grad); border: none; color: #fff; box-shadow: 0 8px 22px rgba(123, 63, 242, .28); }
.btn-primary:hover { box-shadow: 0 12px 28px rgba(123, 63, 242, .34); }

@media (max-width: 780px) {
  .nav-links { display: none; }
}

/* ---------- hero ---------- */
.hero { position: relative; padding: 64px 0 8px; overflow: hidden; }
.hero::before, .hero::after {
  content: ""; position: absolute; z-index: -1; border-radius: 50%; filter: blur(70px); opacity: .5;
}
.hero::before { width: 520px; height: 520px; left: -180px; top: -160px; background: radial-gradient(circle, rgba(47,111,237,.35), transparent 65%); }
.hero::after { width: 560px; height: 560px; right: -200px; top: -80px; background: radial-gradient(circle, rgba(224,69,123,.28), transparent 65%); }

.hero-inner { text-align: center; }

.eyebrow-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px; border-radius: 999px; font-size: 13.5px; font-weight: 600;
  color: var(--g2); background: var(--grad-soft); border: 1px solid rgba(123, 63, 242, .16);
}

h1.title {
  margin: 6px auto 0; max-width: 980px;
  font-size: clamp(34px, 5.4vw, 62px); line-height: 1.1; letter-spacing: -.025em; font-weight: 800;
}
.subtitle {
  margin: 14px auto 0; max-width: 860px;
  font-size: clamp(18px, 2.2vw, 25px); font-weight: 600; color: var(--ink-2); letter-spacing: -.01em;
}
.tagline {
  margin: 18px auto 0; max-width: 1060px;
  font-size: clamp(13.5px, 1.3vw, 18px);
  font-weight: 500; letter-spacing: -.005em;
  white-space: nowrap;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
@media (max-width: 900px) {
  .tagline { white-space: normal; font-size: 14px; max-width: 92%; line-height: 1.55; }
}

.authors { margin: 26px auto 0; max-width: 900px; font-size: 16.5px; font-weight: 600; color: var(--ink); }
.authors .sep { color: #c3cad6; margin: 0 6px; font-weight: 400; }
sup { font-size: 68%; line-height: 0; }
.affils { margin-top: 10px; color: var(--muted); font-size: 14.5px; }
.affils span { display: inline-block; margin: 0 10px; }
.notes { margin-top: 8px; color: #7b8595; font-size: 13px; }

.cta { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 26px; }

.hero-figure { margin: 44px auto 0; }

/* ---------- stats ---------- */
.stats {
  margin: 54px auto 0; display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.stat {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 20px 18px; text-align: center; box-shadow: var(--shadow-sm);
}
.stat b { display: block; font-size: 30px; letter-spacing: -.02em; line-height: 1.15; }
.stat span { display: block; margin-top: 6px; color: var(--muted); font-size: 13.5px; }
@media (max-width: 780px) { .stats { grid-template-columns: repeat(2, 1fr); } }

/* ---------- sections ---------- */
section.block { padding: 92px 0 8px; }
.section-head { max-width: 820px; }
.kicker {
  display: flex; align-items: center; gap: 12px;
  font-size: 13px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted);
}
.kicker i { font-style: normal; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.kicker::after { content: ""; flex: 1; height: 1px; background: var(--line); }

h2.section-title {
  margin: 14px 0 0; font-size: clamp(26px, 3.4vw, 38px); line-height: 1.2;
  letter-spacing: -.02em; font-weight: 800;
}
.section-lead { margin: 14px 0 0; color: var(--muted); font-size: 17px; max-width: 780px; }

/* ---------- cards ---------- */
.grid { display: grid; gap: 18px; margin-top: 34px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 900px) { .grid-3 { grid-template-columns: 1fr; } .grid-2 { grid-template-columns: 1fr; } }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px 24px; box-shadow: var(--shadow-sm);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: #dbe2ee; }
.card h3 { margin: 0 0 8px; font-size: 18.5px; letter-spacing: -.01em; }
.card p { margin: 0; color: var(--muted); font-size: 15.5px; }
.card .tag {
  display: inline-block; margin-bottom: 12px; padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--g2); background: var(--grad-soft);
}
.card code, .eq code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .92em; }

.eq {
  margin-top: 16px; padding: 14px 16px; border-radius: 12px;
  background: #f6f8fc; border: 1px solid #e8edf6;
  font-family: "Times New Roman", Times, Georgia, serif;
  font-style: normal; font-size: 17px; color: #2b3442; overflow-x: auto; white-space: nowrap;
  letter-spacing: .01em; text-align: center;
}

/* ---------- figures ---------- */
figure { margin: 0; }
.fig { margin-top: 40px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow-sm); }
.fig img { border-radius: 10px; }
figcaption { margin-top: 14px; color: var(--muted); font-size: 14px; line-height: 1.6; }
figcaption b { color: var(--ink-2); }

.scroller { overflow-x: auto; }
.scroller img { min-width: 720px; }

/* ---------- table ---------- */
.table-wrap { margin-top: 34px; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow-sm); }
table { border-collapse: collapse; width: 100%; font-size: 15px; }
th, td { padding: 13px 16px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-size: 14px; letter-spacing: .02em; font-weight: 600; color: var(--muted); background: #f8fafd; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: #fafbfe; }
td.best { font-weight: 700; color: var(--g2); }
td.num, th.num { text-align: right; }
.table-note { margin-top: 12px; color: var(--muted); font-size: 13.5px; }

/* ---------- citation ---------- */
.cite-card { margin-top: 30px; position: relative; background: #0f1722; color: #dbe4f0; border-radius: var(--radius); padding: 22px 24px; overflow: hidden; }
.cite-card pre { margin: 0; overflow-x: auto; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13.5px; line-height: 1.7; color: #cfe0ff; }
.copy-btn {
  position: absolute; top: 14px; right: 14px; padding: 6px 12px; border-radius: 999px;
  border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.06); color: #dbe4f0;
  font-size: 12.5px; font-weight: 600; cursor: pointer;
}
.copy-btn:hover { background: rgba(255,255,255,.12); }

/* ---------- footer ---------- */
footer { margin-top: 96px; padding: 34px 0 46px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between; }
.footer-links { display: flex; gap: 18px; }

/* ---------- reveal ---------- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
.reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---------- abstract band ---------- */
.abstract-band {
  margin-top: 54px; padding: 30px 32px; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.abstract-title {
  margin: 0 0 10px; font-size: 13px; letter-spacing: .16em; text-transform: uppercase;
  color: transparent; background: var(--grad); -webkit-background-clip: text; background-clip: text;
}
.abstract-band p { margin: 0; color: var(--ink-2); font-size: 16px; }
.abstract-band b { color: var(--ink); }

/* ---------- wide / narrow figures ---------- */
.fig-wide {
  width: min(1280px, calc(100vw - 40px));
  max-width: none;
  margin-left: calc((100% - min(1280px, 100vw - 40px)) / 2);
}
@media (max-width: 1180px) {
  .fig-wide { width: auto; margin-left: 0; }
}
.fig-narrow { max-width: 660px; margin-left: auto; margin-right: auto; }
.fig-narrow img { margin: 0 auto; }

@media (max-width: 1320px) {
  .fig-wide { width: calc(100vw - 40px); }
}

/* ---------- affiliations: one per line ---------- */
.affils-col span { display: block; margin: 2px 0; }

/* ---------- university emblems in the nav ---------- */
.nav-unis { display: inline-flex; align-items: center; gap: 10px; margin-left: 4px; padding-left: 14px; border-left: 1px solid var(--line); }
.nav-unis img { height: 26px; width: auto; opacity: .85; transition: opacity .18s ease; }
.nav-unis img:hover { opacity: 1; }
@media (max-width: 780px) { .nav-unis { display: none; } }

/* ---------- smoother scrolling: progress bar, parallax, staggers ---------- */
.scroll-progress {
  position: fixed; inset: 0 auto auto 0; height: 3px; width: 100%;
  transform: scaleX(0); transform-origin: 0 50%;
  background: var(--grad); z-index: 70; pointer-events: none;
  will-change: transform;
}

.hero { --shift: 0px; }
.hero::before { transform: translate3d(0, calc(var(--shift) * -.12), 0); }
.hero::after  { transform: translate3d(0, calc(var(--shift) * -.18), 0); }
.hero-inner { will-change: transform; }

.reveal { transition: opacity .7s cubic-bezier(.22,.61,.36,1), transform .7s cubic-bezier(.22,.61,.36,1); }

img { height: auto; }

@media (prefers-reduced-motion: reduce) {
  .scroll-progress { display: none; }
  .hero::before, .hero::after { transform: none; }
}
