/* ============================================================
   GenMed — project page
   Clean academic style inspired by the Nerfies template
   ============================================================ */

:root {
  --ink:        #15202b;
  --ink-soft:   #3b4754;
  --muted:      #6b7785;
  --line:       #e6e9ee;
  --bg:         #ffffff;
  --bg-soft:    #f6f8fb;
  --bg-warm:    #fff7f0;
  --accent:     #0e7490;   /* deep teal */
  --accent-2:   #2563eb;   /* blue */
  --accent-ink: #0b5566;
  --warm:        #f08a4b;
  --warm-soft:   #fde8d2;
  --shape-blue: #3b82f6;
  --radius:     14px;
  --maxw:       1040px;
  --shadow:     0 1px 2px rgba(16,24,40,.04), 0 8px 28px rgba(16,24,40,.07);
  --shadow-sm:  0 1px 2px rgba(16,24,40,.05), 0 2px 8px rgba(16,24,40,.05);
  --serif: "Source Serif 4", "Newsreader", Georgia, "Times New Roman", serif;
  --sans:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono:  "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.container.narrow { max-width: 900px; }

/* ----------------------------- nav ----------------------------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  background: rgba(255,255,255,.76);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid rgba(230,233,238,.72);
}
.nav .container {
  display: flex; align-items: center; justify-content: space-between;
  height: 58px;
}
.nav__brand { font-weight: 700; letter-spacing: -.01em; color: var(--ink); }
.nav__brand span { color: var(--accent); }
.nav__links { display: flex; gap: 22px; }
.nav__links a { color: var(--ink-soft); font-size: 14.5px; font-weight: 500; }
.nav__links a:hover { color: var(--accent); text-decoration: none; }
@media (max-width: 720px){ .nav__links { display: none; } }

/* ----------------------------- hero ----------------------------- */
.hero { padding: 64px 0 26px; text-align: center; }
.headline {
  position: relative;
  overflow: hidden;
  padding-top: 98px;
  padding-bottom: 42px;
  background:
    linear-gradient(180deg, #f5fbfd 0%, #fff8f2 68%, #fff 100%);
  border-bottom: 1px solid rgba(230,233,238,.82);
}
.headline::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(14,116,144,.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(14,116,144,.07) 1px, transparent 1px),
    linear-gradient(115deg, transparent 0 45%, rgba(240,138,75,.08) 46%, transparent 48% 100%);
  background-size: 34px 34px, 34px 34px, 180px 180px;
  mask-image: linear-gradient(180deg, rgba(0,0,0,.85), rgba(0,0,0,.22) 68%, transparent);
  pointer-events: none;
}
.headline::after {
  content: "";
  position: absolute;
  top: -15%;
  bottom: -15%;
  left: -35%;
  width: 42%;
  background: linear-gradient(90deg, transparent, rgba(14,116,144,.12), transparent);
  transform: skewX(-18deg);
  animation: heroScan 8s linear infinite;
  pointer-events: none;
}
.headline .container { position: relative; z-index: 1; }
@keyframes heroScan {
  from { left: -42%; }
  to { left: 118%; }
}
.title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(30px, 5vw, 50px);
  line-height: 1.12;
  letter-spacing: -.015em;
  margin: 0 0 8px;
  color: var(--ink);
}
.subtitle {
  font-size: clamp(17px, 2.4vw, 21px);
  color: var(--ink-soft);
  max-width: 760px; margin: 6px auto 30px;
  font-weight: 400;
}

.authors {
  max-width: 820px; margin: 0 auto 6px;
  font-size: 18px; color: var(--ink);
}
.authors a { color: var(--ink); font-weight: 500; }
.authors a:hover { color: var(--accent); }
.authors .sep { color: var(--muted); }
.authors sup { color: var(--accent); font-weight: 600; }
.eq { font-size: 14px; color: var(--muted); margin: 4px auto 2px; }
.affil {
  max-width: 820px; margin: 14px auto 6px;
  font-size: 15px; color: var(--muted); line-height: 1.7;
}
.affil sup { color: var(--accent); font-weight: 600; }
.corr { font-size: 14px; color: var(--muted); margin-top: 4px; }
.corr a { color: var(--accent); }

/* link buttons */
.links { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin: 30px auto 0; }
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  background: var(--ink); color: #fff;
  padding: 11px 20px; border-radius: 999px;
  font-size: 15px; font-weight: 600; letter-spacing: .01em;
  border: 1px solid var(--ink);
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.btn:hover { color: #fff; text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow-sm); background: #20303f; }
.btn .ic { width: 17px; height: 17px; display: inline-block; }
.btn--ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { background: var(--bg-soft); color: var(--ink); }
.btn--soon { background: #fff; color: var(--muted); border-color: var(--line); cursor: default; }
.btn--soon:hover { transform: none; box-shadow: none; background: #fff; color: var(--muted); }
.btn--soon .tag { font-size: 11px; background: var(--bg-soft); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; color: var(--muted); }
/* ----------------------------- teaser ----------------------------- */
.teaser { padding-top: 28px; }
.teaser .fig { box-shadow: none; border-color: transparent; padding: 0; background: transparent; }
.teaser .fig img { border-radius: 8px; box-shadow: var(--shadow); }
.teaser .fig figcaption { max-width: 940px; margin: 18px auto 0; text-align: justify; }

/* ----------------------------- sections ----------------------------- */
section { padding: 48px 0; }
.section--soft { background: var(--bg-soft); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.eyebrow {
  text-align: center; font-size: 13px; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--accent); margin: 0 0 8px;
}
.h2 {
  font-family: var(--serif); font-weight: 600;
  font-size: clamp(24px, 3.4vw, 33px); text-align: center;
  letter-spacing: -.01em; margin: 0 0 10px; color: var(--ink);
}
.lead {
  max-width: 760px; margin: 0 auto 30px; text-align: center;
  color: var(--ink-soft); font-size: 17px;
}

.prose { max-width: 780px; margin: 0 auto; }
.prose p { margin: 0 0 18px; color: var(--ink-soft); }
.prose strong { color: var(--ink); }

.summary-block {
  max-width: 830px;
  margin: 0 auto;
  color: var(--ink-soft);
  font-size: 18px;
  text-align: justify;
}
.summary-block p { margin: 0; }
.metric-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  max-width: 940px;
  margin: 28px auto 30px;
}
.metric-strip div {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 14px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}
.metric-strip b {
  display: block;
  font-family: var(--serif);
  font-size: 30px;
  line-height: 1;
  color: var(--accent);
  margin-bottom: 8px;
}
.metric-strip span {
  display: block;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.35;
}
.overview-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin: 8px auto 28px;
}
.overview-card {
  display: block;
  min-height: 170px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 18px;
  color: var(--ink);
  box-shadow: var(--shadow-sm);
  transition: transform .14s ease, border-color .14s ease, box-shadow .14s ease;
}
.overview-card:hover {
  transform: translateY(-3px);
  text-decoration: none;
  border-color: #b8dce4;
  box-shadow: var(--shadow);
}
.overview-card span {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
}
.overview-card h3 {
  margin: 8px 0 8px;
  font-size: 18px;
  color: var(--ink);
}
.overview-card p {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--muted);
}
.abstract-details {
  max-width: 860px;
  margin: 0 auto;
  border: 1px solid rgba(14,116,144,.18);
  border-radius: var(--radius);
  background: rgba(255,255,255,.72);
  overflow: hidden;
}
.abstract-details summary {
  cursor: pointer;
  padding: 13px 18px;
  color: var(--accent-ink);
  font-weight: 700;
}
.abstract-details .prose { padding: 4px 22px 18px; }

.subsection {
  margin-top: 46px;
  padding-top: 38px;
  border-top: 1px solid var(--line);
}
.subhead {
  font-family: var(--serif);
  font-size: clamp(22px, 3vw, 29px);
  font-weight: 600;
  margin: 0 0 10px;
  text-align: center;
  color: var(--ink);
}
.prompt-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.prompt-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 18px;
  box-shadow: var(--shadow-sm);
}
.prompt-card span {
  display: inline-block;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-ink);
  background: #e8f4f7;
  border: 1px solid #cfe7ee;
  border-radius: 999px;
  padding: 4px 10px;
  margin-bottom: 12px;
}
.prompt-card p {
  margin: 0;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.5;
}

/* figures */
figure { margin: 0; }
.fig {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; box-shadow: var(--shadow); margin: 0 auto;
}
.fig img { display: block; width: 100%; height: auto; border-radius: 6px; }
.fig figcaption, .cap {
  margin-top: 14px; font-size: 14.5px; color: var(--muted); line-height: 1.6;
  padding: 0 6px;
}
.cap b, .fig figcaption b { color: var(--ink-soft); }
.fig--zoom img { cursor: zoom-in; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
@media (max-width: 820px){ .grid-2 { grid-template-columns: 1fr; } }
@media (max-width: 900px){
  .metric-strip,
  .overview-grid,
  .prompt-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px){
  .metric-strip,
  .overview-grid,
  .prompt-grid { grid-template-columns: 1fr; }
  .headline { padding-top: 88px; }
}

/* highlight stat cards */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin: 8px auto 0; max-width: 920px; }
@media (max-width: 820px){ .stats { grid-template-columns: repeat(2, 1fr); } }
.stat {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 16px; text-align: center; box-shadow: var(--shadow-sm);
}
.stat__num { font-family: var(--serif); font-size: 30px; font-weight: 600; color: var(--accent); line-height: 1; }
.stat__num small { font-size: 16px; color: var(--accent-2); font-weight: 600; }
.stat__num .plus { font-size: 20px; color: var(--accent-2); font-weight: 700; vertical-align: 3px; margin-right: 1px; }
.stat__lbl { margin-top: 8px; font-size: 13.5px; color: var(--muted); line-height: 1.4; }

/* tables */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
table.res {
  width: 100%; border-collapse: collapse; font-size: 14.5px; background: #fff; min-width: 520px;
}
table.res caption {
  caption-side: top; text-align: left; padding: 14px 16px 10px;
  font-size: 14px; color: var(--muted); font-weight: 500;
}
table.res th, table.res td { padding: 10px 14px; text-align: center; border-bottom: 1px solid var(--line); }
table.res thead th { background: var(--bg-soft); color: var(--ink); font-weight: 600; font-size: 13.5px; }
table.res tbody th { text-align: left; font-weight: 500; color: var(--ink-soft); }
table.res td.best, table.res th.best { color: var(--accent); font-weight: 700; }
table.res tr.ours { background: #f2f9fb; }
table.res tr.ours th { color: var(--accent-ink); font-weight: 700; }
.tnote { font-size: 13px; color: var(--muted); margin: 10px 2px 0; }

/* feature list */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 8px; }
@media (max-width: 820px){ .features { grid-template-columns: 1fr; } }
.feature {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow-sm);
}
.feature h3 { margin: 0 0 8px; font-size: 17px; color: var(--ink); }
.feature p { margin: 0; font-size: 15px; color: var(--muted); }
.feature .kicker { font-family: var(--serif); font-size: 22px; color: var(--accent); display: block; margin-bottom: 6px; }

/* bibtex */
.bibtex {
  background: #0f1b24; color: #d7e3ea; border-radius: var(--radius);
  padding: 22px 24px; overflow-x: auto; font-family: var(--mono);
  font-size: 13.5px; line-height: 1.7; box-shadow: var(--shadow);
}
.bibtex .k { color: #7fd1de; }
.bibtex .f { color: #9fb3c0; }
.copy-row { display: flex; justify-content: flex-end; margin-bottom: 10px; }
.copy-btn {
  font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer;
  background: #fff; border: 1px solid var(--line); color: var(--ink-soft);
  padding: 7px 14px; border-radius: 8px;
}
.copy-btn:hover { background: var(--bg-soft); }

/* ----------------------------- carousel ----------------------------- */
.carousel {
  position: relative; background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
}
.carousel__viewport { overflow: hidden; }
.carousel__track { display: flex; transition: transform .5s cubic-bezier(.4,0,.2,1); will-change: transform; }
.slide {
  flex: 0 0 100%; min-width: 100%; margin: 0; padding: 20px 22px 10px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.slide img {
  display: block; border-radius: 6px; cursor: zoom-in; background: #f0f2f5;
  max-width: 100%; width: auto; max-height: 64vh; margin: 0 auto;
}
.slide figcaption {
  margin-top: 14px; font-size: 14.5px; color: var(--muted); line-height: 1.6;
  text-align: center; padding: 0 8px 6px; min-height: 44px;
}
.slide figcaption b { color: var(--ink-soft); }
.carousel__btn {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 46px; height: 46px; border-radius: 999px; border: 1px solid var(--line);
  background: rgba(255,255,255,.92); color: var(--ink); font-size: 26px; line-height: 1;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-sm); z-index: 4; transition: background .12s ease, transform .12s ease;
}
.carousel__btn:hover { background: #fff; transform: translateY(-50%) scale(1.06); }
.carousel__btn--prev { left: 16px; }
.carousel__btn--next { right: 16px; }
.carousel__counter {
  position: absolute; top: 16px; right: 18px; z-index: 4;
  font-size: 12.5px; color: var(--muted); background: rgba(255,255,255,.92);
  border: 1px solid var(--line); padding: 3px 10px; border-radius: 999px;
}
.carousel__dots { display: flex; gap: 9px; justify-content: center; margin-top: 18px; }
.dot {
  width: 9px; height: 9px; border-radius: 999px; background: var(--line);
  border: 0; padding: 0; cursor: pointer; transition: background .15s ease, transform .15s ease;
}
.dot.active { background: var(--accent); transform: scale(1.3); }
@media (max-width: 640px){
  .carousel__btn { width: 38px; height: 38px; font-size: 21px; }
  .carousel__btn--prev { left: 8px; } .carousel__btn--next { right: 8px; }
  .slide { padding: 14px 14px 6px; }
}

/* ----------------------------- 3D comparison ----------------------------- */
.seg { display: flex; flex-wrap: wrap; gap: 9px; justify-content: center; margin: 0 auto 26px; }
.seg button {
  font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
  background: #fff; border: 1px solid var(--line); color: var(--ink-soft);
  padding: 8px 15px; border-radius: 999px; transition: all .14s ease;
}
.seg button small { display: block; font-size: 11.5px; font-weight: 500; color: var(--muted); margin-top: 1px; }
.seg button:hover { border-color: #cdd5dd; background: var(--bg-soft); }
.seg button.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.seg button.active small { color: rgba(255,255,255,.85); }

.mv-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 900px){ .mv-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px){ .mv-grid { grid-template-columns: 1fr; } }

.mv-col {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow-sm);
}
.mv-col.is-ours { border-color: #bfe3d8; box-shadow: 0 0 0 2px #d7f0e8, var(--shadow-sm); }
/* single-line header so all four columns align at the top (no wrap) */
.mv-col__head {
  display: flex; align-items: center; gap: 7px; justify-content: center; flex-wrap: nowrap;
  height: 44px; padding: 0 10px; font-size: 13px; font-weight: 600; color: var(--ink-soft);
  border-bottom: 1px solid var(--line); background: var(--bg-soft);
}
.mv-col.is-ours .mv-col__head { color: var(--accent-ink); background: #f1faf7; }
.mv-dot { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 auto; }
.mv-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
model-viewer { width: 100%; height: 230px; display: block; background: #f7f9fb; --poster-color: transparent; }
.mv-empty {
  width: 100%; height: 230px; display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 13px; background: #f7f9fb; text-align: center; padding: 0 14px;
}
/* fixed-height footer so columns also align at the bottom */
.mv-foot {
  height: 62px; border-top: 1px solid var(--line); background: var(--bg-soft);
  display: flex; align-items: center; justify-content: center; padding: 8px 10px;
}
.mv-foot-label { font-size: 12.5px; color: var(--muted); }
.mv-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; width: 100%; }
.mv-metric { text-align: center; line-height: 1.2; }
.mv-metric .l { display: block; font-size: 10px; color: var(--muted); letter-spacing: .02em; }
.mv-metric .v { font-size: 15px; font-weight: 700; color: var(--ink); }
.mv-metric .v.win { color: var(--accent); }
.mv-metric .v.lose { color: #b06a5e; }
/* prompt colour legend */
.mv-legend { display: flex; gap: 20px; flex-wrap: wrap; justify-content: center; margin-top: 18px; font-size: 13px; color: var(--ink-soft); }
.mv-legend span { display: inline-flex; align-items: center; gap: 7px; }
.mv-legend .sw { width: 13px; height: 13px; border-radius: 3px; display: inline-block; }
.mv-hint { text-align: center; color: var(--muted); font-size: 13px; margin-top: 14px; }

/* footer */
footer { padding: 40px 0 60px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
footer .container { text-align: center; }
footer a { color: var(--accent); }

/* lightbox */
.lb {
  position: fixed; inset: 0; background: rgba(8,12,16,.86); z-index: 100;
  display: none; align-items: center; justify-content: center; padding: 32px;
  cursor: zoom-out;
}
.lb.open { display: flex; }
.lb img { max-width: 96vw; max-height: 92vh; border-radius: 8px; box-shadow: 0 20px 60px rgba(0,0,0,.5); }

/* misc */
.divider-note { text-align: center; color: var(--muted); font-size: 14px; margin-top: 26px; }
hr.soft { border: 0; border-top: 1px solid var(--line); margin: 36px 0; }
