/* ---------------------------------------------------------------------------
   Beyond Pixels — project page
   Dark glassmorphism theme with aurora backdrop.
--------------------------------------------------------------------------- */

:root {
  --bg: #07090f;
  --bg-soft: #0b0e18;
  --text: #e7e9f0;
  --muted: #9aa1b5;
  --line: rgba(255, 255, 255, 0.08);
  --glass: rgba(255, 255, 255, 0.04);
  --glass-strong: rgba(255, 255, 255, 0.07);
  --indigo: #6366f1;
  --violet: #a855f7;
  --cyan: #22d3ee;
  --grad: linear-gradient(100deg, #818cf8, #c084fc 45%, #22d3ee);
  --radius: 18px;
  --maxw: 1080px;
  --font-display: "Space Grotesk", "Inter", sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
}

* { 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;
}
::selection { background: rgba(168, 85, 247, 0.4); }
img { max-width: 100%; display: block; }
a { color: inherit; }
code { font-family: var(--font-mono); font-size: 0.85em; background: rgba(255,255,255,0.07); padding: 1px 6px; border-radius: 6px; }

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

#stars { position: fixed; inset: 0; z-index: -3; }

.aurora { position: fixed; inset: 0; z-index: -2; overflow: hidden; filter: blur(90px) saturate(130%); }
.blob { position: absolute; border-radius: 50%; opacity: 0.5; will-change: transform; }
.b1 { width: 55vw; height: 55vw; left: -12vw; top: -18vw; background: radial-gradient(circle, rgba(99,102,241,0.55), transparent 65%); animation: drift1 26s ease-in-out infinite alternate; }
.b2 { width: 48vw; height: 48vw; right: -14vw; top: 4vw; background: radial-gradient(circle, rgba(168,85,247,0.42), transparent 65%); animation: drift2 32s ease-in-out infinite alternate; }
.b3 { width: 42vw; height: 42vw; left: 28vw; top: 34vw; background: radial-gradient(circle, rgba(34,211,238,0.3), transparent 65%); animation: drift3 38s ease-in-out infinite alternate; }
@keyframes drift1 { to { transform: translate(9vw, 7vw) scale(1.12); } }
@keyframes drift2 { to { transform: translate(-8vw, 9vw) scale(0.92); } }
@keyframes drift3 { to { transform: translate(-6vw, -9vw) scale(1.08); } }

body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,0.028) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(255,255,255,0.028) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, black 30%, transparent 78%);
}

/* -------------------------------- 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, backdrop-filter 0.35s;
  border-bottom: 1px solid transparent;
}
#nav.scrolled { background: rgba(7, 9, 15, 0.72); 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; letter-spacing: 0.2px; }
.brand-dot { width: 11px; height: 11px; border-radius: 50%; background: var(--grad); box-shadow: 0 0 14px rgba(168,85,247,0.9); }
.nav-links { display: flex; gap: clamp(12px, 2.4vw, 28px); }
.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(--glass);
  transition: border-color 0.25s, background 0.25s, transform 0.25s;
}
.nav-cta:hover { border-color: rgba(168,85,247,0.6); background: var(--glass-strong); transform: translateY(-1px); }

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

.hero { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 110px 20px 40px; position: relative; }
.hero-inner { max-width: 980px; }

.venue-pill {
  display: inline-block; font-family: var(--font-mono); font-size: 12.5px; letter-spacing: 1.6px; text-transform: uppercase;
  color: #c7c9ff; padding: 7px 18px; border-radius: 999px; margin-bottom: 26px;
  border: 1px solid rgba(129, 140, 248, 0.35); background: rgba(99, 102, 241, 0.1);
  box-shadow: 0 0 24px rgba(99, 102, 241, 0.25) inset;
}

.hero h1 { font-family: var(--font-display); font-size: clamp(52px, 9vw, 108px); font-weight: 700; letter-spacing: -0.025em; line-height: 1.02; }
.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.subtitle { font-family: var(--font-display); font-size: clamp(17px, 2.6vw, 25px); color: var(--text); opacity: 0.92; margin-top: 14px; font-weight: 500; }

.authors { margin-top: 30px; font-size: clamp(14px, 1.8vw, 16.5px); display: flex; flex-wrap: wrap; gap: 6px 20px; justify-content: center; }
.authors a { text-decoration: none; border-bottom: 1px dashed rgba(199, 201, 255, 0.5); color: #c7c9ff; }
.authors a:hover { color: #fff; border-bottom-style: solid; }
.authors sup, .affils sup { color: var(--muted); }
.affils { margin-top: 10px; font-size: clamp(12px, 1.5vw, 13.5px); color: var(--muted); }

.hero-btns { display: flex; gap: 13px; justify-content: center; margin-top: 30px; 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(--glass); backdrop-filter: blur(8px);
  transition: transform 0.22s, border-color 0.22s, background 0.22s, box-shadow 0.22s;
}
.btn:hover { transform: translateY(-2px); border-color: rgba(255,255,255,0.25); background: var(--glass-strong); }
.btn.primary { background: var(--grad); border: none; color: #fff; box-shadow: 0 8px 30px rgba(139, 92, 246, 0.4); }
.btn.primary:hover { box-shadow: 0 12px 40px rgba(139, 92, 246, 0.55); }

.teaser-frame {
  margin-top: 52px; border-radius: var(--radius); padding: 10px; position: relative;
  background: linear-gradient(160deg, rgba(255,255,255,0.1), rgba(255,255,255,0.03));
  border: 1px solid var(--line); box-shadow: 0 30px 90px rgba(0,0,0,0.55), 0 0 80px rgba(99,102,241,0.14);
  transform-style: preserve-3d; will-change: transform;
}
.teaser-frame img { border-radius: calc(var(--radius) - 7px); cursor: zoom-in; }
.teaser-frame figcaption { font-size: 13px; color: var(--muted); padding: 12px 10px 4px; }

.scroll-cue { position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%); width: 26px; height: 42px; border: 2px solid rgba(255,255,255,0.25); border-radius: 14px; }
.scroll-cue span { position: absolute; left: 50%; top: 7px; width: 4px; height: 8px; margin-left: -2px; border-radius: 3px; background: var(--cyan); 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; } }

/* ------------------------------- strip ---------------------------------- */

.strip { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: rgba(255,255,255,0.02); backdrop-filter: blur(6px); }
.strip-inner { max-width: var(--maxw); margin: 0 auto; padding: 40px 24px; display: grid; grid-template-columns: 1.4fr 1fr; gap: 36px; align-items: center; }
.tldr { font-size: 16.5px; color: #cdd2e1; }
.tldr b { color: #fff; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.stat { text-align: center; }
.stat .num { font-family: var(--font-display); font-weight: 700; font-size: 30px; display: block; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat .lab { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.6px; line-height: 1.35; display: block; margin-top: 2px; }

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

main { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.section { padding: 92px 0 20px; }
.section h2 { font-family: var(--font-display); font-size: clamp(30px, 4.6vw, 44px); font-weight: 700; letter-spacing: -0.02em; margin-bottom: 30px; display: flex; align-items: baseline; gap: 16px; }
.index { font-family: var(--font-mono); font-size: 0.42em; color: transparent; -webkit-text-stroke: 1px rgba(168,85,247,0.75); letter-spacing: 2px; }

.card {
  background: var(--glass); border: 1px solid var(--line); border-radius: var(--radius);
  padding: clamp(22px, 3.4vw, 36px); backdrop-filter: blur(10px);
}
.abstract-text { text-align: justify; color: #ccd1e0; font-size: 15.8px; }
.abstract-text b { color: #fff; }

.frame { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: #fff; margin: 26px 0; box-shadow: 0 24px 70px rgba(0,0,0,0.45); }
.frame img { cursor: zoom-in; }

/* schema chips */
.schema { text-align: center; margin-bottom: 8px; }
.schema-title { color: var(--muted); font-size: 14.5px; margin-bottom: 16px; }
.schema-title b { color: var(--text); }
.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(--glass-strong); 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: rgba(129,140,248,0.7); box-shadow: 0 10px 26px rgba(99,102,241,0.25); }
.chip.invariant { background: linear-gradient(140deg, rgba(34,211,238,0.2), rgba(99,102,241,0.22)); border-color: rgba(34,211,238,0.55); box-shadow: 0 0 22px rgba(34,211,238,0.22); }
.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: var(--text); background: rgba(14, 17, 28, 0.97); border: 1px solid var(--line); box-shadow: 0 14px 38px rgba(0,0,0,0.5);
  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(--cyan); }
.dot-invariant { display: inline-block; width: 9px; height: 9px; border-radius: 3px; background: linear-gradient(140deg, var(--cyan), var(--indigo)); margin-right: 4px; vertical-align: baseline; }

/* agent cards */
.agents { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; margin-top: 4px; }
.agent { transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s; }
.agent:hover { transform: translateY(-5px); border-color: rgba(168,85,247,0.45); box-shadow: 0 16px 44px rgba(0,0,0,0.4); }
.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; }
.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(99,102,241,0.18); box-shadow: 0 0 18px rgba(99,102,241,0.22); }
.i2 { background: rgba(168,85,247,0.18); box-shadow: 0 0 18px rgba(168,85,247,0.22); }
.i3 { background: rgba(236,72,153,0.15); box-shadow: 0 0 18px rgba(236,72,153,0.2); }
.i4 { background: rgba(34,211,238,0.15); box-shadow: 0 0 18px rgba(34,211,238,0.2); }

/* backtracking loop */
.loop { margin-top: 14px; }
.loop-title { font-size: 15px; margin-bottom: 14px; }
.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: #ccd1e0; }
.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(34,211,238,0.12); color: #7de6f5; border: 1px solid rgba(34,211,238,0.35); }
.lv2 { background: rgba(168,85,247,0.12); color: #d3a4fb; border: 1px solid rgba(168,85,247,0.35); }
.lv3 { background: rgba(244,114,182,0.1); color: #f9a8d4; border: 1px solid rgba(244,114,182,0.3); }

/* ------------------------------- results --------------------------------- */

.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.tab {
  font-family: var(--font-body); font-size: 14px; font-weight: 600; color: var(--muted);
  background: var(--glass); border: 1px solid var(--line); border-radius: 999px; padding: 10px 20px; cursor: pointer;
  transition: color 0.2s, background 0.25s, border-color 0.25s, box-shadow 0.25s;
}
.tab:hover { color: var(--text); }
.tab.active { color: #fff; background: linear-gradient(120deg, rgba(99,102,241,0.35), rgba(168,85,247,0.35)); border-color: rgba(168,85,247,0.6); box-shadow: 0 6px 24px rgba(139,92,246,0.28); }

.gallery { position: relative; }
.pane { display: none; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: #fff; box-shadow: 0 24px 70px rgba(0,0,0,0.45); }
.pane.active { display: block; animation: fadeUp 0.5s ease both; }
.pane img { cursor: zoom-in; }
.pane figcaption { background: var(--bg-soft); color: var(--muted); font-size: 13.5px; padding: 14px 18px; border-top: 1px solid var(--line); }
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* quantitative bars */
.quant { margin-top: 26px; }
.quant-title { font-size: 15px; margin-bottom: 22px; }
.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: #cdd2e1; 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(255,255,255,0.06); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; border-radius: 7px; background: rgba(255,255,255,0.28); transition: width 1.1s cubic-bezier(0.22, 1, 0.36, 1); }
.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: #fff; font-weight: 600; }
.bar-row.ours .bar i { background: var(--grad); box-shadow: 0 0 16px rgba(168,85,247,0.55); }
.quant-foot { margin-top: 20px; font-size: 13.5px; color: var(--muted); }
.quant-foot b { color: var(--cyan); }

/* -------------------------------- skill ---------------------------------- */

.skill-grid { display: grid; grid-template-columns: 1fr 1.05fr; gap: 18px; align-items: stretch; }
.skill-lead { font-size: 15px; color: #ccd1e0; margin-bottom: 16px; }
.skill-lead b { color: #fff; }
.skill-steps { padding-left: 20px; display: grid; gap: 10px; font-size: 14px; color: var(--muted); }
.skill-steps li::marker { color: var(--violet); font-weight: 700; }

.terminal { border-radius: var(--radius); border: 1px solid var(--line); background: #0c0f1a; overflow: hidden; box-shadow: 0 24px 60px rgba(0,0,0,0.5); display: flex; flex-direction: column; }
.term-bar { display: flex; align-items: center; gap: 7px; padding: 12px 16px; background: rgba(255,255,255,0.04); border-bottom: 1px solid var(--line); }
.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: var(--muted); margin-left: 8px; }
.term-body { padding: 20px 20px 18px; font-family: var(--font-mono); font-size: 13px; flex: 1; position: relative; }
.prompt-sign { color: var(--cyan); }
.term-line { color: #e7e9f0; min-height: 40px; }
.caret { display: inline-block; width: 8px; height: 15px; background: var(--cyan); vertical-align: -2px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.term-out { color: var(--muted); margin-top: 9px; }
.term-out .ok { color: #34d399; }
.copy-btn {
  margin-top: 16px; align-self: flex-start; font-family: var(--font-body); font-size: 12.5px; font-weight: 600;
  color: var(--text); background: var(--glass-strong); border: 1px solid var(--line); border-radius: 999px; padding: 8px 16px; cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.copy-btn:hover { border-color: rgba(34,211,238,0.6); }
.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: #c3e8ff; 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: rgba(255,255,255,0.02); }
.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: #c7c9ff; text-decoration: none; border-bottom: 1px dashed rgba(199,201,255,0.4); }
.more-works a:hover { color: #fff; }
.foot-note { margin-top: 12px; font-size: 12.5px; color: rgba(154,161,181,0.7); }

/* ------------------------------- lightbox --------------------------------- */

.lightbox {
  position: fixed; inset: 0; z-index: 100; background: rgba(4, 5, 10, 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.8); }
.lb-hint { font-size: 12px; color: var(--muted); font-family: var(--font-mono); }

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

.reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.22, 1, 0.36, 1); }
.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: 860px) {
  .nav-links { display: none; }
  .strip-inner { grid-template-columns: 1fr; gap: 24px; }
  .skill-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(4, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .blob, .caret, .scroll-cue span { animation: none; }
  .bar i { transition: none; }
  .in-view .bar i { width: var(--v); }
}
