:root {
    --bg-color: #ffffff;
    --bg-image: linear-gradient(to bottom, #ffe4cc 0%, #ffffff 40%, #ffffff 100%);
    --bg-size: 100% 100%;
    --text-color: #111111;
    --text-muted: #666666;
    --primary-color: #000000;
    --primary-hover: #333333;
    --secondary-color: rgba(0, 0, 0, 0.05);
    --border-color: rgba(0, 0, 0, 0.1);
    --glass-bg: rgba(255, 255, 255, 0.8);
    --glass-border: rgba(0, 0, 0, 0.1);

    --font-sans: 'Inter', sans-serif;
    --font-heading: 'Outfit', sans-serif;
}

body.dark-mode {
    --bg-color: #1a1a2e;
    --bg-image: linear-gradient(to bottom, #30204a 0%, #1a1a2e 100%);
    --bg-size: 100% 100%;
    --text-color: #f1f1f1;
    --text-muted: #b0a0d0;
    --primary-color: #ffffff;
    --primary-hover: #dddddd;
    --secondary-color: rgba(255, 255, 255, 0.05);
    --border-color: rgba(255, 255, 255, 0.1);
    --glass-bg: rgba(48, 32, 74, 0.8);
    --glass-border: rgba(255, 255, 255, 0.1);
}

body.dark-mode .section-title,
body.dark-mode .logo,
body.dark-mode .hero-text h1 {
    color: #ffffff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scroll-behavior: smooth;
    transition: background-color 0.5s ease, color 0.5s ease, border-color 0.5s ease, background 0.5s ease;
}

body {
    background-color: var(--bg-color);
    background-image: var(--bg-image);
    background-size: var(--bg-size);
    background-attachment: fixed;
    color: var(--text-color);
    font-family: var(--font-sans);
    line-height: 1.6;
    overflow-x: hidden;
}

@keyframes gradientBG {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* Typing Animation */
.typing-text {
    font-family: var(--font-heading);
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    font-weight: 800;
    text-align: center;
    display: inline;
}

.typing-text::after {
    content: '';
    display: inline-block;
    width: 4px;
    height: 1em;
    background-color: var(--primary-color);
    margin-left: 5px;
    vertical-align: -10%;
    animation: blink 0.75s step-end infinite;
}

@keyframes blink {

    from,
    to {
        opacity: 0;
    }

    50% {
        opacity: 1;
    }
}

/* Typography */
h1,
h2,
h3,
.logo {
    font-family: var(--font-heading);
}

.title {
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

.title span {
    background: linear-gradient(135deg, #818cf8 0%, #c084fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    color: var(--primary-color);
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 3rem;
    text-align: center;
    color: #8B5438;
}

/* Buttons */
.btn-primary,
.btn-secondary {
    display: inline-block;
    padding: 0.875rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
}

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

.btn-primary:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

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

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

/* Glassmorphism utility */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 1rem;
}

/* Navigation */
.navbar {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1.5rem 5%;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 100;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid transparent;
    opacity: 0;
    animation: fadeInUp 1s cubic-bezier(0.2, 0.8, 0.2, 1) 0.5s forwards;
}

.nav-container {
    width: 100%;
    max-width: 1200px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar.scrolled {
    background: transparent;
}

.theme-btn {
    position: relative;
    width: 24px;
    height: 24px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-color);
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-btn svg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: opacity 0.3s ease;
}

.icon-sun {
    opacity: 1;
}

.icon-moon {
    opacity: 0;
}

body.dark-mode .icon-sun {
    opacity: 0;
}

body.dark-mode .icon-moon {
    opacity: 1;
}

.icon-sound-off {
    opacity: 1;
}

.icon-sound-on {
    opacity: 0;
}

body.sound-active .icon-sound-off {
    opacity: 0;
}

body.sound-active .icon-sound-on {
    opacity: 1;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: #8B5438;
    text-decoration: none;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

.nav-links a {
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.3s;
}

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

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5%;
    text-align: left;
    position: relative;
}

.hero-content {
    width: 100%;
    max-width: 1200px;
    z-index: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5rem;
}

.hero-text {
    width: 100%;
    max-width: 550px;
    flex-shrink: 0;
    text-align: center;
    padding-left: 5rem;
    opacity: 0;
    animation: fadeInUp 2s ease-out 2.5s forwards;
}

.hero-text h1 {
    color: #8B5438;
}

.profile-carousel {
    position: relative;
    max-width: 320px;
    aspect-ratio: 3 / 4;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

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

.carousel-container {
    width: 100%;
    height: 100%;
    position: relative;
}

.carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.carousel-slide.active {
    opacity: 1;
    z-index: 2;
}

.carousel-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 0.85rem;
    text-align: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.carousel-slide:hover .carousel-caption {
    opacity: 1;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.7);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
    z-index: 10;
}

.carousel-btn:hover {
    background: rgba(255, 255, 255, 0.9);
}

.carousel-btn.prev {
    left: 10px;
}

.carousel-btn.next {
    right: 10px;
}

.hero .description {
    color: var(--text-muted);
    font-size: 1.125rem;
    margin-bottom: 2.5rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-cta {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* General Layout */
.section {
    padding: 5rem 5%;
    max-width: 1200px;
    margin: 0 auto;
}

#about.section {
    max-width: 1450px;
}

/* Age Timer */
.age-timer {
    text-align: left;
    margin-bottom: 2.5rem;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    letter-spacing: 0.05em;
}

.age-label {
    margin-right: 0.6rem;
}

.age-value {}

/* About Section */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr 1.7fr;
    gap: 3rem;
    align-items: start;
}

.about-text p {
    color: black;
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

body.dark-mode .about-text p {
    color: white;
}

.about-card {
    padding: 2rem;
}

.about-card h3 {
    margin-bottom: 1.5rem;
    color: var(--primary-color);
}

.about-card ul {
    margin-top: 1rem;
    list-style-position: inside;
    color: var(--text-muted);
}

/* Cards Column (stacks edu + work carousels) */
.cards-column {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Education Carousel */
.edu-carousel {
    position: relative;
}

.work-carousel {
    margin-top: 1.5rem;
}

.edu-carousel-track {
    position: relative;
    overflow: hidden;
}

.edu-slide {
    display: none;
}

.edu-slide.active {
    display: block;
}

.edu-carousel-controls {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.edu-btn {
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-color);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

.edu-btn:hover {
    background: rgba(0, 0, 0, 0.1);
}

/* Skills Section */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.skill-card {
    padding: 2rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.skill-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border-color: rgba(255, 255, 255, 0.2);
}

.skill-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.skill-card h3 {
    margin-bottom: 0.5rem;
}

.skill-card p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

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

.project-card {
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.project-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

.project-img-placeholder {
    height: 200px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(168, 85, 247, 0.2) 100%);
    border-bottom: 1px solid var(--glass-border);
}

.project-img {
    height: 200px;
    width: 100%;
    object-fit: cover;
    border-bottom: 1px solid var(--glass-border);
}

.project-info {
    padding: 2rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.project-info h3 {
    margin-bottom: 0.5rem;
}

.project-info p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.project-tags span {
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 20px;
    color: var(--text-muted);
}

/* Contact Section */
.contact-box {
    text-align: center;
    padding: 4rem 2rem;
    max-width: 600px;
    margin: 0 auto;
}

.contact-box h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.contact-box p {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

/* Footer */
footer {
    text-align: left;
    padding: 2rem 5%;
    color: var(--text-muted);
    border-top: 1px solid var(--border-color);
    margin-top: 3rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-links {
        display: none;
        /* In a full app, implement a hamburger menu */
    }

    .hero-content {
        flex-direction: column;
        margin-top: 6rem;
    }

    .hero-text,
    .hero-carousel {
        width: 100%;
        max-width: 100%;
    }

    .hero-cta {
        flex-direction: column;
    }

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



.hero-model {
    flex: 1;
    width: 100%;
    max-width: 600px;
    aspect-ratio: 1 / 1;
}

/* 3D Background Embed */
.model-background {
    width: 100%;
    height: 100%;
    --poster-color: transparent;
    opacity: 0;
    animation: fadeInUp 1.5s cubic-bezier(0.2, 0.8, 0.2, 1) 1s forwards;
    outline: none;
}

.model-background::part(default-progress-bar) {
    display: none;
}