:root {
    --bg: #0d0a1f;
    --bg-soft: #15112e;
    --surface: rgba(255, 255, 255, 0.04);
    --surface-2: rgba(255, 255, 255, 0.08);
    --border: rgba(255, 255, 255, 0.12);
    --text: #f4f1ff;
    --text-dim: #b8b3d4;
    --accent-1: #ff5cf0;
    --accent-2: #6366f1;
    --accent-3: #22d3ee;
    --accent-4: #facc15;
    --gradient: linear-gradient(135deg, #ff5cf0 0%, #6366f1 50%, #22d3ee 100%);
    --radius: 16px;
    --shadow: 0 20px 60px -20px rgba(99, 102, 241, 0.4);
}

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

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    scroll-snap-type: y proximity;
    scroll-padding-top: 65px;
}

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

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }

/* Background — dots grid + animated blobs */
.bg-dots,
.bg-blobs {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
}
.bg-dots {
    background-image: radial-gradient(circle, rgba(184, 179, 212, 0.18) 1px, transparent 1px);
    background-size: 28px 28px;
}
.bg-dots .dots-accent {
    position: absolute;
    width: 420px;
    height: 420px;
    top: -120px;
    right: -120px;
    background: radial-gradient(circle, rgba(255, 92, 240, 0.35), transparent 65%);
    filter: blur(40px);
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0;
    animation: float 18s ease-in-out infinite, pulse 14s ease-in-out infinite;
}
.blob-1 { width: 320px; height: 320px; background: var(--accent-1); top: -80px; left: -80px; animation-delay: 0s, 0s; }
.blob-2 { width: 380px; height: 380px; background: var(--accent-2); top: 40%; right: -120px; animation-delay: -6s, -4.5s; }
.blob-3 { width: 280px; height: 280px; background: var(--accent-3); bottom: -80px; left: 30%; animation-delay: -12s, -9s; }

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(40px, -30px) scale(1.1); }
    66% { transform: translate(-30px, 40px) scale(0.95); }
}

@keyframes pulse {
    0%, 100% { opacity: 0; }
    40%, 60% { opacity: 0.4; }
}

.container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.25rem;
}

/* Header / Nav */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    background: rgba(13, 10, 31, 0.7);
    border-bottom: 1px solid var(--border);
}

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    max-width: 1100px;
    margin: 0 auto;
}

.nav-logo {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 1.4rem;
    letter-spacing: 0.05em;
    line-height: 1;
    display: inline-flex;
    align-items: center;
}
.nav-logo span {
    background: var(--gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.nav-toggle {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 0.5rem;
}
.nav-toggle span {
    display: block;
    width: 26px;
    height: 2px;
    background: var(--text);
    transition: transform 0.3s, opacity 0.3s;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.nav-menu {
    position: fixed;
    inset: 64px 0 auto 0;
    background: rgba(13, 10, 31, 0.95);
    backdrop-filter: blur(12px);
    display: flex;
    flex-direction: column;
    gap: 0;
    list-style: none;
    transform: translateY(-120%);
    transition: transform 0.35s ease;
    border-bottom: 1px solid var(--border);
}
.nav-menu.open { transform: translateY(0); }
.nav-menu li a {
    display: block;
    padding: 1rem 1.5rem;
    font-weight: 500;
    border-bottom: 1px solid var(--border);
}
.nav-menu li:last-child a { border-bottom: none; }
.nav-menu li a:hover { color: var(--accent-1); }
.nav-menu li a.nav-cta {
    background: var(--gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-weight: 700;
}

/* Sections */
.section {
    padding: 3rem 0;
    position: relative;
    scroll-snap-align: start;
    scroll-snap-stop: normal;
}

.section-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(1.8rem, 6vw, 2.5rem);
    font-weight: 700;
    margin-bottom: 0.5rem;
    position: relative;
    display: inline-block;
}
.section-title::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -8px;
    width: 60%;
    height: 4px;
    background: var(--gradient);
    border-radius: 2px;
}

.section-lead {
    color: var(--text-dim);
    margin-bottom: 2rem;
    font-size: 1.05rem;
}

.gradient-text {
    background: var(--gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* Rouan — aurora animated gradient */
.rouan-text {
    background: linear-gradient(90deg, var(--accent-1), var(--accent-2), var(--accent-3), var(--accent-1));
    background-size: 300% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: shimmer 6s linear infinite;
}
@keyframes shimmer {
    0%   { background-position: 0% 50%; }
    100% { background-position: 300% 50%; }
}

/* Hero */
.hero {
    min-height: calc(100vh - 65px);
    display: flex;
    align-items: center;
    padding: 2rem 0;
}
.hero-greeting {
    color: var(--accent-3);
    font-weight: 500;
    margin-bottom: 0.5rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-size: 0.85rem;
}
.hero-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(2.5rem, 12vw, 5rem);
    line-height: 1.05;
    font-weight: 700;
    margin-bottom: 0.5rem;
}
.hero-subtitle {
    font-size: clamp(1.1rem, 4vw, 1.5rem);
    color: var(--text-dim);
    margin-bottom: 1.25rem;
}
.hero-desc {
    max-width: 540px;
    color: var(--text-dim);
    margin-bottom: 2rem;
    font-size: 1.05rem;
}
.hero-cta {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.85rem 1.6rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
    text-align: center;
    cursor: pointer;
}
.btn-primary {
    background: var(--gradient);
    color: #fff;
    box-shadow: var(--shadow);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 25px 70px -20px rgba(255, 92, 240, 0.5); }
.btn-ghost {
    border: 1.5px solid var(--border);
    color: var(--text);
}
.btn-ghost:hover { background: var(--surface-2); border-color: var(--accent-1); }

/* Projects */
.projects-grid {
    display: flex;
    gap: 1.25rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding: 0 1.25rem;
    padding: 0.25rem 1.25rem 1rem;
    margin: 0 -1.25rem;
    scrollbar-width: thin;
    scrollbar-color: var(--accent-2) transparent;
    align-items: stretch;
}
.projects-grid::-webkit-scrollbar { height: 6px; }
.projects-grid::-webkit-scrollbar-track { background: transparent; }
.projects-grid::-webkit-scrollbar-thumb { background: var(--accent-2); border-radius: 3px; }
.project-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    transition: transform 0.3s, border-color 0.3s, background 0.3s;
    position: relative;
    overflow: hidden;
    flex: 0 0 85%;
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
}
.project-card .project-link { margin-top: auto; }
.project-card:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 92, 240, 0.5);
    background: var(--surface-2);
}
.project-thumb {
    height: 140px;
    border-radius: 12px;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 3rem;
    font-weight: 700;
    color: rgba(255,255,255,0.85);
}
.thumb-1 { background: var(--bg-soft); padding: 0; overflow: hidden; }
.thumb-2 { background: linear-gradient(135deg, #22d3ee, #6366f1); }
.thumb-3 { background: var(--bg-soft); padding: 0; overflow: hidden; }
.project-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.project-card h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}
.project-card p {
    color: var(--text-dim);
    font-size: 0.95rem;
    margin-bottom: 1rem;
}
.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 1rem;
}
.project-tags span {
    font-size: 0.75rem;
    padding: 0.25rem 0.65rem;
    background: var(--surface-2);
    border-radius: 999px;
    color: var(--text-dim);
}
.project-link {
    font-weight: 600;
    color: var(--accent-3);
    font-size: 0.95rem;
}
.project-link:hover { color: var(--accent-1); }

/* About */
.about-wrap {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    align-items: center;
}
.about-text p {
    color: var(--text-dim);
    margin-bottom: 1rem;
}
.skills {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1.5rem;
}
.skills li {
    padding: 0.4rem 0.9rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 0.85rem;
}
.about-card {
    aspect-ratio: 1;
    max-width: 320px;
    margin: 0 auto;
    border-radius: 24px;
    background: var(--gradient);
    padding: 4px;
    box-shadow: var(--shadow);
}
.about-card-inner {
    width: 100%;
    height: 100%;
    border-radius: 20px;
    background: var(--bg-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 4rem;
    font-weight: 700;
}
.about-card-inner span {
    background: var(--gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* Contact */
.contact-info {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.contact-info li {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: border-color 0.2s, transform 0.2s;
}
.contact-info li:hover {
    border-color: var(--accent-3);
    transform: translateX(4px);
}
.contact-icon {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: var(--gradient);
    color: #fff;
    flex-shrink: 0;
    font-size: 1.1rem;
}
.contact-info a { word-break: break-all; font-weight: 500; }
.contact-info a:hover { color: var(--accent-1); }

/* Footer */
.footer {
    padding: 1.5rem 0;
    text-align: center;
    color: var(--text-dim);
    font-size: 0.9rem;
    border-top: 1px solid var(--border);
    margin-top: 1rem;
}

/* Reveal animation */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Tablet */
@media (min-width: 640px) {
    .section { padding: 4rem 0; }
    .project-card { flex: 0 0 45%; }
}

/* Desktop */
@media (min-width: 900px) {
    .nav-toggle { display: none; }
    .nav-menu {
        position: static;
        background: transparent;
        flex-direction: row;
        gap: 0.5rem;
        transform: none;
        border: none;
        inset: auto;
    }
    .nav-menu li a {
        padding: 0.5rem 1rem;
        border: none;
        border-radius: 999px;
        font-size: 0.95rem;
    }
    .nav-menu li a:hover {
        background: var(--surface-2);
        color: var(--text);
    }
    .nav-menu li a.nav-cta {
        background: var(--gradient);
        color: #fff;
        font-weight: 600;
        box-shadow: 0 8px 24px -10px rgba(255, 92, 240, 0.5);
    }
    .nav-menu li a.nav-cta:hover {
        background: var(--gradient);
        transform: translateY(-1px);
    }
    .section { padding: 4.5rem 0; }
    .project-card { flex: 0 0 31%; }
    .about-wrap { grid-template-columns: 1.4fr 1fr; gap: 4rem; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
    html { scroll-behavior: auto; scroll-snap-type: none; }
}
