/* Layout CSS: Grids and Flexbox */

/* Logo: Always show white (sticky) logo */
.logo-default {
    display: block !important;
}

/* If no sticky logo is set, default stays (need JS or PHP check, but CSS fallback: if only one img, it shows) */
/* Actually, PHP ensures structure. logic above works if both exist. */

/* Hero Layout (Split) */
.hero-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    height: 100%;
    padding-top: var(--header-height);
}

.hero-text {
    z-index: 2;
}

.hero-visual {
    /* display: flex; */
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 1;
}

.visual-container {
    position: relative;
    width: 100%;
    max-width: 500px;
    /* Constrain size */
    height: 70vh;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    /* Align bottom */
}

.hero-img-statue {
    max-height: 100%;
    width: auto;
    object-fit: contain;
    position: relative;
    z-index: 2;
    filter: grayscale(100%) contrast(1.1);
    /* Statue-like aesthetic */
    transition: filter 0.5s ease;
}

.hero-img-statue:hover {
    filter: grayscale(0%) contrast(1);
    /* Reveal color on hover */
}

.shape-x {
    font-size: 500px;
    font-weight: 900;
    line-height: 1;
    color: #000000;
    /* Pure Black as requested */
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0.15;
    /* Increased opacity for visibility */
    z-index: 1;
    font-family: var(--font-heading);
    pointer-events: none;
}

/* Decorative Circles */
.shape-circle {
    position: absolute;
    border-radius: 50%;
    border: 1px solid var(--color-text);
    opacity: 0.1;
    z-index: 0;
    pointer-events: none;
}

.circle-1 {
    width: 300px;
    height: 300px;
    top: 40%;
    left: 40%;
    transform: translate(-50%, -50%);
}

.circle-2 {
    width: 150px;
    height: 150px;
    bottom: 20%;
    right: 20%;
    border-style: dashed;
    /* Variation */
}



/* Grids */
.grid-2-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-lg);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    /* 4 columns for Ramira Services */
    gap: var(--spacing-md);
    margin-top: var(--spacing-lg);
}

/* Portfolio List Layout */
.portfolio-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
    /* No gap, borders separate them */
    margin-top: var(--spacing-lg);
}

.project-row {
    display: grid;
    grid-template-columns: 0.5fr 2fr 1fr auto;
    align-items: center;
    padding: var(--spacing-md) 0;
    border-bottom: 1px solid var(--color-border);
    transition: background-color 0.3s ease;
    cursor: pointer;
    position: relative;
}

.project-row:hover {
    background-color: var(--color-white);
    /* slight highlight */
}

/* Portfolio Hover Reveal Elements (Restored to Square Vibe) */
.hover-reveal-img {
    position: fixed;
    width: 300px;
    height: 300px;
    top: 0;
    left: 0;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    z-index: 99999;
    transform: translate(-50%, -50%);
    transition: opacity 0.3s ease;
    overflow: hidden;
    border-radius: 12px;
}

.hover-reveal-img.visible {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%);
}

.reveal-img-inner {
    width: 100%;
    height: 100%;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    transition: none;
}

.hover-reveal-img.visible .reveal-img-inner {
    transform: scale(1);
}

/* Hide grid defaults */
.portfolio-grid.grid-cols {
    display: none;
}

/* Contact Layout */
.contact-section {
    min-height: 80vh;
    display: flex;
    align-items: center;
}

.contact-wrapper {
    width: 100%;
}

/* Contact Footer */
.contact-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    /* Align items vertically */
    margin-top: var(--spacing-xl);
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--color-border);
    font-size: 0.875rem;
    color: var(--color-text-muted);
    flex-wrap: wrap;
    /* Allow wrapping on small screens */
    gap: var(--spacing-md);
    /* Ensure space between items */
}

/* Dark Footer & Curve */
.dark-footer {
    background-color: #1a1a1a;
    color: #ffffff;
    border-top-left-radius: 60px;
    border-top-right-radius: 60px;
    margin-top: -40px;
    /* Overlap effect if desired, or just margin */
    padding-top: var(--spacing-xl);
    position: relative;
    z-index: 5;
}

/* Force White Text for all children in dark footer */
.dark-footer h2,
.dark-footer h3,
.dark-footer p,
.dark-footer span,
.dark-footer a {
    color: #ffffff !important;
}

.dark-footer .btn-pill-white {
    color: black !important;
}

.dark-footer .email-link {
    color: #ffffff;
    -webkit-text-stroke: 1px transparent;
}

.dark-footer .email-link:hover {
    color: #ffffff;
    text-decoration-color: #ffffff;
    opacity: 0.8;
}

.dark-footer .contact-footer {
    border-top-color: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.5);
}

.dark-footer .social-links a {
    color: #ffffff;
}

/* Default Hidden Mobile Images */
.mobile-project-img {
    display: none;
}

/* Responsive Layouts */
@media (max-width: 992px) {
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .portfolio-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .hero-wrapper {
        grid-template-columns: 1fr;
        text-align: center;
        padding-top: calc(var(--header-height) + 10px);
        /* Reduced gap */
        gap: var(--spacing-md);
    }

    .hero-text {
        order: 2;
        position: relative;
        z-index: 10;
        margin-top: 0;
    }

    .hero-visual {
        justify-content: center;
        margin-top: 0;
        height: auto;
        margin-bottom: var(--spacing-md);
        width: 100%;
        /* Full width */
        max-width: 100%;
        /* No restriction */
        margin-left: auto;
        margin-right: auto;
    }

    .visual-container {
        height: auto;
        /* Allow container to shrink to image size */
        min-height: 250px;
        /* Minimum visual height */
    }

    .visual-container.visual-is-spline {
        height: 400px;
        /* Balanced height */
        min-height: 400px;
        display: block;
        clip-path: none !important;
        /* Disable clipping for Spline canvas */
        animation: none !important;
        /* Disable reveal animation if it causes issues */
    }

    .visual-container.visual-is-spline .shape-x {
        font-size: 180px;
        /* Much smaller to avoid collision */
        opacity: 0.1;
        top: 45%;
        /* Slightly higher to center with the model */
    }

    .visual-container.visual-is-spline .circle-1 {
        width: 150px;
        height: 150px;
    }

    .interactive-visual {
        width: 100%;
        max-width: 100%;
    }

    .grid-2-col {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }

    .services-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-sm);
        /* Reduced from md to sm for mobile */
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
        /* Prevent grid components from pushing width */
    }

    .portfolio-grid {
        grid-template-columns: 1fr;
    }

    .hero-meta {
        flex-direction: column;
        align-items: center;
        /* Center align social links */
        gap: var(--spacing-sm);
    }

    .contact-footer {
        flex-direction: column;
        gap: var(--spacing-sm);
        align-items: flex-start;
        /* Align left on mobile */
    }

    /* Stack Project Rows on Mobile */
    .project-row {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-sm);
        padding: var(--spacing-md) 0;
    }

    .project-row .p-number {
        font-size: 0.9rem;
        margin-bottom: 0;
    }

    .project-row h3 {
        font-size: 1.75rem;
        /* Smaller than desktop */
    }

    .project-row .p-category {
        margin-bottom: var(--spacing-sm);
    }

    .btn-view-project {
        /* Always show on mobile since hover isn't reliable */
        opacity: 1;
        transform: translateX(0);
        margin-top: var(--spacing-xs);
        font-size: 0.75rem;
        padding: 10px 20px;
        align-self: flex-start;
        /* Align left */
    }

    .mobile-project-img {
        display: block;
        width: 100%;
        height: 250px;
        object-fit: cover;
        border-radius: 4px;
        margin-bottom: var(--spacing-sm);
    }
}

/* Fluid Touch Ripple Animation */
.touch-ripple {
    position: fixed;
    top: 0;
    left: 0;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, rgba(37, 211, 102, 0.4) 0%, rgba(37, 211, 102, 0) 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%) scale(0);
    animation: ripple-bloom 0.8s cubic-bezier(0.1, 0.5, 0.5, 1) forwards;
}

@keyframes ripple-bloom {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0.8;
    }

    100% {
        transform: translate(-50%, -50%) scale(3);
        opacity: 0;
    }
}

/* -------------------------------------------------------------------------- */
/*                          Premium Marble Custom Cursor                      */
/* -------------------------------------------------------------------------- */

body.dcy-has-custom-cursor,
body.dcy-has-custom-cursor a,
body.dcy-has-custom-cursor button,
body.dcy-has-custom-cursor label,
body.dcy-has-custom-cursor input,
body.dcy-has-custom-cursor textarea,
body.dcy-has-custom-cursor select,
body.dcy-has-custom-cursor iframe,
body.dcy-has-custom-cursor [onclick],
body.dcy-has-custom-cursor [role="button"],
body.dcy-has-custom-cursor .logo-grid-item,
body.dcy-has-custom-cursor .project-row,
body.dcy-has-custom-cursor .ramira-bot-bubble,
body.dcy-has-custom-cursor #send-ramira-bot,
body.dcy-has-custom-cursor #close-ramira-bot,
body.dcy-has-custom-cursor .booking-button,
body.dcy-has-custom-cursor .whatsapp-header-btn {
    cursor: none !important;
}

.dcy-custom-cursor {
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 1000000;
    will-change: transform;
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dcy-custom-cursor.active {
    opacity: 1;
}

/* --- Style: Modern Arrow --- */
.cursor-style-arrow {
    width: 32px;
    height: 32px;
    transition: opacity 0.3s ease;
    /* Removed transform transition to avoid JS conflict */
}

.cursor-dot {
    width: 100%;
    height: 100%;
    background-image: url('../assets/images/arrow.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    transition: background-image 0.2s ease, transform 0.3s cubic-bezier(0.19, 1, 0.22, 1);
}

.dcy-custom-cursor.cursor-hover .cursor-dot {
    background-image: url('../assets/images/arrow_link.png');
    transform: scale(1.2);
}

/* --- Style: Studio Crosshair --- */
.cursor-style-crosshair {
    width: 100vw;
    height: 100vh;
    left: 0;
    top: 0;
    transform: none !important;
    /* Managed by children */
    pointer-events: none;
    mix-blend-mode: difference;
    /* Move blending to parent for absolute consistency */
}

.cursor-line-h,
.cursor-line-v {
    position: fixed;
    background-color: #fff;
    /* Base white inversion */
    opacity: 1;
    /* Must be 1 for pure black-on-white inversion */
    pointer-events: none;
    z-index: 999999;
    will-change: transform;
}

.cursor-line-h {
    width: 100vw;
    height: 1px;
    left: 0;
    top: 0;
}

.cursor-line-v {
    width: 1px;
    height: 100vh;
    left: 0;
    top: 0;
}

.cursor-crosshair-center {
    position: fixed;
    width: 12px;
    height: 12px;
    top: 0;
    left: 0;
    margin-top: -6px;
    /* Offset to center the 12x12 box on the coordinate */
    margin-left: -6px;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 1000001;
    /* Highest layer for the plus sign */
}

.cursor-crosshair-center::before,
.cursor-crosshair-center::after {
    content: '';
    position: absolute;
    background-color: #fff;
    /* Synchronized with lines */
}

.cursor-crosshair-center::before {
    width: 100%;
    height: 1px;
}

.cursor-crosshair-center::after {
    width: 1px;
    height: 100%;
}

/* Hover state for crosshair */
.cursor-style-crosshair.cursor-hover .cursor-crosshair-center {
    transform: scale(1.5) rotate(45deg);
    transition: transform 0.3s ease;
}

.cursor-style-crosshair.cursor-hover .cursor-line-h,
.cursor-style-crosshair.cursor-hover .cursor-line-v {
    background-color: rgba(0, 0, 0, 0.33);
}

/* Fallback for Touch */
@media (max-width: 1024px) {
    .dcy-custom-cursor {
        display: none !important;
    }

    body,
    a,
    button,
    label,
    input,
    textarea,
    select,
    [onclick],
    .logo-grid-item,
    .project-row {
        cursor: auto !important;
    }

    /* Ensure shapes don't block interaction */
    .hero-visual .shape-x,
    .hero-visual .shape-circle {
        pointer-events: none;
    }
}