@import url("https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Space+Grotesk:wght@400;500;600;700&display=swap");

:root {
  color-scheme: dark;
  --bg: #0b0d0c;
  --surface: #141815;
  --surface-raised: #1a1f1b;
  --line: #303730;
  --text: #f2f4ed;
  --muted: #9ba49c;
  --acid: #d9ff57;
  --coral: #ff7657;
  --cyan: #65d9e8;
  --header-height: 68px;
  --resolution-comparison-max-width: min(960px, 92vw);
  font-family: "Space Grotesk", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  overflow-x: hidden;
  background:
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    var(--bg);
  background-size: 36px 36px;
  color: var(--text);
}

button,
a {
  font: inherit;
}

button {
  cursor: pointer;
}

button:focus-visible,
a:focus-visible,
[role="slider"]:focus-visible {
  outline: 2px solid var(--acid);
  outline-offset: 3px;
}

.site-header {
  position: sticky;
  z-index: 30;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  padding: 0 clamp(18px, 4vw, 58px);
  border-bottom: 1px solid var(--line);
  background: rgba(11, 13, 12, 0.9);
  backdrop-filter: blur(18px);
}

.brand,
.site-header nav,
footer > div {
  display: flex;
  align-items: center;
}

.footer-actions {
  gap: 22px;
}

.brand {
  gap: 11px;
  color: var(--text);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 4px;
  background: var(--acid);
  color: #10140b;
  font-family: "DM Mono", monospace;
  font-size: 17px;
  font-weight: 500;
  transform: skew(-5deg);
}

.brand-copy strong,
.brand-copy small {
  display: block;
}

.brand-copy strong {
  font-size: 14px;
}

.brand-copy small {
  margin-top: 2px;
  color: var(--muted);
  font-family: "DM Mono", monospace;
  font-size: 9px;
  text-transform: uppercase;
}

.site-header nav {
  gap: 24px;
}

.site-header nav a,
footer a {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
}

.site-header nav a:hover,
footer a:hover {
  color: var(--text);
}

.site-header .desk-link {
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--text);
}

.interpolation-showcase,
.resolution-showcase,
.frame-rate-section {
  padding-inline: clamp(18px, 4vw, 58px);
}

.interpolation-showcase,
.resolution-showcase,
.frame-rate-section {
  scroll-margin-top: var(--header-height);
}

.interpolation-showcase {
  min-height: calc(100svh - var(--header-height));
  padding-top: clamp(28px, 4vh, 48px);
  padding-bottom: 42px;
  border-bottom: 1px solid var(--line);
}

.resolution-showcase {
  min-height: calc(100svh - var(--header-height));
  padding-top: clamp(28px, 4vh, 48px);
  padding-bottom: 34px;
}

.showcase-heading,
.section-heading,
.clip-meta,
.overlay-study header,
footer {
  display: flex;
  justify-content: space-between;
}

.showcase-heading {
  align-items: flex-end;
  gap: 28px;
}

.showcase-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.study-link {
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--text);
  font-size: 11px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.study-link:hover {
  border-color: #59635a;
  background: var(--surface-raised);
}

.section-kicker,
.clip-count,
.format-note,
.overlay-study header span {
  font-family: "DM Mono", monospace;
  text-transform: uppercase;
}

.section-kicker {
  margin: 0 0 8px;
  color: var(--acid);
  font-size: 10px;
}

h1,
h2,
h3,
p {
  letter-spacing: 0;
}

h1 {
  margin: 0;
  font-size: clamp(42px, 6vw, 78px);
  line-height: 0.92;
}

.showcase-summary {
  max-width: 670px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: clamp(14px, 1.4vw, 18px);
  line-height: 1.5;
}

.carousel-controls {
  display: grid;
  grid-template-columns: repeat(3, 38px);
  gap: 7px;
}

.zoom-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-family: "DM Mono", monospace;
  font-size: 9px;
  text-transform: uppercase;
  white-space: nowrap;
}

.zoom-toggle input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.toggle-track {
  position: relative;
  width: 32px;
  height: 18px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-raised);
  transition: border-color 160ms ease, background 160ms ease;
}

.toggle-track i {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform 160ms ease, background 160ms ease;
}

.zoom-toggle input:checked + .toggle-track {
  border-color: var(--acid);
  background: rgba(206, 255, 79, 0.08);
}

.zoom-toggle input:checked + .toggle-track i {
  background: var(--acid);
  transform: translateX(14px);
}

.zoom-toggle input:focus-visible + .toggle-track {
  outline: 2px solid var(--text);
  outline-offset: 3px;
}

.icon-control,
.overlay-play {
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface-raised);
  color: var(--text);
}

.icon-control {
  width: 38px;
  height: 38px;
}

.icon-control:hover,
.overlay-play:hover {
  border-color: #59635a;
  background: #232a24;
}

.icon-control:disabled {
  border-color: var(--line);
  color: var(--muted);
  cursor: wait;
  opacity: 0.45;
}

.play-control {
  color: var(--acid);
}

.clip-meta {
  align-items: end;
  margin-top: 24px;
  padding: 11px 0;
  border-top: 1px solid var(--line);
  scroll-margin-top: var(--header-height);
}

.interpolation-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  margin-top: 24px;
  padding: 11px 0;
  border-top: 1px solid var(--line);
}

.interpolation-meta > div {
  display: flex;
  align-items: baseline;
  gap: 13px;
  min-width: 0;
}

.interpolation-meta strong {
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.interpolation-stage {
  position: relative;
  width: min(100%, 1100px);
  aspect-ratio: 1984 / 864;
  max-height: 52vh;
  margin-inline: auto;
  overflow: hidden;
  border-top: 2px solid var(--coral);
  background: var(--surface);
}

.interpolation-stage video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  transition: opacity 280ms ease;
}

.interpolation-stage.is-ready video {
  opacity: 1;
}

.interpolation-stage.is-ready .media-status {
  display: none;
}

.interpolation-method-strip {
  display: grid;
  grid-template-columns: repeat(9, minmax(130px, 1fr));
  width: 100%;
  margin-top: 22px;
  overflow-x: auto;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  scrollbar-width: thin;
}

.interpolation-method-button {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 7px;
  min-height: 58px;
  padding: 10px 9px;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  text-align: left;
}

.interpolation-method-button:last-child {
  border-right: 0;
}

.interpolation-method-button:hover,
.interpolation-method-button.is-active {
  background: var(--surface-raised);
}

.interpolation-method-button.is-active {
  box-shadow: inset 0 2px var(--acid);
}

.interpolation-method-button > span:first-child {
  color: var(--muted);
  font-family: "DM Mono", monospace;
  font-size: 8px;
}

.interpolation-method-button strong,
.interpolation-method-button small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.interpolation-method-button strong {
  font-size: 10px;
}

.interpolation-method-button small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 8px;
}

.interpolation-progress {
  height: 2px;
  margin-top: 14px;
  overflow: hidden;
  background: var(--line);
}

.interpolation-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--coral), var(--cyan), var(--acid));
}

.clip-meta > div {
  display: flex;
  align-items: baseline;
  gap: 13px;
  min-width: 0;
}

.clip-count,
.format-note {
  color: var(--muted);
  font-size: 9px;
  white-space: nowrap;
}

.clip-meta strong {
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.variant-strip,
.zoom-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(7px, 1vw, 15px);
}

.variant-strip,
.zoom-comparison {
  width: 100%;
  max-width: var(--resolution-comparison-max-width);
  margin-inline: auto;
}

.variant-panel {
  min-width: 0;
  border-top: 2px solid var(--line);
}

.variant-panel[data-tone="coral"] { border-color: var(--coral); }
.variant-panel[data-tone="cyan"] { border-color: var(--cyan); }
.variant-panel[data-tone="white"] { border-color: var(--text); }
.variant-panel[data-tone="acid"] { border-color: var(--acid); }

.variant-media {
  position: relative;
  aspect-ratio: 9 / 16;
  max-height: 54vh;
  overflow: hidden;
  background: var(--surface);
}

.variant-media video,
.overlay-stage video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.variant-media video {
  display: block;
  opacity: 0;
  transition: opacity 280ms ease;
}

.variant-media.is-ready video {
  opacity: 1;
}

.zoom-selector {
  position: absolute;
  z-index: 4;
  top: var(--zoom-y, 42%);
  left: var(--zoom-x, 50%);
  width: 34%;
  aspect-ratio: 1;
  border: 1px solid var(--acid);
  background: rgba(206, 255, 79, 0.08);
  box-shadow: 0 0 0 1px rgba(10, 14, 12, 0.85), inset 0 0 0 1px rgba(10, 14, 12, 0.42);
  cursor: move;
  opacity: 0;
  touch-action: none;
  transform: translate(-50%, -50%);
  transition: opacity 180ms ease, background 180ms ease;
}

.zoom-selector::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 8px;
  height: 8px;
  border-top: 1px solid var(--acid);
  border-left: 1px solid var(--acid);
  content: "";
  transform: translate(-50%, -50%) rotate(45deg);
}

.variant-media.is-ready .zoom-selector {
  opacity: 1;
}

.zoom-selector:hover,
.zoom-selector:focus-visible {
  background: rgba(206, 255, 79, 0.16);
  outline: none;
}

.variant-strip.is-zoom-disabled .zoom-selector {
  display: none;
}

.media-status {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-family: "DM Mono", monospace;
  font-size: 9px;
  text-transform: uppercase;
}

.variant-media.is-ready .media-status {
  display: none;
}

.variant-label {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 9px;
  padding: 12px 3px 0;
}

.variant-label > span {
  color: var(--muted);
  font-family: "DM Mono", monospace;
  font-size: 9px;
}

.variant-label strong,
.variant-label small {
  display: block;
}

.variant-label strong {
  font-size: 12px;
}

.variant-panel[data-tone="acid"] .variant-label strong {
  white-space: nowrap;
}

.variant-label small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.zoom-comparison {
  margin-top: 26px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.zoom-comparison-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 10px;
}

.zoom-comparison-heading strong {
  font-size: 12px;
}

.zoom-comparison-heading span,
.zoom-panel figcaption span {
  color: var(--muted);
  font-family: "DM Mono", monospace;
  font-size: 9px;
  text-transform: uppercase;
}

.zoom-panel {
  min-width: 0;
  margin: 0;
  border-top: 2px solid var(--line);
}

.zoom-panel[data-tone="coral"] { border-color: var(--coral); }
.zoom-panel[data-tone="cyan"] { border-color: var(--cyan); }
.zoom-panel[data-tone="white"] { border-color: var(--text); }
.zoom-panel[data-tone="acid"] { border-color: var(--acid); }

.zoom-panel canvas {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  background: var(--surface);
}

.zoom-panel figcaption {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding-top: 8px;
  font-size: 10px;
}

.zoom-panel figcaption strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.carousel-progress {
  height: 2px;
  margin-top: 18px;
  overflow: hidden;
  background: var(--line);
}

.carousel-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--coral), var(--cyan), var(--acid));
  transform-origin: left;
}

.frame-rate-section {
  padding-top: clamp(72px, 10vw, 140px);
  padding-bottom: clamp(80px, 10vw, 140px);
  border-top: 1px solid var(--line);
  background:
    radial-gradient(circle at 75% 10%, rgba(101, 217, 232, 0.07), transparent 34%),
    #0e1210;
}

.section-heading {
  align-items: end;
  gap: 40px;
  margin-bottom: 42px;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(34px, 5vw, 68px);
  line-height: 0.98;
}

.section-heading > p:last-child {
  max-width: 390px;
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.overlay-studies {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 430px));
  justify-content: center;
  gap: clamp(18px, 3vw, 42px);
  max-width: 902px;
  margin-inline: auto;
}

.overlay-study {
  min-width: 0;
}

.overlay-study header {
  align-items: end;
  gap: 16px;
  padding: 13px 0;
  border-top: 1px solid var(--line);
}

.overlay-study header span {
  color: var(--muted);
  font-size: 9px;
}

.overlay-study h3 {
  margin: 5px 0 0;
  font-size: 15px;
}

.overlay-play {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  color: var(--acid);
}

.overlay-stage {
  --split: 50%;
  position: relative;
  aspect-ratio: 9 / 16;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #080a09;
  touch-action: none;
  user-select: none;
}

.overlay-stage video {
  position: absolute;
  inset: 0;
  display: block;
  pointer-events: none;
}

.is-vertical .overlay-stage {
  cursor: col-resize;
}

.is-horizontal .overlay-stage {
  cursor: row-resize;
}

.is-vertical .overlay-reveal {
  clip-path: inset(0 0 0 var(--split));
}

.is-horizontal .overlay-reveal {
  clip-path: inset(var(--split) 0 0 0);
}

.reveal-divider {
  position: absolute;
  z-index: 4;
  background: var(--acid);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.38);
  pointer-events: none;
}

.is-vertical .reveal-divider {
  top: 0;
  bottom: 0;
  left: var(--split);
  width: 2px;
  transform: translateX(-1px);
}

.is-horizontal .reveal-divider {
  top: var(--split);
  right: 0;
  left: 0;
  height: 2px;
  transform: translateY(-1px);
}

.reveal-divider i {
  position: absolute;
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid var(--acid);
  border-radius: 50%;
  background: #151a16;
  color: var(--acid);
  font-family: "DM Mono", monospace;
  font-size: 13px;
  font-style: normal;
}

.is-vertical .reveal-divider i {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.is-horizontal .reveal-divider i {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.overlay-label {
  position: absolute;
  z-index: 3;
  padding: 6px 8px;
  background: rgba(11, 13, 12, 0.82);
  color: var(--text);
  font-family: "DM Mono", monospace;
  font-size: 8px;
  text-transform: uppercase;
  pointer-events: none;
}

.is-vertical .label-a { top: 10px; left: 10px; }
.is-vertical .label-b { top: 10px; right: 10px; }
.is-horizontal .label-a { top: 10px; left: 10px; }
.is-horizontal .label-b { right: 10px; bottom: 10px; }

footer {
  align-items: center;
  gap: 24px;
  padding: 30px clamp(18px, 4vw, 58px);
  border-top: 1px solid var(--line);
}

footer > div {
  gap: 10px;
}

footer .brand-mark {
  width: 28px;
  height: 28px;
  font-size: 13px;
}

.page-status {
  position: fixed;
  z-index: 50;
  right: 18px;
  bottom: 18px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface-raised);
  color: var(--muted);
  font-family: "DM Mono", monospace;
  font-size: 9px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.page-status.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-height: 900px) and (min-width: 761px) {
  .interpolation-showcase,
  .resolution-showcase {
    padding-top: 20px;
    padding-bottom: 24px;
  }

  h1 {
    font-size: clamp(42px, 6vw, 56px);
  }

  .showcase-summary {
    margin-top: 8px;
    font-size: 13px;
    line-height: 1.35;
  }

  .clip-meta {
    margin-top: 12px;
    padding-block: 8px;
  }

  .interpolation-meta {
    margin-top: 12px;
    padding-block: 8px;
  }

  .interpolation-method-strip {
    margin-top: 14px;
  }

  .variant-label {
    padding-top: 8px;
  }

  .zoom-comparison {
    margin-top: 14px;
    padding-top: 8px;
  }

  .zoom-comparison-heading {
    margin-bottom: 6px;
  }

  .zoom-panel figcaption {
    padding-top: 5px;
  }

  .carousel-progress {
    margin-top: 10px;
  }
}

@media (max-width: 760px) {
  .site-header {
    padding-inline: 15px;
  }

  .brand-copy small {
    display: none;
  }

  .site-header nav {
    gap: 12px;
  }

  .site-header nav a {
    font-size: 10px;
  }

  .showcase-heading,
  .section-heading {
    align-items: flex-start;
  }

  .showcase-heading {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .showcase-actions {
    align-items: flex-end;
    flex-direction: column;
  }

  .showcase-summary {
    font-size: 13px;
  }

  .interpolation-stage {
    width: auto;
    max-height: none;
    margin-inline: -18px;
  }

  .interpolation-method-strip {
    grid-auto-columns: minmax(150px, 44vw);
    grid-auto-flow: column;
    grid-template-columns: none;
    margin-inline: -18px;
    width: auto;
    padding-inline: 18px;
    scroll-snap-type: x proximity;
  }

  .interpolation-method-button {
    scroll-snap-align: start;
  }

  .variant-strip,
  .zoom-strip {
    grid-template-columns: repeat(4, minmax(210px, 72vw));
    margin-inline: -18px;
    padding-inline: 18px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scrollbar-width: thin;
  }

  .variant-strip {
    width: auto;
    max-width: none;
  }

  .variant-panel,
  .zoom-panel {
    scroll-snap-align: start;
  }

  .variant-media {
    max-height: 58vh;
  }

  .section-heading {
    display: block;
  }

  .section-heading > p:last-child {
    margin-top: 18px;
  }

  .overlay-studies {
    grid-template-columns: minmax(0, 430px);
  }
}

@media (max-width: 430px) {
  .brand-copy {
    display: none;
  }

  .showcase-heading {
    display: block;
  }

  .showcase-actions {
    align-items: flex-start;
    margin-top: 18px;
  }

  .interpolation-actions {
    align-items: flex-end;
  }

  .carousel-controls {
    margin-top: 18px;
  }

  .format-note {
    display: none;
  }

  .interpolation-meta strong {
    font-size: 12px;
  }

  .clip-meta strong {
    font-size: 12px;
  }

  footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .footer-actions {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }
}

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

  .variant-media video,
  .page-status {
    transition: none;
  }
}
