/* GeoDYN project page. Colours follow the supplementary video: slide background, teal accent. */
:root {
  --bg: #f9f9f4;
  --surface: #ffffff;
  --text: #1d1d1b;
  --muted: #5f5f59;
  --line: #e2e2d9;
  --teal: #13706a;
  --teal-soft: #e3efed;
  --grey-bar: #a2a3ab;
  --track: #ecece4;
  --maxw: 1120px;
  color-scheme: light;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--teal); }

/* navigation */
.topnav {
  position: sticky; top: 0; z-index: 10;
  background: rgba(249, 249, 244, 0.88);
  backdrop-filter: saturate(160%) blur(8px);
  -webkit-backdrop-filter: saturate(160%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.topnav-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 0 20px;
  height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand { font-weight: 700; color: var(--teal); text-decoration: none; letter-spacing: 0.01em; }
.topnav-links { display: flex; gap: 22px; }
.topnav-links a { color: var(--muted); text-decoration: none; font-size: 15px; }
.topnav-links a:hover { color: var(--text); }

/* title block */
.hero { max-width: var(--maxw); margin: 0 auto; padding: 48px 20px 8px; text-align: center; }
.hero h1 { font-size: 40px; line-height: 1.2; margin: 0 0 22px; letter-spacing: -0.01em; }
.authors { font-size: 19px; margin: 0 0 6px; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 22px; }
.authors sup, .affiliations sup, .author-note sup { font-size: 0.68em; }
.authors a { color: var(--teal); text-decoration: none; }
.authors a:hover, .authors a:focus-visible { text-decoration: underline; }
.affiliations { color: var(--muted); margin: 0 0 4px; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 22px; }
.author-note { color: var(--muted); font-size: 14px; margin: 0 0 22px; }

.buttons { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-bottom: 34px; }
.button {
  display: inline-block; padding: 9px 20px; border-radius: 999px;
  background: var(--text); color: #fff; text-decoration: none; font-weight: 600; font-size: 15px;
}
.button:hover { background: #3a3a37; }
.button.soon { background: #b9b9b2; pointer-events: none; }
.button-icon { display: inline-block; margin-right: 6px; line-height: 1; }
.buttons.section-buttons { margin: 18px 0 0; }

.teaser { margin: 0 auto; max-width: 1080px; }
.teaser-video { display: block; width: 100%; height: auto; border-radius: 10px; background: #fff; }
.credit { color: var(--muted); font-size: 13px; margin-top: 8px; }

.tldr { max-width: 820px; margin: 26px auto 0; font-size: 21px; line-height: 1.45; font-weight: 600; }

details.abstract { max-width: 860px; margin: 22px auto 0; text-align: left; }
details.abstract summary {
  cursor: pointer; text-align: center; color: var(--teal); font-weight: 600; list-style: none;
}
details.abstract summary::-webkit-details-marker { display: none; }
details.abstract summary::after { content: " \25BE"; }
details.abstract[open] summary::after { content: " \25B4"; }
details.abstract p { color: #33332f; margin: 14px 0 0; text-align: justify; hyphens: auto; }

/* sections */
main { max-width: var(--maxw); margin: 0 auto; padding: 0 20px 40px; }
section { margin-top: 76px; }
section h2 { font-size: 28px; line-height: 1.25; margin: 0 0 20px; text-align: center; letter-spacing: -0.005em; }
.lead { max-width: 860px; margin: -6px auto 22px; text-align: center; color: #33332f; font-size: 18px; }
.note { color: var(--muted); font-size: 14px; text-align: center; margin: 12px auto 0; max-width: 900px; }

/* motivation: the four failures of pixel rendering at a glance; a card selects its video in the player below */
.failures { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 20px; }
.failure {
  font: inherit; color: inherit; text-align: left; display: block; width: 100%; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 10px 14px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.failure:hover { border-color: var(--teal); box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06); }
.failure:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.failure-media { position: relative; display: block; }
.failure-media img { display: block; width: 100%; height: auto; border-radius: 6px; }
.failure-media::after {
  content: ""; position: absolute; top: 8px; right: 8px; width: 26px; height: 26px; border-radius: 50%;
  background: rgba(20, 20, 20, 0.55) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M8 5v14l11-7z' fill='white'/%3E%3C/svg%3E") center / 14px no-repeat;
}
.pair-labels { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; font-size: 13px; margin: 6px 2px 0; }
.pair-labels .bad { color: #b3261e; font-weight: 600; }
.pair-labels .good { color: var(--teal); font-weight: 600; }
.failure-name { display: block; font-weight: 700; font-size: 18px; margin: 8px 2px 0; }
.failure-cause { display: block; color: #33332f; font-size: 15px; line-height: 1.45; margin: 2px 2px 0; }
.subhead { font-size: 21px; line-height: 1.3; text-align: center; margin: 48px 0 16px; }

.figure { margin: 0 0 26px; }
.figure img { display: block; width: 100%; height: auto; border-radius: 8px; background: #fff; }
.figure.chart { max-width: 560px; margin-left: auto; margin-right: auto; }

/* video players */
.player { margin-top: 18px; }
.player + .player { margin-top: 40px; }
.tabs { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-bottom: 14px; }
.tabs button {
  font: inherit; font-size: 15px; padding: 7px 16px; border-radius: 999px; cursor: pointer;
  border: 1px solid #d3d3c9; background: var(--surface); color: var(--text);
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.tabs button:hover { border-color: var(--teal); }
.tabs button[aria-selected="true"] { background: var(--teal); border-color: var(--teal); color: #fff; }
.tabs button:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }

.clip { margin: 0; }
.clip video {
  display: block; width: 100%; height: auto; border-radius: 10px;
  border: 1px solid var(--line); background: var(--bg);
}
.caption { text-align: center; color: #33332f; margin-top: 12px; min-height: 1.55em; }
.clip video, .teaser-video { cursor: pointer; }

/* play/pause button: top right, shown while paused or on hover */
.has-toggle { position: relative; }
.playpause {
  position: absolute; top: 10px; right: 10px; width: 30px; height: 30px; border-radius: 50%;
  border: 0; padding: 0; display: flex; align-items: center; justify-content: center; cursor: pointer;
  background: rgba(20, 20, 20, 0.55); color: #fff; opacity: 0; transition: opacity 0.15s;
}
.has-toggle:hover .playpause, .playpause:focus-visible, .playpause.is-paused { opacity: 1; }
.playpause:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
@media (hover: none) { .playpause { opacity: 0.85; } }
.figure-video { margin-bottom: 8px; }
.figure-video video { border: 0; }

/* training-data chart */
.chart-card {
  display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.5fr); gap: 40px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 28px 32px;
}
.chart-card h3 { font-size: 17px; margin: 0 0 18px; }
.data-row { display: grid; grid-template-columns: 118px minmax(0, 1fr) 64px; align-items: center; gap: 10px; margin-bottom: 14px; }
.data-label { font-size: 15px; text-align: right; }
.data-bar, .gain-bar { height: 22px; background: var(--track); border-radius: 4px; overflow: hidden; display: block; }
.fill { display: block; height: 100%; border-radius: 4px; }
.fill.teal { background: var(--teal); }
.fill.grey { background: var(--grey-bar); }
.data-value { font-size: 15px; }
.teal-text { color: var(--teal); }
.strong { font-weight: 700; }
.gain-group { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 10px; align-items: start; margin-bottom: 14px; }
.gain-bench { font-size: 14px; color: var(--muted); font-weight: 600; padding-top: 3px; }
.gain-row { display: grid; grid-template-columns: 62px minmax(0, 1fr) 44px 132px; align-items: center; gap: 10px; margin-bottom: 8px; }
.metric { font-size: 14px; text-align: right; }
.gain-row .gain-bar { height: 18px; }
.pct { font-weight: 700; color: var(--teal); font-size: 15px; }
.vals { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* BibTeX */
.bibtex { position: relative; max-width: 900px; margin: 0 auto; }
.bibtex pre {
  margin: 0; padding: 20px 22px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  overflow-x: auto; font-size: 14px; line-height: 1.6;
}
.copy {
  position: absolute; top: 10px; right: 10px; font: inherit; font-size: 13px; padding: 4px 12px;
  border-radius: 999px; border: 1px solid #d3d3c9; background: var(--bg); cursor: pointer;
}
.copy:hover { border-color: var(--teal); }

.footer { height: 40px; }

/* the line break of the title needs about 970 px; below 1000 px the title wraps by itself */
@media (max-width: 1000px) {
  .wide-only { display: none; }
}

/* narrow screens */
@media (max-width: 820px) {
  body { font-size: 16px; }
  .hero { padding-top: 32px; }
  .hero h1 { font-size: 27px; }
  .authors { font-size: 17px; gap: 2px 14px; }
  .tldr { font-size: 18px; }
  section { margin-top: 56px; }
  section h2 { font-size: 23px; }
  .topnav-links { gap: 14px; }
  .topnav-links a { font-size: 14px; }
  .chart-card { grid-template-columns: minmax(0, 1fr); gap: 26px; padding: 22px 18px; }
  .gain-group { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .gain-row { grid-template-columns: 54px minmax(0, 1fr) 40px; }
  .vals { display: none; }
  .tabs button { font-size: 14px; padding: 6px 12px; }
  .failures { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .subhead { font-size: 19px; margin-top: 38px; }
}
@media (max-width: 460px) {
  .topnav-links a:nth-child(4) { display: none; }
  .buttons { gap: 8px; }
  .button { padding: 8px 12px; font-size: 14px; }
  .button-icon { margin-right: 4px; }
  .pair-labels { font-size: 12px; }
  .data-row { grid-template-columns: 104px minmax(0, 1fr) 56px; }
}
