:root {
  --bg: #07090c;
  --surface: #0c1118;
  --elev: #121925;
  --line: rgba(148, 163, 184, 0.14);
  --text: #eef3f8;
  --muted: #8b97a8;
  --teal: #2dd4bf;
  --sky: #38bdf8;
  --warn: #fb923c;
  --max: 1160px;
  --display: "Syne", system-ui, sans-serif;
  --body: "Figtree", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 1.05rem;
  line-height: 1.6;
  overflow-x: hidden;
  cursor: none;
}
body.is-touch { cursor: auto; }
a { color: var(--teal); text-decoration: none; }
a:hover { color: var(--sky); }
img { max-width: 100%; display: block; height: auto; }

.cursor {
  position: fixed; width: 12px; height: 12px; border-radius: 50%;
  background: var(--teal); pointer-events: none; z-index: 9999;
  mix-blend-mode: difference; transform: translate(-50%, -50%);
  transition: width .2s, height .2s, background .2s;
}
.cursor.big { width: 42px; height: 42px; background: rgba(45,212,191,.35); mix-blend-mode: normal; }
.cursor-ring {
  position: fixed; width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid rgba(45,212,191,.45); pointer-events: none; z-index: 9998;
  transform: translate(-50%, -50%); transition: width .25s, height .25s, opacity .25s;
}

.site-header {
  position: sticky; top: 0; z-index: 40;
  backdrop-filter: blur(18px);
  background: rgba(7,9,12,.72);
  border-bottom: 1px solid var(--line);
}
.nav {
  max-width: var(--max); margin: 0 auto; padding: .9rem 1.35rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.nav-brand {
  font-family: var(--display); font-weight: 700; font-size: 1.15rem;
  letter-spacing: -.03em; color: var(--text);
}
.nav-links { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; }
.nav-links a { color: var(--muted); font-weight: 500; font-size: .9rem; }
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.nav-links .ext {
  border: 1px solid var(--line); padding: .35rem .7rem; border-radius: 999px; color: var(--text);
}
.progress {
  position: fixed; top: 0; left: 0; height: 2px; width: 0;
  background: linear-gradient(90deg, var(--teal), var(--sky)); z-index: 60;
}

.hero {
  position: relative; min-height: 100vh; display: grid;
  grid-template-columns: 1.05fr .95fr; align-items: center;
  max-width: var(--max); margin: 0 auto; padding: 4rem 1.35rem 3rem; gap: 2rem;
}
.hero-copy { position: relative; z-index: 2; }
.eyebrow {
  font-family: var(--mono); font-size: .72rem; letter-spacing: .16em;
  text-transform: uppercase; color: var(--teal); margin: 0 0 1rem;
}
.brand {
  font-family: var(--display); font-weight: 800;
  font-size: clamp(3rem, 8vw, 5.4rem); line-height: .95;
  letter-spacing: -.04em; margin: 0 0 1rem;
  background: linear-gradient(120deg, #fff 20%, var(--teal) 70%, var(--sky));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero h1 {
  font-family: var(--display); font-weight: 600;
  font-size: clamp(1.2rem, 2.4vw, 1.65rem); line-height: 1.25;
  margin: 0 0 .85rem; max-width: 22ch; color: var(--text);
}
.lead { color: var(--muted); max-width: 42ch; margin: 0 0 1.6rem; }
.cta { display: flex; flex-wrap: wrap; gap: .75rem; }
.btn {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .85rem 1.2rem; border-radius: 999px; font-weight: 650; font-size: .92rem;
  border: 1px solid transparent; transition: transform .2s, box-shadow .2s, background .2s;
}
.btn-primary {
  background: linear-gradient(120deg, var(--teal), var(--sky)); color: #041016;
  box-shadow: 0 0 0 0 rgba(45,212,191,.4);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 40px rgba(45,212,191,.25); color: #041016; }
.btn-ghost { border-color: var(--line); color: var(--text); background: transparent; }
.btn-ghost:hover { border-color: var(--teal); color: var(--teal); }

.hero-stage {
  position: relative; aspect-ratio: 1; width: min(100%, 520px); justify-self: end;
  border-radius: 24px; overflow: hidden;
  background:
    radial-gradient(circle at 30% 20%, rgba(45,212,191,.18), transparent 45%),
    radial-gradient(circle at 80% 70%, rgba(56,189,248,.14), transparent 40%),
    var(--surface);
  border: 1px solid var(--line);
}
.hero-stage canvas { width: 100%; height: 100%; display: block; }
.hero-stage .hint {
  position: absolute; left: 1rem; bottom: 1rem;
  font-family: var(--mono); font-size: .68rem; color: var(--muted);
  background: rgba(7,9,12,.55); padding: .35rem .55rem; border-radius: 8px;
  border: 1px solid var(--line);
}

.wrap { max-width: var(--max); margin: 0 auto; padding: 4rem 1.35rem; }
.section-kicker {
  font-family: var(--mono); font-size: .72rem; letter-spacing: .14em;
  text-transform: uppercase; color: var(--teal); margin: 0 0 .5rem;
}
.section-title {
  font-family: var(--display); font-weight: 700;
  font-size: clamp(1.8rem, 4vw, 2.6rem); letter-spacing: -.03em; margin: 0 0 .5rem;
}
.section-sub { color: var(--muted); margin: 0 0 1.8rem; max-width: 50ch; }

.proof {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem;
}
.proof-item {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 18px; padding: 1.35rem 1.25rem;
  transition: border-color .25s, transform .25s;
}
.proof-item:hover { border-color: rgba(45,212,191,.45); transform: translateY(-3px); }
.proof-item strong {
  display: block; font-family: var(--display); font-size: 1.8rem; font-weight: 700;
  letter-spacing: -.02em; margin-bottom: .25rem;
}
.proof-item span { color: var(--muted); font-size: .9rem; }

.filters { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.5rem; }
.filter-btn {
  font-family: var(--mono); font-size: .72rem; letter-spacing: .04em;
  padding: .45rem .75rem; border-radius: 999px; border: 1px solid var(--line);
  background: transparent; color: var(--muted); cursor: none;
}
body.is-touch .filter-btn { cursor: pointer; }
.filter-btn.active, .filter-btn:hover {
  color: #041016; background: var(--teal); border-color: var(--teal);
}

.work-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.1rem;
}
.work-card {
  position: relative; display: block; border-radius: 20px; overflow: hidden;
  border: 1px solid var(--line); background: var(--surface);
  transition: transform .3s, border-color .3s, box-shadow .3s;
  color: inherit;
}
.work-card:hover {
  transform: translateY(-6px);
  border-color: rgba(45,212,191,.4);
  box-shadow: 0 20px 60px rgba(0,0,0,.35);
  color: inherit;
}
.work-card img {
  width: 100%; aspect-ratio: 16/10; object-fit: cover;
  transition: transform .5s;
}
.work-card:hover img { transform: scale(1.04); }
.work-card .body { padding: 1.1rem 1.15rem 1.25rem; }
.work-card .num { font-family: var(--mono); font-size: .7rem; color: var(--teal); margin: 0 0 .35rem; }
.work-card h3 {
  font-family: var(--display); font-size: 1.25rem; margin: 0 0 .35rem;
  letter-spacing: -.02em; font-weight: 700;
}
.work-card p { margin: 0; color: var(--muted); font-size: .92rem; }
.work-card.hidden { display: none; }

.diagram-shell {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 20px; padding: 1rem; margin: 1.5rem 0 2rem;
  position: relative;
}
.diagram-shell svg { width: 100%; height: auto; display: block; }
.diagram-caption {
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  margin-top: .85rem; color: var(--muted); font-size: .85rem;
}
.diagram-tip {
  position: absolute; left: 1rem; right: 1rem; bottom: 3.2rem;
  background: rgba(7,9,12,.92); border: 1px solid rgba(45,212,191,.35);
  border-radius: 12px; padding: .85rem 1rem; color: var(--text);
  opacity: 0; pointer-events: none; transform: translateY(8px);
  transition: opacity .25s, transform .25s;
}
.diagram-tip.show { opacity: 1; transform: translateY(0); }
.diagram-tip strong { color: var(--teal); display: block; margin-bottom: .2rem; }
.node { cursor: none; transition: filter .2s; }
body.is-touch .node { cursor: pointer; }
.node:hover, .node:focus { filter: brightness(1.25); outline: none; }
.node.active { filter: drop-shadow(0 0 8px rgba(45,212,191,.8)); }
.flow-edge { stroke-dasharray: 6 6; animation: dash 12s linear infinite; }
@keyframes dash { to { stroke-dashoffset: -120; } }

.page-hero { padding: 3.5rem 0 1.5rem; border-bottom: 1px solid var(--line); }
.page-hero .wrap { padding-top: 0; padding-bottom: 0; }
.page-hero h1 {
  font-family: var(--display); font-weight: 750;
  font-size: clamp(2rem, 5vw, 3.2rem); letter-spacing: -.03em; margin: 0 0 .55rem;
}
.page-hero .tagline { color: var(--muted); margin: 0; max-width: 58ch; }

.cover-band {
  border-radius: 20px; overflow: hidden; border: 1px solid var(--line);
  margin: 1.5rem 0;
}
.cover-band img { width: 100%; aspect-ratio: 21/9; object-fit: cover; }

.prose { max-width: 70ch; }
.prose h2 {
  font-family: var(--display); font-size: 1.45rem; font-weight: 700;
  margin: 1.8rem 0 .55rem; letter-spacing: -.02em;
}
.prose p, .prose li { color: #c3cbd6; }
.prose blockquote {
  margin: 1.1rem 0; padding: 1rem 1.15rem; border-left: 3px solid var(--teal);
  background: var(--elev); border-radius: 0 12px 12px 0; color: #d5dbe4; font-style: italic;
}
.link-row { display: flex; flex-wrap: wrap; gap: .55rem; margin: 1.2rem 0 .4rem; }
.chip-link {
  display: inline-flex; padding: .55rem .9rem; border-radius: 999px;
  background: linear-gradient(120deg, var(--teal), var(--sky)); color: #041016; font-weight: 650; font-size: .88rem;
}
.chip-link:hover { color: #041016; filter: brightness(1.05); }
.chip-link.secondary {
  background: transparent; color: var(--text); border: 1px solid var(--line);
}
.chip-link.secondary:hover { border-color: var(--teal); color: var(--teal); }
.note {
  margin-top: 1.4rem; padding: .9rem 1rem; border-radius: 12px;
  border: 1px solid var(--line); background: var(--elev); color: var(--muted); font-size: .92rem;
}

.pub {
  display: grid; grid-template-columns: 5.5rem 1fr; gap: 1rem;
  padding: 1.4rem; margin-bottom: .8rem; border-radius: 16px;
  border: 1px solid var(--line); background: var(--surface);
  transition: border-color .25s, transform .25s;
}
.pub:hover { border-color: rgba(45,212,191,.4); transform: translateY(-2px); }
.pub-year { font-family: var(--mono); color: var(--teal); font-size: .85rem; padding-top: .2rem; }
.pub-title {
  font-family: var(--display); font-size: 1.15rem; font-weight: 700;
  margin: 0 0 .35rem; letter-spacing: -.02em; line-height: 1.3;
}
.pub-meta { color: var(--muted); font-size: .88rem; margin: 0 0 .55rem; }
.pub-abs { color: #c3cbd6; margin: 0 0 .7rem; font-size: .95rem; }
.pub-actions { display: flex; flex-wrap: wrap; gap: .65rem; align-items: center; }
.venue {
  font-family: var(--mono); font-size: .68rem; letter-spacing: .06em; text-transform: uppercase;
  border: 1px solid var(--line); padding: .2rem .45rem; border-radius: 999px; color: var(--sky);
}

.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li {
  padding: 1rem 0 1rem 1.2rem; border-left: 1px solid var(--line);
  position: relative; margin-left: .3rem;
}
.timeline li::before {
  content: ""; position: absolute; left: -4px; top: 1.35rem;
  width: 7px; height: 7px; border-radius: 50%; background: var(--teal);
  box-shadow: 0 0 12px rgba(45,212,191,.8);
}
.timeline strong { display: block; font-family: var(--display); font-weight: 700; }
.timeline span { color: var(--muted); font-size: .9rem; }

.site-footer {
  border-top: 1px solid var(--line); margin-top: 1rem;
  padding: 2.4rem 1.35rem 3.2rem; color: var(--muted); font-size: .9rem;
}
.site-footer .wrap {
  padding: 0; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
}

.reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; min-height: auto; padding-top: 2.5rem; }
  .hero-stage { justify-self: stretch; width: 100%; max-width: 480px; margin: 0 auto; }
  .proof, .work-grid { grid-template-columns: 1fr; }
  .pub { grid-template-columns: 1fr; gap: .35rem; }
  body { cursor: auto; }
  .cursor, .cursor-ring { display: none !important; }
}
/* ----- project page sections ----- */
.section-block { margin: 2.2rem 0 2.6rem; }
.section-block .section-kicker { margin-bottom: .35rem; }
.section-block .section-title { font-size: 1.45rem; margin-bottom: .75rem; }

.carousel {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 20px;
  overflow: hidden;
  background: var(--surface);
}
.carousel-viewport { position: relative; aspect-ratio: 16/10; background: #05070a; }
.carousel-track {
  display: flex; height: 100%;
  transition: transform .45s cubic-bezier(.22,.61,.36,1);
}
.carousel-slide {
  min-width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
}
.carousel-slide img {
  width: 100%; height: 100%; object-fit: contain; background: #05070a;
}
.carousel-caption {
  display: flex; justify-content: space-between; gap: 1rem; align-items: center;
  padding: .85rem 1rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .88rem;
}
.carousel-caption strong { color: var(--text); font-weight: 600; }
.carousel-nav { display: flex; gap: .45rem; }
.carousel-btn {
  width: 38px; height: 38px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--elev); color: var(--text);
  font-size: 1.1rem; display: grid; place-items: center;
}
.carousel-btn:hover { border-color: var(--teal); color: var(--teal); }
.carousel-dots { display: flex; gap: .35rem; justify-content: center; padding: 0 0 .9rem; }
.carousel-dots button {
  width: 7px; height: 7px; border-radius: 999px; border: 0;
  background: rgba(148,163,184,.35); padding: 0;
}
.carousel-dots button.active { background: var(--teal); width: 18px; }

.demo-video {
  border: 1px solid var(--line); border-radius: 20px; overflow: hidden;
  background: var(--surface);
}
.demo-video video { width: 100%; display: block; aspect-ratio: 16/9; background: #000; }
.demo-video .meta {
  padding: .85rem 1rem; border-top: 1px solid var(--line);
  color: var(--muted); font-size: .88rem;
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
}

.logic-legend {
  display: flex; flex-wrap: wrap; gap: .5rem; margin: .75rem 0 0;
}
.logic-legend span {
  font-family: var(--mono); font-size: .68rem; letter-spacing: .04em;
  border: 1px solid var(--line); border-radius: 999px; padding: .28rem .55rem; color: var(--muted);
}
.logic-legend .on { color: #041016; background: var(--teal); border-color: var(--teal); }

.diagram-shell.detailed { padding: 1.1rem 1rem 1rem; }
.diagram-shell.detailed svg { min-height: 280px; }

.pipeline-controls {
  display: flex; align-items: center; gap: .75rem; flex-wrap: wrap;
  margin: .75rem 0 .35rem;
}
.btn-play {
  border: 0; border-radius: 999px; padding: .55rem 1rem; font-weight: 700;
  background: linear-gradient(120deg, var(--teal), var(--sky)); color: #041016;
}
.pipeline-status { font-family: var(--mono); font-size: .75rem; color: var(--muted); }
.node.flow-hot { filter: drop-shadow(0 0 10px rgba(45,212,191,.85)); }
.flow-edge.flow-anim { animation: dash 4s linear infinite; stroke-opacity: 1; }

.pub-filters { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 1.25rem; }
.pub-filters button {
  font-family: var(--mono); font-size: .72rem; letter-spacing: .04em;
  padding: .4rem .7rem; border-radius: 999px; border: 1px solid var(--line);
  background: transparent; color: var(--muted);
}
.pub-filters button.active, .pub-filters button:hover {
  color: #041016; background: var(--teal); border-color: var(--teal);
}
.pub.hidden { display: none; }
.pub { position: relative; }
.pdf-preview {
  display: none; position: absolute; right: 1rem; top: 1rem; width: 220px; height: 280px;
  border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #000; z-index: 5;
}
.pub:hover .pdf-preview { display: block; }
.pdf-preview iframe { width: 100%; height: 100%; border: 0; }
body.is-touch .pdf-preview, body.reduce-motion .pdf-preview { display: none !important; }
body.reduce-motion .flow-edge, body.reduce-motion .hero-stage canvas { animation: none !important; }
body.reduce-motion .cursor, body.reduce-motion .cursor-ring { display: none !important; }

.nav-links .cv {
  border: 1px solid var(--line); padding: .35rem .7rem; border-radius: 999px; color: var(--text);
}

html[data-theme="light"] {
  --bg: #f4f7fb;
  --surface: #ffffff;
  --elev: #eef2f7;
  --line: rgba(15, 23, 42, 0.12);
  --text: #0f172a;
  --muted: #5b6575;
  --teal: #0d9488;
  --sky: #0284c7;
  --warn: #c2410c;
}
html[data-theme="light"] body {
  background:
    radial-gradient(900px 500px at 10% -10%, rgba(13,148,136,.12), transparent 55%),
    radial-gradient(700px 420px at 100% 0%, rgba(2,132,199,.10), transparent 50%),
    var(--bg);
}
html[data-theme="light"] .site-header { background: rgba(244,247,251,.82); }
html[data-theme="light"] .hero-stage {
  background: linear-gradient(160deg, #e8eef6, #f8fafc);
  border-color: var(--line);
}
html[data-theme="light"] .cursor { mix-blend-mode: multiply; }
html[data-theme="light"] .btn-primary { color: #fff; }
html[data-theme="light"] .diagram-shell,
html[data-theme="light"] .demo-video,
html[data-theme="light"] .pub,
html[data-theme="light"] .work-card,
html[data-theme="light"] .cover-band { background: var(--surface); }
html[data-theme="dark"] body {
  background:
    radial-gradient(900px 500px at 8% -8%, rgba(45,212,191,.08), transparent 55%),
    radial-gradient(700px 420px at 100% 0%, rgba(56,189,248,.07), transparent 50%),
    var(--bg);
}
.chrome-controls {
  display: flex; align-items: center; gap: .45rem; margin-left: .25rem;
}
.theme-toggle, .lang-wrap select {
  font-family: var(--mono); font-size: .72rem; letter-spacing: .02em;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--elev); color: var(--text);
  padding: .35rem .65rem; cursor: pointer;
}
.lang-wrap select {
  padding-right: 1.4rem; appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 12px) 55%, calc(100% - 8px) 55%;
  background-size: 4px 4px, 4px 4px; background-repeat: no-repeat;
}
.theme-toggle:hover, .lang-wrap select:hover { border-color: var(--teal); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); border: 0;
}
@media (max-width: 720px) {
  .chrome-controls { width: 100%; justify-content: flex-end; }
}
