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

:root {
    --bg: #08080c;
    --surface: #0f0f15;
    --border: #1a1a2e;
    --text: #e2e8f0;
    --text-muted: #8892b0;
    --accent: #4a9eff;
    --accent-hover: #6db3ff;
    --danger: #ef4444;
    --danger-dark: #dc2626;
    --success: #22c55e;
    --warning: #f59e0b;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

::selection {
    background: rgba(74, 158, 255, 0.3);
    color: var(--text);
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
}

/* ── Navigation ─────────────────────────────── */

nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 20px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: transparent;
    border-bottom: 1px solid transparent;
    transition: background 0.3s ease, border-color 0.3s ease;
}

nav.scrolled {
    background: rgba(8, 8, 12, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom-color: var(--border);
}

.nav-logo {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
    letter-spacing: -0.02em;
}

.nav-links {
    display: flex;
    gap: 32px;
    list-style: none;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-links a:hover {
    color: var(--text);
}

/* ── Hero ────────────────────────────────────── */

#hero {
    position: relative;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
}

#hero-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    will-change: transform;
}

#hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 200px;
    background: linear-gradient(to bottom, transparent, var(--bg));
    z-index: 5;
    pointer-events: none;
}

.hero-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 10;
    pointer-events: none;
    animation: heroFadeIn 1.2s ease 0.4s forwards;
    opacity: 0;
}

.hero-content h1 {
    font-size: clamp(52px, 9vw, 100px);
    font-weight: 700;
    letter-spacing: -0.04em;
    color: var(--text);
    margin-bottom: 12px;
    line-height: 1;
}

.hero-subtitle {
    font-size: clamp(14px, 2vw, 18px);
    color: var(--text-muted);
    font-weight: 400;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 20px;
}

.hero-tagline {
    font-family: 'JetBrains Mono', monospace;
    font-size: clamp(11px, 1.4vw, 14px);
    color: var(--accent);
    opacity: 0.7;
}

@keyframes heroFadeIn {
    from { opacity: 0; transform: translate(-50%, -46%); }
    to   { opacity: 1; transform: translate(-50%, -50%); }
}

.scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    animation: pulse 2.5s ease-in-out infinite;
}

.scroll-indicator span {
    font-size: 10px;
    color: var(--text-muted);
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.scroll-indicator .line {
    width: 1px;
    height: 36px;
    background: linear-gradient(to bottom, var(--text-muted), transparent);
}

@keyframes pulse {
    0%, 100% { opacity: 0.25; }
    50% { opacity: 0.6; }
}

/* ── Sections ────────────────────────────────── */

section {
    padding: 120px 0;
    position: relative;
}

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

.section-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    font-weight: 500;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: 16px;
}

.section-title {
    font-size: clamp(28px, 4vw, 42px);
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--text);
    margin-bottom: 48px;
}

/* ── Project Cards ───────────────────────────── */

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

.project-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 40px;
    transition: border-color 0.3s, transform 0.3s, box-shadow 0.3s;
    position: relative;
    overflow: hidden;
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    opacity: 0;
    transition: opacity 0.3s;
}

.project-card:hover {
    border-color: rgba(74, 158, 255, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4);
}

.project-card:hover::before {
    opacity: 1;
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
    gap: 16px;
}

.project-name {
    font-size: 24px;
    font-weight: 600;
    color: var(--text);
    letter-spacing: -0.01em;
}

.project-badge {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    font-weight: 500;
    padding: 5px 14px;
    border-radius: 20px;
    background: rgba(74, 158, 255, 0.1);
    color: var(--accent);
    border: 1px solid rgba(74, 158, 255, 0.2);
    white-space: nowrap;
    flex-shrink: 0;
}

.project-description {
    color: var(--text-muted);
    font-size: 15px;
    line-height: 1.7;
    margin-bottom: 24px;
    max-width: 640px;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
}

.tag {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    padding: 4px 12px;
    border-radius: 6px;
    background: rgba(136, 146, 176, 0.08);
    color: var(--text-muted);
    border: 1px solid rgba(136, 146, 176, 0.12);
}

.project-stats {
    display: flex;
    gap: 32px;
    margin-bottom: 28px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 15px;
    font-weight: 500;
    color: var(--text);
}

.stat-label {
    font-size: 12px;
    color: var(--text-muted);
}

.project-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* ── Buttons ─────────────────────────────────── */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
    font-family: inherit;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
}

.btn-primary:hover {
    background: var(--accent-hover);
    box-shadow: 0 4px 20px rgba(74, 158, 255, 0.3);
}

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.btn-ghost:hover {
    color: var(--text);
    border-color: var(--text-muted);
}

/* ── About ───────────────────────────────────── */

.about-text {
    max-width: 640px;
}

.about-text p {
    color: var(--text-muted);
    font-size: 16px;
    line-height: 1.8;
    margin-bottom: 16px;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 24px;
    margin-top: 48px;
}

.skill-group {
    padding: 24px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.skill-group h3 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.skill-group p {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.7;
}

/* ── Contact ─────────────────────────────────── */

.contact-grid {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.contact-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 24px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    text-decoration: none;
    transition: border-color 0.2s, transform 0.2s;
}

.contact-link:hover {
    border-color: rgba(74, 158, 255, 0.3);
    transform: translateY(-1px);
}

.contact-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
    font-family: 'JetBrains Mono', monospace;
}

.contact-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.contact-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 500;
}

.contact-value {
    font-size: 14px;
    color: var(--accent);
    font-weight: 500;
}

/* ── Footer ──────────────────────────────────── */

footer {
    padding: 40px 0;
    border-top: 1px solid var(--border);
}

footer p {
    text-align: center;
    font-size: 13px;
    color: rgba(136, 146, 176, 0.5);
}

/* ── Responsive ──────────────────────────────── */

@media (max-width: 768px) {
    nav { padding: 16px 20px; }
    .nav-links { gap: 20px; }
    .nav-links a { font-size: 13px; }
    .container { padding: 0 20px; }
    section { padding: 80px 0; }
    .project-card { padding: 24px; }
    .project-stats { flex-wrap: wrap; gap: 20px; }
    .contact-grid { flex-direction: column; }
    .skills-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
    .nav-links { gap: 16px; }
    section { padding: 48px 0; }
    .project-header { flex-direction: column; }
    .skills-grid { grid-template-columns: 1fr; }
}
