/* ============================================================
   Vernata project page: style.css
   Light theme only. Signature = LiDAR depth ramp.
   ============================================================ */

/* ---------- Design tokens ---------- */
:root {
  --ink:        #10192A; /* deep slate: primary text */
  --paper:      #FBFCFD; /* cool white: page surface */
  --mist:       #5C6B7A; /* slate grey: secondary text, captions */
  --line:       #E4E8EC; /* hairline borders + dividers */
  --card:       #FFFFFF; /* raised surfaces */

  /* depth ramp (near to far): the signature */
  --depth-near: #E8B23A; /* amber  */
  --depth-mid:  #1F8A8C; /* teal: primary interactive accent */
  --depth-far:  #3B3170; /* indigo */
  --ramp: linear-gradient(90deg, var(--depth-near), var(--depth-mid), var(--depth-far));

  --paper-translucent: rgba(251, 252, 253, 0.78);
  --shadow: 0 10px 30px -12px rgba(16, 25, 42, 0.22);

  /* fluid type scale */
  --step--1: clamp(0.63rem, 0.6rem + 0.25vw,  0.74rem);
  --step-0:  clamp(0.81rem, 0.76rem + 0.35vw, 0.92rem);
  --step-1:  clamp(1.02rem, 0.88rem + 0.85vw, 1.4rem);
  --step-2:  clamp(1.37rem, 1.09rem + 1.7vw,  2.1rem);
  --step-3:  clamp(1.75rem, 1.26rem + 3.5vw,  3.22rem);

  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-body:    'IBM Plex Sans', system-ui, sans-serif;
  --font-mono:    'IBM Plex Mono', ui-monospace, 'SF Mono', monospace;

  --header-h: 60px;
  --wrap: 950px;
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  color-scheme: light;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.6;
  font-weight: 400;
  overflow-x: hidden; /* responsive floor: no horizontal overflow */
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

img, svg, video, iframe { max-width: 100%; display: block; }

a {
  color: var(--depth-mid);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}
a:hover { text-decoration: none; }

:focus-visible {
  outline: 2px solid var(--depth-mid);
  outline-offset: 3px;
  border-radius: 3px;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 2rem);
}

.skip-link {
  position: absolute;
  left: 50%;
  transform: translateX(-50%) translateY(-120%);
  top: 8px;
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--line);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  z-index: 100;
  transition: transform 0.15s ease;
}
.skip-link:focus-visible { transform: translateX(-50%) translateY(0); }

/* ---------- Eyebrow + ramp rule (signature) ---------- */
.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--depth-mid);
  margin: 0 0 0.5rem;
}

.ramp-rule {
  height: 3px;
  width: min(180px, 40%);
  background: var(--ramp);
  border-radius: 3px;
  margin: 0.75rem 0 1.75rem;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--paper-translucent);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid transparent;
}
.site-header::after { /* ramp hairline at bottom edge */
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  background: var(--ramp);
  opacity: 0.85;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: var(--header-h);
}

.brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.01em;
  flex: none;
}

.nav { min-width: 0; }
.nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: clamp(0.5rem, 2vw, 1.25rem);
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.nav-list::-webkit-scrollbar { display: none; }
.nav-list li { scroll-snap-align: end; flex: none; }
.nav-list a {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  color: var(--mist);
  text-decoration: none;
  padding: 0.35rem 0.1rem;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.nav-list a:hover { color: var(--ink); }
.nav-list a.is-active {
  color: var(--depth-mid);
  border-bottom-color: var(--depth-mid);
}

/* ---------- Hero ---------- */
.hero {
  padding: clamp(2.5rem, 8vw, 5rem) 0 clamp(2rem, 6vw, 3.5rem);
  text-align: center;
}
.hero .eyebrow { color: var(--depth-mid); }
.hero .ramp-rule { margin-inline: auto; }

h1#paper-title {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0.25rem 0 0;
  text-wrap: balance;
}
h1#paper-title .title-name {
  display: block;
  font-size: var(--step-3);
}
h1#paper-title .title-sub {
  display: block;
  font-size: var(--step-1);
  font-weight: 600;
  color: var(--mist);
  margin-top: 0.4rem;
}

.authors {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: var(--step-0);
  margin: 0 0 0.5rem;
  line-height: 1.7;
}
.authors a { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--line); }
.authors a:hover { border-bottom-color: var(--depth-mid); color: var(--depth-mid); }
.authors sup { color: var(--mist); font-size: 0.7em; }

.affils {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  color: var(--mist);
  margin: 0 0 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  justify-content: center;
  align-items: center;
}
.affils sup { color: var(--depth-mid); }

.venue-line {
  margin: 0 0 1.5rem;
  text-align: center;
}

.venue-chip {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: var(--step-0);
  color: var(--depth-mid);
  border: 1px solid var(--depth-mid);
  border-radius: 999px;
  padding: 0.3rem 0.9rem;
  white-space: nowrap;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.venue-chip:hover,
.venue-chip:focus-visible {
  background-color: var(--depth-mid);
  color: var(--paper);
}

/* CTA pill buttons */
.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: center;
  margin: 0 0 clamp(1.75rem, 5vw, 2.5rem);
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 44px;
  padding: 0 1.1rem;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: var(--step-0);
  color: var(--depth-mid);
  background: transparent;
  border: 1.5px solid var(--depth-mid);
  border-radius: 999px;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease, transform 0.1s ease;
}
.pill:hover, .pill:focus-visible {
  background: var(--depth-mid);
  color: #fff;
}
.pill:active { transform: translateY(1px); }

/* Hero media: figure uses its natural aspect ratio, capped width */
.hero-media {
  margin: 0 auto;
  max-width: min(100%, 700px);
}
.hero-media img,
.hero-media-video {
  width: 100%;
  height: auto;
  border-radius: 14px;
  box-shadow: var(--shadow);
  background: var(--card);
}
.caption {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  color: var(--mist);
  margin: 0.75rem 0 0;
  line-height: 1.5;
}

.tagline {
  max-width: 60ch;
  margin: 1.5rem auto 0;
  font-size: var(--step-1);
  color: var(--ink);
  line-height: 1.45;
  text-wrap: balance;
}

/* ---------- Sections ---------- */
.section {
  padding-block: clamp(2.25rem, 6vw, 3.5rem);
  scroll-margin-top: calc(var(--header-h) + 12px);
  border-top: 1px solid var(--line);
}
.section h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--step-2);
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin: 0;
}
.section h2.res-head { margin-top: 3rem; margin-bottom: 1.5rem; }
.section h2.res-head:first-of-type { margin-top: 0; }

.prose {
  max-width: none;
  margin-inline: auto;
}
.prose p { margin: 0 0 1rem; }
.prose p:last-child { margin-bottom: 0; }

/* Abstract is centered per spec */
#abstract .prose { text-align: left; }

/* ---------- Video embed ---------- */
.video-embed {
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow);
  background: #0C1320;
}
.video-embed iframe,
.video-embed video {
  width: 100%;
  height: 100%;
  border: 0;
  object-fit: contain;
  background: #000;
}

/* ---------- Method figure ---------- */
.method-figure {
  margin: 0 0 1.75rem;
}
.method-figure img {
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  padding: clamp(0.75rem, 3vw, 1.5rem);
}

/* ---------- Results tables ---------- */
.table-wrap { margin: 1.75rem 0 0; }
.table-cap {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  color: var(--mist);
  margin: 0 0 0.6rem;
  line-height: 1.5;
}
.table-num { color: var(--depth-mid); margin-right: 0.4rem; }
.table-foot {
  margin-top: 1.25rem;
  font-size: 0.8em;
  font-style: italic;
  opacity: 0.85;
  text-align: center;
}
.table-foot .foot-mark { font-style: normal; color: var(--depth-mid); }

.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  -webkit-overflow-scrolling: touch;
}
.results-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: var(--step--1);
  white-space: nowrap;
}
.results-table th,
.results-table td {
  padding: 0.6rem 0.9rem;
  text-align: right;
  border-bottom: 1px solid var(--line);
}
.results-table thead th {
  color: var(--mist);
  font-weight: 500;
  text-align: right;
  border-bottom: 1px solid var(--line);
}
.results-table thead tr:first-child th { text-align: center; }
.results-table th[scope="row"],
.results-table thead th[rowspan] {
  text-align: left;
  color: var(--ink);
}
.results-table tbody tr:last-child td,
.results-table tbody tr:last-child th { border-bottom: 0; }
.results-table .row-ours {
  background: color-mix(in srgb, var(--depth-mid) 9%, transparent);
}
.results-table .row-ours th[scope="row"] { color: var(--depth-mid); }
.results-table strong { color: var(--ink); font-weight: 700; }

/* ---------- Before/after compare slider ---------- */
.compare { margin: 0 0 2rem; }
.compare-stage {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
  aspect-ratio: 1600 / 477;
  background: var(--card);
}
.compare-stage img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* clip the "before" image by inset so it stays pixel-aligned with the "after" */
.compare-before-wrap {
  position: absolute;
  inset: 0;
  clip-path: inset(0 50% 0 0);
}
.compare-handle {
  position: absolute;
  top: 0; bottom: 0;
  left: 50%;
  width: 2px;
  background: var(--paper);
  transform: translateX(-1px);
  pointer-events: none;
  box-shadow: 0 0 0 1px rgba(16, 25, 42, 0.15);
}
.compare-handle::after {
  content: "⇄";
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 34px; height: 34px;
  display: grid; place-items: center;
  background: var(--depth-mid);
  color: #fff;
  border-radius: 999px;
  font-size: 0.9rem;
}
.compare-range {
  width: 100%;
  margin-top: 0.75rem;
  accent-color: var(--depth-mid);
  min-height: 24px;
}

/* ---------- BibTeX ---------- */
.bibtex {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 3px solid transparent;
  border-radius: 12px;
  overflow: hidden;
}
.bibtex::before { /* ramp hairline on the left edge */
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--ramp);
}
.bibtex pre {
  margin: 0;
  padding: 1.25rem 1.5rem;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: var(--step--1);
  line-height: 1.6;
  color: var(--ink);
}
.copy-btn {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  z-index: 1;
  min-height: 36px;
  padding: 0 0.8rem;
  font-family: var(--font-mono);
  font-size: var(--step--1);
  color: var(--depth-mid);
  background: var(--card);
  border: 1px solid var(--depth-mid);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.copy-btn:hover, .copy-btn:focus-visible { background: var(--depth-mid); color: #fff; }
.copy-btn.is-copied { background: var(--depth-mid); color: #fff; border-color: var(--depth-mid); }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  margin-top: 2rem;
  padding-block: 2rem;
}
.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  align-items: center;
  text-align: center;
  font-family: var(--font-mono);
  font-size: var(--step--1);
  color: var(--mist);
}
.footer-inner p { margin: 0; }
.footer-inner a { color: var(--depth-mid); }

/* ---------- Reveal-on-scroll (motion-safe) ---------- */
@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.6s ease, transform 0.6s ease;
  }
  .reveal.is-visible {
    opacity: 1;
    transform: none;
  }
}
