/* ===== CSS Custom Properties ===== */
:root {
    /* Dark theme (default) */
    --bg-primary: #0a192f;
    --bg-secondary: #112240;
    --bg-tertiary: #1d3461;
    --text-primary: #ccd6f6;
    --text-secondary: #8892b0;
    --accent: #64ffda;
    --accent-tint: rgba(100, 255, 218, 0.1);
    --white: #e6f1ff;
    --shadow: rgba(2, 12, 27, 0.7);

    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'SF Mono', 'Fira Code', 'Fira Mono', 'Roboto Mono', monospace;

    /* Spacing */
    --nav-height: 70px;
    --section-padding: 100px;

    /* Transitions */
    --transition: all 0.25s cubic-bezier(0.645, 0.045, 0.355, 1);
    --transition-slow: all 0.5s cubic-bezier(0.645, 0.045, 0.355, 1);
}

/* Light theme */
[data-theme="light"] {
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #e2e8f0;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --accent: #0891b2;
    --accent-tint: rgba(8, 145, 178, 0.1);
    --white: #0f172a;
    --shadow: rgba(148, 163, 184, 0.2);
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--nav-height);
}

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

::selection {
    background-color: var(--accent-tint);
    color: var(--accent);
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--accent);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

/* ===== Cursor Glow ===== */
.cursor-glow {
    position: fixed;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    pointer-events: none;
    background: radial-gradient(
        circle,
        rgba(100, 255, 218, 0.08) 0%,
        rgba(100, 255, 218, 0.02) 40%,
        transparent 70%
    );
    transform: translate(-50%, -50%);
    z-index: 0;
    transition: opacity 0.3s ease;
    opacity: 0;
}

[data-theme="light"] .cursor-glow {
    background: radial-gradient(
        circle,
        rgba(8, 145, 178, 0.06) 0%,
        rgba(8, 145, 178, 0.02) 40%,
        transparent 70%
    );
}

body:hover .cursor-glow {
    opacity: 1;
}

/* ===== Navigation ===== */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background-color: rgba(10, 25, 47, 0.85);
    backdrop-filter: blur(10px);
    z-index: 100;
    transition: var(--transition);
}

[data-theme="light"] .nav {
    background-color: rgba(248, 250, 252, 0.85);
}

.nav.scrolled {
    box-shadow: 0 10px 30px -10px var(--shadow);
}

.nav-content {
    max-width: 1200px;
    margin: 0 auto;
    height: 100%;
    padding: 0 50px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: -1px;
}

.nav-links {
    display: flex;
    gap: 30px;
}

.nav-link {
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 500;
    position: relative;
    padding: 5px 0;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--accent);
    transition: var(--transition);
}

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

.nav-link:hover::after {
    width: 100%;
}

/* Theme Toggle */
.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: var(--text-secondary);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle:hover {
    color: var(--accent);
}

.sun-icon {
    display: none;
}

[data-theme="light"] .sun-icon {
    display: block;
}

[data-theme="light"] .moon-icon {
    display: none;
}

/* Mobile Menu Button */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    z-index: 101;
}

.mobile-menu-btn span {
    display: block;
    width: 25px;
    height: 2px;
    background-color: var(--text-primary);
    transition: var(--transition);
}

.mobile-menu-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-btn.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile Menu */
.mobile-menu {
    display: none;
    position: fixed;
    top: 0;
    right: -100%;
    width: 75%;
    max-width: 400px;
    height: 100vh;
    background-color: var(--bg-secondary);
    z-index: 99;
    padding: 100px 50px;
    transition: var(--transition-slow);
    box-shadow: -10px 0 30px var(--shadow);
}

.mobile-menu.active {
    right: 0;
}

.mobile-link {
    display: block;
    color: var(--text-primary);
    font-size: 1.2rem;
    padding: 15px 0;
    border-bottom: 1px solid var(--bg-tertiary);
}

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

/* ===== Hero Section ===== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 0 50px;
    padding-top: var(--nav-height);
}

.hero-content {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.hero-greeting {
    color: var(--accent);
    font-size: 1rem;
    font-weight: 500;
    font-family: var(--font-mono);
    display: block;
    margin-bottom: 10px;
    margin-left: 8px;
}

.hero-name {
    font-size: clamp(40px, 8vw, 80px);
    color: var(--text-primary);
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 10px;
}

.hero-title {
    font-size: clamp(30px, 6vw, 60px);
    color: var(--text-secondary);
    font-weight: 600;
    line-height: 1.1;
    margin-bottom: 30px;
}

.hero-description {
    font-size: 1.1rem;
    max-width: 540px;
    margin-bottom: 30px;
    line-height: 1.7;
}

.highlight {
    color: var(--accent);
}

.hero-cta {
    display: flex;
    gap: 20px;
    margin-bottom: 40px;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 16px 28px;
    border-radius: 4px;
    font-size: 0.95rem;
    font-weight: 500;
    transition: var(--transition);
    cursor: pointer;
}

.btn-primary {
    background-color: transparent;
    border: 1px solid var(--accent);
    color: var(--accent);
}

.btn-primary:hover {
    background-color: var(--accent-tint);
}

.btn-secondary {
    background-color: var(--accent-tint);
    border: 1px solid transparent;
    color: var(--accent);
}

.btn-secondary:hover {
    border-color: var(--accent);
}

.btn-large {
    padding: 20px 40px;
    font-size: 1.1rem;
}

/* Social Links */
.hero-links {
    display: flex;
    gap: 25px;
}

.social-link {
    color: var(--text-secondary);
    transition: var(--transition);
}

.social-link:hover {
    color: var(--accent);
    transform: translateY(-3px);
}

/* Hero Image */
.hero-image {
    display: flex;
    justify-content: center;
}

.image-wrapper {
    position: relative;
    width: 300px;
    height: 300px;
}

.profile-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    border-radius: 8px;
    filter: grayscale(20%);
    transition: var(--transition);
}

.image-wrapper:hover .profile-photo {
    filter: none;
}

.image-border {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 100%;
    height: 100%;
    border: 2px solid var(--accent);
    border-radius: 8px;
    z-index: -1;
    transition: var(--transition);
}

.image-wrapper:hover .image-border {
    top: 15px;
    left: 15px;
}

/* ===== Sections ===== */
.section {
    max-width: 1000px;
    margin: 0 auto;
    padding: var(--section-padding) 50px;
}

.section-title {
    font-size: clamp(24px, 5vw, 32px);
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 40px;
    display: flex;
    align-items: center;
    white-space: nowrap;
}

.section-title::after {
    content: '';
    display: block;
    width: 300px;
    height: 1px;
    background-color: var(--bg-tertiary);
    margin-left: 20px;
}

.title-number {
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: 0.9em;
    font-weight: 400;
    margin-right: 10px;
}

/* ===== About Section ===== */
.about-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 50px;
}

.about-text p {
    margin-bottom: 20px;
}

.skills-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(140px, 200px));
    gap: 10px;
    margin-top: 20px;
}

.skills-list li {
    position: relative;
    padding-left: 20px;
    font-family: var(--font-mono);
    font-size: 0.9rem;
}

.skills-list li::before {
    content: '>';
    position: absolute;
    left: 0;
    color: var(--accent);
}

/* ===== Experience Section ===== */
.experience-content {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.job {
    padding: 25px;
    background-color: var(--bg-secondary);
    border-radius: 8px;
    border-left: 3px solid var(--accent);
    transition: var(--transition);
}

.job:hover {
    transform: translateX(5px);
    box-shadow: -5px 5px 20px var(--shadow);
}

.job-header {
    margin-bottom: 15px;
}

.job-title {
    font-size: 1.2rem;
    color: var(--text-primary);
    font-weight: 600;
}

.job-company {
    color: var(--accent);
}

.job-date {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 5px;
}

.job-details {
    padding-left: 20px;
}

.job-details li {
    position: relative;
    padding-left: 25px;
    margin-bottom: 10px;
    font-size: 0.95rem;
}

.job-details li::before {
    content: '>';
    position: absolute;
    left: 0;
    color: var(--accent);
    font-family: var(--font-mono);
}

/* ===== Projects Section ===== */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.project-card {
    background-color: var(--bg-secondary);
    border-radius: 8px;
    padding: 30px;
    transition: var(--transition);
    position: relative;
}

.project-card:hover {
    transform: translateY(-7px);
    box-shadow: 0 20px 30px -15px var(--shadow);
}

.project-card.featured {
    grid-column: span 2;
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
}

.project-overline {
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    margin-bottom: 10px;
}

.project-content .project-title {
    font-size: 1.3rem;
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 15px;
}

.project-description {
    margin-bottom: 20px;
}

.project-description-small {
    font-size: 0.95rem;
    margin-bottom: 20px;
    flex-grow: 1;
}

.project-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 25px;
}

.folder-icon {
    color: var(--accent);
}

.project-links {
    display: flex;
    gap: 15px;
}

.project-links a {
    color: var(--text-secondary);
    transition: var(--transition);
}

.project-links a:hover {
    color: var(--accent);
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: auto;
}

.project-tech li {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-secondary);
    background-color: var(--accent-tint);
    padding: 4px 10px;
    border-radius: 4px;
}

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

.blog-card {
    background-color: var(--bg-secondary);
    border-radius: 8px;
    padding: 30px;
    transition: var(--transition);
    border-top: 3px solid transparent;
}

.blog-card:hover {
    border-top-color: var(--accent);
    transform: translateY(-5px);
    box-shadow: 0 20px 30px -15px var(--shadow);
}

.blog-date {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--accent);
    margin-bottom: 10px;
}

.blog-title {
    font-size: 1.2rem;
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 15px;
    line-height: 1.4;
}

.blog-link {
    color: var(--text-primary);
}

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

.blog-excerpt {
    font-size: 0.95rem;
    margin-bottom: 20px;
    line-height: 1.6;
}

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

.blog-tags li {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--accent);
    background-color: var(--accent-tint);
    padding: 4px 10px;
    border-radius: 4px;
}

/* ===== Contact Section ===== */
.contact {
    text-align: center;
    padding-bottom: 150px;
}

.contact .section-title {
    justify-content: center;
}

.contact .section-title::after {
    display: none;
}

.contact-content {
    max-width: 600px;
    margin: 0 auto;
}

.contact-text {
    font-size: 1.1rem;
    margin-bottom: 40px;
}

.contact-links {
    margin-top: 40px;
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

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

.contact-links a:hover {
    color: var(--accent);
}

.separator {
    color: var(--bg-tertiary);
}

/* ===== Footer ===== */
.footer {
    text-align: center;
    padding: 30px 50px;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.footer-note {
    margin-top: 10px;
    font-size: 0.75rem;
    opacity: 0.7;
}

/* ===== Animations ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-name,
.hero-title,
.hero-description,
.hero-cta,
.hero-links {
    animation: fadeInUp 0.6s ease-out forwards;
    opacity: 0;
}

.hero-name { animation-delay: 0.1s; }
.hero-title { animation-delay: 0.3s; }
.hero-description { animation-delay: 0.4s; }
.hero-cta { animation-delay: 0.5s; }
.hero-links { animation-delay: 0.6s; }

.hero-image {
    animation: fadeInUp 0.8s ease-out 0.4s forwards;
    opacity: 0;
}

/* Scroll reveal animation */
.section {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.section.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===== Responsive ===== */
@media (max-width: 1080px) {
    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-description {
        margin-left: auto;
        margin-right: auto;
    }

    .hero-cta {
        justify-content: center;
    }

    .hero-links {
        justify-content: center;
    }

    .hero-image {
        order: -1;
    }

    .image-wrapper {
        width: 250px;
        height: 250px;
    }

    .project-card.featured {
        grid-column: span 1;
    }
}

@media (max-width: 768px) {
    .nav-content {
        padding: 0 25px;
    }

    .nav-links {
        display: none;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .mobile-menu {
        display: block;
    }

    .hero {
        padding: 0 25px;
        padding-top: calc(var(--nav-height) + 20px);
        padding-bottom: 40px;
        min-height: auto;
    }

    /* Disable all hero animations on mobile */
    .hero-name,
    .hero-title,
    .hero-description,
    .hero-cta,
    .hero-links,
    .hero-image {
        animation: none;
        opacity: 1;
        transform: none;
    }

    .hero-content {
        transform: none !important;
        opacity: 1 !important;
    }

    .section {
        padding: var(--section-padding) 25px;
        position: relative;
        z-index: 2;
        background-color: var(--bg-primary);
        transform: none;
        opacity: 1;
    }

    .section-title::after {
        width: 100px;
    }

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

    .projects-grid,
    .blog-grid {
        grid-template-columns: 1fr;
    }

    .image-wrapper {
        width: 200px;
        height: 200px;
    }

    .contact-links {
        flex-direction: column;
        gap: 10px;
    }

    .separator {
        display: none;
    }
}

@media (max-width: 480px) {
    .hero-name {
        font-size: 36px;
    }

    .hero-title {
        font-size: 24px;
    }

    .hero-cta {
        flex-direction: column;
        gap: 15px;
    }

    .btn {
        width: 100%;
        text-align: center;
    }

    .image-wrapper {
        width: 180px;
        height: 220px;
    }
}

/* ===== Print Styles ===== */
@media print {
    .nav,
    .cursor-glow,
    .theme-toggle,
    .mobile-menu-btn {
        display: none;
    }

    body {
        background: white;
        color: black;
    }

    .hero {
        min-height: auto;
        padding-top: 50px;
    }

    .section {
        padding: 30px 0;
    }
}
