:root {
    --navy: #031022;
    --light-navy: #081a2d;
    --lightest-navy: #16293d;
    --dark-slate: #3b4b5a;
    --slate: #94a6bd;
    --light-slate: #b8c9dc;
    --lightest-slate: #d7e7f6;
    --white: #e6f1ff;
    --green: #64ffda;
    --transition: all 0.25s cubic-bezier(0.645, 0.045, 0.355, 1);
    --font-sans: 'Inter', sans-serif;
    --font-mono: 'Fira Code', monospace;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    background-color: var(--navy);
    color: var(--slate);
    font-size: 16px;
    line-height: 1.6;
    overflow-x: hidden;
    cursor: none;
}

/* Motion Detector Effect */
.motion-detector {
    position: fixed;
    width: 320px;
    height: 320px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(45,120,255,0.18) 0%, rgba(45,120,255,0.06) 45%, rgba(45,120,255,0) 75%);
    pointer-events: none;
    transform: translate(-50%, -50%);
    z-index: 1;
    transition: opacity 0.25s ease;
    filter: blur(6px);
    opacity: 0.95;
}

/* Custom Cursor */
.cursor {
    position: fixed;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background-color: rgba(77,171,247,0.95);
    box-shadow: 0 0 10px rgba(77,171,247,0.6), 0 0 24px rgba(77,171,247,0.25);
    pointer-events: none;
    transform: translate(-50%, -50%);
    z-index: 9999;
    transition: transform 0.08s ease, background-color 0.12s ease;
}

.cursor-follower {
    position: fixed;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid rgba(77,171,247,0.45);
    background: rgba(30,80,200,0.02);
    box-shadow: 0 4px 20px rgba(45,120,255,0.12);
    pointer-events: none;
    transform: translate(-50%, -50%);
    z-index: 9998;
    transition: transform 0.25s ease, opacity 0.2s ease;
}

/* Sidebar Navigation */
.sidebar {
    position: fixed;
    top: 0;
    left: 20px;
    width: 50px;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 30px 0;
    z-index: 10;
}

.logo {
    margin-bottom: 60px;
    color: var(--green);
    font-size: 24px;
    font-weight: 700;
    transform: none;
    white-space: nowrap;
}

.logo svg {
    width: 40px;
    height: 40px;
    display: block;
}

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

.nav-links a {
    color: var(--slate);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-decoration: none;
    position: relative;
    transition: var(--transition);
    padding: 10px 0;
}

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

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

.nav-links a.active::after {
    height: 20px;
}

/* Main Content */
.container {
    margin: 0 auto;
    padding: 0 80px;
    max-width: 1000px;
    position: relative;
    z-index: 2;
    width: 100%;
    box-sizing: border-box;
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 100px 0;
}

.hero-content {
    max-width: 800px;
}

.hero-content p {
    color: var(--green);
    font-family: var(--font-mono);
    font-size: 16px;
    margin-bottom: 20px;
}

.hero-content h1 {
    color: var(--lightest-slate);
    font-size: 60px;
    font-weight: 600;
    line-height: 1.1;
    margin-bottom: 20px;
}

.hero-content h2 {
    color: var(--slate);
    font-size: 60px;
    font-weight: 600;
    line-height: 1.1;
    margin-bottom: 30px;
}

.hero-content .typewriter {
    display: inline-block;
    color: var(--green);
}

.hero-content .description {
    color: var(--slate);
    font-size: 20px;
    max-width: 540px;
    margin-bottom: 40px;
}

.hero-buttons {
    display: flex;
    gap: 15px;
}

.btn {
    display: inline-block;
    padding: 12px 25px;
    border-radius: 4px;
    text-decoration: none;
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.1em;
    transition: var(--transition);
    cursor: none;
    border: none;
    position: relative;
    z-index: 5;
}

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

.btn-primary:hover {
    background-color: rgba(100, 255, 218, 0.1);
    transform: translateY(-3px);
}

.btn-secondary {
    background-color: transparent;
    color: var(--lightest-slate);
    border: 1px solid var(--lightest-navy);
    padding: 12px 20px;
}

.btn-secondary:hover {
    background-color: var(--lightest-navy);
    transform: translateY(-3px);
}

/* Section Styles */
section {
    padding: 100px 0;
}

.section-title {
    position: relative;
    margin-bottom: 50px;
}

.section-title h2 {
    color: var(--lightest-slate);
    font-size: 26px;
    font-weight: 600;
    display: inline-block;
    position: relative;
}

.section-title h2::after {
    content: '';
    position: absolute;
    width: 100px;
    height: 1px;
    background-color: var(--lightest-navy);
    bottom: -10px;
    left: 0;
}

.section-title .number {
    display: inline-block;
    color: var(--dark-slate);
    font-family: var(--font-mono);
    font-size: 32px;
    font-weight: 600;
    opacity: 0.9;
    margin-right: 12px;
    vertical-align: middle;
}

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

.about-image {
    position: relative;
    height: 300px;
    border-radius: 4px;
    overflow: hidden;
}

.about-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.about-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--green);
    mix-blend-mode: screen;
    opacity: 0.1;
    z-index: 1;
}

.about-text {
    color: var(--slate);
}

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

.about-text ul {
    list-style-type: none;
    margin-top: 30px;
}

.about-text li {
    position: relative;
    padding-left: 25px;
    margin-bottom: 10px;
    color: var(--slate);
}

.about-text li::before {
    content: '▹';
    position: absolute;
    left: 0;
    color: var(--green);
}

/* Experience Section */
.experience-timeline { position: relative; padding-left: 30px; }
.experience-timeline::before { content: ''; position: absolute; top: 5px; left: 0; width: 1px; height: calc(100% - 10px); background-color: var(--lightest-navy); }
.timeline-item { position: relative; padding-bottom: 50px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before { content: ''; position: absolute; top: 5px; left: -30px; width: 11px; height: 11px; border-radius: 50%; background-color: var(--navy); border: 2px solid var(--green); }
.timeline-date { color: var(--slate); font-family: var(--font-mono); font-size: 13px; margin-bottom: 5px; }
.timeline-title { color: var(--lightest-slate); font-size: 20px; font-weight: 600; margin-bottom: 5px; }
.timeline-company { color: var(--green); font-family: var(--font-mono); font-size: 16px; margin-bottom: 15px; }
.timeline-description { color: var(--slate); }
.timeline-description ul { list-style-type: none; margin-top: 15px; }
.timeline-description li { position: relative; padding-left: 25px; margin-bottom: 10px; }
.timeline-description li::before { content: '▹'; position: absolute; left: 0; color: var(--green); }

/* Skills Section */
.skills-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 30px; }
.skill-category { background-color: var(--light-navy); border-radius: 4px; padding: 25px; height: 100%; }
.skill-category h3 { color: var(--lightest-slate); font-size: 18px; font-weight: 600; margin-bottom: 20px; display: flex; align-items: center; }
.skill-category h3 i { margin-right: 10px; color: var(--green); }
.skill-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.skill-item { color: var(--slate); font-family: var(--font-mono); font-size: 14px; padding: 5px 10px; background-color: var(--navy); border-radius: 3px; transition: var(--transition); }
.skill-item:hover { background-color: var(--lightest-navy); transform: translateY(-3px); }

/* Projects Section */
.projects-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.project-card { background-color: var(--light-navy); border-radius: 4px; overflow: hidden; transition: var(--transition); height: 100%; display: flex; flex-direction: column; }
.project-card:hover { transform: translateY(-5px); }
.project-header { position: relative; height: 180px; overflow: hidden; }
/* allow a subtle 3D tilt on images */
.project-header { perspective: 900px; }
/* Global image behavior: zoom out on hover by default, opt-out with .no-zoom */
:root {
    --image-hover-scale: 0.95;
}

img {
    display: block;
    max-width: 100%;
    height: auto;
    transition: transform 0.25s cubic-bezier(0.645, 0.045, 0.355, 1), filter 0.25s ease, box-shadow 0.25s ease;
    will-change: transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* Apply zoom-out on hover unless an image has the .no-zoom class */
img:not(.no-zoom):hover {
    transform: scale(var(--image-hover-scale));
    filter: saturate(1.03) contrast(1.02);
    box-shadow: 0 12px 30px rgba(0,0,0,0.24);
}

/* Respect user's reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    img, .cursor, .cursor-follower, .motion-detector {
        transition: none !important;
        animation: none !important;
    }
    img:not(.no-zoom):hover { transform: none !important; box-shadow: none !important; }
}

/* Project-specific and about-image rules (kept after the global rules so they can override if needed) */
.project-header img { width: 100%; height: 100%; object-fit: cover; transition: transform 300ms cubic-bezier(0.22, 0.9, 0.32, 1), filter 250ms ease, box-shadow 250ms ease; transform-origin: center center; transform-style: preserve-3d; }
.project-card:hover .project-header img { transform: scale(var(--image-hover-scale)) rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg)); }

/* subtle dark overlay on hover to improve contrast for icons */
.project-header::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,0.18), rgba(0,0,0,0)); opacity: 0; transition: opacity 250ms ease; pointer-events: none; }
.project-card:hover .project-header::after { opacity: 1; }

/* About image: zoom out on hover to match project images */
.about-image img { transition: var(--transition); transform-origin: center center; }
.about-image:hover img { transform: scale(0.95); }
.project-links { position: absolute; top: 10px; right: 10px; display: flex; gap: 10px; opacity: 0; transition: var(--transition); }
.project-card:hover .project-links { opacity: 1; }
.project-links a { width: 35px; height: 35px; background-color: var(--light-navy); color: var(--lightest-slate); border-radius: 4px; display: flex; align-items: center; justify-content: center; transition: var(--transition); }
.project-links a:hover { background-color: var(--green); color: var(--navy); }
.project-content { padding: 25px; flex-grow: 1; display: flex; flex-direction: column; }
.project-title { color: var(--lightest-slate); font-size: 20px; font-weight: 600; margin-bottom: 10px; }
.project-description { color: var(--slate); font-size: 15px; margin-bottom: 20px; flex-grow: 1; }
.project-tech { display: flex; flex-wrap: wrap; gap: 8px; }
.tech-tag { color: var(--green); font-family: var(--font-mono); font-size: 13px; padding: 3px 8px; background-color: rgba(100, 255, 218, 0.1); border-radius: 3px; }

/* Project gallery (fade slideshow) */
.project-header.gallery { position: relative; }
.project-header.gallery img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.6s ease; }
.project-header.gallery img.active { opacity: 1; position: absolute; }

/* Contact Section */
.contact-content { display: flex; flex-direction: column; align-items: center; text-align: center; max-width: 600px; margin: 0 auto; }
.contact-content p { color: var(--slate); font-size: 20px; margin-bottom: 30px; }
.contact-buttons { display: flex; gap: 15px; margin-bottom: 60px; }
.contact-info { display: flex; flex-direction: column; align-items: center; gap: 20px; }
.social-links-horizontal { display: flex; gap: 20px; margin-top: 20px; }
.social-links-horizontal a { color: var(--slate); font-size: 20px; transition: var(--transition); }
.social-links-horizontal a:hover { color: var(--green); transform: translateY(-3px); }

/* Footer */
footer { padding: 40px 0; text-align: center; color: var(--dark-slate); font-family: var(--font-mono); font-size: 14px; }

/* Hamburger button */
.menu-toggle { display: none; position: absolute; top: 20px; right: -60px; width: 36px; height: 28px; background: transparent; border: 0; cursor: pointer; z-index: 101; }
.menu-toggle span { display: block; width: 100%; height: 3px; background: var(--slate); margin: 6px 0; transition: var(--transition); }
.menu-toggle:focus { outline: 2px dashed var(--green); outline-offset: 4px; }

/* Mobile nav collapsed */
@media (max-width: 768px) {
    .sidebar { position: fixed; left: 0; width: 100%; padding: 12px 16px; display: flex; align-items: center; }
    .logo { margin: 0; }
    .menu-toggle { display: block; right: 16px; position: absolute; }
    .nav-links { position: absolute; top: 64px; left: 0; right: 0; background: var(--navy); border-top: 1px solid var(--lightest-navy); flex-direction: column; align-items: flex-start; padding: 12px 16px; gap: 10px; max-height: 0; overflow: hidden; transition: max-height 0.3s ease; }
    .nav-links.open { max-height: 320px; }
    .nav-links a { padding: 10px 4px; display: block; }

    /* Animate hamburger into X when open */
    .menu-toggle.active span:nth-child(1) { transform: translateY(9px) rotate(45deg); background: var(--green); }
    .menu-toggle.active span:nth-child(2) { opacity: 0; }
    .menu-toggle.active span:nth-child(3) { transform: translateY(-9px) rotate(-45deg); background: var(--green); }

    /* Push content down so it isn't covered */
    .container { margin: 72px auto 0; }
}

/* Responsive */
@media (max-width: 1200px) {
    .container { padding: 0 60px; }
    .hero-content h1, .hero-content h2 { font-size: 50px; }
}

@media (max-width: 992px) {
    .container { padding: 0 40px; }
    .about-content { grid-template-columns: 1fr; }
    .about-image { height: 250px; max-width: 400px; margin: 0 auto; }
}

@media (max-width: 768px) {
    .sidebar { width: 100%; height: auto; flex-direction: row; justify-content: space-between; padding: 12px 16px; background-color: var(--navy); position: fixed; top: 0; left: 0; right: 0; z-index: 100; }
    .logo { margin: 0; transform: none; }
    /* nav-links handled by hamburger styles above */
    .container { margin: 72px auto 0; padding: 0 24px; width: auto; }
    .hero { min-height: auto; padding: 72px 0; }
    .hero-content h1, .hero-content h2 { font-size: 40px; }
    .skills-grid { grid-template-columns: 1fr; }
    .section-title .number { position: relative; display: inline-block; margin-bottom: 0; font-size: 20px; opacity: 0.9; }
    .section-title h2::after { width: 50px; }
    .cursor, .cursor-follower, .motion-detector { display: none; }
    body, a, button { cursor: auto; }
}

@media (max-width: 576px) {
    .container { padding: 0 20px; }
    .hero-content h1, .hero-content h2 { font-size: 35px; }
    .hero-content .description { font-size: 18px; }
    .hero-buttons { flex-direction: column; gap: 10px; }
    .btn { width: 100%; text-align: center; }
    .contact-buttons { flex-direction: column; width: 100%; }
    .contact-buttons .btn { width: 100%; }
    .about-image { height: 200px; max-width: 100%; }
} 