:root {
  --bg: #0a0b0a;
  --bg-2: #131513;
  --bg-3: #1b1e1b;
  --ink: #efeee9;
  --ink-2: #a2a69f;
  --ink-3: #6d716a;
  --rule: #272a26;
  --accent: #5ad19a;
  --accent-deep: #1a7a4a;
  --paper: #f3f2ee;
  --warn: #f2c94c;
  --wide: 1240px;
  --measure: 760px;
  --serif: "Instrument Serif", "Times New Roman", serif;
  --sans: "Inter", "Helvetica Neue", Arial, system-ui, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 72px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 17px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img, video { display: block; max-width: 100%; }
svg { width: 1em; height: 1em; flex: none; }
em { font-style: italic; }
::selection { background: var(--accent); color: #000; }

.wrap { max-width: var(--wide); margin: 0 auto; padding-left: 40px; padding-right: 40px; }

/* ---------- top nav (appears after the hero) ---------- */

.topnav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 16px;
  height: 60px;
  padding: 0 40px;
  background: rgba(10, 11, 10, .72);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--rule);
  transform: translateY(-100%);
  transition: transform .35s ease;
}
.topnav.show { transform: none; }
.wordmark { font-family: var(--serif); font-size: 26px; line-height: 1; letter-spacing: -.01em; }
.wordmark em { color: var(--accent); }
.nav-links { margin-left: auto; display: flex; gap: 26px; font-size: 14px; color: var(--ink-2); }
.nav-links a:hover, .nav-links a.active { color: var(--ink); }

/* ---------- hero ---------- */

.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  isolation: isolate;
}

/* static tilted wall of rounded reference photographs */
.hero-wall {
  position: absolute;
  inset: -22% -10%;
  z-index: -2;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  transform: rotate(-7deg);
}
.wall-col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.wall-tile { position: relative; aspect-ratio: var(--ar, 4 / 3); border-radius: 12px; overflow: hidden; background: var(--bg-2); flex: none; }
.wall-tile img { width: 100%; height: 100%; object-fit: cover; filter: saturate(.9); }

.hero-shade {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(10, 11, 10, .55) 0%, rgba(10, 11, 10, .25) 30%, rgba(10, 11, 10, .78) 68%, var(--bg) 100%),
    radial-gradient(120% 90% at 0% 100%, rgba(10, 11, 10, .85) 0%, rgba(10, 11, 10, 0) 60%);
}

.hero-content { width: 100%; padding-bottom: 96px; padding-top: 120px; }

h1 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(88px, 15vw, 216px);
  line-height: .86;
  letter-spacing: -.035em;
}
h1 em { color: var(--accent); }

.subtitle {
  margin: 22px 0 0;
  max-width: 760px;
  font-size: clamp(19px, 2.1vw, 25px);
  line-height: 1.32;
  color: var(--ink);
}

.authors { margin: 34px 0 0; display: flex; flex-wrap: wrap; gap: 4px 22px; font-size: 16px; font-weight: 500; }
.authors a { border-bottom: 1px solid rgba(255, 255, 255, .28); }
.authors a:hover { border-color: var(--accent); color: var(--accent); }
.affiliation { margin: 6px 0 0; color: var(--ink-2); font-size: 15px; }

.buttons { margin-top: 30px; display: flex; flex-wrap: wrap; gap: 10px; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  height: 44px;
  padding: 0 20px 0 17px;
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 999px;
  background: rgba(10, 11, 10, .35);
  backdrop-filter: blur(6px);
  font-size: 15px;
  font-weight: 500;
  transition: background .2s, color .2s, border-color .2s;
}
.btn svg { font-size: 18px; }
.btn:hover { border-color: var(--ink); background: rgba(255, 255, 255, .08); }
.btn.primary { background: var(--ink); color: #0a0b0a; border-color: var(--ink); }
.btn.primary:hover { background: var(--accent); border-color: var(--accent); }


/* ---------- sections ---------- */

main > section { padding-top: 132px; }

h2 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(40px, 5vw, 64px);
  line-height: 1.02;
  letter-spacing: -.02em;
}
h2 em { color: var(--accent); }
h3 { margin: 0 0 8px; font-size: 17px; line-height: 1.35; font-weight: 600; }

.section-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; align-items: end; margin-bottom: 40px; }
.section-head p { margin: 0; color: var(--ink-2); max-width: 520px; justify-self: end; }

.reveal { opacity: 0; transform: translateY(28px); transition: opacity .9s ease, transform .9s cubic-bezier(.2, .7, .2, 1); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- abstract ---------- */

.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 40px; }
.abstract p { margin: 0 0 1em; color: var(--ink-2); }
.abstract .lead { font-size: 21px; line-height: 1.55; color: var(--ink); }
.abstract .more-text { display: none; }
.abstract.open .more-text { display: block; }
.text-btn { padding: 0; border: 0; background: none; color: var(--accent); font: 500 15px/1.4 var(--sans); cursor: pointer; }
.text-btn::after { content: " \2193"; }
.abstract.open .text-btn::after { content: " \2191"; }

/* ---------- featured carousel ---------- */

.featured .section-head { margin-bottom: 36px; }
.carousel { position: relative; }
.track {
  position: relative;
  display: flex;
  gap: 28px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  padding: 8px calc(50vw - min(430px, 41vw)) 4px;
  overscroll-behavior-x: contain;
}
.track::-webkit-scrollbar { display: none; }

/* every card has the same height and the width of its own clip */
.card {
  --ch: min(500px, 62vh, calc(86vw / var(--ar)));
  flex: none;
  width: calc(var(--ch) * var(--ar));
  scroll-snap-align: center;
  margin: 0;
  transition: opacity .5s ease, transform .5s ease;
  opacity: .32;
  transform: scale(.95);
}
.card .media { height: var(--ch); }
.card.active { opacity: 1; transform: none; }

/* one example: the video with its reference inset bottom-left */
.media { position: relative; overflow: hidden; border-radius: 14px; background: #000; cursor: zoom-in; }
.media:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.media video, .media .fill { display: block; width: 100%; height: 100%; object-fit: cover; }
.reference-inset {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 3;
  width: clamp(72px, 25%, 168px);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .8);
  border-radius: 7px;
  background: #101310;
  pointer-events: none;
}
.reference-inset img { display: block; width: 100%; height: auto; aspect-ratio: var(--reference-ar, 4 / 3); object-fit: contain; }
.hover-prompt {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  z-index: 2;
  margin: 0;
  padding: 16px 18px 56px;
  background: linear-gradient(to bottom, rgba(0, 0, 0, .84), rgba(0, 0, 0, .5) 60%, transparent);
  color: #f4f4f0;
  font-size: 14.5px;
  line-height: 1.5;
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity .25s ease, transform .25s ease;
  pointer-events: none;
}
.media:hover .hover-prompt, .media:focus-visible .hover-prompt { opacity: 1; transform: none; }
.media.pending .fill { filter: brightness(.5) saturate(.8); }
.pending-badge {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  padding: 7px 14px;
  border: 1px dashed rgba(255, 255, 255, .5);
  border-radius: 999px;
  background: rgba(10, 11, 10, .55);
  color: var(--ink);
  font-size: 13px;
  white-space: nowrap;
}

/* reference photograph -> WildIcon video, equal height, each at its own aspect ratio */
.pair { position: relative; display: flex; gap: 10px; align-items: stretch; cursor: zoom-in; }
.pair:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 14px; }
.panel-ref, .panel-out { position: relative; flex: var(--ar) 1 0; min-width: 0; aspect-ratio: var(--ar); border-radius: 14px; overflow: hidden; background: #000; }
.panel-ref img, .panel-out video, .panel-out img { width: 100%; height: 100%; object-fit: contain; }
.tag {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(10, 11, 10, .62);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.3;
}
.panel-out .tag { background: var(--accent); color: #07140d; }
.join {
  position: absolute;
  top: 50%;
  left: var(--join);
  z-index: 3;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  margin: -19px 0 0 -19px;
  border-radius: 50%;
  background: var(--ink);
  color: #0a0b0a;
  font-size: 16px;
  box-shadow: 0 0 0 5px var(--bg);
  pointer-events: none;
}

.panel-out.pending {
  display: grid;
  place-items: center;
  border: 1.5px dashed var(--ink-3);
  background: repeating-linear-gradient(135deg, var(--bg-2) 0 14px, var(--bg) 14px 28px);
}
.slot { display: grid; justify-items: center; gap: 10px; padding: 16px; text-align: center; color: var(--ink-2); font-size: 14px; line-height: 1.35; }
.slot svg { width: 46px; height: 46px; padding: 13px 11px 13px 15px; border: 1.5px solid var(--ink-3); border-radius: 50%; color: var(--ink-2); }

.cap { padding: 14px 2px 0; }
.cap .name { font-family: var(--serif); font-size: 28px; line-height: 1.1; }
.original-reference { color: var(--ink-2); font-size: 12px; }
.cap .prompt { margin: 10px 0 0; color: var(--ink-2); font-size: 15px; max-width: 760px; }
@media (hover: hover) and (pointer: fine) { .cap .prompt { display: none; } }
@media (hover: none) { .hover-prompt { display: none; } }

.carousel-controls { display: flex; align-items: center; justify-content: center; gap: 22px; margin-top: 28px; }
.round {
  display: inline-grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid var(--rule);
  border-radius: 50%;
  background: var(--bg-2);
  color: var(--ink);
  font-size: 18px;
  cursor: pointer;
  transition: border-color .2s, background .2s;
}
.round:hover { border-color: var(--ink-2); background: var(--bg-3); }
.round.small { width: 38px; height: 38px; font-size: 15px; }
.dots { display: flex; gap: 8px; }
.dots button { width: 8px; height: 8px; padding: 0; border: 0; border-radius: 999px; background: var(--ink-3); cursor: pointer; transition: width .3s, background .3s; }
.dots button[aria-current="true"] { width: 26px; background: var(--accent); }

/* ---------- observation: frequency lens ---------- */

.observation { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 56px; align-items: center; }
.obs-text p { color: var(--ink-2); margin: 20px 0 0; }
.obs-text .hint { color: var(--ink); }
.obs-text .formula { font-size: 14px; color: var(--ink-3); }
.obs-text .formula i { font-family: var(--serif); font-size: 1.15em; }

.seg-control { display: inline-flex; flex-wrap: wrap; margin-top: 24px; padding: 4px; gap: 2px; border: 1px solid var(--rule); border-radius: 999px; background: var(--bg-2); }
.seg-control button {
  padding: 8px 15px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--ink-2);
  font: 500 14px/1.2 var(--sans);
  cursor: pointer;
}
.seg-control button[aria-checked="true"] { background: var(--ink); color: #0a0b0a; }

.lens-stage {
  --x: 50%;
  --y: 50%;
  --r: 120px;
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  background: #000;
  cursor: none;
  touch-action: none;
}
.lens-stage img { width: 100%; height: auto; user-select: none; -webkit-user-drag: none; }
.lens-top {
  position: absolute;
  inset: 0;
  height: 100% !important;
  clip-path: circle(var(--r) at var(--x) var(--y));
}
.lens-ring {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: calc(var(--r) * 2);
  height: calc(var(--r) * 2);
  margin: calc(var(--r) * -1) 0 0 calc(var(--r) * -1);
  border: 1.5px solid rgba(255, 255, 255, .85);
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .4), 0 10px 40px rgba(0, 0, 0, .45);
  pointer-events: none;
}
.lens-stage.layer-hf .lens-top, .lens-stage.layer-hf .lens-ring { display: none; }
.lens-stage.layer-hf { cursor: default; }

.lens-picker { display: flex; gap: 10px; margin-top: 14px; overflow-x: auto; scrollbar-width: none; }
.lens-picker button {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px 5px 5px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--bg-2);
  color: var(--ink-2);
  font: 500 14px/1 var(--sans);
  cursor: pointer;
}
.lens-picker img { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; }
.lens-picker button[aria-pressed="true"] { border-color: var(--accent); color: var(--ink); }

/* ---------- method & dataset ---------- */

.panel { margin: 0; padding: clamp(14px, 2.4vw, 30px); border-radius: 16px; background: var(--paper); }
.panel img { width: 100%; height: auto; }

.points { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; margin-top: 44px; }
.points > div { border-top: 1px solid var(--rule); padding-top: 18px; }
.points p { margin: 0; color: var(--ink-2); font-size: 15px; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-bottom: 36px; }
.stats > div { border-top: 1px solid var(--rule); padding-top: 14px; }
.stats .num { display: block; font-family: var(--serif); font-size: clamp(56px, 7vw, 96px); line-height: 1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stats .label { display: block; margin-top: 8px; color: var(--ink-2); font-size: 15px; }

.fine { margin: 20px 0 0; font-size: 14px; color: var(--ink-3); }
a.arrow { color: var(--accent); font-weight: 500; margin-left: 6px; }
a.arrow::after { content: " \2192"; }

/* ---------- gallery ---------- */

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 26px; }
.chips button {
  padding: 8px 16px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--bg-2);
  color: var(--ink-2);
  font: 500 14px/1.2 var(--sans);
  cursor: pointer;
}
.chips button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #0a0b0a; }
/* justified rows: one height per row, every clip at its own aspect ratio (sizes set by page.js) */
.grid { display: flex; flex-wrap: wrap; align-items: flex-start; column-gap: 14px; row-gap: 14px; }
.g-tile { margin: 0; flex: none; }
.g-tile[hidden] { display: none; }
.grid.collapsed {
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 260px), transparent);
  mask-image: linear-gradient(to bottom, #000 calc(100% - 260px), transparent);
}
.more-wrap { display: flex; justify-content: center; margin-top: 12px; }
.more-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 48px;
  padding: 0 22px 0 24px;
  border: 1px solid var(--ink-3);
  border-radius: 999px;
  background: var(--bg-2);
  color: var(--ink);
  font: 500 15px/1 var(--sans);
  cursor: pointer;
  transition: border-color .2s, background .2s;
}
.more-btn:hover { border-color: var(--ink); background: var(--bg-3); }
.more-btn svg { font-size: 16px; transition: transform .3s ease; }
.more-btn[aria-expanded="true"] svg { transform: rotate(180deg); }
.g-tile .media { width: 100%; border-radius: 10px; }
.g-tile .reference-inset { left: 8px; bottom: 8px; width: clamp(54px, 27%, 116px); border-radius: 5px; }
.g-tile .hover-prompt { padding: 10px 12px 36px; font-size: 12.5px; line-height: 1.45; }
.g-tile .cap { display: none; padding: 8px 2px 0; }
.g-tile .cap .prompt { display: none; }
@media (hover: none) {
  .g-tile .cap { display: block; }
  .g-tile .cap .prompt {
    margin-top: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 13px;
  }
}

/* ---------- citation & footer ---------- */

#acknowledgements h2 { font-size: clamp(36px, 3.6vw, 46px); }
.ack p { margin: 0 0 1em; max-width: var(--measure); color: var(--ink-2); }
.ack a { color: var(--ink); border-bottom: 1px solid var(--rule); transition: color .2s, border-color .2s; }
.ack a:hover { color: var(--accent); border-color: var(--accent); }


#citation h2 { margin-bottom: 28px; }
.bibtex { position: relative; }
.bibtex pre {
  margin: 0;
  padding: 26px 28px;
  border: 1px solid var(--rule);
  border-radius: 14px;
  background: var(--bg-2);
  color: var(--ink);
  font: 13.5px/1.7 ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  overflow-x: auto;
}
.copy {
  position: absolute;
  top: 14px;
  right: 14px;
  padding: 6px 14px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--bg-3);
  color: var(--ink);
  font: 500 13px/1.3 var(--sans);
  cursor: pointer;
}
.copy:hover { border-color: var(--ink-2); }

.footer { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; margin-top: 140px; padding-top: 28px; padding-bottom: 48px; border-top: 1px solid var(--rule); color: var(--ink-3); font-size: 14px; }

/* ---------- back to top (ring shows scroll progress) ---------- */

.to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 40;
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(19, 21, 19, .82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--ink);
  cursor: pointer;
  opacity: 0;
  transform: translateY(12px) scale(.9);
  pointer-events: none;
  transition: opacity .3s ease, transform .3s ease, background .2s;
}
.to-top.show { opacity: 1; transform: none; pointer-events: auto; }
.to-top:hover { background: var(--bg-3); }
.to-top:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.to-top .ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.to-top .ring circle { fill: none; stroke-width: 2; }
.to-top .ring .track { stroke: var(--rule); }
.to-top .ring .bar { stroke: var(--accent); stroke-linecap: round; stroke-dasharray: 138.23; stroke-dashoffset: 138.23; }
.to-top .arrow { width: 20px; height: 20px; margin: 0; display: block; }

/* ---------- viewer ---------- */

.viewer {
  width: min(1280px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  padding: 28px;
  border: 1px solid var(--rule);
  border-radius: 16px;
  background: var(--bg-2);
  color: var(--ink);
}
.viewer::backdrop { background: rgba(0, 0, 0, .82); backdrop-filter: blur(4px); }
.viewer-close { position: absolute; top: 14px; right: 14px; padding: 6px 14px; border: 1px solid var(--rule); border-radius: 999px; background: var(--bg-3); color: var(--ink); font: 500 13px/1.3 var(--sans); cursor: pointer; }
.viewer-body { margin-top: 34px; }
.viewer-body .pair { cursor: default; }
.viewer-title { margin: 16px 0 0; font-family: var(--serif); font-size: 30px; line-height: 1; }
.viewer-prompt { margin: 14px 0 0; max-width: var(--measure); font-size: 15px; color: var(--ink-2); }

/* ---------- small screens ---------- */

@media (max-width: 900px) {
  .wall-col:nth-child(n+6) { display: none; }
  .nav-links { display: none; }
  .section-head, .split, .observation { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .section-head p { justify-self: start; }
  .points, .stats { grid-template-columns: 1fr; gap: 22px; }
}

@media (max-width: 640px) {
  .wall-col:nth-child(n+5) { display: none; }
  .to-top { right: 14px; bottom: 14px; width: 44px; height: 44px; }
  body { font-size: 16px; }
  .wrap { padding-left: 16px; padding-right: 16px; }
  .topnav { padding: 0 16px; }
  .hero-wall { gap: 8px; inset: -20% -16%; }
  .wall-col { gap: 8px; }
  .wall-tile { border-radius: 9px; }
  .hero-content { padding-bottom: 84px; }
  .btn { height: 40px; padding: 0 16px 0 14px; font-size: 14px; }
  main > section { padding-top: 96px; }
  .track { gap: 14px; }
  .media { border-radius: 10px; }
  .pair { gap: 6px; }
  .panel-ref, .panel-out { border-radius: 10px; }
  .tag { top: 7px; left: 7px; font-size: 11px; padding: 2px 7px; }
  .join { width: 28px; height: 28px; margin: -14px 0 0 -14px; font-size: 12px; box-shadow: 0 0 0 3px var(--bg); }
  .slot { font-size: 12px; gap: 6px; padding: 8px; }
  .slot svg { width: 30px; height: 30px; padding: 8px 6px 8px 10px; }
  .cap .name { font-size: 24px; }
  .lens-stage { --r: 80px; }
  .seg-control button { padding: 7px 10px; font-size: 13px; }
  .footer { flex-direction: column; }
  .viewer { padding: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .wall-col { animation: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .card, .topnav, .to-top { transition: none; }
}
