/* =============================================================================
   UMM Transferability — Project Page Stylesheet
   StyleSeed-compliant: one accent (muted slate-blue), one radius personality (soft),
   one shadow language (<=8%), one motion seed (Silk). Responsive from 320px up.
   ============================================================================= */

/* ---------- Theme tokens ---------- */
:root{
  /* Brand — single accent, tints only (no 2nd/3rd hue) */
  --accent:        #3D5A80;   /* ink slate-blue — links, active nav, .hl */
  --accent-strong: #2E4763;   /* darker slate — hover / emphasis text */
  --accent-soft:   #EEF1F6;   /* cool-grey tint for highlights */

  /* Status — severity only; normal states stay grey */
  --success: #2E7D50;         /* confirmation (copy) */
  --up:      #2E7D50;         /* improvement / up trend */
  --down:    #B04A3C;         /* regression / down trend */

  /* Motion — Silk seed (one easing, three durations) */
  --ease:       cubic-bezier(0.4, 0, 0.2, 1);
  --dur-fast:   120ms;
  --dur-normal: 220ms;
  --dur-slow:   360ms;
  --motion:     var(--dur-normal) var(--ease);

  /* Neutrals (no pure #000; darkest text = #1B1D23) */
  --bg:          #FCFCFD;     /* page background (neutral near-white) */
  --surface:     #FFFFFF;     /* cards / inset blocks */
  --surface-2:   #F4F5F7;     /* second-level inset */
  --text:        #1B1D23;     /* strong */
  --text-soft:   #565A66;     /* body / labels */
  --text-mute:   #6A6E7A;     /* captions (darkened for WCAG AA on near-white) */
  --border:      #E3E5EA;
  --border-soft: #EEF0F3;

  /* Typography */
  --font:        'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-serif:  'Source Serif 4', 'Source Serif Pro', Georgia, serif;
  --font-display:'Manrope', 'Inter', -apple-system, sans-serif;
  --font-mono:   'JetBrains Mono', monospace;

  /* Layout */
  --sidebar-w:   230px;
  --content-max: 1180px;
  --content-px:  clamp(20px, 3.5vw, 48px);

  /* Hero column widths — two deliberate tiers, not ad-hoc per-block values */
  --hero-prose-w: 760px;   /* single-column reading text (title block, lead) */
  --hero-wide-w:  860px;   /* multi-part card / media blocks (qa-block, carousel) */

  /* Radius — soft personality (one scale everywhere) */
  --radius-sm: 8px;    /* badges, code, chips, small buttons */
  --radius:    10px;   /* controls / buttons */
  --radius-lg: 14px;   /* cards */

  /* Shadows — one language, <=8% opacity */
  --shadow-1: 0 4px 18px rgba(20, 24, 40, 0.05);
  --shadow-2: 0 12px 40px rgba(24, 28, 48, 0.07);
}

/* ---------- Base ---------- */
*{ box-sizing:border-box; }
html{ scroll-behavior:smooth; }
body{
  margin:0;
  font-family:var(--font);
  font-size:16px;                 /* desktop body floor */
  background:var(--bg);
  color:var(--text);
  line-height:1.65;
  overflow-x:clip;                /* horizontal-overflow safety (keeps sticky working) */
  -webkit-font-smoothing:antialiased;
}
a{ color:var(--accent); text-decoration:none; }
a:hover{ text-decoration:underline; }
img{ max-width:100%; }
code{
  font-family:var(--font-mono); font-size:0.92em;
  background:var(--surface-2); padding:0.05em 0.4em; border-radius:var(--radius-sm);
}
.hl{ color:var(--accent); font-weight:700; }

/* ---------- Reading-progress bar ---------- */
#progress-bar{
  position:fixed; top:0; left:0; height:3px; width:0;
  background:var(--accent);
  z-index:9999;
  transition:width 0.08s linear;
}

/* ---------- Layout ---------- */
.layout{
  display:flex;
  align-items:flex-start;
  min-height:100vh;
}

/* ---------- Sidebar (desktop: pinned left rail) ---------- */
.sidebar{
  position:sticky; top:0;
  flex:0 0 var(--sidebar-w); width:var(--sidebar-w);
  height:100vh; padding:32px 18px 28px 28px;
  display:flex; flex-direction:column;
  border-right:1px solid var(--border);
  background:var(--surface-2);
}
.sidebar-brand{ display:flex; align-items:center; gap:10px; margin-bottom:36px; }
.brand-mark{
  display:inline-flex; align-items:center; justify-content:center;
  min-width:34px; height:34px; padding:0 9px; border-radius:var(--radius);
  background:var(--accent);
  color:#fff; font-weight:800; font-size:0.82rem; letter-spacing:0.03em;
  box-shadow:var(--shadow-1);
}
.brand-name{ font-weight:700; font-size:1rem; letter-spacing:-0.01em; }

.sidebar-nav{ display:flex; flex-direction:column; gap:2px; flex:1; }
.nav-link{
  display:block; padding:8px 12px;
  font-size:0.9rem; font-weight:500;
  color:var(--text-soft);
  border-left:2px solid transparent;
  border-radius:0 var(--radius-sm) var(--radius-sm) 0;
  transition:color var(--motion), background-color var(--motion), border-color var(--motion);
}
.nav-link:hover{ color:var(--accent); text-decoration:none; background:var(--surface); }
.nav-link.active{
  color:var(--accent);
  border-left-color:var(--accent);
  background:var(--accent-soft);
  font-weight:600;
}
.nav-link:focus-visible{ outline:2px solid var(--accent); outline-offset:2px; }

.sidebar-foot{ margin-top:auto; padding-top:18px; border-top:1px solid var(--border-soft); }
.venue-badge{
  display:inline-block; padding:5px 10px;
  font-size:0.72rem; font-weight:600; letter-spacing:0.04em; text-transform:uppercase;
  background:var(--surface); color:var(--accent-strong);
  border:1px solid var(--border); border-radius:var(--radius-sm);
}

/* ---------- Content column ---------- */
.content{
  flex:1; min-width:0;
  max-width:calc(var(--content-max) + 2 * var(--content-px));
  padding:64px var(--content-px) 96px;
  margin:0 auto;
}

.sec{ margin-bottom:80px; scroll-margin-top:24px; }
.sec-label{
  display:inline-block;
  font-size:1rem; font-weight:700; letter-spacing:0.16em; text-transform:uppercase;
  color:var(--accent);
  padding:4px 0; border-bottom:2px solid var(--accent);
  margin-bottom:14px;
}
.sec-heading{
  font-family:var(--font-display);
  font-size:clamp(1.6rem, 3.1vw, 2.15rem);
  font-weight:700; line-height:1.18; margin:0 0 12px;
  letter-spacing:-0.028em;
}
.sub-heading{
  font-size:1.2rem; font-weight:600;
  margin:48px 0 16px;
  padding-left:12px; border-left:3px solid var(--accent);
}
.sec-lead{
  font-size:1.02rem; color:var(--text-soft);
  margin-top:0; margin-bottom:28px;
}
.cap{ font-size:0.875rem; color:var(--text-mute); margin-top:14px; }

/* =============== HERO =============== */
.hero{ padding-top:24px; }
.hero-head{ text-align:center; max-width:var(--hero-prose-w); margin:0 auto 28px; }
.hero-title{
  font-family:var(--font-display);
  font-weight:800; letter-spacing:-0.035em; line-height:1.3;
  margin:0 0 32px;
  font-size:clamp(1.9rem, 6vw, 3.3rem);
  text-align:center;
  text-wrap:balance;              /* graceful multi-line balancing */
  overflow-wrap:break-word;       /* never overflow the viewport */
}
@media (min-width:900px){
  /* .hero-lead keeps its own max-width (--hero-prose-w), so widening hero-head
     only gives the title (and author grid) more room — lets the first line fit
     "Transferability Between Understanding & Generation" without a 3rd line.
     Subtract the sidebar + content padding actually taken out of the viewport
     (a flat vw fraction overestimates available room once the sidebar is fixed). */
  .hero-head{
    max-width:min(1180px, calc(100vw - var(--sidebar-w) - 2 * var(--content-px) - 24px));
  }
}
.hero-accent{ color:var(--accent); }   /* the one distinctive focal accent */
.hero-sub{
  display:inline-block;
  font-family:var(--font-display); font-weight:700; color:var(--text);
  font-size:0.52em; letter-spacing:-0.02em; line-height:1.2;
  margin-top:12px;
}

.authors-grid{
  display:flex; flex-wrap:wrap; gap:14px 28px;
  margin:8px 0 6px; justify-content:center;
}
.author-card{ font-size:0.95rem; color:var(--text); }
.author-name{ font-weight:500; }
a.author-name{ color:inherit; text-decoration:none; transition:color .15s ease; }
a.author-name:hover{ color:var(--accent); text-decoration:underline; text-underline-offset:3px; }
.author-card sup{ color:var(--accent); font-weight:600; margin-left:1px; font-size:0.75em; }
.affil-legend{ font-size:0.875rem; color:var(--text-mute); margin:4px 0 15px; text-align:center; }
.affil-legend sup{ color:var(--accent); margin-right:2px; }
.affil-foot{ display:inline-block; margin-top:4px; font-size:0.82rem; color:var(--text-mute); }

.links-row{
  display:flex; gap:10px; flex-wrap:wrap;
  margin:0 0 8px; justify-content:center;
}
.link-btn{
  display:inline-flex; align-items:center; gap:8px;
  padding:10px 18px;
  background:var(--surface); color:var(--text);
  border:1px solid var(--border); border-radius:var(--radius);
  font-weight:500; font-size:0.92rem; text-decoration:none;
  box-shadow:0 1px 2px rgba(0,0,0,0.03);
  transition:background-color var(--motion), border-color var(--motion),
             color var(--motion), transform var(--motion), box-shadow var(--motion);
}
.link-btn:hover{
  background:var(--accent-soft); border-color:var(--accent); color:var(--accent-strong);
  text-decoration:none; transform:translateY(-1px); box-shadow:var(--shadow-1);
}
.link-btn svg{ width:16px; height:16px; stroke:currentColor; }
.link-btn:focus-visible{ outline:2px solid var(--accent); outline-offset:3px; }

/* Promoted motivation lead — readable body size (replaces caption-grey hero-gap) */
.hero-lead{
  max-width:var(--hero-prose-w); margin:6px auto 0;
  text-align:justify; font-size:1.02rem; color:var(--text-soft); line-height:1.6;
}
.hero-lead em{ font-style:italic; }

/* Concept motif — Understanding ⇄ Generation, bridges the lead into the teaser.
   Size is driven by ONE multiplier: change --transfer-scale to scale the whole motif. */
.transfer-motif{
  --transfer-scale:1.6;                       /* ← 이 값 하나만 바꾸면 전체 크기 조절 (1 = 현재) */
  display:flex; flex-wrap:wrap; align-items:center; justify-content:center;
  gap:calc(10px * var(--transfer-scale)) calc(12px * var(--transfer-scale));
  margin:20px auto 0;
}
.transfer-node{
  font-size:calc(0.72rem * var(--transfer-scale));
  font-weight:700; letter-spacing:0.06em; text-transform:uppercase;
  color:var(--accent-strong); background:var(--accent-soft);
  padding:calc(6px * var(--transfer-scale)) calc(12px * var(--transfer-scale));
  border-radius:var(--radius-sm); white-space:nowrap;
}
.transfer-arrow{
  width:calc(26px * var(--transfer-scale)); height:calc(26px * var(--transfer-scale));
  color:var(--accent); flex:0 0 auto;
}

/* Hero teaser / qual figures — sit centered within the hero rhythm */
.hero .figure-wide, .hero .figure-medium{ margin:26px auto 8px; }
.hero .qa-block{ margin-top:22px; }

/* Two-part finding — numbered accent badge sits inside each card's eyebrow */
.finding-num{
  flex:0 0 auto;
  display:inline-flex; align-items:center; justify-content:center;
  width:18px; height:18px; border-radius:50%;
  background:var(--accent); color:#fff;
  font-family:var(--font-display); font-weight:800; font-size:0.68rem;
}

/* =============== HERO QUALITATIVE CAROUSEL =============== */
/* Framed like the figure cards (one radius / shadow language). The source PNGs are
   alpha-transparent, so the media well composites on white — same convention as
   every other figure on the page (.figure-wide/.figure-medium img{ background:#fff }). */
.hero-carousel{
  max-width:var(--hero-wide-w); margin:26px auto 8px;
  background:var(--surface);
  border:1px solid var(--border); border-radius:var(--radius-lg);
  overflow:hidden; box-shadow:var(--shadow-1);
}
.carousel-window{
  position:relative; aspect-ratio:2 / 1;
  background:#fff; overflow:hidden;
}
.carousel-slide{
  position:absolute; inset:0;
  width:100%; height:100%; object-fit:contain;
  opacity:0; z-index:0; pointer-events:none;
  transition:opacity var(--dur-normal) var(--ease);
}
.carousel-slide.is-active{ opacity:1; z-index:1; pointer-events:auto; }

/* Prev / next arrows — pointer-first 40px, ≥44px hit area on touch */
.carousel-arrow{
  position:absolute; top:50%; transform:translateY(-50%); z-index:3;
  display:inline-flex; align-items:center; justify-content:center;
  width:40px; height:40px; border-radius:50%;
  background:color-mix(in srgb, var(--surface) 82%, transparent);
  border:1px solid var(--border); color:var(--text);
  cursor:pointer; box-shadow:var(--shadow-1);
  transition:background-color var(--motion), color var(--motion),
             border-color var(--motion), transform var(--motion);
}
.carousel-prev{ left:12px; }
.carousel-next{ right:12px; }
.carousel-arrow svg{ width:20px; height:20px; }
.carousel-arrow:hover{
  background:var(--accent); border-color:var(--accent-strong); color:#fff;
}
.carousel-arrow:focus-visible{ outline:2px solid var(--accent); outline-offset:2px; }

/* Caption well — both captions share one grid cell, so the well is sized to the
   TALLER caption at any width (no overflow, no layout shift); only the active one
   is visible (crossfade). */
.carousel-caps{
  display:grid;
  border-top:1px solid var(--border-soft); background:var(--surface-2);
}
.carousel-cap{
  grid-area:1 / 1; margin:0; padding:14px 22px 16px;
  font-size:0.92rem; line-height:1.55; color:var(--text-soft);
  opacity:0; pointer-events:none;
  transition:opacity var(--dur-normal) var(--ease);
}
.carousel-cap.is-active{ opacity:1; pointer-events:auto; }
.carousel-cap strong{ color:var(--text); }
/* Mirror the figure's on-image labels so caption ↔ image map at a glance
   (reuses the existing severity tokens; no new hues) */
.cap-und{ color:var(--up);   font-weight:700; }
.cap-gen{ color:var(--down); font-weight:700; }

/* Dots */
.carousel-dots{
  display:flex; justify-content:center; gap:8px;
  padding:12px 0 14px; background:var(--surface-2);
}
.carousel-dot{
  width:9px; height:9px; padding:0; border-radius:50%;
  background:var(--border); border:none; cursor:pointer;
  transition:background-color var(--motion), transform var(--motion);
}
.carousel-dot:hover{ background:var(--text-mute); }
.carousel-dot.is-active{ background:var(--accent); transform:scale(1.15); }
.carousel-dot:focus-visible{ outline:2px solid var(--accent); outline-offset:3px; }

/* =============== Q&A CARDS =============== */
/* Full content width — matches .hero-teaser (.figure-wide), which has no max-width cap.
   Wider than --hero-wide-w on purpose so three columns get room to breathe. */
.qa-block{
  display:grid; grid-template-columns:repeat(3, minmax(0, 1fr)); gap:20px;
  margin:26px auto 0; text-align:left;
}
.qa-card{
  background:var(--surface);
  border:1px solid var(--border); border-radius:var(--radius-lg);
  padding:20px 22px; box-shadow:var(--shadow-1);
  transition:transform var(--motion), box-shadow var(--motion);
}
.qa-card:hover{ transform:translateY(-2px); box-shadow:var(--shadow-2); }
.qa-card.qa-answer{ border-left:4px solid var(--accent); }
.qa-tag{
  display:block;
  font-size:0.72rem; font-weight:700; letter-spacing:0.14em; text-transform:uppercase;
  color:var(--accent); margin-bottom:8px;
}
/* Finding cards carry the numbered badge inline with the eyebrow label */
.qa-answer .qa-tag{ display:inline-flex; align-items:center; gap:6px; }
.qa-card p{ margin:0; font-size:1rem; line-height:1.55; }
.qa-card.qa-answer p strong{ color:var(--accent-strong); }

/* Two-card variant (Problem/Recipe) — same card width as a 3-col grid,
   but centered as a group instead of anchored left. */
.qa-pair{
  display:flex; justify-content:center; gap:20px;
  margin:26px auto 0; text-align:left;
}
.qa-pair > .qa-card{
  flex:0 1 calc((100% - 40px)/3);
}

/* =============== TAKEAWAY CALLOUT =============== */
.takeaway{
  display:grid; grid-template-columns:auto 1fr; align-items:center; gap:14px;
  background:var(--surface);
  border:1px solid var(--border); border-left:4px solid var(--accent);
  border-radius:var(--radius-lg);
  padding:16px 20px; margin:18px 0 6px;
  box-shadow:var(--shadow-1);
}
.takeaway-key{
  font-family:var(--font-display); font-weight:800;
  font-size:0.72rem; letter-spacing:0.12em; text-transform:uppercase;
  color:var(--accent); white-space:nowrap; text-align:center;
}
.takeaway-num{
  display:inline-block; margin-top:3px;
  font-size:1.1rem; letter-spacing:0.04em;
}
.takeaway p{ margin:0; font-size:1rem; line-height:1.5; color:var(--text); }
.takeaway p strong{ color:var(--accent-strong); }

/* =============== FIGURES =============== */
.figure-wide, .figure-medium{
  margin:8px 0 14px;
  background:var(--surface);
  border:1px solid var(--border); border-radius:var(--radius-lg);
  overflow:hidden; box-shadow:var(--shadow-1);
  transition:box-shadow var(--motion), transform var(--motion);
}
.figure-medium{ max-width:760px; margin-left:auto; margin-right:auto; }
.figure-wide img, .figure-medium img{ display:block; width:100%; height:auto; background:#fff; }
.figure-wide figcaption, .figure-medium figcaption{
  padding:14px 22px 18px;
  font-size:0.92rem; color:var(--text-soft);
  border-top:1px solid var(--border-soft);
  background:var(--surface-2);
}
.figure-wide:hover, .figure-medium:hover{ box-shadow:var(--shadow-2); }

/* Image error / empty state — friendly fallback instead of a blank box */
.figure-error{
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  gap:10px; min-height:180px; padding:32px;
  background:var(--surface-2); color:var(--text-mute); text-align:center;
}
.figure-error svg{ width:32px; height:32px; stroke:var(--text-mute); }
.figure-error span{ font-size:0.92rem; }
/* Reserve space for a missing src rather than collapsing */
.figure-wide img:not([src]), .figure-wide img[src=""],
.figure-medium img:not([src]), .figure-medium img[src=""]{
  min-height:180px; background:var(--surface-2);
}

/* =============== LIGHTBOX (click figure to enlarge) =============== */
.lightbox-trigger{ cursor:zoom-in; transition:opacity var(--motion), transform var(--motion); }
.lightbox-trigger:hover{ opacity:0.93; }
.lightbox-trigger:focus-visible{ outline:2px solid var(--accent); outline-offset:3px; }

.lightbox-overlay{
  position:fixed; inset:0;
  background:rgba(15, 14, 28, 0.92);
  display:flex; align-items:center; justify-content:center;
  padding:4vh 4vw; z-index:10000;
  opacity:0; pointer-events:none;
  transition:opacity var(--motion);
  backdrop-filter:blur(6px); -webkit-backdrop-filter:blur(6px);
  cursor:zoom-out;
}
.lightbox-overlay.visible{ opacity:1; pointer-events:auto; }
.lightbox-overlay img{
  display:block;
  max-width:100%; max-height:100%; width:auto; height:auto;
  object-fit:contain; border-radius:var(--radius);
  box-shadow:0 24px 80px rgba(0, 0, 0, 0.5);
  background:#fff; cursor:default;
  animation:lbZoomIn var(--dur-normal) var(--ease) both;
}
@keyframes lbZoomIn{ from{ transform:scale(0.94); opacity:0; } to{ transform:scale(1); opacity:1; } }
.lightbox-close{
  position:absolute; top:18px; right:22px;
  width:44px; height:44px; border-radius:50%;
  border:1px solid rgba(255, 255, 255, 0.25);
  background:rgba(20, 18, 36, 0.7);
  color:#fff; font-size:1.6rem; line-height:1; font-weight:400;
  cursor:pointer;
  transition:background-color var(--motion), border-color var(--motion), transform var(--motion);
}
.lightbox-close:hover{ background:var(--accent); border-color:var(--accent-strong); transform:scale(1.05); }
.lightbox-close:focus-visible{ outline:2px solid #fff; outline-offset:2px; }

/* =============== TABLE =============== */
.table-wrap{
  overflow-x:auto; margin:18px 0 10px;
  border-radius:var(--radius-lg); border:1px solid var(--border);
  background:var(--surface); box-shadow:var(--shadow-1);
  -webkit-overflow-scrolling:touch;
}
.results-table{
  width:100%; border-collapse:collapse;
  font-size:0.92rem; min-width:700px;
}
/* Compact tables (few data columns) shouldn't inherit the 700px scroll-width
   used by the large multi-model tables — that width gets divided across only a
   handful of columns on mobile, ballooning the label columns. */
.results-table--sm{ min-width:0; }
.results-table th, .results-table td{ padding:11px 14px; text-align:center; }
.results-table thead th{
  font-weight:600; font-size:0.84rem;
  color:var(--text-soft); background:var(--surface-2);
  border-bottom:1px solid var(--border); letter-spacing:0.02em;
}
.results-table tbody tr{ transition:background-color var(--motion); }
.results-table tbody tr:hover:not(.row-sep){ background:var(--surface-2); }
.results-table .th-left{ text-align:left; padding-left:22px; }
.row-sep{ height:1px; }
.row-sep td{ padding:0; height:1px; background:var(--border-soft); }
.row-gt td{ color:var(--text-mute); font-style:italic; }
/* "Our method" rows — the single focal highlight (flat accent tint, not gradient) */
.row-ours{ background:var(--accent-soft); border-left:3px solid var(--accent); }
.row-ours td{ color:var(--accent-strong); font-weight:600; }
.row-section td{
  text-align:left; font-size:0.82rem; font-weight:600;
  color:var(--text-soft); background:var(--surface-2);
  padding-top:9px; padding-bottom:9px;
}
.row-section em{ font-style:italic; color:var(--text); }
/* Inline deltas — green = improvement, red = regression (severity only) */
.delta{ font-size:0.78em; font-weight:600; white-space:nowrap; }
.delta.imp{ color:var(--up); }
.delta.imp.ours{ color:var(--up); font-weight:900;}
.delta.reg{ color:var(--down); }
/* Vertical group label spanning multiple body rows */
.results-table td.eval-cell{
  background:var(--surface-2);
  font-weight:700; font-size:0.82rem; color:var(--text);
  vertical-align:middle; border-right:1px solid var(--border); line-height:1.25;
}
.results-table td.eval-cell span{
  display:block; margin-top:3px;
  font-weight:600; font-size:0.76rem; color:var(--accent-strong); font-family:var(--font-mono);
}
.results-table thead th.grp{
  border-left:1px solid var(--border); border-bottom:1px solid var(--border); font-size:0.8rem;
}
.results-table thead th.grp-a{
  background:var(--accent-soft); color:var(--accent-strong); border-bottom-color:var(--accent);
}
.results-table thead th.grp-sub{ border-left:1px solid var(--border); font-weight:600; }

/* Counting table only: keep the accent highlight on (a) alone — (b)/(c)/(d)
   header cells fall back to plain white instead of the generic gray thead fill. */
#counting-table thead th{ background:var(--surface); }
#counting-table thead th.grp-a{ background:var(--accent-soft); }
/* Carry the (a) tint down into the Baseline rows so the column reads as one
   continuous highlight; .row-ours rows already tint their whole row. */
#counting-table td.grp-a{ background:var(--accent-soft); }
/* Method rows (row-ours): keep the full-row accent styling for (a) only;
   (b)-(d) cells reset to plain, matching a normal Baseline cell. */
#counting-table .row-ours td{
  background:var(--surface); color:var(--text); font-weight:400;
}
#counting-table .row-ours td.grp-a{
  background:var(--accent-soft); color:var(--accent-strong); font-weight:600;
}

.cap-note{ color:var(--accent-strong); font-weight:600; }
/* Empty-table state (used when a table renders with no rows) */
.table-empty{
  padding:32px; text-align:center;
  color:var(--text-mute); font-size:0.88rem; font-style:italic;
}

/* =============== BIBTEX =============== */
.bib-wrap{
  position:relative;
  background:var(--surface);
  border:1px solid var(--border); border-radius:var(--radius-lg);
  box-shadow:var(--shadow-1); margin-top:16px;
}
.bib{
  margin:0; padding:18px 20px;
  font-family:var(--font-mono); font-size:0.85rem; line-height:1.5;
  overflow-x:auto; color:var(--text);
}
.copy-btn{
  position:absolute; top:12px; right:12px;
  background:var(--surface-2); color:var(--accent-strong);
  border:1px solid var(--border); border-radius:var(--radius-sm);
  padding:7px 14px; font-size:0.78rem; font-weight:600; cursor:pointer;
  transition:background-color var(--motion), color var(--motion), border-color var(--motion);
}
.copy-btn:hover{ background:var(--accent); color:#fff; border-color:var(--accent); }
.copy-btn.copied{ background:var(--success); color:#fff; border-color:var(--success); }
.copy-btn:focus-visible{ outline:2px solid var(--accent); outline-offset:2px; }

/* =============== FOOTER =============== */
.footer{
  margin-top:56px; padding-top:24px;
  border-top:1px solid var(--border-soft);
  color:var(--text-mute); font-size:0.875rem;
}

/* =============== Scroll-in fade (JS opt-in via .fade-in) =============== */
.fade-in{ animation:fadeUp var(--dur-slow) var(--ease) both; }
@keyframes fadeUp{ from{ opacity:0; transform:translateY(8px); } to{ opacity:1; transform:none; } }

/* =============================================================================
   RESPONSIVE — standard breakpoints around the real content
   ============================================================================= */

/* Small laptops — narrow the rail */
@media (max-width:1024px){
  :root{ --sidebar-w:200px; }
  /* Three qa columns only breathe on true desktop; the sidebar squeezes content here */
  .qa-block{ grid-template-columns:1fr; }
  .qa-pair{ flex-direction:column; }
  .qa-pair > .qa-card{ flex:1 1 auto; }
}

/* Tablet & below — sidebar becomes a top bar, single column */
@media (max-width:768px){
  .layout{ flex-direction:column; }
  .sidebar{
    position:static; height:auto; width:100%; flex:0 0 auto;
    border-right:none; border-bottom:1px solid var(--border);
    padding:16px 20px;
    padding-left:max(20px, env(safe-area-inset-left));
    padding-right:max(20px, env(safe-area-inset-right));
  }
  .sidebar-brand{ margin-bottom:12px; }
  .sidebar-nav{
    flex-direction:row; flex-wrap:nowrap; gap:4px;
    overflow-x:auto; scrollbar-width:none; -webkit-overflow-scrolling:touch;
  }
  .sidebar-nav::-webkit-scrollbar{ display:none; }
  .sidebar-foot{ display:none; }
  .nav-link{
    flex:0 0 auto; white-space:nowrap;
    min-height:44px; display:flex; align-items:center;    /* >=44px touch target */
    padding:8px 14px; border-left:none; border-radius:var(--radius-sm);
  }
  .nav-link.active{ border-left:none; background:var(--accent-soft); }

  /* In the column layout, margin:auto would disable flex-stretch and let the
     column balloon to its max-width (pushing content off-screen) — pin it full-width. */
  .content{ width:100%; max-width:100%; margin:0; padding:32px var(--content-px) 64px; }
  .sec{ margin-bottom:56px; }
  .qa-block{ grid-template-columns:1fr; }
  .qa-pair{ flex-direction:column; }
  .qa-pair > .qa-card{ flex:1 1 auto; }

  /* Concept motif steps down one notch (desktop 1.6) so it doesn't dominate the hero */
  .transfer-motif{ --transfer-scale:1.3; }

  .link-btn{ min-height:44px; }
  .copy-btn{ min-height:44px; padding:10px 16px; }

  /* Carousel controls → ≥44px touch targets */
  .carousel-arrow{ width:44px; height:44px; }
  .carousel-dot{
    width:44px; height:44px; padding:17px;
    background-clip:content-box; box-sizing:border-box;
  }
}

/* Phones — reflow the hero, compact the tables */
@media (max-width:480px){
  .hero-title br{ display:none; }                 /* let the title reflow to the viewport */
  .hero-title{ font-size:clamp(1.75rem, 8vw, 2.6rem); }
  .authors-grid{ gap:8px 18px; }
  .content{ padding:28px 18px 56px; }
  .sub-heading{ font-size:1.08rem; }
  .results-table{ font-size:0.84rem; }
  .results-table th, .results-table td{ padding:8px 10px; }

  /* Concept motif compacts to near-baseline on phones */
  .transfer-motif{ --transfer-scale:1.05; }
}

/* =============== Reduced-motion — honour the OS preference =============== */
@media (prefers-reduced-motion: reduce){
  *, *::before, *::after{
    transition-duration:0.01ms !important;
    animation-duration:0.01ms !important;
    animation-iteration-count:1 !important;
    scroll-behavior:auto !important;
  }
}
