/* =====================================================
   Motion4Motion — Project Page
   Claude Code inspired palette (warm, paper-like)
   ===================================================== */

:root {
  /* Claude Code palette */
  --bg: #f5f1e8;            /* warm paper */
  --bg-soft: #efe8d8;       /* softer cream */
  --surface: #faf6ec;       /* card surface */
  --ink: #2b2620;           /* deep espresso text */
  --ink-soft: #6b6258;      /* muted text */
  --line: #e3dac4;          /* hairline borders */
  --accent: #d97757;        /* Claude orange */
  --accent-strong: #c2410c; /* deep burnt */
  --accent-soft: #e9a484;   /* warm peach */
  --highlight: #f4e3c1;     /* subtle highlight */
  --code-bg: #2b2620;
  --code-fg: #f5f1e8;

  --radius: 14px;
  --shadow-sm: 0 1px 2px rgba(43, 38, 32, 0.06);
  --shadow-md: 0 8px 24px rgba(43, 38, 32, 0.08);
  --shadow-lg: 0 20px 60px rgba(43, 38, 32, 0.15);

  --font-serif: 'Source Serif Pro', 'Iowan Old Style', 'Apple Garamond', Georgia, 'Times New Roman', serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

a {
  color: var(--accent-strong);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, color 0.2s ease;
}
a:hover { border-bottom-color: var(--accent); }

.mono { font-family: var(--font-mono); }
.serif { font-family: var(--font-serif); }

/* =====================================================
   HERO — full-viewport teaser with paper overlay
   ===================================================== */
.hero {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 10;
  overflow: hidden;
  background: var(--ink);
}

.hero__video-wrap {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #000;
}

.hero__video-wrap video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
  /* Soften in-video text so the page title stays readable on top. */
  filter: saturate(1.05) blur(4px) brightness(0.55);
  transform: scale(1.02); /* hide blur edges */
}

.hero__gradient {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at center, rgba(0,0,0,0.35) 0%, rgba(0,0,0,0.55) 80%),
    linear-gradient(to bottom, rgba(43, 38, 32, 0.35) 0%, rgba(43, 38, 32, 0.15) 30%, rgba(43, 38, 32, 0.3) 55%, rgba(43, 38, 32, 0.7) 100%);
}

.hero__content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  padding: 0 24px 80px;
  text-align: center;
  color: #fff;
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  background: rgba(250, 246, 236, 0.12);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(250, 246, 236, 0.18);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #faf6ec;
  margin-bottom: 24px;
}

.hero__badge::before {
  content: '';
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
}

.hero__title {
  font-family: var(--font-serif);
  font-size: clamp(2.8rem, 7vw, 5.5rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin-bottom: 18px;
  color: #faf6ec;
  text-shadow: 0 2px 30px rgba(0,0,0,0.4);
}

.hero__title em {
  font-style: italic;
  color: var(--accent-soft);
  font-weight: 500;
}

.hero__subtitle {
  font-size: clamp(1rem, 1.6vw, 1.35rem);
  font-weight: 400;
  color: rgba(250, 246, 236, 0.88);
  max-width: 780px;
  margin-bottom: 28px;
  line-height: 1.5;
}

.hero__authors {
  font-size: 0.95rem;
  color: rgba(250, 246, 236, 0.75);
  max-width: 900px;
  margin-bottom: 10px;
}
.hero__authors a { color: #faf6ec; border-bottom: 1px dashed rgba(250,246,236,0.4); }
.hero__authors sup { color: var(--accent-soft); margin-left: 2px; }

.hero__affiliations {
  font-size: 0.85rem;
  color: rgba(250, 246, 236, 0.6);
  margin-bottom: 24px;
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}

.hero__links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 30px;
}

.hero__links a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: rgba(250, 246, 236, 0.1);
  border: 1px solid rgba(250, 246, 236, 0.2);
  border-radius: 10px;
  color: #faf6ec;
  font-size: 0.9rem;
  font-weight: 500;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: all 0.25s ease;
}
.hero__links a:hover {
  background: var(--accent);
  border-color: var(--accent);
  transform: translateY(-1px);
  border-bottom-color: var(--accent);
}

.hero__scroll {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: rgba(250, 246, 236, 0.7);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  animation: bounce 2.4s ease-in-out infinite;
  pointer-events: none;
}
.hero__scroll::after {
  content: '';
  width: 1px; height: 28px;
  background: linear-gradient(to bottom, rgba(250,246,236,0.7), transparent);
}

@keyframes bounce {
  0%, 100% { transform: translate(-50%, 0); }
  50%      { transform: translate(-50%, 8px); }
}

/* Hero fade controlled by scroll (JS sets --hero-opacity) */
.hero {
  opacity: var(--hero-opacity, 1);
  pointer-events: auto;
  transition: opacity 0.1s linear;
}
.hero.is-hidden {
  pointer-events: none;
}

/* =====================================================
   MAIN CONTENT — paper-like stacked sections
   ===================================================== */
.spacer { height: 100vh; } /* holds hero in view initially */

main {
  position: relative;
  z-index: 20;
  background: var(--bg);
  border-top: 1px solid var(--line);
  box-shadow: 0 -20px 40px rgba(43, 38, 32, 0.06);
  padding-bottom: 60px;
}

.container {
  max-width: 920px;
  margin: 0 auto;
  padding: 0 32px;
}

section {
  padding: 90px 0;
  border-bottom: 1px solid var(--line);
}
section:last-child { border-bottom: none; }

.section-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-strong);
  background: var(--highlight);
  padding: 4px 10px;
  border-radius: 6px;
  margin-bottom: 18px;
}

h2 {
  font-family: var(--font-serif);
  font-size: clamp(1.9rem, 3.2vw, 2.7rem);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.2;
  margin-bottom: 22px;
  color: var(--ink);
}
h3 {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 600;
  margin: 28px 0 10px;
  color: var(--ink);
}

p {
  font-size: 1.05rem;
  color: var(--ink);
  margin-bottom: 16px;
  /* Let paragraphs span the full content column, matching figures/videos. */
  max-width: none;
}
p.lead {
  font-size: 1.2rem;
  color: var(--ink-soft);
  max-width: none;
}

strong { color: var(--ink); font-weight: 600; }
em.method { font-style: normal; font-weight: 600; color: var(--accent-strong); }

/* =====================================================
   ABSTRACT card
   ===================================================== */
.abstract {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 32px 36px;
  box-shadow: var(--shadow-sm);
}
.abstract p { margin-bottom: 0; }

/* =====================================================
   VIDEO EMBEDS
   ===================================================== */
.video-box {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--line);
}
.video-box iframe,
.video-box video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}
.video-box video {
  object-fit: contain;
  background: #000;
}
.video-caption {
  text-align: center;
  font-size: 0.9rem;
  color: var(--ink-soft);
  margin-top: 12px;
  font-style: italic;
}

/* Grid of small videos */
.video-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  margin-top: 8px;
}
@media (max-width: 640px) {
  .video-grid { grid-template-columns: 1fr; }
}

/* =====================================================
   FIGURES / IMAGES
   ===================================================== */
figure {
  margin: 28px 0;
}
figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--line);
  background: var(--surface);
}
figcaption {
  margin-top: 14px;
  font-size: 0.92rem;
  color: var(--ink-soft);
  text-align: center;
  line-height: 1.55;
  padding: 0 12px;
}
figcaption strong { color: var(--ink); }

/* =====================================================
   PIPELINE / METHOD grid
   ===================================================== */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 30px;
}
@media (max-width: 760px) {
  .two-col { grid-template-columns: 1fr; }
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 26px;
  box-shadow: var(--shadow-sm);
}
.card h3 { margin-top: 0; }
.card .num {
  display: inline-flex;
  width: 28px; height: 28px;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 13px;
  border-radius: 8px;
  align-items: center;
  justify-content: center;
  margin-right: 10px;
  font-weight: 600;
}

/* =====================================================
   BibTeX block
   ===================================================== */
.bibtex {
  position: relative;
  background: var(--code-bg);
  color: var(--code-fg);
  font-family: var(--font-mono);
  font-size: 0.88rem;
  line-height: 1.6;
  padding: 22px 24px;
  border-radius: var(--radius);
  overflow-x: auto;
  box-shadow: var(--shadow-md);
}
.bibtex pre { white-space: pre; }
.bibtex .copy-btn {
  position: absolute;
  top: 12px; right: 12px;
  background: rgba(245, 241, 232, 0.1);
  color: var(--code-fg);
  border: 1px solid rgba(245, 241, 232, 0.2);
  padding: 6px 12px;
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  cursor: pointer;
  transition: background 0.2s;
}
.bibtex .copy-btn:hover { background: var(--accent); border-color: var(--accent); }

/* =====================================================
   FOOTER
   ===================================================== */
footer {
  padding: 40px 0 60px;
  text-align: center;
  font-size: 0.88rem;
  color: var(--ink-soft);
  background: var(--bg-soft);
  border-top: 1px solid var(--line);
}
footer a { color: var(--accent-strong); }

/* =====================================================
   Reveal-on-scroll
   ===================================================== */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.reveal.in {
  opacity: 1;
  transform: translateY(0);
}

/* =====================================================
   Responsive tweaks
   ===================================================== */
@media (max-width: 640px) {
  section { padding: 60px 0; }
  .container { padding: 0 20px; }
  .abstract { padding: 22px 20px; }
  .hero__content { padding: 0 20px 60px; }
}
