:root {
  color-scheme: dark;
  --page-bg: #0a0c11;
  --panel: #10131a;
  --panel-2: #161a23;
  --stage-top: #080a0f; /* Video background */
  --stage-bottom: #13161f;
  --text: #d6dae1;
  --strong: #f3f5f9;
  --muted: #aab1be;
  --line: #262b36;
  --line-strong: #3a4150;
  --link: #8ab4ff;
  --select: #d81b60; /* Video highlight */
  --select-text: #ff7aa8; /* Text on dark */
  --select-soft: rgba(216, 27, 96, 0.16);
  --interval: #2fbf6c; /* Video interval */
  --unist: #001c54; /* UNIST navy */
  --unist-text: #7d9fe3; /* UNIST navy, lightened for text on dark */
  --naver: #03c75a; /* NAVER green */
  --offline: #2e5fae; /* Method figure: offline */
  --offline-text: #8fb0ec; /* Text on dark */
  --online: #5b45b8; /* Method figure: online */
  --online-text: #ab9cf2;
  --card: #fff; /* Card behind white media */
  --page: 960px;
  --font-family: "Noto Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --text-label: 12px;
  --text-meta: 13px;
  --text-ui: 15px;
  --text-body: 16px;
  --text-lead: 18px;
  --text-h2: clamp(26px, 3vw, 32px);
  --leading-tight: 1.2;
  --leading-ui: 1.4;
  --leading-text: 1.55;
}

* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
  background: var(--page-bg);
}
[hidden] {
  display: none !important;
}
button:focus-visible,
a:focus-visible,
canvas:focus-visible {
  outline: 2px solid var(--select-text);
  outline-offset: 3px;
}
button:disabled {
  opacity: 0.45;
  cursor: default;
}
body {
  margin: 0;
  background: var(--page-bg);
  color: var(--text);
  font: var(--text-body) / var(--leading-text) var(--font-family);
}
a {
  color: var(--link);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}
video,
canvas,
img {
  display: block;
  max-width: 100%;
}
h1,
h2,
h3 {
  color: var(--strong);
}

/* Title */
.masthead {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 16px 8px;
  text-align: center;
}
.masthead h1 {
  margin: 0;
  font-size: clamp(28px, 3.7vw, 36px);
  font-weight: 600;
  line-height: var(--leading-tight);
}
.links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
}
.paper-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--panel);
  color: var(--text);
  font-size: var(--text-ui);
  font-weight: 500;
  line-height: var(--leading-ui);
  transition: background 150ms ease, border-color 150ms ease;
}
.paper-link svg {
  flex: none;
  color: var(--muted);
}
.paper-link:hover {
  border-color: var(--muted);
  background: var(--panel-2);
  text-decoration: none;
}

/* Sections */
main {
  padding-bottom: 56px;
}
.section {
  max-width: var(--page);
  margin: 0 auto;
  padding: 56px 16px 0;
}
#teaser {
  max-width: 1160px;
  padding-top: 22px;
}
.section-rule {
  width: calc(100% - 32px);
  max-width: 1128px;
  height: 1px;
  margin: 56px auto 0;
  border: 0;
  background: var(--line);
}
.section-rule + .section {
  padding-top: 44px;
}
#hero {
  display: block;
  width: min(100%, max(560px, calc((100svh - 415px) * 16 / 9)));
  margin: 0 auto;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line);
}
.section-title {
  margin: 0 0 14px;
  font-size: var(--text-h2);
  font-weight: 600;
  line-height: var(--leading-tight);
  text-align: center;
}
.kicker {
  margin: 0 0 8px;
  font-size: var(--text-label);
  font-weight: 600;
  text-align: center;
  color: var(--muted);
}
.kicker-where {
  color: var(--select-text);
}
.kicker-when {
  color: var(--interval);
}
h3 {
  margin: 0 0 6px;
  font-size: var(--text-lead);
  font-weight: 600;
  line-height: var(--leading-ui);
}
.note {
  margin: 14px 0 0;
  font-size: var(--text-meta);
  color: var(--muted);
  text-align: center;
}
.frame {
  width: 100%;
  border-radius: 8px;
  background: var(--stage-top);
}
.frame.bordered {
  background: var(--card);
}
.figure {
  width: 100%;
  height: auto;
  margin: 0 auto;
}

.hook-try q {
  font-weight: 500;
}
q {
  quotes: "\201c" "\201d";
}

/* Selectors */
.tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.tabs .chip {
  margin-bottom: -1px;
  padding: 8px 14px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: none;
  color: var(--muted);
  font-size: var(--text-ui);
  line-height: var(--leading-ui);
}
.tabs .chip:hover {
  color: var(--strong);
}
.tabs .chip[aria-selected="true"] {
  border-bottom-color: var(--select-text);
  background: none;
  color: var(--strong);
}

.swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 6px;
  border-radius: 2px;
  background: var(--select);
  vertical-align: 0;
}

/* Opening example */
.ask {
  max-width: 940px;
  padding-top: 24px;
  text-align: center;
}
.ask-query {
  max-width: 820px;
  margin: 0 auto 12px;
  font-size: clamp(22px, 2.5vw, 28px);
  font-weight: 500;
  line-height: var(--leading-ui);
  color: var(--strong);
  text-wrap: balance;
}
.ask-answer p {
  margin: 0 auto;
  max-width: 860px;
  font-size: var(--text-lead);
  line-height: var(--leading-text);
  text-wrap: balance;
}
.ask-examples {
  display: grid;
  justify-items: center;
  gap: 10px;
  margin: 16px auto 0;
}
.hook-try {
  display: flex;
  align-items: baseline;
  gap: 12px;
  max-width: 100%;
  padding: 10px 18px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  text-align: left;
}
.hook-try:hover {
  border-color: var(--select);
  background: var(--select-soft);
}
.hook-kind {
  flex: none;
  font-size: var(--text-label);
  font-weight: 600;
  color: var(--select-text);
  white-space: nowrap;
}
.hook-try q {
  font-size: var(--text-lead);
  line-height: var(--leading-ui);
  color: var(--strong);
}
.hook-try[data-clip] .hook-kind {
  color: var(--interval);
}
.hook-try[data-clip]:hover {
  border-color: var(--interval);
  background: rgba(47, 191, 108, 0.08);
}

/* 4D overview */
.gallery-modes {
  width: fit-content;
  max-width: 100%;
  margin: 0 0 16px;
}
.overview-heading {
  padding: 16px 20px;
}
.overview-heading p {
  margin: 0;
  font-size: var(--text-meta);
  line-height: var(--leading-text);
  color: var(--muted);
}
.overview-heading .overview-key {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 24px;
  margin: 0;
  color: var(--strong);
}
.key-where,
.key-when {
  margin-right: 5px;
  font-weight: 600;
}
.key-where {
  color: var(--select-text);
}
.key-when {
  color: var(--interval);
}
.overview-stage {
  position: relative;
  aspect-ratio: 1120 / 752;
}
.overview-stage > video {
  width: 100%;
  height: 100%;
}
.overview-people {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(var(--overview-columns, 4), minmax(0, 1fr));
  grid-template-rows: repeat(var(--overview-rows, 2), minmax(0, 1fr));
}
.overview-person {
  position: relative;
  min-width: 0;
  padding: 0;
  border: 1px solid var(--line);
  background: transparent;
  text-align: center;
}
.overview-person:hover,
.overview-person:focus-visible {
  z-index: 1;
  border-color: var(--select-text);
  box-shadow: inset 0 0 0 1px var(--select-text);
  outline-offset: -3px;
}
.overview-person-name {
  position: absolute;
  top: 7px;
  left: 8px;
  padding: 2px 5px;
  border-radius: 3px;
  background: rgba(16, 19, 26, 0.8);
  font-size: var(--text-label);
  color: var(--muted);
}
.overview-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--overview-caption);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  padding: 0 10px;
  font-size: var(--text-label);
  line-height: 1.3;
  text-align: left;
  color: var(--strong);
}
.overview-where {
  color: var(--select-text);
}
.overview-toolbar {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 68px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
}
.overview-toolbar .playback {
  flex-shrink: 0;
}
.overview-toolbar p {
  margin: 0;
  font-size: var(--text-meta);
  line-height: var(--leading-ui);
  color: var(--muted);
}
.overview-query > span {
  display: block;
  margin-bottom: 3px;
  font-size: var(--text-meta);
  color: var(--strong);
}
@media (max-width: 400px) {
  .overview-heading {
    padding: 14px;
  }
  .overview-caption {
    padding: 0 6px;
  }
  .overview-person-name {
    top: 4px;
    left: 4px;
  }
}

/* 4D explorer */
.clip-bar {
  padding: 4px 14px 12px;
  border-top: 1px solid var(--line);
  background: var(--panel);
}
#clip-people .subject-preview {
  object-fit: cover;
}
.clip-stage {
  position: relative;
  max-width: 600px;
  margin: 0 auto;
  aspect-ratio: 1;
  overflow: hidden;
  cursor: pointer;
}
.clip-stage video {
  width: 200%;
  max-width: none;
  height: 100%;
  transform: translateX(-50%);
}
.timeline {
  position: relative;
  height: 28px;
  margin-top: 10px;
  cursor: pointer;
  touch-action: none;
}
.timeline .track {
  position: absolute;
  left: 0;
  right: 0;
  top: 11px;
  height: 6px;
  border-radius: 3px;
  background: var(--line);
}
.timeline .interval {
  position: absolute;
  top: 11px;
  height: 6px;
  border-radius: 3px;
  background: var(--interval);
}
.timeline .playhead {
  position: absolute;
  top: 5px;
  width: 2px;
  height: 18px;
  margin-left: -1px;
  background: var(--strong);
}
.clip-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
}
.small {
  padding: 3px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--strong);
  font-size: var(--text-ui);
  line-height: var(--leading-ui);
}
.small:hover {
  border-color: var(--line-strong);
  background: var(--panel-2);
}
/* Related views share one neutral control; secondary actions stay quiet. */
.segmented {
  display: inline-grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}
.segmented button {
  min-height: 28px;
  padding: 4px 12px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  line-height: var(--leading-ui);
  font-weight: 500;
  white-space: nowrap;
}
.segmented button:hover {
  background: var(--panel-2);
  color: var(--strong);
}
.segmented button[aria-pressed="true"] {
  background: var(--line);
  color: var(--strong);
}
.segmented button[aria-pressed="true"]:hover {
  background: var(--line-strong);
}
.quiet {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 6px 10px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  line-height: var(--leading-ui);
  white-space: nowrap;
}
.quiet:hover {
  background: var(--panel-2);
  color: var(--strong);
}
.segmented button:focus-visible,
.quiet:focus-visible {
  outline-color: var(--strong);
}
#clip-back {
  flex-shrink: 0;
}
.playback svg {
  flex-shrink: 0;
  fill: currentColor;
}
.playback .pause-icon,
.playback.is-playing .play-icon {
  display: none;
}
.playback.is-playing .pause-icon {
  display: inline;
}

/* Comparison */
#comparison {
  aspect-ratio: 1920 / 864;
}
.comparison-tools {
  display: none;
}

/* How it works */
#method {
  max-width: 1160px;
}
.walk {
  display: grid;
  justify-items: center;
  gap: 14px;
}
.figure-card {
  position: relative;
  width: 100%;
  padding: 10px;
  border-radius: 10px;
  background: var(--card);
}
.spotlight {
  position: absolute;
  inset: 10px;
  pointer-events: none;
}
.spotlight svg {
  display: block;
  width: 100%;
  height: 100%;
}
.spotlight .dim {
  fill: rgba(8, 10, 15, 0.62);
}
.spotlight .ring {
  fill: none;
  stroke: var(--select);
  stroke-width: 3;
}
.step-flow {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
}
.step-flow li {
  display: flex;
  align-items: center;
}
/* Steps 1-3 offline, 4-7 online */
.offline {
  --phase: var(--offline);
  --phase-text: var(--offline-text);
  --phase-soft: rgba(46, 95, 174, 0.32);
}
.online {
  --phase: var(--online);
  --phase-text: var(--online-text);
  --phase-soft: rgba(91, 69, 184, 0.32);
}
.step-flow li + li::before {
  content: "";
  width: clamp(12px, 4vw, 44px);
  height: 2px;
  background: var(--phase-soft);
}
/* Offline-to-online arrow */
.step-flow li.stage-start::before {
  width: clamp(20px, 7vw, 72px);
  height: 0;
  border-top: 2px dashed var(--phase-soft);
  background: none;
}
.step-flow li.reached + li.reached::before {
  background: var(--phase);
}
.step-flow li.reached + li.reached.stage-start::before {
  background: none;
  border-top-color: var(--phase);
}
.step {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--phase);
  border-radius: 50%;
  background: var(--panel);
  color: var(--phase-text);
  font-weight: 600;
  font-size: var(--text-ui);
  line-height: 1;
  -webkit-tap-highlight-color: transparent;
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}
.step-flow li.reached .step {
  background: var(--phase-soft);
  color: #fff;
}
.step[aria-pressed="true"] {
  border-color: var(--phase);
  background: var(--phase);
  color: #fff;
  box-shadow: 0 0 0 5px var(--phase-soft);
}
@media (hover: hover) and (pointer: fine) {
  .step:hover {
    border-color: var(--phase-text);
  }
}
.step-stage {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 12px;
  width: min(100%, 780px);
}
.step-nav {
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--panel);
  color: var(--strong);
  font-size: var(--text-lead);
  -webkit-tap-highlight-color: transparent;
}
.step-nav:disabled {
  opacity: 0.3;
  cursor: default;
}
@media (hover: hover) and (pointer: fine) {
  .step-nav:not(:disabled):hover {
    border-color: var(--select-text);
    color: var(--select-text);
  }
}
.step-card {
  display: grid;
  align-items: center;
  min-height: 104px;
  overflow: hidden;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
}
/* The full diagram shows no card text; the cue is read by screen readers only */
.step-cue {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.step-card:has(.step-cue) {
  border-color: transparent;
  background: none;
}
.step-phase {
  margin: 0 0 6px;
  font-size: var(--text-label);
  font-weight: 600;
  color: var(--phase-text);
}
.step-line {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 0;
  font-size: var(--text-body);
  line-height: var(--leading-text);
  color: var(--text);
}
.step-line b {
  display: block;
  margin-bottom: 2px;
  font-weight: 600;
  color: var(--phase-text);
}
.step-number {
  flex: none;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--phase);
  color: #fff;
  font-weight: 600;
  font-size: var(--text-meta);
  line-height: 1;
}
.step-body.from-right {
  animation: step-from-right 0.32s ease;
}
.step-body.from-left {
  animation: step-from-left 0.32s ease;
}
@keyframes step-from-right {
  from {
    opacity: 0;
    transform: translateX(32px);
  }
}
@keyframes step-from-left {
  from {
    opacity: 0;
    transform: translateX(-32px);
  }
}
.method-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 16px;
}
.method-tools .small {
  min-height: 40px;
  -webkit-tap-highlight-color: transparent;
}

/* Authors */
.authors {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2px 14px;
  margin: 14px 0 0;
  font-size: var(--text-lead);
  color: var(--strong);
}
.author {
  padding: 1px 6px;
  border-radius: 4px;
  transition:
    background-color 0.2s ease,
    color 0.2s ease;
}
.author a {
  color: inherit;
  text-underline-offset: 3px;
}
.author sup,
.affiliations sup {
  margin-left: 1px;
  font-size: var(--text-label);
}
.author[data-aff="1"] sup,
.affiliation[data-aff="1"] sup {
  color: var(--unist-text);
}
.author[data-aff="2"] sup,
.affiliation[data-aff="2"] sup {
  color: var(--naver);
}
.authors.lit-1 .author[data-aff="1"] {
  background: var(--unist);
  color: #fff;
  box-shadow: 0 0 0 1px var(--unist-text);
}
.authors.lit-2 .author[data-aff="2"] {
  background: var(--naver);
  color: var(--page-bg);
}
.authors[class*="lit-"] .author sup {
  color: inherit;
}
.affiliations {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 2px 18px;
  margin: 6px 0 0;
  font-size: var(--text-ui);
  color: var(--muted);
}
.affiliation {
  padding: 1px 6px;
  border: 0;
  border-radius: 4px;
  background: none;
  color: inherit;
}
.affiliation:hover,
.affiliation:focus-visible {
  color: var(--strong);
}
/* Logos */
.aff-logos {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 36px;
  margin: 14px 0 22px;
}
.aff-logos img {
  height: 20px;
  width: auto;
}

/* 3D stage */
.explorer {
  max-width: 1160px;
  padding-top: 20px;
  scroll-margin-top: 16px;
}
.viewer {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--panel);
}
.viewer-body {
  display: grid;
  grid-template-columns: minmax(0, 1.9fr) minmax(280px, 1fr);
}
.viewer-stage {
  min-width: 0;
  background: linear-gradient(var(--stage-top), var(--stage-bottom));
}
.viewer-head {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 10px 18px;
}
.viewer-head h3 {
  flex: 1;
  margin: 0;
  text-align: left;
}
.viewer-selection {
  display: none;
}
.viewer-viewport {
  position: relative;
  height: clamp(360px, 49vh, 540px);
}
#viewer-canvas {
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: grab;
}
#viewer-canvas:active {
  cursor: grabbing;
}
.viewer-status {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px;
  background: linear-gradient(var(--stage-top), var(--stage-bottom));
  text-align: center;
  color: var(--muted);
}
.viewer-preview {
  width: min(200px, 55%);
  aspect-ratio: 1;
  background-size: 300% 300%;
  background-repeat: no-repeat;
}
.viewer-hint {
  margin: 0;
  padding: 10px 18px 14px;
  font-size: var(--text-meta);
  color: var(--muted);
}
.gesture-mobile {
  display: none;
}
.viewer-side {
  min-width: 0;
  max-height: calc(clamp(360px, 49vh, 540px) + 104px);
  overflow-y: auto;
  padding: 18px;
  border-left: 1px solid var(--line);
}
.viewer-intro {
  margin: 0 0 10px;
  font-size: var(--text-meta);
  color: var(--muted);
}
.prompt-group {
  margin: 12px 0 0;
  font-size: var(--text-label);
  font-weight: 600;
  color: var(--muted);
}
.prompt {
  display: block;
  width: 100%;
  margin-top: 5px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-2);
  color: #dde1e8;
  text-align: left;
  font-size: 14px;
  line-height: var(--leading-ui);
}
.prompt:hover {
  border-color: var(--line-strong);
  color: var(--strong);
}
.prompt[aria-pressed="true"] {
  border-color: var(--select);
  background: var(--select-soft);
  color: var(--select-text);
}
.prompt-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0 7px;
}
.prompt-row .prompt {
  width: auto;
}
#viewer-message {
  margin: 18px 0 0;
  font-size: var(--text-meta);
  color: var(--muted);
}
#viewer-message:empty {
  display: none;
}
.subject-picker {
  padding: 12px 18px 16px;
  border-top: 1px solid var(--line);
}
.subject-picker > p {
  margin: 0 0 9px;
  font-size: var(--text-meta);
  color: var(--muted);
}
.subject-hint {
  display: none;
}
.subjects {
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  gap: 8px;
}
.subject {
  min-width: 0;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 6px;
  background: var(--stage-top);
  overflow: hidden;
}
.subject:hover {
  border-color: var(--line-strong);
}
.subject[aria-pressed="true"] {
  border-color: var(--select);
}
.subject-preview {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  background-size: 300% 300%;
  background-repeat: no-repeat;
}
.subject-label {
  display: block;
  padding: 2px 4px 3px;
  font-size: var(--text-label);
  color: var(--muted);
}
.subject[aria-pressed="true"] .subject-label {
  color: var(--select-text);
}

@media (max-width: 860px), (pointer: coarse) {
  .masthead h1 {
    font-size: clamp(22px, 4.4vw, 28px);
  }
  .authors {
    margin-top: 14px;
    gap: 2px 8px;
    font-size: var(--text-body);
  }
  .affiliations {
    gap: 2px 10px;
    font-size: var(--text-meta);
  }
  .aff-logos {
    gap: 26px;
    margin: 12px 0 16px;
  }
  .aff-logos img {
    height: 16px;
  }
  .links {
    margin-top: 12px;
  }
  .ask.section {
    padding-top: 24px;
  }
  .ask-query {
    margin-bottom: 14px;
  }
  .ask-answer p {
    font-size: var(--text-body);
  }
  .ask-examples {
    justify-items: stretch;
    gap: 8px;
    margin-top: 14px;
  }
  .hook-try {
    display: block;
    padding: 7px 12px;
  }
  .hook-kind {
    display: block;
    margin-bottom: 2px;
    line-height: var(--leading-tight);
  }
  .hook-try q {
    font-size: var(--text-body);
  }
  .clip-controls {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
  }
  .clip-views button {
    padding-inline: 9px;
  }
  .clip-views {
    justify-self: end;
  }
  .small,
  .segmented button,
  .quiet,
  .prompt,
  .affiliation,
  .tabs .chip {
    min-height: 44px;
  }
  .small {
    min-width: 44px;
  }
  #comparison-full {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }
  .comparison-tools {
    display: block;
    margin-top: 6px;
  }
  .timeline {
    height: 44px;
  }
  .timeline .track,
  .timeline .interval {
    top: 19px;
  }
  .timeline .playhead {
    top: 13px;
  }
  .viewer {
    display: flex;
    flex-direction: column;
  }
  .viewer-body {
    display: contents;
  }
  .viewer-stage {
    order: 0;
    scroll-margin-top: 8px;
  }
  .viewer-selection {
    display: block;
    margin: 0;
    padding: 0 12px 10px;
    color: var(--select-text);
    font-size: var(--text-meta);
    line-height: var(--leading-ui);
  }
  .viewer-selection q {
    color: var(--strong);
  }
  .subject-picker {
    order: 1;
  }
  .viewer-viewport {
    height: clamp(260px, 38svh, 380px);
  }
  #viewer-canvas {
    touch-action: pan-y;
  }
  .gesture-desktop {
    display: none;
  }
  .gesture-mobile {
    display: inline;
  }
  .viewer-side {
    order: 2;
    max-height: none;
    border-left: 0;
    border-top: 1px solid var(--line);
  }
  .subjects {
    display: flex;
    overflow-x: auto;
    padding-bottom: 4px;
  }
  .subject-hint {
    display: block;
    margin-top: 3px;
  }
  .subject {
    flex: 0 0 72px;
  }
  .viewer-head {
    padding: 10px 12px;
    gap: 6px;
  }
  .section {
    padding-top: 44px;
  }
  .explorer {
    padding-top: 20px;
  }
  .walk {
    gap: 12px;
  }
  .figure-card {
    padding: 6px;
  }
  .step {
    width: 32px;
    height: 32px;
    font-size: var(--text-meta);
  }
  .step-stage {
    grid-template-columns: 40px minmax(0, 1fr) 40px;
    gap: 8px;
  }
  .step-nav {
    width: 40px;
    height: 40px;
  }
  .step-card {
    min-height: 128px;
    padding: 12px 14px;
  }
  .method-tools .small {
    min-height: 44px;
  }
  .spotlight {
    inset: 6px;
  }
  /* Small figure on phones: dim the rest more and draw a brighter, thicker ring */
  .spotlight .dim {
    fill: rgba(8, 10, 15, 0.86);
  }
  .spotlight .ring {
    stroke: var(--select-text);
    stroke-width: 4;
  }
}

@media (max-width: 480px) {
  .step-stage {
    grid-template-columns: 1fr 1fr;
    gap: 10px 16px;
  }
  .step-card {
    grid-column: 1 / -1;
    grid-row: 1;
  }
  #step-prev {
    justify-self: end;
  }
  #step-next {
    justify-self: start;
  }
  .authors {
    display: grid;
    grid-template-columns: repeat(2, max-content);
    gap: 4px 12px;
    font-size: clamp(14px, 3.9vw, 16px);
  }
  .author {
    padding: 1px 4px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .author,
  .step {
    transition: none;
  }
  .step-body {
    animation: none;
  }
}
/* Where pink to When green. Solid colours by default, so the name stays visible wherever
   text-clipped backgrounds are dropped (forced dark modes, high contrast, older browsers) */
.brand {
  font-weight: 700;
}
.brand-where {
  color: #ff8ab5;
}
.brand-when {
  color: #4bdc8c;
}
/* Desktop: one gradient through the light tints of the method figure */
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  @media (min-width: 861px) and (hover: hover) and (pointer: fine) and (forced-colors: none) {
    span.brand {
      font-weight: inherit;
    }
    .brand {
      background-image: linear-gradient(90deg, var(--select-text), #f6dce6 38%, #dcefe3 62%, var(--interval));
      -webkit-background-clip: text;
      background-clip: text;
      color: transparent;
    }
    .brand-where,
    .brand-when {
      color: inherit;
    }
  }
}
