/* =====================================================================
   LIQUID GLASS — drop-in skin for the Gridx bento cards
   ---------------------------------------------------------------------
   Load AFTER style.css. Layout, spacing and markup are untouched; this
   file only re-skins the card primitive (.shadow-box) and the inner
   tiles that share its look.

   Layer model per card (back → front):
     element background ... tinted glass + vertical "thickness" gradient
     backdrop-filter ...... blur + saturate of the canvas behind it
     ::before ............. liquid reflections, light sweep, pointer specular
     children (z 2) ....... content (template already sets this)
     ::after (z 3) ........ masked gradient rim → neon ring on hover
   ===================================================================== */

/* ---------- 1. Tokens (tweak here, not below) ---------- */
:root {
    --lg-radius: 30px;

    /* Glass body */
    --lg-tint: 16, 19, 28;                 /* rgb of the glass tint      */
    --lg-tint-alpha: 0.52;                 /* lower = more see-through   */
    --lg-tint-alpha-hover: 0.6;
    --lg-blur: 18px;
    --lg-saturate: 160%;

    /* Neon accents (rgb triplets so we can vary alpha) */
    --lg-neon: 34, 211, 238;               /* cyan                       */
    --lg-neon-2: 91, 120, 246;             /* = template --primary_color */

    /* Motion */
    --lg-ease: cubic-bezier(.22, 1, .36, 1);
    --lg-dur: .55s;
    --lg-lift: -4px;
    --lg-scale: 1.012;                     /* keep ≤ 1.02 on a bento grid */

    /* Pointer specular (updated by liquid-glass.js; sane defaults) */
    --mx: 50%;
    --my: 0%;
}

/* Registered so they can animate/transition (Chromium, Safari 16.4+, Firefox 128+) */
@property --lg-spec {
    syntax: '<number>';
    initial-value: 0;
    inherits: true;
}
/* 0 = white rim only, 1 = full neon rim */
@property --lg-glow {
    syntax: '<number>';
    initial-value: 0;
    inherits: true;
}
/* Animatable angle for the rotating neon rim */
@property --lg-angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}

/* ---------- 2. Canvas — glass needs something to refract ---------- */
/* Without this, backdrop blur over a flat #0F0F0F does literally nothing. */
body {
    background: #07080c;
}
body::before {
    content: '';
    position: fixed;
    inset: -20vmax;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(38vmax 38vmax at 18% 22%, rgba(var(--lg-neon-2), .22), transparent 62%),
        radial-gradient(30vmax 30vmax at 82% 18%, rgba(var(--lg-neon), .14), transparent 60%),
        radial-gradient(42vmax 42vmax at 70% 85%, rgba(124, 58, 237, .14), transparent 62%),
        radial-gradient(26vmax 26vmax at 12% 88%, rgba(var(--lg-neon), .08), transparent 60%);
    animation: lg-drift 38s ease-in-out infinite alternate;
    will-change: transform;
}

/* ---------- 3. The card ---------- */
.shadow-box {
    border-radius: var(--lg-radius);
    isolation: isolate;                    /* keep pseudo layers inside the card */
    background:
        linear-gradient(180deg,
            rgba(255, 255, 255, .07) 0%,
            rgba(255, 255, 255, .02) 38%,
            rgba(255, 255, 255, 0) 62%,
            rgba(0, 0, 0, .14) 100%),
        rgba(var(--lg-tint), var(--lg-tint-alpha));
    -webkit-backdrop-filter: blur(var(--lg-blur)) saturate(var(--lg-saturate));
            backdrop-filter: blur(var(--lg-blur)) saturate(var(--lg-saturate));
    box-shadow:
        /* glass edge (inner) */
        inset 0 1px 0 0 rgba(255, 255, 255, .14),
        inset 0 -1px 0 0 rgba(255, 255, 255, .03),
        inset 0 0 0 1px rgba(255, 255, 255, .05),
        inset 0 -18px 32px -24px rgba(var(--lg-neon), .10),
        /* float (outer) */
        0 1px 1px rgba(0, 0, 0, .35),
        0 10px 24px -8px rgba(0, 0, 0, .55),
        0 34px 70px -28px rgba(0, 0, 0, .75);
    transform: translateZ(0);
    transition:
        transform var(--lg-dur) var(--lg-ease),
        box-shadow var(--lg-dur) var(--lg-ease),
        background-color var(--lg-dur) var(--lg-ease);
}

/* ::before — liquid reflections + sweep + pointer specular */
.shadow-box::before {
    content: '';
    position: absolute;
    inset: 0;
    width: auto;
    height: auto;
    z-index: 1;
    opacity: 1;
    pointer-events: none;
    border-radius: inherit;
    background:
        /* 1. pointer specular (fades in on hover) */
        radial-gradient(260px circle at var(--mx) var(--my),
            rgba(255, 255, 255, var(--lg-spec, 0)), transparent 70%),
        /* 2. light sweep band (parked off-canvas right) */
        linear-gradient(105deg,
            transparent 38%,
            rgba(255, 255, 255, .02) 44%,
            rgba(255, 255, 255, .13) 50%,
            rgba(var(--lg-neon), .06) 53%,
            transparent 60%),
        /* 3. curved top reflection — the "lens" of the liquid */
        radial-gradient(120% 70% at 50% -18%,
            rgba(255, 255, 255, .16), rgba(255, 255, 255, .03) 45%, transparent 62%),
        /* 4. left-edge refraction streak */
        linear-gradient(90deg,
            rgba(255, 255, 255, .06), transparent 9%),
        /* 5. bottom caustic glow */
        radial-gradient(90% 45% at 50% 118%,
            rgba(var(--lg-neon), .10), transparent 70%);
    background-size: 100% 100%, 260% 100%, 100% 100%, 100% 100%, 100% 100%;
    background-position: 0 0, 130% 0, 0 0, 0 0, 0 0;
    background-repeat: no-repeat;
    transition:
        background-position 1.1s var(--lg-ease),
        --lg-spec .4s ease;
}

/* ::after — masked rim: soft white at rest, rotating neon on hover */
.shadow-box::after {
    content: '';
    position: absolute;
    inset: 0;
    margin: 0;
    z-index: 3;
    pointer-events: none;
    border-radius: inherit;
    padding: 1px;
    background:
        conic-gradient(from var(--lg-angle) at 50% 50%,
            rgba(var(--lg-neon), 0) 0deg,
            rgba(var(--lg-neon), calc(.95 * var(--lg-glow))) 60deg,
            rgba(var(--lg-neon-2), calc(.9 * var(--lg-glow))) 120deg,
            rgba(var(--lg-neon-2), 0) 190deg,
            rgba(var(--lg-neon), 0) 360deg),
        linear-gradient(180deg,
            rgba(255, 255, 255, .28),
            rgba(255, 255, 255, .05) 35%,
            rgba(255, 255, 255, .03) 65%,
            rgba(255, 255, 255, .12));
    background-size: 100% 100%;
    -webkit-mask:
        linear-gradient(#000 0 0) content-box,
        linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
            mask-composite: exclude;
    opacity: .7;
    transition:
        opacity var(--lg-dur) var(--lg-ease),
        --lg-glow var(--lg-dur) var(--lg-ease);
}

/* ---------- 4. Hover / keyboard focus ---------- */
.shadow-box:hover,
.shadow-box:focus-within {
    --lg-spec: .10;
    --lg-glow: 1;
    transform: translateY(var(--lg-lift)) scale(var(--lg-scale));
    background-color: rgba(var(--lg-tint), var(--lg-tint-alpha-hover));
    box-shadow:
        inset 0 1px 0 0 rgba(255, 255, 255, .22),
        inset 0 -1px 0 0 rgba(var(--lg-neon), .12),
        inset 0 0 0 1px rgba(var(--lg-neon), .10),
        inset 0 -24px 40px -26px rgba(var(--lg-neon), .22),
        0 0 0 1px rgba(var(--lg-neon), .18),
        0 0 28px -4px rgba(var(--lg-neon), .28),
        0 0 64px -12px rgba(var(--lg-neon-2), .30),
        0 18px 40px -12px rgba(0, 0, 0, .6),
        0 50px 90px -30px rgba(0, 0, 0, .8);
}
.shadow-box:hover::before,
.shadow-box:focus-within::before {
    background-position: 0 0, -30% 0, 0 0, 0 0, 0 0;
}
.shadow-box:hover::after,
.shadow-box:focus-within::after {
    opacity: 1;
    animation: lg-spin 5s linear infinite;
}
/* Visible keyboard indicator — overlay links are invisible by design */
.shadow-box:has(.overlay-link:focus-visible) {
    outline: 2px solid rgba(var(--lg-neon), .9);
    outline-offset: 4px;
}

/* ---------- 5. Nested glass (glass inside glass) ---------- */
/* No second backdrop blur (costly + muddy), no independent lift. */
.shadow-box .shadow-box {
    -webkit-backdrop-filter: none;
            backdrop-filter: none;
    background: rgba(255, 255, 255, .035);
    box-shadow:
        inset 0 1px 0 0 rgba(255, 255, 255, .10),
        inset 0 0 0 1px rgba(255, 255, 255, .04);
}
.shadow-box .shadow-box:hover,
.shadow-box .shadow-box:focus-within {
    transform: none;
}
/* Template set these to fixed opacities; reset so the rim behaves */
.info-box .inner-profile-icons.shadow-box::before { opacity: .6; }
.info-box .inner-profile-icons.shadow-box::after  { opacity: .5; }
.info-box .inner-profile-icons.shadow-box:hover::after { opacity: .9; }

/* ---------- 6. Small glass controls (icon tiles, social, CTA) ---------- */
.contact-area .contact-infos .contact-details li .icon-box,
.contact-area .social-links li a {
    -webkit-backdrop-filter: blur(10px) saturate(140%);
            backdrop-filter: blur(10px) saturate(140%);
}
.contact-area .social-links li a:hover,
.project-details-wrap .big-btn:hover {
    /* was solid white; keep it glass but clearly "on" */
    background:
        linear-gradient(180deg, rgba(var(--lg-neon), .18), rgba(var(--lg-neon-2), .10)),
        rgba(var(--lg-tint), .6);
    color: #fff;
    text-shadow: 0 0 18px rgba(var(--lg-neon), .7);
}

/* ---------- 7. Inner tiles that mimic the card (client stats, services…) */
.info-box.about-client-box .clients .client-item,
.service-area .service-content-wrap .service-content-inner .service-item,
.project-details-wrap .project-infos-wrap .project-details-info,
.project-details-wrap .project-about-2 .left-details {
    border-radius: 24px;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .10),
        inset 0 0 0 1px rgba(255, 255, 255, .045);
    transition: box-shadow .4s var(--lg-ease), background-color .4s var(--lg-ease);
}
.info-box.about-client-box .clients .client-item:hover,
.service-area .service-content-wrap .service-content-inner .service-item:hover {
    background-color: rgba(var(--lg-neon), .04);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .16),
        inset 0 0 0 1px rgba(var(--lg-neon), .25),
        0 0 22px -6px rgba(var(--lg-neon), .35);
}

/* Inputs inside glass forms */
.contact-area .contact-form form .input-group textarea,
.contact-area .contact-form form .input-group input,
.blog-details-area .comments-and-form-wrap .comment-form form .input-group textarea,
.blog-details-area .comments-and-form-wrap .comment-form form .input-group input {
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06);
    transition: box-shadow .3s ease;
}
.contact-area .contact-form form .input-group textarea:focus,
.contact-area .contact-form form .input-group input:focus,
.blog-details-area .comments-and-form-wrap .comment-form form .input-group textarea:focus,
.blog-details-area .comments-and-form-wrap .comment-form form .input-group input:focus {
    box-shadow:
        inset 0 0 0 1px rgba(var(--lg-neon), .55),
        0 0 0 4px rgba(var(--lg-neon), .12);
}

/* ---------- 8. Keyframes ---------- */
@keyframes lg-spin {
    to { --lg-angle: 360deg; }
}
@keyframes lg-drift {
    0%   { transform: translate3d(0, 0, 0) rotate(0deg); }
    50%  { transform: translate3d(3vmax, -2vmax, 0) rotate(8deg); }
    100% { transform: translate3d(-2vmax, 2vmax, 0) rotate(-6deg); }
}

/* ---------- 9. Fallbacks & preferences ---------- */
/* No backdrop-filter support → make the glass more opaque so text stays legible */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .shadow-box { background-color: rgba(var(--lg-tint), .88); }
}

/* Touch devices: no hover-lift (sticky :hover after tap looks broken) */
@media (hover: none) {
    .shadow-box:hover { transform: none; }
}

/* Phones: cheaper blur — fixed canvas + many blurred cards = scroll jank */
@media (max-width: 767px) {
    :root { --lg-blur: 10px; --lg-saturate: 140%; }
    body::before { animation: none; }
}

@media (prefers-reduced-motion: reduce) {
    body::before { animation: none; }
    .shadow-box,
    .shadow-box::before,
    .shadow-box::after { transition: none; }
    .shadow-box:hover,
    .shadow-box:focus-within { transform: none; }
    .shadow-box:hover::after,
    .shadow-box:focus-within::after { animation: none; }
}

@media (prefers-reduced-transparency: reduce) {
    .shadow-box {
        -webkit-backdrop-filter: none;
                backdrop-filter: none;
        background-color: rgb(var(--lg-tint));
    }
}
