.story-hero {
  padding: clamp(42px, 6vw, 76px) 0 58px;
  display: grid;
  grid-template-columns: minmax(0, .84fr) minmax(0, 1.16fr);
  gap: clamp(28px, 4vw, 56px);
  align-items: center;
}

.story-hero h1 { max-width: 16ch; }
.story-hero .hero-lead { max-width: 56ch; }
.story-hero .hero-actions { margin-top: 26px; }
.story-hero .trust-row { margin-top: 18px; }

.screen-frame {
  margin: 0;
  min-width: 0;
}

.screen-media {
  position: relative;
  padding: 9px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--sh-md);
  overflow: hidden;
}

.screen-media::before {
  display: block;
  height: 16px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border);
  background: radial-gradient(circle at 9px 6px, var(--accent-fill) 3px, transparent 4px),
    radial-gradient(circle at 21px 6px, var(--border) 3px, transparent 4px),
    radial-gradient(circle at 33px 6px, var(--border) 3px, transparent 4px);
  content: '';
}

.screen-media img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 9px;
}

.screen-frame--focus .screen-media {
  aspect-ratio: 1.27;
}
.screen-frame--focus .screen-media img {
  width: 130%;
  max-width: none;
  transform: translateX(-22%);
}

.screen-frame figcaption {
  margin: 3px 2px 0;
  color: var(--fg2);
  font-size: 11px;
  font-style: italic;
  line-height: 1.35;
}

.story-section { padding: clamp(46px, 6vw, 78px) 0; }
.story-section--tint { background: var(--surface2); }
.story-heading { max-width: 760px; margin-bottom: 30px; }
.story-heading h2 { margin: 0 0 12px; font-size: clamp(25px, 3vw, 36px); line-height: 1.18; }
.story-heading p { margin: 0; color: var(--fg2); font-size: 16px; line-height: 1.6; }
.story-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.story-card {
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 13px;
}
.story-card h3 { margin: 10px 0; font-size: 18px; line-height: 1.3; }
.story-card p { margin: 0 0 16px; color: var(--fg2); line-height: 1.6; }
.story-card .contract-link { margin-top: auto; }
.story-card-index { color: var(--accent-text); font-family: 'JBMono', ui-monospace, monospace; font-size: 12px; }

.story-split {
  display: grid;
  grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr);
  align-items: center;
  gap: clamp(24px, 5vw, 70px);
}
.story-split--reverse { grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); }
.story-split--reverse .story-copy { grid-column: 2; grid-row: 1; }
.story-split--reverse .screen-frame { grid-column: 1; grid-row: 1; }
.story-copy h2 { margin: 0 0 16px; font-size: clamp(25px, 3vw, 36px); line-height: 1.18; }
.story-copy p { color: var(--fg2); font-size: 16px; line-height: 1.65; }
.story-copy .contract-link { display: inline-flex; margin-top: 8px; }
.story-points { padding-left: 20px; color: var(--fg2); font-size: 15px; line-height: 1.7; }
.story-points li + li { margin-top: 8px; }

.screen-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.screen-pair .screen-frame figcaption { margin-top: 3px; }
.analytics-collage { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 14px; align-items: start; }
.analytics-collage .screen-frame:last-child { margin-top: 64px; }
.hosted-carousel { max-width: 660px; margin-inline: auto; }
.hosted-carousel__panel[hidden] { display: none; }
.hosted-carousel__panel .screen-frame { margin: 0; }
.hosted-browser { overflow: hidden; border: 1px solid var(--border); border-radius: 16px; background: #f2eaff; box-shadow: var(--sh-md); }
.hosted-browser__bar { height: 38px; display: flex; align-items: center; gap: 12px; padding: 0 13px; border-bottom: 1px solid var(--border); background: var(--surface); }
.hosted-browser__dots { width: 36px; height: 9px; flex: none; background: radial-gradient(circle at 4px 4px, var(--accent-fill) 3px, transparent 4px), radial-gradient(circle at 17px 4px, var(--border) 3px, transparent 4px), radial-gradient(circle at 30px 4px, var(--border) 3px, transparent 4px); }
.hosted-browser__address { display: block; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 5px 12px; border: 1px solid var(--border); border-radius: 6px; color: var(--fg2); font: 11px 'JBMono', ui-monospace, monospace; }
.hosted-browser__image { display: flex; align-items: center; justify-content: center; height: 410px; overflow: hidden; cursor: zoom-in; }
.hosted-browser__image img { display: block; max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
#hosted-panel-footer .hosted-browser__image { height: auto; aspect-ratio: 1000 / 610; }
#hosted-panel-footer .hosted-browser__image img { width: 100%; height: 100%; max-height: none; object-fit: cover; }
.hosted-carousel__thumbs { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 7px; margin-top: 18px; }
.hosted-carousel__thumbs button { min-width: 0; padding: 4px 4px 8px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); color: var(--fg2); font: inherit; cursor: pointer; text-align: center; }
.hosted-carousel__thumbs button[aria-selected="true"] { border-color: var(--accent-fill); box-shadow: 0 0 0 2px var(--accent-fill); color: var(--fg); }
.hosted-carousel__thumbs button:focus-visible { outline: 2px solid var(--accent-fill); outline-offset: 3px; }
.hosted-carousel__thumbs img { display: block; width: 100%; height: 58px; border-radius: 5px; object-fit: cover; background: #f2eaff; }
.hosted-carousel__thumbs span { display: block; margin-top: 6px; font-size: 11px; line-height: 1.2; }
.hosted-carousel + .story-note { max-width: 75ch; margin: 18px auto 0; text-align: center; }
.catalog-facts { display: grid; gap: 0; border-top: 1px solid var(--border); }
.catalog-fact { display: grid; grid-template-columns: 33px minmax(0, 1fr); gap: 12px; padding: 16px 0; border-bottom: 1px solid var(--border); }
.catalog-fact-index { color: var(--accent-text); font: 12px 'JBMono', ui-monospace, monospace; padding-top: 3px; }
.catalog-fact strong, .catalog-fact span { display: block; }
.catalog-fact strong { font-size: 17px; line-height: 1.25; }
.catalog-fact span { margin-top: 3px; color: var(--fg2); font-size: 13px; line-height: 1.45; }
.story-cta { padding: clamp(45px, 6vw, 70px) 0; }
.story-cta .final-card { padding: clamp(28px, 5vw, 50px); }
.story-note { margin-top: 14px; color: var(--fg2); font-size: 13px; }

@media (max-width: 900px) {
  .story-hero, .story-split, .story-split--reverse { grid-template-columns: 1fr; }
  .story-hero h1 { max-width: 23ch; }
  .story-split--reverse .story-copy, .story-split--reverse .screen-frame { grid-column: 1; grid-row: auto; }
  .analytics-collage { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 700px) {
  .story-hero { padding-top: 38px; gap: 28px; }
  .story-grid, .screen-pair { grid-template-columns: 1fr; }
  .story-card { padding: 20px; }
  .screen-frame--focus .screen-media { aspect-ratio: 1.1; }
  .screen-frame--focus .screen-media img { width: 150%; transform: translateX(-21%); }
  .analytics-collage { grid-template-columns: 1fr; }
  .analytics-collage .screen-frame:last-child { margin-top: 0; }
  .hosted-browser__image { height: clamp(280px, 65vw, 410px); }
  .hosted-carousel__thumbs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Overview video in the hub hero (promo-video.js). The frame is the same screen-frame as the
   screenshots it replaced; the controls stay small and quiet so the loop reads as a preview. */
.promo-video__stage { position: relative; }
/* The whole preview opens the player (promo-video.js), not only the pill. */
.promo-video:not(.is-full) .promo-video__stage { cursor: pointer; }
.promo-video__video {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  border-radius: 9px;
  background: var(--surface2);
  object-fit: cover;
}
.promo-video__play,
.promo-video__ctl {
  position: absolute;
  bottom: 20px;
  /* Light pill on purpose: the video is mostly dark, and a dark glass pill vanished on it. */
  color: #1f1810;
  background: rgb(255 251 244 / 0.94);
  box-shadow: 0 0 0 1px rgb(0 0 0 / 0.06), 0 8px 24px rgb(0 0 0 / 0.35);
  transition: background-color 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
}
.promo-video__play {
  left: 20px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 15px 7px 7px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 650;
  line-height: 1;
  text-decoration: none;
}
.promo-video__play:hover,
.promo-video__play:focus-visible,
.promo-video__stage:hover .promo-video__play { background: #fff; transform: translateY(-1px); }
.promo-video__play-icon {
  position: relative;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent-fill);
}
.promo-video__play-icon::after {
  position: absolute;
  top: 50%;
  left: 52%;
  border-width: 6px 0 6px 10px;
  border-style: solid;
  border-color: transparent transparent transparent var(--accent-ink);
  content: '';
  transform: translate(-40%, -50%);
}
.promo-video__play-time { color: rgb(31 24 16 / 0.6); font-weight: 500; font-variant-numeric: tabular-nums; }
.promo-video__controls { position: absolute; right: 20px; bottom: 20px; display: flex; gap: 8px; }
.promo-video__ctl {
  position: static;
  display: grid;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  opacity: 0.9;
  place-items: center;
}
.promo-video__ctl:hover,
.promo-video__ctl:focus-visible { opacity: 1; background: #fff; }
.promo-video__ctl svg { width: 17px; height: 17px; }
.promo-video__icon-resume,
.promo-video__ctl[aria-pressed='true'] .promo-video__icon-pause { display: none; }
.promo-video__ctl[aria-pressed='true'] .promo-video__icon-resume { display: block; }
.promo-video__play:focus-visible,
.promo-video__ctl:focus-visible { outline: 2px solid var(--accent-fill); outline-offset: 2px; }
.promo-video.is-full .promo-video__play,
.promo-video.is-full .promo-video__controls { display: none; }
/* With sound and controls the whole picture matters more than filling the frame. */
.promo-video.is-full .promo-video__video { object-fit: contain; background: #000; }

/* Modal player (▶). The video is sized to fit BOTH viewport dimensions at 16:9, so it is never
   cropped and never stretched, whatever the screen's proportions. */
.promo-dialog {
  width: fit-content;
  max-width: none;
  max-height: none;
  margin: auto;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: visible;
}
.promo-dialog::backdrop {
  background: rgb(8 6 4 / 0.82);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.promo-dialog__box { position: relative; }
.promo-dialog__video {
  display: block;
  width: min(92vw, calc((100vh - 120px) * 16 / 9));
  width: min(92vw, calc((100dvh - 120px) * 16 / 9));
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  border-radius: 12px;
  background: #000;
  box-shadow: 0 24px 80px rgb(0 0 0 / 0.5);
}
.promo-dialog__close {
  position: absolute;
  top: -48px;
  right: 0;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: rgb(255 255 255 / 0.14);
  cursor: pointer;
  transition: background-color 0.2s ease;
}
.promo-dialog__link {
  position: absolute;
  top: -40px;
  left: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: calc(100% - 56px);
  color: rgb(255 255 255 / 0.86);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.promo-dialog__link::after { content: '→'; }
.promo-dialog__link:hover { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.promo-dialog__link:focus-visible { outline: 2px solid var(--accent-fill); outline-offset: 3px; border-radius: 4px; }
.promo-dialog__close:hover { background: rgb(255 255 255 / 0.26); }
.promo-dialog__close:focus-visible { outline: 2px solid var(--accent-fill); outline-offset: 2px; }
.promo-dialog__close svg { width: 20px; height: 20px; }
.promo-dialog[open] { animation: promo-dialog-in 0.2s ease-out; }
@keyframes promo-dialog-in { from { opacity: 0; transform: scale(0.97); } }
:root.promo-dialog-open { overflow: hidden; }

@media (max-width: 600px) {
  .promo-video__play { left: 10px; bottom: 10px; gap: 7px; padding: 4px 10px 4px 4px; font-size: 12px; }
  /* A phone-wide frame is ~330px: the label stays for screen readers, the pill keeps ▶ and the time. */
  .promo-video__play > span:nth-child(2) {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
  }
  .promo-video__play-icon { width: 24px; height: 24px; }
  .promo-video__controls { right: 10px; bottom: 10px; gap: 6px; }
  .promo-video__ctl { width: 30px; height: 30px; }
  .promo-video__ctl svg { width: 15px; height: 15px; }
}
@media (prefers-reduced-motion: reduce) {
  .promo-video__play,
  .promo-video__ctl,
  .promo-dialog__close { transition: none; }
  .promo-dialog[open] { animation: none; }
}
