:root {
  --ink: #111318;
  --muted: #5f6670;
  --paper: #f7f6f1;
  --surface: #ffffff;
  --line: #d9d9d2;
  --blue: #234dff;
  --green: #22aa47;
  --yellow: #f0b83f;
  --pink: #df4f9a;
  --shadow: 0 20px 55px rgba(17, 19, 24, 0.12);
  --content-max: 1144px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
}

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

a {
  color: inherit;
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  min-height: 64px;
  padding: 0 clamp(18px, 6vw, 88px);
  background: rgba(247, 246, 241, 0.9);
  border-bottom: 1px solid rgba(17, 19, 24, 0.09);
  backdrop-filter: blur(12px);
}

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

.brand {
  font-weight: 800;
  text-decoration: none;
}

nav {
  display: flex;
  gap: clamp(12px, 3vw, 28px);
  color: var(--muted);
  font-size: 0.95rem;
}

nav a,
.site-footer a,
.text-link {
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.hero {
  position: relative;
  min-height: 68vh;
  display: grid;
  align-items: end;
  justify-items: center;
  padding: 92px clamp(18px, 6vw, 88px) 40px;
  overflow: hidden;
  background: #17191c;
}

.hero-media {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(90deg, rgba(10, 11, 13, 0.9), rgba(10, 11, 13, 0.64) 42%, rgba(10, 11, 13, 0.28)),
    url("assets/figures/rplan-comparison.jpg");
  background-size: cover;
  background-position: center;
  filter: saturate(0.85) contrast(1.05);
  transform: scale(1.02);
}

.hero-content {
  position: relative;
  width: 100%;
  max-width: var(--content-max);
  color: #fff;
}

.kicker,
.eyebrow {
  margin: 0 0 12px;
  color: var(--yellow);
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 900px;
  margin: 0;
  font-size: clamp(2rem, 3.8vw, 3.8rem);
  line-height: 1.08;
  font-weight: 800;
}

.title-accent {
  color: #88a6ff;
}

.authors {
  margin: 18px 0 0;
  font-size: clamp(1rem, 1.25vw, 1.16rem);
  font-weight: 700;
}

.affiliation {
  max-width: 700px;
  margin: 8px 0 0;
  color: rgba(255, 255, 255, 0.86);
  font-size: clamp(1.05rem, 1.35vw, 1.25rem);
  font-weight: 750;
}

.dek {
  max-width: 700px;
  margin: 16px 0 0;
  color: rgba(255, 255, 255, 0.86);
  font-size: clamp(0.98rem, 1.2vw, 1.12rem);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 112px;
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 6px;
  color: #fff;
  font-weight: 800;
  text-decoration: none;
  transition: transform 180ms ease, background 180ms ease;
}

.button:hover,
.button:focus-visible {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.14);
}

.button.primary {
  border-color: var(--blue);
  background: var(--blue);
}

section {
  padding: clamp(44px, 6vw, 84px) clamp(18px, 6vw, 88px);
}

.summary-section,
.feature-section,
.citation-section {
  max-width: 1320px;
  margin: 0 auto;
}

.section-heading {
  max-width: 820px;
  margin-bottom: clamp(22px, 3.2vw, 36px);
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(1.45rem, 2.25vw, 2.25rem);
  line-height: 1.14;
  font-weight: 760;
}

.section-intro {
  max-width: 720px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.15vw, 1.12rem);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(24px, 6vw, 80px);
  color: var(--muted);
  font-size: clamp(1rem, 1.15vw, 1.1rem);
}

.summary-grid p {
  margin: 0;
}

.contribution-line {
  max-width: 1320px;
  margin: 0 auto;
  padding-top: 0;
  padding-bottom: clamp(20px, 4vw, 48px);
}

.contribution-line p {
  margin: 0;
  padding: clamp(18px, 3vw, 28px) 0;
  border-top: 3px solid var(--green);
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-size: clamp(1.05rem, 1.7vw, 1.35rem);
  font-weight: 700;
}

.feature-copy p,
.feature-copy li {
  color: var(--muted);
}

.feature-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
}

.feature-layout.reverse {
  grid-template-columns: minmax(280px, 0.78fr) minmax(0, 1.22fr);
}

.feature-layout.reverse figure {
  order: 2;
}

figure {
  margin: 0;
}

figure img {
  width: 100%;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

figcaption {
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.5;
}

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

.feature-copy {
  font-size: clamp(1rem, 1.12vw, 1.08rem);
}

.feature-copy ul {
  margin: 22px 0 0;
  padding-left: 20px;
}

.feature-copy li + li {
  margin-top: 8px;
}

.emergent-box {
  margin-top: 24px;
  padding: 18px 20px;
  border-left: 4px solid var(--blue);
  background: rgba(255, 255, 255, 0.72);
}

.emergent-box h3 {
  margin: 0 0 12px;
  font-size: 1.05rem;
}

.emergent-box ol {
  margin: 0;
  padding-left: 20px;
}

.emergent-box li {
  color: var(--muted);
}

.emergent-box strong {
  color: var(--ink);
}

.alternate {
  border-top: 1px solid var(--line);
}

.compact {
  padding-top: 20px;
}

.math-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) minmax(0, 1.2fr);
  gap: clamp(24px, 5vw, 56px);
  align-items: start;
}

.equation-card,
.table-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: clamp(18px, 3vw, 30px);
  box-shadow: var(--shadow);
}

.label {
  margin: 0 0 12px;
  color: var(--blue);
  font-size: 0.8rem;
  font-weight: 900;
  text-transform: uppercase;
}

.equation {
  overflow-x: auto;
  padding: 16px 0;
  font-family: "Times New Roman", Times, serif;
  font-size: clamp(1.05rem, 1.35vw, 1.25rem);
  line-height: 1.8;
}

.eq-row {
  display: grid;
  grid-template-columns: 54px minmax(260px, 1fr);
  gap: 18px;
  white-space: nowrap;
}

.eq-left {
  color: var(--muted);
  text-align: right;
}

.eq-right {
  color: var(--ink);
}

.equation-card p:last-child,
.table-card p:last-child {
  margin-bottom: 0;
  color: var(--muted);
}

.table-card h3 {
  margin: 0 0 18px;
  font-size: 1.2rem;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  font-size: 0.95rem;
}

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

th {
  background: #f1f0eb;
  color: var(--ink);
  font-size: 0.78rem;
  text-transform: uppercase;
}

td:first-child {
  width: 150px;
  font-weight: 800;
}

.wide-figure img {
  max-height: 720px;
  object-fit: contain;
}

.citation-section {
  padding-top: 56px;
}

pre {
  overflow-x: auto;
  margin: 0;
  padding: clamp(18px, 3vw, 28px);
  background: #111318;
  color: #f7f6f1;
  border-radius: 8px;
  border-left: 8px solid var(--yellow);
  font-size: clamp(0.84rem, 1.4vw, 1rem);
  line-height: 1.5;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 28px clamp(18px, 6vw, 88px);
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.site-footer p {
  margin: 0;
}

.site-footer div {
  display: flex;
  gap: 18px;
}

@media (max-width: 900px) {
  .site-header {
    position: absolute;
  }

  .summary-grid,
  .feature-layout,
  .feature-layout.reverse,
  .math-layout {
    grid-template-columns: 1fr;
  }

  .feature-layout.reverse figure {
    order: initial;
  }

  .hero {
    min-height: 72vh;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 620px) {
  .header-inner {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
    padding: 14px 0;
  }

  nav {
    width: 100%;
    justify-content: space-between;
  }

  .hero {
    padding-top: 140px;
  }

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

  .button {
    min-width: 0;
    padding-inline: 10px;
  }
}
