body {
  font-family: 'Google Sans', 'Noto Sans', sans-serif;
}

h1.title.publication-title {
  font-family: 'Inter', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-weight: 700;
  color: #8C1515;
  font-size: 2.6rem;
  line-height: 1.2;
  letter-spacing: -0.021em;
}

/* widen the title block so the title sets in two lines at the template's own
   2.6rem. At 1100px the last word falls alone onto a third line. */
.hero .container.is-max-desktop {
  max-width: 1150px;
}

/* below the widened container, scale the title down so it does not gain a
   fourth line */
@media screen and (max-width: 1200px) {
  h1.title.publication-title {
    font-size: 2.3rem;
  }
}

/* one more step so laptops around 1024px keep the title at two lines */
@media screen and (max-width: 1080px) {
  h1.title.publication-title {
    font-size: 2.05rem;
  }
}

@media screen and (max-width: 768px) {
  h1.title.publication-title {
    font-size: 1.8rem;
  }

}

/* ==================================================================
   content sections
   ================================================================== */
.section-alt {
  background-color: #fafafa;
  border-top: 1px solid #ededed;
  border-bottom: 1px solid #ededed;
}

.title.is-3.section-title {
  text-align: center;
  color: #8C1515;
  font-family: 'Google Sans', 'Noto Sans', sans-serif;
  margin-bottom: 1.4rem;
}

.section-lead {
  text-align: center;
  color: #6b6b6b;
  margin-top: -0.7rem;
  margin-bottom: 1.8rem;
}

.abstract-body {
  font-size: 1.05rem;
  line-height: 1.75;
  color: #2c2c2c;
}

.teaser-section {
  padding-bottom: 2.5rem;
}

/* ==================================================================
   figures
   ================================================================== */
.pub-figure {
  margin: 0 auto 3.2rem auto;
  max-width: 1000px;
}

.pub-figure:last-child {
  margin-bottom: 0;
}

.pub-figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 6px;
}

.pub-figure figcaption {
  margin-top: 1.0rem;
  font-size: 0.93rem;
  line-height: 1.6;
  color: #5a5a5a;
  text-align: justify;
}

/* ==================================================================
   video
   ================================================================== */
.video-wrap {
  max-width: 900px;
  margin: 0 auto;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.12);
  background: #000;
}

.video-wrap video {
  display: block;
  width: 100%;
  height: auto;
}

@media screen and (max-width: 900px) {
}

@media screen and (max-width: 768px) {

  .pub-figure figcaption { text-align: left; }
}

/* ==================================================================
   paper tables, presented as a side-by-side pair of cards
   ================================================================== */
.table-pair {
  display: grid;
  grid-template-columns: 1.06fr 1fr;
  gap: 1.9rem;
  align-items: start;
}

.pub-table {
  margin: 0;
  min-width: 0;
}

.table-card {
  background: #ffffff;
  border: 1px solid #ececec;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.05);
  overflow: hidden;
}

.table-card-head {
  padding: 1.15rem 1.3rem 1.0rem 1.3rem;
  border-bottom: 1px solid #f0f0f0;
}

.table-card-head h3 {
  font-family: 'Google Sans', 'Noto Sans', sans-serif;
  font-size: 1.12rem;
  font-weight: 600;
  color: #242424;
  line-height: 1.25;
  margin: 0;
}

.table-card-head p {
  font-size: 0.85rem;
  color: #8a8a8a;
  margin: 0.2em 0 0 0;
}

.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table.paper-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  font-variant-numeric: tabular-nums;
  color: #333;
  background: transparent;
}

table.paper-table th,
table.paper-table td {
  padding: 0.5em 0.55em;
  text-align: center;
  white-space: nowrap;
  border: none;
}

/* leading column carries the method names */
table.paper-table th.col-method,
table.paper-table td.col-method {
  text-align: left;
  white-space: normal;
  padding-left: 1.3rem;
  padding-right: 0.9rem;
  color: #242424;
}

table.paper-table td.indent {
  padding-left: 2.3rem;
  font-size: 0.83rem;
}

/* a touch of air where two metric groups meet, instead of a rule */
table.paper-table .gap-left { padding-left: 1.25em; }

table.paper-table tbody td:last-child,
table.paper-table thead th:last-child { padding-right: 1.3rem; }

/* --- header --- */
table.paper-table thead th {
  background: #fbfafa;
  font-weight: 600;
  color: #5f5f5f;
  font-size: 0.86rem;
  letter-spacing: 0.035em;
  text-transform: uppercase;
  vertical-align: bottom;
  padding-top: 0.62em;
  padding-bottom: 0.62em;
}

table.paper-table tr.group-row th.group {
  color: #8C1515;
  font-size: 0.8rem;
  padding-bottom: 0.3em;
}

table.paper-table tr.group-row th.group + th.group { border-left: 1px solid #efefef; }

table.paper-table tr.metric-row th { border-bottom: 1px solid #e6e6e6; }
table.paper-table tr.group-row th { border-bottom: 1px solid #f2f2f2; }

/* the little direction arrow next to each metric */
.dir {
  margin-left: 0.25em;
  font-size: 0.88em;
  font-weight: 700;
}
.dir.up   { color: #2e8b6f; }
.dir.down { color: #b07d3a; }

/* --- body --- */
table.paper-table tbody tr + tr td { border-top: 1px solid #f4f4f4; }

table.paper-table tbody tr:hover td { background-color: #fcfbfb; }

table.paper-table tr.ablation td.col-method { color: #6f6f6f; }

/* the best value in a column */
table.paper-table td.best { font-weight: 700; color: #1f1f1f; }

/* --- our row --- */
table.paper-table tr.ours td {
  background: rgba(140, 21, 21, 0.055);
  border-top: 1px solid rgba(140, 21, 21, 0.18);
  font-weight: 700;
  color: #7a1212;
  padding-top: 0.62em;
  padding-bottom: 0.62em;
}

table.paper-table tr.ours td.col-method {
  color: #8C1515;
  box-shadow: inset 3px 0 0 #8C1515;
}

table.paper-table tr.ours:hover td { background: rgba(140, 21, 21, 0.075); }

.variant {
  display: inline-block;
  white-space: nowrap;
  font-size: 0.72em;
  color: #7a7a7a;
  background: #f4f4f4;
  border-radius: 4px;
  padding: 0.1em 0.42em;
  margin-left: 0.25em;
  font-variant-numeric: normal;
}

.pub-table figcaption {
  margin-top: 0.95rem;
  font-size: 0.87rem;
  line-height: 1.6;
  color: #5f5f5f;
  text-align: left;
}

@media screen and (max-width: 1080px) {
  .table-pair { grid-template-columns: 1fr; gap: 2.6rem; }
}

@media screen and (max-width: 768px) {
  table.paper-table { font-size: 0.8rem; }
  table.paper-table th, table.paper-table td { padding: 0.42em 0.4em; }
  table.paper-table th.col-method, table.paper-table td.col-method { padding-left: 0.9rem; }
  table.paper-table td.indent { padding-left: 1.6rem; }
}

/* ==================================================================
   subsections, the wide replay table and paired figures
   ================================================================== */
.subsection-title {
  font-family: 'Google Sans', 'Noto Sans', sans-serif;
  font-size: 1.28rem;
  font-weight: 600;
  color: #242424;
  text-align: left;
  margin: 0 0 1.25rem 0;
}

.subsection-title + .pub-table,
.subsection-title + .pub-figure {
  margin-top: 0;
}

/* the replay table spans the full container rather than the card width */
.pub-table.is-wide {
  max-width: none;
  margin-bottom: 3.2rem;
}

.pub-table.is-wide figcaption {
  max-width: 960px;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

table.replay-table { font-size: 0.82rem; }

table.replay-table th,
table.replay-table td {
  padding-left: 0.18em;
  padding-right: 0.18em;
}

/* the task names are the widest part of the header, so let them stack to two
   lines instead of forcing the table wider than the page */
table.replay-table thead th {
  white-space: normal;
  letter-spacing: 0.01em;
  font-size: 0.75rem;
  line-height: 1.2;
}

table.replay-table th.col-method,
table.replay-table td.col-method {
  min-width: 118px;
  padding-left: 1.0rem;
  padding-right: 0.6rem;
}

table.replay-table .total {
  border-left: 1px solid #efefef;
  padding-left: 0.9em;
  font-variant-numeric: tabular-nums;
}

table.replay-table thead th.total { color: #5f5f5f; }

.mark {
  font-size: 1.02rem;
  line-height: 1;
}
.mark.yes { color: #2e8b6f; }
.mark.no  { color: #d3d3d3; }

table.replay-table tr.ours .mark.yes { color: #8C1515; }

/* ==================================================================
   animated, interactive success-rate chart
   ================================================================== */
.chart-wrap {
  position: relative;
  background: #fff;
  border: 1px solid #ececec;
  border-radius: 12px;
  padding: 0.9rem 1rem 0.5rem 1rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.05);
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem 1rem;
  margin-bottom: 0.8rem;
}

.chart-legend .lg {
  display: inline-flex;
  align-items: center;
  font-size: 1.16rem;
  color: #3f3f3f;
  white-space: nowrap;
  background: none;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.15em 0.55em;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.chart-legend .lg:hover     { background: #f5f5f5; }
.chart-legend .lg.is-pinned { border-color: #d8d8d8; background: #f2f0f0; color: #242424; }
.chart-legend .lg.is-ours   { color: #2c2c2c; font-weight: 700; }

.chart-legend .lg i {
  width: 15px; height: 15px; border-radius: 3.5px;
  margin-right: 0.45em; display: inline-block;
}

svg.bar-chart { display: block; width: 100%; height: auto; }

svg.bar-chart .grid     { stroke: #eeeeee; stroke-width: 1; }
svg.bar-chart .axis     { stroke: #c4c4c4; stroke-width: 1; }
svg.bar-chart .avg-band { fill: #f7f6f6; }
svg.bar-chart .ghit     { fill: transparent; pointer-events: none; }

svg.bar-chart .ytick,
svg.bar-chart .ylabel,
svg.bar-chart .xlabel,
svg.bar-chart .vlabel {
  font-family: 'Google Sans', 'Noto Sans', sans-serif;
}
svg.bar-chart .ytick  { font-size: 15.5px; fill: #7d7d7d; text-anchor: end; }
svg.bar-chart .ylabel { font-size: 17px; fill: #5f5f5f; text-anchor: middle; }
svg.bar-chart .xlabel { font-size: 16.5px; fill: #4a4a4a; text-anchor: end; }
svg.bar-chart .xlabel.avg { font-weight: 700; fill: #2c2c2c; }
svg.bar-chart .vlabel { font-size: 16.5px; font-weight: 700; fill: #3a2f7d; text-anchor: middle; }

/* Resting state is the FINISHED chart. Collapsed only applies while JS is live
   and the chart has not been revealed, so no failure path leaves it empty. */
svg.bar-chart .bar {
  transform: scaleY(1);
  transform-box: fill-box;
  transform-origin: bottom;
  cursor: pointer;
  outline: none;
  transition: opacity 0.18s ease, filter 0.18s ease;
}

.chart-wrap.armed:not(.in-view) svg.bar-chart .bar    { transform: scaleY(0); }
.chart-wrap.armed:not(.in-view) svg.bar-chart .vlabel { opacity: 0; }

.chart-wrap.armed.in-view svg.bar-chart .bar    { animation: barRise 0.72s cubic-bezier(0.22, 1, 0.36, 1) both; }
.chart-wrap.armed.in-view svg.bar-chart .vlabel { animation: labelFade 0.45s ease-out both; }

@keyframes barRise   { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes labelFade { from { opacity: 0; } to { opacity: 1; } }

/* isolating a series dims the rest */
.chart-wrap[data-focus] svg.bar-chart .bar { opacity: 0.22; }
.chart-wrap[data-focus="0"] svg.bar-chart .bar.s0,
.chart-wrap[data-focus="1"] svg.bar-chart .bar.s1,
.chart-wrap[data-focus="2"] svg.bar-chart .bar.s2,
.chart-wrap[data-focus="3"] svg.bar-chart .bar.s3,
.chart-wrap[data-focus="4"] svg.bar-chart .bar.s4,
.chart-wrap[data-focus="5"] svg.bar-chart .bar.s5,
.chart-wrap[data-focus="6"] svg.bar-chart .bar.s6 { opacity: 1; filter: brightness(1.06); }

.chart-wrap[data-focus] svg.bar-chart .vlabel { opacity: 0.25; }
.chart-wrap[data-focus="6"] svg.bar-chart .vlabel { opacity: 1; }

svg.bar-chart .bar:focus-visible { stroke: #242424; stroke-width: 1.5; }

/* tooltip */
.chart-tip {
  position: absolute;
  transform: translate(-50%, -100%);
  background: #262626;
  color: #fff;
  border-radius: 7px;
  padding: 0.42em 0.62em;
  font-size: 0.78rem;
  line-height: 1.32;
  pointer-events: none;
  white-space: nowrap;
  z-index: 5;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22);
}
.chart-tip[hidden] { display: none; }
.chart-tip b  { display: block; font-weight: 700; }
.chart-tip span { display: block; color: #bdbdbd; font-size: 0.93em; }
.chart-tip em { font-style: normal; font-weight: 700; color: #ffd9d9; }
.chart-tip::after {
  content: ""; position: absolute; left: 50%; top: 100%;
  transform: translateX(-50%);
  border: 5px solid transparent; border-top-color: #262626;
}

@media (prefers-reduced-motion: reduce) {
  .chart-wrap.armed:not(.in-view) svg.bar-chart .bar    { transform: scaleY(1); }
  .chart-wrap.armed:not(.in-view) svg.bar-chart .vlabel { opacity: 1; }
  .chart-wrap.armed.in-view svg.bar-chart .bar,
  .chart-wrap.armed.in-view svg.bar-chart .vlabel { animation: none; }
}

@media screen and (max-width: 900px) {
  .chart-legend { gap: 0.25rem 0.5rem; }
  .chart-legend .lg { font-size: 0.95rem; padding: 0.12em 0.4em; }
}

/* ==================================================================
   the tool-library figure, split into plot + legend across one wide row
   ================================================================== */
.split-figure { max-width: none; }

.split-figure-row {
  display: grid;
  grid-template-columns: 1.22fr 1fr;
  gap: 1.8rem;
  align-items: center;
}

.split-figure-row img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 4px;
}

/* the caption sits centred beneath the pair rather than under either panel */
.split-figure > figcaption {
  max-width: 900px;
  margin: 1.2rem auto 0 auto;
  text-align: center;
}

@media screen and (max-width: 900px) {
  .split-figure-row { grid-template-columns: 1fr; gap: 1.2rem; }
  .split-figure > figcaption { text-align: left; }
}

/* ==================================================================
   the tool-library breakdown (paper Fig. 8), sits above the cost plot
   ================================================================== */
.library-figure { max-width: none; margin-bottom: 3.6rem; }

.library-figure picture { display: block; }

.library-figure img {
  display: block;
  width: 100%;
  max-width: 1280px;
  height: auto;
  margin: 0 auto;
  border-radius: 4px;
}

/* the caption is centred beneath, matching the cost plot below it */
.library-figure > figcaption {
  max-width: 900px;
  margin: 1.2rem auto 0 auto;
  text-align: center;
}

/* below this width the <picture> swaps in the stacked two-panel crop, which is
   far taller than it is wide, so it must not be capped at the wide image's size */
@media screen and (max-width: 860px) {
  .library-figure img { max-width: 560px; }
  .library-figure > figcaption { text-align: left; }
}

/* the success-rate chart now owns its whole row */
.pub-figure.is-full {
  max-width: none;
  margin-left: 0;
  margin-right: 0;
}

/* the chart reads better a bit wider than the container's own cap */
@media screen and (min-width: 1300px) {
  .pub-figure.is-full .chart-wrap {
    width: calc(100% + 120px);
    margin-left: -60px;
  }
}

.pub-figure.is-full > figcaption {
  max-width: 940px;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.pub-figure.is-full .chart-wrap { padding: 1.1rem 1.3rem 0.7rem 1.3rem; }

/* ==================================================================
   task reels: a dial of task names turning one video stage
   ================================================================== */
.subsection-title.reel-second { margin-top: 4.2rem; }

.reel { outline: none; margin-bottom: 1rem; }

/* --- stage --- */
.reel-stage {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  border-radius: 16px;
  background: #0e0e10;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.10), 0 22px 48px rgba(0, 0, 0, 0.16);
  overflow: hidden;
  perspective: 1400px;
  touch-action: pan-y;
}

.reel-frame {
  position: relative;
  aspect-ratio: 4 / 3;
  transform-style: preserve-3d;
}

.reel-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #0e0e10;
  opacity: 0;
  transform: rotateY(14deg) scale(0.9);
  pointer-events: none;
  transition: opacity 0.5s ease, transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.reel-video.is-active {
  opacity: 1;
  transform: none;
  pointer-events: auto;
  z-index: 2;
}

/* the outgoing clip turns away in the direction of travel */
.reel-video.exit-left  { opacity: 0; transform: rotateY(-16deg) scale(0.9) translateX(-6%); z-index: 1; }
.reel-video.exit-right { opacity: 0; transform: rotateY( 16deg) scale(0.9) translateX( 6%); z-index: 1; }

/* --- stage furniture --- */
.reel-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 4;
  width: 42px; height: 42px;
  border: none;
  border-radius: 50%;
  background: rgba(20, 20, 22, 0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: #fff;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.22s ease, background 0.22s ease;
  display: flex; align-items: center; justify-content: center;
  padding-bottom: 3px;
}
.reel-nav.is-prev { left: 14px; }
.reel-nav.is-next { right: 14px; }
.reel-stage:hover .reel-nav,
.reel:focus-within .reel-nav { opacity: 1; }
.reel-nav:hover { background: rgba(140, 21, 21, 0.85); }

.reel-progress {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.14);
  z-index: 4;
}
.reel-progress i {
  display: block; height: 100%; width: 0;
  background: #8C1515;
}

.reel-title {
  text-align: center;
  font-size: 1.12rem;
  font-weight: 600;
  color: #242424;
  margin: 1.1rem 0 0.1rem 0;
  letter-spacing: -0.005em;
}

/* --- the dial --- */
.reel-dial {
  position: relative;
  overflow: hidden;
  padding: 1.5rem 0 0.9rem 0;
  /* the rim fades out at both ends rather than being cut off */
  -webkit-mask-image: linear-gradient(to right, transparent, #000 13%, #000 87%, transparent);
          mask-image: linear-gradient(to right, transparent, #000 13%, #000 87%, transparent);
}

/* the marker showing which slot is live */
.reel-dial::before {
  content: "";
  position: absolute;
  top: 0.35rem; left: 50%;
  transform: translateX(-50%);
  width: 9px; height: 9px;
  border-radius: 50%;
  background: #8C1515;
  z-index: 3;
}

.reel-track {
  display: flex;
  align-items: flex-start;
  gap: 0.35rem;
  width: max-content;
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
  transform-origin: center top;
}

.reel-item {
  flex: 0 0 auto;
  border: 1px solid transparent;
  background: none;
  font-family: inherit;
  font-size: 0.95rem;
  color: #8e8e8e;
  white-space: nowrap;
  padding: 0.42em 0.95em;
  border-radius: 999px;
  cursor: pointer;
  transform-origin: center top;
  transition: color 0.3s ease, background 0.3s ease, border-color 0.3s ease,
              transform 0.55s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.45s ease;
}

.reel-item:hover { color: #4a4a4a; }

.reel-item.is-active {
  color: #8C1515;
  font-weight: 700;
  background: rgba(140, 21, 21, 0.07);
  border-color: rgba(140, 21, 21, 0.2);
}

@media screen and (max-width: 768px) {
  .reel-stage { border-radius: 12px; }
  .reel-nav { opacity: 1; width: 36px; height: 36px; font-size: 1.25rem; }
  .reel-item { font-size: 0.86rem; padding: 0.36em 0.75em; }
  .reel-title { font-size: 1rem; }
  .reel-dial { padding-top: 1.3rem; }
}

@media (prefers-reduced-motion: reduce) {
  .reel-video, .reel-track, .reel-item { transition: none; }
}

/* playback-speed qualifier beside a reel heading */
.speed-tag {
  display: inline-block;
  margin-left: 0.4em;
  font-size: 0.72em;
  font-weight: 600;
  color: #8C1515;
  background: rgba(140, 21, 21, 0.08);
  border-radius: 999px;
  padding: 0.16em 0.62em;
  vertical-align: 0.12em;
  letter-spacing: 0.01em;
}

/* --- the human demonstration window sits beside the stage --- */
.reel-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(1rem, 3.4vw, 3.25rem);
  /* widened so the extra gap comes out of the margins, not out of the stage */
  max-width: 1100px;
  margin: 0 auto;
}

/* the human window shrinks with the viewport rather than wrapping under the
   stage, so the two stay side by side on anything wider than a phone */
.reel-human {
  flex: 0 0 clamp(104px, 23%, 236px);
  width: clamp(104px, 23%, 236px);
}

.reel-human-label {
  font-size: clamp(0.6rem, 1.1vw, 0.78rem);
  font-weight: 600;
  letter-spacing: 0.055em;
  text-transform: uppercase;
  color: #8a8a8a;
  margin: 0 0 0.45rem 0;
  text-align: center;
}

.reel-human-frame {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: 10px;
  overflow: hidden;
  background: #0e0e10;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 10px 24px rgba(0, 0, 0, 0.12);
}

/* no turn here: the small window cuts straight to the new task */
.reel-hvideo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.22s ease;
}
.reel-hvideo.is-active { opacity: 1; }

.reel-stage { max-width: 760px; }

/* only a genuine phone gets the stacked fallback */
@media screen and (max-width: 560px) {
  .reel-row { flex-direction: column-reverse; align-items: center; gap: 1rem; }
  .reel-human { flex: 0 0 auto; width: min(100%, 260px); }
  .reel-stage { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .reel-hvideo { transition: none; }
}

/* ==================================================================
   cinematic hero: rollout clips run behind the title, one after another
   ================================================================== */
.cinema {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #0b0b0d;
  padding: 4.5rem 1.5rem 4.5rem 1.5rem;
  text-align: center;
}

.cine-bg { position: absolute; inset: 0; }

.cine-clip {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.06);
  transition: opacity 0.6s ease;
  will-change: opacity;
}
.cine-clip.is-active { opacity: 1; }

/* darken the footage so white type stays legible over any frame */
.cine-scrim {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(115% 75% at 50% 45%, rgba(8, 8, 10, 0.20) 0%, rgba(8, 8, 10, 0.46) 58%, rgba(8, 8, 10, 0.70) 100%),
    linear-gradient(to bottom, rgba(8, 8, 10, 0.55) 0%, rgba(8, 8, 10, 0.16) 26%, rgba(8, 8, 10, 0.26) 66%, rgba(8, 8, 10, 0.80) 100%);
}

/* a whisper of grain so the gradient does not band */
.cine-grain {
  position: absolute;
  inset: 0;
  opacity: 0.16;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/></filter><rect width='120' height='120' filter='url(%23n)' opacity='0.5'/></svg>");
}

.cine-inner { position: relative; z-index: 3; max-width: 1080px; }

.cine-title {
  font-family: 'Inter', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-weight: 800;
  font-size: clamp(3rem, 7.6vw, 6rem);
  line-height: 1.0;
  letter-spacing: -0.042em;
  color: #fff;
  margin: 0 auto;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.55), 0 1px 60px rgba(0, 0, 0, 0.45);
}

/* The anonymous page carries a single Code button as a placeholder, not a link.
   It is a <span>, so it has no href and cannot be clicked or focused; there is
   deliberately no :hover rule so it never reads as interactive either.
   .cine-buttons is a centring flex row, so the lone button sits centred. */
.cine-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.7rem;
  margin-top: 1.8rem;
}

.cine-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55em;
  padding: 0.68em 1.3em;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px) saturate(140%);
  -webkit-backdrop-filter: blur(10px) saturate(140%);
  color: #fff;
  font-size: clamp(0.88rem, 1.15vw, 1rem);
  font-weight: 600;
  letter-spacing: 0.005em;
  text-decoration: none;
}
.cine-btn i  { font-size: 0.95em; opacity: 0.95; }
.cine-btn em { font-style: normal; font-weight: 500; opacity: 0.66; }

.cine-btn.is-static { cursor: default; pointer-events: none; }

/* --- which clip is on --- */
.cine-ticks {
  position: absolute;
  bottom: 2.1rem;
  left: 2.2rem;
  z-index: 3;
  display: flex;
  gap: 5px;
}
.cine-ticks i {
  display: block;
  width: 16px;
  height: 2px;
  background: rgba(255, 255, 255, 0.24);
  transition: background 0.35s ease;
}
.cine-ticks i.is-on { background: rgba(255, 255, 255, 0.9); }

/* --- scroll cue --- */
.cine-scroll {
  position: absolute;
  bottom: 1.9rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}
.cine-scroll-word {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.64rem;
  letter-spacing: 0.34em;
  text-indent: 0.34em;
  color: rgba(255, 255, 255, 0.62);
  transition: color 0.25s ease;
}
.cine-scroll-rail {
  position: relative;
  display: block;
  width: 1px;
  height: 52px;
  background: rgba(255, 255, 255, 0.2);
  overflow: hidden;
}
.cine-scroll-rail i {
  position: absolute;
  left: 0;
  top: -60%;
  width: 1px;
  height: 60%;
  background: linear-gradient(to bottom, transparent, #fff);
  animation: cineRail 1.9s cubic-bezier(0.6, 0, 0.35, 1) infinite;
}
.cine-scroll:hover .cine-scroll-word { color: #fff; }

@keyframes cineRail {
  0%   { top: -60%; }
  70%  { top: 100%; }
  100% { top: 100%; }
}

@media screen and (max-width: 768px) {
  .cinema { padding: 4.5rem 1.2rem 5.5rem 1.2rem; }
  .cine-br { display: none; }

  .cine-ticks { left: 50%; transform: translateX(-50%); bottom: 0.7rem; }
}

@media (prefers-reduced-motion: reduce) {
  .cine-clip { transition: none; }
  .cine-scroll-rail i { animation: none; top: 20%; }
}

/* --- wordmark: Inter for Dex, JetBrains Mono for the typed-out Agent --- */
.cine-dex { font-family: 'Inter', 'Helvetica Neue', Helvetica, Arial, sans-serif; }

.cine-agent {
  position: relative;
  display: inline-block;
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 700;
  /* the mono face runs wider and taller, so pull it back to match Inter's cap */
  font-size: 0.86em;
  letter-spacing: -0.02em;
  margin-left: 0.055em;
  vertical-align: baseline;
}

/* reserves the finished width up front so the centred title never reflows */
.cine-ghost { visibility: hidden; }

.cine-live {
  position: absolute;
  left: 0;
  top: 0;
  white-space: pre;
  display: inline-flex;
  align-items: baseline;
}

/* keeps the real word for screen readers and for anyone with JS off */
.cine-sr {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.cine-caret {
  display: inline-block;
  width: 0.07em;
  min-width: 2px;
  height: 0.82em;
  margin-left: 0.06em;
  background: #fff;
  transform: translateY(0.02em);
  opacity: 0;
}

/* blinks before the word starts, steadies while typing, fades once done */
.cine-agent.is-waiting .cine-caret { opacity: 1; animation: caretBlink 1.05s steps(1, end) infinite; }
.cine-agent.is-typing  .cine-caret { opacity: 1; animation: caretSoft 1s steps(1, end) infinite; }
.cine-agent.is-done   .cine-caret { animation: caretOut 1.1s ease forwards; }
.cine-agent.is-caret-gone .cine-caret { display: none; }

@keyframes caretBlink { 0%, 50% { opacity: 1; } 51%, 100% { opacity: 0; } }
@keyframes caretSoft  { 0%, 60% { opacity: 1; } 61%, 100% { opacity: 0.25; } }
@keyframes caretOut {
  0%, 25%   { opacity: 1; }
  26%, 55%  { opacity: 0; }
  56%, 80%  { opacity: 1; }
  81%, 100% { opacity: 0; visibility: hidden; }
}

@media (prefers-reduced-motion: reduce) {
  .cine-caret { display: none; }
}

/* the rest of the title arrives once the wordmark has typed itself */
.cine-sub {
  font-family: 'Inter', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-weight: 600;
  font-size: clamp(1.25rem, 2.6vw, 2.1rem);
  line-height: 1.24;
  letter-spacing: -0.018em;
  color: #fff;
  text-align: center;
  max-width: 46ch;
  margin: 3.0rem auto 0 auto;
  text-shadow: 0 1px 14px rgba(0, 0, 0, 0.6), 0 1px 40px rgba(0, 0, 0, 0.45);
  opacity: 1;
  transition: opacity 0.75s ease;
}
/* only a live script hides it, and only until the wordmark finishes typing */
.cine-js .cine-sub:not(.is-in) { opacity: 0; }

/* The wordmark ships complete so it survives a JS failure. With a live script
   the typed half is hidden until typing actually begins; the ghost still
   reserves its width, so "Dex" simply sits alone. */
.cine-js .cine-agent .cine-live { visibility: hidden; }
.cine-js .cine-agent.is-waiting .cine-live,
.cine-js .cine-agent.is-typing  .cine-live,
.cine-js .cine-agent.is-done    .cine-live { visibility: visible; }

@media (prefers-reduced-motion: reduce) {
  .cine-sub { transition: none; }
}

@media screen and (max-height: 880px) {
  .cinema { padding: 3.2rem 1.5rem 3.2rem 1.5rem; }
  .cine-title { font-size: clamp(2.6rem, 6.4vw, 4.8rem); }
  .cine-sub   { font-size: clamp(1.15rem, 2.2vw, 1.72rem); margin-top: 2.4rem; }
}

@media screen and (max-height: 760px) {
  .cinema { padding: 2.5rem 1.5rem 2.5rem 1.5rem; }
  .cine-title   { font-size: clamp(2.2rem, 5.4vw, 3.9rem); }
  .cine-sub     { font-size: clamp(1.02rem, 1.9vw, 1.45rem); margin-top: 1.8rem; }

  .cine-scroll  { bottom: 1.1rem; gap: 0.5rem; }
  .cine-scroll-rail { height: 38px; }
}

@media screen and (max-height: 660px) {
  .cine-title   { font-size: clamp(1.9rem, 4.6vw, 3.1rem); }
  .cine-sub     { font-size: clamp(0.95rem, 1.7vw, 1.26rem); }

  .cine-scroll-rail { height: 28px; }
}

/* the rollout reel has no side panel, so its stage simply centres */
.reel.is-solo .reel-row { max-width: 820px; }
.reel.is-solo .reel-stage { flex: 0 1 760px; margin: 0 auto; }
