/* ===== Reset & Base Styles ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Noto Sans JP', 'Inter', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--primary-color);
    overflow-x: hidden;
    position: relative;
}

/* Grainy Texture for Light Mode */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.05;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

[data-theme="dark"] body::before {
    opacity: 0;
    display: none;
    position: relative;
}



/* ===== CSS Variables ===== */
:root {
    --primary-color: #FAF9F6;
    /* Ecru */
    --secondary-color: #f4f4f0;
    --accent-color: #ffffff;
    --highlight-color: #667eea;
    --highlight-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --text-color: #333333;
    /* Dark Gray */
    --font-serif: 'Noto Serif JP', serif;
    --border-color: #dee2e6;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);

    /* Toggle Button Colors */
    --toggle-bg: #e9ecef;
    --toggle-icon: #f39c12;
}

[data-theme="dark"] {
    --primary-color: #1a202c;
    --secondary-color: #2d3748;
    --accent-color: #171923;
    --text-color: #f7fafc;
    --text-secondary: #cbd5e0;
    --text-light: #a0aec0;
    --border-color: #4a5568;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.6);

    /* Toggle Button Colors for Dark Mode */
    --toggle-bg: #4a5568;
    --toggle-icon: #f1c40f;
}

/* ===== Theme Toggle Button ===== */
.theme-toggle-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: var(--accent-color);
    border: 2px solid var(--border-color);
    box-shadow: var(--shadow-md);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 1001;
    /* Menu is 1000 */
    transition: var(--transition);
    font-size: 1.5rem;
    color: var(--toggle-icon);
}

.theme-toggle-btn:hover {
    transform: translateY(-5px) rotate(15deg);
    box-shadow: var(--shadow-lg);
}

/* Mobile position adjustment if needed */
@media screen and (max-width: 768px) {
    .theme-toggle-btn {
        width: 50px;
        height: 50px;
        bottom: 20px;
        right: 20px;
        font-size: 1.2rem;
    }
}

/* ===== ローディング画面 ===== */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    /* 白、青、紺、灰色のグラデーション（白多め） */
    background: linear-gradient(135deg,
            #ffffff 0%,
            #f8f9fa 20%,
            #e9ecef 40%,
            #9fa8b0 60%,
            /* Adjusted for smoother dark transition if needed */
            #667eea 80%,
            #2c3e50 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: transform 0.8s ease-in-out;
}

.loading-screen.hide {
    transform: translateY(-100%);
}

.loading-content {
    text-align: center;
}

.loading-logo {
    width: 300px;
    height: auto;
    animation: logoFadeInScale 1.5s ease-out forwards;
    filter: drop-shadow(0 10px 30px rgba(102, 126, 234, 0.4));
}

/* ロゴフェードイン＆スケールアップアニメーション */
@keyframes logoFadeInScale {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }

    60% {
        opacity: 1;
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* ===== Anti-Gravity Animations ===== */
@keyframes float {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-20px);
    }
}

@keyframes float-gentle {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }
}

@keyframes float-delay {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-15px);
    }
}

@keyframes fade-in-float {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== Header & Navigation ===== */
header {
    background-color: var(--accent-color);
    backdrop-filter: blur(10px);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: var(--shadow-md);
    border-bottom: 1px solid var(--border-color);
}

nav {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 3rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-color);
    text-decoration: none;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    transition: var(--transition);
    margin-left: 5rem;
}

.logo:hover {
    transform: scale(1.05);
}

.logo-image {
    height: 60px;
    width: auto;
    transition: var(--transition);
    filter: drop-shadow(0 2px 8px rgba(102, 126, 234, 0.2));
}

.logo:hover .logo-image {
    filter: drop-shadow(0 4px 12px rgba(102, 126, 234, 0.4));
    transform: rotate(-3deg);
}

/* Dark Mode Logo Fix */
[data-theme="dark"] .logo-image {
    filter: invert(1) grayscale(1) drop-shadow(0 2px 8px rgba(255, 255, 255, 0.2));
}

[data-theme="dark"] .logo:hover .logo-image {
    filter: invert(1) grayscale(1) drop-shadow(0 4px 12px rgba(255, 255, 255, 0.4));
}

.logo span {
    color: var(--highlight-color);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 3rem;
}

.nav-menu a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    font-size: 1.2rem;
    transition: var(--transition);
    position: relative;
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 3px;
    background: var(--highlight-gradient);
    transition: var(--transition);
}

.nav-menu a:hover::after,
.nav-menu a.active::after {
    width: 100%;
}

.nav-menu a:hover,
.nav-menu a.active {
    color: var(--highlight-color);
}

/* ===== Mobile Menu Toggle ===== */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.mobile-menu-toggle span {
    width: 28px;
    height: 3px;
    background-color: var(--text-color);
    margin: 4px 0;
    transition: var(--transition);
    border-radius: 2px;
}

/* ===== Section Base Styles ===== */
section {
    min-height: 100vh;
    padding: 8rem 3rem 4rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.section-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 3rem;
    text-align: center;
    color: var(--text-color);
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, var(--highlight-color), transparent);
    margin: 1rem auto 0;
}

/* ===== Hero Section (Cinematic Update) ===== */
#hero {
    position: relative;
    width: 100%;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    /* Default to Ecru for Light Mode */
    background: #FAF9F6;
    color: var(--text-color);
}

/* Dark Mode Override for Hero */
[data-theme="dark"] #hero {
    background: #0f1115;
    color: #ffffff;
    overflow: hidden;
    /* Ensure stars/glow don't spill */
}

/* Slideshow Container */
.hero-bg-slideshow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
}

.hero-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0;
    animation: slideShow 24s infinite;
}

/* Stagger animations for 3 images */
.hero-slide:nth-child(1) {
    animation-delay: 0s;
}

.hero-slide:nth-child(2) {
    animation-delay: 8s;
}

.hero-slide:nth-child(3) {
    animation-delay: 16s;
}

/* Overlay to ensure text readability (Ecru wash) */
.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(250, 249, 246, 0.85);
    /* High opacity Ecru to keep it subtle */
    backdrop-filter: blur(2px);
    /* Slight blur for texture */
    z-index: 1;
}

/* Keyframes for Crossfade */
@keyframes slideShow {
    0% {
        opacity: 0;
        transform: scale(1);
    }

    4% {
        opacity: 1;
    }

    33% {
        opacity: 1;
    }

    37% {
        opacity: 0;
    }

    100% {
        opacity: 0;
        transform: scale(1.1);
        /* Slow zoom effect */
    }
}

/* Hide Slideshow in Dark Mode */
[data-theme="dark"] .hero-bg-slideshow {
    display: none;
}

/* Adjust Hero Content layout */
.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    /* Adjust positioning for split layout in Light Mode if needed */
    /* Currently centered. With image on right, we might want to shift text left slightly or keep center. */
    /* User said "Center Typography". Image on "Right or Center". */
    /* Let's keep content center, and image on right as an accent behind/beside. */
}

/* Light Mode Specific Typography Overrides */
html:not([data-theme="dark"]) .cinematic-title .hero-name-mask {
    font-family: var(--font-serif);
    font-size: clamp(3rem, 10vw, 8rem);
    color: #333333;
    -webkit-text-stroke: 0;
    background: none;
    background-clip: border-box;
    -webkit-background-clip: border-box;
    font-weight: 700;
    letter-spacing: 0.05em;
    animation: none;
    /* No galaxy flow */
    text-shadow: none;
}

html:not([data-theme="dark"]) .hero-portfolio-text {
    color: #555;
    font-family: var(--font-serif);
    letter-spacing: 0.3em;
    font-weight: 400;
}

html:not([data-theme="dark"]) .hero-portfolio-text::before,
html:not([data-theme="dark"]) .hero-portfolio-text::after {
    background: #999;
}

/* Spotlight Effect */
.spotlight {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background: radial-gradient(circle 800px at var(--x, 50%) var(--y, 50%),
            rgba(102, 126, 234, 0.05) 0%,
            transparent 80%);
    z-index: 1;
}

[data-theme="dark"] .spotlight {
    background: radial-gradient(circle 800px at var(--x, 50%) var(--y, 50%),
            rgba(255, 255, 255, 0.03) 0%,
            transparent 80%);
    z-index: 1;
}

.hero-bg-pattern {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(rgba(0, 0, 0, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 0, 0, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    opacity: 0.3;
    z-index: 0;
    mask-image: radial-gradient(circle 500px at 50% 50%, black 40%, transparent 100%);
    -webkit-mask-image: radial-gradient(circle 500px at 50% 50%, black 40%, transparent 100%);
}

[data-theme="dark"] .hero-bg-pattern {
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    opacity: 0.3;
    z-index: 0;
    mask-image: radial-gradient(circle 500px at 50% 50%, black 40%, transparent 100%);
    -webkit-mask-image: radial-gradient(circle 500px at 50% 50%, black 40%, transparent 100%);
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.cinematic-title {
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1;
}

/* Light Mode Specific Typography Overrides */
html:not([data-theme="dark"]) .cinematic-title .hero-name-mask {
    font-family: var(--font-serif);
    font-size: clamp(3rem, 10vw, 8rem);
    color: #333333;
    -webkit-text-stroke: 0;
    background: none;
    -webkit-background-clip: border-box;
    background-clip: border-box;
    font-weight: 700;
    letter-spacing: 0.05em;
    animation: none;
    /* No galaxy flow */
    text-shadow: none;
}

/* The Cinematic Text Mask */
.hero-name-mask {
    font-size: clamp(4rem, 15vw, 12rem);
    /* Massive responsive size */
    font-weight: 900;
    letter-spacing: -0.02em;
    text-transform: uppercase;
    text-transform: uppercase;
    color: transparent;
    -webkit-text-stroke: 1px rgba(0, 0, 0, 0.1);
    /* Light mode stroke */

    /* Dynamic Gradient Background */
    background: linear-gradient(135deg,
            #2c3e50 0%,
            #764ba2 25%,
            #667eea 50%,
            #764ba2 75%,
            #2c3e50 100%);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    background-clip: text;
    animation: galaxy-flow 8s ease infinite;

    /* Interactive transform handled by JS */
    transition: transform 0.1s ease-out;
}

[data-theme="dark"] .hero-name-mask {
    -webkit-text-stroke: 1px rgba(255, 255, 255, 0.3);
    background: linear-gradient(135deg,
            #2c3e50 0%,
            #ffffff 25%,
            #667eea 50%,
            #764ba2 75%,
            #2c3e50 100%);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    background-clip: text;
}

@keyframes galaxy-flow {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.hero-portfolio-text {
    font-size: clamp(1rem, 3vw, 2rem);
    font-weight: 300;
    letter-spacing: 0.5em;
    text-transform: uppercase;
    text-transform: uppercase;
    color: var(--text-secondary);
    /* Light mode color */
    margin-top: 1rem;
    position: relative;
    padding-left: 0.5em;
    /* Optical alignment for letter-spacing */
}

[data-theme="dark"] .hero-portfolio-text {
    color: rgba(255, 255, 255, 0.7);
}

.hero-portfolio-text::before,
.hero-portfolio-text::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 30px;
    height: 1px;
    background: var(--text-light);
    /* Light mode lines */
}

[data-theme="dark"] .hero-portfolio-text::before,
[data-theme="dark"] .hero-portfolio-text::after {
    background: rgba(255, 255, 255, 0.3);
}

.hero-portfolio-text::before {
    right: 100%;
    margin-right: 20px;
}

.hero-portfolio-text::after {
    left: 100%;
    margin-left: 20px;
}

.hero-scroll-text {
    margin-top: 4rem;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.4);
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    width: 1px;
    height: 60px;
    background: rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

.scroll-indicator span {
    display: block;
    width: 100%;
    height: 100%;
    background: #667eea;
    animation: scroll-drop 2s cubic-bezier(0.77, 0, 0.175, 1) infinite;
}

@keyframes scroll-drop {
    0% {
        transform: translateY(-100%);
    }

    50% {
        transform: translateY(0%);
    }

    100% {
        transform: translateY(100%);
    }
}

/* ===== About Section ===== */
#about {
    background-color: var(--accent-color);
    border-top: 1px solid var(--border-color);
}

.about-content-home {
    max-width: 1000px;
    display: flex;
    align-items: center;
    gap: 4rem;
    margin: 0 auto;
}

.about-image-wrapper {
    flex-shrink: 0;
}

.about-profile-image {
    width: 380px;
    height: 380px;
    border-radius: 16px;
    object-fit: cover;
    border: 6px solid transparent;
    background: var(--highlight-gradient);
    background-clip: padding-box;
    padding: 6px;
    box-shadow: 0 20px 60px rgba(102, 126, 234, 0.3);
    animation: float-gentle 6s ease-in-out infinite;
    transition: var(--transition-smooth);
}

.about-profile-image:hover {
    transform: translateY(-10px);
    box-shadow: 0 25px 80px rgba(102, 126, 234, 0.4);
}

.about-text {
    flex: 1;
    text-align: left;
}

.about-tagline {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.5;
    color: var(--text-color);
    margin-bottom: 1.5rem;
}

.highlight-text {
    background: var(--highlight-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.about-description {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.about-keywords {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.keyword-tag {
    padding: 0.6rem 1.5rem;
    background-color: var(--secondary-color);
    border-radius: 50px;
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--text-color);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.keyword-tag:hover {
    background: var(--highlight-gradient);
    color: #ffffff;
    border-color: transparent;
    transform: translateY(-3px);
}

.about-content {
    max-width: 900px;
    text-align: center;
}

.about-content p {
    font-size: 1.2rem;
    line-height: 2;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.skills-list {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    justify-content: center;
    margin-top: 3rem;
}

.skill-item {
    background-color: var(--accent-color);
    padding: 1rem 2rem;
    border-radius: 50px;
    font-weight: 500;
    border: 2px solid var(--highlight-color);
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.skill-item:hover {
    background: var(--highlight-gradient);
    color: #ffffff;
    border-color: transparent;
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

/* ===== Works Section ===== */
#works {
    background-color: var(--secondary-color);
    padding: 8rem 3rem;
    border-top: 1px solid var(--border-color);
}

.works-container {
    max-width: 1400px;
    width: 100%;
}

/* 自動スライドカルーセル */
.works-slider-wrapper {
    overflow: hidden;
    margin: 3rem 0;
    position: relative;
}

.works-slider {
    display: flex;
    gap: 2rem;
    width: max-content;
    /* Ensure slider width includes all items for correct percentage calc */
    animation: slide 80s linear infinite;
}

@keyframes slide {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(calc(-100% / 2));
    }
}

.work-slide {
    flex: 0 0 400px;
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    border: 1px solid var(--border-color);
    background-color: var(--accent-color);
}

.work-slide:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
}

.work-slide img,
.work-slide video {
    width: 100%;
    height: 350px;
    object-fit: contain;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 1rem;
    display: block;
}

.work-slide-title {
    padding: 1rem 1.5rem;
    text-align: center;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-color);
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 1));
    border-top: 1px solid var(--border-color);
}

[data-theme="dark"] .work-slide-title {
    background: linear-gradient(to bottom, rgba(26, 32, 44, 0.95), rgba(26, 32, 44, 1));
}

/* ホバーでスライダーを一時停止 */
.works-slider-wrapper:hover .works-slider {
    animation-play-state: paused;
}

/* ===== Contact Section ===== */
#contact {
    background-color: var(--accent-color);
    border-top: 1px solid var(--border-color);
}

.contact-container {
    max-width: 700px;
    width: 100%;
}

.contact-info {
    text-align: center;
    margin-bottom: 3rem;
}

.contact-info p {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.contact-form {
    width: 100%;
}

.form-group {
    margin-bottom: 2rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.8rem;
    font-weight: 600;
    color: var(--text-color);
    font-size: 1rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 1rem 1.5rem;
    background-color: var(--accent-color);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-color);
    font-family: inherit;
    font-size: 1rem;
    transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--highlight-color);
}

.form-group textarea {
    min-height: 180px;
    resize: vertical;
}

.cta-button {
    display: inline-block;
    background: var(--highlight-gradient);
    color: #ffffff;
    padding: 1rem 2.5rem;
    border-radius: 50px;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
    margin-top: 1rem;
    /* Helper */
}

.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
    color: #ffffff;
}

.submit-button {
    width: 100%;
    background: var(--highlight-gradient);
    color: #ffffff;
    padding: 1.2rem 3rem;
    border: none;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.3);
}

.submit-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.5);
}

/* ===== Footer with Contact ===== */
footer {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-top: 1px solid var(--border-color);
    padding: 0;
}

.footer-container {
    max-width: 1400px;
    margin: 0 auto;
}

/* Footer Contact Section */
.footer-contact {
    text-align: center;
    padding: 1.5rem 2rem;
}

.footer-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    background: var(--highlight-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.footer-description {
    font-size: 1.3rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.8;
}

/* Responsive Footer */
@media (max-width: 768px) {
    .footer-contact {
        padding: 4rem 2rem;
    }

    .footer-title {
        font-size: 2.5rem;
    }

    .footer-description {
        font-size: 1.1rem;
    }
}

/* Dark Mode Footer Override */
[data-theme="dark"] footer,
[data-theme="dark"] #contact {
    background: var(--accent-color) !important;
    border-top: 1px solid var(--border-color);
}

[data-theme="dark"] .footer-description {
    color: var(--text-secondary);
}

/* ===== Modal ===== */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(10px);
}

.modal.active {
    display: flex;
}

.modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
}

.modal-content img {
    width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
}

.modal-close {
    position: absolute;
    top: -50px;
    right: 0;
    color: #ffffff;
    font-size: 3rem;
    font-weight: bold;
    cursor: pointer;
    transition: var(--transition);
}

.modal-close:hover {
    color: var(--highlight-color);
}

/* ===== Scroll Animation ===== */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===== Responsive Design ===== */
@media (max-width: 1024px) {
    .works-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }

    .work-item {
        height: 300px;
    }
}

@media (max-width: 768px) {

    /* Mobile Header Layout */
    nav {
        padding: 1rem 1.5rem;
        /* Reduced horizontal padding */
        justify-content: space-between;
        /* Ensure space between items */
    }

    .logo {
        margin-left: 0;
        /* REMOVED MARGIN LEFT for mobile */
        font-size: 1.4rem;
        /* Slightly smaller logo text */
    }

    /* Global Mobile Font Size Reduction */
    html {
        font-size: 14px;
        /* Base font size reduction */
    }

    p {
        font-size: 1rem !important;
        /* Force smaller size for paragraphs */
        line-height: 1.7;
    }

    h1 {
        font-size: 2rem !important;
    }

    h2 {
        font-size: 1.6rem !important;
    }

    h3 {
        font-size: 1.3rem !important;
    }

    .section-title {
        font-size: 2rem !important;
        margin-bottom: 2rem;
    }

    .cta-button {
        padding: 0.8rem 2rem;
        font-size: 0.95rem;
    }

    .footer-title {
        font-size: 2rem !important;
    }

    .footer-description {
        font-size: 1rem !important;
    }

    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background-color: var(--accent-color);
        backdrop-filter: blur(10px);
        width: 100%;
        text-align: center;
        transition: var(--transition);
        box-shadow: 0 10px 27px rgba(0, 0, 0, 0.1);
        padding: 2rem 0;
        gap: 0;
        border-top: 1px solid var(--border-color);
    }

    .nav-menu li {
        padding: 1rem 0;
        border-bottom: 1px solid var(--border-color);
    }

    .nav-menu li:last-child {
        border-bottom: none;
    }

    .nav-menu a {
        color: var(--text-color);
        font-size: 1.1rem;
    }

    .nav-menu a:hover,
    .nav-menu a.active {
        color: var(--highlight-color);
    }

    .nav-menu.active {
        left: 0;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    section {
        padding: 5rem 1.5rem 2rem;
        /* Reduced padding */
    }

    .hero-content h1 {
        font-size: 2.5rem;
    }

    .hero-content p {
        font-size: 1rem;
        /* Smaller hero text */
    }

    .work-item {
        height: 350px;
    }

    .works-grid {
        gap: 2rem;
    }

    .about-content-home {
        flex-direction: column;
        text-align: center;
        gap: 2rem;
    }

    .about-profile-image {
        width: 240px;
        /* Slightly smaller image */
        height: 240px;
    }

    .about-text {
        text-align: center;
    }

    .about-tagline {
        font-size: 1.4rem;
        /* Smaller tagline */
        margin-bottom: 1rem;
    }

    .about-description {
        font-size: 1rem;
        /* Smaller description */
    }

    .about-keywords {
        justify-content: center;
    }

    /* Mobile Works Slider Adjustment */
    .work-slide {
        flex: 0 0 260px;
        /* Smaller width for mobile */
    }

    .work-slide img,
    .work-slide video {
        height: 180px;
        /* Smaller height for mobile */
    }
}