:root {
  --bg: #0a0d0b;
  --bg-2: #101511;
  --surface: #131a15;
  --line: #22302680;
  --line-solid: #223026;
  --text: #e6efe8;
  --muted: #93a498;
  --accent: #7dffb0;
  --accent-ink: #04140a;
  --accent-2: #ffc46b;
  --radius: 14px;
  --font-display: "Bricolage Grotesque", system-ui, sans-serif;
  --font-body: "IBM Plex Sans", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
}

[data-theme="light"] {
  --bg: #f6f7f2;
  --bg-2: #eceee6;
  --surface: #ffffff;
  --line: #1b2a2033;
  --line-solid: #d5dacd;
  --text: #14201a;
  --muted: #55655b;
  --accent: #0b7a3e;
  --accent-ink: #ffffff;
  --accent-2: #a45a00;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1.0625rem/1.65 var(--font-body);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
code { font-family: var(--font-mono); font-size: .88em; background: var(--bg-2); padding: .1em .4em; border-radius: 6px; }
.mono { font-family: var(--font-mono); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: var(--accent-ink); padding: .5rem 1rem; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }

/* NAV */
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 1.5rem;
  padding: .85rem clamp(1rem, 4vw, 3rem);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line-solid);
}
.brand { font: 600 1rem var(--font-mono); text-decoration: none; display: flex; align-items: center; gap: .55rem; margin-right: auto; }
.brand-dot { width: .6rem; height: .6rem; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent); animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 8px transparent; } }
.nav nav { display: flex; gap: 1.4rem; }
.nav nav a { text-decoration: none; color: var(--muted); font-size: .95rem; transition: color .2s; }
.nav nav a:hover { color: var(--text); }
.theme-toggle { background: none; border: 1px solid var(--line-solid); color: var(--text); width: 2.2rem; height: 2.2rem; border-radius: 50%; cursor: pointer; font-size: 1.05rem; }
.theme-toggle:hover { border-color: var(--accent); }

/* HERO */
.hero { position: relative; overflow: hidden; min-height: min(88vh, 760px); display: grid; align-items: center; border-bottom: 1px solid var(--line-solid); }
#trace { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .55; }
.hero::after { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse at 20% 40%, transparent 0%, var(--bg) 78%); pointer-events: none; }
.hero-inner { position: relative; z-index: 2; padding: 5rem clamp(1rem, 6vw, 5rem) 4rem; max-width: 62rem; }
.eyebrow { font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin: 0 0 1rem; }
.eyebrow.accent2 { color: var(--accent-2); }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.08; margin: 0; letter-spacing: -.02em; }
h1 { font-size: clamp(2.5rem, 7vw, 5rem); font-weight: 700; }
h1 em { font-style: normal; color: var(--accent); }
.lead { font-size: clamp(1.05rem, 2vw, 1.25rem); color: var(--muted); max-width: 44rem; margin: 1.4rem 0 2rem; }
.cta { display: flex; flex-wrap: wrap; gap: .8rem; }
.btn { display: inline-block; padding: .75rem 1.3rem; border-radius: 999px; border: 1px solid var(--line-solid); text-decoration: none; font-weight: 500; transition: transform .2s, border-color .2s, background .2s; }
.btn:hover { transform: translateY(-2px); border-color: var(--accent); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: 1.5rem; margin: 3.2rem 0 0; max-width: 40rem; }
.stats div { border-left: 2px solid var(--accent); padding-left: .9rem; }
.stats dt { font: 400 .72rem var(--font-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.stats dd { margin: .2rem 0 0; font: 700 1.9rem var(--font-display); }

/* SECTIONS */
.section { padding: clamp(3.5rem, 8vw, 6.5rem) clamp(1rem, 6vw, 5rem); max-width: 80rem; margin: 0 auto; }
.section-head { margin-bottom: 2.4rem; }
.section-head h2 { font-size: clamp(1.8rem, 4vw, 2.8rem); max-width: 30ch; }
.prose p { margin: 0 0 1.1rem; color: var(--muted); }
.prose p:first-child { color: var(--text); }
.about-grid, .lab-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: clamp(1.5rem, 5vw, 4rem); align-items: start; }
.facts { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; background: var(--line-solid); border: 1px solid var(--line-solid); border-radius: var(--radius); overflow: hidden; }
.facts li { background: var(--surface); padding: 1rem 1.2rem; display: grid; gap: .15rem; }
.facts span { font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: var(--accent); }

/* FEATURED */
.featured { background: linear-gradient(160deg, var(--surface), var(--bg-2)); border: 1px solid var(--line-solid); border-radius: 20px; padding: clamp(1.4rem, 4vw, 2.6rem); margin-bottom: 3rem; }
.featured-top { display: flex; justify-content: space-between; align-items: start; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.featured h3 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
.featured > p { color: var(--muted); max-width: 52rem; }
.links { display: flex; gap: .5rem; flex-wrap: wrap; }
.chip-link { font: 500 .82rem var(--font-mono); text-decoration: none; padding: .35rem .8rem; border: 1px solid var(--line-solid); border-radius: 999px; transition: border-color .2s, color .2s; }
.chip-link:hover { border-color: var(--accent); color: var(--accent); }
.pipeline { list-style: none; display: grid; grid-template-columns: repeat(5, 1fr); gap: .8rem; padding: 0; margin: 2rem 0; counter-reset: step; }
.pipeline li { position: relative; border: 1px solid var(--line-solid); border-radius: 12px; padding: .9rem 1rem; background: var(--bg); display: grid; gap: .2rem; font-size: .9rem; }
.pipeline li b { font-family: var(--font-display); font-size: 1rem; }
.pipeline li span { color: var(--muted); font-size: .82rem; line-height: 1.4; }
.pipeline li:not(:last-child)::after { content: "→"; position: absolute; right: -.75rem; top: 50%; transform: translateY(-50%); color: var(--accent); font-family: var(--font-mono); z-index: 1; background: var(--surface); line-height: 1; padding: 2px 0; }
.feat-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 1.5rem; }
.feat-cols h4 { margin: 0 0 .4rem; color: var(--accent-2); font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; }
.feat-cols p { margin: 0; color: var(--muted); font-size: .96rem; }
.note { margin: 1.6rem 0 0; padding-top: 1.2rem; border-top: 1px dashed var(--line-solid); color: var(--muted); font-size: .92rem; }

/* FILTERS + CARDS */
.filters { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.6rem; }
.filter { font: 500 .85rem var(--font-mono); background: none; color: var(--muted); border: 1px solid var(--line-solid); padding: .45rem 1rem; border-radius: 999px; cursor: pointer; transition: all .2s; }
.filter:hover { color: var(--text); border-color: var(--accent); }
.filter.active { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(19rem, 1fr)); gap: 1.2rem; }
.card { background: var(--surface); border: 1px solid var(--line-solid); border-radius: var(--radius); padding: 1.4rem; display: flex; flex-direction: column; gap: .8rem; transition: transform .25s, border-color .25s; }
.card:hover { transform: translateY(-4px); border-color: var(--accent); }
.card[hidden] { display: none; }
.card header { display: flex; justify-content: space-between; align-items: baseline; gap: .8rem; }
.card h3 { font-size: 1.25rem; overflow-wrap: anywhere; }
.lang { font-size: .72rem; color: var(--accent-2); white-space: nowrap; }
.card p { margin: 0; color: var(--muted); font-size: .96rem; flex: 1; }
.card footer { display: flex; justify-content: space-between; align-items: center; gap: .6rem; font-size: .82rem; }
.card footer a { text-decoration: none; color: var(--accent); font-weight: 500; }
.card footer a:hover { text-decoration: underline; }
.meta { color: var(--muted); }
.soon { color: var(--accent-2); font-size: .75rem; }
.card .status { flex: 0; font-size: .78rem; color: var(--accent-2); font-family: var(--font-mono); }

/* HOMELAB / SKILLS / BENCH */
.tags { display: flex; flex-wrap: wrap; gap: .5rem; }
.tags span { font: 400 .82rem var(--font-mono); padding: .35rem .75rem; border: 1px solid var(--line-solid); border-radius: 8px; background: var(--surface); color: var(--muted); }
.skills { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 1.8rem; }
.skills h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; color: var(--accent); margin-bottom: .7rem; font-weight: 500; }
.skills ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; color: var(--muted); }
.skills li { padding-left: 1rem; position: relative; }
.skills li::before { content: ""; position: absolute; left: 0; top: .7em; width: .4rem; height: 1px; background: var(--accent); }
.bench { list-style: none; padding: 0; margin: 0; display: grid; gap: 1px; background: var(--line-solid); border: 1px solid var(--line-solid); border-radius: var(--radius); overflow: hidden; }
.bench li { background: var(--surface); padding: 1.1rem 1.4rem; color: var(--muted); }
.bench b { color: var(--text); font-weight: 500; }
.contact .lead { margin-top: 0; }
.foot { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem; padding: 1.6rem clamp(1rem, 6vw, 5rem); border-top: 1px solid var(--line-solid); color: var(--muted); font-size: .8rem; }

/* REVEAL */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }

@media (max-width: 900px) {
  .about-grid, .lab-grid { grid-template-columns: 1fr; }
  .pipeline { grid-template-columns: 1fr; }
  .pipeline li:not(:last-child)::after { content: "↓"; right: auto; left: 1rem; top: auto; bottom: -.95rem; transform: none; }
}
@media (max-width: 640px) {
  .nav nav { display: none; }
  .hero-inner { padding-top: 3.5rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .brand-dot { animation: none; }
}
