/* ==========================================================================
   InfCoiL Academic Paper Page — Minimalist Stylesheet (styles.css)
   Restrained single-column layout, system sans-serif, zero ornament
   ========================================================================== */

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background-color: #ffffff;
  color: #111111;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
}

/* Accessibility utility */
.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;
}

/* Links */
a {
  color: #0969da;
  text-decoration: underline;
  text-underline-offset: 2px;
}

a:hover {
  color: #0550ae;
}

a:focus-visible,
button:focus-visible,
summary:focus-visible,
input:focus-visible,
video:focus-visible,
pre:focus-visible,
.table-scroll:focus-visible {
  outline: 2px solid #0969da;
  outline-offset: 2px;
}

/* Main Centered Column (~920px) */
.page {
  max-width: 920px;
  margin: 0 auto;
  padding: 44px 20px 64px;
}

/* ==========================================================================
   1. PAPER HEADER
   ========================================================================== */
.paper-header {
  text-align: center;
  margin-bottom: 32px;
}

.paper-title {
  margin: 0 0 18px;
  font-size: 2.125rem; /* 34px on desktop */
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.015em;
  color: #111111;
}

.title-brand {
  white-space: nowrap;
}

.project-logo {
  width: auto;
  height: 1.25em;
  margin-right: 0.24em;
  vertical-align: -0.22em;
}

.author-list {
  margin: 0 0 8px;
  font-size: 1.0625rem;
  line-height: 1.5;
  color: #111111;
}

.author {
  white-space: nowrap;
}

.affiliation-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 20px;
  margin: 0 0 4px;
  font-size: 0.9375rem;
  color: #444444;
}

.author-notes {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 18px;
  margin: 0 0 18px;
  font-size: 0.84375rem;
  color: #555555;
}

.paper-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

.header-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  appearance: none;
  background-color: #ffffff;
  color: #111111;
  border: 1px solid #c9d1d9;
  padding: 6px 14px;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.4;
  text-decoration: none;
  cursor: pointer;
}

.header-btn:hover:not(:disabled) {
  background-color: #f3f4f6;
  border-color: #8b949e;
  color: #111111;
}

.header-btn:disabled {
  background-color: #f9fafb;
  color: #6b7280;
  border-color: #d0d7de;
  cursor: not-allowed;
}

/* ==========================================================================
   2. SECTIONS & TYPOGRAPHY
   ========================================================================== */
.section {
  margin-top: 36px;
  padding-top: 28px;
  border-top: 1px solid #e5e7eb;
}

#qualitative-transport {
  margin-top: 24px;
  padding-top: 0;
  border-top: none;
}

.section-heading {
  margin: 0 0 12px;
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.35;
  color: #111111;
}

.body-copy {
  margin: 0 0 20px;
  font-size: 1rem;
  line-height: 1.65;
  color: #111111;
}

.section-note {
  margin: 10px 0 0;
  font-size: 0.9rem;
  line-height: 1.55;
  color: #555555;
}

#results > .section-note {
  margin: 0 0 12px;
}

/* ==========================================================================
   3. VIDEOS & FIGURES
   ========================================================================== */
.video-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

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

.video-item {
  margin: 0;
}

.video-stage {
  position: relative;
}

.video-player {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  background-color: #f3f4f6;
  border: 1px solid #d0d7de;
}

.video-label {
  margin-top: 6px;
  font-size: 0.875rem;
  line-height: 1.45;
  color: #222222;
}

.video-subnote {
  margin: 3px 0 0;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: #555555;
}

.video-ended-note {
  margin-top: 6px;
  padding: 4px 8px;
  background-color: #f6f8fa;
  border-left: 2px solid #555555;
  font-size: 0.8125rem;
  color: #222222;
}

/* Framework Figure */
.framework-figure {
  margin: 20px 0 0;
}

.figure-link {
  display: block;
  text-decoration: none;
}

.framework-figure img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid #d0d7de;
  background-color: #ffffff;
}

.figure-caption {
  margin-top: 8px;
  font-size: 0.875rem;
  line-height: 1.5;
  color: #555555;
}

.figure-caption strong {
  color: #111111;
}

/* ==========================================================================
   4. QUANTITATIVE TABLE (BOOKTABS ACADEMIC STYLE)
   ========================================================================== */
.table-scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.results-table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  border-top: 2px solid #111111;
  border-bottom: 2px solid #111111;
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}

.results-table thead th {
  padding: 8px 10px;
  border-bottom: 1px solid #111111;
  text-align: left;
  font-weight: 600;
  color: #111111;
  white-space: normal;
}

.results-table thead th.num,
.results-table tbody td.num {
  text-align: right;
}

.results-table tbody th,
.results-table tbody td {
  padding: 7px 10px;
  border-bottom: 1px solid #eaeef2;
  font-weight: 400;
  color: #111111;
  text-align: left;
  white-space: nowrap;
}

.results-table tbody tr:last-child th,
.results-table tbody tr:last-child td {
  border-bottom: none;
}

.results-table tr.row-group-start th,
.results-table tr.row-group-start td {
  border-top: 1px solid #999999;
}

.results-table tr.row-ours th,
.results-table tr.row-ours td {
  background-color: #f8f9fa;
}

.table-footnote {
  margin: 10px 0 0;
  font-size: 0.84375rem;
  line-height: 1.55;
  color: #555555;
}

/* ==========================================================================
   5. NATIVE DETAILS DISCLOSURES & SYNC CONTROLS
   ========================================================================== */
.inline-details {
  margin-top: 8px;
  font-size: 0.84375rem;
  color: #555555;
}

.inline-details summary {
  cursor: pointer;
  display: list-item;
  color: #444444;
}

.inline-details p {
  margin: 6px 0 0;
  padding-left: 12px;
  border-left: 2px solid #e5e7eb;
  line-height: 1.55;
}

.section-details {
  margin-top: 12px;
  border-top: 1px solid #d0d7de;
  padding-top: 10px;
}

.section-details:last-of-type {
  border-bottom: 1px solid #d0d7de;
  padding-bottom: 10px;
}

.section-details > summary {
  cursor: pointer;
  font-size: 0.96875rem;
  font-weight: 500;
  color: #111111;
  padding: 4px 0;
}

.section-details > summary:hover {
  color: #0969da;
}

.details-body {
  padding-top: 10px;
  padding-bottom: 6px;
}

.details-body > .section-note {
  margin-top: 0;
  margin-bottom: 12px;
}

/* Synchronized comparison toolbar */
.sync-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  padding: 8px 0 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid #e5e7eb;
  font-size: 0.875rem;
}

.sync-buttons,
.baseline-switch {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.switch-label {
  color: #555555;
  margin-right: 2px;
}

.sync-seek {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 200px;
}

#sync-scrubber {
  flex: 1;
  min-width: 110px;
  accent-color: #111111;
  cursor: pointer;
}

.sync-clock {
  font-variant-numeric: tabular-nums;
  font-size: 0.8125rem;
  color: #444444;
  white-space: nowrap;
}

/* Plain buttons */
.plain-btn {
  appearance: none;
  background-color: #ffffff;
  color: #111111;
  border: 1px solid #c9d1d9;
  padding: 4px 10px;
  font-family: inherit;
  font-size: 0.84375rem;
  line-height: 1.4;
  cursor: pointer;
}

.plain-btn:hover {
  background-color: #f3f4f6;
  border-color: #8b949e;
}

.plain-btn.is-active,
.plain-btn[aria-pressed="true"] {
  background-color: #111111;
  color: #ffffff;
  border-color: #111111;
}

/* ==========================================================================
   6. CITATION
   ========================================================================== */
.citation-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.citation-header .section-heading {
  margin: 0;
}

.citation-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.copy-status {
  font-size: 0.8125rem;
  color: #444444;
}

.bibtex-pre {
  margin: 0;
  padding: 14px 16px;
  background-color: #f6f8fa;
  border: 1px solid #d0d7de;
  overflow-x: auto;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.84375rem;
  line-height: 1.55;
  color: #111111;
}

/* ==========================================================================
   7. RESPONSIVE (MOBILE 390px / 360px) & REDUCED MOTION
   ========================================================================== */
@media (max-width: 680px) {
  .page {
    padding: 28px 16px 48px;
  }

  .paper-title {
    font-size: 1.5625rem; /* 25px on mobile */
    line-height: 1.3;
  }

  .author-list {
    font-size: 0.96875rem;
  }

  .affiliation-list {
    font-size: 0.9rem;
    flex-direction: column;
    gap: 2px;
  }

  .header-btn {
    padding: 6px 11px;
    font-size: 0.84375rem;
  }

  .video-pair,
  .video-grid-3 {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .sync-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .sync-seek {
    flex: 1 1 auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
