/* --- CSS Variables for Easy Theming --- */
:root {
    --bg-color: #0d0f18; /* Darker, richer navy blue */
    --text-color: #e0e6f8; /* Brighter for better contrast */
    --secondary-text-color: #8892b0;
    --accent-color: #00e0e0; /* Vibrant Cyan */
    --accent-color-tint: rgba(0, 224, 224, 0.1);
    --grid-color: rgba(0, 224, 224, 0.05); /* Softer Grid */

    /* --- Enhanced Glassmorphism Variables --- */
    --glass-bg: linear-gradient(135deg, rgba(0, 224, 224, 0.03), rgba(0, 224, 224, 0.01));
    --glass-border: 1px solid rgba(0, 224, 224, 0.2);
    --glass-shadow: 0 0 25px rgba(0, 224, 224, 0.07);
    --glass-backdrop-filter: blur(10px);
    
    --mono-font: 'Fira Code', monospace;
    --sans-font: 'Calibre', 'San Francisco', 'SF Pro Text', -apple-system, system-ui, sans-serif;
    --border-radius: 4px;
    --easing: cubic-bezier(0.645, 0.045, 0.355, 1);
    --transition: all 0.25s var(--easing);
}

/* --- Modern CSS Reset & Global Styles --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    background-color: var(--bg-color);
    background-image:
        linear-gradient(var(--grid-color) 1px, transparent 1px),
        linear-gradient(to right, var(--grid-color) 1px, transparent 1px);
    background-size: 40px 40px;
    color: var(--text-color);
    font-family: var(--sans-font);
    font-size: 19px; /* Increased base font size */
    line-height: 1.7; /* Increased line height for readability */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr auto;
    min-height: 100vh;
    &.blur-active { overflow: hidden; }
}

/* --- Custom Cursor --- */
.custom-cursor { display: none; }
@media (hover: hover) and (pointer: fine) {
    body { cursor: none; }
    .custom-cursor {
        display: block; position: fixed; width: 40px; height: 40px; border-radius: 50%;
        background: radial-gradient(circle, rgba(0, 224, 224, 0.4) 0%, rgba(0, 224, 224, 0) 70%);
        pointer-events: none; transform: translate(-50%, -50%);
        transition: width 0.3s ease, height 0.3s ease, background 0.3s ease, transform 0.1s ease;
        z-index: 10000; will-change: transform;
    }
    .custom-cursor.pointer {
        width: 25px; height: 25px;
        background: radial-gradient(circle, rgba(0, 224, 224, 0.6) 0%, rgba(0, 224, 224, 0) 75%);
        transform: translate(-50%, -50%) scale(0.9); /* Scales down on hover */
    }
    a, button { cursor: none; }
}


/* --- Overlays & Layout --- */
.scanline-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none; z-index: 9999;
    background: repeating-linear-gradient(0deg, rgba(0,0,0,0.3), rgba(0,0,0,0.3) 1px, transparent 1px, transparent 2px);
    opacity: 0.05; /* Made scanlines more subtle */
}
main { padding: 0 25px; filter: none; transition: var(--transition); }
main.blur { filter: blur(5px) brightness(0.7); pointer-events: none; }
section { padding: 100px 0; max-width: 1100px; margin: 0 auto; }
.section-title {
    font-family: var(--mono-font); font-size: clamp(26px, 5vw, 34px); color: var(--text-color);
    margin-bottom: 40px; font-weight: 500; display: flex; align-items: center; position: relative; white-space: nowrap;
    &::before { content: '>'; color: var(--accent-color); font-size: 1.1em; margin-right: 15px; }
    &::after {
        content: ''; display: block; position: relative; top: 0px;
        width: 100%; height: 1px; margin-left: 20px;
        background: linear-gradient(to right, rgba(0, 224, 224, 0.3), transparent);
    }
}

/* --- Animation System --- */
@keyframes fade-in-up { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes glitch {
    0% { transform: translate(0); text-shadow: 0 0 5px var(--accent-color); } 20% { transform: translate(-2px, 2px); }
    40% { transform: translate(-2px, -2px); } 60% { transform: translate(2px, 2px); text-shadow: none; }
    80% { transform: translate(2px, -2px); } 100% { transform: translate(0); text-shadow: 0 0 5px var(--accent-color); }
}
.animate-on-load, .animate-on-scroll {
    opacity: 0;
    transition: opacity 0.6s var(--easing) 0.2s, transform 0.6s var(--easing) 0.2s;
}
.animate-on-load { animation: fade-in-up 0.6s var(--easing) forwards; }
.animate-on-scroll.is-visible { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
  .animate-on-load, .animate-on-scroll { animation: none !important; opacity: 1 !important; transform: none !important; transition: none !important; }
}

/* --- Navigation --- */
nav {
    display: flex; justify-content: space-between; align-items: center; padding: 0px 25px;
    position: fixed; width: 100%; top: 0; height: 80px;
    background: rgba(13, 15, 24, 0.75);
    backdrop-filter: var(--glass-backdrop-filter);
    -webkit-backdrop-filter: var(--glass-backdrop-filter);
    border-bottom: 1px solid rgba(0, 224, 224, 0.1);
    z-index: 100;
    .logo a { font-size: 1.5rem; color: var(--accent-color); font-weight: 700; transition: var(--transition); font-family: var(--mono-font); }
    .logo a:hover { transform: scale(1.05); animation: glitch 0.2s infinite; }
    .nav-links { display: none; }
}
.nav-cta-button {
    font-family: var(--mono-font); padding: 8px 16px; border: 1px solid var(--accent-color);
    border-radius: var(--border-radius); color: var(--accent-color); font-size: 0.9em;
    transition: var(--transition);
    &:hover { background-color: var(--accent-color-tint); box-shadow: 0 0 10px var(--accent-color-tint); }
}

/* --- Hero Section --- */
#hero { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; }
.hero-content {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-backdrop-filter);
    -webkit-backdrop-filter: var(--glass-backdrop-filter);
    border: var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: var(--border-radius);
    padding: 2.5rem;
    max-width: 800px;
}
.hero-intro { font-family: var(--mono-font); color: var(--accent-color); font-size: 1.2rem; margin-bottom: 25px; }
.hero-name { font-size: clamp(40px, 8vw, 80px); color: var(--text-color); line-height: 1.1; font-weight: 700; }
.hero-tagline { font-size: clamp(30px, 6vw, 55px); color: var(--secondary-text-color); line-height: 1.1; margin-top: 10px; }
.hero-description { max-width: 600px; margin-top: 30px; color: var(--secondary-text-color); font-size: 1.1rem; }
.hero-cli { font-family: var(--mono-font); margin-top: 50px; font-size: 1.2rem; color: var(--secondary-text-color); }
#typing-text { color: var(--text-color); }
.typed-cursor { color: var(--accent-color); animation: blink 1s step-end infinite; }
@keyframes blink { from, to { opacity: 1; } 50% { opacity: 0; } }

/* --- About Section --- */
.about-content { display: grid; grid-template-columns: 1fr; gap: 50px; align-items: flex-start; }
.about-photo { position: relative; max-width: 320px; margin: 0 auto 60px; grid-row: 1;
    img { width: 100%; border-radius: var(--border-radius); display: block; position: relative; z-index: 1; border: var(--glass-border); filter: grayscale(50%) contrast(1.1); }
    &::after {
        content: ''; display: block; position: absolute;
        width: 100%; height: 100%; border: 2px solid var(--accent-color);
        border-radius: var(--border-radius); top: 14px; left: 14px;
        z-index: 0; transition: var(--transition);
    }
    &:hover {
        &::after { top: 10px; left: 10px; box-shadow: 0 0 15px var(--accent-color-tint); }
        img { filter: grayscale(0%) contrast(1); }
    }
}
.about-text p { margin-bottom: 20px; color: var(--secondary-text-color); }
.about-text a { color: var(--accent-color); text-decoration: none; position: relative; }
.about-text a::after { content: ''; position: absolute; width: 100%; height: 1px; bottom: -3px; left: 0; background-color: var(--accent-color); transform: scaleX(0); transition: transform 0.3s ease; transform-origin: left; }
.about-text a:hover::after { transform: scaleX(1); }
.tech-list { 
    display: grid; grid-template-columns: repeat(2, minmax(140px, 220px)); 
    list-style: none; margin-top: 25px; gap: 15px; font-family: var(--mono-font);
    li { position: relative; padding-left: 25px; color: var(--secondary-text-color); font-size: 0.95em; }
    li::before { content: '▹'; position: absolute; left: 0; color: var(--accent-color); font-size: 1.1em; top: -1px; }
}

/* --- Projects Section --- */
.project-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 25px;
}
.project-card {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-backdrop-filter);
    -webkit-backdrop-filter: var(--glass-backdrop-filter);
    border: var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: var(--border-radius);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 224, 224, 0.1);
}
.project-banner {
    overflow: hidden;
    border-bottom: var(--glass-border);
}
.project-banner img {
    display: block;
    width: 100%;
    transition: transform 0.3s var(--easing);
}
.project-card:hover .project-banner img {
    transform: scale(1.03);
}
.project-content {
    padding: 25px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    justify-content: space-between;
}
.project-overline {
    margin: 0 0 10px;
    color: var(--accent-color);
    font-family: var(--mono-font);
    font-size: 0.9rem;
    font-weight: 400;
}
.project-title {
    margin: 0 0 15px;
    font-size: 1.5rem;
}
.project-title a {
    color: var(--text-color);
    transition: var(--transition);
}
.project-title a:hover {
    color: var(--accent-color);
}
.project-description p {
    color: var(--secondary-text-color);
    font-size: 1rem;
    margin-bottom: 0;
}
.project-footer {
    margin-top: 25px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}
.project-tech-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    font-family: var(--mono-font);
    font-size: 0.85rem;
    color: var(--secondary-text-color);
    padding: 0;
    margin-right: 20px;
}
.project-tech-list li {
    margin-right: 15px;
    margin-bottom: 5px;
}
.project-tech-list li:last-child {
    margin-right: 0;
}
.project-links {
    display: flex;
    align-items: center;
}
.project-links a {
    font-size: 1.4rem;
    margin-left: 15px;
    color: var(--secondary-text-color);
    transition: var(--transition);
}
.project-links a:hover {
    color: var(--accent-color);
}

/* --- Contact & Footer --- */
#contact { text-align: center; padding-bottom: 50px; }
.contact-box {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-backdrop-filter);
    -webkit-backdrop-filter: var(--glass-backdrop-filter);
    border: var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: var(--border-radius);
    max-width: 650px; margin: 0 auto;
    padding: 3rem;
    h3 { font-size: clamp(30px, 5vw, 42px); color: var(--text-color); margin-bottom: 20px; }
    p { color: var(--secondary-text-color); margin-bottom: 35px; }
}
.cta-button {
    font-family: var(--mono-font); display: inline-block; padding: 1.1rem 2rem; border: 1px solid var(--accent-color);
    border-radius: var(--border-radius); transition: var(--transition); color: var(--accent-color); font-size: 1rem;
    &:hover { background-color: var(--accent-color-tint); box-shadow: 0 0 20px var(--accent-color-tint); }
}
footer {
    padding: 25px; text-align: center;
    color: var(--secondary-text-color); font-family: var(--mono-font); font-size: 0.85rem;
    .footer-socials { display: block; margin-bottom: 15px; }
    .social-links { list-style: none; display: flex; justify-content: center; gap: 25px; font-size: 1.5rem; a:hover { color: var(--accent-color); transform: translateY(-3px); } }
}

/* --- Mobile Nav --- */
.hamburger { display: block; position: fixed; top: 25px; right: 25px; z-index: 101; width: 30px; height: 30px; }
.hamburger.is-active .hamburger-inner { transform: rotate(225deg); transition-delay: 0.12s; background-color: var(--accent-color); }
.hamburger.is-active .hamburger-inner::before { top: 0; transform: rotate(90deg); transition-delay: 0s; }
.hamburger.is-active .hamburger-inner::after { bottom: 0; opacity: 0; transition-delay: 0s; }
.hamburger-box { position: relative; width: 30px; height: 24px; }
.hamburger-inner, .hamburger-inner::before, .hamburger-inner::after { position: absolute; width: 30px; height: 2px; background-color: var(--accent-color); border-radius: 2px; transition: transform 0.22s var(--easing), background-color 0.3s ease; }
.hamburger-inner { top: 50%; transform: translateY(-50%); }
.hamburger-inner::before { content: ''; top: -10px; }
.hamburger-inner::after { content: ''; bottom: -10px; }
.mobile-nav {
    display: flex; justify-content: center; align-items: center; flex-direction: column; position: fixed; top: 0; right: 0;
    width: min(75vw, 400px); height: 100vh;
    background: rgba(17, 34, 64, 0.85); 
    backdrop-filter: var(--glass-backdrop-filter);
    -webkit-backdrop-filter: var(--glass-backdrop-filter);
    border-left: var(--glass-border);
    z-index: 99;
    transform: translateX(100vw); transition: transform 0.4s var(--easing); visibility: hidden;
    &.is-active { transform: translateX(0); visibility: visible; }
    .mobile-nav-links { list-style: none; text-align: center; font-family: var(--mono-font); li { margin-bottom: 30px; } a { font-size: clamp(18px, 4vw, 24px); padding: 10px; transition: color 0.3s; &:hover { color: var(--accent-color); } } }
    .mobile-socials { display: flex; margin-top: 40px; list-style: none; li { margin: 0 15px; } a { font-size: 1.5rem; } }
}

/* --- Media Query: Tablet (768px and up) --- */
@media (min-width: 768px) {
    main { padding: 0 100px; }
    .section-title::after { width: 300px; }
    nav { padding: 0 40px; }
    nav .nav-links { display: flex; list-style: none; align-items: center; font-family: var(--mono-font);
        li { margin-left: 30px; }
        a { padding: 5px; position: relative; transition: var(--transition); color: var(--text-color); font-size: 0.95em; }
        a:hover, a.active { color: var(--accent-color); animation: glitch 0.2s infinite; }
    }
    .hamburger, .mobile-nav { display: none; }
    .about-content { grid-template-columns: 3fr 2fr; gap: 70px; }
    .about-photo { grid-row: auto; margin: 0; }
    .project-grid {
        /* UPDATED: This creates a responsive grid that adjusts based on container width */
        grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
        gap: 30px;
    }
}

/* --- Media Query: Large Desktops (1080px and up) --- */
@media (min-width: 1080px) {
    main { padding: 0 150px; }
}

/* --- Sidebars (Desktop only, 1080px and up) --- */
.left-sidebar, .right-sidebar { display: none; }
@media (min-width: 1080px) {
    .left-sidebar, .right-sidebar {
        display: block; width: 40px; position: fixed; bottom: 0; left: 40px; right: auto; z-index: 10; color: var(--text-color);
    }
    .right-sidebar { left: auto; right: 40px; }
    .left-sidebar ul { display: flex; flex-direction: column; align-items: center; list-style: none; gap: 10px; }
    .left-sidebar a { font-size: 1.3rem; padding: 10px; color: var(--text-color); transition: var(--transition); &:hover { color: var(--accent-color); transform: translateY(-3px); animation: glitch 0.2s infinite; } }
    .left-sidebar::after, .right-sidebar::after { content: ''; display: block; width: 1px; height: 90px; margin: 20px auto 0; background-color: var(--secondary-text-color); }
    .right-sidebar a { writing-mode: vertical-rl; font-size: 0.9rem; letter-spacing: 0.1em; color: var(--secondary-text-color); transition: var(--transition); padding-bottom: 20px; &:hover { color: var(--accent-color); transform: translateY(-3px); } }
    footer .footer-socials { display: none; }
}
