/* ── Variables ─────────────────────────────────────────────────────── */
:root {
  --bg:           #ffffff;
  --surface:      #fafafa;
  --surface2:     #f4f4f4;
  --surface3:     #eeeeee;
  --border:       #e8e8e8;
  --border2:      #d0d0d0;
  --text:         #111111;
  --text-muted:   #555555;
  --text-dim:     #aaaaaa;
  --accent:       #ce1124;
  --accent2:      #e8182c;
  --accent3:      #ff2a3c;
  --accent-dark:  #8a0a18;
  --accent-glow:  rgba(206,17,36,0.12);
  --lamp:         #1a7a52;
  --bottle:       #b06010;
  --blind:        #1a4ea0;
  --mod-v:        #1a4ea0;
  --mod-t:        #ce1124;
  --mod-vt:       #6a28a0;
  --best-color:   #1a7a42;
  --best-bg:      rgba(26,122,66,0.07);

  --f-display:    'Fraunces', Georgia, serif;
  --f-body:       'DM Sans', system-ui, sans-serif;
  --f-mono:       'IBM Plex Mono', monospace;
}

/* ── Reset ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--f-body);
  line-height: 1.75;
  overflow-x: hidden;
}
a { text-decoration: none; color: inherit; }
strong { font-weight: 600; }
em { font-style: italic; }

/* ── Progress rail ─────────────────────────────────────────────────── */
#progress-rail {
  position: fixed; top: 0; left: 0;
  height: 2px; width: 0;
  background: linear-gradient(90deg, var(--accent-dark), var(--accent2), var(--accent3));
  z-index: 200;
  transition: width .06s linear;
  box-shadow: 0 0 6px var(--accent-glow);
}

/* ── Nav ───────────────────────────────────────────────────────────── */
#nav {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(255,255,255,0.90);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  transition: background .3s;
}
.nav-inner {
  max-width: 1276px; margin: 0 auto;
  display: flex; align-items: center;
  padding: 0 40px; height: 58px; gap: 32px;
}
.nav-brand {
  font-family: var(--f-display);
  font-size: 18px; font-weight: 700;
  color: var(--accent); white-space: nowrap;
}
.nav-links {
  display: flex; list-style: none; gap: 28px; flex: 1;
}
.nav-links a {
  font-size: 13px; color: var(--text-muted);
  transition: color .2s;
}
.nav-links a:hover { color: var(--text); }
.nav-actions { display: flex; gap: 8px; }
.nav-btn {
  font-size: 12px; font-weight: 500;
  padding: 5px 14px; border-radius: 6px;
  transition: background .2s, color .2s, border-color .2s;
}
.nav-btn-ghost {
  border: 1px solid var(--border2); color: var(--text-muted);
  background: transparent;
}
.nav-btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.nav-btn-fill {
  background: var(--accent); color: #fff; border: 1px solid var(--accent);
}
.nav-btn-fill:hover { background: var(--accent2); border-color: var(--accent2); }

/* ── Layout ────────────────────────────────────────────────────────── */
.container { max-width: 1210px; margin: 0 auto; padding: 0 40px; }
.container.narrow { max-width: 836px; }

/* ── Sections ──────────────────────────────────────────────────────── */
.section { padding: 100px 0; border-top: 1px solid var(--border); background: var(--bg); }
.section:nth-child(odd) { background: var(--surface); }
.section-head { margin-bottom: 52px; }
.section-eyebrow {
  display: inline-block;
  font-family: var(--f-mono); font-size: 12px; font-weight: 700;
  letter-spacing: .18em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 14px;
}
.section-title {
  font-family: var(--f-display);
  font-size: clamp(22px,3vw,36px); font-weight: 800;
  line-height: 1.1; color: var(--text);
  margin-bottom: 16px;
}
.section-desc {
  font-size: 16px; color: var(--text-muted);
  line-height: 1.8;
}
.section-hint {
  margin-top: 12px; font-size: 13px; color: var(--text-dim);
  font-family: var(--f-mono); letter-spacing: .04em;
}
.section-hint-below {
  margin-top: 32px; text-align: center; font-weight: 700;
  font-size: 15px; animation: hint-bounce 1.6s ease-in-out infinite;
}
@keyframes hint-bounce {
  0%, 100% { transform: translateY(0);   opacity: .5; }
  50%       { transform: translateY(6px); opacity: 1;  }
}

/* ── Reveal ────────────────────────────────────────────────────────── */
.reveal {
  opacity: 0; transform: translateY(22px);
  transition: opacity .8s cubic-bezier(.22,.68,0,1.1),
              transform .8s cubic-bezier(.22,.68,0,1.1);
}
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ── HERO ──────────────────────────────────────────────────────────── */
#hero {
  min-height: 100vh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center;
  padding: 100px 40px 80px;
  position: relative; overflow: hidden;
  background: var(--bg);
}
.hero-noise {
  position: absolute; inset: 0; pointer-events: none; z-index: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
  background-size: 256px 256px;
}
.hero-glow {
  position: absolute; pointer-events: none; border-radius: 50%;
  filter: blur(90px); z-index: 0;
}
.hero-glow-1 {
  width: 700px; height: 500px;
  background: radial-gradient(ellipse, rgba(206,17,36,.08) 0%, transparent 70%);
  top: 5%; left: 25%;
}
.hero-glow-2 {
  width: 400px; height: 320px;
  background: radial-gradient(ellipse, rgba(80,80,200,.05) 0%, transparent 70%);
  bottom: 15%; right: 15%;
}
.hero-inner { position: relative; z-index: 1; max-width: 900px; }

@keyframes pulse { 0%,100% { opacity:1; } 50% { opacity:.35; } }

.hero-title {
  font-family: var(--f-display);
  font-size: clamp(20px, 3.2vw, 44px);
  font-weight: 700; line-height: 1.15;
  letter-spacing: -.01em;
  margin-bottom: 24px;
  color: var(--text);
}

.write-phrase {
  display: inline;
  white-space: nowrap;
  clip-path: polygon(0% -30%, 0% -30%, 0% 130%, 0% 130%);
  will-change: clip-path;
}
#hero.in-view .write-phrase         { animation: phrase-write .85s linear forwards; }
#hero.in-view .write-phrase.phrase-1 { animation-delay: 200ms; }
#hero.in-view .write-phrase.phrase-2 { animation-delay: 1550ms; }

@keyframes phrase-write {
  0%   { clip-path: polygon(0% -30%,   0%  -30%,    0%  130%,   0%  130%); }
  14%  { clip-path: polygon(0% -30%,  16%  -50%,   14%  100%,   0%  130%); }
  28%  { clip-path: polygon(0% -30%,  30%   20%,   32%   80%,   0%  130%); }
  43%  { clip-path: polygon(0% -30%,  45%  -50%,   43%  120%,   0%  130%); }
  57%  { clip-path: polygon(0% -30%,  59%   15%,   61%   85%,   0%  130%); }
  71%  { clip-path: polygon(0% -30%,  73%  -45%,   71%  115%,   0%  130%); }
  86%  { clip-path: polygon(0% -30%,  88%   10%,   90%   90%,   0%  130%); }
  100% { clip-path: polygon(0% -30%, 115%  -30%,  115%  130%,   0%  130%); }
}

.hero-sub {
  font-size: clamp(15px, 2.2vw, 20px);
  color: var(--text-muted); line-height: 1.6;
  margin-bottom: 16px; opacity: 0;
}
.hero-byline {
  font-family: var(--f-body); font-size: 15px; font-weight: 500;
  color: var(--text); letter-spacing: .01em;
  margin-top: 28px; margin-bottom: 20px; opacity: 0;
}
.hero-affiliation {
  display: flex; justify-content: center;
  margin-bottom: 36px; opacity: 0;
}
.umd-logo { height: 80px; width: auto; }
.author-link { color: inherit; border-bottom: 1px solid var(--border2); transition: color .2s, border-color .2s; }
.author-link:hover { color: var(--accent); border-bottom-color: var(--accent); }
.hero-tldr {
  font-size: 15px; color: var(--text-muted);
  max-width: 640px; margin: 0 auto 36px;
  line-height: 1.7; opacity: 0;
}
.hero-tldr strong { color: var(--accent); font-weight: 600; }
.hero-tldr em { font-style: normal; color: var(--text); }

.hero-links {
  display: flex; justify-content: center; flex-wrap: wrap; gap: 10px;
  margin-bottom: 60px; opacity: 0;
}
#hero.in-view .hero-sub         { animation: fadeUp .7s ease both 2450ms; }
#hero.in-view .hero-byline      { animation: fadeUp .7s ease both 2550ms; }
#hero.in-view .hero-affiliation { animation: fadeUp .7s ease both 2620ms; }
#hero.in-view .hero-tldr        { animation: fadeUp .7s ease both 2700ms; }
#hero.in-view .hero-links       { animation: fadeUp .7s ease both 2800ms; }
.hlink {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 10px 22px;
  font-size: 13px; font-weight: 500;
  border-radius: 8px; border: 1px solid var(--border2);
  background: var(--surface); color: var(--text);
  transition: background .2s, border-color .2s, color .2s, box-shadow .2s;
}
.hlink svg { width: 15px; height: 15px; }
.hlink:hover {
  border-color: var(--accent); color: var(--accent);
  box-shadow: 0 2px 16px var(--accent-glow);
}
.hlink.hlink-primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.hlink.hlink-primary:hover { background: var(--accent2); border-color: var(--accent2); }


.hero-scroll-hint {
  position: absolute; bottom: 32px; left: 50%; transform: translateX(-50%);
  z-index: 1; color: var(--text-dim);
  animation: bounce 2s ease infinite;
}
.hero-scroll-hint svg { width: 22px; height: 22px; }
@keyframes bounce {
  0%,100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(6px); }
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Abstract ──────────────────────────────────────────────────────── */
#abstract { padding-top: 80px; }
.abstract-lead {
  font-family: var(--f-display);
  font-size: clamp(18px, 2.4vw, 22px);
  line-height: 1.65; color: var(--text); margin-bottom: 22px;
}
.abstract-body {
  font-size: 16px; color: var(--text-muted); line-height: 1.85; margin-bottom: 32px;
}
.abstract-body strong { color: var(--text); }
.abstract-thesis {
  border-left: 3px solid var(--accent);
  margin: 32px 0; padding: 16px 24px;
  font-family: var(--f-display); font-style: italic;
  font-size: 18px; color: var(--accent); line-height: 1.6;
  background: rgba(206,17,36,.05);
}
.contrib-list {
  list-style: none; counter-reset: contrib; margin-top: 32px;
  display: flex; flex-direction: column; gap: 14px;
}
.contrib-list li {
  counter-increment: contrib;
  display: flex; gap: 16px;
  font-size: 15px; color: var(--text-muted); line-height: 1.7;
}
.contrib-list li::before {
  content: counter(contrib);
  font-family: var(--f-mono); font-size: 11px; font-weight: 600;
  color: var(--accent); min-width: 22px; height: 22px;
  background: rgba(206,17,36,.08); border: 1px solid rgba(206,17,36,.3);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  margin-top: 3px; flex-shrink: 0;
}
.contrib-list strong { color: var(--text); }

/* ── Tasks ─────────────────────────────────────────────────────────── */
.task-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 24px; margin-top: 180px; }
@media (max-width: 860px) { .task-grid { grid-template-columns: 1fr; } }

.task-card {
  border: 1px solid var(--border); border-radius: 14px;
  overflow: hidden; background: var(--surface);
  box-shadow: 0 2px 12px rgba(0,0,0,.05);
  transition: border-color .25s, box-shadow .25s, transform .25s;
}
.task-card:hover {
  border-color: var(--border2); transform: translateY(-3px);
  box-shadow: 0 10px 36px rgba(0,0,0,.1);
}
.task-accent { height: 3px; background: var(--task-color); }
.task-video-wrap {
  position: relative; aspect-ratio: 16/10;
  background: var(--surface2); overflow: hidden;
}
.task-video { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ── Video focus lightbox ─────────────────────────────────────────── */
.vfocus-backdrop {
  position: fixed; inset: 0; z-index: 900;
  background: rgba(0,0,0,0);
  transition: background .2s;
  pointer-events: none;
}
.vfocus-backdrop.active { background: rgba(0,0,0,.78); }
.vfocus-video {
  position: fixed; z-index: 901;
  object-fit: cover;
  border-radius: 12px;
  box-shadow: 0 32px 80px rgba(0,0,0,.6);
  pointer-events: none;        /* enabled once expanded */
  will-change: left, top, width, height;
}

/* ── Plot zoom lightbox (t-SNE compositor) ────────────────────────── */
.pfocus-backdrop {
  position: fixed; inset: 0; z-index: 900;
  background: rgba(15,15,20,0);
  transition: background .22s ease;
  pointer-events: none;
  display: none;
}
.pfocus-backdrop.active { background: rgba(15,15,20,.7); pointer-events: auto; display: block; }
.pfocus-frame {
  position: fixed; z-index: 901;
  border: none; border-radius: 8px;
  box-shadow: 0 32px 80px rgba(0,0,0,.5);
  pointer-events: none;
  will-change: left, top, width, height;
  display: none;
}
.pfocus-label {
  position: fixed; z-index: 902;
  display: none;
  font: 600 13px/32px 'Inter', sans-serif;
  color: rgba(220,220,230,0.9);
  letter-spacing: 0.04em;
  text-align: center;
  pointer-events: none;
  text-shadow: 0 1px 4px rgba(0,0,0,0.7);
}
.task-video-placeholder {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; color: var(--text-dim); font-family: var(--f-mono); font-size: 12px;
  background: repeating-linear-gradient(
    45deg, transparent, transparent 20px,
    rgba(0,0,0,.02) 20px, rgba(0,0,0,.02) 21px
  );
}
.task-video-placeholder svg { width: 36px; height: 36px; }
.task-tag {
  position: absolute; bottom: 10px; left: 10px;
  font-family: var(--f-mono); font-size: 11px; font-weight: 600;
  color: #fff; background: var(--task-color);
  padding: 3px 10px; border-radius: 4px;
}
.task-body { padding: 20px 22px 22px; }
.task-desc { font-size: 14px; color: var(--text-muted); line-height: 1.7; margin-bottom: 14px; }
.task-desc em { color: var(--text); font-style: normal; font-weight: 500; }
.task-meta { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.tmeta { color: var(--text-muted); }
.tmeta-sep { color: var(--text-dim); }
.tac-label { color: var(--accent2); font-family: var(--f-mono); }

/* ── Skill tabs ────────────────────────────────────────────────────── */
.skill-tabs {
  display: flex; gap: 4px; margin-bottom: 32px;
  border-bottom: 1px solid var(--border);
}
.skill-tab {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 18px 12px; font-size: 13px; font-weight: 500;
  color: var(--text-muted); background: transparent; border: none;
  cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: color .2s, border-color .2s;
}
.skill-tab.active { color: var(--text); border-bottom-color: var(--accent); }
.skill-tab:hover:not(.active) { color: var(--text); }
.stab-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

.skill-timeline { display: none; }
.skill-timeline.active { display: block; }

.timeline-scroll {
  position: relative; padding: 28px 0 16px;
  overflow-x: auto; overflow-y: visible;
}
.timeline-line {
  position: absolute; top: 56px; left: 24px; right: 24px;
  height: 2px;
  background: linear-gradient(90deg,
    transparent 0px,
    var(--border2) 48px,
    var(--border2) calc(100% - 32px),
    transparent 100%);
  z-index: 0;
}
.timeline-line::after {
  content: '';
  position: absolute; right: 20px; top: -8px;
  width: 0; height: 0;
  border-top: 9px solid transparent;
  border-bottom: 9px solid transparent;
  border-left: 14px solid var(--border2);
}
.timeline-nodes {
  display: flex; position: relative; z-index: 1;
  padding: 0 24px;
  justify-content: space-between;
}

.tnode {
  display: flex; flex-direction: column; align-items: center;
  cursor: pointer; padding: 4px 8px 0; flex: 1;
  position: relative;
  opacity: 0;
  clip-path: inset(0 100% 0 0);
  transition:
    clip-path .45s cubic-bezier(.65,0,.35,1) calc(var(--i, 0) * 90ms),
    opacity .3s ease calc(var(--i, 0) * 90ms);
}
.tnode.revealed { opacity: 1; clip-path: inset(0 0 0 0); }
.tnode:not(:first-child)::before {
  content: '';
  position: absolute; left: -6px; top: 19px;
  width: 0; height: 0;
  border-top: 9px solid transparent;
  border-bottom: 9px solid transparent;
  border-left: 14px solid var(--border2);
  z-index: 2;
}

.tnode-circle {
  width: 96px; height: 56px; border-radius: 28px;
  border: 1.5px solid var(--border2); background: var(--surface);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 8px; padding: 0 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
  transition: border-color .2s, background .2s, box-shadow .2s;
}
.tnode.active .tnode-circle,
.tnode:hover .tnode-circle {
  background: #fef5f5;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.tnode-idx {
  font-family: var(--f-body); font-size: 12px; font-weight: 600;
  color: var(--text-muted); text-align: center; line-height: 1.25;
  letter-spacing: .01em;
}
.tnode.active .tnode-idx, .tnode:hover .tnode-idx { color: var(--accent); }
.tnode-name { display: none; }
.tnode-badges { display: flex; gap: 3px; margin-top: 5px; }
/* ── Subtask progress ring (SVG border around pill) ──────────────── */
.tnode-circle { position: relative; overflow: visible; }
.tnode-ring {
  position: absolute; top: -3px; left: -3px;
  pointer-events: none; overflow: visible;
}
.tnode-ring-track {
  fill: none; stroke: var(--border); stroke-width: 2;
}
.tnode-ring-fill {
  fill: none; stroke: var(--accent); stroke-width: 2.5;
  stroke-linecap: round;
  stroke-dasharray: 256;
  stroke-dashoffset: 256;
}
/* ring duration set dynamically via JS (video.duration) */
.tnode.completed .tnode-ring-fill {
  stroke-dashoffset: 0;
  transition: stroke-dashoffset .15s;
}
@keyframes ring-sweep {
  from { stroke-dashoffset: 256; }
  to   { stroke-dashoffset: 0; }
}
.tnode.node-failed .tnode-circle {
  background: #fde8e8;
  box-shadow: 0 0 0 1px rgba(224, 48, 48, 0.4);
}
.tnode.node-success .tnode-circle {
  background: #d0edda;
  box-shadow: 0 0 0 1px rgba(26, 122, 66, 0.55);
}
.tnode-outcome-label {
  display: none;
  order: -1;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
  pointer-events: none;
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
  text-align: center;
}
.tnode.node-failed .tnode-outcome-label {
  display: block;
  background: rgba(224,48,48,0.12);
  color: #b01818;
  border: 1px solid rgba(224,48,48,0.3);
}
.tnode.node-success .tnode-outcome-label {
  display: block;
  background: rgba(26,122,66,0.12);
  color: #1a6644;
  border: 1px solid rgba(26,122,66,0.3);
}

.mod-badge {
  font-family: var(--f-mono); font-size: 9px; font-weight: 600;
  padding: 1px 5px; border-radius: 3px;
}
.mod-v  { background: rgba(58,94,160,.1);  color: #2a4e90; border: 1px solid rgba(58,94,160,.25); }
.mod-t  { background: rgba(206,17,36,.1);  color: #8a0a18; border: 1px solid rgba(206,17,36,.25); }
.mod-vt { background: rgba(122,68,170,.1); color: #622898; border: 1px solid rgba(122,68,170,.25); }

.ptype-badge {
  font-family: var(--f-mono); font-size: 9px; font-weight: 500;
  padding: 1px 5px; border-radius: 3px; border: 1px solid transparent;
}
.ptype-cont { color: #1a6a44; background: rgba(26,106,68,.08); border-color: rgba(26,106,68,.2); }
.ptype-disc { color: #8a4c10; background: rgba(138,76,16,.08); border-color: rgba(138,76,16,.2); }
.ptype-cond { color: #622898; background: rgba(98,40,152,.08); border-color: rgba(98,40,152,.2); }

.skill-detail {
  position: relative; margin-top: 0; overflow: hidden;
  transition: max-height .4s cubic-bezier(.4,0,.2,1), margin-top .4s;
  max-height: 0;
}
.skill-detail.open { max-height: 700px; margin-top: 16px; }

/* connector arrow from active node to detail card */
.skill-detail.open::before {
  content: '';
  position: absolute;
  top: 0; left: var(--arrow-x, 50%);
  transform: translateX(-50%);
  border: 7px solid transparent;
  border-bottom-color: var(--accent);
  opacity: .55;
  transition: left .3s cubic-bezier(.25,.46,.45,.94);
  z-index: 1;
}

.skill-detail-inner {
  display: grid; grid-template-columns: 1fr 1fr; gap: 28px;
  background: var(--surface); border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-right: 1px solid var(--accent);
  border-radius: 12px; padding: 24px; overflow: hidden;
  box-shadow: 0 2px 16px rgba(0,0,0,.06);
}
@media (max-width: 640px) { .skill-detail-inner { grid-template-columns: 1fr; } }

.detail-video-wrap {
  aspect-ratio: 16/10; background: var(--surface2);
  border-radius: 8px; overflow: hidden; position: relative;
}
.detail-video { width: 100%; height: 100%; object-fit: cover; }
.detail-vid-placeholder {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 8px; color: var(--text-dim); font-family: var(--f-mono); font-size: 11px;
}
.detail-vid-placeholder svg { width: 28px; height: 28px; }

.detail-info { display: flex; flex-direction: column; gap: 12px; }
.detail-skill-name {
  font-family: var(--f-display); font-size: 22px; font-weight: 700; color: var(--text);
}
.detail-terminal { font-size: 13px; color: var(--text-muted); line-height: 1.6; }
.detail-terminal strong { color: var(--text); font-weight: 500; }
.detail-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.detail-progress-type { font-family: var(--f-mono); font-size: 11px; color: var(--text-muted); }

.detail-tactile {
  display: flex; flex-direction: column; gap: 2px;
  max-height: 0; opacity: 0; overflow: hidden;
  transition: max-height .35s ease, opacity .35s ease;
}
.detail-tactile.visible { max-height: 300px; opacity: 1; }
.tac-origin-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: #f0922b; vertical-align: middle; margin-right: 6px; flex-shrink: 0;
}

.detail-tactile-label {
  font-family: var(--f-body); font-size: 13px; font-weight: 600;
  color: var(--text-muted); text-align: center; letter-spacing: .01em;
}

.detail-tactile-videos { display: flex; gap: 72px; justify-content: center; padding: 0px; margin-bottom: 20px; }
.detail-tac-wrap { position: relative; border-radius: 8px; overflow: hidden; background: var(--surface2); width: 130px; flex-shrink: 0; }
.detail-tac-video { width: 130px; height: auto; display: block; }
.detail-tac-tag {
  position: absolute; bottom: 3px; left: 3px;
  font-family: var(--f-mono); font-size: 8px; font-weight: 500;
  color: rgba(255,255,255,.8); background: rgba(0,0,0,.35); border-radius: 2px;
  padding: 1px 3px; pointer-events: none;
}

.modality-legend {
  display: flex; flex-wrap: wrap; gap: 16px;
  margin-top: 32px; padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: 12px; color: var(--text-muted);
}
.mod-key { display: flex; align-items: center; gap: 6px; }

/* ── Pillars ───────────────────────────────────────────────────────── */
.pillars { display: grid; grid-template-columns: repeat(3,1fr); gap: 24px; margin-bottom: 64px; }
@media (max-width: 860px) { .pillars { grid-template-columns: 1fr; } }

.pillar {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 28px;
  display: flex; flex-direction: column; gap: 16px;
  box-shadow: 0 2px 12px rgba(0,0,0,.05);
  position: relative; overflow: hidden;
  transition: border-color .25s, box-shadow .25s, transform .25s;
}
.pillar:hover {
  border-color: var(--border2);
  box-shadow: 0 6px 28px rgba(0,0,0,.09);
  transform: translateY(-2px);
}
.pillar::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0;
  height: 2px; background: linear-gradient(90deg, transparent, var(--accent2), transparent);
  opacity: 0; transition: opacity .3s;
}
.pillar:hover::before { opacity: 1; }

.pillar-num {
  font-family: var(--f-mono); font-size: 11px; font-weight: 600;
  color: var(--accent); letter-spacing: .1em;
}
.pillar-icon { color: var(--accent); opacity: .5; }
.pillar-icon svg { width: 44px; height: 44px; }
.pillar-title {
  font-family: var(--f-display); font-size: 18px; font-weight: 700;
  color: var(--text); line-height: 1.2;
}
.pillar-desc { font-size: 14px; color: var(--text-muted); line-height: 1.75; }
.pillar-desc .mono { color: var(--accent2); }

.horizon-bar { display: flex; align-items: center; gap: 10px; font-size: 12px; }
.horizon-label { font-family: var(--f-mono); font-size: 10px; color: var(--text-muted); width: 44px; }
.horizon-track { flex: 1; height: 6px; background: var(--surface2); border-radius: 100px; overflow: hidden; }
.horizon-fill { height: 100%; border-radius: 100px; }
.hfill-rgb { background: var(--mod-v); }
.hfill-tac { background: var(--mod-t); }
.horizon-val { font-family: var(--f-mono); font-size: 10px; color: var(--text-dim); width: 28px; text-align: right; }

.encoder-badges { display: flex; flex-direction: column; gap: 6px; }
.enc-badge {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px; border-radius: 7px;
  border: 1px solid var(--border); background: var(--surface2);
}
.enc-badge.enc-rgb { border-color: rgba(58,94,160,.25); background: rgba(58,94,160,.04); }
.enc-badge.enc-tac { border-color: rgba(206,17,36,.25); background: rgba(206,17,36,.04); }
.enc-badge.enc-txt { border-color: rgba(122,68,170,.25); background: rgba(122,68,170,.04); }
.enc-name { font-size: 12px; font-weight: 500; color: var(--text); }
.enc-sub { font-family: var(--f-mono); font-size: 10px; color: var(--text-muted); }

.memory-vis { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.mem-token {
  display: flex; flex-direction: column; padding: 6px 10px;
  border: 1px solid var(--border); border-radius: 6px; background: var(--surface2);
  min-width: 64px;
}
.mem-token.mem-active { border-color: var(--accent); background: rgba(206,17,36,.06); }
.mem-lbl { font-family: var(--f-mono); font-size: 10px; color: var(--text); }
.mem-tag { font-size: 9px; color: var(--text-muted); margin-top: 1px; }
.mem-tag.mem-tag-active { color: var(--accent2); font-weight: 600; }
.mem-arrow { width: 28px; height: 12px; color: var(--text-dim); }

/* Arch figure */
.arch-figure {
  overflow: hidden;
}
.arch-img { width: 100%; display: block; }

/* ── Short vs long memory figure ───────────────────────────────── */
.mem-figure { margin-top: 64px; margin-bottom: 64px; }
.mem-figure-img-wrap {
  width: 90%;
  margin: 0 auto;
  line-height: 0;
}
.mem-figure-img {
  width: 100%;
  display: block;
  border-radius: 10px;
}
.mem-figure-text {
  margin-top: 20px;
}
.mem-figure-desc {
  font-size: 17px; color: var(--text-muted);
  line-height: 1.8;
}

#tasks .section-desc { max-width: calc(100% - 390px); }

/* Floating gripper */
.gripper-float {
  position: absolute;
  top: 0; right: 0;
  width: 350px;
  z-index: 2;
  text-align: center;
}
.gripper-img {
  width: 100%;
  display: block;
  border-radius: 10px;
}
.gripper-caption {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 5px;
  font-family: var(--f-mono);
}
.fig-fallback {
  aspect-ratio: 16/7;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; color: var(--text-dim); font-size: 14px;
  background: repeating-linear-gradient(
    0deg, transparent, transparent 28px,
    rgba(0,0,0,.015) 28px, rgba(0,0,0,.015) 29px
  );
}
.fig-fallback svg { width: 44px; height: 44px; }
.fig-fallback small { font-family: var(--f-mono); font-size: 11px; }
.fig-caption {
  padding: 14px 22px; font-size: 13px; color: var(--text-muted);
  border-top: 1px solid var(--border); line-height: 1.65;
}
.fig-caption strong { color: var(--text); }

/* ── Results ───────────────────────────────────────────────────────── */
.results-head-body {
  display: flex;
  gap: 36px;
  align-items: flex-start;
}
.results-head-left {
  flex: 1;
  min-width: 0;
}
.results-head-left .section-desc {
  max-width: none;
}
.results-demo-aside {
  flex: 0 0 50%;
  max-width: 50%;
  text-align: center;
}
.results-demo-img {
  width: 100%;
  display: block;
  border-radius: 10px;
  box-shadow: 0 2px 18px rgba(0,0,0,.12);
}
.results-demo-note {
  margin-top: 10px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-muted);
  text-align: left;
}
.results-demo-caption {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 5px;
  font-family: var(--f-mono);
}

.curves-figure {
  margin-bottom: 52px; background: var(--surface);
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  overflow: hidden;
}
.curves-img { width: 100%; display: block; }
.curves-fallback {
  aspect-ratio: 21/9;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; color: var(--text-dim); font-size: 14px;
}
.curves-fallback svg { width: 40px; height: 40px; }
.curves-fallback small { font-family: var(--f-mono); font-size: 11px; }

/* ── Video grid (Fig. 3) ────────────────────────────────────────────── */
.vidgrid-header {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 18px 20px 16px; border-bottom: 1px solid var(--border);
}
.vidgrid-label {
  font-family: var(--f-mono); font-size: 11px; font-weight: 600;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em;
  white-space: nowrap;
}
.ep-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.ep-pill {
  font-family: var(--f-mono); font-size: 11px; font-weight: 500;
  padding: 6px 14px; border-radius: 20px; border: 1px solid var(--border);
  background: transparent; color: var(--text-dim); cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.ep-pill:hover { border-color: var(--accent); }
.ep-pill.active { background: #b8b8b8; color: var(--text); border-color: #999; }
.ep-pill.ep-good { border-color: #2a9a5a; }
.ep-pill.ep-good.active { border-color: #2a9a5a; }
.ep-pill.ep-bad  { border-color: var(--accent2); }
.ep-pill.ep-bad.active  { border-color: var(--accent2); }
.vid-player-wrap { background: var(--surface); line-height: 0; }
.vid-scrub-bar {
  margin: 10px 16px 14px;
  height: 12px; border-radius: 6px; background: rgba(255,255,255,.25); cursor: grab;
  position: relative;
}
.vid-scrub-fill {
  height: 100%; border-radius: 6px; background: var(--accent); width: 0;
  pointer-events: none; position: relative;
}
.vid-scrub-fill::after {
  content: ''; position: absolute; right: -8px; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.4);
}

.table-heading {
  font-family: var(--f-display); font-size: 20px; font-weight: 600;
  color: var(--text); margin-bottom: 16px;
}
.table-sub { font-family: var(--f-mono); font-size: 12px; color: var(--text-muted); font-weight: 400; }

.table-wrap {
  overflow-x: visible; border-radius: 12px; border: 1px solid var(--border);
  margin-bottom: 14px; box-shadow: 0 2px 12px rgba(0,0,0,.05);
  display: flex; justify-content: center;
}
.results-table { border-collapse: collapse; font-size: 12px; width: 100%; }
.results-table-full { font-size: 11px; }
.results-table-full .sub-th { font-size: 9px; padding: 6px 8px; }
.results-table-full td { padding: 7px 8px; }
.results-table-full td.method-name { font-size: 12px; }
.results-table .group-header {
  text-align: center; font-family: var(--f-mono); font-size: 10px;
  letter-spacing: .1em; text-transform: uppercase; padding: 10px 8px 8px;
  border-bottom: 1px solid var(--border);
}
.lamp-header   { color: var(--lamp);   border-top: 2px solid var(--lamp);   }
.bottle-header { color: var(--bottle); border-top: 2px solid var(--bottle); }
.blind-header  { color: var(--blind);  border-top: 2px solid var(--blind);  }

.results-table thead tr:first-child th { background: var(--surface2); }
.results-table thead tr:nth-child(2)   { background: var(--surface); }
.results-table .sub-th {
  font-family: var(--f-mono); font-size: 10px; font-weight: 400;
  color: var(--text-muted); text-align: center; padding: 8px 10px;
  border-bottom: 1px solid var(--border);
}
.results-table th:first-child { text-align: left; padding-left: 16px; }

.results-table td {
  padding: 10px 10px; border-bottom: 1px solid var(--border);
  font-family: var(--f-mono); font-size: 12px; color: var(--text-muted); text-align: center;
}
.results-table td.method-name {
  font-family: var(--f-body); font-size: 13px; text-align: left;
  padding-left: 16px; color: var(--text); white-space: nowrap;
}
.results-table tr:last-child td { border-bottom: none; }
.row-ours td { background: rgba(206,17,36,.04); }
.row-ablation td { opacity: .85; }
.best { color: var(--best-color) !important; background: var(--best-bg); font-weight: 600; }
.method-star { color: var(--accent); margin-right: 5px; }
.tag-ours {
  font-family: var(--f-mono); font-size: 9px; font-weight: 600;
  background: var(--accent); color: #fff;
  padding: 1px 6px; border-radius: 3px; vertical-align: middle; margin-left: 6px;
}

.table-note { font-size: 12px; color: var(--text-dim); font-style: italic; margin-bottom: 52px; }

.takeaways { display: flex; flex-direction: column; gap: 14px; }
.takeaway {
  display: flex; gap: 16px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 18px 20px;
  box-shadow: 0 1px 6px rgba(0,0,0,.04);
}
.takeaway-icon { color: var(--accent2); font-size: 16px; flex-shrink: 0; margin-top: 2px; }
.takeaway p { font-size: 14px; color: var(--text-muted); line-height: 1.7; }
.takeaway p strong { color: var(--text); }
.takeaway p em { color: var(--accent); font-style: normal; font-weight: 500; }

/* ── Visualization ─────────────────────────────────────────────────── */
.viz-embed-outer {
  position: relative;
}
.viz-zoom-hint {
  position: absolute;
  right: calc(100% + 16px);
  top: 50%;
  transform: translateY(-50%);
  white-space: nowrap;
  font-size: 17px;
  font-style: italic;
  color: var(--text-dim);
  opacity: 1;
  text-align: right;
  pointer-events: none;
  letter-spacing: 0.02em;
  line-height: 1.5;
}
.viz-embed-wrap {
  position: relative;
  border: 1px solid var(--border); border-radius: 8px; overflow: hidden;
  box-shadow: 0 2px 16px rgba(0,0,0,.06);
  height: 500px;
  width: 100%;
  margin: 0;
}
.viz-embed-wrap iframe {
  width: 100%; height: 100%; border: none; display: block;
}
.viz-offline {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 14px; background: var(--surface2);
  color: var(--text-muted); font-size: 14px; text-align: center;
  padding: 32px;
}
.viz-offline svg { width: 40px; height: 40px; color: var(--text-dim); }
.viz-offline code {
  font-family: var(--f-mono); font-size: 12px;
  background: var(--surface3); padding: 8px 16px; border-radius: 6px;
  color: var(--text);
}
.viz-offline button {
  padding: 8px 20px; background: var(--accent); color: #fff;
  border: none; border-radius: 6px; font-size: 13px; cursor: pointer;
  transition: background .2s;
}
.viz-offline button:hover { background: var(--accent2); }

/* ── BibTeX ────────────────────────────────────────────────────────── */
.bib-wrap {
  position: relative; background: var(--surface);
  border: 1px solid var(--border); border-radius: 12px; overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,.05);
}
.bibtex {
  font-family: var(--f-mono); font-size: 13px; line-height: 1.8;
  color: var(--text); padding: 28px; overflow-x: auto; white-space: pre;
}
.copy-bib {
  position: absolute; top: 12px; right: 12px;
  display: flex; align-items: center; gap: 5px;
  padding: 5px 12px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 6px; color: var(--text-muted); font-size: 12px;
  cursor: pointer; transition: color .15s, border-color .15s, background .15s;
}
.copy-bib svg { width: 13px; height: 13px; }
.copy-bib:hover { color: var(--accent); border-color: var(--accent); background: rgba(206,17,36,.05); }
.copy-bib.copied { color: var(--best-color); border-color: var(--best-color); }

/* ── Footer ────────────────────────────────────────────────────────── */
#footer { border-top: 1px solid var(--border); padding: 32px 0; background: var(--surface); }
.footer-row {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 8px;
}
.footer-left { display: flex; flex-direction: column; gap: 2px; }
.footer-wordmark { font-family: var(--f-display); font-size: 16px; font-weight: 700; color: var(--accent); }
.footer-sub { font-family: var(--f-mono); font-size: 11px; color: var(--text-muted); }
.footer-credit { font-family: var(--f-mono); font-size: 11px; color: var(--text-dim); }

/* ── Utility ───────────────────────────────────────────────────────── */
.mono {
  font-family: var(--f-mono); font-size: .88em;
  background: rgba(206,17,36,.08); padding: 1px 5px;
  border-radius: 4px; color: var(--accent);
}

/* ── Scrollbar ─────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; background: var(--bg); }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }

/* ── Mobile / tablet ───────────────────────────────────────────────── */
@media (max-width: 860px) {
  .nav-links { display: none; }
  .nav-inner { padding: 0 20px; gap: 12px; }

  .container { padding: 0 20px; }
  .section { padding: 64px 0; }

  .gripper-float { display: none; }
  .results-head-body { flex-direction: column; }
  .results-head-left { width: 100%; }
  .results-demo-aside { flex: none; width: 100%; }
  .viz-zoom-hint { display: none; }

  .table-wrap { overflow-x: auto; }

  .skill-tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; flex-wrap: nowrap; }
  .skill-tab  { white-space: nowrap; }

  .detail-tactile-videos { gap: 24px; }
}

@media (max-width: 640px) {
  .nav-inner { padding: 0 16px; }
  .container { padding: 0 16px; }
  .section { padding: 48px 0; }

  #hero { padding: 80px 16px 60px; }
  .hero-title { white-space: normal; font-size: clamp(22px, 7vw, 36px); }
  .hero-inner { max-width: 100%; }

  .task-grid { margin-top: 48px; }

  .section-title { font-size: clamp(20px, 6vw, 28px); }

  .skill-detail-inner { grid-template-columns: 1fr; }

  .detail-tactile-videos { flex-direction: column; align-items: center; gap: 16px; }

  .timeline-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

  .vidgrid-header { padding: 12px 14px; }
  .ep-pills { gap: 4px; }
  .ep-pill  { padding: 5px 10px; }

  .abstract-thesis { font-size: 15px; padding: 14px 16px; }

  .takeaway { flex-direction: column; gap: 8px; }

  .table-wrap { overflow-x: auto; }

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

  .pillar { padding: 20px; }
  .viz-embed-wrap { height: 320px; }
}
::-webkit-scrollbar-thumb:hover { background: var(--accent); }
