/* ============ Base & Theme ============ */
:root {
  --bg: #0d1117;
  --bg-soft: #161b22;
  --card: #1c2333;
  --border: #2d3548;
  --text: #e6edf3;
  --muted: #9aa4b2;
  --accent: #4fd1c5;
  --accent-2: #7c8cf8;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: 1080px; margin: 0 auto; padding: 0 24px; }

section { padding: 72px 0; }

.section-title {
  font-size: 1.7rem;
  margin-bottom: 8px;
}
.section-title span { color: var(--accent); }
.section-sub {
  color: var(--muted);
  margin-bottom: 36px;
}

/* ============ Nav ============ */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(13, 17, 23, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}
.logo { font-weight: 700; font-size: 1.05rem; color: var(--text); }
.logo em { color: var(--accent); font-style: normal; }
.nav-links { display: flex; gap: 22px; list-style: none; }
.nav-links a { color: var(--muted); font-size: 0.92rem; }
.nav-links a:hover { color: var(--text); text-decoration: none; }
.nav-links .cta {
  color: var(--bg);
  background: var(--accent);
  padding: 7px 14px;
  border-radius: 8px;
  font-weight: 600;
}
.nav-links .cta:hover { opacity: 0.9; }

/* ============ Hero ============ */
.hero { padding: 110px 0 90px; }
.hero .kicker {
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.8rem;
}
.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  line-height: 1.15;
  margin: 10px 0 16px;
}
.hero h1 .grad {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero p { max-width: 640px; color: var(--muted); font-size: 1.05rem; }
.hero-actions { margin-top: 30px; display: flex; gap: 14px; flex-wrap: wrap; }
.btn {
  display: inline-block;
  padding: 12px 22px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid var(--border);
  color: var(--text);
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); border-color: var(--accent); }
.btn.primary {
  background: var(--accent);
  color: #06281f;
  border-color: var(--accent);
}
.hero-badges { margin-top: 34px; display: flex; gap: 10px; flex-wrap: wrap; }
.badge {
  font-size: 0.8rem;
  color: var(--muted);
  border: 1px solid var(--border);
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--bg-soft);
}

/* ============ Experience timeline ============ */
.timeline { border-left: 2px solid var(--border); margin-left: 8px; padding-left: 30px; }
.entry { position: relative; padding-bottom: 42px; }
.entry:last-child { padding-bottom: 0; }
.entry::before {
  content: "";
  position: absolute;
  left: -38px;
  top: 6px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(79, 209, 197, 0.15);
}
.entry .period { color: var(--accent); font-size: 0.85rem; font-weight: 600; }
.entry h3 { margin: 4px 0 2px; font-size: 1.15rem; }
.entry .org { color: var(--muted); font-size: 0.95rem; margin-bottom: 10px; }
.entry ul { list-style: none; }
.entry li {
  color: var(--muted);
  font-size: 0.95rem;
  padding-left: 18px;
  position: relative;
  margin-bottom: 7px;
}
.entry li::before { content: "▹"; position: absolute; left: 0; color: var(--accent); }

/* ============ Projects ============ */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 22px;
}
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  display: flex;
  flex-direction: column;
  transition: transform 0.18s ease, border-color 0.18s ease;
}
.card:hover { transform: translateY(-4px); border-color: var(--accent); }
.card .icon { font-size: 1.6rem; margin-bottom: 12px; }
.card h3 { font-size: 1.1rem; margin-bottom: 8px; }
.card p { color: var(--muted); font-size: 0.92rem; flex: 1; }
.tags { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 7px; }
.tags span {
  font-size: 0.73rem;
  color: var(--accent);
  background: rgba(79, 209, 197, 0.08);
  border: 1px solid rgba(79, 209, 197, 0.25);
  padding: 3px 9px;
  border-radius: 999px;
}
.card .award {
  margin-top: 14px;
  font-size: 0.82rem;
  color: #f2c94c;
}

/* ============ Skills ============ */
.skill-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 22px; }
.skill-group {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
}
.skill-group h3 { font-size: 0.95rem; color: var(--accent); margin-bottom: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips span {
  font-size: 0.83rem;
  background: var(--card);
  border: 1px solid var(--border);
  padding: 5px 12px;
  border-radius: 8px;
  color: var(--text);
}

/* ============ Education & certs ============ */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
@media (max-width: 720px) { .two-col { grid-template-columns: 1fr; } }
.edu-item, .cert-item {
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}
.edu-item:last-child, .cert-item:last-child { border-bottom: none; }
.edu-item h4 { font-size: 1rem; }
.edu-item .meta, .cert-item .meta { color: var(--muted); font-size: 0.88rem; }

/* ============ Accomplishments ============ */
.accomplishments .card { flex-direction: row; gap: 18px; align-items: flex-start; }
.accomplishments .card .icon { margin: 0; }

/* ============ Contact / footer ============ */
.contact { text-align: center; }
.contact p { color: var(--muted); max-width: 520px; margin: 0 auto 28px; }
footer {
  border-top: 1px solid var(--border);
  padding: 26px 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
}

/* ============ Reveal animation ============ */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.5s ease, transform 0.5s ease; }
.reveal.visible { opacity: 1; transform: none; }

@media (max-width: 640px) {
  .nav-links { gap: 14px; }
  .nav-links li.hide-mobile { display: none; }
  section { padding: 52px 0; }

  /* Hero: natural headline wrapping, tighter rhythm */
  .hero { padding: 64px 0 64px; }
  .hero h1 br { display: none; }
  .hero .kicker { font-size: 0.72rem; letter-spacing: 0.04em; }
  .hero .typeline { min-height: 3.2em; }
  .hero .scroll-hint { display: none; }

  /* Vertical pipeline that stays readable */
  .hero-flow svg.flow-desktop { display: none; }
  .hero-flow svg.flow-mobile { display: block; max-width: 330px; }
  .hero-flow .flow-mobile text { font-size: 16px; text-anchor: start; }

  .hero .stat .num { font-size: 1.6rem; }
}

/* ============ Motion & delight ============ */

/* Scroll progress bar */
#progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  z-index: 200;
}

/* Floating gradient orbs in the hero */
.hero { position: relative; overflow: hidden; }
.hero .container { position: relative; z-index: 1; }
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.22;
  pointer-events: none;
  animation: drift 18s ease-in-out infinite alternate;
}
.orb-1 { width: 420px; height: 420px; background: var(--accent); top: -120px; right: -80px; }
.orb-2 { width: 340px; height: 340px; background: var(--accent-2); bottom: -140px; left: -100px; animation-duration: 22s; animation-delay: -6s; }
.orb-3 { width: 220px; height: 220px; background: #f2c94c; opacity: 0.1; top: 40%; left: 55%; animation-duration: 26s; animation-delay: -12s; }
@keyframes drift {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(-60px, 40px) scale(1.15); }
}

/* Hero entrance */
.hero .container > * {
  opacity: 0;
  animation: fadeUp 0.7s cubic-bezier(0.22, 0.9, 0.32, 1) forwards;
}
.hero .kicker { animation-delay: 0.05s; }
.hero h1 { animation-delay: 0.15s; }
.hero .intro { animation-delay: 0.3s; }
.hero .hero-flow { animation-delay: 0.42s; }
.hero .typeline { animation-delay: 0.56s; }
.hero .hero-actions { animation-delay: 0.68s; }
.hero .hero-badges { animation-delay: 0.8s; }
.hero .stats { animation-delay: 0.92s; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: none; }
}

/* Shimmering gradient headline */
.hero h1 .grad {
  background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--accent));
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shine 6s linear infinite;
}
@keyframes shine { to { background-position: 200% center; } }

/* Typewriter line */
.typeline {
  margin-top: 18px;
  color: var(--muted);
  font-size: 1rem;
  min-height: 1.6em;
}
.typeline strong { color: var(--accent); font-weight: 600; }
.caret {
  display: inline-block;
  width: 2px;
  height: 1.1em;
  background: var(--accent);
  margin-left: 3px;
  vertical-align: text-bottom;
  animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* Animated stat counters */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
  margin-top: 40px;
}
.stat {
  text-align: center;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 10px;
}
.stat .num { font-size: 1.9rem; font-weight: 800; color: var(--accent); }
.stat .lbl { color: var(--muted); font-size: 0.83rem; }

/* Cursor spotlight on cards */
.card { position: relative; overflow: hidden; }
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), rgba(79, 209, 197, 0.12), transparent 45%);
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}
.card:hover::before { opacity: 1; }
.card > * { position: relative; }

/* Timeline dot pulse when revealed */
.entry::after {
  content: "";
  position: absolute;
  left: -42px;
  top: 2px;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  border: 1px solid rgba(79, 209, 197, 0.5);
  opacity: 0;
  pointer-events: none;
}
.entry.visible::after { animation: ring 1.4s ease-out 0.2s; }
@keyframes ring {
  0% { opacity: 0.9; transform: scale(0.4); }
  100% { opacity: 0; transform: scale(1.8); }
}

/* Skill chip micro-interactions */
.chips span { transition: transform 0.18s ease, border-color 0.18s ease, color 0.18s ease; }
.chips span:hover { transform: translateY(-3px); border-color: var(--accent); color: var(--accent); }

/* Scroll-spy nav highlight */
.nav-links a.active { color: var(--accent); }

/* Back-to-top button */
#toTop {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--accent);
  font-size: 1.15rem;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease, border-color 0.2s ease, visibility 0.3s;
  z-index: 150;
}
#toTop.show { opacity: 1; visibility: visible; transform: none; }
#toTop:hover { border-color: var(--accent); }

/* ============ Hero signature animation ============ */
#net {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* Letter-by-letter headline reveal (applied when JS splits the text) */
.hero h1 { perspective: 800px; }
.hero h1.split { animation: none; opacity: 1; }
.hero h1 .word { display: inline-block; white-space: nowrap; }
.hero h1 .ltr {
  display: inline-block;
  opacity: 0;
  transform: translateY(0.55em) rotateX(50deg);
  filter: blur(8px);
  animation: ltr 0.65s cubic-bezier(0.22, 0.9, 0.32, 1) forwards;
}
@keyframes ltr {
  to { opacity: 1; transform: none; filter: blur(0); }
}
.hero h1.split .grad { background: none; animation: none; color: inherit; }
.hero h1 .grad .ltr {
  background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--accent));
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: ltr 0.65s cubic-bezier(0.22, 0.9, 0.32, 1) forwards, shine 6s linear infinite;
}

/* Hero photo */
.hero .container {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 48px;
}
.hero .container > * { grid-column: 1; }
.hero .hero-photo {
  grid-column: 2;
  grid-row: 1 / span 5;
  align-self: center;
  animation-delay: 0.25s;
}
.hero .stats { grid-column: 1 / -1; }

.hero-photo {
  position: relative;
  width: 300px;
  height: 300px;
}
.hero-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  border: 3px solid var(--border);
  display: block;
  animation: photofloat 5s ease-in-out infinite alternate;
}
@keyframes photofloat { from { transform: translateY(0); } to { transform: translateY(-8px); } }
.photo-ring {
  position: absolute;
  inset: -14px;
  border-radius: 50%;
  border: 2px dashed rgba(79, 209, 197, 0.45);
  animation: spinring 26s linear infinite;
}
.photo-ring::before {
  content: "";
  position: absolute;
  top: -5px;
  left: 50%;
  width: 10px;
  height: 10px;
  margin-left: -5px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px rgba(79, 209, 197, 0.9);
}
@keyframes spinring { to { transform: rotate(360deg); } }
.hero-photo::after {
  content: "";
  position: absolute;
  inset: -40px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(79, 209, 197, 0.14), rgba(124, 140, 248, 0.08) 45%, transparent 65%);
  z-index: -1;
}
.photo-fallback { display: none; }
.hero-photo.no-img img { display: none; }
.hero-photo.no-img .photo-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  font-size: 5rem;
  font-weight: 800;
  color: #06281f;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  animation: photofloat 5s ease-in-out infinite alternate;
}
@media (max-width: 900px) {
  .hero .container { display: block; }
  .hero-photo { width: 150px; height: 150px; margin: 0 auto 30px; }
  .hero-photo.no-img .photo-fallback { font-size: 2.6rem; }
}

/* Short intro + animated pipeline flow */
.intro { font-size: 1.15rem; }
.intro strong { color: var(--accent); }
.intro .pronoun { color: var(--muted); font-size: 0.85em; }

.hero-flow { max-width: 680px; margin-top: 26px; }
.hero-flow svg { width: 100%; height: auto; display: block; }
.hero-flow .flow-mobile { display: none; }
.hero-flow text {
  fill: var(--muted);
  font-size: 14px;
  font-weight: 600;
  text-anchor: middle;
  font-family: "Inter", -apple-system, sans-serif;
}
.hero-flow [class] { transform-box: fill-box; transform-origin: center; }
.hero-flow .flowdash { animation: v-flow 1.2s linear infinite; }
.hero-flow .fnode {
  opacity: 0;
  transform: scale(0.4);
  animation: nodepop 0.55s cubic-bezier(0.22, 0.9, 0.32, 1) forwards;
}
.hero-flow .n1 { animation-delay: 0.5s; }
.hero-flow .n2 { animation-delay: 0.7s; }
.hero-flow .n3 { animation-delay: 0.9s; }
.hero-flow .n4 { animation-delay: 1.1s; }
.hero-flow .n5 { animation-delay: 1.3s; }
@keyframes nodepop { to { opacity: 1; transform: scale(1); } }
.hero-flow .ficon { animation: v-idle 2.4s ease-in-out infinite alternate; }
.hero-flow .spark { animation: v-pulse 1.6s ease-in-out infinite; }

/* Experience walkers */
.walk-track {
  position: relative;
  height: 30px;
  max-width: 340px;
  margin: 2px 0 10px;
  border-bottom: 2px dotted var(--border);
  overflow: hidden;
}
.walker {
  position: absolute;
  bottom: 1px;
  left: 0;
  width: 24px;
  font-size: 21px;
  line-height: 1;
  animation: walkx 8s linear infinite;
}
.walker .bod { display: inline-block; animation: bob 0.4s ease-in-out infinite alternate; }
.walker.roll .bod { animation: rollspin 1.4s linear infinite; }
.walker.fly { bottom: 6px; }
.walker.fly .bod { animation: hoverfly 1.2s ease-in-out infinite alternate; }
.walker.rtl { animation-name: walkx-rtl; }
@keyframes walkx {
  0% { left: 0; transform: scaleX(1); }
  48% { left: calc(100% - 24px); transform: scaleX(1); }
  52% { left: calc(100% - 24px); transform: scaleX(-1); }
  100% { left: 0; transform: scaleX(-1); }
}
@keyframes walkx-rtl {
  0% { left: 0; transform: scaleX(-1); }
  48% { left: calc(100% - 24px); transform: scaleX(-1); }
  52% { left: calc(100% - 24px); transform: scaleX(1); }
  100% { left: 0; transform: scaleX(1); }
}
@keyframes bob { from { transform: translateY(0); } to { transform: translateY(-3px); } }
@keyframes rollspin { to { transform: rotate(360deg); } }
@keyframes hoverfly {
  from { transform: translateY(0) rotate(6deg); }
  to { transform: translateY(-6px) rotate(-4deg); }
}

/* Waving hand */
.wave {
  display: inline-block;
  transform-origin: 70% 70%;
  animation: wave 3s ease-in-out 1s infinite;
}
@keyframes wave {
  0%, 55%, 100% { transform: rotate(0); }
  60% { transform: rotate(16deg); }
  65% { transform: rotate(-8deg); }
  70% { transform: rotate(16deg); }
  75% { transform: rotate(-4deg); }
  80% { transform: rotate(10deg); }
  85% { transform: rotate(0); }
}

/* Scroll hint */
.scroll-hint {
  position: absolute;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  width: 24px;
  height: 40px;
  border: 2px solid var(--muted);
  border-radius: 13px;
  opacity: 0.55;
  z-index: 1;
  transition: opacity 0.2s ease, border-color 0.2s ease;
}
.scroll-hint::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 7px;
  width: 4px;
  height: 8px;
  margin-left: -2px;
  border-radius: 2px;
  background: var(--accent);
  animation: wheel 1.8s ease-in-out infinite;
}
@keyframes wheel {
  0% { transform: translateY(0); opacity: 1; }
  70% { transform: translateY(14px); opacity: 0; }
  100% { transform: translateY(0); opacity: 0; }
}
.scroll-hint:hover { opacity: 0.9; border-color: var(--accent); }

/* ============ Animated project visuals ============ */
.card-visual {
  height: 130px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background:
    radial-gradient(120% 120% at 20% 0%, rgba(124, 140, 248, 0.08), transparent 55%),
    radial-gradient(120% 120% at 90% 100%, rgba(79, 209, 197, 0.08), transparent 55%),
    var(--bg-soft);
  margin-bottom: 18px;
  overflow: hidden;
}
.card-visual svg { width: 100%; height: 100%; display: block; }
.card-visual [class] { transform-box: fill-box; transform-origin: center; }

/* Rain: falling drops, idling car */
.v-rain .drop { animation: v-drop 1.1s linear infinite; }
.v-rain .d2 { animation-delay: 0.35s; }
.v-rain .d3 { animation-delay: 0.7s; }
@keyframes v-drop {
  0% { transform: translateY(-14px); opacity: 0; }
  25% { opacity: 1; }
  100% { transform: translateY(22px); opacity: 0; }
}
.v-rain .car { animation: v-idle 1.6s ease-in-out infinite alternate; }
@keyframes v-idle { from { transform: translateY(0); } to { transform: translateY(-2.5px); } }

/* Chat: typing dots + rising bars */
.v-chat .tdot { animation: v-type 1.2s ease-in-out infinite; }
.v-chat .t2 { animation-delay: 0.2s; }
.v-chat .t3 { animation-delay: 0.4s; }
@keyframes v-type {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-4px); opacity: 1; }
}
.v-chat .vbar { transform-origin: bottom; animation: v-bar 2.2s ease-in-out infinite alternate; }
.v-chat .b2 { animation-delay: 0.3s; }
.v-chat .b3 { animation-delay: 0.6s; }
@keyframes v-bar { from { transform: scaleY(0.45); } to { transform: scaleY(1); } }

/* Agents & graph: pulsing nodes, flowing edges */
.v-agents .agent, .v-graph .agent { animation: v-pulse 1.8s ease-in-out infinite; }
.v-agents .a2, .v-graph .a2 { animation-delay: 0.3s; }
.v-agents .a3, .v-graph .a3 { animation-delay: 0.6s; }
.v-agents .a4, .v-graph .a4 { animation-delay: 0.9s; }
@keyframes v-pulse {
  0%, 100% { transform: scale(1); opacity: 0.85; }
  50% { transform: scale(1.3); opacity: 1; }
}
.v-agents .beam, .v-graph .edge {
  stroke-dasharray: 5 5;
  animation: v-flow 1.2s linear infinite;
}
@keyframes v-flow { to { stroke-dashoffset: -20; } }

/* KB: lineage flow line */
.v-db .flowline {
  stroke-dasharray: 8 7;
  animation: v-flow 1.4s linear infinite;
}

/* Gears */
.v-gears .g1 { animation: v-spin 6s linear infinite; }
.v-gears .g2 { animation: v-spin 4s linear infinite reverse; }
@keyframes v-spin { to { transform: rotate(360deg); } }

/* Bot: blinking eyes, pulsing antenna, popping bubble */
.v-bot .eye { animation: v-blink 3.2s ease-in-out infinite; }
@keyframes v-blink { 0%, 92%, 100% { transform: scaleY(1); } 96% { transform: scaleY(0.1); } }
.v-bot .antenna { animation: v-pulse 1.6s ease-in-out infinite; }
.v-bot .bub { animation: v-pop 3.5s ease-in-out infinite; }
@keyframes v-pop {
  0%, 15% { opacity: 0; transform: translateY(6px) scale(0.8); }
  30%, 80% { opacity: 1; transform: none; }
  95%, 100% { opacity: 0; transform: translateY(-4px) scale(0.9); }
}

/* Doc: lines condense into a highlighted summary */
.v-doc .fadeline { animation: v-fadeline 3s ease-in-out infinite; }
.v-doc .f2 { animation-delay: 0.3s; }
@keyframes v-fadeline { 0%, 35% { opacity: 1; } 60%, 80% { opacity: 0.12; } 100% { opacity: 1; } }
.v-doc .hl { transform-origin: left; animation: v-grow 3s ease-in-out infinite; }
@keyframes v-grow { 0%, 35% { transform: scaleX(0.2); } 65%, 85% { transform: scaleX(1); } 100% { transform: scaleX(0.2); } }

/* Farm: growing stem, unfolding leaves, glowing sun */
.v-farm .stem {
  stroke-dasharray: 60;
  animation: v-stem 4s ease-out infinite;
}
@keyframes v-stem { 0% { stroke-dashoffset: 60; } 40%, 100% { stroke-dashoffset: 0; } }
.v-farm .leaf { animation: v-leaf 4s ease-out infinite; }
.v-farm .l2 { animation-delay: 0.4s; }
@keyframes v-leaf { 0%, 35% { opacity: 0; transform: scale(0.3); } 60%, 100% { opacity: 1; transform: scale(1); } }
.v-farm .sun { animation: v-pulse 3s ease-in-out infinite; }

/* Chain: heartbeat block + newly minted block */
.v-chain .glowblock { animation: v-glow 2s ease-in-out infinite; }
@keyframes v-glow {
  0%, 100% { filter: none; }
  50% { filter: drop-shadow(0 0 6px rgba(79, 209, 197, 0.9)); }
}
.v-chain .newblock { animation: v-mint 3s ease-in-out infinite; }
@keyframes v-mint { 0%, 25% { opacity: 0; transform: translateX(-8px); } 55%, 100% { opacity: 1; transform: none; } }

/* Lab: dipping rod, swaying liquid */
.v-lab .dip { animation: v-dip 2.6s ease-in-out infinite alternate; }
@keyframes v-dip { from { transform: translateY(0); } to { transform: translateY(10px); } }
.v-lab .liquid { animation: v-sway 3s ease-in-out infinite alternate; transform-origin: bottom; }
@keyframes v-sway { from { transform: scaleY(0.92); } to { transform: scaleY(1.05); } }

/* ============ Skill → project filtering ============ */
.chips span[data-skill] {
  cursor: pointer;
  border-color: rgba(79, 209, 197, 0.35);
}
.chips span[data-skill]::after {
  content: "↗";
  font-size: 0.7em;
  margin-left: 5px;
  color: var(--accent);
  opacity: 0.7;
}
.chips span.on { background: var(--accent); color: #06281f; border-color: var(--accent); }
.chips span.on::after { color: #06281f; }

#filter-note {
  margin: -20px 0 28px;
  color: var(--text);
  font-size: 0.95rem;
}
#filter-note strong { color: var(--accent); }
#filter-note button {
  font: inherit;
  font-size: 0.85rem;
  margin-left: 10px;
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--muted);
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease;
}
#filter-note button:hover { border-color: var(--accent); color: var(--text); }

.card { transition: transform 0.18s ease, border-color 0.18s ease, opacity 0.35s ease; }
.card.dim { opacity: 0.18; }
.card.dim:hover { transform: none; border-color: var(--border); }
.card.match { border-color: var(--accent); box-shadow: 0 0 24px rgba(79, 209, 197, 0.15); }

/* Respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
  .hero .container > *, .reveal { opacity: 1 !important; transform: none !important; }
  .orb { display: none; }
  .hero-flow .packet { display: none; }
}
