/* --- Reset & Base --- */
* {
    box-sizing: border-box;
    scroll-behavior: smooth;
}
html {
    scroll-behavior: smooth;
}

:root {
    /* Colors for the interactive character */
    --character-body: #7C3AED; /* Purple */
    --character-eye-bg: #fff;
    --character-pupil: #0b0f1a;
}

body {
    margin: 0;
    font-family: 'Inter', sans-serif;
    color: #fff;
    background: #0b0f1a;
    overflow-x: hidden;
}

#background-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

/* --- Smooth Theme Transitions --- */
body, .card, .tilt, .btn, .cta, footer, nav a, blockquote {
    transition: background 0.6s ease,
                color 0.6s ease,
                border 0.6s ease,
                box-shadow 0.6s ease,
                opacity 0.6s ease;
}

section { padding: 80px 20px; }
.container { max-width: 1100px; margin: auto; }

/* --- Header --- */
header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: rgba(11, 15, 26, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px); /* Safari */
}
nav a {
    position: relative;
    color: #ccc;
    margin: 0 10px;
    text-decoration: none;
    padding-bottom: 4px;
    transition: color 0.3s ease;
}
nav a::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0%;
    height: 2px;
    background: linear-gradient(90deg,#06B6D4,#7C3AED,#F43F5E);
    transition: width 0.3s ease;
}
nav a:hover {
    color: #fff;
}
nav a:hover::after {
    width: 100%;
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
}

.brand {
    display: flex;
    align-items: center;
    text-decoration: none;
}
.brand h1 {
    font-family: 'Poppins', sans-serif;
    font-size: 20px;
    margin: 0;
    background: linear-gradient(90deg,#06B6D4,#7C3AED,#F43F5E);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    transition: background 1s ease;
}

.cta {
    background: #06B6D4; padding: 8px 14px; border-radius: 20px;
    color: #0b0f1a; text-decoration: none;
}

/* --- Hero --- */
.hero-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
}
.hero-card {
    background: rgba(255,255,255,0.05);
    padding: 34px;
    border-radius: 20px;
    transition: transform 0.2s ease;
    width: fit-content;
    flex: 1;
    max-width: 600px;
}
.gradient-text {
    background: linear-gradient(90deg,#06B6D4,#7C3AED,#F43F5E);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}
.btn {
    display: inline-block;
    padding: 10px 14px;
    margin-top: 10px;
    margin-right: 10px;
    border-radius: 12px;
    border: 1px solid #444;
    color: #fff;
    text-decoration: none;
    transition: background 0.3s ease;
}
.btn:hover {
    background: rgba(255,255,255,0.1);
}

/* --- About, Projects & Cards --- */
.about {
    display: grid;
    transition: background 0.3s ease, color 0.3s ease;
    gap: 20px;
    grid-template-columns: 1fr; /* This aligns the two cards vertically */
}
.card {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 16px;
    margin-bottom: 20px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 0 25px rgba(124, 58, 237, 0.4);
}
.section-title {
    font-family: 'Poppins', sans-serif;
    font-size: 28px;
    margin-bottom: 20px;
}
blockquote {
    border-left: 3px solid #06B6D4;
    padding-left: 12px;
    color: #ddd;
}

/* --- Projects --- */
.projects {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}
.Team-dreamdevs, .project2 {
    height: 150px;
    transition: background 0.3s ease, color 0.3s ease;
    border-radius: 12px;
    display: grid; place-items: center;
    background: linear-gradient(135deg,#22C55E,#06B6D4);
    text-align: center;
    color: #0b0f1a;
}
.project2 {
    background: linear-gradient(135deg, #22C55E, #06B6D4);
}

/* --- Work With Me --- */
.work-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    align-items: center;
    position: relative;
}
.character-container {
    display: grid;
    place-items: center;
    height: 100%;
    position: absolute;
    right: 0;
    bottom: 0;
}
#character-svg {
    width: 200px;
    height: 200px;
    transition: transform 0.2s ease-out;
}
#character-svg:hover {
    transform: scale(1.1) rotate(-5deg);
}

/* --- Form --- */
form { display: grid; gap: 12px; }

input, textarea {
    width: 100%;
    padding: 12px;
    border-radius: 12px;
    border: none;
    background: rgba(255,255,255,0.1);
    color: #fff;
    font-family: inherit;
    transition: background 0.3s ease, color 0.3s ease;
}
input::placeholder, textarea::placeholder {
    color: rgba(255,255,255,0.6);
}
textarea { min-height: 120px; resize: vertical; }
.submit {
    background: linear-gradient(90deg,#06B6D4,#7C3AED);
    border: none;
    padding: 12px 16px;
    border-radius: 12px;
    color: #0b0f1a;
    cursor: pointer;
    transition: opacity 0.3s ease;
}
.submit:hover { opacity: 0.85; }

/* --- Contact & Socials --- */
.socials a {
    margin-right: 15px;
    color: #fff;
    text-decoration: none;
    font-size: 1.1em;
    transition: color 0.3s ease;
}
.socials a:hover {
    color: #06B6D4;
}
.socials i {
    margin-right: 8px;
}

/* --- Footer --- */
footer {
    padding: 20px;
    background: rgba(255,255,255,0.05);
    text-align: center;
}

/* --- Theme Toggle Button --- */
.theme-toggle {
    background: rgba(255,255,255,0.1);
    border: none;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    border-radius: 50%;
    width: 38px;
    height: 38px;
    margin-left: 10px;
    transition: background 0.3s ease, transform 0.3s ease;
}
.theme-toggle:hover { background: rgba(255,255,255,0.25); transform: rotate(20deg); }

/* --- Light Mode Overrides --- */
body.light-mode {
    background: #fafafa;
    color: #222;
}

body.light-mode header {
    background: rgba(250, 250, 250, 0.85);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

body.light-mode nav a {
    color: #444;
}

body.light-mode nav a:hover {
    color: #7C3AED;
}

body.light-mode .btn {
    border: 1px solid #ccc;
    color: #333;
    background: #fff;
}

body.light-mode .btn:hover {
    background: #f0e7ff;
    border-color: #7C3AED;
    color: #7C3AED;
}

body.light-mode .cta {
    background: #7C3AED;
    color: #fff;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.4);
}

body.light-mode .card {
    background: #fff;
    border: 1px solid #ddd;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

body.light-mode .card:hover {
    box-shadow: 0 0 25px rgba(124, 58, 237, 0.2);
}

body.light-mode blockquote {
    border-left-color: #7C3AED;
    color: #555;
}

body.light-mode input,
body.light-mode textarea {
    background: #f9f9f9;
    color: #222;
    border: 1px solid #ccc;
}

body.light-mode input::placeholder,
body.light-mode textarea::placeholder {
    color: #999;
}

/* Fix links visibility in About section for light mode */
body.light-mode .about a,
body.light-mode .about .list li {
    color: #444;
    text-decoration: underline;
    cursor: pointer;
}

body.light-mode .about a:hover {
    color: #7C3AED;
}

/* Fix links visibility in Contact section for light mode */
body.light-mode .socials a {
    color: #111;
}

body.light-mode .socials a:hover {
    color: #7C3AED;
}

/* --- Waving Cartoon Character Animation --- */
#waving-character svg {
    transform-origin: 50% 50%;
    animation: wave 3s ease-in-out infinite;
    transition: transform 0.3s ease;
}

#waving-character svg:hover,
#waving-character svg:focus {
    animation-play-state: paused;
    transform: scale(1.1) rotate(10deg);
    outline: none;
}

@keyframes wave {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(15deg); }
}

/* Hero section flex layout for robot */
.hero-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
}

#robot-container {
    flex: 1;
    max-width: 400px;
    height: 400px;
    cursor: grab;
}

@media (max-width: 900px) {
    .hero-inner {
        flex-direction: column;
    }
    #robot-container {
        max-width: 100%;
        height: 300px;
        margin-top: 30px;
    }
}

/* AOS pop-out animation overrides (optional for smoother effect) */
[data-aos="zoom-in"] {
    transform-origin: center center;
}

/* Responsiveness */
@media (max-width: 768px) {
    .hero-inner, .about, .projects, .work-grid {
        grid-template-columns: 1fr;
    }
    .cube-scene {
        display: none;
    }
    .nav {
        flex-direction: column;
        gap: 10px;
    }
    .work-grid {
        gap: 50px;
    }
}
