
/* =========================================================
   CRAFT Project Website
   ========================================================= */

:root {
  --ink: #101828;
  --muted: #5d6877;
  --line: #dde3ea;
  --line-strong: #aeb8c5;
  --surface: #ffffff;
  --surface-soft: #f6f8fb;
  --accent: #2563eb;
  --accent-dark: #1748b4;
  --accent-soft: #eaf2ff;
  --craft-row: #e8f2ff;
  --max-width: 1120px;
  --wide-width: 1220px;
  --shadow: 0 18px 50px rgba(16, 24, 40, 0.08);
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  color: var(--ink);
  background: var(--surface);
  font-family:
    Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI",
    Helvetica, Arial, sans-serif;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
}

img,
video {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.page {
  width: min(var(--max-width), calc(100% - 40px));
  margin-inline: auto;
}

.page-wide {
  width: min(var(--wide-width), calc(100% - 40px));
  margin-inline: auto;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 1000;
  padding: 10px 14px;
  border-radius: 8px;
  color: #fff;
  background: var(--ink);
  transform: translateY(-160%);
  transition: transform 0.2s ease;
}

.skip-link:focus {
  transform: translateY(0);
}


/* =========================================================
   Navigation
   ========================================================= */

.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid rgba(221, 227, 234, 0.88);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(16px);
}

.nav-inner {
  display: flex;
  width: min(var(--max-width), calc(100% - 40px));
  min-height: 64px;
  margin-inline: auto;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 9px;
  color: #fff;
  background: var(--accent);
  font-size: 15px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 22px;
}

.nav-links a {
  color: #485467;
  font-size: 13px;
  font-weight: 650;
  text-decoration: none;
  transition: color 0.18s ease;
}

.nav-links a:hover {
  color: var(--accent);
}


/* =========================================================
   Hero
   ========================================================= */

.hero {
  padding: 90px 0 58px;
  text-align: center;
}

.hero-inner {
  max-width: 1020px;
}

.eyebrow,
.section-kicker,
.method-label {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 1000px;
  margin: 0 auto 24px;
  font-size: clamp(40px, 6vw, 68px);
  line-height: 1.04;
  letter-spacing: -0.045em;
  text-wrap: balance;
}

.authors {
  margin: 0;
  font-size: 17px;
  font-weight: 650;
}

.affiliation {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.hero-claim {
  max-width: 830px;
  margin: 30px auto 0;
  color: #425066;
  font-size: clamp(18px, 2.3vw, 23px);
  line-height: 1.55;
  text-wrap: balance;
}

.hero-claim strong {
  color: var(--ink);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 30px;
}

.button {
  display: inline-flex;
  min-height: 44px;
  padding: 10px 17px;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 750;
  text-decoration: none;
  transition:
    transform 0.18s ease,
    background-color 0.18s ease,
    border-color 0.18s ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button-primary {
  color: #fff;
  background: var(--accent);
}

.button-primary:hover {
  background: var(--accent-dark);
}

.button-secondary {
  border-color: #cfd7e3;
  background: #fff;
}

.button-secondary:hover {
  border-color: #aeb8c7;
  background: var(--surface-soft);
}

.button-ghost {
  color: var(--accent);
  background: var(--accent-soft);
}


/* =========================================================
   Headline metrics
   ========================================================= */

.metrics-band {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.metric-item {
  min-height: 150px;
  padding: 28px 24px;
  border-left: 1px solid var(--line);
  text-align: center;
}

.metric-item:last-child {
  border-right: 1px solid var(--line);
}

.metric-item strong {
  display: block;
  color: var(--ink);
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1;
  letter-spacing: -0.04em;
}

.metric-item span {
  display: block;
  margin-top: 11px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}


/* =========================================================
   Hero visual
   ========================================================= */

.hero-visual-section {
  padding: 52px 0 36px;
}

.hero-visual {
  margin: 0;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: #fff;
  box-shadow: var(--shadow);
}

.hero-visual img {
  width: 100%;
  max-height: 600px;
  object-fit: contain;
}

.hero-visual figcaption {
  max-width: 820px;
  margin: 18px auto 0;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}


/* =========================================================
   Shared sections
   ========================================================= */

.section {
  padding: 96px 0;
}

.section-tinted {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
}

.section-heading {
  max-width: 850px;
  margin-bottom: 40px;
}

.section-heading-center {
  max-width: 860px;
  margin-right: auto;
  margin-left: auto;
  text-align: center;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(32px, 4.2vw, 50px);
  line-height: 1.08;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.section-lead,
.section-summary {
  max-width: 800px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.7;
}

.section-heading-center .section-lead,
.section-heading-center .section-summary {
  margin-right: auto;
  margin-left: auto;
}


/* =========================================================
   Overview
   ========================================================= */

.overview-figure {
  width: min(1440px, calc(100vw - 72px));
  margin: 36px auto 0;
  padding: 18px;

  border: 1px solid var(--line);
  border-radius: 22px;

  background: #fff;
  box-shadow: 0 14px 40px rgba(16, 24, 40, 0.06);
}

.overview-figure img {
  width: 100%;
  max-height: 620px;
  object-fit: contain;

  border: 0;
  border-radius: 12px;
  background: #fff;
}

.overview-figure figcaption {
  max-width: 860px;
  margin: 14px auto 0;

  color: var(--muted);
  text-align: center;
  font-size: 15px;
  line-height: 1.65;
}




/* =========================================================
   Method
   ========================================================= */

.method-section {
  width: auto;
  margin-right: 0;
  margin-left: 0;
}

.method-section > .page {
  width: min(1480px, calc(100vw - 72px));
  max-width: none;
}

.method-row {
  display: grid;
  grid-template-columns: 360px minmax(0, 960px);
  gap: 48px;
  align-items: center;
  justify-content: center;

  width: 100%;
  margin: 44px auto 0;
}

.method-row + .method-row {
  margin-top: 52px;
}

.method-row-reverse {
  grid-template-columns: minmax(0, 960px) 360px;
}

.method-row-reverse .method-copy {
  grid-column: 2;
  grid-row: 1;
}

.method-row-reverse .method-figure-box {
  grid-column: 1;
  grid-row: 1;
}

.method-copy {
  width: 100%;
  max-width: 360px;
}

.method-copy h3 {
  margin: 0 0 14px;
  font-size: 26px;
  line-height: 1.22;
  letter-spacing: -0.018em;
}

.method-copy p:not(.method-label) {
  margin: 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.78;
}

.method-figure-box {
  display: flex;
  width: 100%;
  height: 440px;
  margin: 0;
  padding: 20px;

  align-items: center;
  justify-content: center;

  border: 1px solid var(--line);
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 14px 40px rgba(16, 24, 40, 0.06);
}

.method-figure-box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}


/* =========================================================
   Qualitative Rollouts: Wide Baseline vs CRAFT Comparisons
   ========================================================= */

.rollouts-wide {
  width: min(1480px, calc(100vw - 72px));
  margin-inline: auto;
}

.comparison-list {
  display: grid;
  gap: 48px;
}

.comparison-card {
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.comparison-video-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  overflow: hidden;

  border: 1px solid var(--line);
  border-radius: 22px;
  background: #0d1117;
}

.comparison-video {
  position: relative;
  min-width: 0;
  background: #0d1117;
}

.comparison-video + .comparison-video {
  border-left: 1px solid rgba(255, 255, 255, 0.18);
}

.comparison-video video {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #0d1117;
}

.comparison-label {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 2;

  padding: 6px 11px;
  border-radius: 999px;

  color: #fff;
  background: rgba(15, 23, 42, 0.74);
  backdrop-filter: blur(8px);

  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.comparison-ours .comparison-label {
  background: rgba(37, 99, 235, 0.86);
}

.comparison-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #fff;
  box-shadow: none;
}

.comparison-video-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  overflow: hidden;
  background: #0d1117;
}

.comparison-desc {
  margin: 0;
  padding: 22px 28px 26px;

  border-top: 1px solid var(--line);
  background: #fff;

  text-align: left;
}

.comparison-desc h3 {
  margin: 0 0 8px;
  font-size: 24px;
  line-height: 1.25;
  letter-spacing: -0.015em;
}

.comparison-desc p {
  max-width: 980px;
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
}




@media (max-width: 760px) {
  .rollouts-wide {
    width: min(100% - 28px, var(--max-width));
  }

  .comparison-list {
    gap: 38px;
  }

  .comparison-video-row {
    grid-template-columns: 1fr;
    border-radius: 16px;
  }

  .comparison-video + .comparison-video {
    border-left: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.16);
  }

  .comparison-desc {
    margin-top: 14px;
    text-align: left;
  }

  .comparison-desc h3 {
    font-size: 21px;
  }
}




/* =========================================================
   Main Results Table
   ========================================================= */

.results-table-wrap {
  width: 100%;
  overflow: hidden;
  border-top: 2px solid #252525;
  border-bottom: 2px solid #252525;
  background: #fff;
}

.results-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  color: #1f1f1f;
  font-family: "Times New Roman", Times, serif;
  font-size: clamp(11px, 1.05vw, 15px);
  font-variant-numeric: tabular-nums;
}

.results-table .base-col {
  width: 12%;
}

.results-table .strategy-col {
  width: 13%;
}

.results-table .reference-col {
  width: 12%;
}

.results-table .metric-col {
  width: 7.875%;
}

.results-table th,
.results-table td {
  padding: 7px 5px;
  vertical-align: middle;
  line-height: 1.2;
}

.results-table thead th {
  color: #1d1d1d;
  background: #fff;
  text-align: center;
  white-space: nowrap;
  font-weight: 700;
}

.results-table thead tr:first-child th {
  padding-top: 10px;
  padding-bottom: 5px;
  border-bottom: 0;
  font-size: 1.02em;
}

.results-table thead tr:first-child th[colspan] {
  position: relative;
}

.results-table thead tr:first-child th[colspan]::after {
  content: "";
  position: absolute;
  right: 7%;
  bottom: 0;
  left: 7%;
  height: 1px;
  background: #777;
}

.results-table thead tr:nth-child(2) th {
  padding-top: 4px;
  padding-bottom: 8px;
  border-bottom: none;
  font-size: 0.98em;
}

.results-table thead th[rowspan="2"] {
  vertical-align: middle;
}

.traffic-head span {
  display: block;
}

.traffic-head .traffic-sub {
  margin: 5px 7% 0;
  padding-top: 4px;
  border-top: 1px solid #777;
}

.results-table tbody tr {
  background: #fff;
}

.results-table tbody td {
  padding-top: 6px;
  padding-bottom: 6px;
  border: 0;
  text-align: center;
  white-space: nowrap;
}

.results-table tbody tr.section-divider td {
  border-top: 1.25px solid #555;
}

.results-table tbody tr.craft-row {
  background: var(--craft-row);
}

.results-table tbody tr.craft-row td {
  background: transparent;
}

.results-table strong {
  font-weight: 800;
}

.craft-tag {
  font-weight: 800;
  letter-spacing: 0;
}

.result-callouts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 22px;
}

.result-callouts article {
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.result-callouts strong,
.result-callouts span {
  display: block;
}

.result-callouts strong {
  font-size: 14px;
}

.result-callouts span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}


/* =========================================================
   Analysis and Robustness
   ========================================================= */

.analysis-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.analysis-card {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
}

.analysis-figure-box {
  display: flex;
  height: 330px;
  padding: 18px;
  align-items: center;
  justify-content: center;
  background: var(--surface-soft);
}

.analysis-figure-box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.analysis-card figcaption {
  padding: 20px 22px 23px;
  color: var(--muted);
  font-size: 14px;
}

.analysis-card figcaption strong {
  color: var(--ink);
}

.wide-figure {
  margin: 0;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fff;
}

.wide-figure img {
  width: 100%;
  max-height: 560px;
  object-fit: contain;
}


/* =========================================================
   Takeaways and Citation
   ========================================================= */

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

.takeaway-grid article {
  min-height: 180px;
  padding: 26px;
  border-top: 3px solid var(--accent);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-left: 1px solid var(--line);
  border-radius: 14px;
}

.takeaway-grid h3 {
  margin: 0 0 10px;
  font-size: 20px;
}

.takeaway-grid p {
  margin: 0;
  color: var(--muted);
}

.citation-section {
  border-top: 1px solid var(--line);
  background: #0f172a;
}

.citation-section .section-kicker {
  color: #8fb5ff;
}

.citation-section h2 {
  color: #fff;
}

.bibtex-box {
  position: relative;
}

.bibtex-box pre {
  margin: 0;
  overflow-x: auto;
  padding: 28px;
  border: 1px solid #334155;
  border-radius: 18px;
  color: #dbe7f7;
  background: #111c31;
  font: 14px/1.65 "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.copy-button {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  padding: 8px 11px;
  border: 1px solid #475569;
  border-radius: 8px;
  color: #fff;
  background: #1e293b;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}


/* =========================================================
   Footer
   ========================================================= */

.site-footer {
  color: #8994a5;
  background: #0b1220;
}

.footer-inner {
  display: flex;
  min-height: 92px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  font-size: 12px;
}


/* =========================================================
   Responsive
   ========================================================= */

@media (max-width: 980px) {
  .nav-links {
    gap: 14px;
  }

  .nav-links a:nth-child(4),
  .nav-links a:nth-child(5) {
    display: none;
  }

  .metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric-item:nth-child(3),
  .metric-item:nth-child(4) {
    border-top: 1px solid var(--line);
  }

  .takeaway-grid,
  .result-callouts {
    grid-template-columns: 1fr;
  }

  .method-section {
    width: min(var(--max-width), calc(100% - 40px));
  }

  .method-row,
  .method-row-reverse {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .method-row-reverse .method-copy,
  .method-row-reverse .method-figure-box {
    grid-column: auto;
    grid-row: auto;
  }

  .method-copy {
    max-width: 100%;
    text-align: center;
  }

  .method-figure-box {
    height: 340px;
  }

  .results-table-wrap {
    overflow: visible;
    border: 0;
    background: transparent;
  }

  .results-table,
  .results-table tbody {
    display: block;
  }

  .results-table colgroup,
  .results-table thead {
    display: none;
  }

  .results-table tbody tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 18px;
    margin-bottom: 14px;
    padding: 12px 14px;
    border: 1px solid #d9d9d9;
    border-top: 2px solid #333;
    border-radius: 12px;
    background: #fff;
  }

  .results-table tbody tr.craft-row {
    background: var(--craft-row);
  }

  .results-table tbody td {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    padding: 7px 0;
    border-bottom: 1px solid #e6e6e6;
    text-align: right;
    white-space: normal;
  }

  .results-table tbody td::before {
    content: attr(data-label);
    flex: 1;
    color: #555;
    font-family:
      Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI",
      Helvetica, Arial, sans-serif;
    font-weight: 650;
    text-align: left;
  }

  .results-table tbody td:last-child {
    border-bottom: 0;
  }

  .results-table tbody tr.section-divider td {
    border-top: 0;
  }
}

@media (max-width: 760px) {
  .page,
  .page-wide,
  .nav-inner {
    width: min(100% - 28px, var(--max-width));
  }

  .site-nav {
    position: static;
  }

  .nav-inner {
    min-height: 58px;
  }

  .nav-links {
    display: none;
  }

  .hero {
    padding: 68px 0 44px;
  }

  .hero h1 {
    font-size: clamp(38px, 12vw, 56px);
  }

  .hero-claim {
    font-size: 18px;
  }

  .section {
    padding: 72px 0;
  }

  .section-heading h2 {
    font-size: 34px;
  }

  .section-lead,
  .section-summary {
    font-size: 16px;
  }

  .overview-figure {
    width: 100%;
  }

  .overview-figure img {
    max-height: 320px;
  }

  .analysis-pair {
    grid-template-columns: 1fr;
  }

  .analysis-figure-box {
    height: 280px;
  }

  .footer-inner {
    padding: 24px 0;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 6px;
  }
}

@media (max-width: 560px) {
  .metrics-grid {
    grid-template-columns: 1fr;
  }

  .metric-item {
    min-height: 124px;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
  }

  .metric-item:last-child {
    border-bottom: 0;
  }

  .hero-actions {
    align-items: stretch;
  }

  .button {
    width: 100%;
  }

  .hero-visual {
    padding: 12px;
    border-radius: 16px;
  }

  .method-figure-box {
    height: 260px;
    padding: 12px;
  }

  .results-table tbody tr {
    grid-template-columns: 1fr;
  }

  .bibtex-box pre {
    padding: 58px 18px 20px;
    font-size: 12px;
  }
}

.extra-video-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  margin-top: 28px;
}

.extra-video-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #0d1117;
  box-shadow: 0 12px 32px rgba(16, 24, 40, 0.07);
}

.extra-video-card video {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #0d1117;
}

.extra-video-label {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;

  padding: 6px 11px;
  border-radius: 999px;

  color: #fff;
  background: rgba(15, 23, 42, 0.76);
  backdrop-filter: blur(8px);

  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

@media (max-width: 760px) {
  .extra-video-grid {
    grid-template-columns: 1fr;
    gap: 18px;
    margin-top: 22px;
  }

  .extra-video-card {
    border-radius: 16px;
  }
}
.score-word,
.score-legend span {
  font-weight: 800;
}

.score-green {
  color: #16a34a;
}

.score-yellow {
  color: #ca8a04;
}

.score-red {
  color: #dc2626;
}

.score-legend {
  display: flex;
  max-width: 460px;
  margin-top: 14px;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.score-gradient {
  flex: 1;
  height: 9px;
  border-radius: 999px;
  background: linear-gradient(90deg, #16a34a 0%, #facc15 50%, #dc2626 100%);
}
.comparison-card-open-loop .comparison-desc p {
  max-width: 1500px;
}
