/* 
 * Primary Stylesheet for Sony Sculpture
 * Implements Cinematic Scroll-Linked 3D Animation & Premium Editorial Layout
 */

:root {
    --bg-color: #080809;
    --card-bg: rgba(18, 18, 20, 0.85);
    --card-bg-solid: #121214;
    --border-color: rgba(223, 213, 198, 0.08);
    --border-color-hover: rgba(200, 107, 69, 0.35);
    --text-primary: #dfd5c6;
    --text-secondary: #8e8279;
    --accent: #c86b45;
    --accent-glow: rgba(200, 107, 69, 0.25);
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Inter', sans-serif;
    --transition-speed: 0.5s;
    --ease-smooth: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-body);
    line-height: 1.7;
    overflow-x: hidden;
    position: relative;
}

/* Background Gradients */
.bg-ambient {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: -2;
}

.bg-ambient::before {
    content: '';
    position: absolute;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
    top: -10vw;
    right: -10vw;
    opacity: 0.5;
}

.bg-ambient::after {
    content: '';
    position: absolute;
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, rgba(142, 130, 121, 0.06) 0%, transparent 70%);
    bottom: -15vw;
    left: -15vw;
    opacity: 0.4;
}

/* Grain Overlay */
.grain-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.035;
    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.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* Typography */
h1, h2, h3, h4 {
    font-family: var(--font-heading);
    font-weight: 500;
    letter-spacing: -0.5px;
    line-height: 1.2;
}

a {
    color: inherit;
    text-decoration: none;
    transition: all 0.3s var(--ease-smooth);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-color);
}
::-webkit-scrollbar-thumb {
    background: rgba(142, 130, 121, 0.2);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

/* Header & Navigation */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(8, 8, 9, 0.5);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    padding: 24px 60px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo span {
    color: var(--accent);
}

.nav-links {
    display: flex;
    gap: 40px;
    list-style: none;
}

.nav-links a {
    font-size: 0.95rem;
    font-weight: 400;
    color: var(--text-secondary);
    position: relative;
    padding: 6px 0;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--text-primary);
}

.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 1px;
    bottom: 0;
    left: 0;
    background-color: var(--accent);
    transition: width 0.3s var(--ease-smooth);
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

.nav-cta {
    background-color: var(--accent);
    color: white;
    padding: 10px 26px;
    border-radius: 40px;
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: 0 4px 15px var(--accent-glow);
}

.nav-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(200, 107, 69, 0.4);
    filter: brightness(1.1);
}

/* Mobile Nav Toggle */
.mobile-toggle {
    display: none;
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
    background: none;
    border: none;
}

.mobile-toggle span {
    width: 24px;
    height: 2px;
    background-color: var(--text-primary);
    transition: all 0.3s ease;
}

/* 3D fixed Viewport container */
#container3D {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    z-index: 10;
    pointer-events: none; /* Allows user to interact with layout text below canvas */
}

/* Layout Containers & Sections */
.main-wrapper {
    max-width: 1400px;
    margin: 140px auto 40px; /* Pushed down to clear the fixed header */
    padding: 0 40px;
}

/* Homepage Scroll Sections */
.scroll-section {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 120px 60px;
    border-bottom: 1px solid rgba(223, 213, 198, 0.03);
}

/* Specific Section Alignments */
#hero {
    justify-content: flex-start;
}

#roots {
    justify-content: flex-end;
}

#gallery-showcase {
    flex-direction: column;
    justify-content: center;
    min-height: auto;
    padding-block: 100px;
}

#projects-section {
    justify-content: flex-start;
}

#contact-section {
    justify-content: flex-start;
}

/* Content cards for text visibility */
.section-content-box {
    max-width: 600px;
    width: 100%;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 28px;
    padding: 50px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    z-index: 20; /* Keep it above the 3D model background */
    position: relative;
    backdrop-filter: blur(20px);
}

.section-indicator {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2.5px;
    color: var(--accent);
    margin-bottom: 15px;
    display: block;
}

.section-title {
    font-size: 3rem;
    margin-bottom: 24px;
    color: var(--text-primary);
}

.section-p {
    font-size: 1.05rem;
    color: var(--text-secondary);
    margin-bottom: 30px;
    font-weight: 300;
}

/* Hero Section Typography overrides */
#hero h1 {
    font-size: 4.8rem;
    line-height: 1.05;
    margin-bottom: 20px;
}

#hero h1 span {
    font-family: var(--font-body);
    font-weight: 300;
    font-size: 1.6rem;
    color: var(--text-secondary);
    letter-spacing: 3px;
    text-transform: uppercase;
    display: block;
    margin-bottom: 10px;
}

/* Gallery Showcase Grid layout */
.gallery-section-wrapper {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    z-index: 20;
    position: relative;
}

.gallery-section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 50px;
}

.gallery-section-header h2 {
    font-size: 3rem;
}

.gallery-homepage-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.gallery-homepage-card {
    background: var(--card-bg-solid);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.4s var(--ease-smooth);
    display: flex;
    flex-direction: column;
}

.gallery-homepage-card:hover {
    transform: translateY(-8px);
    border-color: var(--border-color-hover);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.4);
}

.gallery-card-img {
    height: 300px;
    width: 100%;
    overflow: hidden;
    position: relative;
}

.gallery-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.gallery-homepage-card:hover .gallery-card-img img {
    transform: scale(1.08);
}

.gallery-card-body {
    padding: 24px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.gallery-card-body h3 {
    font-size: 1.3rem;
    margin-bottom: 8px;
}

.gallery-card-body p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.gallery-card-tag {
    display: inline-block;
    align-self: flex-start;
    margin-top: 15px;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent);
    background: rgba(200, 107, 69, 0.1);
    padding: 3px 8px;
    border-radius: 4px;
}

/* Stats list / Completed Projects styling */
.stats-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 30px;
}

.stat-box {
    border-top: 1px solid var(--border-color);
    padding-top: 15px;
}

.stat-num {
    font-family: var(--font-heading);
    font-size: 2.8rem;
    font-weight: 700;
    color: var(--accent);
    line-height: 1;
}

.stat-txt {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 6px;
}

/* Contact form layout override */
.contact-homepage-card {
    max-width: 650px;
    width: 100%;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 14px 18px;
    background-color: rgba(8, 8, 9, 0.5);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.form-group textarea {
    height: 120px;
    resize: none;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 10px var(--accent-glow);
    background-color: rgba(8, 8, 9, 0.7);
}

.submit-btn {
    background-color: var(--accent);
    color: white;
    border: none;
    padding: 14px 30px;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 15px var(--accent-glow);
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(200, 107, 69, 0.4);
    filter: brightness(1.1);
}

.form-status {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.form-status.success {
    background: rgba(107, 162, 131, 0.15);
    border: 1px solid #6ba283;
    color: #bbf7d0;
}

.form-status.error {
    background: rgba(200, 83, 83, 0.15);
    border: 1px solid #c85353;
    color: #fecaca;
}

/* Button with arrow */
.btn-text {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--accent);
    font-weight: 600;
    font-size: 0.95rem;
}

.btn-text:hover {
    color: var(--text-primary);
}

.btn-text span {
    transition: transform 0.3s ease;
}

.btn-text:hover span {
    transform: translateX(5px);
}

/* Inner Page Header styling */
.page-header {
    text-align: center;
    margin-bottom: 60px;
    margin-top: 40px;
}

.page-header h1 {
    font-size: 3.8rem;
    margin-bottom: 12px;
}

.page-header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* Gallery page filters and layout */
.gallery-filters {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 50px;
    flex-wrap: wrap;
}

.filter-btn {
    background: rgba(142, 130, 121, 0.08);
    border: 1px solid var(--border-color);
    padding: 10px 24px;
    border-radius: 30px;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
    box-shadow: 0 4px 15px var(--accent-glow);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
}

.gallery-item {
    background: var(--card-bg-solid);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.gallery-item:hover {
    transform: translateY(-8px);
    border-color: var(--border-color-hover);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.4);
}

.gallery-image-box {
    position: relative;
    width: 100%;
    height: 350px;
    overflow: hidden;
}

.gallery-image-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.gallery-item:hover .gallery-image-box img {
    transform: scale(1.08);
}

.gallery-info {
    padding: 24px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.gallery-info h3 {
    font-size: 1.4rem;
    margin-bottom: 8px;
}

.gallery-info p {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.gallery-info .category-tag {
    display: inline-block;
    align-self: flex-start;
    margin-top: 15px;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent);
    background: rgba(200, 107, 69, 0.1);
    padding: 4px 10px;
    border-radius: 4px;
}

/* Lightbox Modal */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(8, 8, 9, 0.95);
    z-index: 2000;
    display: none;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox.active {
    display: flex;
    opacity: 1;
}

.lightbox-content {
    max-width: 90%;
    max-height: 80vh;
    position: relative;
    text-align: center;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 75vh;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.lightbox-caption {
    color: var(--text-primary);
    margin-top: 15px;
    font-family: var(--font-heading);
    font-size: 1.3rem;
}

.lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    color: var(--text-primary);
    font-size: 2rem;
    cursor: pointer;
}

/* About Page layout details */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: center;
}

.about-image {
    border-radius: 30px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    height: 500px;
    position: relative;
}

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

.about-text h2 {
    font-size: 2.5rem;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.about-text p {
    color: var(--text-secondary);
    font-size: 1.05rem;
    margin-bottom: 20px;
}

/* Contact Page Layout details */
.contact-grid {
    display: grid;
    grid-template-columns: 5fr 7fr;
    gap: 40px;
}

.contact-info-card {
    background: var(--card-bg-solid);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.contact-info-title h2 {
    font-size: 2rem;
    margin-bottom: 12px;
}

.contact-info-title p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.info-details {
    margin: 40px 0;
}

.info-item {
    display: flex;
    gap: 20px;
    margin-bottom: 24px;
    align-items: flex-start;
}

.info-item-icon {
    font-size: 1.5rem;
    color: var(--accent);
}

.info-item-text h4 {
    font-family: var(--font-body);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.info-item-text p {
    font-size: 1.05rem;
    color: var(--text-primary);
}

.contact-form-card {
    background: var(--card-bg-solid);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 40px;
}

/* Footer styling */
footer {
    position: relative;
    z-index: 30; /* Keep it above background ThreeJS canvas */
    border-top: 1px solid var(--border-color);
    background: rgba(8, 8, 9, 0.95);
    padding: 80px 60px 40px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: 40px;
    max-width: 1400px;
    margin: 0 auto;
}

.footer-col h3 {
    font-size: 1.5rem;
    margin-bottom: 20px;
}

.footer-col p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    max-width: 300px;
}

.footer-col h4 {
    font-family: var(--font-body);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent);
    margin-bottom: 20px;
}

.footer-col ul {
    list-style: none;
}

.footer-col ul li {
    margin-bottom: 12px;
}

.footer-col ul li a {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.footer-col ul li a:hover {
    color: var(--text-primary);
}

.footer-bottom {
    max-width: 1400px;
    margin: 60px auto 0;
    padding-top: 20px;
    border-top: 1px solid rgba(223, 213, 198, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-secondary);
    font-size: 0.85rem;
    flex-wrap: wrap;
    gap: 15px;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    header {
        padding: 20px 40px;
    }
    .main-wrapper {
        margin: 110px auto 30px;
        padding: 0 30px;
    }
    .scroll-section {
        padding: 100px 30px;
        min-height: auto;
    }
    .section-content-box {
        max-width: 100%;
        padding: 30px;
    }
    #roots {
        justify-content: center;
    }
    #hero, #projects-section, #contact-section {
        justify-content: center;
    }
    #container3D {
        opacity: 0.35; /* Faint overlay behind mobile text cards */
    }
    .gallery-homepage-grid {
        grid-template-columns: 1fr 1fr;
    }
    .about-grid, .contact-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    header {
        padding: 20px;
    }
    .main-wrapper {
        margin: 100px auto 20px;
        padding: 0 20px;
    }
    .nav-links {
        display: none;
    }
    .nav-cta {
        display: none;
    }
    .mobile-toggle {
        display: flex;
    }
    .scroll-section {
        padding: 80px 20px;
    }
    .section-title {
        font-size: 2.2rem;
    }
    #hero h1 {
        font-size: 2.8rem;
    }
    .gallery-homepage-grid {
        grid-template-columns: 1fr;
    }
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    .form-row {
        grid-template-columns: 1fr;
    }
}
