:root {
  --page-bg: #ffffff;
  --text: #171717;
  --muted: #707070;
  --line: #dedede;
  --soft-line: #ededed;
  --placeholder: #f7f7f7;
  --placeholder-text: #8b8b8b;
  --accent: #1f4f86;
  --content-width: min(60vw, 920px);
  --demo-width: min(76vw, 1160px);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

.site-shell {
  padding: 64px 0 96px;
}

.site-header {
  --title-size: clamp(1.75rem, 2.35vw, 2.25rem);
  width: 100%;
  margin: 0 auto 64px;
  text-align: center;
}

h1,
h2,
p,
figure { margin-top: 0; }

h1 {
  width: calc(100% - 48px);
  margin: 0 auto 12px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.6rem, 4vw, 3.5rem);
  font-weight: 600;
  letter-spacing: -0.045em;
  line-height: 1.2;
  text-wrap: wrap;
}

.paper-subtitle {
  width: calc(100% - 48px);
  margin: 0 auto 28px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: var(--title-size);
  font-style: normal;
  line-height: 1.4;
  text-wrap: balance;
}

.authors {
  width: var(--content-width);
  margin-right: auto;
  margin-left: auto;
  margin-bottom: 18px;
  font-size: 1.05rem;
  line-height: 1.9;
  text-wrap: balance;
}

.authors span {
  display: inline-block;
  white-space: nowrap;
}

.site-header sup {
  margin-left: 0.12em;
  font-size: 0.7em;
  line-height: 0;
}

.affiliations {
  width: var(--content-width);
  margin-right: auto;
  margin-left: auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 20px;
  margin-bottom: 12px;
  color: #555;
  font-size: 0.85rem;
  line-height: 1.6;
}

.affiliations span { max-width: 100%; }

.corresponding-author {
  width: var(--content-width);
  margin: 0 auto 28px;
  color: #555;
  font-size: 0.85rem;
  line-height: 1.6;
}

.corresponding-author a {
  color: inherit;
  text-underline-offset: 3px;
}

.placeholder-text { color: var(--placeholder-text); }

.header-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
}

.text-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 104px;
  min-height: 40px;
  padding: 8px 16px;
  border: 1px solid #cfcfcf;
  border-radius: 6px;
  background: #fafafa;
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.4;
  text-decoration: none;
}

.text-link:not(:disabled):hover { color: var(--accent); border-color: var(--accent); }

.link-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.placeholder-link {
  color: #555;
  cursor: default;
  opacity: 1;
}

.section {
  width: var(--content-width);
  margin: 80px auto 0;
}

.results-section { width: var(--demo-width); }

.teaser-section { margin-top: 0; }

.teaser-question {
  max-width: 760px;
  margin: 0 auto 32px;
  text-align: center;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.65rem, 2.5vw, 2.25rem);
  letter-spacing: -0.03em;
  line-height: 1.16;
}

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 24px;
  margin-bottom: 32px;
}

h2 {
  margin-bottom: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.55rem, 2.6vw, 2.1rem);
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.2;
}

.section-note {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.84rem;
  text-align: right;
}

.qualitative-block + .qualitative-block {
  margin-top: 72px;
}

.subsection-title {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

code {
  padding: 0.1em 0.3em;
  border: 1px solid var(--soft-line);
  background: #fafafa;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
}

.figure-frame {
  position: relative;
  display: grid;
  min-height: 360px;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--placeholder);
  place-items: center;
}

.figure-frame--teaser {
  width: 100%;
  min-height: 320px;
  margin-right: auto;
  margin-left: auto;
}
.figure-frame--method { min-height: 300px; }

.figure-frame img {
  display: none;
  width: 100%;
  height: auto;
  max-height: 760px;
  object-fit: contain;
  background: #fff;
}

.figure-frame--teaser img {
  width: 85%;
  margin-right: auto;
  margin-left: auto;
}

.figure-frame.is-loaded {
  display: block;
  min-height: 0;
  border: 0;
  background: #fff;
}
.figure-frame.is-loaded img { display: block; }
.figure-frame.is-loaded .figure-placeholder { display: none; }

.figure-placeholder {
  display: grid;
  gap: 8px;
  padding: 32px;
  color: var(--placeholder-text);
  font-size: 0.95rem;
  text-align: center;
}

.figure-placeholder span {
  color: #a2a2a2;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.8rem;
}

.figure-caption {
  display: block;
  width: 100%;
  margin: 0 auto;
  padding: 18px 0 4px;
  border-top: 0;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  line-height: 1.65;
  text-align: left;
}

.caption-label {
  color: var(--text);
  font-weight: 700;
}

.quantitative-figures {
  display: grid;
  gap: 40px;
}

.experiment-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 40px 36px;
}

.experiment {
  display: grid;
  grid-template-rows: 1fr auto;
  min-width: 0;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.experiment:nth-child(-n + 2) { padding-top: 0; border-top: 0; }

.experiment-header {
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 12px;
  margin-bottom: 14px;
}

.experiment-title {
  margin: 0;
  min-height: 3em;
  font-size: 0.9rem;
  line-height: 1.5;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.experiment-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.control-button {
  padding: 6px 11px;
  border: 1px solid #cfcfcf;
  border-radius: 2px;
  background: #fff;
  color: #333;
  font: inherit;
  font-size: 0.78rem;
  cursor: pointer;
}

.control-button:hover,
.control-button:focus-visible {
  border-color: #808080;
  outline: none;
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.video-cell { min-width: 0; }

.video-label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.video-frame {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--placeholder);
}

.video-frame video {
  display: none;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #111;
}

.video-frame.is-loaded video { display: block; }
.video-frame.is-loaded .video-placeholder { display: none; }

.video-placeholder {
  display: grid;
  height: 100%;
  padding: 20px;
  color: var(--placeholder-text);
  place-content: center;
  text-align: center;
  font-size: 0.83rem;
}

.video-placeholder small {
  display: block;
  margin-top: 5px;
  color: #a2a2a2;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.7rem;
  overflow-wrap: anywhere;
}

.placeholder-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(220px, 0.8fr);
  gap: 20px;
  align-items: stretch;
}

.placeholder-grid .figure-frame { min-height: 320px; }

.table-placeholder {
  display: grid;
  min-height: 320px;
  padding: 28px;
  border: 1px solid var(--line);
  background: var(--placeholder);
  color: var(--placeholder-text);
  place-content: center;
  text-align: center;
}

.table-placeholder span {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.3rem;
}

.table-placeholder small {
  max-width: 200px;
  margin-top: 8px;
  color: #a2a2a2;
  font-size: 0.78rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 1000px) {
  :root {
    --content-width: min(80vw, 720px);
    --demo-width: min(86vw, 760px);
  }

  .experiment-list { grid-template-columns: 1fr; }
  .experiment:nth-child(2) { padding-top: 24px; border-top: 1px solid var(--line); }
  .experiment-title { min-height: 0; }
}

@media (max-width: 600px) {
  :root {
    --content-width: calc(100vw - 40px);
    --demo-width: calc(100vw - 32px);
  }

  .site-shell { padding-top: 40px; }
  .site-header { margin-bottom: 48px; }
  .section { margin-top: 56px; }
  .teaser-section { margin-top: 0; }
  .figure-caption { font-size: 0.9rem; }
  .video-label { font-size: 0.65rem; letter-spacing: 0; }
  .video-placeholder { padding: 8px; font-size: 0.7rem; }
  .control-button { min-height: 36px; }
  .placeholder-grid { grid-template-columns: 1fr; }
}

@media (max-width: 359px) {
  .video-grid { grid-template-columns: 1fr; gap: 16px; }
  .video-label { font-size: 0.75rem; }
}
