:root {
  --bg: #f6f9fc;
  --panel: #ffffff;
  --panel-soft: rgba(255, 255, 255, 0.82);
  --ink: #10182a;
  --muted: #5b667a;
  --line: rgba(31, 111, 176, 0.16);
  --blue: #2f6fb0;
  --indigo: #3457d5;
  --teal: #1e8a72;
  --cyan: #4fb3d9;
  --shadow: 0 18px 46px rgba(16, 49, 84, 0.10);
  --radius: 26px;
  --radius-sm: 16px;
  --page-max: 1200px;
  --wide-max: 1280px;
  --nav-height: 64px;
}

* { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-height) + 14px);
  /* stop Chrome's mobile font-boosting from inflating heading sizes past
     their CSS clamp() and overflowing the viewport */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  margin: 0;
  background:
    radial-gradient(circle at 8% 0, rgba(47, 111, 176, .10), transparent 28rem),
    radial-gradient(circle at 84% 4%, rgba(79, 179, 217, .12), transparent 34rem),
    linear-gradient(180deg, #f6f9fc 0%, #eef4fb 48%, #f6f9fc 100%);
  color: var(--ink);
  font-family: "Google Sans", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
}
img, video { max-width: 100%; display: block; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
p { color: var(--muted); }
.skip-link { position: absolute; left: -999px; top: 1rem; background: var(--ink); color: white; padding: .7rem 1rem; border-radius: 999px; z-index: 20; }
.skip-link:focus { left: 1rem; }

/* Nav */
.site-header { position: sticky; top: 0; z-index: 10; backdrop-filter: blur(18px); background: rgba(246, 249, 252, .86); border-bottom: 1px solid var(--line); min-height: var(--nav-height); }
.nav-shell { width: min(94vw, var(--wide-max)); margin: 0 auto; padding: .45rem 0; min-height: calc(var(--nav-height) - 3px); display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; }
.brand { display: inline-flex; align-items: center; gap: .55rem; font-weight: 860; letter-spacing: -.02em; white-space: nowrap; font-size: 1.05rem; color: var(--ink); }
.brand img { height: 26px; width: auto; }
.brand-mark { background: linear-gradient(135deg, var(--blue), var(--indigo)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.nav-links { display: flex; align-items: center; gap: .18rem; flex-wrap: wrap; justify-content: flex-end; }
.nav-links a { color: var(--muted); padding: .5rem .78rem; border-radius: 999px; font-size: .9rem; text-decoration: none; font-weight: 650; }
.nav-links a.active, .nav-links a:hover { color: var(--ink); background: rgba(47, 111, 176, .09); text-decoration: none; }
.nav-toggle { display: none; border: 0; background: white; border-radius: 12px; padding: .55rem .75rem; box-shadow: var(--shadow); cursor: pointer; }
.scroll-progress { height: 3px; background: rgba(47, 111, 176, .08); }
.scroll-progress span { display: block; width: 0; height: 100%; background: linear-gradient(90deg, var(--blue), var(--indigo), var(--cyan)); }

/* Layout helpers */
.content-grid { width: min(90vw, var(--page-max)); margin: 0 auto; }
.wide-grid { width: min(94vw, var(--wide-max)); margin: 0 auto; }
.section-pad { padding: clamp(56px, 7vh, 92px) 0; }
.site-section { position: relative; scroll-margin-top: calc(var(--nav-height) + 14px); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.5rem; }
.glass { background: var(--panel-soft); backdrop-filter: blur(18px); }
.eyebrow { color: var(--blue); text-transform: uppercase; font-size: .78rem; letter-spacing: .14em; font-weight: 860; margin: 0 0 .6rem; }
h1, h2, h3, h4 { letter-spacing: -.03em; line-height: 1.1; margin: 0 0 .75rem; color: var(--ink); }
h2 { font-size: clamp(1.9rem, 3vw, 2.7rem); }
h3 { font-size: 1.2rem; }
.section-lede, .section-heading p { font-size: clamp(1rem, 1vw, 1.12rem); max-width: 820px; margin: 0 auto .5rem; }
.section-heading { text-align: center; margin: 0 auto 2rem; max-width: 880px; }
.section-lede, .table-note {
  text-align: justify;
  text-align-last: left;
  hyphens: auto;
  -webkit-hyphens: auto;
}

/* Hero */
.hero { position: relative; overflow: hidden; padding-top: clamp(2.5rem, 6vh, 4.5rem); padding-bottom: clamp(2rem, 4vh, 3rem); }
.hero-bg { position: absolute; inset: 0; background: radial-gradient(circle at 12% 40%, rgba(47, 111, 176, .14), transparent 30rem), radial-gradient(circle at 86% 30%, rgba(79, 179, 217, .16), transparent 34rem); pointer-events: none; }
.hero-shell { position: relative; width: min(92vw, var(--wide-max)); margin: 0 auto; text-align: center; }
.hero h1 { font-size: clamp(1.9rem, 3.6vw, 2.85rem); max-width: 920px; margin: 0 auto .9rem; }
.hero .authors { font-size: 1.08rem; margin: 0 auto .4rem; max-width: 760px; }
.hero .authors a { color: var(--ink); font-weight: 700; }
.hero .affiliations { color: var(--muted); font-size: 1rem; margin-bottom: .2rem; }
.hero .footnote { color: #8b93a3; font-size: .88rem; margin-bottom: 1.1rem; }
.hero-logo { margin: 1rem auto 1.4rem; }
.hero-logo img { height: 72px; width: auto; margin: 0 auto; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; justify-content: center; margin-top: .5rem; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 2.6rem; padding: .7rem 1.25rem; border-radius: 999px; border: 1px solid rgba(47, 111, 176, .22); background: white; color: var(--ink); font-weight: 750; cursor: pointer; transition: transform .18s ease, box-shadow .18s ease, background .18s ease; text-decoration: none; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 12px 30px rgba(16, 49, 84, .14); text-decoration: none; }
.btn.primary { color: white; background: linear-gradient(135deg, var(--blue), var(--indigo)); border-color: transparent; }
.btn .icon { display: inline-flex; font-size: 1.02em; }
.btn.btn-disabled { color: var(--muted); background: rgba(16, 49, 84, .04); border-color: rgba(16, 49, 84, .12); cursor: not-allowed; }
.btn.btn-disabled:hover { transform: none; box-shadow: none; }
.btn.btn-disabled .badge-soon { font-size: .72rem; font-weight: 700; letter-spacing: .02em; color: var(--muted); background: rgba(16, 49, 84, .08); border-radius: 999px; padding: .18rem .55rem; margin-left: .15rem; }

.hero-visual { margin-top: clamp(2rem, 4vh, 3rem); }
.hero-visual figure { padding: .85rem; overflow: hidden; }
.hero-visual img { width: 100%; border-radius: 18px; }
.hero-visual figcaption { color: var(--muted); font-size: .95rem; padding: .9rem .5rem .2rem; text-align: center; }

/* Metric chips */
.metric-chips { display: flex; flex-wrap: wrap; gap: .55rem; margin: 1.1rem 0 0; justify-content: center; }
.metric-chips span { border: 1px solid rgba(47, 111, 176, .18); background: rgba(255, 255, 255, .78); color: #354055; padding: .5rem .85rem; border-radius: 999px; font-weight: 700; font-size: .92rem; }

/* Overview / contribution cards */
.overview-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin-top: 2rem; }
.overview-cards .card { text-align: center; display: flex; flex-direction: column; align-items: center; }
.overview-cards .card-icon { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; font-size: 1.35rem; margin-bottom: .9rem; color: white; }
.overview-cards h3 { font-size: 1.02rem; margin-bottom: .5rem; }
.overview-cards p {
  font-size: .92rem;
  align-self: stretch;
  text-align: justify;
  text-align-last: left;
  hyphens: auto;
  -webkit-hyphens: auto;
}

/* Method */
.pipeline-figure { padding: 1rem; overflow: hidden; margin: 2rem 0 0; }
.pipeline-figure img { width: 100%; max-width: 1180px; margin: 0 auto; background: white; border-radius: 16px; }
.pipeline-figure figcaption { color: var(--muted); font-size: .92rem; padding: 1rem .5rem 0; text-align: justify; text-align-last: left; hyphens: auto; }

.theorem-card { margin-top: 1.75rem; border-left: 5px solid var(--teal); text-align: left; }
.theorem-card .theorem-title { font-size: 1.08rem; font-weight: 800; margin-bottom: .6rem; display: flex; align-items: center; gap: .5rem; color: var(--teal); }
.theorem-card p { text-align: justify; text-align-last: left; hyphens: auto; margin: 0 0 .75rem; color: var(--ink); opacity: .88; }
.theorem-card p:last-child { margin-bottom: 0; }

.limitation-card { margin-top: 1.5rem; border-left: 5px solid #c0392b; text-align: left; }
.limitation-card .theorem-title { font-size: 1.08rem; font-weight: 800; margin-bottom: .6rem; display: flex; align-items: center; gap: .5rem; color: #c0392b; }
.limitation-card p { text-align: justify; text-align-last: left; hyphens: auto; margin: 0 0 1rem; color: var(--ink); opacity: .88; }
.limitation-card figure { margin: 0; }
.limitation-card img { width: 100%; max-width: 560px; display: block; margin: 0 auto; border-radius: 14px; box-shadow: var(--shadow); }
.limitation-card figcaption { text-align: center; color: var(--muted); font-size: .88rem; margin-top: .6rem; }

.draft-note { margin: .9rem auto 0; max-width: 640px; font-size: .88rem; color: var(--muted); background: rgba(192, 57, 43, .07); border: 1px solid rgba(192, 57, 43, .18); border-radius: 999px; padding: .5rem 1.1rem; }
.draft-note strong { color: #c0392b; }

.two-col-figures { display: grid; grid-template-columns: 5fr 7fr; gap: 1.25rem; margin-top: 1.75rem; align-items: start; }
.two-col-figures figure { margin: 0; }
.two-col-figures img { width: 100%; border-radius: 16px; box-shadow: var(--shadow); }
.two-col-figures figcaption { text-align: center; color: var(--muted); font-size: .92rem; margin-top: .6rem; }

/* Galleries */
.gallery-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.1rem; margin-top: 1.75rem; }
.gallery-grid figure { margin: 0; }
.gallery-grid img { width: 100%; border-radius: 16px; box-shadow: var(--shadow); background: white; }
.gallery-grid figcaption { text-align: center; color: var(--muted); font-size: .92rem; margin-top: .6rem; }
.gallery-grid .span-2 { grid-column: span 2; }

/* Table */
.table-card { margin-top: 1.5rem; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .93rem; }
th, td { padding: .68rem .7rem; border-bottom: 1px solid var(--line); text-align: center; }
th:first-child, td:first-child { text-align: left; }
/* no text-transform here: several headers are MathJax-rendered Greek letters
   ($\gamma^\star$, $\mu$-steps), and uppercasing mangles them into different
   symbols (mu -> a capital-M-like glyph, gamma -> Gamma) */
th { color: var(--muted); font-size: .78rem; font-weight: 700; letter-spacing: .03em; }
tr.highlight-row td { color: var(--blue); font-weight: 800; background: rgba(47, 111, 176, .05); }
.table-note { color: var(--muted); font-size: .88rem; margin-top: 1rem; }
.diverge { color: #c0392b; font-weight: 700; }

/* Citation */
.citation-card { margin-top: 1.5rem; }
.citation-card pre { margin: 0; white-space: pre-wrap; word-break: break-word; background: #10182a; color: #eef4fb; border-radius: 16px; padding: 1.25rem; overflow: auto; font-size: .88rem; line-height: 1.6; }

.site-footer { border-top: 1px solid var(--line); padding: 2rem 0; color: var(--muted); text-align: center; font-size: .92rem; }
.site-footer a { color: var(--muted); text-decoration: underline; }

@media (max-width: 980px) {
  .overview-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .two-col-figures { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .content-grid, .wide-grid, .hero-shell, .nav-shell { width: min(94vw, var(--page-max)); }
  .section-pad { padding: 3rem 0; }
  .nav-toggle { display: inline-flex; }
  .nav-links { display: none; position: absolute; left: 3vw; right: 3vw; top: 4.2rem; padding: .8rem; background: rgba(255, 255, 255, .97); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); flex-direction: column; align-items: stretch; }
  .nav-links.open { display: flex; }
  .nav-links a { text-align: center; }
  .overview-cards { grid-template-columns: 1fr; }
  .gallery-grid { grid-template-columns: 1fr; }
  .gallery-grid .span-2 { grid-column: span 1; }
}
