/* ============================================================
   E2HiL — project page styles
   Design language shared with the UniIntervene page,
   retuned to a blue -> cyan identity for E2HiL.
   ============================================================ */

:root {
  --blue-50:  #eff5ff;
  --blue-100: #dceafe;
  --blue-200: #bfd6fe;
  --blue-300: #93bafd;
  --blue-400: #609afa;
  --blue-500: #3b82f6;
  --blue-600: #2563eb;
  --blue-700: #1d4ed8;
  --blue-800: #1e3a8a;

  --cyan:      #0891b2;
  --cyan-500:  #06b6d4;
  --cyan-soft: #d5f5fb;

  --ink:      #0f1729;
  --ink-soft: #43506b;
  --ink-mute: #7a869c;

  --bg:       #ffffff;
  --bg-soft:  #f5f9ff;
  --line:     #e5ecf8;

  --radius:   18px;
  --radius-sm:12px;
  --shadow-sm: 0 2px 10px rgba(30, 58, 138, .06);
  --shadow:    0 14px 40px rgba(30, 58, 138, .10);
  --shadow-lg: 0 28px 70px rgba(30, 58, 138, .16);

  --font-head: "Space Grotesk", "Inter", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, video { max-width: 100%; display: block; }
a { color: var(--blue-600); text-decoration: none; }
a:hover { color: var(--blue-700); }

.container { width: min(1140px, 92vw); margin-inline: auto; }
.narrow { width: min(820px, 92vw); }

/* ---------------- NAV ---------------- */
.nav {
  position: sticky; top: 0; z-index: 100;
  backdrop-filter: saturate(180%) blur(14px);
  background: rgba(255,255,255,.80);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  width: min(1140px, 92vw); margin-inline: auto;
  display: flex; align-items: center; justify-content: space-between;
  height: 62px;
}
.nav-brand {
  font-family: var(--font-head); font-weight: 700; font-size: 1.2rem;
  color: var(--ink); letter-spacing: -.02em;
}
.nav-brand .brand-mark { color: var(--blue-600); }
.nav-brand sup { color: var(--cyan); font-size: .62em; top: -.5em; }
.nav-links { display: flex; gap: 4px; }
.nav-links a {
  color: var(--ink-soft); font-weight: 500; font-size: .92rem;
  padding: 8px 13px; border-radius: 9px; transition: .18s;
}
.nav-links a:hover { color: var(--blue-700); background: var(--blue-50); }
.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: 0; cursor: pointer; padding: 8px; }
.nav-toggle span { width: 24px; height: 2px; background: var(--ink); border-radius: 2px; transition: .25s; }

/* ---------------- HERO ---------------- */
.hero {
  position: relative; overflow: hidden;
  padding: 60px 0 64px;
  background:
    radial-gradient(1100px 460px at 50% -120px, var(--blue-100), transparent 70%),
    linear-gradient(180deg, var(--bg-soft), var(--bg));
}
.hero-glow {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(420px 300px at 12% 8%, rgba(37,99,235,.16), transparent 60%),
    radial-gradient(420px 300px at 88% 0%, rgba(6,182,212,.14), transparent 60%);
}
.hero-grid {
  position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(900px 380px at 50% 60px, #000 10%, transparent 75%);
  -webkit-mask-image: radial-gradient(900px 380px at 50% 60px, #000 10%, transparent 75%);
}
.hero-content { position: relative; text-align: center; }

.badge {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: .84rem; font-weight: 600;
  color: var(--blue-700); background: #fff;
  border: 1px solid var(--blue-200);
  padding: 7px 17px; border-radius: 999px; box-shadow: var(--shadow-sm);
}
.badge .badge-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--cyan-500); box-shadow: 0 0 0 4px var(--cyan-soft);
}
.hero-title {
  font-family: var(--font-head); font-weight: 700;
  font-size: clamp(2.6rem, 12vw, 6.2rem); line-height: 1;
  margin: 20px 0 6px; letter-spacing: -.03em;
  overflow-wrap: break-word;
}
.hero-title sup { font-size: .5em; top: -.55em; }
.grad {
  background: linear-gradient(100deg, var(--blue-600) 8%, var(--cyan-500) 92%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-subtitle {
  font-family: var(--font-head); font-weight: 600;
  font-size: clamp(1.1rem, 2.4vw, 1.5rem); color: var(--ink);
  margin: 8px auto 0; max-width: 860px; letter-spacing: -.01em; line-height: 1.35;
}
.hero-tagline {
  font-size: 1.04rem; color: var(--ink-soft);
  max-width: 720px; margin: 18px auto 0;
}
.hero-tagline strong { color: var(--blue-700); font-weight: 600; }

/* ---------------- AUTHORS ---------------- */
.authors {
  margin: 26px auto 0; max-width: 900px;
  font-size: 1.08rem; font-weight: 500; line-height: 1.9;
}
.authors .author { color: var(--ink); white-space: nowrap; }
a.author { color: var(--blue-700); transition: color .15s; }
a.author:hover { color: var(--cyan); text-decoration: underline; }
.authors sup { color: var(--cyan); font-weight: 600; font-size: .68em; }
.affil { color: var(--ink-soft); font-size: .96rem; margin-top: 12px; }
.affil sup { color: var(--cyan); font-weight: 600; }
.affil-sep { display: inline-block; }
.affil-note { color: var(--ink-mute); font-size: .85rem; margin-top: 4px; }
.affil-note .corr { color: var(--cyan); }

/* ---------------- BUTTONS ---------------- */
.hero-buttons { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 30px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 22px; border-radius: 999px;
  font-weight: 600; font-size: .96rem; letter-spacing: .01em;
  transition: transform .15s, box-shadow .2s, background .2s;
  border: 1px solid transparent;
}
.btn .ic { width: 18px; height: 18px; }
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--blue-600); color: #fff; box-shadow: 0 10px 24px rgba(37,99,235,.32); }
.btn-primary:hover { background: var(--blue-700); color: #fff; }
.btn-dark { background: var(--ink); color: #fff; box-shadow: 0 10px 24px rgba(15,23,41,.22); }
.btn-dark:hover { background: #000; color: #fff; }
.btn-accent { background: var(--cyan); color: #fff; box-shadow: 0 10px 24px rgba(8,145,178,.3); }
.btn-accent:hover { color: #fff; filter: brightness(1.06); }
.btn[aria-disabled="true"] { opacity: .82; }

/* teaser */
.teaser-figure {
  margin: 0; max-width: none;
  background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px;
  box-shadow: var(--shadow-lg);
}
.teaser-figure img { border-radius: 10px; margin-inline: auto; }
.teaser-figure figcaption,
.figure-card figcaption,
.video-card figcaption {
  font-size: .9rem; color: var(--ink-soft); padding: 14px 10px 4px;
  text-align: center; line-height: 1.6;
}

/* ---------------- STATS ---------------- */
.stats-band {
  background: linear-gradient(180deg, var(--bg), var(--blue-50));
  padding: 44px 0;
  border-top: 1px solid var(--line);
}
.stats-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 18px; }
.stat {
  text-align: center; background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 22px 12px; box-shadow: var(--shadow-sm);
}
.stat-num {
  font-family: var(--font-head); font-weight: 700;
  font-size: clamp(1.7rem, 3.4vw, 2.5rem);
  background: linear-gradient(120deg, var(--blue-600), var(--cyan-500));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  line-height: 1;
}
.stat-num span { font-size: .6em; }
.stat-label { font-size: .82rem; color: var(--ink-soft); margin-top: 8px; line-height: 1.4; }

/* ---------------- SECTIONS ---------------- */
.section { padding: 74px 0; }
.section-alt { background: var(--bg-soft); border-block: 1px solid var(--line); }
.section-title {
  font-family: var(--font-head); font-weight: 700;
  font-size: clamp(1.6rem, 3.4vw, 2.2rem); letter-spacing: -.02em;
  margin: 0 0 6px; display: flex; align-items: baseline; gap: 14px;
}
.kicker {
  font-size: .8rem; font-weight: 700; color: var(--blue-600);
  background: var(--blue-100); border-radius: 8px;
  padding: 3px 9px; letter-spacing: .04em;
}
.section-sub { color: var(--ink-soft); font-size: 1.05rem; max-width: 780px; margin: 6px 0 32px; }
.section-sub.small { font-size: .98rem; margin-bottom: 18px; }
.section-sub.center, .section-title.center { margin-inline: auto; text-align: center; justify-content: center; }
.lead { font-size: 1.12rem; color: var(--ink); }
.section p { color: var(--ink-soft); }
.section .lead, .section p strong { color: var(--ink); }
.narrow p { font-size: 1.04rem; }
.abstract-section { padding-top: 68px; }
.abstract-wrap { width: min(1120px, 92vw); }
.abstract-copy { display: flow-root; }
.abstract-copy .section-title { margin-bottom: 20px; }
.abstract-copy .teaser-figure {
  float: left;
  width: min(55%, 610px);
  margin: 7px 34px 18px 0;
}
.abstract-copy p { font-size: 1.02rem; }
.abstract-copy p:last-child { margin-bottom: 0; }

/* ---------------- FIGURES ---------------- */
.figure-card {
  margin: 0; background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow);
}
.figure-card img { border-radius: 10px; width: 100%; }
.figure-card.slim { max-width: 720px; margin-inline: auto; }

/* ---------------- VIDEO EMBED ---------------- */
.video-embed {
  position: relative; padding-bottom: 56.25%; height: 0;
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-lg);
  border: 1px solid var(--line); background: #000;
}
.video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; }

/* ---------------- METHOD COMPONENTS ---------------- */
.component-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; margin-top: 30px;
}
.comp-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px 24px; box-shadow: var(--shadow-sm); transition: .2s;
  position: relative; overflow: hidden;
}
.comp-card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 4px;
  background: linear-gradient(90deg, var(--blue-500), var(--cyan-500));
}
.comp-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.comp-num {
  width: 42px; height: 42px; border-radius: 12px;
  display: grid; place-items: center; font-family: var(--font-head);
  font-weight: 700; font-size: 1.2rem; color: #fff;
  background: linear-gradient(135deg, var(--blue-500), var(--blue-700));
  margin-bottom: 16px;
}
.comp-card h3 { font-family: var(--font-head); font-size: 1.18rem; margin: 0 0 8px; letter-spacing: -.01em; }
.comp-card p { font-size: .96rem; margin: 0; }

/* ---------------- DEMO + VIDEO CARDS ---------------- */
.demo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.demo-grid.cols-2 {
  grid-template-columns: repeat(2, 1fr);
  max-width: 1120px;
  gap: 24px;
  margin-inline: auto;
}
.video-card {
  margin: 0; background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); padding: 10px; box-shadow: var(--shadow-sm); transition: .2s;
}
.video-card:hover { box-shadow: var(--shadow); transform: translateY(-3px); }
.video-card video {
  border-radius: 10px; width: 100%; height: auto;
  background: #0b1220; display: block;
}
.video-card figcaption {
  font-weight: 600; color: var(--ink);
  display: flex; align-items: center; gap: 8px; justify-content: center;
  padding: 12px 8px 4px; font-family: var(--font-head); font-size: 1rem;
}

/* ---------------- TAGS ---------------- */
.tag {
  display: inline-block; font-size: .66rem; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; padding: 3px 9px; border-radius: 999px;
}
.tag-reach    { color: #0d7a6b; background: #d7f5ee; }
.tag-pick     { color: var(--blue-700); background: var(--blue-100); }
.tag-contact  { color: var(--cyan); background: var(--cyan-soft); }
.tag-deform   { color: #b45309; background: #fdf0d5; }
.tag-artic    { color: #9333ea; background: #f3e8ff; }
.tag-long     { color: #be123c; background: #ffe4e9; }

/* ---------------- BIBTEX ---------------- */
.bibtex-wrap { position: relative; }
.bibtex-wrap pre {
  background: #0d1526; color: #e6edff; border-radius: var(--radius);
  padding: 26px 24px; overflow-x: auto; font-family: var(--font-mono);
  font-size: .86rem; line-height: 1.65; box-shadow: var(--shadow);
  margin: 0;
}
.copy-btn {
  position: absolute; top: 14px; right: 14px;
  background: rgba(255,255,255,.12); color: #fff; border: 1px solid rgba(255,255,255,.25);
  padding: 6px 14px; border-radius: 8px; font-size: .82rem; font-weight: 600;
  cursor: pointer; transition: .18s; backdrop-filter: blur(6px);
}
.copy-btn:hover { background: rgba(255,255,255,.22); }
.copy-btn.copied { background: var(--cyan); border-color: var(--cyan); }

/* ---------------- FOOTER ---------------- */
.footer { padding: 44px 0; text-align: center; color: var(--ink-soft); border-top: 1px solid var(--line); background: var(--bg-soft); }
.footer p { margin: 6px 0; font-size: .92rem; }
.footer .muted { color: var(--ink-mute); font-size: .84rem; }
.footer a { font-weight: 600; }

/* ---------------- REVEAL ANIM ---------------- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .6s ease, transform .6s cubic-bezier(.2,.7,.2,1); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ---------------- RESPONSIVE ---------------- */
@media (max-width: 960px) {
  .component-grid, .demo-grid { grid-template-columns: 1fr; }
  .demo-grid.cols-2 { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .abstract-copy .teaser-figure {
    float: none;
    width: 100%;
    max-width: 820px;
    margin: 0 auto 24px;
  }
}
@media (max-width: 720px) {
  .nav-links {
    position: absolute; top: 62px; left: 0; right: 0;
    flex-direction: column; gap: 0; background: #fff;
    border-bottom: 1px solid var(--line); padding: 8px 16px 16px;
    box-shadow: var(--shadow); display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px 8px; border-radius: 8px; }
  .nav-toggle { display: flex; }
  .section { padding: 56px 0; }
  .badge { font-size: .74rem; padding: 7px 14px; line-height: 1.5; max-width: 92vw; }
  .hero { padding: 42px 0 48px; }
}
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
}
