:root {
    --bg: #070709;
    --panel: #0e0f13;
    --panel2: #0c0d11;
    --alt: #0a0b0e;
    --ink: #F4F2EC;
    --text: #ECEAE3;
    --muted: #a8a69f;
    --muted2: #9a988f;
    --muted3: #928f87;
    --faint: #74726c;
    --faint2: #5a5852;
    --line: rgba(255, 255, 255, 0.08);
    --line2: rgba(255, 255, 255, 0.09);
    --line3: rgba(255, 255, 255, 0.10);
    --chip: rgba(255, 255, 255, 0.03);
    --accent: #8b7bff;
    --accent-ink: #070709;
    --glow: rgba(139, 123, 255, 0.12);
    --mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;
    --display: 'Space Grotesk', system-ui, sans-serif;
    --sans: 'Helvetica Neue', Arial, sans-serif;
    --maxw: 1200px;
    --pad: clamp(20px, 5vw, 56px);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--sans);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
::selection { background: var(--accent); color: var(--accent-ink); }
a { color: inherit; }
h1, h2, h3 { font-family: var(--display); color: var(--ink); margin: 0; }
img, svg, canvas { display: block; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding-left: var(--pad); padding-right: var(--pad); }

.eyebrow {
    font-family: var(--mono);
    font-size: 12px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 16px;
}
.sec-title {
    font-weight: 600;
    font-size: clamp(28px, 3.6vw, 46px);
    line-height: 1.06;
    letter-spacing: -0.025em;
    max-width: 24ch;
    text-wrap: balance;
}
.grad {
    background: linear-gradient(118deg, #8b7bff 0%, #5aa8ff 52%, #46e0c4 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* ---------- Header ---------- */
.site-header {
    position: sticky; top: 0; z-index: 60;
    background: rgba(7, 7, 9, 0.66);
    backdrop-filter: saturate(160%) blur(14px);
    -webkit-backdrop-filter: saturate(160%) blur(14px);
    border-bottom: 1px solid var(--line);
}
.header-bar {
    display: flex; align-items: center; justify-content: space-between;
    gap: 20px; flex-wrap: wrap;
    padding-top: 13px; padding-bottom: 13px;
}
.wordmark { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.wordmark-logo { height: 32px; width: auto; border-radius: 6px; display: block; object-fit: contain; }
.wordmark .name { font-family: var(--display); font-size: 21px; font-weight: 600; letter-spacing: -0.02em; }
.wordmark .llc { font-family: var(--mono); font-size: 10px; letter-spacing: 0.2em; color: var(--faint); text-transform: uppercase; align-self: baseline; }
.nav { display: flex; align-items: center; gap: clamp(14px, 2vw, 26px); flex-wrap: wrap; }
.nav a { font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.1em; text-transform: uppercase; color: #8e8c86; text-decoration: none; transition: color .15s ease; }
.nav a:hover, .nav a:focus-visible { color: var(--accent); }
.nav a.btn, .nav a.btn:hover, .nav a.btn:focus-visible { color: var(--accent-ink); text-transform: none; }
.btn {
    font-family: var(--mono); font-size: 12px; letter-spacing: 0.02em;
    color: var(--accent-ink); background: var(--accent);
    padding: 9px 15px; border-radius: 7px; text-decoration: none;
    transition: filter .15s ease;
}
.btn:hover, .btn:focus-visible { filter: brightness(1.12); }
.btn-lg { font-size: 13.5px; padding: 13px 22px; border-radius: 8px; }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; background: var(--bg); min-height: clamp(600px, 90vh, 920px); display: flex; align-items: stretch; }
.hero canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.hero-scrim { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(90deg, var(--bg) 0%, rgba(7,7,9,0.92) 30%, rgba(7,7,9,0.35) 62%, rgba(7,7,9,0) 86%); }
.hero-fade { position: absolute; left: 0; right: 0; bottom: 0; height: 160px; pointer-events: none; background: linear-gradient(transparent, var(--bg)); }
.hero-inner { position: relative; z-index: 2; width: 100%; display: flex; flex-direction: column; justify-content: center; padding-top: clamp(40px, 7vw, 72px); padding-bottom: clamp(40px, 7vw, 72px); }
.hero-eyebrow { font-family: var(--mono); font-size: 12px; letter-spacing: 0.22em; line-height: 1.5; text-transform: uppercase; color: var(--accent); margin-bottom: clamp(32px, 4.5vw, 46px); display: flex; align-items: center; flex-wrap: wrap; gap: 4px 11px; }
.dot { width: 7px; height: 1.05em; border-radius: 1px; background: var(--accent); box-shadow: 0 0 10px var(--accent); animation: blink 1.06s steps(1) infinite; }
@keyframes blink { 0%, 50% { opacity: 1; } 51%, 100% { opacity: 0; } }
.hero h1 { font-weight: 600; font-size: clamp(40px, 6.6vw, 82px); line-height: 1.02; letter-spacing: -0.03em; max-width: 16ch; }
.hero p:not(.hero-eyebrow) { font-size: clamp(16px, 1.55vw, 20px); line-height: 1.55; color: #cdcbc4; max-width: 56ch; margin: 28px 0 0; }
.hero-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-top: 36px; }
.btn-ghost { font-family: var(--mono); font-size: 13px; letter-spacing: 0.03em; color: var(--text); text-decoration: none; border: 1px solid rgba(255,255,255,0.16); padding: 12px 20px; border-radius: 8px; transition: border-color .15s ease, background .15s ease; }
.btn-ghost:hover, .btn-ghost:focus-visible { border-color: var(--accent); background: rgba(139,123,255,0.08); }

/* ---------- Stats ---------- */
.stats { border-top: 1px solid var(--line); }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); }
.stat { padding: 34px 30px 36px; border-right: 1px solid var(--line); }
.stat:last-child { border-right: 0; }
.stat .num { font-family: var(--display); font-size: clamp(30px, 3.2vw, 42px); font-weight: 500; letter-spacing: -0.02em; line-height: 1; color: var(--ink); }
.stat .lbl { font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.08em; text-transform: uppercase; color: #8e8c86; margin-top: 14px; }

/* ---------- Sections ---------- */
section { scroll-margin-top: 72px; }
.band { border-top: 1px solid var(--line); }
.band.alt { background: var(--alt); }
.sec-pad { padding-top: clamp(56px, 8vw, 108px); padding-bottom: clamp(56px, 8vw, 108px); }
.sec-head { margin-bottom: 44px; }
.sec-head.row { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; max-width: none; margin-bottom: 38px; }
.sec-count { font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em; color: var(--faint); text-transform: uppercase; }

/* ---------- Cards ---------- */
.chip { width: 42px; height: 42px; flex: none; border: 1px solid var(--line3); background: var(--chip); border-radius: 11px; display: flex; align-items: center; justify-content: center; color: var(--accent); }
.chip.sm { width: 36px; height: 36px; border-radius: 10px; }
.ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 16px; }
.card { background: var(--panel); border: 1px solid var(--line2); border-radius: 14px; text-decoration: none; color: var(--text); }

.spec { padding: 26px 28px 34px; transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; }
.spec:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: 0 16px 44px var(--glow); }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.idx { font-family: var(--mono); font-size: 13px; letter-spacing: 0.12em; color: var(--faint); }
.spec h3 { font-weight: 500; font-size: 23px; letter-spacing: -0.015em; margin: 22px 0 13px; line-height: 1.14; }
.spec p { font-size: 15.5px; line-height: 1.62; color: var(--muted2); margin: 0; }

/* Services — joined grid */
.svc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 330px), 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.svc { background: var(--panel2); padding: 28px 28px 34px; transition: background .18s ease; }
.svc:hover { background: #11131a; }
.svc .card-top { margin-bottom: 18px; }
.svc h3 { font-weight: 500; font-size: 21px; letter-spacing: -0.015em; margin: 0 0 12px; line-height: 1.16; }
.svc p { font-size: 15px; line-height: 1.64; color: var(--muted2); margin: 0; }

/* Why */
.why { position: relative; overflow: hidden; border-top: 1px solid var(--line); }
.why-glow { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(120% 140% at 85% -20%, rgba(139,123,255,0.14), transparent 55%), radial-gradient(100% 120% at 10% 120%, rgba(70,224,196,0.08), transparent 50%); }
.why-inner { position: relative; padding-top: clamp(64px, 9vw, 124px); padding-bottom: clamp(64px, 9vw, 124px); }
.why h2 { font-weight: 600; font-size: clamp(30px, 4.6vw, 58px); line-height: 1.05; letter-spacing: -0.03em; max-width: 20ch; }
.why p { font-size: clamp(16px, 1.5vw, 19px); line-height: 1.62; color: var(--muted); max-width: 64ch; margin: 28px 0 0; }
.why .btn { display: inline-block; margin-top: 38px; }

/* Projects */
.groups { display: flex; flex-direction: column; gap: clamp(40px, 5vw, 54px); }
.group-head { display: flex; align-items: baseline; gap: 16px; margin-bottom: 20px; }
.group-head .glabel { font-family: var(--display); font-size: 15px; font-weight: 600; letter-spacing: -0.005em; color: var(--ink); }
.group-head .gcount { font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.08em; color: var(--faint); }
.group-head .grule { flex: 1; height: 1px; background: var(--line); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr)); gap: 13px; }

.proj { display: flex; flex-direction: column; padding: 20px 22px; border-radius: 13px; min-height: 158px; transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease; }
.proj:hover { transform: translateY(-2px); border-color: var(--accent); box-shadow: 0 14px 38px var(--glow); }
.arrow { font-family: var(--mono); font-size: 14px; color: var(--faint2); line-height: 1; flex: none; }
.proj-name { font-family: var(--display); font-weight: 500; font-size: 20px; letter-spacing: -0.015em; margin: 16px 0 0; line-height: 1.12; color: var(--ink); }
.proj-desc { font-size: 14px; line-height: 1.52; color: var(--muted3); margin: 9px 0 0; flex-grow: 1; }
.proj-dom { font-family: var(--mono); font-size: 12px; letter-spacing: 0.02em; color: var(--accent); margin-top: 16px; }

/* Open Source */
.oss-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 345px), 1fr)); gap: 13px; }
.oss { padding: 22px 22px 20px; border-radius: 13px; background: var(--panel2); transition: border-color .16s ease, box-shadow .16s ease; }
.oss:hover { border-color: var(--accent); box-shadow: 0 14px 38px var(--glow); }
.oss-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.oss-id { display: flex; align-items: center; gap: 13px; min-width: 0; }
.oss-name { font-family: var(--mono); font-size: 16px; font-weight: 600; letter-spacing: -0.01em; color: var(--ink); overflow: hidden; text-overflow: ellipsis; }
.oss-desc { font-size: 14.5px; line-height: 1.55; color: var(--muted3); margin: 16px 0; flex-grow: 1; }
.oss-repo { font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.02em; color: var(--faint); border-top: 1px solid var(--line); padding-top: 14px; }
.oss-repo a { color: var(--faint); text-decoration: none; }
.oss-repo a:hover { color: var(--accent); }

/* Footer */
.site-footer { border-top: 1px solid var(--line); }
.footer-bar { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; flex-wrap: wrap; padding-top: clamp(44px, 5vw, 64px); padding-bottom: clamp(44px, 5vw, 64px); }
.footer-bar p { font-size: 14px; color: #8e8c86; margin: 13px 0 0; max-width: 42ch; }
.footer-right { text-align: right; }
.footer-right a { font-family: var(--mono); font-size: 13px; color: var(--accent); text-decoration: none; }
.footer-right .meta { font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.06em; color: var(--faint2); margin-top: 11px; text-transform: uppercase; }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .dot { animation: none; }
}

/* ---- sub-page (SEO landing) additions ---- */
.subhero { position: relative; background: radial-gradient(120% 120% at 82% -10%, var(--glow) 0%, transparent 55%), var(--bg); border-bottom: 1px solid var(--line); }
.subhero .wrap { padding-top: clamp(24px, 4vw, 44px); padding-bottom: clamp(48px, 7vw, 88px); }
.breadcrumb { font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint); }
.breadcrumb a { color: var(--faint); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb .sep { padding: 0 8px; opacity: .55; }
.breadcrumb .cur { color: var(--muted); }
.subhero h1 { font-family: var(--display); font-weight: 600; letter-spacing: -0.03em; line-height: 1.04; font-size: clamp(34px, 5.2vw, 60px); max-width: 17ch; margin: 24px 0 0; text-wrap: balance; }
.subhero .lede { font-size: clamp(16px, 1.6vw, 20px); line-height: 1.6; color: #cdcbc4; max-width: 60ch; margin: 22px 0 0; }
.prose { max-width: 72ch; }
.prose p { font-size: clamp(15.5px, 1.4vw, 18px); line-height: 1.72; color: #cdcbc4; margin: 0 0 18px; }
.prose a { color: var(--accent); text-decoration: none; border-bottom: 1px solid rgba(139,123,255,.35); }
.prose a:hover { border-color: var(--accent); }
.steps { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; grid-template-columns: repeat(auto-fit, minmax(min(100%,240px),1fr)); margin-top: 8px; }
.step { background: var(--panel); padding: 26px 26px 30px; }
.step .num { font-family: var(--mono); font-size: 12px; letter-spacing: .1em; color: var(--accent); }
.step h3 { font-family: var(--display); font-weight: 600; font-size: 18px; margin: 12px 0 8px; letter-spacing: -0.01em; }
.step p { color: var(--muted); font-size: 14.5px; line-height: 1.6; margin: 0; }
.faq-item { border-top: 1px solid var(--line); padding: 24px 0; max-width: 80ch; }
.faq-item:last-child { border-bottom: 1px solid var(--line); }
.faq-item h3 { font-family: var(--display); font-weight: 600; font-size: 18px; letter-spacing: -0.01em; margin: 0 0 10px; }
.faq-item p { color: var(--muted); font-size: 15px; line-height: 1.65; margin: 0; max-width: 72ch; }
.cta-band { text-align: center; }
.cta-band p { color: var(--muted); max-width: 52ch; margin: 14px auto 24px; }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}