/* Project page — layout inspired by academic landing pages (e.g. embodiment scaling laws) */

/*
  Graphik (Commercial Type): self-hosted *-Web.woff2 under fonts/. Regular + Bold wired; 500/600
  fall back to the nearest defined weight (browser may synthesize between 400 and 700).
*/
@font-face {
  font-family: "Graphik";
  src: url("fonts/Graphik-Regular-Web.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Graphik";
  src: url("fonts/Graphik-Bold-Web.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  /* UCSD: gold + navy on white */
  --ucsd-yellow: #c59114;
  --ucsd-blue: #172b49;
  --bg: #ffffff;
  --surface: color-mix(in srgb, var(--ucsd-yellow) 12%, #ffffff 88%);
  --text: var(--ucsd-blue);
  --muted: color-mix(in srgb, var(--ucsd-blue) 50%, #ffffff 50%);
  --accent: var(--ucsd-blue);
  --border: color-mix(in srgb, var(--ucsd-blue) 15%, #ffffff 85%);
  --shadow: rgba(23, 43, 73, 0.1);
  --radius: 8px;
  --maxw: 920px;
  --font-body: "Graphik", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  /* One scale for desktop & mobile (page zoom scales rem together) */
  --lh-prose: 1.65;
  --lh-tight: 1.35;
  --lh-snug: 1.5;
  --text-title: clamp(2.275rem, 5.2vw, 3.055rem);
  --text-h2: 1.55rem;
  --text-h3: 1.2rem;
  --text-body: 1.05rem;
  --text-secondary: 0.95rem;
  --text-small: 0.9rem;
  --text-ui: 0.88rem;
}

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

html {
  font-size: 90%;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

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

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--text-body);
  line-height: var(--lh-prose);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img,
video,
svg {
  max-width: 100%;
  height: auto;
}

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

a:hover {
  text-decoration: underline;
}

::selection {
  background: var(--ucsd-blue);
  color: var(--ucsd-yellow);
}

::-moz-selection {
  background: var(--ucsd-blue);
  color: var(--ucsd-yellow);
}

/* Yellow headings: selection inverts to blue text on yellow */
.hero h1::selection,
section.content h2::selection,
h3.section-subtitle::selection {
  background: var(--ucsd-yellow);
  color: var(--ucsd-blue);
}

.hero h1::-moz-selection,
section.content h2::-moz-selection,
h3.section-subtitle::-moz-selection {
  background: var(--ucsd-yellow);
  color: var(--ucsd-blue);
}

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 1.25rem;
  padding-left: max(1.25rem, env(safe-area-inset-left));
  padding-right: max(1.25rem, env(safe-area-inset-right));
}

/* Hero */
.hero {
  padding: 3rem 0 2.5rem;
  text-align: center;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.hero h1 {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: var(--text-title);
  line-height: 1.25;
  margin: 0 0 1rem;
  letter-spacing: -0.02em;
  color: var(--ucsd-yellow);
}

.authors {
  font-size: var(--text-h3);
  font-weight: 700;
  line-height: var(--lh-prose);
  margin: 0 0 0.35rem;
}

/* Avoid UA/default superscript sizing that looks wrong under page zoom on phones */
.authors sup {
  font-size: 0.68em;
  font-weight: inherit;
  line-height: 0;
  vertical-align: baseline;
  position: relative;
  top: -0.42em;
}

.hero .affil {
  margin-top: 0;
  margin-bottom: 0.85rem;
}

.institution-logos {
  margin: 0 auto 1.15rem;
  max-width: min(100%, 720px);
}

.institution-logos img {
  display: block;
  width: 100%;
  height: auto;
  vertical-align: middle;
}

.affil {
  font-size: var(--text-h3);
  line-height: var(--lh-snug);
  color: var(--muted);
  margin: 0 0 1rem;
}

/* In-page nav */
.section-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.65rem;
  justify-content: center;
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  font-size: var(--text-h3);
  line-height: var(--lh-tight);
}

.section-nav a {
  color: var(--muted);
  font-weight: 600;
  text-decoration: none;
  padding: 0.2rem 0;
}

.section-nav a:hover {
  color: var(--accent);
  text-decoration: underline;
}

/* Sections */
section.content {
  padding: 2.75rem 0;
  border-bottom: 1px solid var(--border);
}

section.content:last-of-type {
  border-bottom: none;
}

section.content h2 {
  font-family: var(--font-body);
  font-size: var(--text-h2);
  font-weight: 700;
  line-height: 1.28;
  margin: 0 0 1rem;
  letter-spacing: -0.02em;
  color: var(--ucsd-yellow);
}

.section-subtitle {
  font-family: var(--font-body);
  font-size: var(--text-h3);
  font-weight: 700;
  line-height: 1.35;
  margin: 2rem 0 0.75rem;
  letter-spacing: -0.02em;
  color: var(--ucsd-yellow);
}

#real-world .section-subtitle:first-of-type {
  margin-top: 0.5rem;
}

.lead.follow-text {
  margin-top: -0.25rem;
  margin-bottom: 1rem;
  font-size: var(--text-secondary);
  line-height: var(--lh-snug);
  color: var(--muted);
}

.tagline {
  font-family: var(--font-body);
  font-size: var(--text-h3);
  line-height: 1.35;
  font-style: italic;
  color: var(--muted);
  margin: 0 0 0.75rem;
}

/* TL;DR, Takeaways, and similar highlights — warm surface + gold bar */
.callout {
  margin: 0 0 1.25rem;
  padding: 1rem 1.15rem;
  font-size: var(--text-body);
  line-height: var(--lh-prose);
  background: var(--surface);
  border-left: 4px solid var(--ucsd-yellow);
  border-radius: 0 var(--radius) var(--radius) 0;
  box-shadow: 0 1px 0 var(--shadow);
}

#takeaways .callout {
  margin-bottom: 0;
}

#takeaways .callout .obs-list {
  margin: 0;
}

.abstract {
  margin: 0;
  text-align: start;
  hyphens: auto;
  line-height: var(--lh-prose);
}

.lead {
  font-size: var(--text-body);
  line-height: var(--lh-prose);
  margin: 0 0 1rem;
}

.muted {
  color: var(--muted);
  font-size: var(--text-small);
  line-height: var(--lh-snug);
}

.problem-figure {
  margin-top: 1.5rem;
}

/* Two simulation figures: same structure as pipeline (figure-block), stacked */
.sweep-pair {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  margin-top: 1.75rem;
}

.sweep-pair .figure-block {
  margin: 0;
}

.figure-expl {
  font-size: var(--text-secondary);
  color: var(--muted);
  line-height: var(--lh-snug);
  margin: 0 0 1rem;
}

.figure-panels {
  margin-top: 1rem;
}

.figure-panels .figure-expl {
  margin-bottom: 0.65rem;
}

.panel-list {
  margin: 0;
  padding-left: 1.2rem;
  font-size: var(--text-secondary);
  color: var(--muted);
  line-height: var(--lh-snug);
}

.panel-list li {
  margin-bottom: 0.35rem;
}

.panel-list strong {
  color: var(--text);
}

/* Second sweep: fewer panels → 0.5× width, centered (same img styling as pipeline) */
.sweep-img--half {
  width: 50%;
  max-width: 50%;
  margin: 0 auto;
}

.sweep-img--half .img-figure {
  width: 100%;
}

/* ——— Narrow window: same layout as desktop, uniformly scaled to fit viewport width ——— */
.page-scale {
  margin: 0 auto;
}

@media (max-width: 920px) {
  html {
    overflow-x: hidden;
  }

  .page-scale {
    width: var(--maxw);
    max-width: var(--maxw);
    margin: 0 auto;
    /* Uniform scale: design width (--maxw) maps to full viewport width */
    zoom: calc(100vw / var(--maxw));
  }

  .hero {
    padding-top: max(2.5rem, env(safe-area-inset-top));
  }

  .footer-note {
    padding-bottom: max(3rem, env(safe-area-inset-bottom));
  }
}

/* Media */
.figure-block {
  margin: 1.5rem 0;
}

.figure-block:first-child {
  margin-top: 0;
}

.video-wrap {
  position: relative;
  width: 100%;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg);
  box-shadow: 0 8px 32px var(--shadow);
}

.video-wrap video {
  display: block;
  width: 100%;
  height: auto;
  vertical-align: middle;
}

.caption {
  font-size: var(--text-small);
  line-height: var(--lh-snug);
  color: var(--muted);
  margin: 0.5rem 0 0;
}

/* Rasterized figure exports (from PDF) */
.img-figure {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  vertical-align: middle;
}

.figure-block .img-figure {
  box-shadow: 0 2px 12px var(--shadow);
}

.img-hero {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  box-shadow: 0 4px 24px var(--shadow);
}

/* Key observations */
.obs-list {
  margin: 0;
  padding-left: 1.25rem;
  font-size: var(--text-body);
  line-height: var(--lh-prose);
}

.obs-list li {
  margin-bottom: 0.5rem;
}

/* BibTeX */
.bib-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

section.content .bib-header h2 {
  margin: 0;
}

.copy-bib {
  font-family: var(--font-body);
  font-size: var(--text-ui);
  line-height: 1.25;
  font-weight: 600;
  padding: 0.4rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: color-mix(in srgb, var(--ucsd-blue) 6%, #ffffff 94%);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.copy-bib:hover:not(:disabled) {
  border-color: color-mix(in srgb, var(--ucsd-blue) 30%, #ffffff 70%);
  box-shadow: 0 1px 4px var(--shadow);
}

.copy-bib:disabled {
  opacity: 0.85;
  cursor: default;
}

pre.bib {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: var(--text-body);
  line-height: 1.5;
  padding: 1rem 1.1rem;
  background: color-mix(in srgb, var(--ucsd-blue) 6%, #ffffff 94%);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0;
}

.footer-note {
  font-size: var(--text-small);
  line-height: var(--lh-snug);
  color: var(--muted);
  text-align: center;
  padding: 2rem 1rem 3rem;
}

