/* ===== SafeDriveVLA Project Page ===== */
/* Typography: Satoshi (body) + Fraunces (display), matching awesome-ai-auto-research */

body {
  font-family: "Satoshi", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.header-content,
.header-content h1,
.header-content h2,
.button-container a.button {
  font-family: "Satoshi", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.header-content h1 {
  font-family: "Fraunces", Georgia, serif;
  font-feature-settings: "ss01", "ss02";
  letter-spacing: -0.02em;
  font-weight: 500;
}
.button-container a.button {
  font-weight: 600;
  letter-spacing: 0.005em;
  background-color: #fffdf4;
  color: #0c1b33;
  border-color: rgba(12, 27, 51, 0.35);
}
.button-container a.button:hover {
  background-color: #f5d77e;
  color: #0c1b33;
}
.header-content .button-container { margin: 1.1rem 0 0.2rem -6px; }
/* style.css sets nowrap on header h2 below 768px, which clips the hero description on phones */
@media (max-width: 768px) {
  .header-content h2 { white-space: normal; }
}
.icon.is-small {
  font-family: "Satoshi", -apple-system, sans-serif;
}

/* Hero: full-width title; below it, authors/links/summary on the left and the teaser on the right */
@media (min-width: 600px) {
  .header-container .header-content {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 100%;
    margin-right: 0;
  }
}
.sdv-hero-row {
  display: flex;
  align-items: flex-start;
  gap: 3rem;
}
.sdv-hero-meta {
  flex: 1 1 0;
  min-width: 0;
}
.sdv-hero-media {
  flex: 0 0 40%;
  max-width: 560px;
  margin-top: 1.4rem; /* same as .sdv-authors, so the video's top lines up with the author block */
}
.sdv-hero-media video {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  background: #0c1b33;
}
@media (max-width: 960px) {
  .sdv-hero-row { flex-direction: column; gap: 0; }
  .sdv-hero-media { width: 100%; max-width: 560px; margin: 0.5rem auto 1rem; }
}

/* Header author block */
.sdv-authors {
  margin: 1.4rem 0 0.4rem;
  max-width: 1120px;
  letter-spacing: 0;
}
.sdv-venue {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #0c1b33;
  background: #f5d77e;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  margin-bottom: 0.9rem;
}
.sdv-author-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.1rem;
  font-size: 1.12rem;
  font-weight: 600;
  color: #fff;
  line-height: 1.5;
}
.sdv-author-list span,
.sdv-affiliations span { white-space: nowrap; }
/* Line break after the fifth author, matching the paper and README */
.sdv-author-list .sdv-break { flex-basis: 100%; height: 0; }
.sdv-author-list a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease, color .2s ease;
}
.sdv-author-list a:hover {
  color: #f5d77e;
  border-bottom-color: #f5d77e;
}
.sdv-authors sup {
  color: #f5d77e;
  font-size: 0.68em;
  margin-left: 0.08em;
}
.sdv-affiliations {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.3rem;
  margin-top: 0.8rem;
  font-size: 0.92rem;
  color: rgba(255, 247, 212, 0.92);
}
.sdv-affiliations span {
  display: inline-flex;
  align-items: center;
}
/* School seals sit on a white disc so the dark-blue ones stay legible on the header */
.sdv-aff-logo {
  height: 30px;
  width: 30px;
  object-fit: contain;
  background: #fff;
  border-radius: 50%;
  padding: 3px;
  margin-right: 0.45rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}
.sdv-author-note {
  margin-top: 0.35rem;
  font-size: 0.8rem;
  color: #FFF7D4;
  opacity: 0.75;
}

h1, h2,
.sdv-section-title,
.sdv-stat .sdv-stat-num,
.sdv-table-caption b {
  font-family: "Fraunces", Georgia, "Times New Roman", serif;
  font-feature-settings: "ss01", "ss02";
  letter-spacing: -0.015em;
}
h1, h2 { font-weight: 500; }

/* Editorial-style kicker (eyebrow above section titles) — matches auto-research */
.wb-kicker {
  display: inline-block !important;
  font-size: 0.74rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.14em !important;
  text-transform: uppercase !important;
  color: #255799 !important;
  margin: 0.4rem 0 0.4rem !important;
  font-family: "Satoshi", -apple-system, sans-serif !important;
}

/* Section spacing */
d-article > section + section,
d-article > section + br + br + section {
  margin-top: 1.5rem;
}
d-article section .wb-section {
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
}

/* SafeDriveVLA name — UCI blue→gold gradient, matching \safeDriveGradientText in the arXiv paper */
.sdv-name {
  font-weight: 600;
  background: linear-gradient(90deg, #255799, #D4A300);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.sdv-name span { color: transparent; }
/* Lighter stops on the dark header so the wordmark keeps its contrast */
.header-content .sdv-name { background-image: linear-gradient(90deg, #8fb4e8, #f5d77e); }

/* Accent rule under kickers */
.sdv-hr {
  height: 3px;
  width: 72px;
  background: linear-gradient(90deg, #255799, #4a7cc0 55%, #D4A300);
  border-radius: 999px;
  margin: .75rem 0 1.25rem;
}

/* Benchmark cards — three axes, stacked vertically */
#benchmark .wb-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-top: 1rem;
}
.sdv-axis-card {
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 1.1rem 1.2rem;
  background: #fff;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.sdv-axis-card:hover {
  border-color: #a9c1e3;
  box-shadow: 0 8px 20px rgba(37, 87, 153, 0.10);
}
.sdv-axis-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  border-radius: 999px;
  background: linear-gradient(135deg, #4a7cc0, #1d4a85);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}
.sdv-axis-card h3 {
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.1rem;
  font-weight: 500;
  margin: 0.2rem 0 0.5rem;
  color: #111827;
}
.sdv-axis-card p {
  font-size: 0.92rem;
  color: #4b5563;
  line-height: 1.6;
  margin: 0 0 0.6rem;
}
.sdv-axis-chip {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: #f8efd0;
  color: #7a5e00;
  margin-right: 0.3rem;
}
.sdv-axis-chip--metric {
  text-transform: none;
  letter-spacing: 0.01em;
  background: #E9EEF5;
  color: #255799;
}
.sdv-axis-meta {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.3rem 0.3rem;
  margin-top: 0.45rem;
}
.sdv-axis-label {
  flex: 0 0 3.5rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #6b7280;
}

/* Method sub-blocks */
#method .wb-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
  margin-top: 1rem;
}
@media (max-width: 1024px) {
  #method .wb-grid { grid-template-columns: 1fr; }
}
.sdv-method-card {
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 1.1rem 1.2rem;
  background: #fff;
}
.sdv-method-card h3 {
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.05rem;
  font-weight: 500;
  margin: 0 0 0.4rem;
}
.sdv-method-card p {
  font-size: 0.92rem;
  color: #4b5563;
  line-height: 1.6;
  margin: 0;
}

/* Driving-mode pills inside Method */
.sdv-mode-pill {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  margin: 0.2rem 0.3rem 0.2rem 0;
}
.sdv-mode-pill.strict   { background: #E9EEF5; color: #1d4a85; }
.sdv-mode-pill.cautious { background: #f8efd0; color: #7a5e00; }
.sdv-mode-pill.fallback { background: #d1fae5; color: #065f46; }

/* ===== Video gallery (WorldLens-style split comparator) ===== */
/* Re-export the comparator styles from worldlens.css (file is otherwise loaded only by worldlens.html) */

.videogen { margin: 1rem auto 0; max-width: 960px; }
.video-hero {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  overflow: hidden;
  background: #111827;
  box-shadow: 0 12px 28px rgba(0,0,0,0.18);
}
.video-compare-split {
  position: relative;
  width: 100%; height: 100%;
  border-radius: inherit;
  overflow: hidden;
  --split: 50%;
}
.video-compare-split .video-wrapper {
  position: absolute; inset: 0;
  pointer-events: none;
}
.video-compare-split .video-el {
  width: 100%; height: 100%;
  object-fit: cover;
}
.video-compare-split .gt-layer {
  clip-path: polygon(0 0, var(--split) 0, var(--split) 100%, 0 100%);
}
.video-compare-split .gen-layer {
  clip-path: polygon(var(--split) 0, 100% 0, 100% 100%, var(--split) 100%);
}
.video-compare-split .video-label {
  position: absolute;
  bottom: 10px;
  padding: 4px 12px;
  font-size: 0.82rem;
  font-family: "Satoshi", -apple-system, sans-serif;
  font-weight: 600;
  border-radius: 999px;
  background: rgba(0,0,0,.6);
  color: #fff;
  backdrop-filter: blur(4px);
  letter-spacing: .3px;
}
.video-compare-split .label-left  { left: 10px; }
.video-compare-split .label-right { right: 10px; }
.video-compare-split .split-handle {
  position: absolute;
  top: 0; bottom: 0;
  width: 28px;
  left: var(--split);
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: ew-resize;
  z-index: 5;
  pointer-events: auto;
}
.video-compare-split .handle-line {
  position: absolute;
  top: 0; bottom: 0;
  width: 2px;
  background: rgba(255,255,255,.9);
  box-shadow: 0 0 8px rgba(0,0,0,.35);
}
.video-compare-split .handle-arrows {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 6px;
  border-radius: 999px;
  background: rgba(0,0,0,.6);
  color: #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,.35);
}

/* Caption under the comparator describing the instruction */
.sdv-scene-caption {
  max-width: 960px;
  margin: 0.75rem auto 0;
  padding: 0.7rem 1rem;
  border-left: 3px solid #255799;
  background: #f1f5fa;
  border-radius: 0 8px 8px 0;
  font-size: 0.88rem;
  color: #374151;
  line-height: 1.55;
  font-family: "Satoshi", -apple-system, sans-serif;
}
.sdv-scene-caption b {
  color: #1d4a85;
  font-weight: 600;
}

/* Thumbnail strip — scene picker */
.thumb-bar {
  display: flex;
  gap: 0.55rem;
  margin: 0.85rem auto 0;
  max-width: 960px;
  flex-wrap: wrap;
  justify-content: center;
}
.thumb {
  position: relative;
  border: 2px solid #e5e7eb;
  background: #f9fafb;
  border-radius: 10px;
  padding: 0;
  overflow: hidden;
  cursor: pointer;
  width: 132px;
  transition: border-color .2s ease, transform .2s ease;
}
.thumb:hover { border-color: #a9c1e3; transform: translateY(-2px); }
.thumb.is-active { border-color: #255799; box-shadow: 0 0 0 3px rgba(37,87,153,0.18); }
.thumb img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
}
.thumb span {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  color: #374151;
  padding: 0.32rem 0.4rem;
  font-family: "Satoshi", -apple-system, sans-serif;
}

/* Placeholder thumbnail (no image yet) */
.thumb-placeholder {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: repeating-linear-gradient(
    45deg,
    #f3f4f6,
    #f3f4f6 6px,
    #e5e7eb 6px,
    #e5e7eb 12px
  );
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9ca3af;
  font-size: 0.72rem;
  font-family: "Satoshi", -apple-system, sans-serif;
}

/* Placeholder video panel (full hero, used until clips are dropped in) */
.video-placeholder {
  width: 100%;
  height: 100%;
  background:
    linear-gradient(135deg, rgba(37,87,153,0.05), rgba(212,163,0,0.05)),
    repeating-linear-gradient(
      45deg,
      #1f2937,
      #1f2937 12px,
      #374151 12px,
      #374151 24px
    );
  display: flex;
  align-items: center;
  justify-content: center;
  color: #e5e7eb;
  font-family: "Satoshi", -apple-system, sans-serif;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 600;
}
.video-placeholder .ph-label {
  background: rgba(0,0,0,0.55);
  padding: 0.55rem 1.2rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.15);
}

/* ===== Results tables (adapted from onevl-table) ===== */
.sdv-table-wrap {
  margin: 1rem auto 1.5rem;
  max-width: 960px;
  overflow-x: auto;
}
.sdv-table-caption {
  font-size: 0.88rem;
  color: #374151;
  margin-bottom: 0.4rem;
  font-family: "Satoshi", -apple-system, sans-serif;
}
.sdv-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  font-family: "Satoshi", -apple-system, sans-serif;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  overflow: hidden;
}
.sdv-table th {
  background: #E9EEF5;
  color: #111827;
  font-weight: 600;
  text-align: center;
  padding: 0.55rem 0.7rem;
  font-size: 0.85rem;
  border-bottom: 1px solid #e5e7eb;
}
.sdv-table td {
  padding: 0.5rem 0.7rem;
  text-align: center;
  border-bottom: 1px solid #f3f4f6;
  color: #374151;
}
.sdv-table tr:last-child td { border-bottom: none; }
.sdv-table .group-header td {
  background: #f9fafb;
  font-weight: 600;
  color: #6b7280;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-align: left;
  padding: 0.4rem 0.7rem;
}
.sdv-table .row-ours { background: #FCF8EB; }
.sdv-table .row-ours td { color: #111827; font-weight: 500; }
.sdv-table .best,
.sdv-table .row-ours td.best { font-weight: 700; color: #255799; }
.sdv-table .underline { text-decoration: underline; text-decoration-color: #D4A300; }
.sdv-table .pending { color: #9ca3af; font-style: italic; }
.sdv-table .sdv-delta { color: #4a7cc0; font-size: 0.8em; font-weight: 500; white-space: nowrap; }
.sdv-table thead tr + tr th { background: #f4f7fb; font-size: 0.8rem; }
.sdv-table th.sdv-th-group { border-bottom: 1px solid #b8cbe6; }

/* Figure captions and side-by-side figure rows */
.sdv-fig-caption {
  font-size: 0.88rem;
  color: #374151;
  line-height: 1.55;
  margin-top: 0.6rem;
  text-align: center;
  font-family: "Satoshi", -apple-system, sans-serif;
}
.sdv-fig-caption b {
  font-family: "Fraunces", Georgia, "Times New Roman", serif;
  letter-spacing: -0.015em;
}
/* Side-by-side figures: each figure's flex-grow is its image aspect ratio (--ar),
   so the images render at the same height and their captions line up */
.sdv-fig-row {
  display: flex;
  gap: 1.5rem;
  max-width: 960px;
  margin: 1rem auto 1.5rem;
  align-items: flex-start;
}
.sdv-fig-row figure {
  flex: var(--ar, 1) 1 0;
  min-width: 0;
  width: auto;
  margin: 0;
}
.sdv-fig-row img { width: 100%; height: auto; display: block; }
@media (max-width: 720px) {
  .sdv-fig-row { flex-direction: column; }
  .sdv-fig-row figure { flex: none; width: 100%; }
}

/* Contributors name list (matches OneVL) */
.contributors-name-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 0.6rem;
  margin-top: 0.6rem;
  font-size: 0.92rem;
  color: #374151;
  line-height: 1.8;
  font-family: "Satoshi", -apple-system, sans-serif;
}
.contributors-name-list span { white-space: nowrap; }
.contributors-name-list span::after { content: ","; color: #9ca3af; }
.contributors-name-list span:last-child::after { content: ""; }

/* Generic placeholder box */
.placeholder-box {
  border: 2px dashed #d1d5db;
  border-radius: 14px;
  padding: 1.5rem;
  text-align: center;
  color: #9ca3af;
  font-size: 0.92rem;
  background: #fafafa;
  margin: 1rem 0;
  font-family: "Satoshi", -apple-system, sans-serif;
}

/* Footer */
.wb-footer {
  text-align: center;
  font-family: "Satoshi", -apple-system, sans-serif;
  font-size: 0.85rem;
  color: #6b7280;
}
.wb-footer a { color: #255799; text-decoration: none; }
.wb-footer a:hover { text-decoration: underline; }

/* Axis 1 — SimLingo vs SafeDriveVLA comparison player (full 1024x912 frames, camera-aligned) */
.sdv-compare-player { max-width: 720px; }
.sdv-compare-player .video-hero {
  aspect-ratio: 1024 / 912;
}
.sdv-compare-player .video-compare-split { cursor: ew-resize; }

/* Table-of-contents heading */
d-article d-contents nav h4 { color: #255799; }

/* ===== Overview video: its own band between the header and the article ===== */
.sdv-overview {
  padding: 3.2rem 1.5rem 0.75rem;
  background: #fff;
}
.sdv-overview-inner {
  max-width: 1040px;
  margin: 0 auto;
  text-align: center;
}
.sdv-overview-kicker {
  font-family: "Satoshi", -apple-system, sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #255799;
}
.sdv-overview-kicker::after {
  content: "";
  display: block;
  width: 72px;
  height: 3px;
  margin: 0.75rem auto 1.4rem;
  border-radius: 999px;
  background: linear-gradient(90deg, #255799, #4a7cc0 55%, #D4A300);
}
.sdv-overview-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 18px;
  overflow: hidden;
  background: #0c1b33;
  border: 1px solid rgba(12, 27, 51, 0.08);
  box-shadow: 0 30px 60px -28px rgba(12, 27, 51, 0.55), 0 2px 8px rgba(12, 27, 51, 0.08);
}
.sdv-overview-frame video {
  display: block;
  width: 100%;
  height: 100%;
}
.sdv-overview-frame video:not([controls]) { cursor: pointer; }
.sdv-overview-play {
  position: absolute;
  left: 22px;
  bottom: 22px;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 1.1rem 0.45rem 0.45rem;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font-family: "Satoshi", -apple-system, sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: #0c1b33;
  background: rgba(255, 253, 244, 0.95);
  box-shadow: 0 0 0 5px rgba(245, 215, 126, 0.5), 0 14px 30px rgba(0, 0, 0, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.sdv-overview-play:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 0 5px rgba(245, 215, 126, 0.85), 0 18px 34px rgba(0, 0, 0, 0.4);
}
.sdv-overview-play[hidden] { display: none; }
.sdv-overview-play-ic {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4a7cc0, #1d4a85);
}
.sdv-overview-play-ic svg { width: 18px; height: 18px; margin-left: 2px; fill: #fff; }
.sdv-overview-dur {
  font-weight: 600;
  color: #6b7280;
  font-variant-numeric: tabular-nums;
}
@media (max-width: 640px) {
  .sdv-overview { padding: 2rem 16px 0.5rem; }
  .sdv-overview-frame { border-radius: 12px; }
  .sdv-overview-play { left: 12px; bottom: 12px; font-size: 0.85rem; }
  .sdv-overview-play-ic { width: 32px; height: 32px; }
}
