/* ---------------------------------------------------------------------------
   Beyond Pixels — project page
   Light theme: white canvas, pastel gradient wash, blue→purple→coral accents.
--------------------------------------------------------------------------- */

:root {
  --bg: #fbfbfe;
  --bg-soft: #f3f4fa;
  --panel: #eef0f7;
  --card: #ffffff;
  --text: #1a1c2b;
  --text-2: #3b4055;
  --muted: #5d6478;
  --line: rgba(26, 28, 43, 0.10);
  --blue: #4285f4;
  --purple: #9b72cb;
  --coral: #d96570;
  --accent: #4f7dff;
  --accent-line: rgba(79, 125, 255, 0.40);
  --accent-soft: rgba(79, 125, 255, 0.08);
  --accent-glow: rgba(79, 125, 255, 0.22);
  --green: #0f8f6d;
  --amber: #d97706;
  --grad: linear-gradient(90deg, #4285f4, #9b72cb 50%, #d96570);
  --shadow-1: 0 1px 2px rgba(26, 28, 43, 0.04), 0 14px 40px rgba(26, 28, 43, 0.07);
  --shadow-2: 0 2px 4px rgba(26, 28, 43, 0.05), 0 22px 56px rgba(26, 28, 43, 0.11);
  --radius: 18px;
  --maxw: 1080px;
  --font-title: "Exo 2", "Space Grotesk", sans-serif;
  --font-display: "Space Grotesk", "Inter", sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { background: var(--bg); color: var(--text); font-family: var(--font-body); font-size: 16px; line-height: 1.65; overflow-x: hidden; position: relative; }
::selection { background: rgba(155, 114, 203, 0.28); }
img { max-width: 100%; display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; }
code { font-family: var(--font-mono); font-size: 0.85em; background: rgba(26,28,43,0.06); color: var(--text); padding: 1px 6px; border-radius: 6px; }

/* ------------------------------ backdrop -------------------------------- */

.wash { position: absolute; left: 0; right: 0; top: 0; height: 1200px; z-index: -1; pointer-events: none;
  background: radial-gradient(70% 60% at 20% 10%, rgba(66,133,244,0.30), transparent 70%),
              radial-gradient(60% 55% at 78% 18%, rgba(155,114,203,0.30), transparent 70%),
              radial-gradient(55% 50% at 55% 62%, rgba(217,101,112,0.18), transparent 70%);
  mask-image: linear-gradient(to bottom, black 50%, transparent 100%); filter: blur(30px); }

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

#nav { position: fixed; top: 0; left: 0; right: 0; z-index: 50; display: flex; align-items: center; justify-content: space-between; padding: 14px clamp(18px, 4vw, 44px); transition: background 0.35s, border-color 0.35s, box-shadow 0.35s; border-bottom: 1px solid transparent; }
#nav.scrolled { background: rgba(251, 251, 254, 0.85); backdrop-filter: blur(14px); border-bottom-color: var(--line); }
.brand { font-family: var(--font-display); font-weight: 700; font-size: 17px; text-decoration: none; display: flex; align-items: center; gap: 9px; }
.brand-dot { width: 11px; height: 11px; border-radius: 50%; background: var(--grad); box-shadow: 0 0 12px rgba(155,114,203,0.6); }
.nav-links { display: flex; gap: clamp(12px, 2.4vw, 26px); }
.nav-links a { text-decoration: none; color: var(--muted); font-size: 14px; font-weight: 500; transition: color 0.2s; }
.nav-links a:hover { color: var(--text); }
.nav-cta { display: flex; align-items: center; gap: 7px; font-size: 13.5px; font-weight: 600; text-decoration: none; padding: 8px 15px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); box-shadow: var(--shadow-1); transition: border-color 0.25s, transform 0.25s, box-shadow 0.25s; }
.nav-cta:hover { border-color: var(--accent-line); transform: translateY(-1px); box-shadow: var(--shadow-2); }

/* -------------------------------- hero ---------------------------------- */

.hero { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 104px 20px 60px; position: relative; }
.hero-inner { max-width: 1040px; width: 100%; }
.venue-pill { display: inline-block; font-family: var(--font-mono); font-size: 12.5px; letter-spacing: 1.6px; text-transform: uppercase; color: #4f5bd5; padding: 7px 18px; border-radius: 999px; margin-bottom: 22px; border: 1px solid var(--accent-line); background: rgba(255,255,255,0.7); }
.hero h1 { font-family: var(--font-title); font-style: italic; font-weight: 900; font-size: clamp(50px, 8.2vw, 100px); letter-spacing: -0.02em; line-height: 1.02; padding-right: 0.06em; }
.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent; }
.subtitle { font-family: var(--font-display); font-size: clamp(16px, 2.4vw, 23px); color: var(--text); opacity: 0.88; margin-top: 12px; font-weight: 500; }
.authors { margin-top: 24px; font-size: clamp(14px, 1.7vw, 16px); display: flex; flex-wrap: wrap; gap: 6px 20px; justify-content: center; }
.authors a { text-decoration: none; border-bottom: 1px dashed var(--accent-line); color: var(--accent); }
.authors a:hover { color: var(--text); border-bottom-style: solid; }
.authors sup, .affils sup { color: var(--muted); }
.affils { margin-top: 8px; font-size: clamp(12px, 1.4vw, 13.5px); color: var(--muted); }
.hero-btns { display: flex; gap: 12px; justify-content: center; margin-top: 26px; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; font-size: 14.5px; font-weight: 600; padding: 12px 24px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); box-shadow: var(--shadow-1); transition: transform 0.22s, border-color 0.22s, box-shadow 0.22s; }
.btn:hover { transform: translateY(-2px); border-color: var(--accent-line); box-shadow: var(--shadow-2); }
.btn.primary { background: var(--grad); border: none; color: #fff; box-shadow: 0 8px 26px rgba(155, 114, 203, 0.35); }
.btn.primary:hover { box-shadow: 0 12px 34px rgba(155, 114, 203, 0.45); }
.scroll-cue { position: absolute; bottom: 22px; left: 50%; transform: translateX(-50%); width: 26px; height: 42px; border: 2px solid rgba(26,28,43,0.18); border-radius: 14px; }
.scroll-cue span { position: absolute; left: 50%; top: 7px; width: 4px; height: 8px; margin-left: -2px; border-radius: 3px; background: var(--purple); animation: cue 1.8s ease-in-out infinite; }
@keyframes cue { 0% { transform: translateY(0); opacity: 1; } 70% { transform: translateY(14px); opacity: 0; } 100% { opacity: 0; } }

/* ------------------------- shared frame & chip bits ------------------------ */

.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 0 rgba(52,211,153,0.6); animation: pulse 1.8s ease-out infinite; flex: none; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(52,211,153,0.6); } 100% { box-shadow: 0 0 0 10px rgba(52,211,153,0); } }
.slot-cap { display: block; font-family: var(--font-mono); font-size: 11px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted); margin-top: 9px; }
.slot-frame { position: relative; aspect-ratio: 3 / 4; border-radius: 14px; overflow: hidden; background: var(--panel); border: 1px solid var(--line); }
.slot-frame::before { content: ""; position: absolute; inset: -24px; background: var(--img) center / cover no-repeat; filter: blur(26px) saturate(1.2); opacity: 0.5; transform: scale(1.1); }
.slot-frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; transition: opacity 0.7s ease, transform 0.9s var(--ease-out), filter 0.9s ease; }
.res-frame { box-shadow: 0 0 0 1px rgba(155,114,203,0.35), 0 16px 40px rgba(155,114,203,0.22); }
.target-frame { width: 100%; aspect-ratio: 1 / 1; border-style: dashed; border-color: rgba(217,119,6,0.5); display: none; }
.viewer.is-image .target-frame { display: block; }
.viewer.is-image .target-chip { display: none; }

.target-chip { display: inline-flex; align-items: baseline; gap: 2px; font-family: var(--font-display); font-weight: 600; font-size: 17px; line-height: 1.25; color: var(--text); text-align: center;
  padding: 10px 16px; border-radius: 14px; border: 1px dashed rgba(217,119,6,0.55); background: rgba(245,158,11,0.10); max-width: 100%; }
.target-chip .chip-quote { color: var(--amber); font-size: 1.15em; }
.target-chip .chip-text { word-break: normal; overflow-wrap: break-word; hyphens: manual; }
.target-chip.big { font-size: clamp(18px, 2.1vw, 24px); padding: 14px 20px; }
.target-chip.small { font-size: 13px; padding: 4px 10px; border-radius: 9px; }
.target-chip.typing .chip-text::after { content: ""; display: inline-block; width: 2px; height: 0.95em; background: var(--amber); margin-left: 3px; vertical-align: -2px; animation: blink 0.9s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.stage-metaphor-label { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 1.4px; text-transform: uppercase; color: var(--accent); white-space: nowrap; }
.stage-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(26,28,43,0.06); }
.stage-progress i { display: block; height: 100%; width: 0; background: var(--grad); }

/* ------------------------- walkthrough (hero) ------------------------------ */

.walk { margin: 44px auto 0; max-width: 1010px; border-radius: 22px; padding: 18px 22px 22px; position: relative; text-align: left;
  background: rgba(255,255,255,0.86); border: 1px solid var(--line); box-shadow: var(--shadow-2), 0 0 80px rgba(155,114,203,0.10); backdrop-filter: blur(10px); overflow: hidden; }
.walk-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.walk-title { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 1.4px; text-transform: uppercase; color: var(--muted); }
.walk-steps { list-style: none; display: flex; gap: 6px; margin-left: auto; flex-wrap: wrap; }
.walk-steps li { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); padding: 4px 10px 4px 5px; border-radius: 999px; border: 1px solid transparent; cursor: pointer; transition: color 0.25s, border-color 0.25s, background 0.25s; }
.walk-steps li b { width: 18px; height: 18px; border-radius: 50%; font-family: var(--font-mono); font-size: 10.5px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; background: var(--panel); color: var(--muted); transition: background 0.25s, color 0.25s; }
.walk-steps li:hover { color: var(--text); }
.walk-steps li.done b { background: rgba(15,143,109,0.14); color: var(--green); }
.walk-steps li.on { color: var(--text); border-color: var(--accent-line); background: var(--accent-soft); }
.walk-steps li.on b { background: var(--grad); color: #fff; }

.walk-body { display: grid; grid-template-columns: 0.78fr 1.6fr 0.78fr; gap: 18px; align-items: center; }
.walk-img { text-align: center; min-width: 0; }
.walk-img .slot-frame img { cursor: zoom-in; }
.walk-img figcaption { margin-top: 9px; display: grid; gap: 3px; }
.cap-k { font-family: var(--font-mono); font-size: 11px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted); }
.cap-m { font-size: 12.5px; color: var(--text-2); font-style: italic; line-height: 1.4; }

/* progressive states: .r1 … .r6 are added cumulatively as the walkthrough advances */
.walk-ref { opacity: 0; transform: translateX(-14px); transition: opacity 0.7s ease, transform 0.7s var(--ease-out); }
.walk.r1 .walk-ref { opacity: 1; transform: none; }
.walk-res .slot-frame img { opacity: 0; filter: blur(16px); transform: scale(1.04); }
.walk.r5 .walk-res .slot-frame img { opacity: 1; filter: none; transform: none; }
.walk-res figcaption { opacity: 0; transition: opacity 0.5s 0.5s; }
.walk.r5 .walk-res figcaption { opacity: 1; }

.walk-mid { min-width: 0; }
.walk-agent { font-family: var(--font-mono); font-size: 11px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--accent); min-height: 18px; margin-bottom: 8px; }
.schema-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12.8px; table-layout: fixed; }
.schema-table col.c-k { width: 108px; }
.schema-table thead th { text-align: left; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted); font-weight: 500; padding: 0 10px 8px; vertical-align: middle; height: 34px; }
.schema-table .th-tgt .th-label { vertical-align: middle; }
.schema-table .th-tgt .target-chip.small { margin-left: 10px; vertical-align: middle; text-transform: none; letter-spacing: 0; font-size: 13px; opacity: 0; transform: scale(0.85); transition: opacity 0.4s, transform 0.4s var(--ease-out); }
.walk.r3 .th-tgt .target-chip.small { opacity: 1; transform: none; }
.schema-table tbody th, .schema-table tbody td { border-top: 1px solid var(--line); padding: 9px 10px; vertical-align: top; line-height: 1.45; transition: background 0.5s; }
.schema-table tbody th { text-align: left; font-weight: 600; font-size: 12px; color: var(--text); white-space: nowrap; }
.schema-table tbody td { color: var(--text-2); }
.k { display: inline-flex; width: 22px; height: 22px; border-radius: 7px; align-items: center; justify-content: center; font-family: var(--font-display); font-style: normal; font-weight: 600; font-size: 12px; color: var(--text); background: var(--panel); border: 1px solid var(--line); margin-right: 8px; vertical-align: middle; transition: background 0.4s, border-color 0.4s, box-shadow 0.4s, color 0.4s; }
.schema-table td.ref, .schema-table td.tgt { opacity: 0; transform: translateY(5px); transition: opacity 0.45s ease, transform 0.45s var(--ease-out); }
.row-s td { transition-delay: 0s !important; } .row-c td { transition-delay: 0.35s !important; } .row-g td { transition-delay: 0.7s !important; } .row-v td { transition-delay: 1.05s !important; } .row-i td { transition-delay: 1.4s !important; }
.walk.r2 td.ref { opacity: 1; transform: none; }
.walk.r4 td.tgt { opacity: 1; transform: none; }
.walk.r4 .row-g th, .walk.r4 .row-g td { background: var(--accent-soft); }
.walk.r4 .row-g .k { background: var(--grad); border-color: transparent; color: #fff; box-shadow: 0 0 14px var(--accent-glow); }
.badge { display: inline-block; margin-left: 6px; font-family: var(--font-mono); font-size: 9.5px; font-weight: 600; font-style: normal; letter-spacing: 0.8px; text-transform: uppercase; padding: 2px 6px; border-radius: 999px; vertical-align: 1px; }
.badge.new { color: #b45309; border: 1px solid rgba(180,83,9,0.4); background: rgba(180,83,9,0.07); }
.badge.kept { color: #0f766e; border: 1px solid rgba(15,118,110,0.4); background: rgba(15,118,110,0.07); }
.badge.aligned { color: #6d28d9; border: 1px solid rgba(109,40,217,0.35); background: rgba(109,40,217,0.07); }

.walk-checks { margin-top: 12px; padding-top: 11px; border-top: 1px dashed var(--line); display: flex; align-items: center; gap: 14px; visibility: hidden; opacity: 0; transition: opacity 0.4s; }
.walk.r6 .walk-checks { visibility: visible; opacity: 1; }
.walk-checks ul { list-style: none; display: grid; gap: 6px; font-size: 12.5px; color: var(--text-2); flex: 1; min-width: 0; }
.walk-checks li { display: flex; gap: 8px; align-items: baseline; opacity: 0; transform: translateX(-6px); transition: opacity 0.4s, transform 0.4s var(--ease-out); }
.walk-checks li:nth-child(1) { transition-delay: 0.1s; } .walk-checks li:nth-child(2) { transition-delay: 0.45s; } .walk-checks li:nth-child(3) { transition-delay: 0.8s; } .walk-checks li:nth-child(4) { transition-delay: 1.15s; }
.walk.r6 .walk-checks li { opacity: 1; transform: none; }
.walk-checks b { color: var(--text); font-weight: 600; white-space: nowrap; }
.tick { width: 14px; height: 14px; border-radius: 50%; background: rgba(15,143,109,0.12); border: 1px solid rgba(15,143,109,0.55); position: relative; flex: none; top: 2px; }
.tick::after { content: ""; position: absolute; left: 4px; top: 1px; width: 3.5px; height: 7px; border-right: 2px solid var(--green); border-bottom: 2px solid var(--green); transform: rotate(45deg); }
.walk-pass { flex: none; font-family: var(--font-mono); font-size: 12px; font-weight: 700; letter-spacing: 1.6px; color: var(--green); border: 1px solid rgba(15,143,109,0.45); border-radius: 999px; padding: 7px 13px; background: rgba(15,143,109,0.06); box-shadow: 0 0 18px rgba(15,143,109,0.18); opacity: 0; transform: scale(0.8); transition: opacity 0.4s 1.6s, transform 0.4s var(--ease-out) 1.6s; }
.walk.r6 .walk-pass { opacity: 1; transform: none; }

/* ------------------------------- task tiles -------------------------------- */

.strip { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--bg-soft); }
.strip-inner { max-width: var(--maxw); margin: 0 auto; padding: 34px 24px; display: grid; }
.strip-inner.tiles { grid-template-columns: repeat(3, 1fr); gap: 16px; align-items: stretch; }
.tile { padding: 18px 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); box-shadow: var(--shadow-1); }
.tile-k { display: block; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 1.4px; text-transform: uppercase; color: var(--accent); margin-bottom: 8px; }
.tile p { font-size: 14px; color: var(--text-2); }
.tile b { color: var(--text); }

/* ------------------------------ sections --------------------------------- */

main { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.section { padding: 88px 0 10px; }
.sec-head { margin-bottom: 28px; }
.sec-head h2 { font-family: var(--font-display); font-size: clamp(30px, 4.6vw, 44px); font-weight: 700; letter-spacing: -0.02em; display: flex; align-items: baseline; gap: 16px; color: var(--text); }
.index { font-family: var(--font-mono); font-size: 0.42em; color: transparent; -webkit-text-stroke: 1px var(--purple); letter-spacing: 2px; }
.sec-sub { margin-top: 10px; max-width: 760px; color: var(--muted); font-size: 15px; }
.sec-sub b { color: var(--text); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(22px, 3.4vw, 36px); box-shadow: var(--shadow-1); }
.abstract-text { text-align: justify; color: var(--text-2); font-size: 15.8px; }
.abstract-text b { color: var(--text); }
.frame { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: #fff; margin: 26px 0; box-shadow: var(--shadow-1); }
.frame img { cursor: zoom-in; }

/* ------------------------------ case cards -------------------------------- */

.grid { display: grid; gap: 18px; }
.text-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.image-grid { grid-template-columns: 1fr; max-width: 920px; margin: 0 auto; }

.case { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 18px 14px; box-shadow: var(--shadow-1); cursor: pointer;
  transition: transform 0.3s var(--ease-out), border-color 0.3s, box-shadow 0.3s; opacity: 0; transform: translateY(26px); }
.case.in { opacity: 1; transform: none; transition: opacity 0.7s ease, transform 0.7s var(--ease-out), border-color 0.3s, box-shadow 0.3s; }
.case:hover { border-color: var(--accent-line); box-shadow: var(--shadow-2), 0 0 50px rgba(155,114,203,0.10); transform: translateY(-4px); }
.case-num { position: absolute; top: 12px; left: 16px; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 1.2px; color: rgba(93,100,120,0.7); }
.case.lone { grid-column: 1 / -1; justify-self: center; width: 100%; max-width: calc(50% - 9px); }

.eq { display: grid; align-items: center; gap: 10px; margin-top: 8px; }
.eq.two { grid-template-columns: 1fr 22px minmax(112px, 0.95fr) 34px 1fr; }
.eq.three { grid-template-columns: 1fr 30px 0.72fr 54px 1fr; gap: 14px; }

.slot { min-width: 0; text-align: center; }
.tag { display: block; font-family: var(--font-mono); font-size: 10px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted); margin-top: 8px; }
.slot.res .tag { color: var(--purple); }
.slot.tgt .tag { color: var(--amber); }

.fimg { position: relative; aspect-ratio: 3 / 4; border-radius: 12px; overflow: hidden; background: var(--panel); border: 1px solid var(--line); }
.fimg::before { content: ""; position: absolute; inset: -24px; background: var(--img) center / cover no-repeat; filter: blur(24px) saturate(1.2); opacity: 0.45; transform: scale(1.1); }
.fimg img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.fimg.square { aspect-ratio: 1 / 1; border-style: dashed; border-color: rgba(217,119,6,0.45); }
.slot.res .fimg { box-shadow: 0 0 0 1px rgba(155,114,203,0.3), 0 12px 32px rgba(155,114,203,0.18); transition: transform 0.4s var(--ease-out), box-shadow 0.4s; }
.case:hover .slot.res .fimg { transform: scale(1.025); box-shadow: 0 0 0 1px rgba(155,114,203,0.6), 0 18px 44px rgba(155,114,203,0.28); }

.op { font-family: var(--font-display); font-size: 26px; color: var(--muted); text-align: center; }
/* arrow = gradient line + CSS chevron; the chevron's tip lands exactly on the line end */
.op.arrow { display: flex; align-items: center; padding-right: 2px; }
.op.arrow i { flex: 1; height: 2px; border-radius: 2px 0 0 2px; background: linear-gradient(90deg, rgba(66,133,244,0.15), #4285f4, #9b72cb); transform-origin: left; transform: scaleX(0); transition: transform 0.6s var(--ease-out) 0.45s; }
.op.arrow b { flex: none; width: 10px; height: 10px; margin-left: -12px; border-top: 2px solid var(--purple); border-right: 2px solid var(--purple); border-radius: 0 1px 0 0; transform: rotate(45deg); opacity: 0; transition: opacity 0.3s 0.9s; }
.case.in .op.arrow i { transform: scaleX(1); }
.case.in .op.arrow b { opacity: 1; }

.slot.tgt { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; }
.slot.tgt .fimg { width: 100%; align-self: stretch; }
.slot.tgt .target-chip { font-size: 13.5px; padding: 8px 10px; transform: scale(0.85); opacity: 0; transition: transform 0.5s var(--ease-out) 0.3s, opacity 0.5s 0.3s; }
.case.in .slot.tgt .target-chip { transform: none; opacity: 1; }

/* reveal choreography */
.slot.ref { transform: translateX(-18px); opacity: 0; transition: transform 0.7s var(--ease-out) 0.05s, opacity 0.7s 0.05s; }
.case.in .slot.ref { transform: none; opacity: 1; }
.slot.res .fimg img { filter: blur(16px); opacity: 0; transform: scale(1.04); transition: filter 0.9s ease 0.75s, opacity 0.7s ease 0.75s, transform 0.9s var(--ease-out) 0.75s; }
.case.in .slot.res .fimg img { filter: none; opacity: 1; transform: none; }
.eq .op:not(.arrow) { opacity: 0; transform: scale(0.6); transition: opacity 0.4s 0.35s, transform 0.4s var(--ease-out) 0.35s; }
.case.in .eq .op:not(.arrow) { opacity: 1; transform: none; }

.case-foot { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.metaphor { font-size: 13px; color: var(--muted); }
.metaphor .stage-metaphor-label { margin-right: 8px; }

/* theory block: Conceptual Blending Theory */
.theory { display: grid; grid-template-columns: 1.05fr 1fr; gap: 28px; align-items: center; margin-bottom: 38px; }
.theory-fig { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: #fff; padding: 16px; box-shadow: var(--shadow-1); }
.theory-fig img { cursor: zoom-in; }
.theory-kicker { font-family: var(--font-mono); font-size: 11px; letter-spacing: 1.6px; text-transform: uppercase; color: var(--accent); margin-bottom: 8px; }
.theory-text h3 { font-family: var(--font-display); font-size: 26px; font-weight: 700; letter-spacing: -0.01em; margin-bottom: 10px; color: var(--text); }
.theory-lead { color: var(--text-2); font-size: 15px; margin-bottom: 18px; }
.spaces { list-style: none; display: grid; gap: 13px; }
.spaces li { display: grid; grid-template-columns: 16px 1fr; column-gap: 12px; row-gap: 2px; font-size: 14px; color: var(--muted); align-items: start; }
.spaces li b { color: var(--text); font-family: var(--font-display); font-weight: 600; font-size: 15px; }
.spaces li > span:last-child { grid-column: 2; }
.spaces em { color: var(--purple); font-style: normal; font-weight: 500; }
.sp { width: 14px; height: 14px; border-radius: 50%; margin-top: 4px; }
.sp1 { background: linear-gradient(90deg, #f0876b 50%, #6aa5dc 50%); }
.sp3 { border: 2px dashed #8b93a8; background: rgba(26,28,43,0.04); }
.sp4 { background: #7fc7a5; box-shadow: 0 0 0 3px rgba(127,199,165,0.3); }
.theory-bridge { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 14px; color: var(--text-2); }

/* schema chips */
.schema { text-align: center; margin: 4px 0 8px; }
.chips { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.chip { position: relative; font-family: var(--font-display); font-weight: 600; font-size: 19px; width: 58px; height: 58px; display: inline-flex; align-items: center; justify-content: center; border-radius: 16px; border: 1px solid var(--line); background: var(--card); color: var(--text); box-shadow: var(--shadow-1); cursor: default; transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s; }
.chip sub { font-size: 11px; margin-left: 1px; }
.chip:hover { transform: translateY(-4px); border-color: var(--accent-line); box-shadow: var(--shadow-2); }
.chip.invariant { background: linear-gradient(140deg, rgba(66,133,244,0.14), rgba(155,114,203,0.16)); border-color: var(--accent-line); box-shadow: 0 0 22px var(--accent-glow); }
.chip::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 12px); left: 50%; transform: translateX(-50%) translateY(4px); width: 240px; padding: 10px 13px; border-radius: 12px; font-family: var(--font-body); font-weight: 400; font-size: 12.5px; line-height: 1.45; color: #fff; background: #1a1c2b; box-shadow: 0 14px 38px rgba(26,28,43,0.3); opacity: 0; pointer-events: none; transition: opacity 0.18s, transform 0.18s; z-index: 5; }
.chip:hover::after { opacity: 1; transform: translateX(-50%) translateY(0); }
.schema-note { margin-top: 15px; font-size: 13px; color: var(--muted); }
.schema-note b { color: var(--accent); }
.dot-invariant { display: inline-block; width: 9px; height: 9px; border-radius: 3px; background: var(--grad); margin-right: 4px; }

/* agents & loop */
.agents { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.agent { transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s; }
.agent:hover { transform: translateY(-5px); border-color: var(--accent-line); box-shadow: var(--shadow-2); }
.agent-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.agent h3 { font-family: var(--font-display); font-size: 16.5px; font-weight: 600; color: var(--text); }
.agent p { font-size: 13.8px; color: var(--muted); }
.agent-ico { width: 40px; height: 40px; flex: none; display: inline-flex; align-items: center; justify-content: center; border-radius: 12px; font-size: 18px; }
.i1 { background: rgba(66,133,244,0.14); box-shadow: 0 0 18px rgba(66,133,244,0.18); }
.i2 { background: rgba(155,114,203,0.16); box-shadow: 0 0 18px rgba(155,114,203,0.18); }
.i3 { background: rgba(217,101,112,0.14); box-shadow: 0 0 18px rgba(217,101,112,0.16); }
.i4 { background: rgba(15,143,109,0.12); box-shadow: 0 0 18px rgba(15,143,109,0.16); }
.loop { margin-top: 14px; }
.loop-title { font-size: 15px; margin-bottom: 14px; color: var(--text); }
.tau { color: var(--muted); font-size: 13px; }
.loop-rows { display: grid; gap: 9px; }
.loop-row { display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--text-2); }
.arrow { color: var(--muted); }
.lv { font-family: var(--font-mono); font-size: 12px; padding: 5px 12px; border-radius: 999px; white-space: nowrap; }
.lv1 { background: rgba(15,118,110,0.08); color: #0f766e; border: 1px solid rgba(15,118,110,0.35); }
.lv2 { background: rgba(109,40,217,0.07); color: #6d28d9; border: 1px solid rgba(109,40,217,0.3); }
.lv3 { background: rgba(190,24,93,0.07); color: #be185d; border: 1px solid rgba(190,24,93,0.3); }

/* quantitative */
.quant-title { font-size: 15px; margin-bottom: 22px; color: var(--text); }
.quant-sub { color: var(--muted); font-size: 12.5px; display: inline-block; }
.charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 30px; }
.chart h4 { font-family: var(--font-display); font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 13px; letter-spacing: 0.3px; }
.bar-row { display: grid; grid-template-columns: 88px 1fr 40px; align-items: center; gap: 10px; margin-bottom: 9px; }
.bar-name { font-size: 12px; color: var(--muted); text-align: right; }
.bar { height: 12px; border-radius: 7px; background: rgba(26,28,43,0.07); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; border-radius: 7px; background: rgba(26,28,43,0.22); transition: width 1.1s var(--ease-out); }
.in-view .bar i { width: var(--v); }
.bar-val { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.bar-row.ours .bar-name, .bar-row.ours .bar-val { color: var(--text); font-weight: 600; }
.bar-row.ours .bar i { background: var(--grad); box-shadow: 0 0 12px rgba(155,114,203,0.4); }
.quant-foot { margin-top: 20px; font-size: 13.5px; color: var(--muted); }
.quant-foot b { color: var(--accent); }
.cmp { margin-top: 22px; border-top: 1px solid var(--line); padding-top: 16px; }
.cmp summary { cursor: pointer; font-size: 14px; color: var(--accent); list-style: none; display: flex; align-items: center; gap: 10px; }
.cmp summary::before { content: "▸"; color: var(--purple); transition: transform 0.25s; }
.cmp[open] summary::before { transform: rotate(90deg); }
.cmp img { margin-top: 16px; border-radius: 12px; border: 1px solid var(--line); cursor: zoom-in; background: #fff; }

/* skill */
.skill-grid { display: grid; grid-template-columns: 1fr 1.05fr; gap: 18px; align-items: stretch; }
.skill-lead { font-size: 15px; color: var(--text-2); margin-bottom: 16px; }
.skill-lead b { color: var(--text); }
.skill-steps { padding-left: 20px; display: grid; gap: 10px; font-size: 14px; color: var(--muted); }
.skill-steps li::marker { color: var(--purple); font-weight: 700; }
.terminal { border-radius: var(--radius); border: 1px solid rgba(26,28,43,0.2); background: #0f1220; overflow: hidden; box-shadow: var(--shadow-2); display: flex; flex-direction: column; color: #e7e9f0; }
.term-bar { display: flex; align-items: center; gap: 7px; padding: 12px 16px; background: rgba(255,255,255,0.05); border-bottom: 1px solid rgba(255,255,255,0.08); }
.term-bar span { width: 11px; height: 11px; border-radius: 50%; }
.term-bar span:nth-child(1) { background: #f87171; } .term-bar span:nth-child(2) { background: #fbbf24; } .term-bar span:nth-child(3) { background: #34d399; }
.term-bar em { font-style: normal; font-family: var(--font-mono); font-size: 11.5px; color: #9aa3bd; margin-left: 8px; }
.term-body { padding: 20px 20px 18px; font-family: var(--font-mono); font-size: 13px; flex: 1; }
.prompt-sign { color: #7fb4ff; }
.term-line { color: #e7e9f0; min-height: 40px; }
.caret { display: inline-block; width: 8px; height: 15px; background: #7fb4ff; vertical-align: -2px; animation: blink 1s steps(1) infinite; }
.term-out { color: #9aa3bd; margin-top: 9px; }
.term-out .ok { color: #34d399; }
.copy-btn { margin-top: 16px; font-size: 12.5px; font-weight: 600; background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 8px 16px; cursor: pointer; transition: border-color 0.2s, color 0.2s; color: var(--text); }
.copy-btn:hover { border-color: var(--accent-line); }
.copy-btn.copied { border-color: var(--green); color: var(--green); }
.terminal .copy-btn { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.14); color: #e7e9f0; }
.terminal .copy-btn:hover { border-color: rgba(127,180,255,0.6); }
.terminal .copy-btn.copied { border-color: #34d399; color: #34d399; }

/* bibtex */
.bib { position: relative; }
.bib pre { font-family: var(--font-mono); font-size: 13px; line-height: 1.7; color: #2b3150; overflow-x: auto; }
.bib .copy-btn { position: absolute; top: 18px; right: 18px; margin: 0; }

/* footer */
footer { border-top: 1px solid var(--line); margin-top: 90px; background: var(--bg-soft); }
.foot-inner { max-width: var(--maxw); margin: 0 auto; padding: 36px 24px 44px; text-align: center; }
.more-works { font-size: 14px; color: var(--muted); }
.more-works a { color: var(--accent); text-decoration: none; border-bottom: 1px dashed var(--accent-line); }
.more-works a:hover { color: var(--text); }
.foot-note { margin-top: 12px; font-size: 12.5px; color: rgba(93,100,120,0.8); }

/* ------------------------------ case viewer (dark overlay) ---------------- */

.viewer { position: fixed; inset: 0; z-index: 100; background: rgba(10, 12, 24, 0.94); backdrop-filter: blur(10px); display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: opacity 0.28s; padding: 24px; color: #eef1fb; }
.viewer.open { opacity: 1; pointer-events: auto; }
.viewer-body { width: min(1180px, 100%); }
.viewer-eq { display: grid; grid-template-columns: 1fr 40px minmax(160px, 0.7fr) 60px 1fr; gap: 18px; align-items: center; }
.v-slot { text-align: center; min-width: 0; }
.v-slot figcaption { font-family: var(--font-mono); font-size: 11px; letter-spacing: 1.2px; text-transform: uppercase; color: #9aa3bd; margin-top: 10px; }
.v-frame { position: relative; aspect-ratio: 3 / 4; max-height: 64vh; margin: 0 auto; border-radius: 16px; overflow: hidden; background: #12162a; border: 1px solid rgba(255,255,255,0.1); }
.v-frame::before { content: ""; position: absolute; inset: -30px; background: var(--img) center / cover no-repeat; filter: blur(30px) saturate(1.25); opacity: 0.55; transform: scale(1.1); }
.v-frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; transition: opacity 0.35s; }
.v-frame.target-frame { aspect-ratio: 1 / 1; max-height: 40vh; border-color: rgba(251,191,36,0.55); }
.v-frame.res-frame { box-shadow: 0 0 0 1px rgba(155,114,203,0.5), 0 20px 60px rgba(66,133,244,0.3); }
.viewer.switching .v-frame img { opacity: 0; }
.v-op { font-family: var(--font-display); font-size: 40px; color: #9aa3bd; text-align: center; }
.v-target { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; }
.viewer .target-chip { color: #fff; border-color: rgba(251,191,36,0.6); background: rgba(251,191,36,0.12); }
.viewer .target-chip .chip-quote { color: #fbbf24; }
.viewer .slot-cap { color: #9aa3bd; }
.viewer-variants { display: flex; gap: 10px; justify-content: center; margin-top: 18px; min-height: 0; }
.viewer-meta { justify-content: center; margin-top: 16px; font-size: 15px; color: #cdd2e1; display: flex; gap: 12px; align-items: baseline; min-height: 24px; }
.viewer-meta .stage-metaphor-label { color: #7fb4ff; }
.viewer-close, .viewer-nav { position: fixed; z-index: 101; border: 1px solid rgba(255,255,255,0.12); background: rgba(255,255,255,0.07); color: #fff; cursor: pointer; border-radius: 50%; display: flex; align-items: center; justify-content: center; transition: background 0.2s, transform 0.2s; }
.viewer-close { top: 20px; right: 22px; width: 42px; height: 42px; font-size: 16px; }
.viewer-nav { top: 50%; transform: translateY(-50%); width: 48px; height: 48px; font-size: 30px; line-height: 1; padding-bottom: 4px; }
.viewer-nav.prev { left: 18px; } .viewer-nav.next { right: 18px; }
.viewer-close:hover, .viewer-nav:hover { background: rgba(255,255,255,0.16); }
.viewer-nav:hover { transform: translateY(-50%) scale(1.06); }
.viewer.no-nav .viewer-nav { display: none; }

/* simple image lightbox (figures) */
.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(10, 12, 24, 0.93); backdrop-filter: blur(8px); display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 14px; opacity: 0; pointer-events: none; transition: opacity 0.25s; cursor: zoom-out; padding: 4vh 3vw; }
.lightbox.open { opacity: 1; pointer-events: auto; }
.lightbox img { max-width: 94vw; max-height: 88vh; border-radius: 12px; box-shadow: 0 40px 120px rgba(0,0,0,0.6); }
.lb-hint { font-size: 12px; color: #9aa3bd; font-family: var(--font-mono); }

/* ------------------------------ reveal anim ------------------------------- */

.reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.7s ease, transform 0.7s var(--ease-out); }
.reveal.in { opacity: 1; transform: none; }
.d1 { transition-delay: 0.08s; } .d2 { transition-delay: 0.16s; } .d3 { transition-delay: 0.24s; } .d4 { transition-delay: 0.32s; } .d5 { transition-delay: 0.42s; }

/* ------------------------------ responsive -------------------------------- */

@media (max-width: 900px) {
  .nav-links { display: none; }
  .strip-inner.tiles { grid-template-columns: 1fr; gap: 12px; }
  .skill-grid { grid-template-columns: 1fr; }
  .text-grid { grid-template-columns: 1fr; }
  .case.lone { max-width: none; }
  .theory { grid-template-columns: 1fr; gap: 20px; }
  .walk { padding: 16px 14px 18px; }
  .walk-steps { margin-left: 0; }
  .walk-body { grid-template-columns: 1fr 1fr; }
  .walk-mid { grid-column: 1 / -1; }
  .schema-table col.c-k { width: 92px; }
  .target-chip.big { font-size: 15px; padding: 10px 12px; }
  .viewer-eq { grid-template-columns: 1fr 24px minmax(90px, 0.7fr) 30px 1fr; gap: 10px; }
  .v-op { font-size: 26px; }
  .v-frame { max-height: 48vh; }
  .viewer-nav { display: none; }
}
@media (max-width: 520px) {
  .eq.two, .eq.three { grid-template-columns: 1fr 18px minmax(70px, 0.7fr) 26px 1fr; gap: 6px; }
  .op { font-size: 18px; } .op.arrow b { width: 8px; height: 8px; margin-left: -10px; }
  .slot.tgt .target-chip { font-size: 12px; padding: 7px 8px; }
  .case { padding: 14px 12px 12px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal, .case { opacity: 1; transform: none; transition: none; }
  .slot.ref, .slot.res .fimg img, .slot.tgt .target-chip, .eq .op:not(.arrow) { opacity: 1; transform: none; filter: none; transition: none; }
  .op.arrow i { transform: none; } .op.arrow b { opacity: 1; }
  .caret, .scroll-cue span, .live-dot { animation: none; }
  .walk-ref, .walk-res .slot-frame img, .walk-res figcaption, .schema-table td.ref, .schema-table td.tgt, .th-tgt .target-chip.small, .walk-checks, .walk-checks li, .walk-pass { opacity: 1; transform: none; filter: none; visibility: visible; transition: none; }
  .bar i { transition: none; } .in-view .bar i { width: var(--v); }
}
