:root {
  --primary-color: #2563eb;
  --primary-hover: #1d4ed8;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --background-primary: #ffffff;
  --background-secondary: #f8fafc;
  --border-color: #e2e8f0;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --border-radius: 0.75rem;
  --border-radius-lg: 1rem;
  --section-space: clamp(4rem, 8vw, 6rem);
  --transition: 0.2s ease;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: sans-serif;
  color: var(--text-primary);
  line-height: 1.6;
  font-size: 16px;
  background: var(--background-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img { display: block; max-width: 100%; }
a { color: inherit; }
.wrap { width: min(1120px, calc(100% - 40px)); margin-inline: auto; }
.narrow { width: min(850px, calc(100% - 40px)); }

/* Hero */
.hero {
  position: relative;
  overflow: hidden;
  padding: 5.5rem 0 4rem;
  text-align: center;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border-bottom: 1px solid var(--border-color);
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top center, rgba(37, 99, 235, 0.08), transparent 42%);
  pointer-events: none;
}

.hero > .wrap { position: relative; z-index: 1; }

.eyebrow {
  display: block;
  margin-bottom: 0.75rem;
  color: var(--primary-color);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1, h2, h3 {
  margin: 0;
  color: var(--text-primary);
  line-height: 1.15;
}

h1 {
  max-width: 20ch;
  margin-inline: auto;
  font-size: clamp(3rem, 7vw, 5rem);
  white-space: nowrap;
  font-weight: 800;
  letter-spacing: -0.05em;
}

h2 {
  font-size: clamp(1.75rem, 3vw, 2.4rem);
  font-weight: 750;
  letter-spacing: -0.03em;
}

h3 {
  font-size: 1.2rem;
  font-weight: 700;
}

.subtitle {
  max-width: 46rem;
  margin: 1.2rem auto 1.5rem;
  color: var(--text-secondary);
  font-size: 1.05rem;
  line-height: 1.65;
}

.authors {
  display: flex;
  justify-content: center;
  gap: 1.75rem;
  margin: 0;
  font-weight: 600;
  color: var(--text-primary);
}

.affiliation {
  margin: 0.35rem 0 1.6rem;
  color: var(--text-secondary);
}

/* Buttons */
.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.8rem 1.05rem;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--background-primary);
  color: var(--text-primary);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 700;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.button:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-color);
}

.button.primary {
  background: var(--primary-color);
  color: white;
  box-shadow: var(--shadow-md);
}

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

.button-icon {
  display: inline-grid;
  place-items: center;
  width: 1.1rem;
  height: 1.1rem;
  flex: 0 0 1.1rem;
}

.button-icon svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

/* Layout sections */
.abstract p { margin: 0; }
.standfirst {
  margin: 1.4rem 0 0.75rem;
  color: var(--text-primary);
  font-size: 1.15rem;
  line-height: 1.65;
}

.abstract p,
.section-heading p,
.gain-card p,
.repo-grid span,
figcaption {
  color: var(--text-secondary);
}

.band,
.content-section { padding: var(--section-space) 0; }

.band {
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

main section:nth-of-type(odd) {
  background: var(--background-primary);
}

main section:nth-of-type(even) {
  background: var(--background-secondary);
}

.section-heading {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  align-items: end;
  gap: 2rem;
  margin-bottom: 2rem;
}

.section-heading p {
  margin: 0;
  line-height: 1.7;
}

.notice {
  color: #92400e;
}

/* Cards and figures */
.repo-grid a,
.gain-card {
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  background: var(--background-primary);
  box-shadow: var(--shadow-md);
}

.paper-figure {
  max-width: 60rem;
  margin-inline: auto;
}

.paper-figure figcaption {
  margin-top: 0.6rem;
  padding: 0;
  font-style: italic;
  font-size: 0.84rem;
  font-weight: 400;
}

figure {
  margin: 0;
  overflow: hidden;
}

figure img {
  width: 100%;
  height: auto;
}

figcaption {
  margin-top: 0.45rem;
  padding: 0;
  font-size: 0.84rem;
  font-style: italic;
  font-weight: 400;
}

/* Robot and experiment demos */
.robot-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.9rem;
}

.robot-grid figure {
  align-self: start;
}

.robot-grid figcaption {
  text-align: center;
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(12rem, 1fr));
  align-items: start;
  gap: 0.9rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
}

.video-card {
  overflow: hidden;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  background: var(--background-primary);
  box-shadow: var(--shadow-md);
}

.demo-media {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  background: var(--background-secondary);
  object-fit: contain;
}

.video-copy {
  padding: 1rem;
}

.video-copy p {
  margin: 0.55rem 0 0;
  color: var(--text-secondary);
  font-size: 0.86rem;
}

/* Stiffness controls */
.stiffness-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(21rem, 0.8fr);
  align-items: start;
  gap: 1.25rem;
}

.gain-card {
  position: relative;
  padding: 1.55rem;
  overflow: hidden;
}

.card-label {
  display: inline-block;
  margin-bottom: 0.6rem;
  color: var(--primary-color);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.gain-card h3 { margin-bottom: 1rem; font-size: 1.35rem; }

.phase-list {
  display: grid;
  gap: 0.25rem;
  margin-top: 1.15rem;
}

.phase {
  padding: 0.9rem 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.22);
}

.phase:last-child {
  border-bottom: 0;
}

.phase strong {
  display: block;
  color: var(--text-primary);
  font-size: 1rem;
  line-height: 1.3;
}

.phase p {
  margin: 0.3rem 0 0;
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.55;
}

.compliance-figure {
  max-width: 27rem;
  margin: 0.3rem auto 0;
}

.compliance-figure figcaption {
  margin-top: 0.6rem;
  padding: 0;
  font-size: 0.78rem;
  font-style: italic;
  font-weight: 400;
}

.equation {
  overflow-x: auto;
  margin: 0.95rem 0 1rem;
  padding: 0.9rem 1rem;
  border-radius: var(--border-radius);
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(255, 255, 255, 0.72);
  color: var(--text-primary);
  font-size: 1.05rem;
  font-weight: 700;
  text-align: center;
}

.repo-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.9rem;
}

.repo-grid a {
  display: flex;
  flex-direction: column;
  padding: 1.1rem;
  text-decoration: none;
  transition: var(--transition);
}

.repo-grid a:hover {
  border-color: var(--primary-color);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.repo-grid strong {
  color: var(--text-primary);
  font-size: 0.98rem;
  overflow-wrap: anywhere;
}

.repo-grid span {
  margin-top: 0.35rem;
  font-size: 0.9rem;
}

footer {
  padding: 2rem 0 2.5rem;
  color: var(--text-secondary);
  font-size: 0.84rem;
  text-align: center;
  border-top: 1px solid var(--border-color);
  background: var(--background-secondary);
}

/* Responsive */
@media screen and (max-width: 1024px) {
  .section-heading {
    grid-template-columns: 1fr;
  }

}

@media screen and (max-width: 768px) {
  .hero {
    padding: 4rem 0 3rem;
  }

  .wrap, .narrow { width: min(100% - 2rem, 1120px); }

  .robot-grid,
  .repo-grid,
  .stiffness-grid {
    grid-template-columns: 1fr;
  }

  .authors {
    flex-direction: column;
    gap: 0.15rem;
  }

  .button {
    width: 100%;
  }

  .actions { gap: 0.55rem; }

}

@media screen and (max-width: 480px) {
  h1 { letter-spacing: -0.04em; }
  .subtitle { font-size: 1rem; }
  .gain-card,
  .repo-grid a { padding: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}
