:root {
  --ink: #15171a;
  --muted: #616b78;
  --line: #dfe4ea;
  --paper: #ffffff;
  --wash: #f5f7fa;
  --accent: #1d4ed8;
  --accent-dark: #173ca5;
  --shadow: 0 14px 40px rgba(15, 23, 42, 0.10);
  --radius: 12px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

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

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

a {
  color: inherit;
}

.container {
  width: min(100% - 40px, 1100px);
  margin-inline: auto;
}

.container-wide {
  width: min(100% - 40px, 1180px);
}

.container-text {
  max-width: 920px;
}

.container-figure {
  width: min(100% - 32px, 1320px);
}

.paper-header {
  padding: 72px 0 42px;
  text-align: center;
  background:
    radial-gradient(circle at 50% -30%, rgba(29, 78, 216, 0.09), transparent 48%),
    var(--paper);
}

.header-inner {
  max-width: 1040px;
}

.eyebrow,
.section-kicker {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  line-height: 1.16;
}

h1 {
  max-width: 980px;
  margin-inline: auto;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.25rem, 5vw, 4.2rem);
  font-weight: 700;
  letter-spacing: -0.035em;
}

h2 {
  margin-bottom: 28px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.8rem, 3vw, 2.45rem);
  font-weight: 700;
  text-align: center;
  letter-spacing: -0.02em;
}

.authors {
  margin: 28px 0 0;
  color: var(--accent);
  font-size: 1.12rem;
  font-weight: 650;
}

.affiliation {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 1rem;
}

.resource-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 27px;
}

.resource-button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 9px 18px;
  border: 1px solid #20252c;
  border-radius: 999px;
  color: #fff;
  background: #20252c;
  font-size: 0.94rem;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

a.resource-button:hover,
a.resource-button:focus-visible {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 7px 20px rgba(29, 78, 216, 0.22);
  transform: translateY(-1px);
}

.resource-button.is-disabled {
  color: #515a66;
  background: #eef1f4;
  border-color: #dce1e7;
  cursor: not-allowed;
}

.button-icon {
  font-size: 0.8em;
}

.code-icon {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
}

.coming-soon {
  padding-left: 2px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}

.section {
  padding: 72px 0;
}

.section-first {
  padding-top: 12px;
}

.section-tinted {
  background: var(--wash);
}

.section-heading {
  margin-bottom: 30px;
  text-align: center;
}

.section-heading h2,
.section-heading .section-kicker {
  margin-bottom: 0;
}

.section-heading .section-kicker {
  margin-bottom: 8px;
}

.abstract {
  margin: 0;
  font-size: 1.06rem;
  line-height: 1.82;
  text-align: justify;
  text-wrap: pretty;
}

.media-shell {
  position: relative;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 1px solid #d7dde5;
  border-radius: var(--radius);
  background: #0d1117;
  box-shadow: var(--shadow);
}

.media-shell video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #0d1117;
}

.hero-media {
  border-radius: 14px;
}

.media-error {
  display: none;
  position: absolute;
  inset: 0;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 24px;
  color: #d9e2ef;
  background: linear-gradient(145deg, #101722, #202a38);
  font-size: 0.95rem;
  text-align: center;
}

.media-shell.has-error .media-error {
  display: flex;
}

.framework-figure {
  margin: 0;
}

.framework-figure a {
  display: block;
  border-radius: var(--radius);
  outline-offset: 5px;
}

.framework-figure img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 8px 30px rgba(15, 23, 42, 0.07);
}

.framework-figure figcaption {
  max-width: 1140px;
  margin: 22px auto 0;
  color: #414a56;
  font-size: 0.96rem;
  line-height: 1.65;
  text-align: justify;
}

.media-grid {
  display: grid;
  gap: 28px;
}

.execution-flow {
  display: grid;
  grid-template-columns:
    minmax(170px, 1fr) 34px
    minmax(170px, 1fr) 42px
    minmax(170px, 1fr)
    minmax(170px, 1fr)
    minmax(170px, 1fr);
  gap: 14px;
  align-items: start;
  padding: 4px 2px 14px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.flow-video-card {
  min-width: 170px;
}

.flow-video-card > figcaption {
  min-height: 2.8em;
  font-size: 0.92rem;
  line-height: 1.4;
}

.flow-operator {
  align-self: center;
  margin-bottom: 2.8rem;
  color: var(--accent);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2.15rem;
  font-weight: 700;
  line-height: 1;
  text-align: center;
}

.flow-arrow {
  font-size: 2.4rem;
}

.execution-flow + .media-grid {
  margin-top: 34px;
  padding-top: 34px;
  border-top: 1px solid var(--line);
}

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

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

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

.media-group {
  margin-top: 34px;
}

.video-card {
  min-width: 0;
  margin: 0;
}

.video-card > figcaption {
  margin-top: 12px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.13rem;
  font-weight: 700;
  text-align: center;
}

.video-card-featured {
  width: min(100%, 900px);
  margin-inline: auto;
}

.site-footer {
  padding: 34px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  background: #fff;
  font-size: 0.86rem;
  text-align: center;
}

.site-footer p {
  margin: 0;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

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

  .grid-three .video-card:last-child {
    grid-column: 1 / -1;
    width: calc(50% - 14px);
    justify-self: center;
  }
}

@media (max-width: 680px) {
  .container,
  .container-wide,
  .container-figure {
    width: min(100% - 28px, 1180px);
  }

  .paper-header {
    padding: 48px 0 30px;
  }

  h1 {
    font-size: clamp(2rem, 10vw, 3rem);
    letter-spacing: -0.025em;
  }

  .section {
    padding: 52px 0;
  }

  .section-first {
    padding-top: 8px;
  }

  .grid-two,
  .grid-three {
    grid-template-columns: 1fr;
  }

  .grid-three .video-card:last-child {
    grid-column: auto;
    width: 100%;
  }

  .media-grid {
    gap: 25px;
  }

  .media-group {
    margin-top: 25px;
  }

  .abstract,
  .framework-figure figcaption {
    text-align: left;
  }

  .abstract {
    font-size: 1rem;
    line-height: 1.75;
  }
}

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

  .resource-button {
    transition: none;
  }
}
