/* SoftAE project page. Method colours follow the paper's figures. Random's yellow is
   darkened from #f1d933 so marks stay visible on white; labels always carry the name. */
:root {
  color-scheme: light;
  --paper: #f6f5f1;
  --paper-2: #efede6;
  --surface: #ffffff;
  --ink: #16181d;
  --ink-2: #3b404a;
  --muted: #646a75;
  --line: #e3e0d8;
  --line-2: #cfcabf;
  --random: #d4b014;
  --task: #4197bf;
  --softae: #d64059;
  --rose: #f2a0ab;
  --arm: #988fd9;
  --night: #121418;
  --serif: 'Newsreader', Georgia, 'Times New Roman', serif;
  --sans: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
  --gutter: clamp(16px, 4vw, 56px);
  --maxw: 1240px;
  --radius: 14px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 1.0625rem/1.65 var(--sans); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
img, svg, canvas { display: block; max-width: 100%; }
h1, h2, h3, p, figure, dl, dd, ol, ul { margin: 0; }
ol[role='list'], ul[role='list'] { list-style: none; padding: 0; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--softae); outline-offset: 3px; border-radius: 4px; }
::selection { background: #f7c7cf; }
[hidden] { display: none !important; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.wrap { width: 100%; max-width: calc(var(--maxw) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }
.skip-link { position: fixed; left: 12px; top: -80px; z-index: 50; padding: 10px 14px; border-radius: 8px; background: var(--ink); color: var(--paper); }
.skip-link:focus { top: 12px; }

/* Shared pieces */
.dot { display: inline-block; flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--c, var(--muted)); }
.dot-random { --c: var(--random); }
.dot-task { --c: var(--task); }
.dot-softae { --c: var(--softae); }
.kicker { font: 500 .75rem/1.4 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--softae); }
.eyebrow { display: flex; align-items: center; gap: 12px; font: 500 .75rem/1.4 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.eyebrow .num { color: var(--softae); border: 1px solid var(--line-2); border-radius: 4px; padding: 1px 7px; letter-spacing: 0; }
.fig-tag { display: inline-block; margin-right: 6px; padding: 1px 6px; border: 1px solid var(--line-2); border-radius: 4px; font: 500 .6875rem/1.5 var(--mono); letter-spacing: .02em; color: var(--ink-2); white-space: nowrap; vertical-align: 1px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 20px; border: 1px solid var(--line-2); border-radius: 999px; background: transparent; color: var(--ink); font: 600 .9375rem/1 var(--sans); text-decoration: none; cursor: pointer; transition: background-color .2s, border-color .2s, transform .2s; }
.btn:hover { border-color: var(--ink); transform: translateY(-1px); }
.btn-primary { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.btn-primary:hover { background: #2c3039; }
.btn-quiet { border-color: transparent; text-decoration: underline; text-underline-offset: 4px; }
.btn-note { font: 500 .6875rem/1 var(--mono); letter-spacing: .04em; text-transform: uppercase; opacity: .7; }
.chip { display: inline-flex; align-items: center; justify-content: center; min-height: 32px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--surface); font: 600 .8125rem/1 var(--sans); cursor: pointer; transition: background-color .2s, color .2s, border-color .2s; }
.chip:hover { border-color: var(--ink); }
.chip[aria-pressed='true'] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.chip-group { display: inline-flex; gap: 4px; }
.text-link { display: inline-flex; align-items: center; gap: 6px; padding: 0; border: 0; background: none; color: var(--ink); font-weight: 600; text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 4px; cursor: pointer; }
.text-link:hover { text-decoration-color: var(--softae); }
.card, .chart-card, .platform-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.zoomable { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; border-radius: 8px; }
.zoomable img { width: 100%; height: auto; border-radius: 8px; }
figcaption { font-size: .875rem; line-height: 1.6; color: var(--muted); }

/* Header */
.site-header { position: sticky; top: 0; z-index: 30; background: rgba(246, 245, 241, .86); border-bottom: 1px solid var(--line); -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; max-width: calc(var(--maxw) + 2 * var(--gutter)); min-height: 68px; margin-inline: auto; padding-inline: var(--gutter); }
.wordmark { display: inline-flex; align-items: center; gap: 10px; font: 700 1.125rem/1 var(--sans); letter-spacing: -.01em; text-decoration: none; }
.wordmark b { color: var(--softae); font-weight: 700; }
.site-header nav { display: flex; gap: 28px; font-size: .9375rem; color: var(--ink-2); }
.site-header nav a { text-decoration: none; }
.site-header nav a:hover { color: var(--softae); }
.institution-logos { display: flex; align-items: center; gap: 18px; }
.institution-logos a { display: block; }
.institution-logos a + a { padding-left: 18px; border-left: 1px solid var(--line-2); }
.institution-logos img { width: auto; height: 30px; }
.institution-logos a + a img { height: 26px; }

/* Hero */
.hero { display: grid; grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr); gap: clamp(32px, 5vw, 64px); align-items: start; padding-top: clamp(36px, 6vw, 72px); padding-bottom: clamp(48px, 6vw, 72px); }
.hero-copy { padding-top: 6px; }
.venue { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font: 500 .8125rem/1.4 var(--mono); letter-spacing: .04em; color: var(--ink-2); }
.venue-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--softae); box-shadow: 0 0 0 4px rgba(214, 64, 89, .16); }
.pill { padding: 3px 9px; border-radius: 999px; background: var(--ink); color: var(--paper); font: 500 .6875rem/1.3 var(--mono); letter-spacing: .06em; text-transform: uppercase; }
h1 { margin: 22px 0 22px; font: 500 clamp(2.5rem, 4.6vw, 4.35rem)/1.03 var(--serif); letter-spacing: -.022em; font-variation-settings: 'opsz' 72; text-wrap: balance; }
.lead { max-width: 36em; font-size: clamp(1.0625rem, 1.35vw, 1.1875rem); line-height: 1.6; color: var(--ink-2); }
.lead strong { color: var(--ink); }
.authors { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 26px 0 0; padding: 0; list-style: none; font-weight: 500; font-size: 1rem; }
.authors a { text-decoration-color: var(--line-2); }
.authors a:hover { text-decoration-color: var(--softae); }
.authors sup, .affiliations sup { margin-left: 1px; font: 500 .6875rem/1 var(--mono); color: var(--muted); }
.affiliation-logos { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 14px 30px; margin: 20px 0 0; padding: 0; list-style: none; }
.affiliation-logos li { display: flex; align-items: flex-start; gap: 4px; }
.affiliation-logos sup { font: 500 .6875rem/1 var(--mono); color: var(--muted); }
/* Logos share a bottom line so the names under them line up. */
.aff { display: flex; flex-direction: column; gap: 7px; color: var(--muted); font-size: .8125rem; line-height: 1.3; text-decoration: none; }
.aff:hover { color: var(--ink); }
.aff-logo { display: flex; align-items: flex-end; height: 40px; opacity: .88; transition: opacity .2s; }
.aff:hover .aff-logo { opacity: 1; }
.aff-logo img { width: auto; }
.aff-srl { height: 26px; }
.aff-las { height: 31px; }
.aff-ai { height: 40px; }
.affiliations { margin-top: 12px; font-size: .875rem; color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 30px; }

/* Explorer */
.explorer { padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 24px 48px -32px rgba(22, 24, 29, .28); }
.explorer-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px 16px; margin: 2px 2px 14px; }
.explorer-title { margin-top: 6px; font: 600 1.1875rem/1.25 var(--sans); letter-spacing: -.01em; }
.explorer-controls { display: flex; flex-wrap: wrap; gap: 6px; }
.explorer-stage { position: relative; aspect-ratio: 16 / 10; overflow: hidden; border-radius: 12px; background: linear-gradient(#fbfbfc, #eceef2); }
.explorer-canvas { width: 100%; height: 100%; }
.explorer-fallback { width: 100%; height: 100%; object-fit: contain; background: var(--surface); }
.explorer-hud, .hud-keys { position: absolute; pointer-events: none; font: 500 .75rem/1.3 var(--mono); color: var(--ink-2); }
.explorer-hud { left: 10px; right: 10px; bottom: 10px; display: flex; }
.hud-episode, .hud-keys { padding: 5px 9px; border-radius: 6px; background: rgba(255, 255, 255, .82); }
/* The legend sits in the empty top corner so the episode slider can use the whole bottom row. */
.hud-keys { top: 10px; right: 10px; display: inline-flex; flex-wrap: wrap; gap: 12px; }
.hud-episode { flex: 1 1 auto; display: flex; align-items: center; gap: 12px; min-width: 0; padding-block: 2px; }
.hud-episode > span { flex: none; }
.hud-episode b { display: inline-block; min-width: 3ch; text-align: right; }
/* A 24 px hit area around a 4 px track; --p is the played fraction, set by replay.js. */
.hud-scrub { flex: 1 1 auto; min-width: 0; height: 24px; margin: 0; background: transparent; cursor: pointer; pointer-events: auto; -webkit-appearance: none; appearance: none; }
.hud-scrub::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: linear-gradient(var(--ink-2), var(--ink-2)) 0 0 / calc(var(--p, 0) * (100% - 14px) + 7px) 100% no-repeat, var(--line-2); }
.hud-scrub::-webkit-slider-thumb { width: 14px; height: 14px; margin-top: -5px; border: 2px solid var(--surface); border-radius: 50%; background: var(--ink); box-shadow: 0 1px 3px rgba(22, 24, 29, .3); -webkit-appearance: none; appearance: none; }
.hud-scrub::-moz-range-track { height: 4px; border-radius: 2px; background: var(--line-2); }
.hud-scrub::-moz-range-progress { height: 4px; border-radius: 2px; background: var(--ink-2); }
.hud-scrub::-moz-range-thumb { width: 10px; height: 10px; border: 2px solid var(--surface); border-radius: 50%; background: var(--ink); box-shadow: 0 1px 3px rgba(22, 24, 29, .3); }
.hud-keys > span { display: inline-flex; align-items: center; gap: 6px; }
.key-arm { width: 16px; height: 4px; border-radius: 2px; background: var(--arm); }
.key-dots { width: 14px; height: 10px; background: radial-gradient(circle, var(--ink-2) 1.6px, transparent 2px) 0 0 / 5px 5px; }
.explorer-methods { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.method-card { display: flex; flex-direction: column; gap: 3px; min-width: 0; padding: 8px 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); text-align: left; cursor: pointer; transition: border-color .2s, background-color .2s, box-shadow .2s; }
.method-card:hover { border-color: var(--line-2); }
.method-card[aria-pressed='true'] { border-color: var(--ink); background: var(--surface); box-shadow: inset 0 3px 0 var(--c, var(--ink)); }
.method-card[data-method='random'] { --c: var(--random); }
.method-card[data-method='hucrl'] { --c: var(--task); }
.method-card[data-method='softae'] { --c: var(--softae); }
.mini-wrap { position: relative; display: block; aspect-ratio: 120 / 64; margin-bottom: 4px; overflow: hidden; border-radius: 6px; background: #f1efe9; }
.mini-map { position: absolute; inset: 0; width: 100%; height: 100%; }
.method-name { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: .875rem; line-height: 1.3; }
.method-desc { font-size: .75rem; line-height: 1.35; color: var(--muted); }
.explorer-note { margin: 12px 2px 0; font-size: .8125rem; }

/* Key numbers */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); padding-block: 0 clamp(56px, 7vw, 88px); }
.stat { padding: 26px 26px 4px; border-top: 1px solid var(--ink); border-left: 1px solid var(--line); }
.stat:first-child { padding-left: 0; border-left: 0; }
.stat-value { font: 600 clamp(2.4rem, 4vw, 3.4rem)/1 var(--sans); letter-spacing: -.035em; }
.stat-label { max-width: 22em; margin-top: 12px; font-size: .9375rem; line-height: 1.55; color: var(--muted); }
.stat-open { display: block; width: 100%; padding: 0; border: 0; background: none; color: inherit; text-align: left; cursor: pointer; }
.stat-open .stat-value, .stat-open .stat-label { display: block; }
.stat-open .stat-value { transition: color .2s; }
.stat-open:hover .stat-value { color: var(--softae); }
.stat-more { display: inline-flex; align-items: center; gap: 6px; margin-top: 14px; font: 500 .75rem/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--softae); }
.stat-open:hover .stat-more { text-decoration: underline; text-underline-offset: 3px; }

/* Film band */
.film { padding-block: clamp(64px, 8vw, 112px); background: var(--night); color: #f2f1ec; }
.film .eyebrow { color: #a9adb6; }
.film-head { display: grid; grid-template-columns: 1fr 1fr; gap: 24px 64px; align-items: end; margin-bottom: 32px; }
.film h2 { margin-top: 16px; font: 500 clamp(2.1rem, 3.6vw, 3.25rem)/1.06 var(--serif); letter-spacing: -.018em; }
.film-head > p { max-width: 30em; color: #b9bdc5; }
.yt-player { position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 14px; background: #000; color: #fff; text-decoration: none; }
.yt-player img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease, opacity .3s; }
.yt-player:hover img { transform: scale(1.015); opacity: .92; }
.yt-player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.yt-play { position: absolute; left: 50%; top: 50%; width: 84px; height: 84px; margin: -42px 0 0 -42px; border-radius: 50%; background: rgba(255, 255, 255, .94); box-shadow: 0 12px 30px rgba(0, 0, 0, .3); transition: transform .25s; }
.yt-play::after { content: ''; position: absolute; left: 34px; top: 27px; border-style: solid; border-width: 15px 0 15px 24px; border-color: transparent transparent transparent var(--ink); }
.yt-player:hover .yt-play { transform: scale(1.06); }
.yt-label { position: absolute; left: 16px; bottom: 14px; display: flex; flex-direction: column; padding: 8px 12px; border-radius: 8px; background: rgba(18, 20, 24, .92); font-weight: 600; font-size: .9375rem; line-height: 1.3; }
.yt-label small { font: 400 .75rem/1.4 var(--mono); color: #c7cad1; }
.letters { margin-top: 28px; }
.letters img { width: 100%; height: auto; border-radius: 10px; }
.letters figcaption { margin-top: 12px; color: #a9adb6; }
.letters .fig-tag { border-color: #4a4f59; color: #d6d8dd; }

/* Sections */
.section { padding-block: clamp(72px, 9vw, 120px); border-top: 1px solid var(--line); }
.section-alt { background: var(--paper-2); }
.section-head { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr); gap: 24px 64px; align-items: end; margin: 22px 0 clamp(36px, 5vw, 52px); }
.section h2, .paper-section h2 { font: 500 clamp(2.1rem, 3.6vw, 3.25rem)/1.06 var(--serif); letter-spacing: -.018em; text-wrap: balance; }
.section-head > p { max-width: 34em; color: var(--ink-2); }
.figure-note { margin-top: 18px; font-size: .875rem; color: var(--muted); }

/* 01 Idea */
.concepts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.concept { display: flex; flex-direction: column; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.concept img { width: 100%; height: auto; background: #f2f3f4; }
.concept h3 { display: flex; align-items: center; gap: 9px; margin: 20px 22px 0; font: 600 1.125rem/1.3 var(--sans); }
.concept p { margin: 8px 22px 24px; font-size: .9375rem; color: var(--muted); }
.concept-ours { border-color: rgba(214, 64, 89, .55); box-shadow: 0 0 0 3px rgba(214, 64, 89, .08); }

/* 02 Method */
.loop { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px; margin: 0; padding: 0; list-style: none; counter-reset: loop; }
.loop li { position: relative; padding: 22px 22px 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.loop li:not(:last-child)::after { content: '→'; position: absolute; right: -22px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 1.125rem; }
.loop li:last-child::after { content: '↺ repeat'; position: absolute; right: 18px; top: 18px; font: 500 .6875rem/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.loop-step { font: 500 .75rem/1 var(--mono); color: var(--softae); }
.loop h3 { margin-top: 12px; font: 600 1.125rem/1.3 var(--sans); }
.loop p { margin-top: 8px; font-size: .9375rem; color: var(--muted); }
.zero-shot { display: grid; grid-template-columns: 220px 1fr; gap: 12px 32px; align-items: baseline; margin-top: 18px; padding: 24px 28px; border-radius: var(--radius); background: var(--ink); color: #f2f1ec; }
.zero-shot-label { font: 500 .8125rem/1.4 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: #f39aaa; }
.zero-shot p:last-child { font-size: 1.125rem; line-height: 1.55; }
.method-more { margin-top: 18px; font-size: .9375rem; color: var(--muted); }
.method-more a { color: var(--ink); font-weight: 600; text-decoration-color: var(--line-2); }
.method-more a:hover { text-decoration-color: var(--softae); }

/* 03 Results */
.method-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 22px; margin-bottom: 18px; font-size: .875rem; color: var(--ink-2); }
.method-legend > span { display: inline-flex; align-items: center; gap: 8px; }
.legend-note { margin-left: auto; color: var(--muted); }
.legend-note b, .specs b { color: var(--softae); font-weight: 600; }
.tablist { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.tablist [role='tab'] { display: grid; grid-template-columns: 96px 1fr; align-items: center; gap: 14px; min-width: 0; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: transparent; text-align: left; cursor: pointer; transition: background-color .2s, border-color .2s; }
.tablist [role='tab'] img { width: 96px; height: 64px; object-fit: contain; border-radius: 8px; background: #f3f3f3; }
.tablist [role='tab'] span { display: flex; flex-direction: column; min-width: 0; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; -webkit-hyphens: auto; hyphens: auto; }
.tablist [role='tab'] small { margin-top: 3px; font: 400 .75rem/1.3 var(--mono); color: var(--muted); }
.tablist [role='tab']:hover { border-color: var(--line-2); background: rgba(255, 255, 255, .6); }
.tablist [role='tab'][aria-selected='true'] { border-color: var(--ink); background: var(--surface); box-shadow: inset 0 -3px 0 var(--ink); }
.tabpanel { display: grid; grid-template-columns: minmax(0, .72fr) minmax(0, 1.6fr); gap: 20px; align-items: start; margin-top: 20px; }
.tabpanel + .tabpanel { margin-top: 40px; }
.platforms.is-enhanced .tabpanel + .tabpanel { margin-top: 20px; }
/* The real-hardware tab ends with a full-width note. */
.panel-note { grid-column: 1 / -1; padding-top: 16px; border-top: 1px solid var(--line); font-size: .9375rem; color: var(--muted); }
.panel-note b { color: var(--ink); }
.platform-card { display: flex; flex-direction: column; gap: 16px; padding: 22px; }
.platform-card h3 { font: 600 1.1875rem/1.3 var(--sans); }
.specs { display: grid; gap: 10px; }
.specs > div { display: grid; grid-template-columns: 104px 1fr; gap: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.specs dt { font: 500 .6875rem/1.7 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.specs dd { font-size: .9375rem; line-height: 1.5; }
/* Each tab leads with its supplementary movie; the paper's figures open from the links under it. */
.result-media { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.takeaway { padding-left: 14px; border-left: 3px solid var(--softae); color: var(--ink-2); }
.fig-links { display: flex; flex-wrap: wrap; gap: 8px; }
.fig-link { display: inline-flex; align-items: center; min-height: 38px; padding: 6px 12px 6px 6px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); font-size: .875rem; font-weight: 500; line-height: 1.3; text-align: left; text-decoration: none; cursor: zoom-in; transition: border-color .2s; }
.fig-link[data-dialog] { cursor: pointer; }
.fig-link:hover { border-color: var(--ink); }
.fig-link > [aria-hidden] { margin-left: 5px; color: var(--muted); }

/* Native chart cards */
.chart-card { padding: 22px 22px 18px; }
.chart-title { font: 600 1.0625rem/1.35 var(--sans); }
.chart-sub { margin-top: 4px; font-size: .8125rem; color: var(--muted); }
.chart-callout { margin-top: 16px; font-size: .9375rem; color: var(--ink-2); }
.chart-callout strong { color: var(--ink); }
.chart-card figcaption { margin-top: 10px; font-size: .8125rem; }
/* Horizontal bars, used for the model-error chart behind the 4.6× key number */
.bars { --name: 92px; --end: 56px; position: relative; margin-top: 18px; }
.bars::before { content: ''; position: absolute; top: 0; bottom: 26px; left: var(--name); right: var(--end); background: linear-gradient(90deg, var(--line) 1px, transparent 1px) 0 0 / 25% 100% repeat-x; pointer-events: none; }
.bar-row { position: relative; display: grid; grid-template-columns: var(--name) 1fr; align-items: center; height: 42px; }
.bar-name { display: inline-flex; align-items: center; gap: 8px; font-size: .875rem; color: var(--ink-2); }
.bar-track { position: relative; height: 22px; margin-right: var(--end); }
.bar { position: absolute; left: 0; top: 0; bottom: 0; width: var(--w); border-radius: 0 4px 4px 0; background: var(--c); }
.bar-random { --c: var(--random); }
.bar-task { --c: var(--task); }
.bar-softae { --c: var(--softae); }
.bar-value { position: absolute; left: calc(var(--w) + 8px); top: 50%; transform: translateY(-50%); font: 500 .8125rem/1 var(--mono); color: var(--ink); white-space: nowrap; }
.bar-axis { display: flex; justify-content: space-between; margin: 6px var(--end) 0 var(--name); font: 400 .6875rem/1 var(--mono); color: var(--muted); }
.bar-axis span { width: 0; display: flex; justify-content: center; }

/* 04 Stress */
.stress-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.card { display: flex; flex-direction: column; padding: 16px 16px 22px; }
.card-tag { margin-top: 14px; }
.card h3 { margin-top: 8px; font: 600 1.125rem/1.3 var(--sans); }
.card p:last-child { margin-top: 6px; font-size: .9375rem; color: var(--muted); }
.aside-note { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); font-size: .9375rem; color: var(--muted); }
.aside-note b { color: var(--ink); }

/* Tip-error range chart behind the 2.0 mm key number */
.range-chart { width: 100%; height: auto; margin-top: 14px; overflow: visible; }
.range-chart .grid path { stroke: var(--line); stroke-width: 1; }
.range-chart .baseline { stroke: var(--line-2); stroke-width: 1; }
.range-chart .ticks text { font: 400 11px var(--mono); fill: var(--muted); text-anchor: middle; }
.range-chart .name { font: 500 14px var(--sans); fill: var(--ink-2); }
.range-chart .strong { font-weight: 700; fill: var(--ink); }
.range-chart .val { font: 500 12.5px var(--mono); fill: var(--ink); paint-order: stroke; stroke: var(--surface); stroke-width: 4px; stroke-linejoin: round; }
.range-chart .val.muted { fill: var(--muted); font-weight: 400; }
.range-chart .range { stroke-width: 3; stroke-linecap: round; fill: none; }
.range-chart .mean { stroke: var(--surface); stroke-width: 2; }
.range-chart .random { stroke: var(--random); }
.range-chart .task { stroke: var(--task); }
.range-chart .softae { stroke: var(--softae); }
.range-chart circle.random { fill: var(--random); }
.range-chart circle.task { fill: var(--task); }
.range-chart circle.softae { fill: var(--softae); }
.range-chart circle.mean { stroke: var(--surface); }
.range-chart .key { stroke: none; }
.range-chart .hit { fill: transparent; }
.range-chart .row { outline: none; }
.range-chart .row:hover .hit, .range-chart .row:focus-visible .hit { fill: rgba(22, 24, 29, .04); }
.range-chart .row:focus-visible .hit { stroke: var(--softae); stroke-width: 1.5; }
.key-mean, .key-range { display: inline-block; vertical-align: -1px; margin: 0 4px 0 2px; }
.key-mean { width: 9px; height: 9px; border-radius: 50%; background: var(--ink-2); }
.key-range { width: 18px; height: 3px; margin-left: 10px; border-radius: 2px; background: var(--ink-2); vertical-align: 2px; }

/* 05 Paper */
.paper-section { padding-block: clamp(72px, 9vw, 120px); border-top: 1px solid var(--line); }
.paper-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .9fr); gap: 32px 56px; align-items: start; margin-top: 22px; }
.paper-full-title { margin-top: 22px; font: 400 1.375rem/1.35 var(--serif); font-style: italic; }
.paper-authors { margin-top: 12px; color: var(--ink-2); }
.paper-venue { margin-top: 6px; font-size: .9375rem; color: var(--muted); }
.code-card { padding: 26px 26px 24px; border-radius: var(--radius); background: var(--ink); color: #f2f1ec; }
.code-card .kicker { color: #f39aaa; }
.code-card h3 { margin-top: 10px; font: 500 1.5rem/1.2 var(--serif); }
.code-card ul { display: grid; gap: 8px; margin: 16px 0 20px; padding: 0; list-style: none; font-size: .9375rem; color: #c9ccd3; }
.code-card li { position: relative; padding-left: 22px; }
.code-card li::before { content: '✓'; position: absolute; left: 0; color: #f39aaa; }
.code-card .text-link { color: #f2f1ec; text-decoration-color: #5b606b; overflow-wrap: anywhere; }
.abstract { margin-top: clamp(40px, 5vw, 64px); border-top: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); }
.abstract summary { display: flex; justify-content: space-between; align-items: center; padding: 20px 0; list-style: none; cursor: pointer; font: 500 1.375rem/1.2 var(--serif); }
.abstract summary::-webkit-details-marker { display: none; }
.abstract summary span { font: 400 1.5rem/1 var(--sans); color: var(--softae); transition: transform .2s; }
.abstract[open] summary span { transform: rotate(45deg); }
.abstract p { max-width: 62em; padding-bottom: 26px; color: var(--ink-2); }
.citation { margin-top: 36px; }
.citation-top { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.citation-top h3 { font: 600 1.125rem/1.3 var(--sans); }
.citation pre { margin: 14px 0 0; padding: 22px 24px; overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); font: 400 .8125rem/1.75 var(--mono); color: var(--ink-2); }
.contact { margin-top: 28px; color: var(--muted); }

/* Footer */
.site-footer { border-top: 1px solid var(--line); background: var(--paper); }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 28px; max-width: calc(var(--maxw) + 2 * var(--gutter)); margin-inline: auto; padding: 28px var(--gutter) 36px; font-size: .8125rem; color: var(--muted); }
.footer-inner .wordmark { font-size: 1rem; color: var(--ink); }
.footer-inner a { text-decoration-color: var(--line-2); }

/* Dialogs and tooltip */
.media-dialog { width: min(1100px, 94vw); max-height: 92vh; padding: 0; border: 0; border-radius: 14px; background: #0f1114; color: #f2f1ec; box-shadow: 0 30px 80px rgba(0, 0, 0, .45); }
.media-dialog::backdrop { background: rgba(10, 11, 14, .74); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.dialog-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 10px 10px 18px; }
.dialog-bar h2 { font: 600 .9375rem/1.3 var(--sans); }
.dialog-close { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border: 1px solid #3b3f48; border-radius: 50%; background: transparent; color: inherit; cursor: pointer; }
.dialog-close:hover { background: #262a31; }
.media-dialog--figure { width: auto; max-width: 96vw; background: var(--surface); color: var(--ink); }
.media-dialog--chart { width: min(620px, 94vw); background: var(--surface); color: var(--ink); }
.media-dialog--chart .dialog-bar { padding: 14px 12px 0 22px; }
.media-dialog--chart .dialog-bar h2 { font: 600 1.0625rem/1.35 var(--sans); }
.media-dialog--chart .dialog-close { border-color: var(--line-2); }
.media-dialog--chart .dialog-close:hover { background: var(--paper); }
.dialog-body { padding: 0 22px 22px; }
.dialog-note { margin-top: 12px; font-size: .8125rem; line-height: 1.55; color: var(--muted); }
.media-dialog--tasks { width: min(700px, 94vw); }
.dagger { color: var(--softae); font-weight: 600; }
.task-table { width: 100%; margin-top: 14px; border-collapse: collapse; font-size: .875rem; line-height: 1.45; }
.task-table th, .task-table td { padding: 10px 10px 10px 0; border-top: 1px solid var(--line); text-align: left; vertical-align: top; }
.task-table thead th { padding-top: 0; border-top: 0; font: 500 .6875rem/1.4 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.task-table tbody th { width: 32%; font-weight: 600; }
.task-table tbody th small { display: block; margin-top: 2px; font: 400 .75rem/1.3 var(--mono); color: var(--muted); }
.task-table ul { display: grid; gap: 3px; margin: 0; padding: 0; list-style: none; }
.task-table td:last-child { padding-right: 0; font: 400 .8125rem/1.5 var(--mono); color: var(--ink-2); white-space: nowrap; }
.task-goto { padding: 0; border: 0; background: none; color: var(--ink); font: inherit; font-weight: 600; text-align: left; text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; cursor: pointer; }
.task-goto:hover { text-decoration-color: var(--softae); }
.media-dialog--figure .dialog-bar { justify-content: flex-end; padding: 8px; }
.media-dialog--figure .dialog-close { border-color: var(--line-2); }
.media-dialog--figure .dialog-close:hover { background: var(--paper); }
.dialog-figure { max-width: min(1600px, 92vw); max-height: calc(92vh - 72px); width: auto; height: auto; margin: 0 16px 16px; }
.dialog-caption { max-width: min(760px, 88vw); margin: -4px 16px 18px; font-size: .875rem; line-height: 1.5; color: var(--muted); }
.tip { position: fixed; z-index: 60; max-width: 260px; padding: 7px 10px; border-radius: 7px; background: var(--ink); color: var(--paper); font: 500 .75rem/1.45 var(--sans); pointer-events: none; box-shadow: 0 8px 20px rgba(0, 0, 0, .18); }

/* Responsive */
@media (max-width: 1100px) {
  .hero { grid-template-columns: minmax(0, 1fr); }
  .hero-copy { max-width: 760px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat:nth-child(3) { padding-left: 0; border-left: 0; }
  .loop { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 28px; }
  .loop li:nth-child(2)::after { content: none; }
  .tabpanel { grid-template-columns: minmax(0, 1fr); }
  .tablist [role='tab'] { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .tablist [role='tab'] img { width: 100%; height: 64px; }
  .tabpanel > .result-media { order: -1; }
  .specs { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 28px; }
}
@media (max-width: 900px) {
  .site-header nav { display: none; }
  .section-head, .film-head, .paper-grid { grid-template-columns: minmax(0, 1fr); }
  .concepts, .stress-grid { grid-template-columns: minmax(0, 1fr); max-width: 560px; }
  .concept { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1fr); align-items: center; }
  .concept img { grid-row: span 2; height: 100%; object-fit: contain; }
  .concept h3 { margin-top: 0; align-self: end; }
  .concept p { margin-bottom: 0; align-self: start; }
  .zero-shot { grid-template-columns: minmax(0, 1fr); }
  .legend-note { margin-left: 0; }
}
@media (max-width: 600px) {
  html { scroll-padding-top: 72px; }
  body { font-size: 1rem; }
  .header-inner { min-height: 60px; gap: 12px; }
  .wordmark img { width: 36px; height: auto; }
  .institution-logos { gap: 10px; }
  .institution-logos a + a { padding-left: 10px; }
  .institution-logos img { height: 22px; }
  .institution-logos a + a img { height: 19px; }
  .actions .btn { flex: 1 1 auto; padding: 0 16px; }
  .explorer { padding: 12px; border-radius: 14px; }
  .explorer-stage { aspect-ratio: 16 / 10; }
  .hud-keys { display: none; }
  .explorer-hud { left: 6px; right: 6px; bottom: 6px; font-size: .6875rem; }
  .method-desc { display: none; }
  .method-name { font-size: .8125rem; }
  .stats { grid-template-columns: minmax(0, 1fr); }
  .stat, .stat:nth-child(3) { padding: 22px 0 18px; border-left: 0; }
  .loop { grid-template-columns: minmax(0, 1fr); }
  .loop li:not(:last-child)::after { content: '↓'; right: auto; left: 50%; top: auto; bottom: -24px; transform: translateX(-50%); }
  .loop li:nth-child(2)::after { content: '↓'; }
  .concept { display: flex; align-items: stretch; }
  .concept img { height: auto; }
  .concept h3 { margin-top: 18px; align-self: auto; }
  .concept p { margin-bottom: 22px; align-self: auto; }
  .tablist { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .tablist [role='tab'] { padding: 8px; font-size: .75rem; }
  .tablist [role='tab'] small { font-size: .6875rem; }
  .specs { grid-template-columns: minmax(0, 1fr); }
  .specs > div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .yt-play { width: 64px; height: 64px; margin: -32px 0 0 -32px; }
  .yt-play::after { left: 26px; top: 20px; border-width: 12px 0 12px 19px; }
  .yt-label { left: 10px; bottom: 10px; padding: 6px 10px; font-size: .8125rem; }
  .yt-label small { display: none; }
  .citation pre { padding: 16px; font-size: .75rem; }
  .bars { --name: 74px; --end: 50px; }
  .task-table th:nth-child(3), .task-table td:nth-child(3) { display: none; }
  .task-table tbody th { width: 38%; }
  .dialog-body { padding: 0 16px 18px; }
  .media-dialog--chart .dialog-bar { padding-left: 16px; }
  .range-chart .name { font-size: 23px; }
  .range-chart .val { font-size: 21px; stroke-width: 5px; }
  .range-chart .ticks text { font-size: 19px; }
  .range-chart .key { r: 8px; }
  .range-chart circle.mean { r: 9px; stroke-width: 3; }
  .range-chart .range { stroke-width: 5; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
