:root {
  --paper: #f6f3ec;
  --paper-deep: #ece7dc;
  --ink: #1e211f;
  --muted: #5d635e;
  --line: #d7d1c5;
  --accent: #a9472d;
  --accent-dark: #78331f;
  --green: #2e6750;
  --white: #fffdfa;
  --shadow: 0 18px 50px rgba(43, 38, 30, 0.09);
  --radius: 18px;
  --max-width: 1160px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

code {
  padding: 0.12rem 0.32rem;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.65);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.88em;
}

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

.narrow {
  max-width: 860px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(215, 209, 197, 0.85);
  background: rgba(246, 243, 236, 0.92);
  backdrop-filter: blur(14px);
}

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

.wordmark {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.08rem;
  font-weight: 700;
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 1.35rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.nav-links a {
  text-decoration: none;
}

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

.language-switch {
  padding: 5px 12px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 750;
  line-height: 1.4;
  text-decoration: none;
}

.language-switch:hover {
  color: var(--white);
  background: var(--ink);
}

.hero {
  padding: 108px 0 62px;
  text-align: center;
}

.eyebrow,
.section-kicker {
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 980px;
  margin: 18px auto 24px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.5rem, 6.2vw, 5.25rem);
  font-weight: 600;
  letter-spacing: -0.045em;
  line-height: 1.02;
}

.hero-lede {
  max-width: 780px;
  margin: 0 auto;
  color: var(--muted);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.13rem, 2.2vw, 1.45rem);
  line-height: 1.55;
}

.hero-actions {
  margin: 34px 0 44px;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 20px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
  transition: transform 160ms ease, background 160ms ease;
}

.github-icon {
  width: 18px;
  height: 18px;
  margin-right: 8px;
  flex: 0 0 auto;
  fill: currentColor;
}

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

.button.primary {
  color: var(--white);
  background: var(--ink);
}

.button.secondary {
  background: transparent;
}

.headline-metrics {
  max-width: 900px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.metric {
  padding: 24px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.metric + .metric {
  border-left: 1px solid var(--line);
}

.metric strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2rem;
  line-height: 1.1;
}

.metric span {
  color: var(--muted);
  font-size: 0.82rem;
}

.wide-media {
  margin-bottom: 84px;
}

.wide-media video,
.wide-media .asset-fallback {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.asset-media {
  display: block;
  max-width: 100%;
  background: #d8d2c6;
  object-fit: cover;
}

.asset-fallback {
  min-height: 260px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px dashed #aaa194;
  color: var(--muted);
  background: repeating-linear-gradient(-45deg, #eee9df, #eee9df 12px, #f5f1e9 12px, #f5f1e9 24px);
  text-align: center;
}

.asset-fallback[hidden] {
  display: none;
}

.asset-fallback span {
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.media-caption,
figcaption {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.paper-section {
  padding: 94px 0;
  scroll-margin-top: 64px;
}

.paper-section.muted {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--paper-deep);
}

.paper-section h2 {
  max-width: 820px;
  margin: 10px 0 24px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 4vw, 3.25rem);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.08;
}

.paper-section h3 {
  margin: 0 0 10px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.35rem;
  line-height: 1.2;
}

.abstract,
.section-intro {
  color: var(--muted);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.18rem;
  line-height: 1.8;
}

.section-intro {
  max-width: 840px;
  margin-bottom: 36px;
}

.system-grid {
  margin-top: 42px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.architecture-figure {
  margin-top: 42px;
}

.architecture-frame,
.architecture-frame img {
  width: 100%;
  aspect-ratio: 16 / 9;
}

.media-panel {
  margin: 0;
}

.asset-frame {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ddd6ca;
}

.image-frame,
.image-frame img,
.video-frame,
.video-frame video {
  width: 100%;
  aspect-ratio: 16 / 10;
}

.architecture {
  margin-top: 64px;
  display: grid;
  grid-template-columns: 1fr auto 1.2fr auto 1fr;
  align-items: center;
  gap: 14px;
}

.arch-node {
  min-height: 142px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.48);
}

.arch-node.emphasized {
  color: var(--white);
  border-color: var(--ink);
  background: var(--ink);
}

.arch-label {
  margin-bottom: 6px;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.arch-node strong {
  font-size: 1rem;
}

.arch-node small {
  margin-top: 4px;
  color: #898e89;
}

.arch-arrow {
  color: var(--accent);
  font-size: 1.5rem;
}

.arch-branch {
  grid-column: 2 / 5;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  color: var(--muted);
  font-size: 0.82rem;
  text-align: center;
}

.arch-branch span {
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
}

.evidence-note {
  max-width: 850px;
  margin: 34px auto 0;
  padding-left: 18px;
  border-left: 3px solid var(--accent);
  color: var(--muted);
  font-size: 0.92rem;
}

.method-steps {
  margin-top: 42px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.method-card {
  min-height: 260px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 253, 250, 0.58);
}

.method-card p {
  color: var(--muted);
  font-size: 0.92rem;
}

.step-number {
  display: block;
  margin-bottom: 42px;
  color: var(--accent);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.35rem;
}

.hil-media {
  margin-top: 34px;
  padding: 34px;
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  align-items: center;
  gap: 34px;
  border-radius: var(--radius);
  color: var(--white);
  background: var(--ink);
}

.hil-media p {
  margin: 0;
  color: #c6c8c4;
}

.method-media-grid {
  margin-top: 34px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.method-media-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 253, 250, 0.58);
}

.score-chart {
  margin: 38px 0 52px;
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
}

.score-row {
  display: grid;
  grid-template-columns: 180px 1fr 58px;
  align-items: center;
  gap: 18px;
}

.score-row + .score-row {
  margin-top: 22px;
}

.score-name {
  display: flex;
  flex-direction: column;
}

.score-name small {
  color: var(--muted);
}

.score-track {
  height: 16px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--paper-deep);
}

.score-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #777c77;
}

.score-row.highlight .score-track span {
  background: var(--accent);
}

.score-row.highlight .score-value {
  color: var(--accent);
}

.score-value {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.35rem;
  font-weight: 700;
  text-align: right;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  background: rgba(255, 255, 255, 0.42);
}

th,
td {
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

th {
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

tbody tr:last-child td {
  border-bottom: 0;
}

td.best {
  color: var(--accent-dark);
  font-weight: 800;
}

.swatch {
  width: 10px;
  height: 10px;
  margin-right: 9px;
  display: inline-block;
  border: 1px solid rgba(0, 0, 0, 0.22);
  border-radius: 50%;
}

.swatch.blue { background: #2469b1; }
.swatch.green { background: #468151; }
.swatch.red { background: #b94234; }
.swatch.yellow { background: #e3bd31; }
.swatch.white { background: #fff; }

.result-notes {
  margin: 26px 0 56px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.result-notes article {
  padding: 22px;
  display: flex;
  flex-direction: column;
  border-top: 2px solid var(--accent);
  background: rgba(255, 255, 255, 0.34);
}

.result-notes strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.7rem;
}

.result-notes span {
  color: var(--muted);
  font-size: 0.82rem;
}

.towel-panel {
  max-width: 900px;
  margin: 0 auto;
}

.towel-panel .image-frame,
.towel-panel .image-frame img {
  aspect-ratio: 3 / 4;
}

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

.limitations-list {
  margin: 34px 0;
  padding: 0;
  list-style: none;
}

.limitations-list li {
  padding: 18px 0 18px 28px;
  position: relative;
  border-top: 1px solid var(--line);
}

.limitations-list li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--accent);
}

.limitations-list li:last-child {
  border-bottom: 1px solid var(--line);
}

.closing-statement {
  padding: 28px;
  border-radius: 12px;
  color: var(--white);
  background: var(--green);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.12rem;
}

footer {
  border-top: 1px solid var(--line);
  background: var(--paper-deep);
}

.footer-inner {
  min-height: 110px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  color: var(--muted);
  font-size: 0.88rem;
}

.footer-inner a:hover {
  color: var(--accent);
}

@media (max-width: 900px) {
  .method-steps,
  .result-notes {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .video-grid {
    grid-template-columns: 1fr;
  }

  .method-media-grid {
    grid-template-columns: 1fr;
  }

  .video-grid .media-panel {
    max-width: 720px;
  }
}

@media (max-width: 720px) {
  .nav-shell {
    min-height: 58px;
  }

  .nav-links {
    display: none;
  }

  .hero {
    padding: 72px 0 42px;
  }

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

  .metric:nth-child(3) {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

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

  .paper-section {
    padding: 68px 0;
  }

  .system-grid,
  .hil-media {
    grid-template-columns: 1fr;
  }

  .architecture {
    grid-template-columns: 1fr;
  }

  .arch-arrow {
    transform: rotate(90deg);
    text-align: center;
  }

  .arch-branch {
    grid-column: 1;
  }

  .score-row {
    grid-template-columns: 1fr 52px;
    gap: 10px;
  }

  .score-track {
    grid-column: 1 / 3;
    grid-row: 2;
  }

  .score-value {
    grid-column: 2;
    grid-row: 1;
  }

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

@media (max-width: 520px) {
  .section-shell,
  .nav-shell {
    width: min(calc(100% - 28px), var(--max-width));
  }

  .method-steps,
  .result-notes,
  .arch-branch {
    grid-template-columns: 1fr;
  }

  .method-card {
    min-height: 0;
  }

  .step-number {
    margin-bottom: 24px;
  }

  .hil-media,
  .score-chart {
    padding: 22px;
  }
}

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

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}

/* Project attribution beneath the title. */
.project-credits {
  max-width: 860px;
  margin: 0 auto 28px;
  color: var(--muted);
  font-size: 0.95rem;
}

.project-credits p {
  margin: 5px 0;
}

.project-credits .project-authors,
.project-credits .project-advisor {
  color: var(--ink);
  font-size: 1.2rem;
  font-weight: 650;
}

.project-credits .project-advisor {
  margin-top: 12px;
  color: var(--ink);
}
