/* Leaning Over to Reach Far-Away Objects — project page
   palette drawn from the paper's own figures:
   navy = success mean, green = hardware, red = failure (used only there) */
:root {
  --paper: #12161F;          /* page ground: deep ink navy */
  --ink: #E9E6DC;            /* text: warm off-white */
  --accent: #4CBE6E;
  --fail: #D8574A;
  --wood: #C8A165;
  --wood-deep: #A97F42;
  --mute: #97A0AD;
  --line: #2A3140;
  --card: #FCFBF8;           /* figures stay printed on white */
  --col: 1000px;
  --wide: 1000px;
}

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

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: "Source Serif 4", Georgia, serif;
  font-size: clamp(1.05rem, 0.9rem + 0.5vw, 1.34rem);
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
}

.mono { font-family: "IBM Plex Mono", ui-monospace, monospace; }
.serif { font-family: "Source Serif 4", Georgia, serif; }

.col { max-width: var(--col); margin: 0 auto; padding: 0 1.25rem; }

h1, h2 {
  font-family: "Archivo", "Helvetica Neue", sans-serif;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

a { color: var(--accent); }
a:focus-visible, .btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ---------- hero ---------- */
.hero { padding-top: 4.5rem; text-align: center; }

.eyebrow {
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mute);
  margin-bottom: 1.4rem;
}

.hero h1 {
  font-size: clamp(2.1rem, 6vw, 3.6rem);
  font-weight: 800;
  line-height: 1.05;
}

.subtitle {
  max-width: 680px;
  margin: 1.3rem auto 0;
  color: #B7BDC9;
  font-size: clamp(1.08rem, 0.95rem + 0.4vw, 1.3rem);
}

.links {
  display: flex;
  gap: 0.7rem;
  justify-content: center;
  flex-wrap: wrap;
  margin: 1.8rem 0 3rem;
}

.btn {
  font-family: "Archivo", sans-serif;
  font-weight: 600;
  font-size: 0.92rem;
  text-decoration: none;
  color: var(--ink);
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  padding: 0.5rem 1.15rem;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  transition: background 0.15s, color 0.15s;
}
.btn:hover { background: var(--ink); color: var(--paper); }
.btn-ico { font-size: 0.7em; }
.btn-soon {
  border-style: dashed;
  border-color: var(--mute);
  color: var(--mute);
  cursor: default;
}
.btn-soon:hover { background: none; color: var(--mute); }

/* hero media "rests" on the table line */
.on-table {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 0 1.25rem;
  position: relative;
  z-index: 1;
}
.hero-media {
  max-width: 860px;
  margin: 0 auto;
}
.hero-media + .hero-media { margin-top: 1.6rem; }
.hero-media img, .hero-media video {
  width: 100%;
  display: block;
  border-radius: 10px;
  border: 1px solid var(--line);
  border-bottom: none;
  box-shadow: 0 22px 48px -18px rgba(0, 0, 0, 0.65);
}
.hero-media figcaption {
  font-size: clamp(0.76rem, 0.7rem + 0.15vw, 0.85rem);
  color: var(--mute);
  padding: 0.6rem 0.2rem 0;
  text-align: left;
}

/* the signature: a wood table-top rule */
.table-line {
  height: 5px;
  background:
    linear-gradient(90deg, var(--wood) 0%, var(--wood-deep) 50%, var(--wood) 100%);
  box-shadow: 0 2px 8px rgba(200, 161, 101, 0.35);
  margin-top: -2.4rem; /* tuck under the media caption */
  position: relative;
  z-index: 0;
}
.hero .table-line { margin-top: -2.35rem; }

/* ---------- phase strip ---------- */
.phases {
  max-width: var(--wide);
  margin: 3.2rem auto 0;
  padding: 0 1.25rem;
}
.phase-strip {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.7rem;
}
.phase-strip li {
  text-align: center;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}
.phase-strip li.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .phase-strip li { opacity: 1; transform: none; transition: none; }
}
.phase-strip img {
  width: 100%;
  display: block;
  border-radius: 6px;
  border: 1px solid var(--line);
}
.phase-strip span {
  display: inline-block;
  margin-top: 0.45rem;
  font-size: 0.74rem;
  color: var(--mute);
}
.phase-strip li:nth-child(3) span { color: var(--accent); font-weight: 500; }
.phase-note {
  text-align: center;
  color: var(--mute);
  font-size: 0.72rem;
  margin-top: 0.9rem;
}

/* ---------- sections ---------- */
main section { margin-top: 4.6rem; }

h2 {
  font-size: clamp(1.45rem, 1.2rem + 0.8vw, 1.9rem);
  font-weight: 700;
  margin-bottom: 1rem;
}

section p + p { margin-top: 0.9rem; }

figure { margin-top: 1.6rem; }
figure img { width: 100%; display: block; border-radius: 6px; }
figcaption {
  font-size: clamp(0.82rem, 0.74rem + 0.22vw, 0.98rem);
  color: #AEB6C2;
  margin-top: 0.7rem;
  line-height: 1.65;
  font-family: "Source Serif 4", Georgia, serif;
}
figcaption b { color: var(--ink); }
.fig-narrow { max-width: 680px; margin-left: auto; margin-right: auto; }
.fig-narrow img { background: var(--card); border-radius: 8px; padding: 0.9rem; box-shadow: 0 14px 34px -16px rgba(0,0,0,0.6); }
section figure + figure { margin-top: 3rem; }

/* figures that breathe past the text column */
.col figure.wide {
  width: 100%;
}
.col figure.wide video {
  width: 100%;
  display: block;
  border-radius: 8px;
  background: #000;
  box-shadow: 0 14px 34px -16px rgba(0,0,0,0.6);
}
.col figure.wide img {
  background: var(--card);
  border-radius: 8px;
  padding: 1.1rem;
  box-shadow: 0 14px 34px -16px rgba(0,0,0,0.6);
}

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.6rem;
  align-items: center;
  margin-top: 0.4rem;
}
.split figure { margin-top: 0; }
.split figure img { background: var(--card); border-radius: 8px; padding: 0.9rem; box-shadow: 0 14px 34px -16px rgba(0,0,0,0.6); }

.fig-row {
  width: min(var(--wide), 100vw - 2.5rem);
  margin-left: 50%;
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
  margin-top: 1.6rem;
}
.fig-row figure { margin-top: 0; background: var(--card); border-radius: 8px; padding: 0.9rem; box-shadow: 0 14px 34px -16px rgba(0,0,0,0.6); }

/* ---------- headline ledger ---------- */
.ledger {
  list-style: none;
  margin-top: 0.5rem;
  border-top: 1px solid var(--line);
}
.ledger li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 0.85rem 0.15rem;
  border-bottom: 1px solid var(--line);
}
.ledger-label {
  font-family: "IBM Plex Mono", monospace;
  font-size: clamp(0.78rem, 0.72rem + 0.2vw, 0.92rem);
  letter-spacing: 0.02em;
  color: var(--mute);
}
.ledger-value {
  font-family: "Archivo", sans-serif;
  font-weight: 800;
  font-size: clamp(1.5rem, 1.2rem + 1vw, 2.2rem);
  color: var(--accent);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
@media (max-width: 560px) {
  .ledger li { flex-direction: column; align-items: flex-start; gap: 0.15rem; }
}

/* ---------- stats on the table (unused) ---------- */
.stats-wrap { margin-top: 4.6rem; }
.stats {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 0 1.25rem;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  text-align: center;
}
.stat b {
  font-family: "Archivo", sans-serif;
  font-weight: 800;
  font-size: clamp(2rem, 4.5vw, 3rem);
  color: var(--accent);
  display: block;
  line-height: 1;
}
.stat b i {
  font-style: normal;
  font-size: 0.45em;
  font-weight: 700;
  color: var(--ink);
  margin-left: 0.1em;
}
.stat span {
  font-family: "IBM Plex Mono", monospace;
  display: block;
  font-size: 0.72rem;
  color: var(--mute);
  margin-top: 0.55rem;
  line-height: 1.5;
  padding-bottom: 1.3rem;
}
.stats-wrap .table-line { margin-top: 0; }

/* ---------- bibtex + footer ---------- */
.bibtex {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1.1rem 1.3rem;
  font-size: 0.82rem;
  line-height: 1.7;
  overflow-x: auto;
}

footer { margin-top: 5rem; }
footer .table-line { margin-top: 0; }
footer p {
  text-align: center;
  color: var(--mute);
  font-size: 0.74rem;
  padding: 1.6rem 1.25rem 2.2rem;
}

/* ---------- responsive ---------- */
@media (max-width: 780px) {
  .stats { grid-template-columns: repeat(2, 1fr); row-gap: 1.8rem; }
  .split, .fig-row { grid-template-columns: 1fr; }
  .phase-strip { grid-template-columns: repeat(5, 1fr); gap: 0.35rem; }
  .phase-strip span { font-size: 0.6rem; }
  .hero .table-line, .table-line { margin-top: -2.2rem; }
}
