/* Artificial Foveated Perception, CoRL 2026 project page */

:root {
  --bg: #fbfbfd;
  --surface: #ffffff;
  --ink: #1d1d1f;
  --ink-2: #494950;
  --ink-3: #6e6e73;
  --line: rgba(0, 0, 0, 0.08);
  --line-strong: rgba(0, 0, 0, 0.14);

  --afp: #2563eb;
  --afp-soft: rgba(37, 99, 235, 0.12);
  --direct: #8e8e93;
  --direct-soft: rgba(29, 29, 31, 0.06);

  --dark-bg: #000000;
  --dark-surface: #141416;
  --dark-ink: #f5f5f7;
  --dark-ink-3: #a1a1a6;
  --dark-line: rgba(255, 255, 255, 0.12);

  --radius: 20px;
  --radius-sm: 12px;

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;

  --measure: 66ch;
  --gutter: clamp(20px, 5vw, 64px);
}

* { box-sizing: border-box; }

html {
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 72px;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-optical-sizing: auto;
}

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 0.15em; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }
img, video, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }

::selection { background: rgba(37, 99, 235, 0.18); }

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

/* Layout */

.wrap {
  width: min(1120px, 100% - 2 * var(--gutter));
  margin-inline: auto;
}

.wrap-narrow {
  width: min(760px, 100% - 2 * var(--gutter));
  margin-inline: auto;
}

section { padding-block: clamp(72px, 10vw, 128px); }
section:not(.band) + section:not(.band) { padding-top: 0; }

.eyebrow {
  margin: 0 0 12px;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--afp);
}

h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; }

h2 {
  font-size: clamp(1.75rem, 3.6vw, 2.75rem);
  max-width: 22ch;
}

h3 {
  font-size: 1.25rem;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.lede {
  font-size: clamp(1.125rem, 1.6vw, 1.375rem);
  line-height: 1.5;
  color: var(--ink-2);
  max-width: var(--measure);
  margin-top: 20px;
}

.prose {
  max-width: var(--measure);
  color: var(--ink-2);
}

.prose strong { color: var(--ink); font-weight: 600; }
.prose.wide { max-width: none; }

.grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(28px, 4vw, 56px);
  align-items: start;
}

.grid-2 > * { min-width: 0; }

@media (min-width: 880px) {
  .grid-2 { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
  .grid-2.even { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .grid-2.flip > :first-child { order: 2; }
}

/* Nav */

.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 52px;
  display: flex;
  align-items: center;
  background: rgba(251, 251, 253, 0.72);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--line);
}

.nav .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.nav-brand {
  font-weight: 600;
  letter-spacing: -0.01em;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

.nav-brand svg { width: 22px; height: 22px; }

.nav-links {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.nav-links::-webkit-scrollbar { display: none; }

@media (max-width: 480px) {
  .nav-links {
    padding-right: 32px;
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent);
    mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent);
  }
}

.nav-links a {
  font-size: 0.875rem;
  color: var(--ink-3);
  padding: 6px 10px;
  border-radius: 999px;
  white-space: nowrap;
  transition: color 160ms ease, background-color 160ms ease;
}

.nav-links a:hover { text-decoration: none; }

@media (hover: hover) and (pointer: fine) {
  .nav-links a:hover { color: var(--ink); background: var(--direct-soft); }
}

/* Hero */

.hero {
  padding-top: clamp(56px, 8vw, 104px);
  padding-bottom: clamp(24px, 3vw, 40px);
  text-align: center;
}

.hero .venue {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink-3);
  padding: 6px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  margin-bottom: 28px;
}

.hero .venue::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--afp);
}

.hero h1 {
  font-size: clamp(1.5rem, 5.2vw, 4.25rem);
  letter-spacing: -0.03em;
  line-height: 1.05;
  white-space: nowrap;
}

@media (max-width: 380px) {
  .hero h1 { white-space: normal; }
}

.hero h1 span {
  display: block;
  margin: 14px auto 0;
  max-width: 30ch;
  font-size: 0.5em;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--ink-3);
  white-space: normal;
  text-wrap: balance;
}

.authors {
  margin: 36px auto 0;
  max-width: 820px;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--ink-2);
}

.authors .name { white-space: nowrap; }
.authors sup { font-size: 0.7em; color: var(--ink-3); margin-left: 1px; }
.affils { margin-top: 10px; font-size: 0.9375rem; color: var(--ink-3); line-height: 1.7; }
.affils span { white-space: nowrap; }
.affils sup { font-size: 0.7em; margin-right: 2px; }
.corr { margin-top: 6px; font-size: 0.875rem; color: var(--ink-3); }
.corr a { color: var(--ink-2); }

.actions {
  margin-top: 32px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  font-size: 0.9375rem;
  font-weight: 500;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  transition: transform 160ms var(--ease-out), background-color 160ms ease, border-color 160ms ease;
}

.btn:hover { text-decoration: none; }
.btn:active { transform: scale(0.97); }
.btn svg { width: 18px; height: 18px; flex: none; }

.btn-primary {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

@media (hover: hover) and (pointer: fine) {
  .btn:hover { border-color: rgba(0, 0, 0, 0.28); }
  .btn-primary:hover { background: #000; border-color: #000; }
}

/* Overview triptych: three small synchronized clips under the headline */

.triptych {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 32px;
}

.triptych figure {
  margin: 0;
}

.triptych video {
  width: 100%;
  height: auto;
  aspect-ratio: 448 / 416;
  object-fit: cover;
  border-radius: var(--radius-sm);
  background: #000;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06), 0 12px 32px -16px rgba(0, 0, 0, 0.25);
}

.triptych figcaption {
  padding: 8px 2px 0;
  font-size: 0.8125rem;
  color: var(--ink-3);
}

.triptych figure.afp figcaption { color: var(--afp); font-weight: 600; }

.up { color: var(--afp); }

/* Cards and figures */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(20px, 3vw, 32px);
}

.figure {
  border-radius: var(--radius);
  overflow: hidden;
  background: #000;
}

.figure video { width: 100%; height: auto; }

.caption {
  margin-top: 12px;
  font-size: 0.9375rem;
  color: var(--ink-3);
}

/* Diagram */

.diagram {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr;
}

@media (min-width: 960px) {
  .diagram { grid-template-columns: 1fr auto 1.6fr auto 1fr; align-items: stretch; }
}

.node {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  min-height: 84px;
}

.node .k {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 6px;
}

.node .v { font-weight: 500; line-height: 1.35; }
.node .d { margin-top: 6px; font-size: 0.875rem; color: var(--ink-3); line-height: 1.45; }

.node-afp {
  border-color: rgba(37, 99, 235, 0.35);
  background: linear-gradient(180deg, rgba(37, 99, 235, 0.06), rgba(37, 99, 235, 0.02));
}

.node-afp .k { color: var(--afp); }

.node-stack { display: grid; gap: 12px; }

@media (min-width: 600px) and (max-width: 959px) {
  .node-stack { grid-template-columns: 1fr 1fr; }
}

.arrow {
  display: grid;
  place-items: center;
  color: var(--ink-3);
}

.arrow svg { width: 22px; height: 22px; }

@media (max-width: 959px) {
  .arrow svg { transform: rotate(90deg); }
}

.paths { display: grid; gap: 12px; margin-top: 14px; }

.path {
  display: grid;
  gap: 2px;
  font-size: 0.875rem;
  color: var(--ink-2);
  line-height: 1.45;
}

.path .k { margin-bottom: 0; }

/* Math */

math {
  font-size: 1.05em;
  font-family: "Cambria Math", "STIX Two Math", "Latin Modern Math", "Libertinus Math", math;
}

mi[mathvariant="bold"] { font-weight: 700; font-style: normal; text-transform: none; }

.math-block {
  margin: 20px 0;
  padding: 18px 20px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--line);
  overflow-x: auto;
  max-width: 100%;
}

.math-block math { display: block; text-align: center; font-size: 1.15em; }
.math-block mtd { padding: 0.3em 0.6em; }

/* Stat tiles */

.stats {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 20px 22px;
}

.stat .n {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.stat .l { margin-top: 8px; font-size: 0.9375rem; color: var(--ink-3); line-height: 1.4; }
.stat .from { font-size: 0.875rem; color: var(--ink-3); margin-top: 6px; font-variant-numeric: tabular-nums; }

/* Controls */

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.seg {
  display: inline-flex;
  padding: 3px;
  border-radius: 999px;
  background: var(--direct-soft);
  position: relative;
}

.seg button {
  position: relative;
  z-index: 1;
  height: 32px;
  padding: 0 14px;
  border: 0;
  background: transparent;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ink-3);
  cursor: pointer;
  transition: color 160ms ease, transform 120ms var(--ease-out);
  white-space: nowrap;
}

.seg button:active { transform: scale(0.97); }
.seg button[aria-pressed="true"] { color: var(--ink); }

/* The thumb covers the whole track; clip-path reveals the pressed segment. */
.seg .thumb {
  position: absolute;
  inset: 3px;
  border-radius: 999px;
  background: var(--surface);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 0 0 0.5px rgba(0, 0, 0, 0.04);
  clip-path: inset(0 100% 0 0 round 999px);
}

.seg.ready .thumb { transition: clip-path 260ms var(--ease-out); }

.legend {
  display: flex;
  gap: 16px;
  font-size: 0.8125rem;
  color: var(--ink-3);
}

.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend i { width: 12px; height: 12px; border-radius: 3px; background: var(--direct); }
.legend i.afp { background: var(--afp); }

/* Bar charts */

.chart { width: 100%; overflow: visible; }

.chart text {
  font-family: var(--font);
  font-size: 13px;
  fill: var(--ink-2);
}

.chart .lab { font-size: 13.5px; fill: var(--ink); }
.chart .val { font-size: 12.5px; fill: var(--ink-3); font-variant-numeric: tabular-nums; }
.chart .val.afp { fill: var(--afp); font-weight: 600; }
.chart .grid line { stroke: var(--line); }
.chart .axis text { fill: var(--ink-3); font-size: 11.5px; }

.chart .bar {
  transform-box: fill-box;
  transform-origin: left center;
  transition: transform 360ms var(--ease-out);
}

.chart .bar.direct { fill: var(--direct); }
.chart .bar.afp { fill: var(--afp); }

.chart .val { transition: transform 360ms var(--ease-out), opacity 200ms ease; }
.chart .val.pending { opacity: 0; }

.chart-title {
  font-size: 0.9375rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.chart-sub { font-size: 0.8125rem; color: var(--ink-3); margin-bottom: 14px; }

.charts-2 {
  display: grid;
  gap: 28px;
}

@media (min-width: 880px) {
  .charts-2 { grid-template-columns: 1fr 1fr; }
}

/* Dark band with videos */

.band {
  background: var(--dark-bg);
  color: var(--dark-ink);
}

.band .eyebrow { color: #6ea8ff; }
.band .lede, .band .prose { color: var(--dark-ink-3); }
.band .prose strong { color: var(--dark-ink); }
.band .caption { color: var(--dark-ink-3); }
.band .legend { color: var(--dark-ink-3); }

.pair {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr 1fr;
}

@media (max-width: 560px) {
  .pair { gap: 8px; }
  .pair figure { border-radius: var(--radius-sm); }
  .pair figcaption { left: 8px; top: 8px; padding: 4px 8px; font-size: 0.6875rem; }
}

.pair figure {
  margin: 0;
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--dark-surface);
}

.pair video {
  width: 100%;
  height: auto;
  aspect-ratio: var(--ar, 4 / 3);
  object-fit: cover;
  cursor: pointer;
}

.pair figcaption {
  position: absolute;
  left: 14px;
  top: 14px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 600;
  background: rgba(0, 0, 0, 0.5);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  color: #fff;
  pointer-events: none;
}

.pair figure.afp figcaption { background: rgba(37, 99, 235, 0.85); }

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.chip {
  height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--dark-line);
  background: transparent;
  color: var(--dark-ink-3);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease, transform 120ms var(--ease-out);
}

.chip:active { transform: scale(0.97); }
.chip[aria-pressed="true"] { background: #fff; color: #000; border-color: #fff; }

@media (hover: hover) and (pointer: fine) {
  .chip:hover:not([aria-pressed="true"]) { border-color: rgba(255, 255, 255, 0.35); color: var(--dark-ink); }
}

.strip {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, 1fr);
}

@media (min-width: 720px) {
  .strip { grid-template-columns: repeat(4, 1fr); }
}

.strip figure {
  margin: 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--dark-surface);
}

.strip video { width: 100%; height: auto; aspect-ratio: var(--ar, 4 / 3); object-fit: cover; cursor: pointer; }
.strip figcaption { padding: 10px 4px 0; font-size: 0.8125rem; color: var(--dark-ink-3); }

.triptych video, .figure video { cursor: pointer; }

/* Tool section */

.tool-steps {
  display: grid;
  gap: 14px;
  margin-top: 24px;
  counter-reset: step;
}

.tool-steps > div {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 14px;
  align-items: start;
  color: var(--ink-2);
}

.tool-steps > div::before {
  counter-increment: step;
  content: counter(step);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.8125rem;
  font-weight: 600;
  background: var(--afp-soft);
  color: var(--afp);
  margin-top: 1px;
}

/* Citation */

.cite {
  display: grid;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 14px 22px 24px;
}

.cite pre {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.8125rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--ink-2);
}

.cite .copy {
  justify-self: end;
  height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: transform 160ms var(--ease-out), background-color 160ms ease;
}

.cite .copy:active { transform: scale(0.97); }
.cite .copy svg { width: 14px; height: 14px; }

@media (hover: hover) and (pointer: fine) {
  .cite .copy:hover { background: var(--direct-soft); }
}

/* Footer */

footer {
  padding: 40px 0 56px;
  border-top: 1px solid var(--line);
  font-size: 0.875rem;
  color: var(--ink-3);
}

footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
  justify-content: space-between;
}

footer a { color: var(--ink-2); }

/* Reveal on scroll (only when JS is running) */

.js .reveal {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 600ms var(--ease-out), transform 600ms var(--ease-out);
  transition-delay: var(--delay, 0ms);
}

.js .reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { transform: none; transition: opacity 300ms ease; }
  .chart .bar, .chart .val { transition: none; }
  .seg.ready .thumb { transition: none; }
  .btn, .chip, .seg button, .cite .copy { transition: none; }
}

@media (prefers-reduced-transparency: reduce) {
  .nav { background: var(--bg); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
