/* Flash-dLLM project page.
   Layout idea (one reading column with figures and result tables) after the D2F project page.
   Colors follow the demo videos: near-black ink and one amber accent. */

:root {
  color-scheme: light;
  --font-display: "Manrope", "Inter", "Helvetica Neue", Arial, sans-serif;
  --font-ui: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-body: "Source Serif 4", Georgia, "Times New Roman", serif;
  --ink: #0d1117;
  --text: #2c3440;
  --muted: #667080;
  --line: #e2e5ea;
  --subtle: #f4f5f7;
  --amber: #ffc428;        /* Flash-dLLM color in the videos */
  --amber-deep: #a86a00;   /* the same hue, dark enough for text on white */
  --amber-wash: #fff6dc;
}

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

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

body {
  margin: 0;
  background: #fff;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.75;
}

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 24px 34px;
}

a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--amber);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}
a:hover { background: var(--amber-wash); }
:focus-visible { outline: 2px solid var(--amber-deep); outline-offset: 2px; }

strong { font-weight: 600; color: var(--ink); }

/* Header */

header {
  text-align: center;
  padding: 52px 0 40px;
}
.logo { display: block; width: 76px; height: 76px; margin: 0 auto 26px; }

h1 {
  font-family: var(--font-display);
  font-size: clamp(29px, 4.9vw, 44px);
  font-weight: 800;
  line-height: 1.18;
  letter-spacing: -0.025em;
  color: var(--ink);
  margin: 0 0 26px;
}
h1 .flash {
  background: linear-gradient(transparent 62%, var(--amber) 62%, var(--amber) 92%, transparent 92%);
  padding: 0 2px;
}

.authors { font-family: var(--font-ui); font-size: 19px; }
.authors strong { font-weight: 600; }
.authors a { text-decoration: none; }
.authors a:hover { background: none; text-decoration: underline; text-decoration-color: var(--amber); text-decoration-thickness: 2px; }
.authors span { display: block; }
.authors .affiliation { margin-top: 6px; font-size: 16px; color: var(--muted); }
.authors .note { margin-top: 2px; font-size: 13.5px; color: var(--muted); }

.institution { display: block; width: auto; height: 58px; margin: 22px auto 0; }

.links { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 28px; }
.links a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 20px;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 15.5px;
  font-weight: 600;
  text-decoration: none;
}
.links a:hover { background: var(--amber-wash); }
.links a.primary { background: var(--ink); color: #fff; }
.links a.primary:hover { background: #000; }
.links svg { width: 17px; height: 17px; }

/* Article */

h2, h3 { font-family: var(--font-display); color: var(--ink); line-height: 1.25; letter-spacing: -0.015em; }
h2 {
  font-size: clamp(25px, 3.6vw, 32px);
  font-weight: 800;
  margin: 3.1em 0 0.9em;
}
h2::before {
  content: "";
  display: block;
  width: 44px;
  height: 5px;
  margin-bottom: 16px;
  border-radius: 3px;
  background: var(--amber);
}
h3 { font-size: clamp(20px, 2.6vw, 23px); font-weight: 700; margin: 2.2em 0 0.8em; }

p, ul, ol { margin: 0 0 1.3em; }
ul, ol { padding-left: 26px; }
li { margin-bottom: 0.7em; }
li::marker { color: var(--amber-deep); font-family: var(--font-ui); font-weight: 600; }
code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.86em;
  background: var(--subtle);
  padding: 0.15em 0.4em;
  border-radius: 4px;
}

/* Figures and the demo video */

figure { margin: 40px 0; text-align: center; }
figure a { display: block; background: none; }
figure img,
figure video {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 10px;
  border: 1px solid var(--line);
}
figure img { background: #fff; }
figure video { aspect-ratio: 16 / 9; background: var(--ink); border-color: var(--ink); }
figcaption {
  max-width: 720px;
  margin: 14px auto 0;
  font-family: var(--font-ui);
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--muted);
}
figcaption b { font-weight: 600; color: var(--ink); }

#demo { margin-top: 0; }
.switch {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  margin-bottom: 14px;
  background: var(--subtle);
  border-radius: 999px;
}
.switch button {
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 600;
  color: var(--muted);
  background: none;
  border: 0;
  border-radius: 999px;
  padding: 7px 18px;
  cursor: pointer;
}
.switch button:hover { color: var(--ink); }
.switch button[aria-selected="true"] { background: var(--amber); color: var(--ink); }
.video-panel + .video-panel { margin-top: 36px; }
.js .video-panel + .video-panel { margin-top: 0; }

/* Result tables */

.table-scroll {
  overflow-x: auto;
  margin: 1.2em 0 0.7em;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.results-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
}
.results-table th,
.results-table td {
  padding: 11px 10px;
  border-bottom: 1px solid var(--line);
  text-align: center;
  white-space: nowrap;
}
.results-table th:first-child,
.results-table td:first-child { text-align: left; padding-left: 18px; }
.results-table td.metric { text-align: center; padding-left: 10px; color: var(--muted); }
.results-table thead th {
  background: var(--ink);
  color: #fff;
  font-weight: 600;
  border-bottom: 0;
}
.results-table thead tr.sub th { font-weight: 500; font-size: 0.93em; padding-top: 2px; }
.results-table thead th.ours { background: var(--amber); color: var(--ink); }
.results-table tbody tr:last-child td { border-bottom: 0; }
.results-table tr.ours,
.results-table td.ours { background: var(--amber-wash); }
.results-table tr.group td { border-top: 1px solid #c9ced6; }
.results-table tbody tr.group:first-child td { border-top: 0; }
.results-table strong { font-weight: 700; color: var(--ink); }
.speedup { color: var(--amber-deep); font-weight: 600; }
.table-note {
  font-family: var(--font-ui);
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--muted);
  margin: 0.7em 0 1.4em;
}

/* Citation and footer */

.bibtex { position: relative; }
.bibtex pre {
  margin: 0;
  padding: 24px;
  overflow-x: auto;
  background: var(--ink);
  color: #e6edf3;
  border-radius: 10px;
  line-height: 1.6;
}
.bibtex code { background: none; padding: 0; font-size: 13.5px; color: inherit; }
.copy {
  position: absolute;
  top: 10px;
  right: 10px;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  background: var(--amber);
  border: 0;
  border-radius: 999px;
  padding: 4px 14px;
  cursor: pointer;
}
.copy:hover { background: #ffd35c; }

footer {
  margin-top: 60px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  text-align: center;
  font-family: var(--font-ui);
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--muted);
}
footer p { margin: 0 0 4px; }
footer a { color: var(--muted); text-decoration-thickness: 1.5px; }

/* Narrow screens */

@media (max-width: 640px) {
  body { font-size: 17px; line-height: 1.7; }
  .container { padding: 0 16px 26px; }
  header { padding: 34px 0 30px; }
  .logo { width: 64px; height: 64px; margin-bottom: 20px; }
  .institution { height: 48px; }
  .links a { padding: 8px 15px; font-size: 14.5px; }
  figure { margin: 30px 0; }
  .switch { display: flex; }
  .switch button { flex: 1; padding: 7px 6px; font-size: 13px; }
  .results-table { font-size: 14px; }
  .bibtex pre { padding: 46px 14px 16px; }
}

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