/* ThinkDrag — project page */

:root {
  --display: "Space Grotesk", "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --bg: #f6f5f2;
  --surface: #ffffff;
  --tint: #eeece6;
  --text: #16181d;
  --muted: #5d6169;
  --faint: #8f939a;
  --line: #e2dfd8;
  --handle: #3b6cf6;
  --target: #f0473f;
  --handle-soft: rgba(59, 108, 246, 0.1);
  --target-soft: rgba(240, 71, 63, 0.1);
  --think: #7c4dff;
  --think-soft: rgba(124, 77, 255, 0.09);
  --shadow: 0 1px 2px rgba(22, 24, 29, 0.05), 0 10px 26px rgba(22, 24, 29, 0.07);
  --shadow-lg: 0 2px 4px rgba(22, 24, 29, 0.06), 0 22px 54px rgba(22, 24, 29, 0.13);
  --radius: 14px;
  --maxw: 1080px;
  --prosew: 760px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: var(--handle); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--handle); outline-offset: 2px; }

/* ---------- Scroll progress (left edge) ---------- */

.progress {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  z-index: 50;
  width: 3px;
  background: var(--line);
  opacity: 0;
  transition: opacity 0.4s;
}
.progress.is-visible { opacity: 1; }
.progress span {
  display: block;
  height: 100%;
  background: linear-gradient(180deg, var(--handle), var(--think) 55%, var(--target));
  transform-origin: top;
  transform: scaleY(0);
}

/* ---------- Top nav ---------- */

.topnav {
  position: fixed;
  top: 12px;
  left: 50%;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: calc(100% - 24px);
  padding: 7px 8px 7px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  box-shadow: var(--shadow);
  transform: translate(-50%, -140%);
  transition: transform 0.45s cubic-bezier(.2, .8, .2, 1);
}
.topnav.is-visible { transform: translate(-50%, 0); }
.topnav-brand { display: flex; align-items: center; gap: 8px; font-family: var(--display); font-weight: 700; color: var(--text); white-space: nowrap; }
.topnav-brand:hover { text-decoration: none; }
.brand-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--handle); box-shadow: 9px 0 0 -2px var(--target); margin-right: 8px; }
.topnav-links { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.topnav-links::-webkit-scrollbar { display: none; }
.topnav-links a { padding: 5px 12px; border-radius: 999px; color: var(--muted); font-size: 0.86rem; font-weight: 500; white-space: nowrap; }
.topnav-links a:hover { color: var(--text); background: var(--tint); text-decoration: none; }
.topnav-links a.is-active { color: var(--handle); background: var(--handle-soft); }

/* ---------- Hero ---------- */

.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: 72px 24px 88px;
  overflow: hidden;
  background:
    radial-gradient(1200px 500px at 85% 10%, var(--handle-soft), transparent 60%),
    radial-gradient(900px 500px at 10% 100%, var(--target-soft), transparent 60%);
}
.hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.hero-bg .ga { fill: none; stroke: var(--text); stroke-width: 1.2; stroke-linecap: round; opacity: 0.16; }
.hero-bg .gh { fill: var(--handle); opacity: 0.35; }
.hero-bg .gt { fill: var(--target); opacity: 0.35; }

.hero-inner {
  position: relative;
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 44px;
}
.hero-text { display: flex; flex-direction: column; align-items: center; text-align: center; }
.hero-text .authors, .hero-text .buttons { justify-content: center; }

.kicker { margin: 0 0 14px; font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.04em; color: var(--muted); }
.title {
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(3.2rem, 7.6vw, 5.8rem);
  line-height: 0.95;
  letter-spacing: -0.035em;
}
.title-drag { position: relative; display: inline-block; color: var(--handle); }
.title-arrow { position: absolute; left: 4%; right: -14%; bottom: -0.32em; width: 110%; height: 0.42em; overflow: visible; }
.title-arrow .ta-path { fill: none; stroke: var(--text); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 200; stroke-dashoffset: 200; }
.title-arrow .ta-h { fill: var(--handle); transform-origin: 8px 30px; transform: scale(0); }
.title-arrow .ta-t { fill: var(--target); transform-origin: 190px 14px; transform: scale(0); }
.title-drag.is-go .ta-h { animation: pop 0.4s 0.2s cubic-bezier(.3, 1.6, .5, 1) forwards; }
.title-drag.is-go .ta-path { animation: draw 0.9s 0.45s cubic-bezier(.6, 0, .2, 1) forwards; }
.title-drag.is-go .ta-t { animation: pop 0.4s 1.25s cubic-bezier(.3, 1.6, .5, 1) forwards; }
@keyframes pop { to { transform: scale(1); } }
@keyframes draw { to { stroke-dashoffset: 0; } }

.subtitle { margin: 30px 0 18px; font-size: clamp(1.1rem, 1.8vw, 1.35rem); line-height: 1.4; color: var(--muted); font-weight: 500; }
.authors { margin: 0; display: flex; flex-wrap: wrap; gap: 4px 16px; font-weight: 500; }
.authors a { color: var(--text); border-bottom: 1px solid var(--line); }
.authors a:hover { text-decoration: none; border-color: var(--handle); }
.logos { display: flex; align-items: center; justify-content: center; gap: 22px; margin: 16px 0 22px; }
.logos a { display: block; opacity: 0.92; transition: opacity 0.2s, transform 0.2s; }
.logos a:hover { opacity: 1; transform: translateY(-1px); }
.logos img { width: auto; }
.logo-mmlab { height: 38px; border-radius: 4px; }
.logo-ntu { height: 40px; }

.buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  border-radius: 999px;
  background: var(--text);
  color: #fff;
  font-size: 0.92rem;
  font-weight: 500;
  transition: transform 0.2s, box-shadow 0.2s;
}
.btn svg { width: 15px; height: 15px; fill: currentColor; }
.btn:hover { text-decoration: none; transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-soon { background: transparent; color: var(--faint); border: 1px dashed var(--line); cursor: default; }
.btn-soon:hover { transform: none; box-shadow: none; }
.btn small { margin-left: 2px; padding: 1px 6px; border-radius: 999px; background: var(--tint); font-size: 0.68rem; color: var(--muted); }

/* Teaser: input | previous methods | ThinkDrag */
.teaser { width: 100%; margin: 0; }
.tz-regions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 2fr);
  padding: 18px 0;
  border-radius: 20px;
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.tz-region { padding: 0 20px; min-width: 0; }
.tz-region + .tz-region { border-left: 1.5px dashed var(--line); }
.tz-rh {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0 0 12px;
  font-family: var(--display);
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.tz-rh span { font-family: var(--mono); font-size: 0.7rem; font-weight: 500; color: var(--faint); }
.tz-r-ours .tz-rh { color: var(--handle); }
/* 40px = the padding of two regions, so every image in the teaser is the same size */
.tz-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.tz { position: relative; display: flex; flex-direction: column; min-width: 0; }
.tz-badge {
  position: absolute;
  z-index: 1;
  left: 8px;
  top: 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px 4px 8px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.76rem;
  font-weight: 600;
  box-shadow: 0 0 0 1.5px var(--think), 0 4px 12px rgba(22, 24, 29, 0.25);
}
.tz-badge svg { width: 13px; height: 13px; fill: var(--think); }
.tz-img { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--tint); box-shadow: var(--shadow); }
.tz-r-ours .tz-img { box-shadow: 0 0 0 2px color-mix(in srgb, var(--handle) 55%, transparent), var(--shadow); }
.tz-img img { width: 100%; height: 100%; object-fit: cover; transition: filter 0.9s ease, opacity 0.9s ease, transform 0.9s ease; }
.tz.is-pending .tz-img img { filter: blur(16px) saturate(0.6); opacity: 0.5; transform: scale(1.04); }
.tz-foot { min-height: 4.4em; margin: 10px 2px 0; font-size: 0.82rem; line-height: 1.45; color: var(--muted); transition: opacity 0.5s; }
.tz-foot b { color: var(--text); font-weight: 600; }
.tz.is-pending .tz-foot:not(.is-typing) { opacity: 0; }
.tz-notes { list-style: none; padding: 0; }
.tz-notes li { position: relative; padding-left: 14px; }
.tz-notes li + li { margin-top: 4px; }
.tz-notes li b { display: block; line-height: 1.3; }
.tz-notes li span { display: block; font-size: 0.94em; line-height: 1.35; }
.tz-notes li::before { content: ""; position: absolute; left: 0; top: 0.6em; width: 6px; height: 6px; border-radius: 50%; background: var(--target); }
.tz-think { font-family: var(--mono); font-size: 0.74rem; color: var(--text); }
.tz-think .tk { color: var(--think); }
.tz-d { display: inline-grid; place-items: center; width: 1.45em; height: 1.45em; margin-right: 4px; border-radius: 50%; font-size: 0.86em; font-weight: 600; vertical-align: 0.05em; }
.tz-d1 { background: var(--handle-soft); color: var(--handle); }
.tz-d2 { background: var(--target-soft); color: var(--target); }
/* Outcome tag on each output, as in the paper. */
.tz-verdict {
  position: absolute; left: 8px; bottom: 8px; z-index: 3; padding: 3px 9px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.92); box-shadow: 0 1px 4px rgba(22, 24, 29, 0.18);
  font-size: 0.74rem; font-weight: 600; color: #17805a; transition: opacity 0.5s 0.3s;
}
.tz-verdict.is-bad { color: var(--target); }
.tz.is-pending .tz-verdict { opacity: 0; transition-delay: 0s; }
.tz-prompt-text { font-style: italic; color: var(--text); }
.tz-prompt-text s { color: var(--faint); }
.tz-prompt-text .tk { font-family: var(--mono); font-style: normal; font-size: 0.74rem; color: var(--think); margin-right: 2px; }
.tz-cap { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 12px; padding: 0 6px; font-size: 0.86rem; color: var(--muted); }
.tz-replay {
  flex: none;
  padding: 4px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.8rem;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, opacity 0.3s;
}
.teaser:not(.is-done) .tz-replay { opacity: 0.4; pointer-events: none; }
.tz-replay:hover { color: var(--handle); border-color: var(--handle); }
.caret { display: inline-block; width: 7px; height: 1em; margin-left: 1px; vertical-align: -2px; background: var(--think); animation: blink 0.9s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.scroll-cue { position: absolute; left: 50%; bottom: 24px; width: 24px; height: 38px; margin-left: -12px; border: 1.5px solid var(--faint); border-radius: 12px; }
.scroll-cue span { position: absolute; left: 50%; top: 7px; width: 4px; height: 7px; margin-left: -2px; border-radius: 2px; background: var(--faint); animation: cue 1.8s ease-in-out infinite; }
@keyframes cue { 0%, 100% { transform: translateY(0); opacity: 1; } 60% { transform: translateY(12px); opacity: 0; } }

/* ---------- Sections ---------- */

.section { padding: 72px 24px; }
.section > * { max-width: var(--maxw); margin-left: auto; margin-right: auto; }
.section-tint { background: var(--tint); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.prose p { max-width: var(--prosew); margin: 0 0 1em; color: color-mix(in srgb, var(--text) 86%, var(--muted)); }
.h2 {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin: 0 0 18px;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(1.8rem, 3.6vw, 2.5rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
}
.h2 .num { font-family: var(--mono); font-size: 0.8rem; font-weight: 500; color: var(--handle); letter-spacing: 0.05em; transform: translateY(-0.4em); }

.tldr {
  position: relative;
  margin-bottom: 48px !important;
  padding: 22px 26px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.tldr::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: linear-gradient(180deg, var(--handle), var(--target)); }
.tldr p { margin: 0; font-size: 1.1rem; line-height: 1.6; }
.tldr-tag { display: inline-block; margin-bottom: 6px; font-family: var(--mono); font-size: 0.75rem; font-weight: 500; letter-spacing: 0.08em; color: var(--handle); }

.figure-card { margin: 8px auto 28px; padding: 22px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.figure-card img { width: 100%; height: auto; cursor: zoom-in; }

.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.8s ease, transform 0.8s cubic-bezier(.2, .8, .2, 1); }
.reveal.is-in { opacity: 1; transform: none; }

/* ---------- Dataset cards ---------- */

.ds-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.ds-card {
  margin: 0;
  padding: 10px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  cursor: default;
  transition: transform 0.3s cubic-bezier(.2, .8, .2, 1), box-shadow 0.3s;
}
.ds-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.ds-card h3 { display: flex; align-items: center; gap: 7px; margin: 2px 4px 9px; font-size: 0.78rem; font-weight: 600; white-space: nowrap; }
.ds-card h3::before { content: ""; flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--c); }
.c-blue { --c: #3b6cf6; }
.c-green { --c: #22a06b; }
.c-pink { --c: #e0479e; }
.c-peach { --c: #f08c3a; }
.ds-media { position: relative; aspect-ratio: 1; border-radius: 9px; overflow: hidden; background: var(--tint); }
.ds-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: opacity 0.5s ease; }
.ds-media img.out { opacity: 0; }
.ds-card.is-out .ds-media img.out { opacity: 1; }
.ds-state {
  position: absolute;
  left: 8px;
  bottom: 8px;
  display: flex;
  gap: 2px;
  padding: 2px;
  border-radius: 999px;
  background: rgba(22, 24, 29, 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.ds-state span { padding: 1px 8px; border-radius: 999px; color: rgba(255, 255, 255, 0.65); font-size: 0.68rem; font-weight: 500; transition: background 0.3s, color 0.3s; }
.ds-card:not(.is-out) .ds-state .s-in, .ds-card.is-out .ds-state .s-out { background: #fff; color: var(--text); }

/* ---------- Results blocks ---------- */

.block + .block { margin-top: 64px !important; }
.block-title { margin: 0 0 6px; font-family: var(--display); font-size: 1.35rem; font-weight: 600; letter-spacing: -0.01em; }
.block-note { max-width: var(--prosew); margin: 0 0 18px; color: var(--muted); }

.scene-picker { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.scene-picker button {
  width: 64px;
  height: 64px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface);
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.2s, border-color 0.2s, transform 0.2s;
}
.scene-picker button img { width: 100%; height: 100%; object-fit: cover; }
.scene-picker button:hover { opacity: 1; transform: translateY(-2px); }
.scene-picker button[aria-selected="true"] { opacity: 1; border-color: var(--handle); }

.cmp-row { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.cmp-cell { margin: 0; }
.cmp-cell .ph { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--surface); box-shadow: var(--shadow); cursor: zoom-in; }
.cmp-cell img { width: 100%; height: 100%; object-fit: cover; animation: fadein 0.45s ease both; }
.cmp-cell figcaption { margin-top: 8px; text-align: center; font-size: 0.82rem; font-weight: 500; color: var(--muted); }
.cmp-cell.is-input figcaption { color: var(--text); }
.cmp-cell.is-ours .ph { box-shadow: 0 0 0 2.5px var(--handle), var(--shadow-lg); }
.cmp-cell.is-ours figcaption { color: var(--handle); font-weight: 600; }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.chip {
  padding: 6px 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}
.chip:hover { color: var(--text); border-color: var(--faint); }
.chip[aria-selected="true"] { background: var(--text); border-color: var(--text); color: #fff; }

/* Reasoning */
.rs { display: grid; grid-template-columns: 1fr 1fr 1.35fr 1fr; gap: 14px; align-items: start; }
.rs-img { margin: 0; }
.rs-img img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 12px; background: var(--surface); box-shadow: var(--shadow); cursor: zoom-in; }
.rs-img figcaption { margin-top: 8px; text-align: center; font-size: 0.82rem; font-weight: 500; color: var(--muted); }
.rs-ours img { box-shadow: 0 0 0 2.5px var(--handle), var(--shadow-lg); transition: filter 0.8s ease, opacity 0.8s ease; }
.rs-ours figcaption { color: var(--handle); font-weight: 600; }
.rs.is-thinking .rs-ours img { filter: blur(12px) saturate(0.7); opacity: 0.85; }
.trace {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--think) 30%, var(--line));
  box-shadow: var(--shadow);
}
.trace-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--think); }
.trace-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--think); }
.rs.is-thinking .trace-dot { animation: blink 0.8s steps(1) infinite; }
.trace-replay { margin-left: auto; padding: 0 6px; border: 0; background: none; color: var(--faint); font-size: 0.95rem; cursor: pointer; }
.trace-replay:hover { color: var(--think); }
.trace-body { font-family: var(--mono); font-size: 0.78rem; line-height: 1.6; color: var(--text); }
.trace-body p { margin: 0 0 0.6em; }
.trace-body .d { display: inline-block; padding: 0 6px; border-radius: 5px; font-weight: 500; }
.trace-body .d1 { background: var(--handle-soft); color: var(--handle); }
.trace-body .d2 { background: var(--target-soft); color: var(--target); }
.trace-body .d3 { background: #dff3ee; color: #16806a; }
.trace-body .d0 { background: var(--think-soft); color: var(--think); }
.trace-body b { font-weight: 600; }

/* Text-guided */
.tv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.tv { display: flex; flex-direction: column; padding: 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.tv-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tv-pair figure { margin: 0; }
/* Both examples share one portrait frame; the taller candle images are cropped at the bottom. */
.tv-pair .ph { position: relative; aspect-ratio: 512 / 688; border-radius: 10px; overflow: hidden; background: var(--tint); cursor: zoom-in; }
.tv-pair img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top; transition: opacity 0.5s ease; }
/* Candle frames are 512x912 shown at 512x688: start the crop ~20px down (20 / 224 of the excess). */
.tv[data-k="text_candle"] .tv-pair img { object-position: 50% 9%; }
.tv-pair img.out { opacity: 0; transition: none; }
.tv-pair img.out.is-under { opacity: 1; }
.tv-pair img.out.is-on { opacity: 1; z-index: 1; transition: opacity 0.5s ease; }
.tv-pair figure:last-child .ph { box-shadow: 0 0 0 2px color-mix(in srgb, var(--handle) 55%, transparent); }
.tv-pair figcaption { margin-top: 8px; font-size: 0.8rem; color: var(--muted); text-align: center; }
.tv-prompts { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.tv-label { flex: none; font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--faint); }
.tv-seg {
  position: relative;
  flex: 1;
  display: grid;
  grid-template-columns: repeat(var(--n, 2), 1fr);
  padding: 3px;
  border-radius: 10px;
  background: var(--tint);
  border: 1px solid var(--line);
}
.tv-seg button {
  position: relative;
  z-index: 1;
  padding: 7px 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 0.84rem;
  font-style: italic;
  line-height: 1.3;
  cursor: pointer;
  transition: color 0.25s;
}
.tv-seg button[aria-pressed="true"] { color: var(--text); }
.tv-ind {
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 3px;
  width: calc((100% - 6px) / var(--n, 2));
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 0 0 1.5px var(--handle), 0 2px 6px rgba(22, 24, 29, 0.08);
  transition: transform 0.4s cubic-bezier(.2, .8, .2, 1);
}
.tv-ind { transform: translateX(calc(var(--i, 0) * 100%)); }

/* ---------- Drag-target overlays ---------- */

.block-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.tk-toggle {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 13px 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.tk-toggle svg { width: 15px; height: 15px; fill: currentColor; }
.tk-toggle:hover { color: var(--text); border-color: var(--faint); }
.tk-toggle[aria-pressed="true"] { color: var(--target); border-color: var(--target); background: var(--target-soft); }
.tk-layer { position: absolute; z-index: 2; overflow: visible; pointer-events: none; }
.tk-pt { opacity: 0; transform-box: fill-box; transition: opacity 0.25s ease; }
.tk-on .tk-pt { opacity: 1; }
.tk-dot { fill: #e90a0a; }
.tz-actions { display: inline-flex; gap: 8px; flex: none; }
.block-head .block-title { margin-bottom: 6px; }

/* ---------- BibTeX ---------- */

.bibtex { position: relative; }
.bibtex pre { margin: 0; padding: 22px 24px; overflow-x: auto; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); font-family: var(--mono); font-size: 0.84rem; line-height: 1.6; }
.copy { position: absolute; top: 12px; right: 12px; display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg); color: var(--muted); font-size: 0.8rem; cursor: pointer; }
.copy svg { width: 13px; height: 13px; fill: currentColor; }
.copy:hover { color: var(--text); }
.copy.is-done { color: var(--handle); border-color: var(--handle); }

.footer { padding: 24px 24px 64px; text-align: center; font-size: 0.86rem; color: var(--faint); }

/* ---------- Lightbox ---------- */

.lightbox { width: 100vw; height: 100vh; max-width: 100vw; max-height: 100vh; margin: 0; padding: 0; border: 0; background: transparent; }
.lightbox[open] { display: flex; align-items: center; justify-content: center; }
.lightbox::backdrop { background: rgba(246, 245, 242, 0.92); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.lightbox figure { margin: 0; max-width: min(1200px, 90vw); animation: fadein 0.3s ease; }
.lightbox img { max-height: 82vh; width: auto; margin: 0 auto; border-radius: 10px; background: #fff; box-shadow: var(--shadow-lg); }
.lightbox figcaption { margin-top: 12px; text-align: center; color: var(--muted); font-size: 0.92rem; }
.lb-close, .lb-nav { position: fixed; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); color: var(--text); cursor: pointer; box-shadow: var(--shadow); }
.lb-close { top: 18px; right: 18px; width: 40px; height: 40px; font-size: 1.5rem; line-height: 1; }
.lb-nav { top: 50%; width: 44px; height: 44px; margin-top: -22px; font-size: 1.6rem; line-height: 1; }
.lb-prev { left: 18px; }
.lb-next { right: 18px; }
.lightbox.is-single .lb-nav { display: none; }

/* ---------- Paper figures rebuilt as HTML (generated from the PowerPoint sources) ---------- */
@font-face { font-family: "Google Sans Static"; font-weight: 400; font-style: normal; font-display: block; src: url("../fonts/GoogleSansStatic-Regular.woff2") format("woff2"); }
@font-face { font-family: "Google Sans Static"; font-weight: 700; font-style: normal; font-display: block; src: url("../fonts/GoogleSansStatic-Bold.woff2") format("woff2"); }
@font-face { font-family: "Google Sans Static"; font-weight: 400; font-style: italic; font-display: block; src: url("../fonts/GoogleSansStatic-Italic.woff2") format("woff2"); }
@font-face { font-family: "Google Sans Static"; font-weight: 700; font-style: italic; font-display: block; src: url("../fonts/GoogleSansStatic-BoldItalic.woff2") format("woff2"); }
.pf { position: relative; container-type: inline-size; width: 100%; font-family: "Google Sans Static", sans-serif; font-weight: 400; line-height: 1.252; color: #000; font-size: 0.8cqw; text-align: left; }
.pf-s { position: absolute; box-sizing: border-box; }
.pf-i { background-repeat: no-repeat; }
.pf-v { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.pf-t { position: absolute; inset: 0; display: flex; flex-direction: column; box-sizing: border-box; }
.pf-actr { justify-content: center; }
.pf-ab { justify-content: flex-end; }
.pf-nw .pf-p { display: flex; align-items: baseline; white-space: pre; }
.pf-nw .pf-ctr { justify-content: center; }
.pf-nw .pf-r { justify-content: flex-end; }
.pf-t:not(.pf-nw) .pf-ctr { text-align: center; }
.pf-t:not(.pf-nw) .pf-r { text-align: right; }
.pf-data { aspect-ratio: 6083300 / 1025525; }
.pf-method { aspect-ratio: 6178550 / 1749425; }
.pf-scroll { overflow-x: auto; scrollbar-width: thin; }

/* Method figure: step through the flow */
.pf-flow [data-g] { cursor: pointer; transition: opacity 1.1s cubic-bezier(.37, 0, .25, 1); }
.pf-flow .is-next { opacity: 0.14; }
.pf-flow .is-done { opacity: 0.62; }
/* Parts of the current step come in one after another, left to right. */
.pf-flow .is-on { transition-delay: var(--dl, 0ms); }
.pf-flow .is-reset { opacity: 0.14; transition: opacity 0.34s ease; }
.pf-flow .pf-v.is-on path[stroke-dasharray] { animation: pf-march 0.9s linear infinite; }
@keyframes pf-march { to { stroke-dashoffset: var(--per); } }
/* Reasoning trace: each line of text is written out from left to right. */
.pf-w { align-self: flex-start; }
.pf-flow .is-on .pf-w { animation: pf-wipe 0.8s linear var(--wl) both; }
.pf-flow .is-reset .pf-w { clip-path: inset(0 100% 0 0); }
@keyframes pf-wipe { from { clip-path: inset(-10% 100% -10% 0); } to { clip-path: inset(-10% -2% -10% 0); } }
/* Edited image: a layer of noise over the picture fades out, like the denoising it stands for. */
.pf-noise { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; pointer-events: none; transition: opacity 1.1s cubic-bezier(.37, 0, .25, 1); }
.pf-flow .is-next > .pf-noise, .pf-flow .is-reset > .pf-noise { opacity: 1; }
.pf-flow .is-on .pf-noise { animation: pf-denoise 3.8s cubic-bezier(.4, 0, .6, 1) 1.3s both; }
@keyframes pf-denoise { from { opacity: 1; } to { opacity: 0; } }
.flow { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 10px 12px; margin-top: 18px; }
.flow-play {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 13px 6px 9px;
  border: 1px solid var(--text); border-radius: 999px; background: var(--text); color: #fff;
  font: inherit; font-size: 0.84rem; font-weight: 500; cursor: pointer;
}
.flow-play svg { width: 15px; height: 15px; fill: currentColor; }
.flow-play .i-stop, .flow-play.is-playing .i-play { display: none; }
.flow-play.is-playing .i-stop { display: inline; }
.flow-steps .chip em { font-style: normal; font-family: var(--mono); font-size: 0.72em; opacity: 0.65; margin-left: 8px; }
.figure-bare .flow { margin-top: 14px; }
.flow-play:hover { opacity: 0.88; }
.flow-steps { margin: 0; }
.flow-steps .chip i { font-style: normal; font-family: var(--mono); font-size: 0.72em; opacity: 0.6; margin-right: 6px; }
.flow-steps .chip { position: relative; overflow: hidden; }
.flow-steps .chip::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2.5px; background: var(--handle); transform: scaleX(0); transform-origin: left; }
.flow-steps .chip.is-running::after { animation: flow-fill var(--dur, 2.6s) linear both; }
@keyframes flow-fill { to { transform: scaleX(1); } }
/* Dataset figure. A stage is one layer, and a size container: in focus it is laid out half as large again
   (not scaled as a picture, so text and images stay sharp) and lifts above the others, which dim as whole
   layers. It is then built up part by part. */
.pf-stage {
  position: absolute; left: 0; top: 0; width: 100%; height: 100%; z-index: 1; container-type: inline-size;
  transition: left 0.85s cubic-bezier(.3, 1.2, .4, 1), top 0.85s cubic-bezier(.3, 1.2, .4, 1), width 0.85s cubic-bezier(.3, 1.2, .4, 1),
    height 0.85s cubic-bezier(.3, 1.2, .4, 1), z-index 0s 0.85s;
}
.pf-stage, .pf-stage * { pointer-events: none; }
.pf-stage .pf-panel { pointer-events: auto; cursor: pointer; transition: box-shadow 0.85s ease, border-radius 0.85s ease; }
.pf-stage.is-focus { left: calc(var(--ox) * -0.5); top: -25%; width: 150%; height: 150%; z-index: 4; transition-delay: 0s; }
.pf-stage.is-focus .pf-panel { border-radius: 0.34cqw !important; box-shadow: 0 0.14cqw 0.4cqw rgba(30, 40, 70, 0.12), 0 0.8cqw 2.4cqw rgba(30, 40, 70, 0.22); }
.pf-arrows { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.pf-arrows [data-a] { transition: opacity 0.85s cubic-bezier(.37, 0, .25, 1); }
.pf-arrows [data-s="lift"] { opacity: 0; transition-duration: 0.3s; }
.pf-arrows .is-back { transition: opacity 0.9s cubic-bezier(.37, 0, .25, 1) 0.75s; }
.pf-arrows [data-s="next"] { opacity: 0.12; }
.pf-arrows [data-s="done"] { opacity: 0.36; }
/* A stage dims under its own sheet in the page colour, so it stays opaque and hides what is behind it. */
.pf-dim { position: absolute; background: var(--tint); opacity: 0; transition: opacity 0.85s cubic-bezier(.37, 0, .25, 1); }
.pf-stage[data-s="next"] .pf-dim { opacity: 0.88; }
.pf-stage[data-s="done"] .pf-dim { opacity: 0.64; }
/* A clear sheet over each stage of the strip, to point at and click. */
.pf-flow .pf-veil { position: absolute; top: 0; bottom: 0; z-index: 3; cursor: pointer; }
/* The strip opens room above and below while a stage is lifted, and closes it again afterwards. The layer of a
   lifted stage is wider than the figure, so it is clipped just outside the figure's sides. */
.figure-bare .pf-scroll {
  padding: 0 24px; margin-inline: -24px; overflow: visible; overflow-x: clip;
  transition: padding 0.7s cubic-bezier(.4, 0, .2, 1) 0.25s;
}
.figure-bare .pf-scroll.is-open { padding-block: 4.6%; transition: padding 0.5s cubic-bezier(.2, .7, .2, 1); }
.pf-c { position: absolute; inset: 0; }
.pf-b { transition: opacity 0.6s cubic-bezier(.3, 0, .2, 1), translate 0.8s cubic-bezier(.2, .7, .2, 1), scale 0.55s cubic-bezier(.3, 1.5, .5, 1); }
.pf-b.is-pre { opacity: 0; translate: 0 0.6cqw; transition: opacity 0.22s ease, translate 0s 0.22s, scale 0s 0.22s; }
.pf-arr.is-pre { translate: -0.8cqw 0; }
.pf-pop.is-pre { translate: none; scale: 0.2; }
/* Stacked images are dealt one by one, and turn opaque quickly so they do not show through each other. */
.pf-deal { transition: opacity 0.3s ease, translate 0.7s cubic-bezier(.3, 1.3, .5, 1); }
.pf-deal.is-pre { translate: 1.6cqw -1.2cqw; }
/* The reasoning chain is written out line by line. */
.pf-type { clip-path: inset(-10% -5% -10% 0); transition: clip-path 0.38s linear; }
.pf-type.is-pre { opacity: 1; translate: none; clip-path: inset(-10% 100% -10% 0); transition: clip-path 0s; }
/* The two drags draw themselves from handle to target. */
.pf-draw line { stroke-dasharray: var(--len); transition: stroke-dashoffset 0.8s cubic-bezier(.4, 0, .2, 1); }
.pf-draw.is-pre { translate: none; }
.pf-draw.is-pre line { stroke-dashoffset: var(--len); transition: stroke-dashoffset 0s 0.22s; }
/* Count labels: one line, lifted a little so the descenders do not sit on the bottom edge. */
.pf-tag { align-items: center; white-space: nowrap; }
.pf-tag .pf-p { position: relative; top: -0.065cqw; }
/* The dataset pipeline sits straight on the page, at the full content width. */
.figure-bare { margin: 8px auto 28px; }

/* ---------- Responsive ---------- */

@media (max-width: 960px) {
  .tz-regions { grid-template-columns: 1fr 1fr; row-gap: 18px; }
  .tz-r-ours { grid-column: 1 / -1; border-left: 0 !important; border-top: 1.5px dashed var(--line); padding-top: 16px; }
  .topnav-brand { display: none; }
  .topnav { padding-left: 8px; }
  .ds-grid { grid-template-columns: repeat(2, 1fr); }
  .cmp-row { grid-template-columns: repeat(3, 1fr); }
  .rs { grid-template-columns: repeat(3, 1fr); }
  .rs .trace { grid-column: 1 / -1; order: 4; }
  .tv-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .section { padding: 56px 16px; }
  .hero { padding: 56px 16px 80px; }
  .subtitle { margin-top: 28px; }
  .tz-region { padding: 0 12px; }
  .tz-pair { gap: 24px; }
  .tz-rh { font-size: 0.92rem; }
  .tz-foot { font-size: 0.76rem; min-height: 0; }
  .tz-think { font-size: 0.68rem; }
  .tz-badge { font-size: 0.66rem; padding: 2px 7px; }
  .tz-cap { flex-direction: column; align-items: flex-start; gap: 8px; }
  .tv-label { display: none; }
  .tk-toggle { padding: 5px 10px 5px 8px; font-size: 0.76rem; }
  .tv-seg button { font-size: 0.8rem; }
  .rs { gap: 8px; }
  .rs-img figcaption { font-size: 0.74rem; }
  .figure-card { padding: 10px; }
  .ds-grid { gap: 10px; }
  .ds-card { padding: 8px; }
  .ds-card h3 { font-size: 0.78rem; }
  .cmp-row { grid-template-columns: repeat(2, 1fr); }
  .scene-picker button { width: 54px; height: 54px; }
  .lb-nav { display: none; }
  .logos img { height: 32px; }
  .buttons { gap: 6px; }
  .btn { padding: 7px 12px; font-size: 0.84rem; gap: 5px; }
  .btn small { display: none; }
  .bibtex pre { padding-top: 52px; font-size: 0.78rem; }
  .pf-data { min-width: 980px; }
  .figure-bare .pf-scroll { padding: 0; margin-inline: 0; overflow-x: auto; }
  .figure-bare .pf-scroll.is-open { padding-block: 46px; }
  .pf-method { min-width: 760px; }
  .flow { grid-template-columns: 1fr; }
  .flow-play { justify-self: start; }
  .topnav { padding: 5px; }
  .topnav-links a { padding: 5px 9px; font-size: 0.8rem; }
  .tz-rh { white-space: nowrap; font-size: 0.86rem; }
  .block-head { flex-wrap: wrap; row-gap: 4px; }
  .block-head .tk-toggle { margin-bottom: 10px; }
  .scene-picker { display: grid; grid-template-columns: repeat(6, 1fr); gap: 7px; }
  .scene-picker button { width: auto; height: auto; aspect-ratio: 1; border-radius: 10px; }
  .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline: -16px; padding-inline: 16px; }
  .chips::-webkit-scrollbar { display: none; }
  .chip { flex: none; }
  .ds-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ds-card h3 { white-space: nowrap; font-size: 0.72rem; letter-spacing: -0.01em; gap: 6px; margin-inline: 2px; }
  .kicker { font-size: 0.7rem; letter-spacing: 0.02em; }
}

@media (prefers-reduced-motion: reduce) {
  .pf-flow .pf-v.is-on path[stroke-dasharray], .flow-steps .chip.is-running::after, .pf-flow .is-on .pf-w, .pf-flow .is-on .pf-noise { animation: none; }
  .pf-flow .is-on { transition-delay: 0s; }
  .pf-b, .pf-stage, .pf-stage .pf-panel, .pf-dim, .pf-arrows [data-a], .figure-bare .pf-scroll { transition: none; }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .title-arrow .ta-path { stroke-dashoffset: 0; }
  .title-arrow .ta-h, .title-arrow .ta-t { transform: none; }
  .scroll-cue span, .caret { animation: none; }
}
