/* =========================================================
   PedestrianQA — Project page
   ========================================================= */

:root {
  --bg: #fbfbfd;
  --bg-tint: #f3f5f9;
  --paper: #ffffff;
  --ink: #0e1116;
  --ink-2: #1e242c;
  --muted: #5b6470;
  --line: #e4e8ee;
  --line-strong: #c7cdd6;

  --green: #15803d;
  --green-soft: #dcfce7;
  --red: #c0392b;
  --red-soft: #fde8e6;
  --blue: #2563eb;
  --blue-soft: #dbeafe;
  --amber: #d97706;
  --amber-soft: #fef3c7;
  --violet: #7c3aed;
  --violet-soft: #ede9fe;
  --cyan: #0891b2;
  --cyan-soft: #cffafe;

  --grad-1: linear-gradient(135deg, #16a34a 0%, #0891b2 50%, #2563eb 100%);
  --grad-soft: linear-gradient(135deg, #dcfce7 0%, #cffafe 50%, #dbeafe 100%);

  --radius: 14px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04), 0 1px 3px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 6px 16px -6px rgba(15, 23, 42, 0.08), 0 4px 8px -2px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 30px 60px -20px rgba(15, 23, 42, 0.18), 0 16px 36px -16px rgba(15, 23, 42, 0.10);

  --font-sans: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }

code, pre {
  font-family: var(--font-mono);
}

code {
  background: rgba(15, 23, 42, 0.06);
  border-radius: 6px;
  padding: 1px 6px;
  font-size: 0.9em;
}

/* ====== Navbar ====== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(251, 251, 253, 0.82);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.05rem;
  text-decoration: none;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.nav-brand .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--grad-1);
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.12);
}
.navbar nav {
  display: flex;
  gap: 28px;
  font-size: 0.93rem;
  color: var(--muted);
  font-weight: 500;
}
.navbar nav a {
  text-decoration: none;
  position: relative;
  transition: color 150ms ease;
}
.navbar nav a:hover { color: var(--ink); }
.navbar nav a::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -6px;
  height: 2px;
  background: var(--grad-1);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 200ms ease;
}
.navbar nav a:hover::after { transform: scaleX(1); }

/* ====== Hero ====== */
.hero {
  position: relative;
  padding: 110px 24px 60px;
  overflow: hidden;
  isolation: isolate;
}
.hero-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.55;
}
.blob-a {
  width: 520px; height: 520px;
  top: -120px; left: -120px;
  background: radial-gradient(circle, #86efac 0%, transparent 70%);
}
.blob-b {
  width: 580px; height: 580px;
  top: 40px; right: -160px;
  background: radial-gradient(circle, #93c5fd 0%, transparent 70%);
}
.grid-overlay {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(15, 23, 42, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 23, 42, 0.04) 1px, transparent 1px);
  background-size: 38px 38px;
  mask-image: radial-gradient(ellipse at center top, rgba(0,0,0,0.85) 0%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at center top, rgba(0,0,0,0.85) 0%, transparent 70%);
}

.hero-content {
  max-width: 1100px;
  margin: 0 auto;
  text-align: center;
}

.venue-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--green);
  background: var(--green-soft);
  border: 1px solid #bbf7d0;
  border-radius: 999px;
}
.pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(21, 128, 61, 0.6);
  animation: pulse 1.8s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(21, 128, 61, 0.6); }
  70% { box-shadow: 0 0 0 10px rgba(21, 128, 61, 0); }
  100% { box-shadow: 0 0 0 0 rgba(21, 128, 61, 0); }
}

.title {
  margin: 22px 0 14px;
  font-size: clamp(3rem, 9vw, 6.4rem);
  font-weight: 900;
  letter-spacing: -0.045em;
  line-height: 0.95;
}
.title-accent {
  background: var(--grad-1);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.tagline {
  max-width: 820px;
  margin: 0 auto 26px;
  font-size: clamp(1.1rem, 2.2vw, 1.5rem);
  font-weight: 500;
  color: var(--ink-2);
  line-height: 1.35;
}
.hl {
  background: linear-gradient(180deg, transparent 60%, rgba(34, 197, 94, 0.28) 60%);
  padding: 0 2px;
}

.authors {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 22px;
  font-size: 1.02rem;
  font-weight: 600;
  margin-bottom: 6px;
}
.author {
  text-decoration: none;
  color: var(--ink);
  transition: color 150ms ease;
}
.author:hover { color: var(--blue); }
.affiliation {
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 32px;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 56px;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 18px;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
  transition: transform 150ms ease, box-shadow 150ms ease, border-color 150ms ease;
}
.btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--ink);
}
.btn-primary {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}
.btn-primary:hover { border-color: var(--ink); }
.btn-tag {
  display: inline-block;
  padding: 2px 6px;
  font-size: 0.72rem;
  font-weight: 800;
  background: var(--red-soft);
  color: var(--red);
  border-radius: 4px;
  letter-spacing: 0.02em;
}

/* Teaser image */
.hero-figure {
  margin: 0 auto;
  max-width: 1080px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  padding: 18px;
}
.hero-figure img {
  width: 100%;
  border-radius: calc(var(--radius-lg) - 10px);
  border: 1px solid var(--line);
}
.hero-figure figcaption {
  margin: 14px 6px 4px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

/* ====== Sections ====== */
.section {
  padding: 110px 24px;
}
.section-tint { background: var(--bg-tint); }
.section-dark {
  background:
    radial-gradient(80% 60% at 50% 0%, rgba(34, 197, 94, 0.06), transparent 60%),
    #0b0e13;
  color: #e5e7eb;
}
.section-code {
  background:
    radial-gradient(60% 60% at 50% 0%, rgba(37, 99, 235, 0.08), transparent 60%),
    #0b0e13;
  color: #e5e7eb;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
}
.narrow { max-width: 880px; margin: 0 auto; }
.center { text-align: center; }

.eyebrow {
  display: inline-block;
  margin: 0 0 12px;
  padding: 4px 12px;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--green);
  background: var(--green-soft);
  border-radius: 999px;
}
.eyebrow.light {
  color: #86efac;
  background: rgba(34, 197, 94, 0.12);
}
.eyebrow.center { margin-left: auto; margin-right: auto; display: inline-block; }

.section-title {
  margin: 0 0 22px;
  font-size: clamp(1.9rem, 3.6vw, 2.9rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.12;
}
.section-title.light { color: #f8fafc; }
.section-title.center { text-align: center; }

.lead {
  color: var(--muted);
  font-size: 1.06rem;
  line-height: 1.7;
  margin-bottom: 14px;
}
.lead strong { color: var(--ink); }
.lead-light { color: #c1c7d0; }
.lead-light strong { color: #f8fafc; }
.lead.center { text-align: center; max-width: 760px; margin-left: auto; margin-right: auto; }

/* ====== Stats / feature cards ====== */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin: 36px 0 56px;
}
.stat-card {
  padding: 26px 22px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%; height: 3px;
  background: var(--grad-1);
}
.stat-num {
  font-size: clamp(1.9rem, 3vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  background: var(--grad-1);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 6px;
  line-height: 1;
}
.stat-lbl {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}
.feature {
  padding: 26px 22px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: transform 200ms ease, box-shadow 200ms ease;
}
.feature:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}
.feature h3 {
  margin: 12px 0 8px;
  font-size: 1.05rem;
  font-weight: 700;
}
.feature p {
  margin: 0;
  font-size: 0.93rem;
  color: var(--muted);
  line-height: 1.6;
}
.feature-icon {
  width: 42px; height: 42px;
  display: grid; place-items: center;
  border-radius: 11px;
}
.i-blue   { background: var(--blue-soft);   color: var(--blue); }
.i-red    { background: var(--red-soft);    color: var(--red); }
.i-green  { background: var(--green-soft);  color: var(--green); }
.i-amber  { background: var(--amber-soft);  color: var(--amber); }

/* ====== Figures ====== */
.figure-block {
  margin: 34px 0 0;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 22px;
}
.figure-block.dark {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
}
.figure-block img {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--line);
}
.figure-block.dark img {
  border-color: rgba(255, 255, 255, 0.1);
}
.figure-block figcaption {
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.93rem;
  line-height: 1.6;
}
.figure-block.dark figcaption { color: #c1c7d0; }

/* ====== Rationale cards ====== */
.rationale-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 32px;
}
.r-card {
  padding: 20px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.r-card p {
  margin: 10px 0 0;
  font-size: 0.92rem;
  color: var(--muted);
  line-height: 1.6;
}
.r-tag {
  display: inline-block;
  padding: 4px 10px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 6px;
}
.r-tag.spatial  { background: var(--blue-soft);   color: var(--blue); }
.r-tag.temporal { background: var(--violet-soft); color: var(--violet); }
.r-tag.math     { background: var(--amber-soft);  color: var(--amber); }
.r-tag.ego      { background: var(--red-soft);    color: var(--red); }
.r-tag.scene    { background: var(--green-soft);  color: var(--green); }
.r-tag.dest     { background: var(--cyan-soft);   color: var(--cyan); }

/* ====== Pipeline ====== */
.pipeline-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin-top: 40px;
}
.step {
  padding: 24px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  position: relative;
}
.step-num {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  color: #86efac;
  margin-bottom: 14px;
  letter-spacing: 0.08em;
}
.step h3 {
  margin: 0 0 8px;
  font-size: 1rem;
  font-weight: 700;
  color: #f8fafc;
}
.step p {
  margin: 0;
  font-size: 0.9rem;
  color: #c1c7d0;
  line-height: 1.6;
}

/* ====== Baseline setup grid ====== */
.setup-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 30px;
}
.setup-item {
  padding: 16px 18px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.setup-item span {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.setup-item strong {
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--ink);
  font-family: var(--font-mono);
}

/* ====== Headline results ====== */
.headline-results {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 38px 0 56px;
}
.hr-card {
  padding: 24px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}
.hr-card::before {
  content: '';
  position: absolute;
  inset: 0 auto auto 0;
  width: 4px; height: 100%;
}
.hr-green::before { background: var(--green); }
.hr-red::before   { background: var(--red); }
.hr-blue::before  { background: var(--blue); }
.hr-amber::before { background: var(--amber); }
.hr-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 8px;
}
.hr-value {
  display: block;
  font-size: 2.1rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1;
  margin-bottom: 6px;
}
.hr-value small { font-size: 1rem; font-weight: 600; color: var(--muted); }
.hr-sub {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
}

/* ====== Result tables ====== */
.result-block {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 26px;
  margin-bottom: 22px;
}
.result-head h3 {
  margin: 0 0 6px;
  font-size: 1.15rem;
  font-weight: 700;
}
.result-head p {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 0.93rem;
}
.table-figure {
  margin: 0;
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
}
.table-figure img {
  width: 100%;
  min-width: 760px;
  display: block;
}

/* ====== Takeaways ====== */
.takeaways {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 36px;
}
.tk {
  padding: 24px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-align: center;
}
.tk-num {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: var(--grad-1);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 8px;
}
.tk p {
  margin: 0;
  font-size: 0.93rem;
  color: var(--muted);
  line-height: 1.55;
}

/* ====== Access ====== */
.access-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 36px;
}
.access-card {
  display: block;
  padding: 26px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: inherit;
  transition: transform 200ms ease, box-shadow 200ms ease, border-color 200ms ease;
}
.access-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--ink);
}
.access-card.primary {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}
.access-card.primary p { color: #c1c7d0; }
.ac-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
}
.access-card.primary .ac-top { color: #86efac; }
.access-card h3 {
  margin: 0 0 8px;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.access-card p {
  margin: 0;
  font-size: 0.93rem;
  color: var(--muted);
}

.datasets {
  margin-top: 40px;
  padding-top: 30px;
  border-top: 1px solid var(--line);
}
.ds-title {
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 12px;
}
.ds-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.ds {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  font-weight: 700;
  text-decoration: none;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  transition: transform 150ms ease, border-color 150ms ease;
}
.ds:hover {
  transform: translateY(-2px);
  border-color: var(--ink);
}

/* ====== BibTeX ====== */
.code-wrap {
  position: relative;
  margin-top: 22px;
}
pre {
  margin: 0;
  padding: 26px 24px;
  background: #0f1319;
  color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius);
  overflow-x: auto;
  font-size: 0.92rem;
  line-height: 1.65;
}
pre code {
  background: transparent;
  padding: 0;
  color: inherit;
  font-size: inherit;
}
.copy-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  padding: 6px 12px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.08);
  color: #e5e7eb;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  cursor: pointer;
  transition: background 150ms ease;
  font-family: var(--font-sans);
}
.copy-btn:hover { background: rgba(255, 255, 255, 0.14); }
.copy-btn.copied { background: var(--green); color: #fff; border-color: var(--green); }

/* ====== Ack ====== */
.ack { padding-top: 70px; padding-bottom: 70px; }

/* ====== Footer ====== */
.footer {
  padding: 40px 24px 30px;
  border-top: 1px solid var(--line);
  background: var(--paper);
  color: var(--muted);
  font-size: 0.92rem;
}
.footer-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 16px;
}
.footer-row strong { color: var(--ink); }
.footer-links { display: flex; gap: 18px; font-weight: 600; }
.footer-links a { text-decoration: none; }
.footer-links a:hover { color: var(--ink); }
.footer-fine {
  margin: 18px 0 0;
  font-size: 0.84rem;
  opacity: 0.8;
}

/* ====== Reveal on scroll ====== */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 600ms ease, transform 600ms ease;
}
.reveal.in {
  opacity: 1;
  transform: none;
}

/* ====== Responsive ====== */
@media (max-width: 1024px) {
  .stat-grid, .feature-grid, .headline-results, .pipeline-steps, .ds-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .rationale-grid, .access-grid, .takeaways, .setup-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .navbar nav { display: none; }
  .section { padding: 80px 20px; }
  .hero { padding: 80px 20px 40px; }
  .stat-grid, .feature-grid, .headline-results, .pipeline-steps,
  .rationale-grid, .access-grid, .takeaways, .setup-grid, .ds-grid {
    grid-template-columns: 1fr;
  }
  .footer-row { flex-direction: column; align-items: flex-start; }
  .copy-btn { top: 10px; right: 10px; }
  pre { font-size: 0.8rem; padding: 20px 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}
