@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,400;12..96,500;12..96,600;12..96,700&display=swap');

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Bricolage Grotesque', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
}

/* 3D Background Canvas */
#bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    opacity: 0.85;
}

body.dark-mode #bg-canvas {
    opacity: 0.9;
}

/* Ensure content is above 3D background */
.hero,
.projects,
.about-contact,
.theme-toggle {
    position: relative;
    z-index: 1;
}

/* Hero Section */
.hero {
    min-height: 45vh;
    max-height: 55vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem 2rem 1.5rem;
    background: transparent;
    color: #1a1a1a;
    position: relative;
    border: none;
    margin-bottom: 2rem;
}

/* Solid center panel for content */
.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: min(900px, 70%);
    height: 100%;
    background: #f7931e;
    border: 6px solid #1a1a1a;
    z-index: 0;
}

.hero-content {
    max-width: 800px;
    padding: 0 1rem;
    position: relative;
    z-index: 1;
}

.hero-content .logo {
    max-width: 130px;
    height: auto;
    margin-bottom: 1rem;
    display: block;
    margin-left: auto;
    margin-right: auto;
    filter: drop-shadow(3px 3px 0 rgba(0, 0, 0, 0.2));
}

.hero h1 {
    font-size: 4.5rem;
    margin-bottom: 0.3rem;
    font-weight: 700;
    color: #000000;
    text-transform: uppercase;
    letter-spacing: -2px;
    padding-bottom: 0.5rem;
    border-bottom: 4px solid #000000;
    display: inline-block;
}

.tagline {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #1a1a1a;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.separator {
    display: inline-block;
    margin: 0 0.5rem;
    font-size: 1.2em;
    font-weight: 900;
    color: #000000;
}

.subtitle {
    font-size: 1.3rem;
    font-weight: 400;
    color: #2a2a2a;
    max-width: 600px;
    margin: 0 auto;
}

.subtitle-item {
    display: inline;
}

.subtitle-separator {
    display: inline-block;
}

/* Hide mobile breaks on desktop */
.mobile-break {
    display: none;
}

/* Projects Section */
.projects {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.5rem 2rem 1rem; /* Reduced bottom padding from 3rem to 1rem */
}

.project-card {
    margin-bottom: 3rem; /* Changed from 4rem to consistent 3rem */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    background: #ffffff;
    border-radius: 0;
    overflow: hidden;
    box-shadow:
        8px 8px 0 rgba(0, 0, 0, 0.1),
        0 10px 40px rgba(0, 0, 0, 0.15);
    border: 6px solid #1a1a1a;
}

.project-card:hover {
    transform: translateY(-8px) translateX(-4px);
    box-shadow:
        12px 12px 0 rgba(0, 0, 0, 0.1),
        0 15px 50px rgba(0, 0, 0, 0.2);
}

.project-card a {
    text-decoration: none;
    color: inherit;
    display: block;
    cursor: pointer;
    -webkit-user-drag: none; /* Prevent drag on webkit browsers */
    user-drag: none;
}

.project-image {
    width: 100%;
    overflow: hidden;
    background: white;
}

.project-image img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.4s ease;
    -webkit-user-drag: none;
    user-drag: none;
    pointer-events: none; /* Make image not interfere with text selection */
}

/* 3D Design card video overlay */
.project-image-3d {
    position: relative;
}

.card-thumbnail-main {
    width: 100%;
    height: auto;
    display: block;
    transition: opacity 0.3s ease;
}

.card-video-main {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

/* Desktop: show video on hover */
@media (min-width: 769px) {
    .project-card:hover .card-thumbnail-main {
        opacity: 0;
    }

    .project-card:hover .card-video-main {
        opacity: 1;
    }
}

/* Mobile: video visible by default (autoplay handled in JS) */
@media (max-width: 768px) {
    .card-video-main {
        opacity: 1;
    }

    .card-thumbnail-main {
        opacity: 0;
    }
}

.project-card:hover .project-image img {
    transform: scale(1.05);
}

.project-info {
    padding: 1.5rem;
    text-align: center;
    background: white;
    pointer-events: auto; /* Re-enable pointer events for text area */
}

.project-info h2 {
    font-size: 2rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
    color: #1a1a1a;
    user-select: text;
    pointer-events: auto;
}

.project-info p {
    font-size: 1.1rem;
    color: #4a4a4a;
    line-height: 1.6;
    text-align: left;
    user-select: text;
    pointer-events: auto;
}

/* About & Contact Section */
.about-contact {
    background: transparent;
    padding: 0;
    margin: 2rem auto 4rem; /* Reduced top margin from 4rem to 2rem */
    display: flex;
    flex-direction: column;
    gap: 3rem;
    max-width: 1200px;
}

/* About Section - Full Width with Photo */
.about-full {
    background: #ffffff;
    padding: 3rem 3rem; /* Reduced top padding from 4rem */
    border-radius: 0;
    box-shadow:
        8px 8px 0 rgba(0, 0, 0, 0.1),
        0 10px 40px rgba(0, 0, 0, 0.15);
    border: 6px solid #1a1a1a;
}

.about-heading {
    color: #1a1a1a;
    margin-bottom: 1.5rem; /* Reduced from 2rem */
    font-size: 2.5rem;
    padding-bottom: 0;
    text-align: center;
}

.about-content-wrapper {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 3rem;
    align-items: start;
}

.about-text {
    max-width: 750px;
}

.about-text p {
    color: #4a4a4a;
    line-height: 1.8;
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.inline-link {
    color: #004e89;
    font-weight: 700;
    text-decoration: underline;
    transition: color 0.2s ease;
}

.inline-link:hover {
    color: #ff6b35;
}

.about-image {
    position: sticky;
    top: 2rem;
}

.about-image img {
    width: 100%;
    height: auto;
    display: block;
    border: 6px solid #1a1a1a;
    box-shadow:
        6px 6px 0 rgba(0, 0, 0, 0.1),
        0 4px 20px rgba(0, 0, 0, 0.1);
}

.image-caption {
    margin-top: 1rem;
    font-size: 0.9rem;
    color: #666;
    font-style: italic;
    text-align: center;
}

/* Read more button - hidden on desktop */
.about-preview {
    display: block;
}

.about-full-text {
    display: block;
}

.read-more-btn {
    display: none;
}

/* Contact Section - Standalone Card */
.contact-standalone {
    background: #ffffff;
    padding: 3rem;
    border-radius: 0;
    box-shadow:
        8px 8px 0 rgba(0, 0, 0, 0.1),
        0 10px 40px rgba(0, 0, 0, 0.15);
    border: 6px solid #1a1a1a;
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.contact-standalone h2 {
    color: #1a1a1a;
    margin-bottom: 1rem;
    font-size: 2rem;
}

.contact-standalone p {
    color: #4a4a4a;
    line-height: 1.8;
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.contact-button {
    display: inline-block;
    padding: 0.8rem 2rem;
    background: #ff6b35;
    color: white;
    text-decoration: none;
    border-radius: 0;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.2);
    border: 3px solid #000000;
}

.contact-button:hover {
    transform: translateY(-2px) translateX(-2px);
    box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.2);
}

.footer-credits {
    text-align: center;
    padding: 2rem 0;
    color: #1a1a1a; /* Changed from #666 to proper black */
}

/* Dark Mode Toggle */
.theme-toggle {
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.theme-toggle-btn {
    background: #f4e8d0; /* Changed from #ffffff to cream */
    color: #000000;
    border: 4px solid #f4e8d0; /* Changed from #ffffff to cream */
    padding: 0.75rem 1.5rem;
    font-family: 'Bricolage Grotesque', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    box-shadow:
        6px 6px 0 rgba(0, 0, 0, 0.15),
        0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.theme-toggle-btn:hover {
    transform: translateY(-2px) translateX(-2px);
    box-shadow:
        8px 8px 0 rgba(0, 0, 0, 0.15),
        0 6px 20px rgba(0, 0, 0, 0.15);
}

.theme-toggle-btn:active {
    transform: translateY(0) translateX(0);
    box-shadow:
        4px 4px 0 rgba(0, 0, 0, 0.15),
        0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Dark Mode Styles */
body.dark-mode {
    --bg-primary: #1a1a1a;
    --stripe-1: #cc5528;
    --stripe-2: #c97619;
}

body.dark-mode .theme-toggle-btn {
    background: #f4e8d0; /* Changed from #ffffff to cream */
    color: #000000;
    border-color: #f4e8d0; /* Changed from #ffffff to cream */
}

body.dark-mode .hero {
    background: transparent;
}

body.dark-mode .hero::before {
    background: #1a1a1a;
    border-color: #f4e8d0;
}

body.dark-mode .hero h1 {
    color: #f4e8d0;
    border-bottom-color: #f4e8d0;
}

body.dark-mode .hero .tagline {
    color: #f4e8d0;
}

body.dark-mode .hero .subtitle {
    color: #f4e8d0;
}

body.dark-mode .project-card,
body.dark-mode .about-contact {
    background: transparent; /* Changed from #2a2a2a to transparent */
    border-color: #f4e8d0;
}

body.dark-mode .project-info,
body.dark-mode .about,
body.dark-mode .contact {
    background: #2a2a2a;
}

body.dark-mode .project-info h2,
body.dark-mode .about h2,
body.dark-mode .contact h2 {
    color: #ffffff;
}

body.dark-mode .project-info p,
body.dark-mode .about p,
body.dark-mode .contact p {
    color: #cccccc;
}

body.dark-mode .footer-credits {
    color: #f4e8d0; /* Changed from #aaaaaa to cream */
    border-top-color: #444444;
}

body.dark-mode .contact-button {
    background: #cc5528;
}

body.dark-mode .separator {
    color: #f4e8d0;
}

/* 3D Loading Indicator */
.loading-3d {
    position: fixed;
    bottom: 2rem;
    left: 2rem;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    font-family: 'Bricolage Grotesque', sans-serif;
    font-size: 0.9rem;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.loading-3d.visible {
    opacity: 1;
}

.loading-3d::after {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-left: 8px;
    border: 2px solid #ffffff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .hero::before {
        width: min(900px, 80%);
    }

    .project-card {
        max-width: 700px;
    }
}

@media (max-width: 768px) {
    .hero {
        padding: 2rem 1rem 2rem;
    }

    /* Full width on mobile - no side panels */
    .hero::before {
        width: 100%;
    }

    .hero h1 {
        font-size: 2.5rem;
        letter-spacing: -1px;
    }

    .tagline {
        font-size: 1.3rem;
        letter-spacing: 0.3px;
        line-height: 1.4;
    }

    .subtitle {
        font-size: 1rem;
        line-height: 1.5;
    }

    /* KEEP square separators on mobile/tablet - do NOT hide or stack */

    /* Show mobile breaks on tablets */
    .mobile-break {
        display: inline;
    }

    .project-card {
        max-width: 100%;
        margin-bottom: 3rem; /* Consistent 3rem spacing */
    }

    .project-info h2 {
        font-size: 1.6rem;
    }

    .about-contact {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .theme-toggle {
        position: static;
        width: 100%;
        display: flex;
        flex-direction: row; /* Side-by-side on mobile */
        justify-content: center;
        gap: 1rem;
        padding: 1rem;
        background: transparent;
    }

    .theme-toggle-btn {
        width: auto;
        flex: 1; /* Equal width buttons */
        max-width: 200px;
    }

    .about-content-wrapper {
        grid-template-columns: 1fr;
        gap: 2rem;
        display: flex;
        flex-direction: column;
    }

    /* Mobile: Picture comes first */
    .about-image {
        position: static;
        max-width: 400px;
        margin: 0 auto;
        order: 1;
    }

    /* Text comes second */
    .about-text {
        order: 2;
    }

    /* Mobile: Hide extra paragraphs by default */
    .about-full-text {
        display: none;
    }

    .about-full-text.expanded {
        display: block;
    }

    /* Mobile: Show read more button */
    .read-more-btn {
        display: inline-block;
        margin-top: 1rem;
        padding: 0.6rem 1.5rem;
        background: #ff6b35;
        color: white;
        border: 3px solid #000000;
        font-family: 'Bricolage Grotesque', sans-serif;
        font-weight: 700;
        font-size: 0.95rem;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        cursor: pointer;
        box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.2);
        transition: transform 0.2s ease, box-shadow 0.2s ease;
    }

    .read-more-btn:active {
        transform: translateY(-2px) translateX(-2px);
        box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.2);
    }

    .read-more-btn.expanded {
        background: #4a4a4a;
    }

    body.dark-mode .read-more-btn {
        background: #cc5528;
        border-color: #f4e8d0;
    }

    body.dark-mode .read-more-btn.expanded {
        background: #6a6a6a;
    }

    .about-text h2 {
        font-size: 2rem;
    }

    .about-text p,
    .contact-standalone p {
        font-size: 1rem;
    }

    .about-full {
        padding: 2rem 1.5rem;
    }

    .contact-standalone {
        padding: 2rem 1.5rem;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 1.5rem 1rem 2rem;
    }

    .hero h1 {
        font-size: 2rem;
        letter-spacing: -0.5px;
    }

    .tagline {
        font-size: 1.1rem;
    }

    .subtitle {
        font-size: 0.95rem;
        margin-bottom: 0.5rem;
    }

    /* STILL keep inline on phones - do NOT stack yet */

    /* Ensure mobile breaks are visible */
    .mobile-break {
        display: inline;
    }
}

/* Only stack at extremely narrow widths (≤360px) */
@media (max-width: 360px) {
    .subtitle-separator {
        display: none;
    }

    .subtitle-item {
        display: block;
        margin-bottom: 0.3rem;
    }

    .subtitle-item:last-child {
        margin-bottom: 0;
    }
}

/* Dark mode for About section */
body.dark-mode .about-full,
body.dark-mode .contact-standalone {
    background: #2a2a2a;
    border-color: #f4e8d0;
}

body.dark-mode .about-heading,
body.dark-mode .contact-standalone h2 {
    color: #ffffff;
}