/* GoalDex project page */

:root {
  --bg: #0a0b0d;
  --surface: #121418;
  --surface-2: #181b20;
  --line: #262a31;
  --text: #eef0f3;
  --text-2: #b4bac4;
  --muted: #7d8590;
  --accent: #5ee0a8;
  --accent-ink: #062014;
  --bar-ours: #29a874;
  --bar-other: #6b7380;
  --radius: 14px;
  --maxw: 1120px;
  --section-space: clamp(32px, 4vw, 56px);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Inter Tight", "Inter", system-ui, sans-serif;
  --brand: "Sora", "Inter", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 72px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
}

img,
video {
  display: block;
  max-width: 100%;
}

figure {
  margin: 0;
}

/* ---------- top bar ---------- */

.topbar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 24px;
  height: 60px;
  padding: 0 clamp(16px, 4vw, 40px);
  transition: background 0.3s ease, border-color 0.3s ease;
  border-bottom: 1px solid transparent;
}

.topbar.is-solid {
  background: rgba(10, 11, 13, 0.78);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom-color: var(--line);
}

.topbar .brand {
  font-family: var(--brand);
  font-weight: 600;
  font-size: 18px;
  letter-spacing: -0.04em;
  text-decoration: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.topbar.is-solid .brand {
  opacity: 1;
}

.topbar nav {
  display: flex;
  gap: 4px;
  margin-left: auto;
}

.topbar nav a {
  font-size: 14px;
  color: var(--text-2);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 999px;
  transition: color 0.2s, background 0.2s;
}

.topbar nav a:hover,
.topbar nav a.is-active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
}

.topbar .home {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--text-2);
  text-decoration: none;
}

.topbar .home:hover {
  color: var(--text);
}

@media (max-width: 760px) {
  .topbar nav {
    display: none;
  }
  .topbar .home {
    margin-left: auto;
  }
}

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

.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-items: center;
  overflow: hidden;
  isolation: isolate;
}

.hero-wall {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  z-index: -2;
}

.hero-row {
  display: flex;
  flex: none;
  gap: 8px;
}

.hero-wall .tile {
  flex: 0 0 var(--tile-w, 280px);
  width: var(--tile-w, 280px);
  height: calc(var(--tile-w, 280px) * 0.625);
  border-radius: 10px;
  overflow: hidden;
  background: #15181c;
}

.hero-wall video {
  width: 100%;
  height: 100%;
  object-fit: contain; /* native 16:10 frames, uniform scaling and square pixels */
  filter: brightness(0.62) contrast(1.08) saturate(1.15);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 52% 48% at 50% 50%, rgba(10, 11, 13, 0.86) 0%, rgba(10, 11, 13, 0.62) 60%, rgba(10, 11, 13, 0.22) 100%),
    linear-gradient(to bottom, rgba(10, 11, 13, 0.6) 0%, rgba(10, 11, 13, 0) 16%, rgba(10, 11, 13, 0) 70%, var(--bg) 100%);
}

.hero-content {
  max-width: 980px;
  padding: 96px 16px 120px;
  text-align: center;
}

.venue {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text);
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(6px);
}

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

.hero h1 {
  font-family: var(--brand);
  font-weight: 600;
  font-size: clamp(3.6rem, 11.5vw, 8.2rem);
  line-height: 0.95;
  letter-spacing: -0.02em;
  margin: 22px 0 14px;
}

.hero h1 .dex {
  color: var(--accent);
}

.hero .tagline {
  font-family: var(--brand);
  font-size: clamp(1.32rem, 2.52vw, 1.74rem);
  font-weight: 400;
  line-height: 1.35;
  letter-spacing: -0.01em;
  color: var(--text);
  margin: 0 auto 30px;
  max-width: 820px;
  text-wrap: balance;
}

.authors {
  list-style: none;
  padding: 0;
  margin: 0 0 6px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 26px;
  font-size: 17px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.authors li {
  white-space: nowrap;
}

.authors a {
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.25);
  transition: border-color 0.2s;
}

.authors a:hover {
  border-bottom-color: var(--accent);
}

.authors sup,
.affils sup {
  font-size: 0.68em;
  color: var(--text-2);
  margin-left: 1px;
}

.affils {
  color: var(--text-2);
  font-size: 15px;
  margin: 0 0 30px;
}

.affils span + span::before {
  content: "·";
  margin: 0 10px;
  color: var(--muted);
}

.links {
  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: 15px;
  font-weight: 600;
  text-decoration: none;
  color: var(--text);
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(8px);
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
}

.btn svg {
  width: 18px;
  height: 18px;
}

.btn:hover {
  background: rgba(255, 255, 255, 0.16);
  transform: translateY(-1px);
}

.btn.is-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.btn.is-primary:hover {
  background: #7febbd;
}

.btn[aria-disabled="true"] {
  cursor: default;
  opacity: 0.7;
}

.btn[aria-disabled="true"]:hover {
  transform: none;
  background: rgba(255, 255, 255, 0.09);
}

.btn .soon {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-2);
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
}

.scroll-cue {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  width: 28px;
  height: 44px;
  border-radius: 14px;
  border: 2px solid rgba(255, 255, 255, 0.4);
}

.scroll-cue::after {
  content: "";
  position: absolute;
  top: 8px;
  left: 50%;
  width: 4px;
  height: 8px;
  margin-left: -2px;
  border-radius: 2px;
  background: var(--text);
  animation: cue 1.8s ease-in-out infinite;
}

@keyframes cue {
  0% {
    opacity: 0;
    transform: translateY(0);
  }
  30% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateY(14px);
  }
}

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

.section {
  padding: var(--section-space) clamp(16px, 4vw, 40px);
}

.section.is-tight {
  padding-top: 0;
}

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
}

.wrap.is-narrow {
  max-width: 860px;
}

.eyebrow {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 14px;
}

.section h2 {
  font-family: var(--display);
  font-size: clamp(1.9rem, 4.2vw, 3rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin: 0 0 18px;
  text-wrap: balance;
}

.section h3 {
  font-family: var(--display);
  font-size: clamp(1.35rem, 2.6vw, 1.75rem);
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 0 0 12px;
}

.lead {
  font-size: clamp(1.05rem, 1.6vw, 1.2rem);
  color: var(--text-2);
  max-width: 760px;
  margin: 0 0 36px;
}

.lead strong {
  color: var(--text);
  font-weight: 600;
}

.section-head {
  margin-bottom: 36px;
}

.divider {
  height: 1px;
  background: var(--line);
  max-width: var(--maxw);
  margin: 0 auto;
}

/* ---------- media frames ---------- */

.frame {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 30px 80px -40px rgba(0, 0, 0, 0.9);
}

.frame video {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  background: #000;
}

.frame.is-figure {
  background: #fff;
  padding: clamp(10px, 2vw, 22px);
}

.frame.is-figure img {
  width: 100%;
  height: auto;
}

.caption {
  font-size: 14.5px;
  color: var(--muted);
  margin: 14px 0 0;
  width: 100%;
  max-width: none;
  text-align: left;
}

.caption strong {
  color: var(--text-2);
  font-weight: 600;
}

.sound {
  position: absolute;
  top: 14px;
  right: 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 13px;
  border: 0;
  border-radius: 999px;
  font: 600 13px var(--font);
  color: #fff;
  background: rgba(10, 11, 13, 0.72);
  backdrop-filter: blur(8px);
  cursor: pointer;
  transition: background 0.2s;
}

.sound:hover {
  background: rgba(10, 11, 13, 0.9);
}

.sound svg {
  width: 16px;
  height: 16px;
}

/* teaser placeholder */

.placeholder {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  text-align: center;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(94, 224, 168, 0.12), transparent 60%),
    radial-gradient(ellipse at 80% 90%, rgba(120, 140, 255, 0.1), transparent 55%),
    var(--surface);
  border: 1px dashed #3a404a;
  color: var(--text-2);
}

.placeholder .play {
  width: 76px;
  height: 76px;
  margin: 0 auto 16px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.placeholder .play svg {
  width: 28px;
  height: 28px;
  margin-left: 4px;
  color: var(--text);
}

.placeholder p {
  margin: 0;
  font-size: 15px;
}

.placeholder p strong {
  display: block;
  font-family: var(--display);
  font-size: 20px;
  font-weight: 650;
  color: var(--text);
  margin-bottom: 2px;
}

.placeholder.is-small {
  aspect-ratio: auto;
  min-height: 220px;
  padding: 24px;
}

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

.abstract p {
  margin: 0 0 16px;
  font-size: clamp(1.02rem, 1.5vw, 1.12rem);
  color: var(--text-2);
}

/* ---------- method steps ---------- */

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 28px 0 40px;
  counter-reset: step;
}

.step {
  padding: 22px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  counter-increment: step;
}

.step::before {
  content: counter(step, decimal-leading-zero);
  display: block;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--accent);
  margin-bottom: 10px;
}

.step h4 {
  font-family: var(--display);
  font-size: 18px;
  font-weight: 650;
  letter-spacing: -0.01em;
  margin: 0 0 8px;
}

.step p {
  margin: 0;
  font-size: 15px;
  color: var(--text-2);
  line-height: 1.55;
}

@media (max-width: 860px) {
  .steps {
    grid-template-columns: 1fr;
  }
}

/* ---------- results ---------- */

.result {
  margin-top: var(--section-space);
}

.section-head + .result {
  margin-top: 0;
}

.result > p:not(.caption) {
  color: var(--text-2);
  max-width: 780px;
  margin: 0 0 26px;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
  gap: 18px;
  align-items: stretch;
}

@media (max-width: 1100px) {
  .split {
    grid-template-columns: 1fr;
  }
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  font: 600 14px var(--font);
  color: var(--text-2);
  background: var(--surface);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
}

.tab:hover {
  color: var(--text);
  border-color: #3a404a;
}

.tab[aria-selected="true"] {
  color: var(--accent-ink);
  background: var(--accent);
  border-color: var(--accent);
}

.tab .count {
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  opacity: 0.8;
}

.panel {
  display: flex;
  flex-direction: column;
  padding: 22px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
}

.panel h4 {
  font-family: var(--display);
  font-size: 20px;
  font-weight: 650;
  margin: 0 0 4px;
}

.panel .sub {
  font-size: 14px;
  color: var(--muted);
  margin: 0 0 18px;
}

.big-number {
  font-family: var(--display);
  font-size: 56px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.03em;
  margin-bottom: 4px;
}

.big-number small {
  font-size: 22px;
  color: var(--text-2);
  font-weight: 600;
  letter-spacing: 0;
}

.meter {
  display: flex;
  gap: 2px;
  height: 10px;
  margin: 14px 0 18px;
}

.meter span {
  flex: 1;
  border-radius: 3px;
  background: #2a2f37;
}

.meter span.is-on {
  background: var(--bar-ours);
}

.kv {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 16px;
  margin: 0;
  font-size: 15px;
}

.panel .kv {
  margin-top: auto;
}

.kv dt {
  color: var(--text-2);
}

.kv dd {
  margin: 0;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  text-align: right;
}

.panel .note {
  font-size: 13.5px;
  color: var(--muted);
  margin: 18px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  align-items: start;
}

@media (max-width: 900px) {
  .two-col {
    grid-template-columns: 1fr;
  }
}

/* ---------- simulation object explorer ---------- */

.scaling-overview video {
  aspect-ratio: 16 / 9;
  object-fit: contain;
}

.object-explorer .frame video {
  aspect-ratio: 16 / 10;
  object-fit: contain;
}

.object-explorer {
  margin-top: 38px;
}

.explorer-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px 24px;
  margin-bottom: 18px;
}

.explorer-toolbar h4 {
  margin: 0 0 6px;
  font-family: var(--display);
  font-size: 24px;
  font-weight: 650;
  letter-spacing: -0.015em;
}

.explorer-toolbar label {
  color: var(--text-2);
  font-size: 14px;
}

.explorer-picker {
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: 100%;
}

.explorer-picker select {
  width: 320px;
  max-width: 100%;
  min-width: 0;
  padding: 12px 16px;
  border: 1px solid #3a404a;
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  font: 500 16px var(--font);
  color-scheme: dark;
  cursor: pointer;
}

.explorer-picker select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.object-position {
  flex: none;
  color: var(--muted);
  font: 13px var(--mono);
}

.object-set {
  align-self: flex-start;
  margin-bottom: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(94, 224, 168, 0.09);
  color: var(--accent);
  font-size: 13px;
  font-weight: 500;
}

.object-explorer .panel h4 {
  font-size: 28px;
  line-height: 1.2;
  margin-bottom: 8px;
}

.simulation-metrics {
  width: 100%;
  margin-top: auto;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 14px;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
}

.simulation-metrics caption {
  padding: 24px 0 14px;
  color: var(--text-2);
  text-align: left;
  font-size: 14px;
}

.simulation-metrics th,
.simulation-metrics td {
  padding: 12px 0;
  text-align: right;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.simulation-metrics th:first-child {
  width: 44%;
  padding-right: 12px;
  text-align: left;
}

.simulation-metrics thead th {
  padding-top: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.simulation-metrics tbody th {
  color: var(--text-2);
  font-weight: 400;
}

.simulation-metrics td {
  font-size: 17px;
  font-weight: 600;
  white-space: nowrap;
}

.simulation-metrics .teacher {
  color: var(--text);
}

.simulation-metrics .student,
.simulation-metrics thead th:last-child {
  color: var(--accent);
}

.metrics-source,
.simulation-credits {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.metrics-source a,
.simulation-credits a {
  color: var(--text-2);
  text-underline-offset: 3px;
  text-decoration-color: var(--line);
}

.metrics-source a:hover,
.simulation-credits a:hover {
  color: var(--accent);
}

.simulation-credits summary {
  cursor: pointer;
  width: fit-content;
}

.simulation-credits ul {
  padding-left: 18px;
  columns: 2 280px;
  column-gap: 32px;
}

.simulation-credits li {
  break-inside: avoid;
  margin: 5px 0;
}


@media (max-width: 600px) {
  .explorer-picker {
    width: 100%;
  }
  .explorer-picker select {
    flex: 1;
    width: 0;
  }
}

/* ---------- bibtex ---------- */

.bibtex {
  position: relative;
}

.bibtex pre {
  margin: 0;
  padding: 22px 24px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  overflow-x: auto;
  font: 13.5px/1.7 var(--mono);
  color: var(--text-2);
}

.copy {
  position: absolute;
  top: 12px;
  right: 12px;
  height: 32px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text-2);
  font: 600 13px var(--font);
  cursor: pointer;
}

.copy:hover {
  color: var(--text);
}

@media (max-width: 600px) {
  .bibtex pre {
    padding-top: 54px;
  }
}

/* ---------- acknowledgements ---------- */

.acknowledgements-copy {
  margin: 0 0 26px;
  color: var(--text-2);
  font-size: 16px;
  line-height: 1.75;
}

/* Keep all six logos on one line; narrow screens can scroll the strip. */
.acknowledgements-logos {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 24px;
  overflow-x: auto;
  list-style: none;
  margin: 0;
  padding: 12px 16px;
  border-radius: var(--radius);
  background: var(--bg);
  scrollbar-width: thin;
  scrollbar-color: var(--line) var(--bg);
  scroll-padding-inline: 16px;
}

.acknowledgements-logos li {
  flex: 1 0 140px;
  min-width: 0;
}

.acknowledgements-logos a {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 72px;
  padding: 0 6px;
  border-radius: 8px;
}

.acknowledgements-logos:focus-visible,
.acknowledgements-logos a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.acknowledgements-logos img {
  display: block;
  width: 100%;
  max-width: 136px;
  height: auto;
  max-height: 52px;
  object-fit: contain;
}

.acknowledgements-logos .logo-rsl {
  max-width: 126px;
}

.acknowledgements-logos .logo-meta {
  max-width: 180px;
  max-height: 72px;
}

.acknowledgements-logos .logo-sbb {
  max-width: 160px;
}

.acknowledgements-logos .logo-snsf {
  max-width: 152px;
}

/* ---------- footer ---------- */

footer {
  padding: 40px clamp(16px, 4vw, 40px) 56px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}

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

footer a {
  color: var(--text-2);
  text-decoration: none;
}

footer a:hover {
  color: var(--text);
}

/* ---------- reveal ---------- */

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.is-in {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .scroll-cue::after {
    animation: none;
  }
}
