:root {
    --bg-color: #F6F5F0; /* Soft warm cream */
    --text-primary: #1A1A1A;
    --border-color: #D6D5CF;
    /* Fonts */
    --font-heading: 'Outfit', sans-serif;
    --font-sans: 'Outfit', sans-serif;
    
    /* Inputs */
    --input-bg: transparent;
    --input-border: #1A1A1A;
}

[data-theme="dark"] {
    --bg-color: #000000; /* Solid black */
    --text-primary: #F6F5F0; /* Soft cream text */
    --border-color: #333333;
    --input-bg: transparent;
    --input-border: #F6F5F0;
}

/* Theme Toggle Button */
.theme-toggle {
    background: transparent;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    transition: background-color 0.3s ease;
}

.theme-toggle:hover {
    background-color: rgba(128, 128, 128, 0.1);
}

.theme-toggle svg {
    width: 20px;
    height: 20px;
}

/* Switch icon depending on theme */
.moon-icon { display: block; }
.sun-icon { display: none; }

[data-theme="dark"] .moon-icon { display: none; }
[data-theme="dark"] .sun-icon { display: block; }

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

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-sans);
    -webkit-font-smoothing: antialiased;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 60px;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--bg-color); /* solid so it overlays cleanly */
    position: relative;
    z-index: 100;
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 400;
    letter-spacing: 0.05em;
    text-decoration: none;
    color: var(--text-primary);
}

.nav {
    display: flex;
    gap: 30px;
    align-items: center;
}

.nav a {
    text-decoration: none;
    color: var(--text-primary);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    transition: opacity 0.3s ease;
}

.nav a:hover {
    opacity: 0.6;
}

.nav a.active {
    border-bottom: 1px solid var(--text-primary);
    padding-bottom: 2px;
}

/* Hero Section */
.hero {
    padding: 60px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hero-media-wrapper {
    width: 100%;
    max-width: 1200px;
    height: 55vh;
    overflow: hidden;
    position: relative;
}

.hero-media-wrapper video,
.hero-media-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    animation: heroBreathing 20s ease-in-out infinite;
}

@keyframes heroBreathing {
    0% { transform: scale(1); }
    50% { transform: scale(1.06); }
    100% { transform: scale(1); }
}

.hero-text {
    text-align: center;
    max-width: 800px;
    margin-bottom: 50px;
}

.hero-text h1 {
    font-family: var(--font-heading);
    font-size: 4.5rem;
    font-weight: 400;
    letter-spacing: 0.05em;
    margin-bottom: 20px;
}

.hero-text h2 {
    font-size: 1.1rem;
    font-weight: 400;
    letter-spacing: 0.02em;
    margin-bottom: 15px;
    text-transform: uppercase;
}

.hero-text p {
    font-size: 0.85rem;
    font-weight: 400;
    letter-spacing: 0.02em;
    margin-bottom: 30px;
    text-transform: uppercase;
}

.explore-btn {
    text-decoration: none;
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-transform: uppercase;
    transition: opacity 0.3s ease;
}

.explore-btn:hover {
    opacity: 0.7;
}

/* SplitText Animation Classes */
.split-text-anim {
    overflow: hidden;
    will-change: transform, opacity;
}

.split-char {
    display: inline-block;
    white-space: pre;
    will-change: transform, opacity;
}

.explore-btn span {
    font-size: 1.2rem;
    line-height: 1;
}

/* Global Sections */
.section-padding {
    padding: 60px;
    border-bottom: 1px solid var(--border-color);
}

.section-header {
    text-align: center;
    margin-bottom: 50px;
}

.section-header h2 {
    font-family: var(--font-heading);
    font-size: 3rem;
    font-weight: 400;
    letter-spacing: 0.05em;
}

/* Portfolio Grid */
.grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    max-width: 1400px;
    margin: 0 auto;
}

/* Special full width grid for Gallery Page */
.gallery-page-grid {
    grid-template-columns: repeat(4, 1fr);
}

.grid-item {
    display: flex;
    flex-direction: column;
    cursor: pointer;
    text-decoration: none;
    color: var(--text-primary);
}

.image-box {
    width: 100%;
    aspect-ratio: 16 / 10;
    margin-bottom: 15px;
    overflow: hidden;
}

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

.grid-item:hover .image-box img {
    transform: scale(1.03);
}

.item-text h3 {
    font-family: var(--font-sans);
    font-size: 1rem;
    font-weight: 400;
    margin-bottom: 5px;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.item-text p {
    font-family: var(--font-sans);
    font-size: 0.85rem;
    font-weight: 400;
    color: #444;
    text-transform: capitalize;
}

/* Services Grid */
.services-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.service-card {
    padding: 60px 40px;
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.5s cubic-bezier(0.25, 1, 0.3, 1);
    background-color: transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 380px;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: var(--text-primary);
    transform: scaleY(0);
    transform-origin: bottom;
    transition: transform 0.5s cubic-bezier(0.25, 1, 0.3, 1);
    z-index: 0;
}

.service-card:hover::before {
    transform: scaleY(1);
    transform-origin: top;
}

.service-card:hover {
    border-color: var(--text-primary);
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.05);
}

.service-card > * {
    position: relative;
    z-index: 1;
    transition: color 0.4s ease;
}

.service-card h3 {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 400;
    margin-bottom: 20px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.service-card p {
    font-size: 0.95rem;
    line-height: 1.8;
    color: var(--text-secondary);
}

.service-card:hover h3, 
.service-card:hover p,
.service-card:hover .service-btn-icon {
    color: var(--bg-color) !important;
}

.service-btn-icon {
    margin-top: 30px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s cubic-bezier(0.25, 1, 0.3, 1);
    color: var(--text-primary);
}

.service-card:hover .service-btn-icon {
    opacity: 1;
    transform: translateY(0);
}

/* Contact Form */
.contact-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    max-width: 1200px;
    margin: 0 auto;
}

.contact-info h2 {
    font-family: var(--font-heading);
    font-size: 3rem;
    font-weight: 400;
    margin-bottom: 20px;
}

.contact-info p {
    font-size: 1rem;
    margin-bottom: 20px;
}

.email-link {
    font-size: 1.2rem;
    text-decoration: underline;
    color: var(--text-primary);
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.input-group {
    position: relative;
}

.input-group input,
.input-group textarea {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--input-border);
    padding: 10px 0;
    font-family: var(--font-sans);
    font-size: 1rem;
    color: var(--text-primary);
    outline: none;
}

.input-group label {
    position: absolute;
    top: 10px;
    left: 0;
    font-size: 0.9rem;
    color: #666;
    pointer-events: none;
    transition: 0.3s ease all;
}

.input-group input:focus ~ label,
.input-group input:not(:placeholder-shown) ~ label,
.input-group textarea:focus ~ label,
.input-group textarea:not(:placeholder-shown) ~ label {
    top: -20px;
    font-size: 0.8rem;
    color: var(--text-primary);
}

.submit-btn, .whatsapp-btn {
    padding: 15px 30px;
    background: transparent;
    border: 1px solid var(--text-primary);
    color: var(--text-primary);
    font-family: var(--font-sans);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-block;
    text-align: center;
    text-decoration: none;
}

.submit-btn:hover, .whatsapp-btn:hover {
    background: var(--text-primary);
    color: var(--bg-color);
}

/* Footer */
.footer {
    padding: 30px 60px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-left {
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.footer-right {
    display: flex;
    gap: 20px;
    align-items: center;
}

.social-link {
    color: var(--text-primary);
    transition: opacity 0.3s ease;
}

.social-link:hover {
    opacity: 0.6;
}

/* Responsive */
@media (max-width: 1024px) {
    .grid, .gallery-page-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .services-grid {
        grid-template-columns: 1fr;
    }
    .contact-wrapper {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 20px;
        padding: 20px;
    }
    .hero-text h1 {
        font-size: 3rem;
    }
    .grid, .gallery-page-grid {
        grid-template-columns: 1fr;
    }
    .footer {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
}

/* Preloader */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-color);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.preloader-text-animated {
    display: flex;
    font-family: var(--font-heading);
    font-size: 1.2rem;
    letter-spacing: 0.2em;
    color: var(--text-primary);
    margin-bottom: 30px;
}

.preloader-text-animated .char {
    display: inline-block;
}

.preloader-line-container {
    width: 200px;
    height: 1px;
    background-color: rgba(26, 26, 26, 0.1);
    position: relative;
    overflow: hidden;
}

.preloader-line {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background-color: var(--text-primary);
}


/* ==========================================================================
   FEATURED ACCORDION
   ========================================================================== */
.featured-accordion {
    display: flex;
    height: 75vh;
    min-height: 600px;
    width: 100%;
    margin: 50px auto 0;
    gap: 15px;
}

.accordion-item {
    flex: 1;
    height: 100%;
    border-radius: 4px;
    background-size: cover;
    background-position: center;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: flex 0.8s cubic-bezier(0.25, 1, 0.3, 1), min-height 0.8s cubic-bezier(0.25, 1, 0.3, 1);
}

.accordion-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(26, 26, 26, 0.1) 0%, rgba(26, 26, 26, 0.9) 100%);
    z-index: 1;
    transition: var(--transition-smooth);
}

.accordion-content {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 40px;
    z-index: 10;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    height: 100%;
    color: #F6F5F0;
}

.acc-category {
    font-size: 0.75rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: rgba(246, 245, 240, 0.8);
    font-weight: 400;
    margin-bottom: 8px;
    transform: translateY(20px);
    opacity: 0;
    transition: var(--transition-smooth);
}

.acc-title {
    font-size: 2.5rem;
    font-family: var(--font-heading);
    color: #F6F5F0;
    text-transform: uppercase;
    margin-bottom: 15px;
    line-height: 1.1;
    transform: translateY(30px);
    opacity: 0;
    transition: var(--transition-smooth);
}

.acc-btn {
    align-self: flex-start;
    transform: translateY(40px);
    opacity: 0;
    transition: var(--transition-smooth);
    margin-top: 15px;
    display: inline-block;
    border-bottom: 1px solid rgba(246, 245, 240, 0.5);
    padding-bottom: 5px;
    font-size: 0.85rem;
    letter-spacing: 1px;
    text-transform: uppercase;
}
.acc-btn:hover {
    border-bottom-color: #F6F5F0;
}

/* Expanded state styles */
.accordion-item.active {
    flex: 3.5;
    cursor: default;
}

.accordion-item.active .accordion-overlay {
    background: linear-gradient(to bottom, rgba(26, 26, 26, 0.05) 0%, rgba(26, 26, 26, 0.8) 100%);
}

.accordion-item.active .acc-category,
.accordion-item.active .acc-title,
.accordion-item.active .acc-btn {
    transform: translateY(0);
    opacity: 1;
}

@media (max-width: 991px) {
    .gallery-mobile-accordion {
        flex-direction: column;
        height: auto;
        min-height: 80vh;
    }
    .gallery-mobile-accordion .accordion-item {
        min-height: 80px;
    }
    .gallery-mobile-accordion .accordion-item.active {
        flex: auto;
        min-height: 50vh;
    }
}

/* Transition delay orchestrations */
.accordion-item.active .acc-category { transition-delay: 0.2s; }
.accordion-item.active .acc-title { transition-delay: 0.3s; }
.accordion-item.active .acc-btn { transition-delay: 0.4s; }

/* Mobile Adjustments for Accordion */
@media (max-width: 991px) {
    .featured-accordion {
        flex-direction: column;
        height: 100vh;
        gap: 10px;
    }
}


/* ==========================================================================
   BREATHING MASONRY GALLERY
   ========================================================================== */
.breathing-gallery-grid {
    column-count: 3;
    column-gap: 20px;
    padding: 20px 0;
    width: 100%;
}

.gallery-item-wrapper {
    break-inside: avoid;
    margin-bottom: 20px;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
    background-color: var(--border-color);
}

.gallery-item-wrapper img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    animation: heroBreathing 20s ease-in-out infinite;
    filter: grayscale(100%);
    transition: filter 0.8s ease;
    /* animation-delay set in JS for staggered effect */
}

.gallery-item-wrapper:hover img {
    filter: grayscale(0%);
}

.gallery-item-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.1);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 2;
    pointer-events: none;
}

.gallery-item-wrapper:hover .gallery-item-overlay {
    opacity: 1;
}

@media (max-width: 991px) {
    .gallery-item-wrapper img {
        filter: grayscale(0%) !important;
    }
}

@media (max-width: 991px) {
    .breathing-gallery-grid { column-count: 2; }
}

@media (max-width: 576px) {
    .breathing-gallery-grid { 
        column-count: auto; 
        display: flex; 
        flex-direction: column; 
    }
}

/* ==========================================================================
   PIXEL TRANSITION
   ========================================================================== */
.pixelated-image-card {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
}

.pixelated-image-card__default,
.pixelated-image-card__active,
.pixelated-image-card__pixels {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
}

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

.pixelated-image-card__active {
  z-index: 2;
  display: none;
}

.pixelated-image-card__pixels {
  pointer-events: none;
  position: absolute;
  z-index: 3;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.pixelated-image-card__pixel {
  display: none;
  position: absolute;
}

/* ==========================================================================
   THEME VIEW TRANSITION (Ported from theme toggle.tsx)
   ========================================================================== */
::view-transition-group(root) {
  animation-duration: 1s;
  animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
}
      
::view-transition-new(root) {
  animation-name: reveal-light-top-right;
}

::view-transition-old(root),
[data-theme="dark"]::view-transition-old(root) {
  animation: none;
  z-index: -1;
}

[data-theme="dark"]::view-transition-new(root) {
  animation-name: reveal-dark-top-right;
}

@keyframes reveal-dark-top-right {
  from { clip-path: circle(0% at 100% 0%); }
  to { clip-path: circle(150% at 100% 0%); }
}

@keyframes reveal-light-top-right {
  from { clip-path: circle(0% at 100% 0%); }
  to { clip-path: circle(150% at 100% 0%); }
}

/* ==========================================================================
   LIGHTBOX OVERLAY
   ========================================================================== */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: none;
    justify-content: center;
    align-items: center;
}

.lightbox.active {
    display: flex;
}

.lightbox-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
}

.lightbox-content {
    position: relative;
    z-index: 10001;
    max-width: 90%;
    max-height: 90vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.lightbox-img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.5);
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
    position: absolute;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 2.5rem;
    cursor: pointer;
    transition: color 0.3s ease;
    padding: 20px;
    outline: none;
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
    color: #bbb;
}

.lightbox-close {
    top: -50px;
    right: 0;
    font-size: 3rem;
}

.lightbox-prev {
    left: -60px;
}

.lightbox-next {
    right: -60px;
}

@media (max-width: 768px) {
    .lightbox-prev { left: -20px; }
    .lightbox-next { right: -20px; }
    .lightbox-close { right: 10px; top: -60px; }
}
