:root {
  --bg: #f3f3ee;
  --surface: #fbfbf8;
  --surface-2: #ebebe4;
  --text: #11111a;
  --muted: #5d5d6b;
  --line: #dcdcd3;
  --accent: #6558ff;
  --accent-ink: #ffffff;
  --accent-soft: #e7e5ff;
  --warn: #b54708;
  --ok: #22a356;
  --bad: #c4321f;
  --solo: #6558ff;
  --team: #d9622b;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 24px rgba(16, 24, 40, .06);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e0e14; --surface: #16161f; --surface-2: #1e1e2a; --text: #f1f1ec; --muted: #a0a0ae;
    --line: #2a2a38; --accent: #8b81ff; --accent-ink: #0e0e14; --accent-soft: #24214d;
    --warn: #f79009; --ok: #47cd89; --bad: #f97066; --solo: #8b81ff; --team: #ff9a66;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e0e14; --surface: #16161f; --surface-2: #1e1e2a; --text: #f1f1ec; --muted: #a0a0ae;
    --line: #2a2a38; --accent: #8b81ff; --accent-ink: #0e0e14; --accent-soft: #24214d;
    --warn: #f79009; --ok: #47cd89; --bad: #f97066; --solo: #8b81ff; --team: #ff9a66;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25); color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.6 Manrope, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
a { color: inherit; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5rem; letter-spacing: -.02em; }
p { margin: 0 0 1rem; }
.mono { font-family: "DM Mono", ui-monospace, monospace; }
.small { font-size: .85rem; }
.muted { color: var(--muted); }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 32px; } }

/* NAV */
.nav-shell { position: sticky; top: 0; z-index: 10; padding: 12px 12px 0; }
.nav {
  max-width: 1120px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 12px 10px 18px; border: 1px solid var(--line); border-radius: 18px;
  background: color-mix(in srgb, var(--surface) 82%, transparent); backdrop-filter: blur(14px); box-shadow: var(--shadow);
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand b { font-size: .8rem; line-height: 1.05; font-weight: 800; letter-spacing: -.01em; }
.brand span { font-size: .6rem; line-height: 1.3; color: var(--muted); border-left: 1px solid var(--line); padding-left: 12px; letter-spacing: .08em; }
.links { display: flex; gap: 2px; background: var(--surface-2); border-radius: 12px; padding: 4px; }
.links a { text-decoration: none; font-size: .9rem; font-weight: 600; padding: 8px 16px; border-radius: 9px; }
.links a:hover { background: var(--surface); }
.nav-right { display: flex; align-items: center; gap: 10px; }
.talk { text-decoration: none; font-weight: 700; font-size: .9rem; display: flex; align-items: center; gap: 8px; }
.theme-btn { font: 500 .66rem "DM Mono", monospace; letter-spacing: .1em; border: 1px solid var(--text); background: transparent; color: var(--text); border-radius: 10px; padding: 9px 12px; cursor: pointer; }
@media (max-width: 760px) { .links, .brand span { display: none; } }

/* BUTTONS */
.btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 10px 16px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  font: inherit; font-weight: 600; font-size: .92rem; text-decoration: none; cursor: pointer;
  transition: transform .15s ease, border-color .15s ease;
}
.btn:hover { transform: translateY(-1px); border-color: var(--muted); }
.btn.primary { background: var(--text); color: var(--bg); border-color: var(--text); }
.btn.ghost { background: transparent; }
.btn:disabled { opacity: .6; cursor: progress; transform: none; }
.cta { display: flex; flex-wrap: wrap; gap: 10px; }

/* HERO */
.hero { padding-top: 72px; padding-bottom: 40px; }
.eyebrow { color: var(--muted); font-size: .82rem; display: flex; align-items: center; gap: 8px; margin-bottom: 20px; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 var(--ok); animation: pulse 2s infinite; flex: none; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 60%, transparent); } 70% { box-shadow: 0 0 0 10px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.hero { padding-top: 48px; }
.hero-grid { display: grid; gap: 40px; align-items: center; }
@media (min-width: 900px) { .hero-grid { grid-template-columns: 1.35fr 1fr; } }
.hero h1 { font-size: clamp(2.6rem, 7vw, 5.4rem); font-weight: 700; letter-spacing: -.055em; line-height: .92; margin-bottom: 1.5rem; }
h1 em, h2 em { font-family: "Instrument Serif", serif; font-style: italic; font-weight: 400; color: var(--accent); letter-spacing: -.02em; }
.label { color: var(--accent); font-size: .72rem; font-weight: 500; letter-spacing: .14em; margin-bottom: 14px; }
.portrait { position: relative; margin: 0; justify-self: center; width: min(100%, 380px); }
.portrait img { display: block; width: 100%; aspect-ratio: 4/5; object-fit: cover; border-radius: 26px; border: 1.5px solid var(--text); box-shadow: 14px 14px 0 var(--accent); background: var(--surface-2); }
.portrait-tag { position: absolute; top: 16px; left: 16px; z-index: 1; font-size: .66rem; letter-spacing: .1em; background: var(--surface); color: var(--text); padding: 6px 10px; border-radius: 8px; }
.portrait figcaption { position: absolute; left: -12px; bottom: -22px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px 18px; box-shadow: var(--shadow); max-width: 240px; }
.portrait figcaption .label { display: block; margin-bottom: 6px; font-size: .62rem; }
.portrait figcaption b { font-size: 1.1rem; line-height: 1.2; letter-spacing: -.02em; }
@media (max-width: 899px) { .portrait figcaption { left: 8px; } }
.lede { font-size: 1.12rem; color: var(--muted); max-width: 62ch; }
.stats { list-style: none; padding: 0; margin: 64px 0 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
@media (min-width: 720px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stats li { background: var(--surface); padding: 18px 20px; }
.stats strong { display: block; font-size: 1.8rem; font-weight: 800; letter-spacing: -.03em; }
.stats span { color: var(--muted); font-size: .85rem; }

/* INTEGRATIONS MARQUEE */
.integrations { padding-bottom: 24px; }
.marquee { overflow: hidden; mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.track { display: flex; gap: 10px; width: max-content; animation: scroll 50s linear infinite; }
.marquee:hover .track { animation-play-state: paused; }
@keyframes scroll { to { transform: translateX(-50%); } }
.pill { white-space: nowrap; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 6px 14px; font-size: .88rem; font-weight: 500; }
@media (prefers-reduced-motion: reduce) { .track { animation: none; flex-wrap: wrap; width: auto; } .pulse { animation: none; } }

/* SECTIONS */
.section { padding-top: 72px; padding-bottom: 8px; scroll-margin-top: 96px; }
.section-head { margin-bottom: 28px; max-width: 70ch; }
.section-head h2 { font-size: clamp(2rem, 5vw, 3.4rem); font-weight: 600; letter-spacing: -.045em; }
.section-head p { color: var(--muted); }

/* FILTERS + PROJECTS */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.chip { border: 1px solid var(--line); background: var(--surface); color: var(--muted); border-radius: 999px; padding: 6px 14px; font: inherit; font-size: .88rem; cursor: pointer; }
.chip.active { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.projects { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .projects { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1040px) { .projects { grid-template-columns: repeat(3, 1fr); } }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px;
  display: flex; flex-direction: column; gap: 10px; box-shadow: var(--shadow); min-width: 0;
  animation: rise .35s ease both;
}
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
.card.feature { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.card-top { display: flex; justify-content: space-between; gap: 8px; align-items: center; flex-wrap: wrap; }
.org { font-size: .78rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.badge { font-size: .72rem; font-weight: 600; border-radius: 999px; padding: 3px 9px; border: 1px solid currentColor; }
.badge.solo { color: var(--solo); }
.badge.team { color: var(--team); }
.card h3 { font-size: 1.15rem; margin: 0; }
.card p { color: var(--muted); font-size: .93rem; margin: 0; }
.card .mine { font-size: .88rem; border-left: 3px solid var(--accent); padding-left: 10px; color: var(--text); }
.card .status { font-size: .78rem; color: var(--accent); font-weight: 600; }
.apis { display: flex; flex-wrap: wrap; gap: 6px; }
.api { font-size: .74rem; padding: 2px 8px; border-radius: 6px; background: var(--accent-soft); color: var(--text); }
.stack { margin-top: auto; padding-top: 8px; border-top: 1px dashed var(--line); font-size: .78rem; color: var(--muted); }

/* DEMOS */
.demo { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); min-width: 0; }
.demo.featured { margin-bottom: 16px; }
.demo-head { display: grid; gap: 16px; }
@media (min-width: 860px) { .demo-head { grid-template-columns: 1fr auto; align-items: end; } }
.demo h3 { font-size: 1.15rem; margin: 6px 0; }
.tag { display: inline-block; font-size: .72rem; font-weight: 600; color: var(--accent); background: var(--accent-soft); border-radius: 6px; padding: 2px 8px; }
.demo-grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 860px) { .demo-grid { grid-template-columns: 1fr 1fr; } .demo.wide { grid-column: 1 / -1; } }
.inline-form { display: flex; gap: 8px; margin: 10px 0; }
.stack-form { display: grid; gap: 8px; margin: 10px 0; }
.row { display: flex; gap: 8px; align-items: center; }
input, select {
  font: inherit; color: var(--text); background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 10px; padding: 9px 12px; min-width: 0; flex: 1;
}
input:focus, select:focus, .btn:focus-visible, .chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.out { margin-top: 12px; min-height: 40px; }
.out.big { font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; }
.grid-3 { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } }
.tile { background: var(--surface-2); border-radius: 12px; padding: 14px; min-width: 0; }
.tile .k { font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.tile .v { font-size: 1.5rem; font-weight: 800; }
.tile .s { font-size: .85rem; color: var(--muted); }
.tile img { height: 22px; vertical-align: middle; border-radius: 3px; margin-right: 6px; }
.trace { margin-top: 12px; font-size: .74rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px 14px; }
.trace .ok { color: var(--ok); }
.trace .bad { color: var(--bad); }
.err { color: var(--bad); font-size: .9rem; }
.skeleton { height: 70px; border-radius: 12px; background: linear-gradient(90deg, var(--surface-2), var(--line), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.gh { display: flex; gap: 12px; align-items: center; }
.gh img { width: 52px; height: 52px; border-radius: 50%; }
.gh-repos { list-style: none; padding: 0; margin: 10px 0 0; font-size: .88rem; }
.gh-repos li { display: flex; justify-content: space-between; gap: 8px; padding: 6px 0; border-top: 1px solid var(--line); }
.gh-repos a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.health { width: 100%; border-collapse: collapse; font-size: .88rem; margin: 10px 0 14px; }
.health th, .health td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); }
.health th { font-size: .74rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
@media (max-width: 560px) { .health .purpose { display: none; } }
.bar { display: inline-block; height: 6px; border-radius: 3px; background: var(--ok); vertical-align: middle; margin-right: 6px; }

/* PROCESS */
.process { list-style: none; padding: 0; margin: 0; display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .process { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1040px) { .process { grid-template-columns: repeat(4, 1fr); } }
.process li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.process .num { color: var(--accent); font-size: .85rem; }
.process h3 { font-size: 1.1rem; margin: 6px 0; }
.process p { color: var(--muted); font-size: .92rem; margin: 0; }

/* TIMELINE */
.timeline { display: grid; gap: 0; border-left: 2px solid var(--line); margin-left: 4px; }
.job { display: grid; gap: 4px 24px; padding: 0 0 28px 22px; position: relative; }
.job::before { content: ""; position: absolute; left: -7px; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: var(--bg); border: 2px solid var(--accent); }
@media (min-width: 720px) { .job { grid-template-columns: 150px 1fr; } }
.when { color: var(--muted); font-size: .82rem; padding-top: 3px; }
.job h3 { font-size: 1.1rem; }
.job p { color: var(--muted); margin: 0; max-width: 72ch; }

/* STACK */
.stack-grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .stack-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1040px) { .stack-grid { grid-template-columns: repeat(3, 1fr); } }
.stack-grid div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.stack-grid h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.stack-grid p { margin: 0; font-size: .93rem; }

/* CONTACT */
.contact-card { background: var(--text); color: var(--bg); border-radius: 20px; padding: clamp(24px, 5vw, 48px); }
.contact-card h2 { font-size: clamp(2rem, 5vw, 3.6rem); font-weight: 600; letter-spacing: -.045em; }
.contact-card h2 em { color: color-mix(in srgb, var(--accent) 70%, var(--bg)); }
.contact-card .lede { color: color-mix(in srgb, var(--bg) 75%, var(--text)); }
.contact-card .btn { background: transparent; color: var(--bg); border-color: color-mix(in srgb, var(--bg) 35%, var(--text)); overflow-wrap: anywhere; }
.contact-card .btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); }

.footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; color: var(--muted); padding-top: 48px; padding-bottom: 40px; }

/* EDUCATION */
.edu { display: grid; gap: 16px; }
@media (min-width: 860px) { .edu { grid-template-columns: 1.2fr 1fr; } }
.edu > div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.edu h3 { font-size: 1.35rem; margin-top: 8px; }
.edu ul { margin: 10px 0 0; padding-left: 18px; color: var(--muted); font-size: .92rem; }
.edu li { padding: 3px 0; }
.edu .when { font-size: .74rem; color: var(--accent); letter-spacing: .1em; }

.card[hidden] { display: none; }

/* CONTACT FORM (sits on the inverted contact card) */
.contact-form { display: grid; gap: 14px; grid-template-columns: 1fr; margin: 28px 0 8px; }
@media (min-width: 720px) { .contact-form { grid-template-columns: 1fr 1fr; } }
.contact-form .full { grid-column: 1 / -1; }
.field { display: grid; gap: 6px; }
.field label { font-size: .85rem; font-weight: 600; }
.field .opt { font-weight: 400; opacity: .6; }
.contact-form input, .contact-form select, .contact-form textarea {
  font: inherit; width: 100%; color: var(--bg); background: color-mix(in srgb, var(--bg) 8%, var(--text));
  border: 1px solid color-mix(in srgb, var(--bg) 22%, var(--text)); border-radius: 12px; padding: 12px 14px;
}
.contact-form textarea { resize: vertical; min-height: 130px; }
.contact-form ::placeholder { color: color-mix(in srgb, var(--bg) 45%, var(--text)); }
.contact-form select option { color: #11111a; }
.contact-form input:focus, .contact-form select:focus, .contact-form textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.contact-form [aria-invalid="true"] { border-color: #f97066; }
.field .err-msg { color: #f97066; font-size: .8rem; }
.form-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.form-status { margin: 0; font-size: .92rem; }
.form-status.ok { color: #47cd89; }
.form-status.bad { color: #f97066; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.or { font-size: .7rem; letter-spacing: .14em; opacity: .55; margin: 22px 0 10px; }
