/* ===== Custom Properties ===== */
:root {
    --bg: #07070f;
    --surface: #0f0f1a;
    --card: rgba(255, 255, 255, 0.04);
    --card-border: rgba(255, 255, 255, 0.08);
    --card-hover: rgba(255, 255, 255, 0.07);
    --text: #e8eaf0;
    --text-muted: #6b7280;
    --primary: #a78bfa;
    --primary-glow: rgba(167, 139, 250, 0.3);
    --secondary: #34d399;
    --accent: #f472b6;
    --nav-bg: rgba(7, 7, 15, 0.8);
    --shadow: 0 0 0 1px rgba(255, 255, 255, 0.05), 0 20px 40px rgba(0, 0, 0, 0.4);
}

[data-theme="light"] {
    --bg: #fafafa;
    --surface: #f4f4f8;
    --card: rgba(255, 255, 255, 0.7);
    --card-border: rgba(0, 0, 0, 0.07);
    --card-hover: rgba(255, 255, 255, 0.95);
    --text: #111118;
    --text-muted: #6b7280;
    --primary: #7c3aed;
    --primary-glow: rgba(124, 58, 237, 0.15);
    --secondary: #059669;
    --accent: #db2777;
    --nav-bg: rgba(250, 250, 250, 0.85);
    --shadow: 0 0 0 1px rgba(0, 0, 0, 0.05), 0 20px 40px rgba(0, 0, 0, 0.08);
}

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

html {
    scroll-behavior: smooth;
}

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

/* ===== Aurora Background ===== */
.aurora {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.aurora-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.14;
    animation: drift 22s ease-in-out infinite alternate;
}

[data-theme="light"] .aurora-blob {
    opacity: 0.07;
}

.aurora-1 {
    width: 640px;
    height: 640px;
    background: #a78bfa;
    top: -220px;
    left: -120px;
    animation-delay: 0s;
}

.aurora-2 {
    width: 520px;
    height: 520px;
    background: #34d399;
    bottom: -120px;
    right: -120px;
    animation-delay: -8s;
}

.aurora-3 {
    width: 420px;
    height: 420px;
    background: #f472b6;
    top: 45%;
    left: 50%;
    animation-delay: -16s;
}

@keyframes drift {
    0%   { transform: translate(0, 0) scale(1); }
    50%  { transform: translate(50px, -40px) scale(1.06); }
    100% { transform: translate(-25px, 25px) scale(0.94); }
}

/* ===== Noise Texture ===== */
.noise {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    opacity: 0.035;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-size: 200px 200px;
}

[data-theme="light"] .noise {
    opacity: 0.015;
}

/* ===== Navigation ===== */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 48px;
    background: var(--nav-bg);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-bottom: 1px solid var(--card-border);
    transition: background 0.4s, border-color 0.4s;
}

.nav-logo {
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    color: var(--primary);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 32px;
}

.nav-right a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: color 0.2s;
}

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

.theme-toggle {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    width: 36px;
    height: 36px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
    color: var(--text-muted);
}

.theme-toggle:hover {
    background: var(--card-hover);
    color: var(--text);
}

.theme-toggle i {
    font-size: 0.85rem;
}

/* ===== Main Layout ===== */
main {
    position: relative;
    z-index: 2;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 48px 80px;
}

/* ===== Hero ===== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    gap: 64px;
    padding-top: 80px;
}

.hero-content {
    flex: 1;
    min-width: 0;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: 100px;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 28px;
    backdrop-filter: blur(10px);
}

.pulse-dot {
    width: 7px;
    height: 7px;
    background: var(--secondary);
    border-radius: 50%;
    animation: pulse-ring 2s infinite;
    flex-shrink: 0;
}

@keyframes pulse-ring {
    0%   { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.5); }
    70%  { box-shadow: 0 0 0 8px rgba(52, 211, 153, 0); }
    100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}

.hero-name {
    font-size: clamp(3rem, 7vw, 5.5rem);
    font-weight: 900;
    line-height: 1.05;
    letter-spacing: -0.03em;
    margin-bottom: 20px;
}

.hero-name span {
    display: block;
}

.name-accent {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-role {
    font-size: 1.15rem;
    color: var(--text-muted);
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    min-height: 2rem;
}

.role-prefix {
    color: var(--text-muted);
}

.typing-text {
    color: var(--primary);
    font-weight: 600;
}

.cursor {
    color: var(--primary);
    font-weight: 300;
    animation: blink-cursor 0.75s step-end infinite;
}

@keyframes blink-cursor {
    from, to { opacity: 0; }
    50%       { opacity: 1; }
}

.hero-bio {
    font-size: 0.975rem;
    color: var(--text-muted);
    max-width: 460px;
    margin-bottom: 40px;
    line-height: 1.75;
}

.hero-cta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
    font-family: inherit;
    letter-spacing: -0.01em;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 0 24px var(--primary-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 32px var(--primary-glow);
}

.btn-ghost {
    background: var(--card);
    color: var(--text);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(10px);
}

.btn-ghost:hover {
    background: var(--card-hover);
    transform: translateY(-2px);
}

/* Hero image */
.hero-image {
    position: relative;
    flex-shrink: 0;
}

.hero-image img {
    width: 280px;
    height: 280px;
    border-radius: 32px;
    object-fit: cover;
    display: block;
    position: relative;
    z-index: 1;
    box-shadow: var(--shadow);
}

.image-ring {
    position: absolute;
    inset: -6px;
    border-radius: 38px;
    background: linear-gradient(135deg, var(--primary), var(--accent), var(--secondary));
    z-index: 0;
    opacity: 0.5;
    animation: ring-spin 10s linear infinite;
}

@keyframes ring-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* ===== Bento Grid ===== */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-bottom: 80px;
}

.bento-card {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 28px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transition: background 0.2s, transform 0.25s, box-shadow 0.25s;
}

.bento-card:hover {
    background: var(--card-hover);
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

.bento-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 6px;
}

.stat-number {
    font-size: 2.8rem;
    font-weight: 900;
    letter-spacing: -0.04em;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
}

.stat-label {
    font-size: 0.73rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.bento-bio {
    grid-column: span 2;
}

.bento-icon {
    font-size: 1.3rem;
    color: var(--primary);
    margin-bottom: 14px;
    display: block;
}

.bento-bio h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.01em;
}

.bento-bio p {
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.7;
}

.bento-links {
    grid-column: span 3;
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.social-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 100px;
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
    border: 1px solid var(--card-border);
    background: var(--card);
    color: var(--text);
    letter-spacing: -0.01em;
}

.social-pill:hover {
    transform: translateY(-2px);
}

.social-pill.linkedin:hover {
    background: #0a66c2;
    color: #fff;
    border-color: #0a66c2;
}

.social-pill.github:hover {
    background: var(--text);
    color: var(--bg);
    border-color: var(--text);
}

/* ===== Skills ===== */
.skills-section {
    margin-bottom: 80px;
}

.section-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--primary);
    margin-bottom: 32px;
}

.skills-groups {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.skills-group {
    display: flex;
    align-items: flex-start;
    gap: 28px;
}

.group-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    min-width: 180px;
    padding-top: 7px;
    flex-shrink: 0;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    padding: 5px 14px;
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text);
    transition: all 0.2s;
    cursor: default;
    letter-spacing: -0.01em;
}

.tag:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--primary-glow);
}

/* ===== Contact / Footer ===== */
.contact {
    text-align: center;
    padding: 64px 0 40px;
    border-top: 1px solid var(--card-border);
}

.contact-title {
    font-size: clamp(2rem, 5vw, 3.2rem);
    font-weight: 900;
    letter-spacing: -0.03em;
    color: var(--text);
    margin-bottom: 14px;
}

.contact-sub {
    color: var(--text-muted);
    margin-bottom: 44px;
    font-size: 0.975rem;
}

.contact-links {
    display: flex;
    justify-content: center;
    gap: 14px;
    margin-bottom: 52px;
    flex-wrap: wrap;
}

.contact-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 22px 36px;
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: 18px;
    text-decoration: none;
    color: var(--text);
    font-size: 0.82rem;
    font-weight: 600;
    transition: all 0.25s;
    min-width: 130px;
    backdrop-filter: blur(10px);
    letter-spacing: 0.01em;
}

.contact-link i {
    font-size: 1.7rem;
    color: var(--primary);
}

.contact-link:hover {
    background: var(--card-hover);
    transform: translateY(-4px);
    box-shadow: var(--shadow);
}

.footer-note {
    font-size: 0.78rem;
    color: var(--text-muted);
    letter-spacing: 0.02em;
}

/* ===== Scroll animations ===== */
.fade-in {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.65s ease, transform 0.65s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
    main {
        padding: 0 32px 60px;
    }

    .hero {
        gap: 40px;
    }

    .hero-image img {
        width: 220px;
        height: 220px;
    }
}

@media (max-width: 768px) {
    main {
        padding: 0 20px 60px;
    }

    .nav {
        padding: 14px 20px;
    }

    .nav-right a {
        display: none;
    }

    .hero {
        flex-direction: column-reverse;
        align-items: flex-start;
        gap: 36px;
        padding-top: 100px;
        min-height: auto;
        padding-bottom: 60px;
    }

    .hero-image img {
        width: 180px;
        height: 180px;
    }

    .image-ring {
        inset: -5px;
        border-radius: 30px;
    }

    .bento-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .bento-bio {
        grid-column: span 2;
    }

    .bento-links {
        grid-column: span 2;
    }

    .skills-group {
        flex-direction: column;
        gap: 10px;
    }

    .group-label {
        min-width: unset;
        padding-top: 0;
    }
}

@media (max-width: 480px) {
    .bento-grid {
        grid-template-columns: 1fr;
    }

    .bento-bio,
    .bento-links {
        grid-column: span 1;
    }

    .hero-cta {
        flex-direction: column;
    }

    .btn {
        justify-content: center;
    }
}
