/* Reset & Base Styles */
:root {
    --bg-color: #0a0a0a;
    --surface-color: #171717;
    --text-primary: #ffffff;
    --text-secondary: #a3a3a3;
    --accent-color: #818cf8;
    /* Indigo: Perfect balance of Blue & Purple */
    --accent-glow: rgba(129, 140, 248, 0.25);
    --gradient-primary: linear-gradient(135deg, #60a5fa 0%, #c084fc 100%);
    /* Blue to Purple Gradient */

    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-display: 'Space Grotesk', sans-serif;

    --container-width: 1100px;
    --header-height: 80px;
    --radius-md: 16px;
    /* Slightly rounder for visionOS feel */
    --radius-lg: 24px;
    --glass-bg: rgba(255, 255, 255, 0.02);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-highlight: rgba(255, 255, 255, 0.15);
    --glass-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

@media (min-width: 768px) {
    :root {
        --header-height: 80px;
    }
}

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

html {
    scroll-behavior: smooth;
}

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

/* Typography */
h1,
h2,
h3,
.logo {
    font-family: var(--font-display);
    font-weight: 400;
    /* Lighter weight */
    letter-spacing: -0.03em;
    /* Tighter tracking */
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease;
}

ul {
    list-style: none;
}

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

@media (min-width: 768px) {
    .container {
        padding: 0 24px;
    }
}

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

/* Header */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    background: rgba(10, 10, 10, 0.8);
    backdrop-filter: blur(12px);
    z-index: 1000;
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
}

.logo .dot {
    color: var(--accent-color);
}

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

.nav-links a {
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
}

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

.nav-links .btn-primary {
    color: var(--bg-color);
}

/* Buttons */
/* Buttons - Glass Style */
.btn-primary {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: var(--text-primary);
    padding: 12px 32px;
    border-radius: 100px;
    font-weight: 500;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.btn-primary:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2), 0 0 20px var(--accent-glow);
    border-color: rgba(255, 255, 255, 0.3);
}

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    padding: 12px 24px;
    border-radius: 100px;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--text-primary);
}

/* Hero Section */
#hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    padding-top: var(--header-height);
    overflow: hidden;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
}

.subtitle {
    color: var(--accent-color);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.875rem;
    margin-bottom: 16px;
    display: block;
    opacity: 0;
    animation: fadeUp 0.8s ease forwards 0.2s;
}

.headline {
    font-size: clamp(2.5rem, 8vw, 5rem);
    line-height: 1.1;
    margin-bottom: 24px;
    opacity: 0;
    animation: fadeUp 0.8s ease forwards 0.4s;
}

.bio {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin-bottom: 40px;
    opacity: 0;
    animation: fadeUp 0.8s ease forwards 0.6s;
}

@media (min-width: 768px) {
    .bio {
        font-size: 1.25rem;
    }
}

.cta-group {
    display: flex;
    gap: 16px;
    opacity: 0;
    animation: fadeUp 0.8s ease forwards 0.8s;
}

/* Hero Background Shapes */
.hero-background {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1;
    pointer-events: none;
}

.shape {
    position: absolute;
    filter: blur(100px);
    /* Increased blur for softer diffusion */
    opacity: 0.15;
    /* Significantly reduced opacity */
    border-radius: 50%;
}

.shape-1 {
    top: -10%;
    right: -5%;
    width: 500px;
    height: 500px;
    background: #3b82f6;
    /* Blue */
    animation: float 10s infinite ease-in-out;
}

.shape-2 {
    bottom: 10%;
    left: -10%;
    width: 400px;
    height: 400px;
    background: #a855f7;
    /* Purple */
    animation: float 15s infinite ease-in-out reverse;
}

/* Sections */
.section {
    padding: 60px 0;
}

@media (min-width: 768px) {
    .section {
        padding: 100px 0;
    }
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 60px;
}

/* About */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.about-text p {
    color: var(--text-secondary);
    margin-bottom: 24px;
    font-size: 1.1rem;
}

.skills-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 32px;
}

.skill-tag {
    background: rgba(255, 255, 255, 0.05);
    padding: 8px 16px;
    border-radius: 100px;
    font-size: 0.9rem;
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.code-block {
    background: #1e1e1e;
    padding: 32px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-family: 'Fira Code', monospace;
    font-size: 0.9rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    transform: rotate(2deg);
    transition: transform 0.3s ease;
}

.code-block:hover {
    transform: rotate(0deg) scale(1.02);
}

.keyword {
    color: #c678dd;
}

.variable {
    color: #e06c75;
}

.property {
    color: #d19a66;
}

.string {
    color: #98c379;
}

.boolean {
    color: #56b6c2;
}

/* Projects */
.project-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px;
}

@media (min-width: 640px) {
    .project-grid {
        grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    }
}

.project-card {
    background: var(--glass-bg);
    backdrop-filter: blur(40px) saturate(150%);
    -webkit-backdrop-filter: blur(40px) saturate(150%);
    border-radius: var(--radius-lg);
    padding: 40px;
    border: 1px solid var(--glass-border);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05), var(--glass-shadow);
    position: relative;
    overflow: hidden;

    /* 3D Tilt Props - Desktop Only */
    transform-style: preserve-3d;
    will-change: transform;
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), border-color 0.3s ease, background 0.3s ease;
}

@media (min-width: 1024px) {
    .project-card {
        transform: perspective(1000px) rotateX(var(--rotate-x, 0deg)) rotateY(var(--rotate-y, 0deg));
    }
}

/* Shimmer Animation */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }

    100% {
        background-position: 1000px 0;
    }
}

/* Glare Effect - Subtle */
.project-card::after,
.article-card::after,
.contact-option::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(600px circle at var(--mouse-x) var(--mouse-y),
            rgba(255, 255, 255, 0.08),
            transparent 40%);
    z-index: 1;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.project-card:hover::after,
.article-card:hover::after,
.contact-option:hover::after {
    opacity: 1;
}

.project-card:hover {
    border-color: var(--glass-highlight);
    background: rgba(255, 255, 255, 0.05);
}

.project-content h3 {
    font-size: 1.5rem;
    margin-bottom: 12px;
}

.project-content p {
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.project-tags {
    display: flex;
    gap: 12px;
    margin-bottom: 32px;
}

.project-tags span {
    font-size: 0.8rem;
    color: var(--accent-color);
    background: rgba(59, 130, 246, 0.1);
    padding: 4px 12px;
    border-radius: 100px;
}

.link-arrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.link-arrow:hover svg {
    transform: translateX(4px);
}

.link-arrow svg {
    transition: transform 0.2s ease;
}

/* Writing */
.writing-grid {
    display: grid;
    gap: 24px;
    grid-template-columns: 1fr;
}

@media (min-width: 768px) {
    .writing-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.article-card {
    display: block;
    padding: 32px;
    border-radius: var(--radius-md);
    border: 1px solid var(--glass-border);
    background: var(--glass-bg);
    backdrop-filter: blur(40px) saturate(150%);
    -webkit-backdrop-filter: blur(40px) saturate(150%);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05), var(--glass-shadow);
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    overflow: hidden;

    /* 3D Tilt Props - Desktop Only */
    transform-style: preserve-3d;
    will-change: transform;
}

@media (min-width: 1024px) {
    .article-card {
        transform: perspective(1000px) rotateX(var(--rotate-x, 0deg)) rotateY(var(--rotate-y, 0deg));
    }
}

.article-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--glass-highlight);
    transform: translateY(-4px) scale(1.02);
}

.article-card .date {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
    display: block;
}

.article-card h3 {
    font-size: 1.25rem;
    margin-bottom: 8px;
}

.article-card p {
    color: var(--text-secondary);
}

/* Contact */
.contact-wrapper {
    text-align: center;
    max-width: 600px;
}

.big-btn {
    font-size: 1.25rem;
    padding: 16px 48px;
    margin: 32px 0;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 32px;
}

.social-links a {
    color: var(--text-secondary);
    font-weight: 500;
}

.social-links a:hover {
    color: var(--text-primary);
    text-decoration: underline;
    text-underline-offset: 4px;
}

/* Footer */
footer {
    padding: 40px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Animations */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes float {

    0%,
    100% {
        transform: translate(0, 0);
    }

    50% {
        transform: translate(-20px, 20px);
    }
}

/* Mobile Responsive */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
}

.hamburger {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    position: relative;
}

.hamburger::before,
.hamburger::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    left: 0;
    transition: 0.3s ease;
}

.hamburger::before {
    top: -8px;
}

.hamburger::after {
    bottom: -8px;
}

@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }

    .nav-links {
        position: fixed;
        top: var(--header-height);
        left: 0;
        width: 100%;
        background: var(--bg-color);
        flex-direction: column;
        padding: 40px;
        gap: 24px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        transform: translateY(-150%);
        transition: transform 0.3s ease;
    }

    .nav-links.active {
        transform: translateY(0);
    }

    .headline {
        font-size: 3rem;
    }

    .about-grid {
        grid-template-columns: 1fr;
    }

    .code-block {
        transform: rotate(0);
        margin-top: 20px;
    }
}

/* Cursor Glow Effect */
.cursor-glow {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.15), transparent 70%);
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    transform: translate(-50%, -50%);
    z-index: 9999;
    transition: opacity 0.3s ease;
}

/* Hamburger Animation */
.menu-toggle[aria-expanded="true"] .hamburger {
    background: transparent;
}

.menu-toggle[aria-expanded="true"] .hamburger::before {
    transform: rotate(45deg);
    top: 0;
}

.menu-toggle[aria-expanded="true"] .hamburger::after {
    transform: rotate(-45deg);
    bottom: 0;
}