.video-dialog, .study-dialog, .stream-dialog {
  width: min(880px, calc(100% - 32px));
  max-height: 94vh;
  margin: auto;
  padding: 0;
  background: var(--surface);
  color: var(--fg);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.video-dialog::backdrop, .study-dialog::backdrop, .stream-dialog::backdrop { background: #080b09cf; }
.video-dialog__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; }
.video-dialog__top h3 { margin: 0; font-size: 16px; }
.video-dialog__top button { padding: 7px 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--fg); font: 500 14px var(--ui); cursor: pointer; }
.video-dialog video { display: block; width: 100%; max-height: 73vh; background: #0b0c0b; }

.showcase-block {
  padding-block: clamp(44px, 5.2vw, 76px);
  background: var(--surface);
  color: var(--fg);
  border-top: 1px solid var(--line);
}
.showcase-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  flex-wrap: wrap;
  margin-bottom: clamp(20px, 2.4vw, 36px);
}
.showcase-head h2 {
  font: 540 clamp(36px, 4.2vw, 62px)/1.04 var(--ui);
  letter-spacing: -.055em;
}
.catalog-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 39px;
  border: 1px solid var(--line);
  border-radius: 30px;
  padding: 8px 16px;
  font: 560 14px/1.2 var(--ui);
  color: inherit;
  text-decoration: none;
}
.catalog-link::before {
  content: '';
  width: 11px;
  height: 11px;
  flex: none;
  background: linear-gradient(currentColor 0 0) 0 0, linear-gradient(currentColor 0 0) 100% 0,
              linear-gradient(currentColor 0 0) 0 100%, linear-gradient(currentColor 0 0) 100% 100%;
  background-size: 4.5px 4.5px;
  background-repeat: no-repeat;
}
.catalog-link:is(:hover,:focus-visible) {
  color: #171a16; background: var(--lime); border-color: var(--lime);
}
.video-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  grid-template-rows: repeat(2, clamp(164px, 13.6vw, 210px));
  gap: clamp(8px, 1.05vw, 16px);
}
.video-card {
  position: relative;
  isolation: isolate;
  display: flex; align-items: end;
  min-width: 0;
  overflow: hidden;
  border-radius: 10px;
  background: #252b29;
  color: #fff;
}
.video-card:first-child { grid-row: span 2; }
.video-card video, .video-card::before {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
}
.video-card video { object-fit: cover; }
.video-card video.launch-field { object-position: 18% 50%; }
.video-card video.rain-portrait { object-position: 50% 38%; }
.video-card::before {
  content: '';
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(0deg,rgba(5,10,10,.82),rgba(5,10,10,.24) 36%,transparent 65%);
}
.video-card__caption { z-index: 2; margin: clamp(12px,1.35vw,20px); pointer-events: none; }
.video-card__caption p { margin-bottom: 3px; font: 500 clamp(11px,1.02vw,14px)/1.3 var(--ui); color: #f0f3ed; }
.video-card__caption h3 { font: 565 clamp(19px,1.85vw,29px)/1.03 var(--ui); letter-spacing: -.04em; }
.video-card:first-child h3 { font-size: clamp(30px,3.4vw,50px); }
.video-card__caption .card-price { display: block; margin-top: 4px; color: #f1f4ef; }
.video-card__caption a { color: #fff; text-decoration: none; pointer-events: auto; }
.video-card:has(.video-card__caption a:is(:hover,:focus-visible)) h3 { text-decoration: underline; text-underline-offset:.14em; text-decoration-thickness: .06em; }
.video-card__caption a::after { content: ''; position: absolute; inset: 0; }
.video-card:focus-within { outline: 2px solid var(--lime); outline-offset: 2px; }
.video-card__watch {
  position: absolute; z-index: 3; top: 11px; right: 11px;
  display: grid; place-items: center; width: 38px; height: 38px;
  color: #fff; background: rgba(13,20,18,.62);
  border: 1px solid rgba(255,255,255,.57); border-radius: 50%;
  backdrop-filter: blur(8px);
}
.video-card__watch span {
  display: block;
  width: 10px; height: 12px;
  margin-left: 2px;
  background: currentColor;
  clip-path: polygon(0 0, 100% 50%, 0 100%);
}
.video-card__watch:is(:hover,:focus-visible) { background: #fff; color: #171a16; }
#demo-image { padding-block: clamp(36px, 3.7vw, 54px); }
#demo-image .showcase-head { margin-bottom: clamp(17px, 1.6vw, 24px); }
.image-grid {
  --tile-media-height: clamp(132px, 12.6vw, 184px);
  display: grid;
  gap: clamp(16px, 1.5vw, 22px) clamp(12px, 1vw, 16px);
}
.image-card { position: relative; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.image-card--edit { grid-area: edit; }
.image-card--vector { grid-area: vector; }
.image-card--runner { grid-area: runner; }
.image-card--poster { grid-area: poster; }
.image-card--citrus { grid-area: citrus; }
.image-card--launch { grid-area: launch; }
.image-card__media { position: relative; flex: none; height: var(--tile-media-height); border-radius: 9px; overflow: hidden; background: #182024; }
.image-card--edit .image-card__media { flex: 1; min-height: 0; height: auto; }
.image-card__media > img { display: block; width: 100%; height: 100%; object-fit: cover; }
.image-card--vector .image-card__media > img { object-position: 78% 8%; }
.image-card .source-links { bottom: 8px; left: 8px; right: 8px; gap: 4px; }
.image-card .source-link { gap: 4px; min-height: 30px; padding: 2px 6px 2px 2px; font-size: 11px; font-weight: 550; }
.image-card .source-link img { width: 29px; height: 23px; }
.image-card--edit .source-links { justify-content: flex-end; }
.image-card__caption { flex: 1; display: flex; flex-direction: column; padding-top: 8px; }
.image-card--edit .image-card__caption { flex: none; }
.image-card__caption h3 { font: 580 clamp(16px, 1.35vw, 20px)/1.1 var(--ui); letter-spacing: -.035em; }
.image-card__caption p { margin-top: 4px; color: var(--muted); font-size: 13px; line-height: 1.3; }
.image-card__caption .card-price { display: block; margin-top: auto; padding-top: 4px; }
.image-card--edit h3 { font-size: clamp(22px, 1.95vw, 30px); }
.image-card__caption .model-name::after { content: ""; position: absolute; inset: 0; border-radius: 9px; }
.image-card__caption .model-name:focus-visible::after { outline: 2px solid var(--accent); outline-offset: 3px; }
.image-card--edit .image-card__caption .model-name::after { display: none; }
@media (min-width: 1001px) {
  .image-grid {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    /* Common picture and caption tracks keep the large comparison flush with both rows. */
    grid-template-rows: var(--tile-media-height) auto clamp(16px, 1.5vw, 22px) var(--tile-media-height) auto;
    row-gap: 0;
  }
  .image-card { display: grid; grid-template-rows: subgrid; }
  .image-card--edit { grid-area: 1 / 1 / 6 / 5; }
  .image-card--vector { grid-area: 1 / 5 / 3 / 9; }
  .image-card--runner { grid-area: 1 / 9 / 3 / 13; }
  .image-card--poster { grid-area: 4 / 5 / 6 / 8; }
  .image-card--citrus { grid-area: 4 / 8 / 6 / 10; }
  .image-card--launch { grid-area: 4 / 10 / 6 / 13; }
  .image-card__media { height: auto; grid-row: 1; }
  .image-card__caption { grid-row: 2; }
  .image-card--edit .image-card__media { grid-row: 1 / 5; }
  .image-card--edit .image-card__caption { grid-row: 5; }
}
.model-name { color: inherit; text-decoration: none; }
a.model-name:is(:hover,:focus-visible) { text-decoration: underline; text-underline-offset: .17em; text-decoration-thickness: .07em; }
.compare-media { --split: 52%; }
.compare-media .compare-before { position: absolute; inset: 0; clip-path: inset(0 calc(100% - var(--split)) 0 0); }
.compare-line { position: absolute; z-index: 1; inset-block: 0; left: var(--split); border-left: 2px solid #fff; pointer-events: none; }
.compare-line b { position: absolute; top: 50%; transform: translate(-50%,-50%); width: 30px; height: 36px; background: #fff; border: 1px solid #0002; border-radius: 18px; box-shadow: 0 2px 8px #0003; }
.compare-line b::after { content: ''; position: absolute; top: 9px; left: 8px; width: 12px; height: 15px; background: radial-gradient(circle,#353c34 1.3px,transparent 1.6px) 0 0 / 6px 5px; }
.compare-tag { position: absolute; top: 12px; border-radius: 4px; padding: 4px 8px; color: #fff; background: #161d1bc9; font: 550 12px/1.1 var(--ui); }
.before-tag { left: 12px; }
.after-tag { right: 12px; }
.compare-range { position: absolute; z-index: 2; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; }
.compare-media:focus-within { outline: 3px solid var(--accent); outline-offset: 2px; }

@media (max-width: 760px) {
  .video-grid { grid-template-columns: 1fr 1fr; grid-template-rows: none; gap: 9px; }
  .video-card { aspect-ratio: 1.5; }
  .video-card:first-child { grid-column: 1 / -1; grid-row: auto; aspect-ratio: 2.1; }
}
@media (min-width: 601px) and (max-width: 1000px) {
  .image-grid {
    --tile-media-height: clamp(124px, 18vw, 162px);
    grid-template-columns: repeat(6, minmax(0, 1fr));
    grid-template-areas: "edit edit edit vector vector vector"
                         "runner runner runner poster poster poster"
                         "citrus citrus launch launch launch launch";
  }
  .image-card--edit .image-card__media { flex: none; height: var(--tile-media-height); }
  .image-card--edit .image-card__caption { flex: 1; }
  .image-card--edit h3 { font-size: 20px; }
}
@media (max-width: 600px) {
  .image-grid {
    --tile-media-height: clamp(105px, 29vw, 150px);
    grid-template-columns: repeat(12, minmax(0, 1fr));
    grid-template-areas: "edit edit edit edit edit edit edit vector vector vector vector vector"
                         "runner runner runner runner runner runner poster poster poster poster poster poster"
                         "citrus citrus citrus citrus citrus launch launch launch launch launch launch launch";
    gap: 16px 8px;
  }
  .image-card--edit .image-card__media, .image-card--vector .image-card__media { flex: none; height: calc(var(--tile-media-height) + 28px); }
  .image-card--edit .image-card__caption { flex: 1; }
  .image-card__caption h3 { font-size: clamp(15px, 4.1vw, 18px); }
  .image-card .source-links { bottom: 5px; left: 5px; right: 5px; }
  .image-card .source-link { min-height: 27px; font-size: 10px; }
  .image-card .source-link img { width: 24px; height: 20px; }
  .image-card--edit .source-links { left: 4px; right: 4px; justify-content: flex-start; gap: 4px; }
  .image-card--edit .source-link { padding-right: 4px; gap: 3px; }
  .image-card--edit .source-link img { width: 19px; }
  .image-card--edit .compare-tag { top: 6px; padding: 3px 5px; font-size: 10px; }
  .image-card--edit .before-tag { left: 6px; }
  .image-card--edit .after-tag { right: 6px; }
}
@media (max-width: 560px) {
  .showcase-head { align-items: start; flex-direction: column; }
  .showcase-head h2 { font-size: clamp(32px,8.8vw,45px); }
  .catalog-link { min-height: 34px; padding: 6px 12px; font-size: 13px; }
  .video-card { border-radius: 8px; aspect-ratio: 1.2; }
  .video-card:first-child { aspect-ratio: 1.7; }
  .video-card__watch { top: 7px; right: 7px; width: 30px; height: 30px; }
  .video-card__watch span { width: 8px; height: 10px; }
  .video-card__caption { margin: 10px; }
  .video-card__caption h3 { font-size: clamp(16px,4.4vw,21px); }
  .video-card:first-child h3 { font-size: 30px; }
  .image-card__caption { padding-top: 6px; }
  .image-card__caption p { font-size: 12px; }
}

@media (max-width: 400px) {
  .video-grid .video-card:not(:first-child) { width: 100%; min-height: 158px; aspect-ratio: auto; }
}

.process-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: clamp(15px,1.65vw,25px);
}
.process-card { position: relative; min-width: 0; }
.process-card__stage {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1.48;
  border-radius: 10px;
  background: #182024;
}
.process-card__stage video { display: block; width: 100%; height: 100%; object-fit: cover; }
.process-card__stage .video-card__watch { width: 43px; height: 43px; }
.process-card__caption { margin-top: 13px; }
.video-model-credit, .video-example-info { display: flex; flex-wrap: wrap; align-items: baseline; gap: 3px 12px; }
.video-example-info { margin-top: 5px; }
.process-card__caption :is(h3,h4), .process-model h3, .workflow-models h3 {
  margin: 0;
  font: 570 clamp(19px,1.6vw,25px)/1.14 var(--ui);
  letter-spacing: -.035em;
}
.process-card__caption p, .process-model p, .workflow-models p {
  color: var(--muted);
  font: 400 14px/1.45 var(--ui);
}
.workflow-models p { margin-top: 5px; }
.process-card__caption a::after { content: ''; position: absolute; inset: 0; border-radius: 10px; }
.process-card__caption a:focus-visible::after { outline: 2px solid var(--accent); outline-offset: 3px; }
.source-links {
  position: absolute; z-index: 3; bottom: 12px; left: 12px; right: 12px;
  display: flex; align-items: stretch; gap: 6px; flex-wrap: wrap; pointer-events: none;
}
.source-link {
  display: flex; align-items: center; gap: 7px; max-width: 100%; pointer-events: auto;
  padding: 3px 10px 3px 3px;
  border: 1px solid #fff9; border-radius: 7px;
  color: #fff; background: #17201eeb; text-decoration: none;
  font: 550 12px/1.2 var(--ui);
}
.source-link--voice { padding-inline: 9px; }
.voice-bars {
  width: 15px; height: 14px;
  background: linear-gradient(currentColor,currentColor) 0 50%/2px 40%,
              linear-gradient(currentColor,currentColor) 33% 50%/2px 75%,
              linear-gradient(currentColor,currentColor) 66% 50%/2px 100%,
              linear-gradient(currentColor,currentColor) 100% 50%/2px 55%;
  background-repeat: no-repeat;
}
.source-link img {
  display: block; flex: none; object-fit: cover;
  width: 50px; height: 35px; border-radius: 4px;
}
.source-link:is(:hover,:focus-visible) { color: #171a16; background: #fff; }
.source-link:focus-visible,.video-card__watch:focus-visible { outline: 2px solid white; outline-offset: 2px; }
.process-model h3 { font-size: 19px; }
.process-model p { margin: 4px 0 0; max-width: 77ch; text-wrap: pretty; }
.workflow-models { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,220px),1fr)); gap: 18px; margin-top: 25px; }
.workflow-models article { border-top: 1px solid var(--line); padding-top: 12px; }
.video-dialog > img { display: block; width: 100%; max-height: 78vh; object-fit: contain; background: #0b0c0b; }
.video-dialog > audio { display: block; width: calc(100% - 28px); margin: 4px 14px 16px; }
.video-dialog > [hidden] { display: none; }

@media (max-width: 850px) and (min-width: 601px) {
  .process-card__stage { aspect-ratio: 1.1; }
  .source-links { bottom: 8px; left: 8px; right: 8px; }
  .source-link { gap: 5px; font-size: 11px; }
  .source-link img { width: 34px; height: 28px; }
}
@media (max-width: 600px) {
  .process-grid { grid-template-columns: 1fr; row-gap: 24px; }
  .process-card__stage { aspect-ratio: 1.7; }
  .process-card__caption { margin-top: 8px; }
  .video-example-info { margin-top: 3px; }
}
.avatar-grid { row-gap: 14px; }
.avatar-group {
  display: grid; grid-template-columns: subgrid; grid-template-rows: subgrid;
  grid-column: span var(--scenes); grid-row: span 2;
}
.avatar-group .process-model { grid-column: 1/-1; }
.avatar-group .process-card__stage { aspect-ratio: 1.18; }
.process-model a { text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: .19em; }
.process-model a:is(:hover,:focus-visible) { text-decoration-color: currentColor; }
@media (max-width: 600px) {
  .avatar-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px 10px; }
  .avatar-group { grid-column: 1/-1; grid-row: auto; grid-template-rows: none; row-gap: 12px; }
  .avatar-group + .avatar-group { margin-top: 9px; }
  .avatar-group .process-card__stage { aspect-ratio: .9; }
  .avatar-group .process-card:only-of-type, .avatar-group .process-card:nth-of-type(3) { grid-column: 1/-1; }
  .avatar-group .process-card:only-of-type .process-card__stage, .avatar-group .process-card:nth-of-type(3) .process-card__stage { aspect-ratio: 1.45; }
  .avatar-group .source-links { left: 6px; right: 6px; bottom: 6px; }
  .avatar-group .source-link { gap: 5px; padding-right: 6px; font-size: 11px; }
  .avatar-group .source-link img { width: 30px; height: 27px; }
  .video-grid .video-card__watch::after { content: ''; position: absolute; inset: -6px; }
}

#demo-avatar .spoken-script { margin-top: 7px; font: 500 13px/1.5 var(--ui); }
#demo-avatar .spoken-script summary { width: fit-content; cursor: pointer; color: var(--muted); }
#demo-avatar .spoken-script summary:is(:hover,:focus-visible) { color: var(--fg); text-decoration: underline; }
#demo-avatar .spoken-script p { max-width: 42ch; margin: 7px 0 0; color: var(--fg); }

@media (max-width: 960px) {
  #demo-avatar .process-card:not(:only-of-type) {
    display: flex; flex-direction: column; gap: 7px;
  }
  #demo-avatar .process-card:not(:only-of-type) .process-card__stage { display: contents; }
  #demo-avatar .process-card:not(:only-of-type) video {
    aspect-ratio: 1.18; height: auto; border-radius: 8px;
  }
  #demo-avatar .process-card:not(:only-of-type) .process-card__caption { order: 1; margin-top: 0; }
  #demo-avatar .process-card:not(:only-of-type) .source-links { position: static; order: 2; gap: 5px; }
  #demo-avatar .process-card:not(:only-of-type) .source-link {
    min-height: 34px; border-color: var(--line); background: var(--surface); color: var(--fg);
  }
  #demo-avatar .process-card:not(:only-of-type) .source-link:is(:hover,:focus-visible) { border-color: var(--fg); outline-color: var(--accent); }
}
@media (max-width: 600px) {
  #demo-avatar .process-card:not(:only-of-type) video { aspect-ratio: .9; }
  #demo-avatar .process-card:not(:only-of-type) .video-card__watch { top: 5px; right: 5px; width: 35px; height: 35px; }
}
