/* ==========================================================================
   Depth 3D layer
   Loaded on every public page after styles.css. It only adds depth (layered
   shadows, light edges, extruded titles, a perspective floor and pointer tilt
   driven by depth-3d.js); it does not change layout, colours or content.
   To return to the previous look, remove this <link> and the depth-3d.js <script>.
   ========================================================================== */

:root {
    /* Light theme surfaces */
    --d3-surface:
        inset 0 1px 0 rgba(255, 255, 255, 0.9),
        0 1px 1px rgba(15, 23, 42, 0.05),
        0 8px 16px -6px rgba(15, 23, 42, 0.10),
        0 24px 48px -18px rgba(15, 23, 42, 0.18);
    --d3-surface-hover:
        inset 0 1px 0 rgba(255, 255, 255, 0.95),
        0 2px 2px rgba(15, 23, 42, 0.05),
        0 18px 30px -10px rgba(15, 23, 42, 0.18),
        0 40px 70px -24px color-mix(in srgb, var(--gold) 45%, transparent);
    --d3-glare: color-mix(in srgb, var(--gold-light) 30%, transparent);
    --d3-title-depth:
        0 1px 0 color-mix(in srgb, var(--gold) 22%, #fff),
        0 2px 0 color-mix(in srgb, var(--gold) 30%, #fff),
        0 3px 0 color-mix(in srgb, var(--gold) 38%, #fff),
        0 10px 18px rgba(15, 23, 42, 0.16);
}
html[data-theme="dark"] {
    --d3-surface:
        inset 0 1px 0 rgba(255, 255, 255, 0.07),
        inset 0 -1px 0 rgba(0, 0, 0, 0.35),
        0 1px 1px rgba(0, 0, 0, 0.25),
        0 10px 18px -6px rgba(0, 0, 0, 0.45),
        0 28px 56px -18px rgba(0, 0, 0, 0.6);
    --d3-surface-hover:
        inset 0 1px 0 rgba(255, 255, 255, 0.12),
        inset 0 -1px 0 rgba(0, 0, 0, 0.35),
        0 2px 2px rgba(0, 0, 0, 0.3),
        0 22px 34px -12px rgba(0, 0, 0, 0.6),
        0 44px 80px -26px color-mix(in srgb, var(--gold) 40%, transparent);
    --d3-glare: rgba(255, 255, 255, 0.11);
    --d3-title-depth:
        0 1px 0 color-mix(in srgb, var(--gold) 55%, #000),
        0 2px 0 color-mix(in srgb, var(--gold) 42%, #000),
        0 3px 0 color-mix(in srgb, var(--gold) 30%, #000),
        0 4px 0 color-mix(in srgb, var(--gold) 20%, #000),
        0 12px 26px rgba(0, 0, 0, 0.5);
}

/* --------------------------------------------------------------------------
   1. Cards: depth + light edge, and the glare used while tilting
   -------------------------------------------------------------------------- */
:is(.service-card, .pricing-card, .testimonial-card, .process-step, .about-card,
    .project-card, .feature-card, .contact-card, .verify-box, .faq-item) {
    box-shadow: var(--d3-surface);
}

:is(.service-card, .pricing-card, .testimonial-card, .process-step, .about-card,
    .project-card, .feature-card, .contact-card, .counter-item) {
    position: relative;
}
:is(.service-card, .pricing-card, .testimonial-card, .process-step, .about-card,
    .project-card, .feature-card, .contact-card, .counter-item)::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    z-index: 3;
    opacity: 0;
    background: radial-gradient(520px circle at var(--d3-mx, 50%) var(--d3-my, 0%), var(--d3-glare), transparent 42%);
    transition: opacity 0.35s ease;
}

/* depth-3d.js adds .d3-tilting while the pointer is over a card (desktop only).
   Doubled class + :root so it outranks styles.css's `html:not(.aos-enabled) [data-aos] { transform: none !important }`. */
:root .d3-tilting.d3-tilting {
    transform: perspective(1100px) rotateX(var(--d3-rx, 0deg)) rotateY(var(--d3-ry, 0deg)) translate3d(0, -8px, 0) !important;
    transition: transform 0.12s linear, box-shadow 0.35s ease, border-color 0.35s ease !important;
    box-shadow: var(--d3-surface-hover) !important;
    will-change: transform;
}
:root .d3-tilting.d3-tilting::after {
    opacity: 1;
}
/* After the pointer leaves: ease back to rest. */
:root .d3-settling.d3-settling {
    transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.5s ease !important;
}

/* --------------------------------------------------------------------------
   2. Icons as raised tiles, glyphs with depth
   -------------------------------------------------------------------------- */
:is(.service-icon, .feature-icon, .process-num) {
    background-image: linear-gradient(150deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0) 58%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.18),
        inset 0 -3px 6px rgba(0, 0, 0, 0.18),
        0 10px 18px -8px color-mix(in srgb, var(--gold) 55%, transparent);
}
:is(.service-icon, .feature-icon) i,
.counter-item > i,
.pricing-icon {
    filter:
        drop-shadow(0 2px 0 color-mix(in srgb, var(--gold) 45%, #000))
        drop-shadow(0 8px 10px rgba(0, 0, 0, 0.3));
}

/* --------------------------------------------------------------------------
   3. Buttons with a physical edge that presses down
   -------------------------------------------------------------------------- */
:is(.btn-primary, .hero3d-btn-primary, .btn-whatsapp, .featured .btn-price, .ai-chat-launcher) {
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.45),
        inset 0 -2px 0 rgba(0, 0, 0, 0.14),
        0 4px 0 0 color-mix(in srgb, var(--gold) 52%, #000),
        0 14px 26px -10px color-mix(in srgb, var(--gold) 70%, transparent);
}
:is(.btn-primary, .hero3d-btn-primary, .btn-whatsapp, .featured .btn-price):hover {
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.5),
        inset 0 -2px 0 rgba(0, 0, 0, 0.14),
        0 6px 0 0 color-mix(in srgb, var(--gold) 52%, #000),
        0 22px 34px -12px color-mix(in srgb, var(--gold) 75%, transparent);
}
:is(.btn-primary, .hero3d-btn-primary, .btn-whatsapp, .featured .btn-price):active {
    transform: translateY(3px) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.4),
        inset 0 -1px 0 rgba(0, 0, 0, 0.14),
        0 1px 0 0 color-mix(in srgb, var(--gold) 52%, #000),
        0 6px 12px -6px color-mix(in srgb, var(--gold) 60%, transparent);
    transition-duration: 0.06s;
}
:is(.btn-outline, .hero3d-btn-ghost, .btn-price) {
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        0 10px 20px -12px rgba(0, 0, 0, 0.55);
}
:is(.btn-outline, .hero3d-btn-ghost, .btn-price):active {
    transform: translateY(2px) !important;
    transition-duration: 0.06s;
}

/* --------------------------------------------------------------------------
   4. Extruded titles
   -------------------------------------------------------------------------- */
.section-title {
    text-shadow: var(--d3-title-depth);
}
.hero3d-title,
.service-hero-title {
    text-shadow:
        0 1px 0 #d8cdb4,
        0 2px 0 #c6b896,
        0 3px 0 #ad9f7c,
        0 4px 0 #8f8262,
        0 6px 2px rgba(0, 0, 0, 0.35),
        0 16px 34px rgba(0, 0, 0, 0.55);
}
/* Gradient text has a transparent fill, so it gets its depth from drop-shadow instead. */
.hero3d-title .hero3d-accent {
    text-shadow: none;
    filter:
        drop-shadow(0 1px 0 #8a6510)
        drop-shadow(0 2px 0 #6f510c)
        drop-shadow(0 3px 0 #574009)
        drop-shadow(0 12px 22px rgba(245, 217, 138, 0.25));
}
.counter-number {
    text-shadow:
        0 1px 0 color-mix(in srgb, var(--gold) 50%, #000),
        0 2px 0 color-mix(in srgb, var(--gold) 38%, #000),
        0 3px 0 color-mix(in srgb, var(--gold) 26%, #000),
        0 12px 24px rgba(0, 0, 0, 0.45);
}

/* --------------------------------------------------------------------------
   5. Perspective floor under the heroes
   -------------------------------------------------------------------------- */
.hero3d::after,
.service-hero::before {
    content: "";
    position: absolute;
    left: -50%;
    right: -50%;
    bottom: -2px;
    height: 52%;
    pointer-events: none;
    background-image:
        linear-gradient(color-mix(in srgb, var(--gold-light) 85%, transparent) 1.5px, transparent 1.5px),
        linear-gradient(90deg, color-mix(in srgb, var(--gold-light) 85%, transparent) 1.5px, transparent 1.5px);
    background-size: 72px 72px;
    background-position: 50% 0;
    transform: perspective(460px) rotateX(60deg);
    transform-origin: 50% 100%;
    -webkit-mask-image: linear-gradient(to top, #000 0%, rgba(0, 0, 0, 0.6) 35%, rgba(0, 0, 0, 0) 85%);
    mask-image: linear-gradient(to top, #000 0%, rgba(0, 0, 0, 0.6) 35%, rgba(0, 0, 0, 0) 85%);
}
.hero3d::after {
    z-index: 2;
    opacity: 0.42;
}
/* Above the hero's dark gradient (z-index 1), below its text (z-index 2, later in the DOM). */
.service-hero::before {
    z-index: 2;
    opacity: 0.32;
}
@media (min-width: 900px) and (prefers-reduced-motion: no-preference) {
    .hero3d::after,
    .service-hero::before {
        animation: d3-floor-move 7s linear infinite;
    }
}
@keyframes d3-floor-move {
    to { background-position: 50% 72px; }
}

/* --------------------------------------------------------------------------
   6. Stats as raised glass tiles (the stats band is always dark)
   -------------------------------------------------------------------------- */
.counter-item {
    padding: 1.6rem 1rem 1.4rem;
    border-radius: 22px;
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.015));
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        inset 0 -1px 0 rgba(0, 0, 0, 0.35),
        0 12px 22px -8px rgba(0, 0, 0, 0.5),
        0 30px 60px -24px rgba(0, 0, 0, 0.6);
    --d3-glare: rgba(255, 255, 255, 0.1);
}

/* --------------------------------------------------------------------------
   7. Small touches: logo tile, eyebrow badges, scrolled header
   -------------------------------------------------------------------------- */
.logo-icon {
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.5),
        inset 0 -3px 0 rgba(0, 0, 0, 0.16),
        0 8px 16px -6px color-mix(in srgb, var(--gold) 70%, transparent);
}
:is(.hero3d-eyebrow, .service-hero-badge) {
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        0 10px 24px -12px rgba(0, 0, 0, 0.6);
}
.header.scrolled {
    box-shadow:
        inset 0 -1px 0 color-mix(in srgb, var(--gold) 22%, transparent),
        0 14px 40px rgba(0, 0, 0, 0.35);
}

@media (prefers-reduced-motion: reduce) {
    :root .d3-tilting.d3-tilting {
        transform: none !important;
    }
}

/* Readability fix (was already there before the 3D layer): in the light theme the featured
   plan's title was near-white (#fff4cc) on a white card. */
html[data-theme="light"] .pricing-card.featured h3,
html:not([data-theme]) .pricing-card.featured h3 {
    color: #8b6914 !important;
}
