:root {
    --bg:            #0B1020;
    --bg-alt:        #0F162B;
    --surface:       rgba(255, 255, 255, 0.03);
    --surface-hover: rgba(255, 255, 255, 0.06);
    --border:        rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.16);
    --text:          #E6EAF2;
    --text-muted:    #8A93A6;
    --text-dim:      #5C6578;
    --accent:        #7CF5D1;
    --accent-2:      #5EB2FF;
    --accent-violet: #A78BFA;
    --danger:        #FF7A90;
    --glow:          rgba(124, 245, 209, 0.18);
    --serif:  'DM Serif Display', Georgia, serif;
    --sans:   'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --mono:   'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
    --radius:     12px;
    --radius-lg:  18px;
    --ease:       cubic-bezier(0.2, 0.8, 0.2, 1);
}

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

html { scroll-behavior: smooth; }

body {
    font-family: var(--sans);
    background: var(--bg);
    color: var(--text);
    line-height: 1.65;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
      radial-gradient(900px circle at 10% 10%, rgba(94, 178, 255, 0.06), transparent 40%),
      radial-gradient(700px circle at 90% 20%, rgba(124, 245, 209, 0.05), transparent 45%),
      radial-gradient(800px circle at 50% 100%, rgba(167, 139, 250, 0.04), transparent 50%);
    z-index: -2;
    pointer-events: none;
}

body::after {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
      linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
      linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
    z-index: -1;
    pointer-events: none;
}

a { color: inherit; text-decoration: none; }
::selection { background: var(--accent); color: var(--bg); }

.container { max-width: 1160px; margin: 0 auto; padding: 0 1.5rem; }

.header {
    position: sticky;
    top: 0;
    z-index: 50;
    padding: 1.1rem 0;
    background: rgba(11, 16, 32, 0.72);
    backdrop-filter: saturate(160%) blur(14px);
    -webkit-backdrop-filter: saturate(160%) blur(14px);
    border-bottom: 1px solid var(--border);
}
.header-content { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; }
.logo {
    font-family: var(--mono);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 1.5px;
    color: var(--text);
    text-transform: uppercase;
}
.logo .dot { color: var(--accent); }
nav ul { display: flex; gap: 2rem; list-style: none; }
nav a {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
    transition: color 0.2s var(--ease);
    position: relative;
}
nav a:hover { color: var(--text); }
nav a.cta {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    color: var(--text);
    transition: all 0.2s var(--ease);
}
nav a.cta:hover { background: var(--accent); color: var(--bg); border-color: var(--accent); }
@media (max-width: 720px) {
    nav ul li:not(.nav-cta) { display: none; }
}

.hero { padding: 6rem 0 4rem; }
.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-family: var(--mono);
    font-size: 0.78rem;
    color: var(--accent);
    letter-spacing: 2px;
    text-transform: uppercase;
    padding: 0.45rem 0.9rem;
    border: 1px solid rgba(124, 245, 209, 0.25);
    border-radius: 999px;
    background: rgba(124, 245, 209, 0.05);
    margin-bottom: 1.5rem;
}
.eyebrow .pulse {
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 0 var(--glow);
    animation: pulseDot 2.2s var(--ease) infinite;
}
@keyframes pulseDot {
    0%   { box-shadow: 0 0 0 0 rgba(124, 245, 209, 0.6); }
    70%  { box-shadow: 0 0 0 10px rgba(124, 245, 209, 0); }
    100% { box-shadow: 0 0 0 0 rgba(124, 245, 209, 0); }
}
h1.hero-title {
    font-family: var(--serif);
    font-weight: 400;
    font-size: clamp(2.4rem, 6vw, 4.2rem);
    line-height: 1.05;
    letter-spacing: -0.01em;
    margin-bottom: 1.4rem;
    max-width: 16ch;
}
h1.hero-title .grad {
    background: linear-gradient(120deg, var(--text) 0%, var(--accent) 55%, var(--accent-2) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.hero-desc {
    font-size: 1.12rem;
    color: var(--text-muted);
    max-width: 62ch;
    margin-bottom: 2rem;
}
.hero-desc strong { color: var(--text); font-weight: 600; }
.cta-row { display: flex; flex-wrap: wrap; gap: 0.9rem; margin-bottom: 2.5rem; }
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.85rem 1.4rem;
    border-radius: 10px;
    font-family: var(--sans);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s var(--ease);
    border: 1px solid transparent;
}
.btn-primary { background: var(--accent); color: var(--bg); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 10px 30px var(--glow); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border-strong); }
.btn-ghost:hover { background: var(--surface-hover); border-color: var(--text-muted); }
.btn .arrow { transition: transform 0.2s var(--ease); }
.btn:hover .arrow { transform: translateX(3px); }

.availability {
    font-size: 0.9rem;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}
.availability::before {
    content: '';
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 12px var(--glow);
}

.proof-bar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    padding: 1.5rem;
    margin-top: 1.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}
.proof-stat .num {
    font-family: var(--serif);
    font-size: 2rem;
    font-weight: 400;
    color: var(--accent);
    line-height: 1;
}
.proof-stat .label {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-top: 0.4rem;
    line-height: 1.3;
}
@media (max-width: 720px) {
    .proof-bar { grid-template-columns: repeat(2, 1fr); }
}

.section { padding: 5rem 0; border-top: 1px solid var(--border); }
.section-head { margin-bottom: 3rem; max-width: 68ch; }
.section-kicker {
    font-family: var(--mono);
    font-size: 0.78rem;
    color: var(--accent);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 0.8rem;
}
.section-title {
    font-family: var(--serif);
    font-weight: 400;
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    line-height: 1.15;
    letter-spacing: -0.01em;
    margin-bottom: 0.8rem;
    color: var(--text);
}
.section-sub { color: var(--text-muted); font-size: 1.02rem; }

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
}
.project {
    position: relative;
    padding: 1.75rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    transition: all 0.3s var(--ease);
    display: flex;
    flex-direction: column;
}
.project::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2), var(--accent-violet));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.3s var(--ease);
    pointer-events: none;
}
.project:hover { transform: translateY(-3px); background: var(--surface-hover); }
.project:hover::before { opacity: 1; }
.project.featured { grid-column: 1 / -1; }
@media (min-width: 860px) {
    .project.featured {
        grid-column: 1 / -1;
        display: grid;
        grid-template-columns: 1.1fr 1fr;
        gap: 2rem;
        align-items: start;
    }
}
.badges { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1rem; }
.badge {
    font-family: var(--mono);
    font-size: 0.7rem;
    letter-spacing: 1px;
    padding: 0.3rem 0.7rem;
    border-radius: 999px;
    text-transform: uppercase;
    font-weight: 500;
}
.badge-featured { background: rgba(124, 245, 209, 0.12); color: var(--accent); border: 1px solid rgba(124, 245, 209, 0.3); }
.badge-oss      { background: rgba(94, 178, 255, 0.12);  color: var(--accent-2); border: 1px solid rgba(94, 178, 255, 0.3); }
.badge-prod     { background: rgba(167, 139, 250, 0.12); color: var(--accent-violet); border: 1px solid rgba(167, 139, 250, 0.3); }
.badge-research { background: rgba(255, 122, 144, 0.10); color: var(--danger); border: 1px solid rgba(255, 122, 144, 0.25); }

.project h3 { font-size: 1.35rem; font-weight: 600; color: var(--text); margin-bottom: 0.6rem; letter-spacing: -0.01em; }
.project-hook { font-size: 1rem; color: var(--text); margin-bottom: 0.8rem; font-weight: 500; }
.project-desc { color: var(--text-muted); font-size: 0.95rem; margin-bottom: 1.2rem; flex: 1; }

.metric-row { display: flex; gap: 1.5rem; margin: 0.8rem 0 1.2rem; flex-wrap: wrap; }
.metric .val {
    font-family: var(--serif);
    font-size: 1.6rem;
    color: var(--accent);
    line-height: 1;
}
.metric .lbl {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 0.3rem;
    max-width: 18ch;
    line-height: 1.3;
}

.tech { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: auto; padding-top: 1rem; border-top: 1px solid var(--border); }
.tech .tag {
    font-family: var(--mono);
    font-size: 0.72rem;
    padding: 0.25rem 0.6rem;
    background: rgba(94, 178, 255, 0.08);
    border: 1px solid rgba(94, 178, 255, 0.2);
    color: var(--accent-2);
    border-radius: 6px;
}

.project-links { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1rem; }
.project-link {
    font-family: var(--mono);
    font-size: 0.78rem;
    color: var(--text);
    padding: 0.4rem 0.8rem;
    border: 1px solid var(--border-strong);
    border-radius: 6px;
    transition: all 0.2s var(--ease);
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}
.project-link:hover { background: var(--accent); color: var(--bg); border-color: var(--accent); }
.project-link.disabled { color: var(--text-dim); pointer-events: none; border-style: dashed; }

.ascii-diagram {
    font-family: var(--mono);
    font-size: 0.72rem;
    line-height: 1.35;
    color: var(--text-muted);
    background: rgba(0,0,0,0.25);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1rem;
    overflow-x: auto;
    white-space: pre;
}
.ascii-diagram .hl { color: var(--accent); }
.ascii-diagram .hl2 { color: var(--accent-2); }

.timeline { position: relative; padding-left: 2rem; max-width: 820px; }
.timeline::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 4px;
    bottom: 4px;
    width: 1px;
    background: linear-gradient(to bottom, var(--accent), var(--accent-violet), transparent);
}
.tl-item { position: relative; padding-bottom: 2.5rem; }
.tl-item::before {
    content: '';
    position: absolute;
    left: -2rem;
    top: 0.45rem;
    width: 14px; height: 14px;
    border-radius: 50%;
    background: var(--bg);
    border: 2px solid var(--accent);
    box-shadow: 0 0 0 4px rgba(124, 245, 209, 0.1);
}
.tl-date {
    font-family: var(--mono);
    font-size: 0.78rem;
    color: var(--accent);
    letter-spacing: 1px;
    margin-bottom: 0.3rem;
    text-transform: uppercase;
}
.tl-role { font-size: 1.15rem; font-weight: 600; color: var(--text); margin-bottom: 0.2rem; }
.tl-org { font-size: 0.95rem; color: var(--accent-2); margin-bottom: 0.7rem; }
.tl-body { color: var(--text-muted); font-size: 0.95rem; }
.tl-body ul { list-style: none; margin-top: 0.5rem; }
.tl-body li { position: relative; padding-left: 1.2rem; margin-bottom: 0.3rem; }
.tl-body li::before {
    content: '→';
    position: absolute; left: 0;
    color: var(--accent);
    font-family: var(--mono);
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.25rem;
}
.skill-card {
    padding: 1.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: all 0.25s var(--ease);
}
.skill-card:hover { background: var(--surface-hover); border-color: var(--border-strong); }
.skill-card h4 {
    font-size: 0.92rem;
    color: var(--text);
    margin-bottom: 1rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.skill-card h4 .kbd {
    font-family: var(--mono);
    font-size: 0.7rem;
    color: var(--accent);
    padding: 0.15rem 0.45rem;
    border: 1px solid rgba(124, 245, 209, 0.3);
    border-radius: 4px;
}
.skill-row { display: flex; justify-content: space-between; align-items: center; padding: 0.45rem 0; font-size: 0.88rem; border-bottom: 1px dashed var(--border); }
.skill-row:last-child { border-bottom: none; }
.skill-row .name { color: var(--text); }
.skill-row .lvl { font-family: var(--mono); font-size: 0.72rem; color: var(--text-muted); }
.skill-row .lvl.core { color: var(--accent); }

.pub-list { display: grid; gap: 1rem; }
.pub {
    padding: 1.25rem 1.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: all 0.2s var(--ease);
}
.pub:hover { background: var(--surface-hover); border-color: var(--border-strong); }
.pub-type {
    font-family: var(--mono);
    font-size: 0.72rem;
    color: var(--accent);
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 0.4rem;
}
.pub-title { font-size: 1.05rem; color: var(--text); font-weight: 600; margin-bottom: 0.3rem; line-height: 1.35; }
.pub-meta { font-size: 0.85rem; color: var(--text-muted); }
.pub-meta a { color: var(--accent-2); }
.pub-meta a:hover { color: var(--accent); }

.contact-card {
    padding: 2.5rem;
    background: linear-gradient(135deg, rgba(124, 245, 209, 0.05), rgba(94, 178, 255, 0.05), rgba(167, 139, 250, 0.04));
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-lg);
    text-align: center;
}
.contact-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-top: 2rem;
}
.contact-item {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.75rem 1.2rem;
    border: 1px solid var(--border-strong);
    border-radius: 10px;
    font-size: 0.95rem;
    font-family: var(--mono);
    transition: all 0.2s var(--ease);
}
.contact-item:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }
.contact-item svg { width: 16px; height: 16px; }

footer {
    padding: 2.5rem 0;
    border-top: 1px solid var(--border);
    text-align: center;
    font-family: var(--mono);
    font-size: 0.8rem;
    color: var(--text-dim);
}
footer a { color: var(--text-muted); }
footer a:hover { color: var(--accent); }

.reveal { opacity: 0; transform: translateY(20px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.visible { opacity: 1; transform: translateY(0); }

@media (max-width: 640px) {
    .hero { padding: 4rem 0 3rem; }
    .section { padding: 3.5rem 0; }
    .contact-card { padding: 1.5rem; }
}

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