/* RoboJEPA project page. Palette and type follow the paper figure and the intro video. */
:root {
  --paper: #F3F1EC;
  --paper-2: #EAE6DE;
  --ink: #22282E;
  --ink-2: #5F6B76;
  --ink-3: #8A939B;
  --rule: #CDC7BC;
  --coral: #C26B5C;
  --coral-d: #8F3F31;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  --title: Roboto, system-ui, -apple-system, "Segoe UI", sans-serif;
  --gutter: clamp(16px, 4vw, 48px);
  --hero-h: 100vh;
}
@supports (height: 100svh) { :root { --hero-h: 100svh; } }

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-snap-type: y proximity; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; }
sup { font-size: .62em; line-height: 0; position: relative; top: -.5em; vertical-align: baseline; }

/* ----------------------------------------------------------------------------- cover panel */
.hero {
  position: relative;
  height: var(--hero-h);
  min-height: 560px;
  overflow: hidden;
  scroll-snap-align: start;
  display: grid;
  place-items: center;
  isolation: isolate;
}
.hero-media { position: absolute; inset: 0; z-index: -1; will-change: transform; }
.hero-media video {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  background: var(--paper);
}
.wash {                       /* paper wash: strong behind the text, lighter at the edges so the video reads */
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 72% 70% at 50% 47%,
              rgba(243, 241, 236, .86) 0%, rgba(243, 241, 236, .74) 45%, rgba(243, 241, 236, .34) 100%);
}

.hero-inner {
  width: min(1180px, 100% - 2 * var(--gutter));
  text-align: center;
  padding: 0 0 clamp(40px, 6vh, 72px);
  will-change: transform, opacity;
}
.title {
  font-family: var(--title);
  font-weight: 700;
  font-size: clamp(64px, 10.5vw, 156px);
  letter-spacing: -.02em;
  line-height: 1;
  margin: 0;
}
.subtitle {
  font-family: var(--title);
  font-weight: 400;
  font-size: clamp(24px, 3.3vw, 52px);
  color: var(--ink-2);
  margin: .28em 0 0;
  line-height: 1.15;
}
.rule {
  width: min(520px, 60%);
  height: 0; border: 0;
  border-top: 1.5px solid var(--coral);
  margin: clamp(18px, 3.2vh, 36px) auto clamp(16px, 2.6vh, 30px);
}
.authors {
  font-size: clamp(15px, 1.25vw, 21px);
  max-width: 64em;
  margin: 0 auto;
  line-height: 1.6;
}
.authors span { white-space: nowrap; }
.affil {
  font-weight: 500;
  font-size: clamp(13px, 1.05vw, 18px);
  color: var(--ink-2);
  margin: .9em 0 0;
}
.affil span { white-space: nowrap; }
.affil .sep { margin: 0 .55em; color: var(--ink-3); }
.note { font-size: clamp(12px, .9vw, 15px); color: var(--ink-3); margin: .5em 0 0; }

.links {
  display: flex; justify-content: center; flex-wrap: wrap;
  gap: 14px;
  margin-top: clamp(22px, 3.6vh, 40px);
}
.btn {
  display: inline-flex; align-items: center; gap: .55em;
  padding: .78em 1.45em .78em 1.2em;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
  font-weight: 600;
  font-size: clamp(15px, 1.15vw, 18px);
  letter-spacing: .01em;
  box-shadow: 0 1px 2px rgba(34, 40, 46, .18), 0 6px 18px rgba(34, 40, 46, .12);
  transition: transform .2s cubic-bezier(.2, .8, .2, 1), box-shadow .2s, background .2s;
}
.btn svg { width: 1.25em; height: 1.25em; flex: none; }
.btn:hover { transform: translateY(-2px); background: #2F3E4D; box-shadow: 0 2px 4px rgba(34, 40, 46, .2), 0 10px 24px rgba(34, 40, 46, .16); }
.btn:focus-visible { outline: 2px solid var(--coral); outline-offset: 3px; }
.btn.is-soon { background: rgba(34, 40, 46, .55); cursor: default; }
.btn.is-soon:hover { transform: none; background: rgba(34, 40, 46, .55); }
.btn .soon {
  font-style: normal; font-family: var(--mono); font-weight: 500;
  font-size: .62em; letter-spacing: .08em; text-transform: uppercase;
  padding: .2em .55em; border-radius: 999px;
  background: rgba(243, 241, 236, .18);
}

.bg-caption {
  position: absolute; left: var(--gutter); bottom: 22px;
  max-width: 420px; margin: 0;
  padding: 10px 14px; border-radius: 10px;
  background: rgba(243, 241, 236, .82);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  font-family: var(--mono); font-size: 11.5px; line-height: 1.55;
  color: var(--ink-2);
  text-align: left;
}

.down, .up {
  display: grid; place-items: center;
  width: 52px; height: 52px; border-radius: 50%;
  color: var(--ink);
  background: rgba(243, 241, 236, .78);
  border: 1px solid rgba(34, 40, 46, .14);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  transition: background .2s, transform .2s;
}
.down svg, .up svg { width: 24px; height: 24px; }
.down {
  position: absolute; left: 50%; bottom: 22px;
  transform: translateX(-50%);
  animation: nudge 2.4s cubic-bezier(.45, 0, .55, 1) infinite;
}
.down:hover, .up:hover { background: var(--paper); }
@keyframes nudge { 0%, 100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, 7px); } }

/* ----------------------------------------------------------------------------- content */
.content {
  position: relative;
  padding: clamp(56px, 9vh, 112px) var(--gutter) clamp(40px, 6vh, 80px);
}
.block { max-width: 780px; margin: 0 auto; scroll-snap-align: start; scroll-margin-top: 24px; }
.block + .block { margin-top: clamp(56px, 8vh, 96px); }
.block.wide { max-width: 1180px; }
h2 {
  font-family: var(--mono); font-weight: 500;
  font-size: 13px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-2);
  margin: 0 0 1.4em;
  display: flex; align-items: center; gap: 14px;
}
h2::after { content: ""; flex: 1; border-top: 1px solid var(--rule); }
.abstract {
  font-family: var(--serif);
  font-size: clamp(18px, 1.35vw, 21px);
  line-height: 1.65;
  margin: 0;
  hyphens: auto; -webkit-hyphens: auto;
  text-wrap: pretty;
}
.abstract::first-letter { font-weight: 600; }

figure { margin: 0; }
.figure-frame {
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: clamp(12px, 2.4vw, 32px);
  overflow-x: auto;
}
.figure-frame img { display: block; width: 100%; height: auto; }
.va-stack { display: none; }
.subtitle .nb { white-space: nowrap; }
figcaption {
  max-width: 780px;
  margin: 1.2em auto 0;
  font-size: 15.5px; line-height: 1.6;
  color: var(--ink-2);
}
figcaption strong { color: var(--ink); font-weight: 600; }
figcaption em { font-style: normal; font-weight: 600; color: var(--ink); }

.foot {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  max-width: 1180px; margin: 0 auto;
  padding: 28px var(--gutter) 40px;
  border-top: 1px solid var(--rule);
  font-size: 14px; color: var(--ink-2);
}
.foot p { margin: 0; }
.foot a { text-decoration: none; border-bottom: 1px solid var(--rule); }
.foot a:hover { border-color: var(--ink-2); }

/* ----------------------------------------------------------------------------- phones and narrow screens */
@media (max-width: 760px), (max-aspect-ratio: 4/5) {
  .wash {
    background: radial-gradient(ellipse 95% 62% at 50% 46%,
                rgba(243, 241, 236, .88) 0%, rgba(243, 241, 236, .78) 50%, rgba(243, 241, 236, .42) 100%);
  }
  .hero-inner { padding-bottom: 120px; }
  .authors { font-size: 15px; line-height: 1.55; }
  .affil { font-size: 13px; line-height: 1.6; }
  .affil .sep { display: none; }
  .affil span { display: block; }
  .links { gap: 10px; }
  .btn { font-size: 15px; padding: .7em 1.15em .7em .95em; }
  .bg-caption {
    left: 50%; transform: translateX(-50%);
    width: calc(100% - 2 * var(--gutter)); max-width: none;
    bottom: 84px; text-align: center; font-size: 10.5px; padding: 8px 12px;
  }
  .down { bottom: 18px; width: 48px; height: 48px; }
  .va-full { display: none; }
  .va-stack { display: grid; gap: 22px; justify-items: center; }
  .va-stack img { width: 100%; max-width: 440px; }
  .btn .soon { display: none; }
  .btn.is-soon::after { content: "soon"; position: absolute; top: -9px; right: -6px; font: 500 9px/1 var(--mono);
    letter-spacing: .08em; text-transform: uppercase; padding: 4px 6px; border-radius: 999px;
    background: var(--coral); color: #fff; }
  .btn { position: relative; font-size: 14.5px; padding: .72em 1.05em .72em .9em; gap: .45em; }
  .links { flex-wrap: nowrap; }
}
@media (max-height: 640px) and (min-width: 761px) {
  .bg-caption { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .down { animation: none; }
  .btn { transition: none; }
}

/* author links: quiet until hovered */
.authors a { text-decoration: none; background-image: linear-gradient(currentColor, currentColor);
  background-size: 0% 1px; background-position: 0 100%; background-repeat: no-repeat;
  transition: background-size .25s cubic-bezier(.2, .8, .2, 1); }
.authors a:hover, .authors a:focus-visible { background-size: 100% 1px; }
