:root {
  --ink: #202431;
  --muted: #626a7b;
  --line: #dfe4ef;
  --paper: #ffffff;
  --wash: #f5f7fb;
  --blue: #586f9c;
  --blue-deep: #40577f;
  --blue-soft: #e9eef8;
  --purple: #756b9b;
  --purple-soft: #eeebf7;
  --shadow: 0 16px 44px rgba(56, 68, 96, 0.10);
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: "Noto Sans", sans-serif;
  font-size: 16px;
  line-height: 1.72;
}

a {
  color: var(--blue-deep);
}

.project-hero {
  background:
    radial-gradient(circle at 12% 8%, rgba(88, 111, 156, 0.13), transparent 34%),
    radial-gradient(circle at 88% 28%, rgba(117, 107, 155, 0.13), transparent 31%),
    var(--paper);
  border-bottom: 1px solid var(--line);
}

.project-hero .hero-body {
  padding: 5rem 1.5rem 4.5rem;
}

.project-hero .container {
  max-width: 1280px !important;
  width: calc(100% - 3rem) !important;
}

.project-mark {
  align-items: center;
  display: inline-flex;
  gap: 0.35rem;
  justify-content: center;
  margin-bottom: 2.35rem;
  min-height: 9.5rem;
}

.project-mark__logo {
  filter: drop-shadow(0 9px 12px rgba(45, 57, 79, 0.18));
  height: 9.5rem;
  object-fit: contain;
  width: 9.5rem;
}

.project-mark__word {
  color: #ffffff;
  font-family: "Google Sans", "Noto Sans", sans-serif;
  font-size: clamp(3rem, 7vw, 5rem);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 1;
  -webkit-text-stroke: 0.4px rgba(62, 69, 82, 0.15);
  text-shadow:
    0 1px 0 rgba(109, 117, 132, 0.28),
    0 4px 4px rgba(75, 83, 99, 0.28),
    0 11px 20px rgba(56, 68, 96, 0.26);
}

.publication-title {
  color: #363636;
  font-family: "Google Sans", "Noto Sans", sans-serif;
  font-size: clamp(2.75rem, 4.1vw, 3.7rem) !important;
  font-weight: 400 !important;
  letter-spacing: -0.03em;
  line-height: 1.06;
  margin: 0 auto 2.3rem !important;
  max-width: 1180px;
}

.publication-authors {
  color: var(--muted);
  margin: 0 auto 1.7rem;
}

.author-line,
.affiliation-line {
  margin: 0.22rem 0;
}

.todo-inline {
  background: var(--wash);
  border: 1px solid var(--line);
  border-radius: 999px;
  display: inline-block;
  font-size: 0.95rem;
  padding: 0.27rem 0.75rem;
}

.publication-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 1.4rem;
}

.resource-button.button {
  background: #363636;
  border: 1px solid #363636;
  border-radius: 999px;
  box-shadow: none;
  color: #ffffff;
  font-family: "Google Sans", "Noto Sans", sans-serif;
  font-size: 1.05rem;
  font-weight: 500;
  height: auto;
  min-width: auto;
  padding: 0.7rem 1.25rem;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.resource-button.button:hover,
.resource-button.button:focus-visible {
  background: #242424;
  border-color: #242424;
  box-shadow: 0 8px 20px rgba(32, 36, 49, 0.18);
  color: #ffffff;
  transform: translateY(-1px);
}

.resource-icon {
  color: #ffffff;
  fill: currentColor;
  flex: 0 0 auto;
  height: 1rem;
  margin-right: 0.35rem;
  width: 1rem;
}

.section {
  padding: 5.5rem 1.5rem;
}

.section--first {
  padding-top: 4.5rem;
}

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

.section-heading {
  margin: 0 auto 2.5rem;
  max-width: 760px;
}

.section-heading .title,
.bibtex-title {
  color: var(--ink);
  font-family: "Source Serif 4", Georgia, serif;
  letter-spacing: -0.025em;
  margin-top: 0.2rem;
}

.eyebrow {
  color: var(--blue);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  margin-bottom: 0.55rem;
  text-transform: uppercase;
}

.section-lead {
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.65;
}

.publication-video {
  border-radius: 1.1rem;
  overflow: hidden;
  position: relative;
  width: 100%;
}

.demo-frame {
  aspect-ratio: 16 / 9;
  background: #eef1f7;
  border: 1px solid #d7ddea;
  box-shadow: var(--shadow);
}

.demo-frame video {
  background: #11151d;
  height: 100%;
  object-fit: contain;
  width: 100%;
}

.media-placeholder {
  align-items: center;
  background:
    linear-gradient(135deg, rgba(88, 111, 156, 0.07), rgba(117, 107, 155, 0.08)),
    repeating-linear-gradient(135deg, rgba(255,255,255,0.55) 0 1px, transparent 1px 16px);
  color: var(--ink);
  display: flex;
  gap: 1.1rem;
  height: 100%;
  justify-content: center;
  padding: 2rem;
}

.media-placeholder__icon {
  align-items: center;
  background: var(--paper);
  border: 1px solid #ccd4e3;
  border-radius: 50%;
  box-shadow: 0 10px 28px rgba(56, 68, 96, 0.13);
  color: var(--blue);
  display: inline-flex;
  height: 4.2rem;
  justify-content: center;
  padding-left: 0.25rem;
  width: 4.2rem;
}

.media-placeholder strong,
.media-placeholder span {
  display: block;
}

.media-placeholder strong {
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 1.35rem;
}

.media-placeholder div > span {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 0.25rem;
}

.abstract-copy {
  color: #343947;
  font-size: 1.03rem;
  text-align: justify;
}

.abstract-copy p:not(:last-child) {
  margin-bottom: 1.15rem;
}

.framework-figure {
  margin: 0 auto;
}

.framework-figure img {
  display: block;
  height: auto;
  width: 100%;
}

.framework-description {
  color: #343947;
  font-size: 1rem;
  line-height: 1.75;
  margin: 1.75rem auto 0;
  text-align: justify;
}

.experiment-grid {
  align-items: start;
  display: grid;
  gap: 2.5rem 2rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.result-figure {
  margin: 0;
}

.result-figure--centered {
  grid-column: 1 / -1;
  justify-self: center;
  max-width: 620px;
  width: 100%;
}

.result-figure__media {
  align-items: center;
  background: var(--paper);
  display: flex;
  justify-content: center;
  min-height: 360px;
}

.result-figure__media img {
  display: block;
  height: auto;
  max-height: 500px;
  max-width: 100%;
  object-fit: contain;
  width: 100%;
}

.result-figure__media--wide img {
  max-height: 360px;
}

.result-figure figcaption {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.6;
  margin-top: 1rem;
  text-align: center;
}

.result-figure figcaption strong {
  color: var(--ink);
}

.adaptation-summary {
  border-bottom: 1px solid var(--line);
  border-top: 1px solid var(--line);
  margin-top: 3rem;
  padding: 1.5rem 0;
}

.adaptation-summary h3 {
  color: var(--ink);
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 1.15rem;
  text-align: center;
}

.adaptation-summary h3 span {
  color: var(--muted);
  font-weight: 400;
}

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

.adaptation-metrics > div {
  padding: 0.15rem 1rem;
  text-align: center;
}

.adaptation-metrics > div + div {
  border-left: 1px solid var(--line);
}

.adaptation-metrics strong,
.adaptation-metrics span {
  display: block;
}

.adaptation-metrics strong {
  color: var(--blue-deep);
  font-family: "Google Sans", "Noto Sans", sans-serif;
  font-size: 1.55rem;
  font-weight: 500;
  line-height: 1.2;
}

.adaptation-metrics span {
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 0.28rem;
}

.system-flow {
  align-items: stretch;
  display: grid;
  gap: 0.9rem;
  grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr;
}

.flow-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  box-shadow: 0 7px 24px rgba(56, 68, 96, 0.06);
  padding: 1.35rem;
}

.flow-card--accent {
  background: linear-gradient(145deg, var(--blue-soft), #f7f8fc);
  border-color: #cfd8e9;
}

.flow-index {
  color: var(--purple);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.flow-card h3 {
  color: var(--ink);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.35;
  margin: 0.35rem 0 0.65rem;
}

.flow-card p {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.6;
}

.flow-arrow {
  align-self: center;
  color: #9ca7bd;
  font-size: 1.35rem;
}

.overview-note {
  align-items: center;
  background: #253047;
  border-radius: 0.9rem;
  color: #f8f9fc;
  display: grid;
  gap: 2rem;
  grid-template-columns: minmax(220px, 0.7fr) 1.3fr;
  margin-top: 1.2rem;
  padding: 1.45rem 1.6rem;
}

.overview-note strong,
.overview-note span {
  display: block;
}

.note-label {
  color: #b8c2d7;
  font-size: 0.69rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  margin-bottom: 0.24rem;
  text-transform: uppercase;
}

.overview-note p {
  color: #d8deea;
  font-size: 0.9rem;
  line-height: 1.6;
}

.asset-slot {
  align-items: center;
  background: var(--wash);
  border: 1px dashed #b8c2d4;
  border-radius: 0.75rem;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  justify-content: center;
  margin-top: 1.25rem;
  min-height: 7.5rem;
  padding: 1.25rem;
  text-align: center;
}

.section--tinted .asset-slot {
  background: var(--paper);
}

.asset-slot strong {
  color: var(--ink);
  margin-bottom: 0.15rem;
}

.asset-slot span {
  font-size: 0.87rem;
}

.metrics-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(3, 1fr);
}

.metric-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  box-shadow: 0 8px 24px rgba(56, 68, 96, 0.06);
  padding: 1.5rem;
}

.metric-label {
  color: var(--blue);
  font-size: 0.73rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.metric-value {
  color: var(--ink);
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 2.7rem;
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1.1;
  margin: 0.55rem 0 0.65rem;
}

.metric-card > p:last-child {
  color: var(--muted);
  font-size: 0.9rem;
}

.results-panel {
  align-items: center;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  display: grid;
  gap: 2rem;
  grid-template-columns: 1.15fr 0.85fr;
  margin-top: 1rem;
  padding: 2rem;
}

.results-copy p {
  color: var(--muted);
}

.result-note {
  border-left: 3px solid var(--purple);
  font-size: 0.86rem;
  margin-top: 1.1rem;
  padding-left: 0.9rem;
}

.bar-chart {
  background: var(--wash);
  border-radius: 0.75rem;
  padding: 1.35rem;
}

.chart-title {
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 1.1rem;
}

.bar-row {
  align-items: center;
  display: grid;
  font-size: 0.77rem;
  gap: 0.6rem;
  grid-template-columns: 7.1rem 1fr 2.5rem;
  margin: 0.7rem 0;
}

.bar-track {
  background: #dfe4ee;
  border-radius: 999px;
  height: 0.62rem;
  overflow: hidden;
}

.bar-fill {
  background: #9aa7bd;
  border-radius: inherit;
  display: block;
  height: 100%;
}

.bar-fill--ours {
  background: linear-gradient(90deg, var(--blue), var(--purple));
}

.chart-caption {
  color: var(--muted);
  font-size: 0.72rem;
  margin-top: 1rem;
}

.safety-architecture {
  margin: 0 auto;
  max-width: 820px;
}

.safety-architecture img {
  display: block;
  height: auto;
  width: 100%;
}

.safety-architecture figcaption,
.safety-evaluation figcaption {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.6;
  margin-top: 1rem;
  text-align: center;
}

.safety-architecture figcaption strong,
.safety-evaluation figcaption strong {
  color: var(--ink);
}

.safety-evaluation {
  margin: 3.5rem auto 0;
  max-width: 760px;
}

.safety-evaluation img {
  display: block;
  height: auto;
  width: 100%;
}

.bibtex-title {
  margin-bottom: 1rem !important;
}

.bibtex-block {
  background: #ffffff !important;
  border: 1px solid var(--line);
  border-radius: 0.8rem;
  color: #2f394c !important;
  font-size: 0.86rem;
  overflow-x: auto;
  padding: 1.4rem !important;
  white-space: pre-wrap;
}

.sr-only {
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

@media (max-width: 960px) {
  .system-flow {
    grid-template-columns: 1fr;
  }

  .flow-arrow {
    justify-self: center;
    transform: rotate(90deg);
  }

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

}

@media (max-width: 760px) {
  .project-hero .hero-body {
    padding: 3.4rem 1.1rem 3.1rem;
  }

  .project-mark {
    gap: 0;
    margin-bottom: 1.8rem;
    min-height: 7rem;
  }

  .project-mark__logo {
    height: 7rem;
    width: 7rem;
  }

  .project-mark__word {
    font-size: clamp(2.6rem, 13vw, 4rem);
  }

  .publication-title {
    font-size: clamp(2.4rem, 11vw, 3.35rem) !important;
    line-height: 1.08;
  }

  .publication-title__break {
    display: none;
  }

  .section {
    padding: 4rem 1.1rem;
  }

  .abstract-copy {
    text-align: left;
  }

  .framework-description {
    text-align: left;
  }

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

  .result-figure--centered {
    grid-column: auto;
  }

  .result-figure__media {
    min-height: 0;
  }

  .overview-note,
  .results-panel {
    grid-template-columns: 1fr;
  }

}

@media (max-width: 520px) {
  .adaptation-metrics > div {
    padding: 0.15rem 0.35rem;
  }

  .adaptation-metrics strong {
    font-size: 1.3rem;
  }

  .adaptation-metrics span {
    font-size: 0.78rem;
  }

  .publication-links {
    align-items: stretch;
    flex-direction: column;
  }

  .resource-button.button {
    justify-content: flex-start;
    width: 100%;
  }

  .media-placeholder {
    align-items: center;
    flex-direction: column;
    text-align: center;
  }

  .bar-row {
    grid-template-columns: 1fr auto;
  }

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

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

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