/* VINE project page — clean, readable, GitHub Pages friendly (/vine) */

:root {
  --bg: #fafaf9;
  --surface: #ffffff;
  --text: #1c1917;
  --text-muted: #57534e;
  --accent: #1a1a2e;
  --accent-soft: #e7e5e4;
  --border: #e7e5e4;
  --human: #f59e0b;
  --bc: #2563eb;
  --pi1: #16a34a;
  --pi2: #8b5cf6;
  --pi3: #9f6b5f;
  --font-body: "Source Sans 3", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-title: var(--font-body);
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  --page-width: 1040px;
  --figure-width: 960px;
  --single-media-width: 720px;
}

* {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  margin: 0;
  min-height: 100vh;
}

.container {
  max-width: var(--page-width);
  margin: 0 auto;
  padding: 0 clamp(0.75rem, 2vw, 1.5rem);
}

/* Header */
.site-header {
  background: var(--accent);
  color: #fff;
  padding: 0.75rem 0;
  margin-bottom: 2rem;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.venue {
  font-weight: 600;
  letter-spacing: 0.02em;
}

.year {
  opacity: 0.9;
  font-size: 0.95rem;
}

/* Title & authors */
.paper-title {
  font-family: var(--font-title);
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 700;
  line-height: 1.25;
  margin: 0 0 0.25rem;
  color: var(--text);
}

.paper-subtitle {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin: 0 0 1.25rem;
}

.authors {
  list-style: none;
  padding: 0;
  margin: 0 0 0.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
}

.authors li {
  font-size: 1rem;
}

.authors a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.authors a:hover {
  text-decoration: underline;
}

.authors sup {
  font-size: 0.7em;
  margin-left: 0.15rem;
}

.affiliations {
  list-style: none;
  padding: 0;
  margin: 0 0 2rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.affiliations li {
  margin-bottom: 0.2rem;
}

.affiliations .note {
  margin-top: 0.5rem;
  font-size: 0.85rem;
}

.affiliations .equal {
  font-weight: 600;
  margin-left: 0.1rem;
}

/* Compact one-line affiliations */
.affiliations--compact {
  margin: 0 0 2rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.core-idea {
  margin-bottom: 2.5rem;
}

.overview-figure {
  margin-top: 1rem;
}

.core-statement {
  margin: 0 0 1rem;
  padding-left: 1rem;
  border-left: 3px solid #3b82f6;
  color: var(--text);
  font-size: 1.05rem;
  line-height: 1.55;
}

.idea-grid,
.intuition-grid,
.method-steps,
.stat-grid,
.mini-table-grid {
  display: grid;
  gap: 0.75rem;
}

.idea-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.intuition-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 1rem;
}

.critic-points {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}

.critic-points li {
  border-left: 3px solid #2563eb;
  padding: 0.15rem 0 0.15rem 0.85rem;
}

.critic-points h3 {
  margin: 0 0 0.25rem;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.25;
}

.critic-points p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.idea-card,
.intuition-grid article,
.method-steps article,
.stat-grid article {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.idea-card {
  padding: 0.85rem;
}

.intuition-grid article {
  padding: 0.85rem;
}

.idea-label {
  display: inline-block;
  margin-bottom: 0.3rem;
  color: #2563eb;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.idea-card h3,
.intuition-grid h3,
.method-steps h3 {
  margin: 0 0 0.25rem;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.25;
}

.idea-card p,
.intuition-grid p,
.method-steps p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.subsection-title {
  font-family: var(--font-body);
  font-size: 1.05rem;
  font-weight: 600;
  margin: 1.25rem 0 0.5rem;
  color: var(--text);
}

.subsection-title:first-of-type {
  margin-top: 0.5rem;
}

.ood-objects-label {
  margin-top: 0.75rem;
  margin-bottom: 0.25rem;
}

/* Hero figure — compact, no black edges */
.hero-figure {
  margin-bottom: 1.5rem;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.hero-figure img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
  vertical-align: top;
}

.caption {
  padding: 0.5rem 0.75rem;
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}

/* Buttons */
.action-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 2.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1.1rem;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: #2d2d44;
}

.btn-secondary {
  background: var(--accent-soft);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: #d6d3d1;
}

/* Sections */
section {
  margin-bottom: 2rem;
}

section h2 {
  font-family: var(--font-title);
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0 0 0.75rem;
  color: var(--text);
}

.abstract,
.algorithm-section {
  margin: 2.5rem 0;
}

.abstract > h2,
.algorithm-section > h2 {
  font-size: 1.45rem;
  line-height: 1.25;
  margin-bottom: 1rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid var(--border);
}

.abstract > p {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem 1.1rem;
  font-size: 0.98rem;
  line-height: 1.65;
}

.abstract .overview-figure {
  margin-top: 1.25rem;
}

.abstract p,
.highlights ul {
  margin: 0;
  color: var(--text);
}

.highlights ul {
  padding-left: 1.25rem;
}

.highlights li {
  margin-bottom: 0.4rem;
}

/* Section description */
.section-desc {
  margin: 0 0 1rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.task-demos-and-results {
  margin-top: 2.75rem;
}

.task-demos-and-results > h2 {
  font-size: 1.55rem;
  line-height: 1.25;
  margin-bottom: 1.2rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid var(--border);
}

.task-demos-and-results .subsection-title {
  font-size: 1.18rem;
  line-height: 1.25;
  margin: 2rem 0 0.55rem;
  padding-left: 0.65rem;
  border-left: 3px solid var(--accent);
  color: var(--text);
}

.task-demos-and-results .section-desc {
  font-size: 0.96rem;
  line-height: 1.55;
  margin-bottom: 1.1rem;
}

.math {
  color: var(--text);
  font-family: var(--font-body);
  font-style: italic;
  white-space: nowrap;
}

.math sub,
.math sup {
  font-size: 0.72em;
  line-height: 0;
}

.method-lead {
  margin: 0 0 1rem;
  color: var(--text);
}

.method-steps {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 1rem 0;
}

.method-steps article {
  padding: 0.85rem;
  position: relative;
}

.method-steps span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  margin-bottom: 0.45rem;
  border-radius: 999px;
  background: #ecfdf5;
  color: #047857;
  font-size: 0.82rem;
  font-weight: 700;
}

.comparison-table,
.metric-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  font-size: 0.9rem;
}

.comparison-table th,
.comparison-table td,
.metric-table th,
.metric-table td {
  padding: 0.55rem 0.7rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.comparison-table th,
.metric-table th {
  background: #f5f5f4;
  color: var(--text);
  font-weight: 700;
}

.comparison-table tr:last-child td,
.metric-table tr:last-child td {
  border-bottom: none;
}

.comparison-table td:nth-child(2) {
  color: #0f766e;
  font-weight: 600;
}

.stat-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0 0 1rem;
}

.stat-grid article {
  padding: 0.85rem;
}

.stat-value {
  display: block;
  color: #1d4ed8;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.1;
}

.stat-label {
  display: block;
  margin-top: 0.35rem;
  color: var(--text-muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.mini-table-grid {
  grid-template-columns: 1.35fr 1fr;
  align-items: start;
  margin-top: 0.25rem;
}

.mini-table-grid .metric-table {
  margin: 0;
}

.video-progression {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
  margin-bottom: 1rem;
}

.video-progression figure {
  margin: 0;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}

.video-progression figure video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.video-progression figure figcaption {
  padding: 0.4rem 0.6rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}

.video-progression .metric-table {
  margin: 0;
}

.demo-row-title {
  margin: 1.25rem 0 0.35rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.scroll-hint {
  margin: 0 0 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.task-demos-and-results figure figcaption {
  font-size: 0.82rem;
  line-height: 1.4;
}

.task-demos-and-results .metric-table th {
  font-size: 0.9rem;
}

/* Algorithm section (FQL-style collapsible pseudocode) */
.algorithm-section {
  margin: 2.5rem 0;
}

.algorithm-section h2 {
  margin-bottom: 1rem;
}

.algorithm-points {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
}

.algorithm-points li {
  position: relative;
  margin: 0;
  padding: 0.75rem 0.85rem 0.75rem 1.9rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.42;
}

.algorithm-points li::before {
  content: "";
  position: absolute;
  left: 0.75rem;
  top: 1rem;
  width: 0.38rem;
  height: 0.38rem;
  border-radius: 50%;
  background: var(--accent);
}

.algo-math {
  font-family: ui-monospace, "Cascadia Code", "Source Code Pro", monospace;
  font-size: 0.95em;
}

.algorithm-disclosure {
  margin: 1rem 0 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.algorithm-disclosure summary {
  cursor: pointer;
  padding: 0.95rem 1.1rem;
  font-weight: 600;
  text-align: center;
  color: #fff;
  background: var(--accent);
  list-style: none;
  user-select: none;
  transition: background 0.15s ease;
}

.algorithm-disclosure summary:hover {
  background: #2d2d44;
}

.algorithm-disclosure summary::-webkit-details-marker {
  display: none;
}

.algorithm-disclosure[open] summary {
  border-bottom: 1px solid var(--border);
  background: var(--accent);
}

.algorithm-panel {
  padding: 1.1rem 1.25rem 1.25rem;
  overflow-x: auto;
}

.offline-domains-disclosure {
  margin-top: 0.75rem;
}

.offline-domains-panel {
  padding-top: 0.85rem;
}

.offline-domains-caption {
  margin: 0 0 0.85rem;
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.table-figure-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
}

.table-figure-scroll a {
  display: block;
}

.table-figure-scroll img {
  display: block;
  width: max(100%, 1080px);
  height: auto;
}

.algorithm-caption {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  color: var(--text);
}

.algorithm-code {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: algo-line;
  font-family: ui-monospace, "Cascadia Code", "Source Code Pro", monospace;
  font-size: 0.82rem;
  line-height: 1.55;
  min-width: 680px;
}

.algorithm-code > li {
  counter-increment: algo-line;
  position: relative;
  padding-left: 2.2rem;
  margin: 0.12rem 0;
  white-space: nowrap;
}

.algorithm-code > li::before {
  content: counter(algo-line);
  position: absolute;
  left: 0;
  width: 1.6rem;
  text-align: right;
  color: var(--text-muted);
}

.algorithm-code .indent-1 {
  padding-left: 3.4rem;
}

.algorithm-code .indent-2 {
  padding-left: 4.6rem;
}

.algorithm-code .kw {
  font-weight: 700;
}

.algorithm-code .fn {
  font-weight: 600;
}

.algorithm-code .var,
.algorithm-code .dist {
  font-style: italic;
}

.algorithm-code .hvar {
  font-style: italic;
  position: relative;
  display: inline-block;
}

.algorithm-code .hvar::before {
  content: "^";
  position: absolute;
  left: -0.05em;
  top: -0.55em;
  font-size: 0.72em;
  font-style: normal;
}

.algorithm-code .algo-comment {
  margin-left: 1rem;
  color: var(--text-muted);
  font-style: italic;
  font-size: 0.92em;
}

.algorithm-code .strike-red {
  color: #dc2626;
  text-decoration: line-through;
  text-decoration-color: #dc2626;
}

.algorithm-code .strike-comment {
  color: #dc2626;
  font-style: italic;
}

.mix-viz {
  margin: 1rem 0;
  overflow-x: auto;
  padding-bottom: 0.25rem;
  -webkit-overflow-scrolling: touch;
}

.mix-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.mix-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  min-width: 680px;
}

.mix-card {
  padding: 0.75rem;
  min-width: 0;
}

.donut {
  position: relative;
  width: min(100%, 8.5rem);
  aspect-ratio: 1;
  margin: 0 auto 0.65rem;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
}

.donut::after {
  content: "";
  position: absolute;
  inset: 25%;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 0 0 1px var(--border);
}

.donut span {
  position: absolute;
  inset: 34%;
  z-index: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 700;
}

.mix-card h3 {
  margin: 0;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 700;
  text-align: center;
}

.mix-card p {
  margin: 0.1rem 0 0.5rem;
  color: var(--text-muted);
  font-size: 0.8rem;
  text-align: center;
}

.takeover-badge {
  width: fit-content;
  margin: 0 auto 0.55rem;
  padding: 0.18rem 0.45rem;
  border-radius: 999px;
  background: #fff7ed;
  color: #c2410c;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}

.mix-card ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.mix-card li {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--text-muted);
  font-size: 0.75rem;
  line-height: 1.35;
  white-space: nowrap;
}

.swatch {
  flex: 0 0 auto;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 999px;
}

.swatch-human {
  background: var(--human);
}

.swatch-bc {
  background: var(--bc);
}

.swatch-pi1 {
  background: var(--pi1);
}

.swatch-pi2 {
  background: var(--pi2);
}

.swatch-pi3 {
  background: var(--pi3);
}

/* Media rows: 1×3, 1×2, 1×1 — compact, no black bars */
.media-row {
  display: grid;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.media-row-3 {
  grid-template-columns: repeat(3, 1fr);
}

/* Horizontal scroll: one large video at a time (Task Demos, Robustness phone disturb) */
.media-row-scroll {
  display: flex;
  flex-wrap: nowrap;
  gap: 1rem;
  overflow-x: auto;
  overflow-y: hidden;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.media-row-scroll figure {
  flex: 0 0 auto;
  scroll-snap-align: start;
  min-width: min(85vw, 520px);
  max-width: min(85vw, 520px);
  margin: 0;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}

.media-row-scroll figure figcaption {
  padding: 0.4rem 0.6rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}

.media-row-scroll figure video {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.media-row-scroll figure img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.more-experiments {
  margin-top: 0.75rem;
}

.more-experiments figure video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #000;
}

.td3bc-comparison {
  margin: 0.5rem 0 1.5rem;
}

.td3bc-comparison .media-row-2 {
  grid-template-columns: repeat(2, minmax(0, 300px));
  justify-content: center;
  gap: 1rem;
  margin-bottom: 0.25rem;
}

.media-row-2 {
  grid-template-columns: repeat(2, 1fr);
}

/* Q-value: keep two curves side-by-side (parallel), show full image */
.q-value .media-row-2 {
  grid-template-columns: 1fr 1fr;
  align-items: start;
}

.q-value figure img {
  object-fit: contain;
  background: var(--surface);
}

.media-row-1 {
  grid-template-columns: 1fr;
  max-width: var(--single-media-width);
  margin-left: auto;
  margin-right: auto;
}

.media-row-wide {
  grid-template-columns: 1fr;
  width: min(var(--figure-width), calc(100vw - 1.5rem));
  max-width: none;
  margin-left: 50%;
  margin-right: 0;
  transform: translateX(-50%);
}

.media-row-wide figure {
  width: 100%;
}

/* Continuous operation: single video, allow wider for compilation */
.continuous-operation .media-row-1 {
  max-width: var(--figure-width);
}

/* Q-value: text aligns with other sections; figures smaller and centered */
.q-value .media-row-1 {
  max-width: var(--figure-width);
  margin-left: auto;
  margin-right: auto;
}

/* Center all media rows (video/image blocks) within section */
.media-row {
  justify-items: center;
}

.media-row figure {
  margin: 0;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}

/* Video: fill fixed aspect ratio, no black letterboxing */
.media-row figure video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  vertical-align: top;
}

.td3bc-comparison .media-row figure {
  width: 100%;
  max-width: 300px;
}

.td3bc-comparison .media-row figure video {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  background: #fff;
}

.media-row figure img {
  display: block;
  width: 100%;
  height: auto;
  vertical-align: top;
  object-fit: cover;
}

.media-row figure object {
  display: block;
  width: 100%;
  min-height: 280px;
  background: var(--surface);
  vertical-align: top;
}

/* Final Results: no border around PDF embeds (avoid black frame) */
.final-results figure {
  border: none;
  box-shadow: none;
}

.final-results figure object {
  border: none;
  outline: none;
}

.media-row figure figcaption {
  padding: 0.4rem 0.6rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}

.plot-figure a {
  display: block;
  width: 100%;
}

.plot-figure img {
  object-fit: contain;
  background: var(--surface);
}

/* Method section: intro + teaser */
.method .hero-figure {
  margin-top: 1rem;
}

.method .method-lead {
  color: var(--text);
}

/* Citation */
.bibtex {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin: 0;
  overflow-x: auto;
  font-family: ui-monospace, "Cascadia Code", "Source Code Pro", monospace;
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--text);
}

.bibtex code {
  white-space: pre;
}

/* Footer */
.site-footer {
  padding: 2rem 0 3rem;
  border-top: 1px solid var(--border);
  margin-top: 2rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.site-footer p {
  margin: 0;
}

@media (max-width: 640px) {
  .action-links {
    flex-direction: column;
  }

  .btn {
    justify-content: center;
  }

  .media-row-3,
  .media-row-2 {
    grid-template-columns: 1fr;
  }

  .media-row-1 {
    max-width: none;
  }

  .media-row-wide {
    max-width: none;
  }

  .idea-grid,
  .intuition-grid,
  .critic-points,
  .method-steps,
  .algorithm-points,
  .stat-grid,
  .mini-table-grid {
    grid-template-columns: 1fr;
  }

  .video-progression {
    grid-template-columns: 1fr;
  }

  .comparison-table,
  .metric-table {
    font-size: 0.85rem;
  }
}
