/* === Base === */
:root {
    --bg: #0a0a0b;
    --bg-alt: #111113;
    --surface: #1a1a1e;
    --border: #2a2a2e;
    --text: #e4e4e7;
    --text-muted: #a1a1aa;
    --accent: #06b6d4;
    --accent-glow: rgba(6, 182, 212, 0.15);
    --magenta: #d946ef;
    --green: #22c55e;
    --radius: 12px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --mono: 'JetBrains Mono', monospace;
}

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

html { scroll-padding-top: 40px; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

a { color: var(--accent); text-decoration: none; transition: color 0.2s; }
a:hover { color: #22d3ee; }

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

/* === Side dot nav (desktop) === */
.side-nav {
    position: fixed;
    right: 28px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 18px;
    align-items: flex-end;
}

.side-dot {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    cursor: pointer;
}

.side-dot::after {
    content: '';
    display: block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--border);
    border: 1.5px solid #3a3a3e;
    transition: background 0.25s, transform 0.25s, border-color 0.25s;
    flex-shrink: 0;
}

.side-dot::before {
    content: attr(data-label);
    font-family: var(--mono);
    font-size: 0.7rem;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    white-space: nowrap;
    opacity: 0;
    transform: translateX(6px);
    transition: opacity 0.2s, transform 0.2s;
    pointer-events: none;
}

.side-dot:hover::before,
.side-dot.active::before {
    opacity: 1;
    transform: translateX(0);
}

.side-dot:hover::after {
    background: var(--text-muted);
    border-color: var(--text-muted);
    transform: scale(1.3);
}

.side-dot.active::after {
    background: var(--accent);
    border-color: var(--accent);
    transform: scale(1.4);
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.5);
}

/* === Mobile nav === */
.mob-btn {
    display: none;
    position: fixed;
    bottom: 28px;
    right: 24px;
    z-index: 200;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--surface);
    border: 1px solid var(--border);
    cursor: pointer;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    transition: background 0.2s, border-color 0.2s;
    backdrop-filter: blur(12px);
}
.mob-btn:hover { border-color: var(--accent); }
.mob-btn span {
    display: block;
    width: 18px;
    height: 1.5px;
    background: var(--text);
    border-radius: 2px;
    transition: transform 0.3s, opacity 0.3s;
}
.mob-btn.open span:first-child { transform: translateY(3.25px) rotate(45deg); }
.mob-btn.open span:last-child  { transform: translateY(-3.25px) rotate(-45deg); }

.mob-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 150;
    background: rgba(10, 10, 11, 0.96);
    backdrop-filter: blur(20px);
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
}
.mob-overlay.open {
    opacity: 1;
}

.mob-menu {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.mob-link {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: -0.03em;
    padding: 8px 24px;
    border-radius: 8px;
    transition: color 0.2s;
    opacity: 0;
    transform: translateY(16px);
    transition: color 0.2s, opacity 0.3s, transform 0.3s;
}
.mob-overlay.open .mob-link { opacity: 1; transform: translateY(0); }
.mob-overlay.open .mob-link:nth-child(1) { transition-delay: 0.05s; }
.mob-overlay.open .mob-link:nth-child(2) { transition-delay: 0.10s; }
.mob-overlay.open .mob-link:nth-child(3) { transition-delay: 0.15s; }
.mob-overlay.open .mob-link:nth-child(4) { transition-delay: 0.20s; }
.mob-overlay.open .mob-link:nth-child(5) { transition-delay: 0.25s; }

.mob-link:hover { color: var(--accent); }

/* === Hero === */
.hero {
    min-height: 100vh;
    display: flex; align-items: center;
    position: relative; overflow: hidden;
}

.hero-bg {
    position: absolute; inset: 0;
    background:
        radial-gradient(ellipse 600px 400px at 20% 50%, rgba(6, 182, 212, 0.06), transparent),
        radial-gradient(ellipse 500px 300px at 80% 30%, rgba(217, 70, 239, 0.04), transparent);
}

#hero-canvas {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    display: block;
    opacity: 0;
    transition: opacity 1.2s ease;
}

.hero-content { position: relative; z-index: 1; max-width: 700px; }

.hero-tag {
    font-family: var(--mono); font-size: 0.85rem;
    color: var(--accent); margin-bottom: 16px;
    letter-spacing: 0.05em; text-transform: uppercase;
}

.hero h1 {
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 700; letter-spacing: -0.03em;
    line-height: 1.1; margin-bottom: 20px;
}

.hero-sub {
    font-size: 1.15rem; color: var(--text-muted);
    line-height: 1.7; margin-bottom: 36px;
}

.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; }

.btn {
    display: inline-block; padding: 14px 28px;
    border-radius: 10px; font-weight: 600;
    font-size: 0.95rem; transition: all 0.25s;
}

.btn-primary { background: var(--accent); color: var(--bg); }
.btn-primary:hover { background: #22d3ee; color: var(--bg); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(6, 182, 212, 0.25); }

.btn-outline { border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }

/* === Sections === */
.section { padding: 100px 0; }
.section-dark { background: var(--bg-alt); }

.section-title {
    font-size: 2rem; font-weight: 700;
    margin-bottom: 48px;
    letter-spacing: -0.02em;
}

.section-title::after {
    content: ''; display: block;
    width: 40px; height: 3px;
    background: var(--accent);
    margin-top: 12px; border-radius: 2px;
}

/* === About === */
.about-prose { max-width: 760px; }

.about-prose p {
    color: var(--text-muted);
    font-size: 1.05rem;
    line-height: 1.85;
    margin-bottom: 20px;
}
.about-prose p:last-child { margin-bottom: 0; }
.about-prose a { color: var(--accent); }
.about-prose a:hover { color: #22d3ee; }


/* === Research === */
.research-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
}

.research-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius);
    padding: 24px 24px 20px;
    display: flex; flex-direction: column;
    transition: border-color 0.25s, transform 0.25s;
}
.research-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.research-card--cta { border-left-color: var(--magenta); opacity: 0.7; }
.research-card--cta:hover { opacity: 1; }

.research-card h3 { font-size: 1rem; margin-bottom: 10px; line-height: 1.4; }
.research-card p { color: var(--text-muted); font-size: 0.875rem; flex: 1; margin-bottom: 14px; line-height: 1.65; }

.research-meta {
    font-family: var(--mono); font-size: 0.7rem;
    color: var(--text-muted); letter-spacing: 0.06em;
    text-transform: uppercase; margin-top: auto; margin-bottom: 10px;
    display: block;
}

/* === Projects === */
.projects-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }

.project-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex; flex-direction: column;
    transition: border-color 0.25s, transform 0.25s;
}
.project-card:hover { border-color: var(--accent); transform: translateY(-3px); box-shadow: 0 12px 32px rgba(0,0,0,0.3); }

.project-card.featured {
    border-color: var(--accent);
}

.project-preview {
    width: 100%; height: 200px;
    overflow: hidden; flex-shrink: 0;
}
.project-preview img {
    width: 100%; height: 100%;
    object-fit: cover; object-position: top;
    display: block;
    transition: transform 0.5s ease;
}
.project-card:hover .project-preview img { transform: scale(1.04); }

.project-body {
    padding: 24px;
    display: flex; flex-direction: column; flex: 1;
}

.project-header { margin-bottom: 12px; display: flex; flex-direction: column; }

.project-badge {
    display: inline-block;
    font-family: var(--mono); font-size: 0.7rem;
    color: var(--accent); background: var(--accent-glow);
    padding: 3px 8px; border-radius: 4px;
    margin-bottom: 8px; text-transform: uppercase;
    letter-spacing: 0.05em; align-self: flex-start;
}

.project-card h3 { font-size: 1.1rem; }
.project-card p { color: var(--text-muted); font-size: 0.88rem; flex: 1; margin-bottom: 16px; line-height: 1.6; }

.project-link {
    font-family: var(--mono); font-size: 0.85rem;
    color: var(--accent); font-weight: 500;
    transition: color 0.2s;
}
.project-link:hover { color: #22d3ee; }


/* === Press === */
.section-sub {
    color: var(--text-muted); font-size: 0.95rem;
    max-width: 640px; line-height: 1.7;
    margin-bottom: 40px; margin-top: -8px;
}
.press-grid {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 16px; margin-bottom: 36px;
}
.press-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 24px;
    display: flex; flex-direction: column; gap: 14px;
    transition: border-color 0.25s;
}
.press-card:hover { border-color: var(--accent); }
.press-card blockquote {
    font-size: 0.95rem; line-height: 1.65;
    color: var(--text); font-style: italic; margin: 0; flex: 1;
}
.press-card cite { font-family: var(--mono); font-size: 0.72rem; color: var(--text-muted); font-style: normal; }
.press-card cite a { color: var(--accent); }
.press-stat {
    display: flex; align-items: center; gap: 24px;
    background: var(--surface); border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: 0 var(--radius) var(--radius) 0;
    padding: 20px 28px;
}
.press-stat-num { font-size: 2.4rem; font-weight: 800; color: var(--accent); line-height: 1; flex-shrink: 0; }
.press-stat-label { font-family: var(--mono); font-size: 0.78rem; color: var(--text-muted); line-height: 1.7; }

/* === Blog === */
.blog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 24px; }

.blog-card {
    display: flex; flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    transition: border-color 0.25s, transform 0.25s;
}
.blog-card:hover { border-color: var(--accent); transform: translateY(-2px); }

.blog-card-meta {
    display: flex; align-items: center; gap: 14px;
    margin-bottom: 16px;
}
.blog-card-meta time { font-family: var(--mono); font-size: 0.75rem; color: var(--text-muted); }

.blog-tag {
    font-family: var(--mono); font-size: 0.7rem;
    color: var(--accent); background: var(--accent-glow);
    padding: 2px 8px; border-radius: 4px;
    text-transform: uppercase; letter-spacing: 0.05em;
}

.blog-card h3 { font-size: 1.1rem; margin-bottom: 12px; line-height: 1.4; }
.blog-card > p { color: var(--text-muted); font-size: 0.875rem; line-height: 1.65; flex: 1; margin-bottom: 20px; }
.blog-read { font-family: var(--mono); font-size: 0.82rem; color: var(--accent); }

/* === Contact === */
.contact-content { text-align: center; max-width: 600px; margin: 0 auto; }
.contact-content > p { color: var(--text-muted); margin-bottom: 32px; font-size: 1.1rem; }

.contact-links { display: flex; gap: 24px; justify-content: center; flex-wrap: wrap; }

.contact-link {
    display: flex; align-items: center; gap: 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 24px;
    color: var(--text);
    transition: border-color 0.2s, transform 0.2s;
}
.contact-link:hover { border-color: var(--accent); color: var(--text); transform: translateY(-2px); }

.contact-icon { font-weight: 700; color: var(--accent); font-size: 1.1rem; }

/* === Neural Cover === */
.nc-wrap {
    position: relative;
    width: 100%; border-radius: var(--radius);
    overflow: hidden; margin-bottom: 40px;
    background: #0a0a0f;
}
.nc-wrap canvas {
    display: block; width: 100%;
    height: 260px; object-fit: cover;
}
.nc-loading {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    background: var(--surface);
    font-family: var(--mono); font-size: 0.75rem;
    color: var(--text-muted); letter-spacing: 0.1em;
    transition: opacity 0.4s;
}
.nc-loading.done { opacity: 0; pointer-events: none; }

/* blog card cover preview */
.blog-card-cover {
    width: 100%; height: 140px;
    overflow: hidden; border-radius: var(--radius) var(--radius) 0 0;
    margin: -28px -28px 20px -28px;
    width: calc(100% + 56px);
    background: #0a0a0f;
}
.blog-card-cover canvas {
    display: block; width: 100%; height: 140px;
}

/* === Footer === */
.footer {
    padding: 32px 0;
    border-top: 1px solid var(--border);
    text-align: center;
}
.footer-inner { display: flex; flex-direction: column; gap: 8px; align-items: center; }
.footer p { color: var(--text-muted); font-size: 0.85rem; margin: 0; }
.footer-license { font-size: 0.78rem !important; }
.footer-license a { color: var(--accent); }
.footer-license a:hover { color: #22d3ee; }

/* === GSAP animation init states === */
.gsap-fade {
    opacity: 0;
    transform: translateY(24px);
}

/* === Mobile === */
@media (max-width: 768px) {
    .side-nav { display: none; }
    .mob-btn { display: flex; }

    .stack-grid { grid-template-columns: 1fr; }
    .research-grid { grid-template-columns: 1fr 1fr; }
    @media (max-width: 480px) { .research-grid { grid-template-columns: 1fr; } }
    .projects-grid { grid-template-columns: 1fr; }
    .edu-grid { grid-template-columns: 1fr; }
    .contact-links { flex-direction: column; align-items: center; }

    .section { padding: 60px 0; }
    .hero { min-height: 90vh; }
}
