/* ============================================================
   Towards Autonomous Robot-Assisted Surgery — site styles
   ============================================================ */

:root {
  --ink: #0b1f33;
  --ink-2: #2c4257;
  --muted: #5f7488;
  --bg: #ffffff;
  --bg-soft: #eef4fa;
  --line: #e2e9f0;

  --navy: #12263a;
  --navy-2: #1a3a5c;
  --navy-deep: #081420;

  --accent: #12b6a3;     /* teal */
  --accent-2: #2a93d6;   /* sky */
  --accent-3: #f59e0b;   /* warm highlight */

  --grad: linear-gradient(100deg, var(--accent-2), var(--accent));
  --shadow-sm: 0 1px 2px rgba(11, 31, 51, .06), 0 2px 6px rgba(11, 31, 51, .05);
  --shadow: 0 10px 30px -12px rgba(11, 31, 51, .22);
  --shadow-lg: 0 30px 60px -24px rgba(11, 31, 51, .35);

  --radius: 16px;
  --radius-sm: 10px;
  --maxw: 1180px;

  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --display: "Space Grotesk", var(--font);
}

* { box-sizing: border-box; }

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

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}

img, video, svg { max-width: 100%; display: block; }
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { font-family: var(--display); line-height: 1.15; color: var(--ink); margin: 0 0 .5em; letter-spacing: -.01em; }
h2 { font-size: clamp(1.7rem, 3.2vw, 2.6rem); }
h3 { font-size: clamp(1.2rem, 2vw, 1.5rem); }
p { margin: 0 0 1rem; }

.container { width: min(var(--maxw), 92vw); margin-inline: auto; }

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

/* ============================== BUTTONS ============================== */
.btn {
  --pad-y: .8rem; --pad-x: 1.25rem;
  display: inline-flex; align-items: center; gap: .5rem;
  padding: var(--pad-y) var(--pad-x);
  border-radius: 999px;
  font-weight: 600; font-size: .95rem;
  border: 1px solid transparent;
  cursor: pointer; transition: transform .18s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease, color .18s;
  white-space: nowrap; text-decoration: none;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn svg { flex: 0 0 auto; }
.btn--primary { background: var(--grad); color: #fff; box-shadow: 0 8px 20px -8px rgba(42,147,214,.6); }
.btn--primary:hover { box-shadow: 0 12px 26px -8px rgba(42,147,214,.7); color: #fff; }
.btn--ghost { background: rgba(255,255,255,.0); color: var(--ink); border-color: var(--line); box-shadow: var(--shadow-sm); }
.btn--ghost:hover { border-color: var(--accent-2); color: var(--accent-2); }
.btn--sm { --pad-y: .55rem; --pad-x: 1rem; font-size: .88rem; }
.btn--xs { --pad-y: .45rem; --pad-x: .85rem; font-size: .82rem; }

.btn-row { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.2rem; }

/* ============================== NAV ============================== */
.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: saturate(160%) blur(12px);
  background: rgba(255,255,255,.78);
  border-bottom: 1px solid transparent;
  transition: background .25s, border-color .25s, box-shadow .25s;
}
.nav.is-scrolled { background: rgba(255,255,255,.9); border-color: var(--line); box-shadow: var(--shadow-sm); }
.nav__inner { width: min(var(--maxw), 94vw); margin-inline: auto; display: flex; align-items: center; gap: 1rem; height: 64px; }
.nav__brand { display: inline-flex; align-items: center; gap: .55rem; color: var(--ink); font-family: var(--display); font-weight: 700; }
.nav__brand:hover { text-decoration: none; }
.nav__mark { color: var(--accent); display: inline-flex; }
.nav__brandtext { font-size: 1.02rem; }
.nav__links { display: flex; gap: .35rem; margin-left: auto; }
.nav__links a {
  color: var(--ink-2); font-weight: 500; font-size: .92rem; padding: .5rem .7rem; border-radius: 8px;
  transition: color .15s, background .15s;
}
.nav__links a:hover { color: var(--accent-2); background: var(--bg-soft); text-decoration: none; }
.nav__links a.active { color: var(--accent-2); }
.nav__cta { margin-left: .5rem; }
.nav__toggle { display: none; flex-direction: column; gap: 5px; background: none; border: 0; cursor: pointer; padding: 8px; margin-left: auto; }
.nav__toggle span { width: 24px; height: 2px; background: var(--ink); border-radius: 2px; transition: transform .25s, opacity .25s; }
.nav.open .nav__toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav.open .nav__toggle span:nth-child(2) { opacity: 0; }
.nav.open .nav__toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ============================== HERO ============================== */
.hero {
  position: relative; overflow: hidden;
  color: #eaf2fb;
  background:
    radial-gradient(1100px 600px at 78% -10%, rgba(42,147,214,.32), transparent 60%),
    radial-gradient(900px 500px at 8% 110%, rgba(18,182,163,.28), transparent 55%),
    linear-gradient(160deg, var(--navy-2) 0%, var(--navy) 45%, var(--navy-deep) 100%);
  padding: clamp(3rem, 7vw, 6rem) 0 clamp(4rem, 8vw, 7rem);
}
.hero__bg {
  position: absolute; inset: 0; opacity: .5; pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(80% 70% at 50% 30%, #000 40%, transparent 100%);
}
.hero__grid {
  position: relative; z-index: 1;
  width: min(var(--maxw), 92vw); margin-inline: auto;
  display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(2rem, 4vw, 4rem); align-items: center;
}
.eyebrow {
  display: inline-block; font-weight: 600; font-size: .8rem; letter-spacing: .12em; text-transform: uppercase;
  color: #9fc6e6; margin-bottom: 1rem;
  padding: .35rem .75rem; border: 1px solid rgba(159,198,230,.3); border-radius: 999px;
}
.hero__title { color: #fff; font-size: clamp(2.3rem, 5.2vw, 4rem); margin-bottom: 1rem; }
.hero__lead { font-size: clamp(1.05rem, 1.6vw, 1.3rem); color: #cfe0f0; max-width: 36ch; margin-bottom: 1.8rem; }
.hero__lead strong { color: #fff; }
.hero__actions { display: flex; flex-wrap: wrap; gap: .7rem; }
.hero .btn--ghost { background: rgba(255,255,255,.06); color: #eaf2fb; border-color: rgba(255,255,255,.18); }
.hero .btn--ghost:hover { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.4); }
.hero__byline { margin-top: 1.8rem; font-size: .92rem; color: #a9c4dc; }
.hero__byline strong { color: #fff; }

/* device / video frame in hero */
.device {
  margin: 0; border-radius: 18px; overflow: hidden;
  background: #0c1c2e; border: 1px solid rgba(255,255,255,.12);
  box-shadow: var(--shadow-lg);
  transform: perspective(1200px) rotateY(-4deg) rotateX(1.5deg);
  transition: transform .5s ease;
}
.device:hover { transform: perspective(1200px) rotateY(0) rotateX(0); }
.device__bar { display: flex; align-items: center; gap: 6px; padding: 10px 14px; background: #0a1726; border-bottom: 1px solid rgba(255,255,255,.08); }
.device__bar > span { width: 10px; height: 10px; border-radius: 50%; background: #2c4257; }
.device__bar > span:nth-child(1) { background: #ef6f6f; }
.device__bar > span:nth-child(2) { background: #f5c451; }
.device__bar > span:nth-child(3) { background: #5fd07d; }
.device__label { margin: 0 0 0 auto; font-size: .72rem; color: #7f9ab4; letter-spacing: .02em; }
.device__video { width: 100%; aspect-ratio: 960 / 594; object-fit: contain; background: #0c1c2e; }
.hero__media-cap { margin-top: 1rem; font-size: .85rem; color: #a9c4dc; text-align: center; }

.scroll-hint { position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%); width: 26px; height: 42px; border: 2px solid rgba(255,255,255,.4); border-radius: 14px; z-index: 2; }
.scroll-hint span { position: absolute; top: 8px; left: 50%; width: 4px; height: 8px; margin-left: -2px; background: #fff; border-radius: 2px; animation: scrolldot 1.6s infinite; }
@keyframes scrolldot { 0% { opacity: 0; transform: translateY(0);} 40% {opacity:1;} 80% {opacity:0; transform: translateY(12px);} 100%{opacity:0;} }

/* ============================== STAT STRIP ============================== */
.stats { background: var(--navy-deep); color: #eaf2fb; }
.stats__inner {
  width: min(var(--maxw), 92vw); margin-inline: auto;
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 1rem;
  padding: 2.2rem 0;
}
.stat { text-align: center; padding: .3rem; }
.stat__num { display: block; font-family: var(--display); font-weight: 700; font-size: clamp(1.4rem, 2.4vw, 2rem); color: #fff; line-height: 1.1; }
.stat__num .u { -webkit-text-fill-color: initial; }
.stat__label { display: block; font-size: .78rem; color: #9fb6cd; margin-top: .35rem; line-height: 1.35; }

/* ============================== SECTIONS ============================== */
.section { padding: clamp(3.5rem, 8vw, 6.5rem) 0; }
.section--alt { background: var(--bg-soft); }
.section__head { max-width: 760px; margin: 0 auto clamp(2rem, 4vw, 3.2rem); text-align: center; }
.kicker { font-weight: 600; font-size: .82rem; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin: 0 0 .6rem; }
.section__sub { color: var(--muted); font-size: 1.08rem; margin: 0; }

/* explain cards */
.explain { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.2rem; margin-bottom: clamp(3rem, 6vw, 4.5rem); }
.explain__card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.6rem 1.4rem;
  box-shadow: var(--shadow-sm); position: relative; transition: transform .2s, box-shadow .2s;
}
.explain__card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.explain__step { font-family: var(--display); font-weight: 700; font-size: 1rem; color: #fff; background: var(--grad); width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; margin-bottom: 1rem; }
.explain__card h3 { font-size: 1.12rem; }
.explain__card p { color: var(--ink-2); font-size: .96rem; margin: 0; }

/* grounding figure */
.ground-fig { margin: 0 0 clamp(3rem, 6vw, 4.5rem); background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(1.4rem, 3vw, 2.4rem); box-shadow: var(--shadow-sm); text-align: center; }
.ground-fig img { margin: 0 auto; max-height: 340px; width: auto; }
.ground-fig figcaption { margin: 1.3rem auto 0; color: var(--ink-2); font-size: .96rem; max-width: 76ch; }
.ground-fig strong { color: var(--ink); }

/* pipeline */
.pipeline { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(1.6rem, 3vw, 2.6rem); box-shadow: var(--shadow-sm); margin-bottom: clamp(3rem, 6vw, 4.5rem); }
.pipeline__title { text-align: center; font-size: 1.3rem; margin-bottom: 2rem; }
.pipeline__row { display: flex; align-items: stretch; justify-content: center; gap: 1rem; }
.pipe { flex: 1 1 0; max-width: 320px; text-align: center; padding: 1.4rem 1.2rem; border-radius: var(--radius-sm); background: var(--bg-soft); border: 1px solid var(--line); }
.pipe__icon { width: 56px; height: 56px; margin: 0 auto .9rem; display: grid; place-items: center; border-radius: 14px; background: #fff; color: var(--accent-2); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.pipe h4 { font-size: 1.25rem; margin-bottom: .4rem; }
.pipe p { color: var(--ink-2); font-size: .92rem; margin-bottom: .9rem; }
.pipe__tag { font-size: .72rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); background: rgba(18,182,163,.1); padding: .3rem .7rem; border-radius: 999px; }
.pipe__arrow { display: grid; place-items: center; font-size: 1.6rem; color: var(--accent-2); font-weight: 700; }

/* contribution intro cards */
.contrib-intro { text-align: center; }
.contrib-intro > h3 { font-size: clamp(1.4rem, 2.6vw, 1.9rem); margin-bottom: 1.8rem; }
.contrib-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem; text-align: left; }
.ccard {
  display: block; background: var(--navy); color: #eaf2fb; border-radius: var(--radius); padding: 1.8rem;
  position: relative; overflow: hidden; transition: transform .22s, box-shadow .22s; box-shadow: var(--shadow);
}
.ccard::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--grad); }
.ccard:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); text-decoration: none; }
.ccard__num { font-family: var(--display); font-weight: 700; color: var(--accent); font-size: 1.1rem; }
.ccard h4 { color: #fff; font-size: 1.3rem; margin: .5rem 0; }
.ccard p { color: #b9cee2; font-size: .95rem; margin-bottom: 1.1rem; }
.ccard__go { font-weight: 600; color: #fff; font-size: .9rem; }

/* ============================== FEATURE BLOCKS ============================== */
.feature { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 4.5rem); align-items: center; }
.feature--reverse .feature__media { order: 2; }
.feature__body .lead-sm { font-size: 1.12rem; color: var(--ink); }
.feature__body p { color: var(--ink-2); }
.feature__media img { border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--line); background: #fff; }

.badge { display: inline-block; font-family: var(--display); font-weight: 700; font-size: .78rem; letter-spacing: .06em; padding: .35rem .8rem; border-radius: 999px; color: #fff; }
.badge--01 { background: linear-gradient(100deg, #2a93d6, #12b6a3); }
.badge--02 { background: linear-gradient(100deg, #12b6a3, #3fb56b); }
.badge--03 { background: linear-gradient(100deg, #7a5cf0, #2a93d6); }

.ticks { list-style: none; padding: 0; margin: 1rem 0 1.4rem; display: grid; gap: .6rem; }
.ticks li { position: relative; padding-left: 1.9rem; color: var(--ink-2); }
.ticks li::before { content: ""; position: absolute; left: 0; top: .35em; width: 1.2rem; height: 1.2rem; border-radius: 50%; background: rgba(18,182,163,.14); }
.ticks li::after { content: ""; position: absolute; left: .38rem; top: .62em; width: .42rem; height: .22rem; border-left: 2px solid var(--accent); border-bottom: 2px solid var(--accent); transform: rotate(-45deg); }
.ticks strong { color: var(--ink); }

.chips { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1.2rem 0; }
.chip { font-size: .82rem; font-weight: 500; padding: .35rem .8rem; border-radius: 999px; background: #fff; border: 1px solid var(--line); color: var(--ink-2); box-shadow: var(--shadow-sm); }
.chip--hot { background: var(--navy); color: #fff; border-color: var(--navy); }

.why { background: rgba(42,147,214,.07); border-left: 3px solid var(--accent-2); padding: 1rem 1.2rem; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; color: var(--ink-2); font-size: .96rem; margin-top: 1.4rem; }
.why strong { color: var(--ink); }

/* video frames */
.vidframe { margin: 0; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); border: 1px solid var(--line); background: #0c1c2e; }
.vidframe video { width: 100%; display: block; object-fit: contain; background: #0c1c2e; }
.vidframe figcaption { padding: .8rem 1rem; font-size: .85rem; color: var(--ink-2); background: #fff; }

/* Dissection showcase clip (~16:10) — show the whole frame, no cropping */
.feature .vidframe video { aspect-ratio: 960 / 594; }

/* Portrait v2 demo clips — size by height so the full vertical frame is visible */
.duo .vidframe { display: flex; flex-direction: column; }
.duo .vidframe video { height: clamp(360px, 58vh, 580px); width: auto; max-width: 100%; align-self: center; }

/* ViT stereo pair — show full frames at matching height */
.stereo .vidframe video { aspect-ratio: 4 / 3; }

.result-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin: 1.4rem 0; }
.result { text-align: center; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 1.1rem .6rem; box-shadow: var(--shadow-sm); }
.result__big { display: block; font-family: var(--display); font-weight: 700; font-size: clamp(1.3rem, 2.4vw, 1.7rem); color: var(--accent-2); line-height: 1.1; }
.result__cap { display: block; font-size: .78rem; color: var(--muted); margin-top: .4rem; line-height: 1.3; }

.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 1.6rem; margin-top: clamp(2.5rem, 5vw, 4rem); }

/* subfeature / gallery */
.subfeature { margin-top: clamp(3rem, 6vw, 4.5rem); }
.subfeature__title { text-align: center; font-size: clamp(1.3rem, 2.4vw, 1.7rem); }
.subfeature__lead { text-align: center; max-width: 70ch; margin: 0 auto 2rem; color: var(--ink-2); }
.subfeature__lead strong { color: var(--ink); }
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem; }
.gallery--two { grid-template-columns: repeat(2, 1fr); margin-top: 2rem; }
.gallery figure { margin: 0; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); transition: transform .2s, box-shadow .2s; }
.gallery figure:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.gallery img { width: 100%; height: 230px; object-fit: contain; padding: 1.2rem; background: #fff; }
.gallery figcaption { padding: .8rem 1rem; font-size: .85rem; color: var(--ink-2); border-top: 1px solid var(--line); background: var(--bg-soft); }

/* stereo pair (vision) — full-width, larger demo row */
.vision-intro { max-width: 820px; margin: 0 auto clamp(1.8rem, 3.5vw, 2.6rem); text-align: center; }
.vision-intro .lead-sm { font-size: 1.12rem; color: var(--ink); }
.vision-intro p { color: var(--ink-2); }
.stereo { display: grid; grid-template-columns: 1fr 1fr; gap: 1.4rem; max-width: 1040px; margin-inline: auto; }
.stereo .vidframe figcaption { text-align: center; font-weight: 600; }
.stereo__cap { text-align: center; color: var(--muted); font-size: .9rem; margin-top: 1rem; }
.vision-results { max-width: 880px; margin: clamp(2rem, 4vw, 2.8rem) auto 0; }
.btn-row--center { justify-content: center; }

/* ============================== REPLICATE ============================== */
.start { margin-bottom: clamp(2.5rem, 5vw, 3.5rem); }
.start__title { text-align: center; font-size: 1.3rem; margin-bottom: 1.4rem; }
.start__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.startcard { display: flex; flex-direction: column; gap: .5rem; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 1.1rem 1.2rem; box-shadow: var(--shadow-sm); transition: border-color .2s, transform .2s; }
.startcard:hover { border-color: var(--accent-2); transform: translateY(-3px); text-decoration: none; }
.startcard__q { color: var(--muted); font-size: .88rem; }
.startcard__a { font-family: var(--display); font-weight: 700; color: var(--ink); font-size: 1rem; }
.startcard:hover .startcard__a { color: var(--accent-2); }

.repos { display: grid; grid-template-columns: 1fr 1fr; gap: 1.6rem; }
.repo { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.6rem; box-shadow: var(--shadow-sm); scroll-margin-top: 90px; transition: box-shadow .2s, transform .2s; display: flex; flex-direction: column; }
.repo:hover { box-shadow: var(--shadow); transform: translateY(-3px); }
.repo__head { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; margin-bottom: .8rem; flex-wrap: wrap; }
.repo__name { display: flex; align-items: center; gap: .5rem; font-size: 1.25rem; margin: 0; color: var(--ink); }
.repo__name svg { color: var(--accent-2); }
.repo__tag { margin: .25rem 0 0; color: var(--muted); font-size: .9rem; }
.repo__langs { display: flex; flex-wrap: wrap; gap: .35rem; }
.repo__langs span { font-size: .72rem; font-weight: 600; color: var(--ink-2); background: var(--bg-soft); border: 1px solid var(--line); padding: .25rem .6rem; border-radius: 999px; }
.repo__desc { color: var(--ink-2); font-size: .96rem; }
.repo__desc code { background: var(--bg-soft); padding: .1rem .35rem; border-radius: 5px; font-size: .9em; }
.repo__links { display: flex; flex-wrap: wrap; gap: .5rem; margin: .4rem 0 1rem; }

/* code blocks */
.codeblock, .cite pre { position: relative; margin-top: auto; }
.codeblock pre, .cite pre {
  background: var(--navy-deep); color: #d6e6f5; border-radius: var(--radius-sm);
  padding: 1.1rem 1.2rem; overflow-x: auto; font-size: .82rem; line-height: 1.6; margin: 0;
  font-family: "SF Mono", ui-monospace, "Cascadia Code", Menlo, Consolas, monospace;
  border: 1px solid rgba(255,255,255,.08);
}
.codeblock code, .cite code { font-family: inherit; }
.copy {
  position: absolute; top: .6rem; right: .6rem; z-index: 2;
  background: rgba(255,255,255,.1); color: #cfe0f0; border: 1px solid rgba(255,255,255,.18);
  border-radius: 7px; padding: .3rem .6rem; font-size: .74rem; font-weight: 600; cursor: pointer; transition: background .15s, color .15s;
  font-family: var(--font);
}
.copy:hover { background: rgba(255,255,255,.2); color: #fff; }
.copy.copied { background: var(--accent); color: #fff; border-color: var(--accent); }

/* supporting packages */
.subrepos-wrap { margin-top: clamp(2.2rem, 4vw, 3.2rem); }
.subrepos-title { text-align: center; font-size: 1.3rem; margin-bottom: .3rem; }
.subrepos-sub { text-align: center; color: var(--muted); margin: 0 0 1.4rem; }
.subrepos { display: grid; grid-template-columns: 1fr 1fr; gap: 1.4rem; }
.subrepo { display: block; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.3rem 1.5rem; box-shadow: var(--shadow-sm); transition: border-color .2s, transform .2s, box-shadow .2s; }
.subrepo:hover { border-color: var(--accent-2); transform: translateY(-3px); box-shadow: var(--shadow); text-decoration: none; }
.subrepo__name { display: flex; align-items: center; gap: .5rem; font-size: 1.1rem; margin: 0 0 .4rem; color: var(--ink); }
.subrepo__name svg { color: var(--accent-2); }
.subrepo:hover .subrepo__name { color: var(--accent-2); }
.subrepo__tag { color: var(--ink-2); font-size: .92rem; margin: 0 0 .9rem; }
.subrepo__langs { display: flex; flex-wrap: wrap; gap: .35rem; }
.subrepo__langs span { font-size: .72rem; font-weight: 600; color: var(--ink-2); background: var(--bg-soft); border: 1px solid var(--line); padding: .25rem .6rem; border-radius: 999px; }

/* ============================== PUBLICATIONS ============================== */
.pubs { list-style: none; counter-reset: pub; padding: 0; margin: 0 auto; max-width: 900px; display: grid; gap: 1rem; }
.pub { display: flex; gap: 1.2rem; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.3rem 1.5rem; box-shadow: var(--shadow-sm); transition: box-shadow .2s, transform .2s; }
.pub:hover { box-shadow: var(--shadow); transform: translatey(-2px); }
.pub__venue { flex: 0 0 auto; align-self: flex-start; font-family: var(--display); font-weight: 700; font-size: .76rem; color: #fff; background: var(--navy-2); padding: .4rem .7rem; border-radius: 8px; letter-spacing: .03em; white-space: nowrap; }
.pub__venue--journal { background: linear-gradient(100deg, #2a93d6, #12b6a3); }
.pub__body h3 { font-size: 1.08rem; margin: 0 0 .35rem; }
.pub__authors { font-size: .88rem; color: var(--ink-2); margin: 0 0 .25rem; }
.pub__meta { font-size: .85rem; color: var(--muted); margin: 0 0 .6rem; }
.pub__links { display: flex; gap: .5rem; flex-wrap: wrap; }
.pub__links a { font-size: .8rem; font-weight: 600; padding: .25rem .7rem; border: 1px solid var(--line); border-radius: 999px; color: var(--accent-2); }
.pub__links a:hover { background: var(--bg-soft); text-decoration: none; }

.cite { max-width: 900px; margin: 2.5rem auto 0; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow-sm); }
.cite__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; gap: 1rem; }
.cite__head h3 { margin: 0; font-size: 1.15rem; }
.copy--inline { position: static; }

/* ============================== ABOUT ============================== */
.about { display: grid; grid-template-columns: 280px 1fr; gap: clamp(2rem, 4vw, 3.5rem); align-items: center; }
.about__photo img { width: 100%; max-width: 280px; border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--line); aspect-ratio: 4/5; object-fit: cover; }
.about__role { font-weight: 600; color: var(--accent-2); margin-top: -.3rem; }
.about__body p { color: var(--ink-2); }
.about__note { font-size: .95rem; }
.social { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.2rem; }
.social__link { display: inline-flex; align-items: center; gap: .45rem; font-size: .9rem; font-weight: 600; color: var(--ink); background: #fff; border: 1px solid var(--line); padding: .5rem .9rem; border-radius: 999px; box-shadow: var(--shadow-sm); transition: border-color .15s, color .15s, transform .15s; }
.social__link:hover { border-color: var(--accent-2); color: var(--accent-2); transform: translateY(-2px); text-decoration: none; }
.social__link svg { color: var(--accent-2); }

.ack { margin-top: clamp(2.5rem, 5vw, 3.5rem); border-top: 1px solid var(--line); padding-top: 2.2rem; text-align: center; max-width: 820px; margin-inline: auto; }
.ack h3 { font-size: 1.2rem; }
.ack p { color: var(--ink-2); margin-bottom: 1.5rem; }
.ack__logos { display: flex; align-items: center; justify-content: center; gap: 2.5rem; flex-wrap: wrap; }
.ack__logos img { height: 56px; width: auto; opacity: .85; filter: grayscale(.2); }

/* ============================== FOOTER ============================== */
.footer { background: var(--navy-deep); color: #b9cee2; padding: 3rem 0 2rem; position: relative; }
.footer__inner { display: grid; grid-template-columns: 1.4fr 1fr 1.3fr; gap: 2rem; align-items: start; }
.footer__brand { display: flex; gap: .8rem; align-items: flex-start; }
.footer__brand .nav__mark { color: var(--accent); }
.footer__title { font-family: var(--display); font-weight: 700; color: #fff; margin: 0 0 .25rem; font-size: 1rem; }
.footer__sub { font-size: .85rem; margin: 0; color: #8fa9c2; }
.footer__links { display: flex; flex-direction: column; gap: .5rem; }
.footer__links a { color: #b9cee2; font-size: .9rem; }
.footer__links a:hover { color: #fff; }
.footer__legal { font-size: .82rem; color: #8fa9c2; margin: 0; }
.footer__disclaimer { color: #6f88a2; font-size: .78rem; }
.totop { position: absolute; right: 4vw; top: -22px; width: 44px; height: 44px; border-radius: 50%; background: var(--grad); color: #fff; display: grid; place-items: center; font-size: 1.2rem; box-shadow: var(--shadow); transition: transform .2s; }
.totop:hover { transform: translateY(-3px); text-decoration: none; color: #fff; }

/* ============================== REVEAL ANIMATION ============================== */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ============================== RESPONSIVE ============================== */
@media (max-width: 1024px) {
  .explain { grid-template-columns: repeat(2, 1fr); }
  .stats__inner { grid-template-columns: repeat(3, 1fr); gap: 1.4rem; }
  .gallery { grid-template-columns: 1fr; }
  .gallery img { height: auto; }
}

@media (max-width: 860px) {
  .nav__links { display: none; }
  .nav__cta { display: none; }
  .nav__toggle { display: flex; }
  .nav.open .nav__links {
    display: flex; flex-direction: column; gap: .2rem;
    position: absolute; top: 64px; left: 0; right: 0;
    background: rgba(255,255,255,.97); backdrop-filter: blur(12px);
    padding: 1rem 5vw 1.4rem; border-bottom: 1px solid var(--line); box-shadow: var(--shadow);
  }
  .nav.open .nav__links a { padding: .8rem .5rem; font-size: 1rem; }

  .hero__grid { grid-template-columns: 1fr; }
  .hero__media { order: -1; }
  .device { transform: none; }
  .hero__lead { max-width: none; }

  .feature, .feature--reverse { grid-template-columns: 1fr; }
  .feature--reverse .feature__media { order: -1; }
  .duo { grid-template-columns: 1fr; }
  .stereo { grid-template-columns: 1fr; }
  .contrib-cards { grid-template-columns: 1fr; }
  .pipeline__row { flex-direction: column; align-items: stretch; }
  .pipe { max-width: none; }
  .pipe__arrow { transform: rotate(90deg); }
  .repos { grid-template-columns: 1fr; }
  .subrepos { grid-template-columns: 1fr; }
  .start__grid { grid-template-columns: 1fr 1fr; }
  .gallery--two { grid-template-columns: 1fr; }
  .about { grid-template-columns: 1fr; text-align: center; justify-items: center; }
  .social { justify-content: center; }
  .footer__inner { grid-template-columns: 1fr; }
}

@media (max-width: 540px) {
  .stats__inner { grid-template-columns: repeat(2, 1fr); }
  .explain { grid-template-columns: 1fr; }
  .result-grid { grid-template-columns: 1fr; }
  .start__grid { grid-template-columns: 1fr; }
  .hero__actions .btn { flex: 1 1 auto; justify-content: center; }
}
