/* Responsive base – prevent mobile zoom and overflow */
html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    overflow-x: hidden;
}

body {
    font-family: 'Inter', sans-serif;
    min-width: 0;
    max-width: 100vw;
    overflow-x: hidden;
    position: relative;
}

/* Prevent iOS zoom on input focus (font-size >= 16px on mobile) */
@media (max-width: 767px) {
    input, textarea, select {
        font-size: 16px;
    }
}

/* Selection and focus polish */
::selection {
    background: rgba(111, 163, 166, 0.25);
    color: #1a222d;
}

/* Consistent link/button focus (visible for keyboard) */
a:focus-visible,
button:focus-visible {
    outline: 2px solid #6FA3A6;
    outline-offset: 2px;
}

/* Prevent horizontal overflow */
img, video, iframe {
    max-width: 100%;
    height: auto;
}

/* Safe area for notched devices (nav + floating button) */
#navbar {
    padding-left: env(safe-area-inset-left, 0);
    padding-right: env(safe-area-inset-right, 0);
    padding-top: env(safe-area-inset-top, 0);
}
/* Topbar: prevent overflow, consistent height when scrolled */
.nav-topbar {
    overflow: hidden;
}
#navbar.scrolled {
    box-shadow: 0 1px 12px rgba(0,0,0,0.06);
}
#whatsapp-float {
    bottom: max(1.25rem, env(safe-area-inset-bottom));
    right: max(1.25rem, env(safe-area-inset-right));
}

/* Bottom nav (mobile): linodev – active state with accent teal */
.bottom-nav-item {
    position: relative;
}
.bottom-nav-item .bottom-nav-underline {
    display: block;
    width: 24px;
    height: 3px;
    border-radius: 2px;
    background: transparent;
    transition: background 0.2s ease, color 0.2s ease;
}
.bottom-nav-item.active {
    color: #6FA3A6;
}
.bottom-nav-item.active .bottom-nav-underline {
    background: #6FA3A6;
}
.bottom-nav-item:active {
    opacity: 0.85;
}

/* Space for fixed bottom nav on mobile */
@media (max-width: 767px) {
    body {
        padding-bottom: 5.5rem;
    }
    #whatsapp-float {
        bottom: calc(5rem + env(safe-area-inset-bottom, 0px));
    }
}

/* Anchor scroll offset (small on mobile – no top nav; larger on desktop for fixed nav) */
[id] {
    scroll-margin-top: 1.5rem;
}

@media (min-width: 768px) {
    [id] {
        scroll-margin-top: 6rem;
    }
}

.glass-nav {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(62, 76, 94, 0.1);
}

.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Testimonial cards: subtle hover */
.testimonial-card {
    transition: box-shadow 0.2s ease;
}
.testimonial-card:hover {
    box-shadow: 0 10px 40px -10px rgba(62, 76, 94, 0.12);
}

/* Form inputs placeholder */
input::placeholder,
textarea::placeholder {
    color: #5C6F82;
    opacity: 0.8;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #E6E6E6;
}

::-webkit-scrollbar-thumb {
    background: #5C6F82;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #6FA3A6;
}

/* ——— 3D design elements ——— */
.scene-3d {
    perspective: 1200px;
    transform-style: preserve-3d;
}

.card-3d {
    transform-style: preserve-3d;
    transition: transform 0.4s ease-out;
}

/* 3D tilt on hover (service/portfolio cards) */
.card-3d-tilt:hover {
    transform: rotateX(5deg) rotateY(5deg) translateZ(12px);
}

/* Floating 3D shape in hero */
.shape-3d {
    transform-style: preserve-3d;
    animation: float-3d 8s ease-in-out infinite;
}

.shape-3d-inner {
    transform: rotateX(15deg) rotateY(25deg);
    border-radius: 24px;
    background: linear-gradient(135deg, rgba(111, 163, 166, 0.25) 0%, rgba(62, 76, 94, 0.2) 100%);
    box-shadow: 
        0 25px 50px -12px rgba(62, 76, 94, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

@keyframes float-3d {
    0%, 100% { transform: translateY(0) rotateY(0deg); }
    50% { transform: translateY(-20px) rotateY(10deg); }
}

/* 3D rotating cube (decorative) */
.cube-3d {
    width: 120px;
    height: 120px;
    position: relative;
    transform-style: preserve-3d;
    animation: spin-3d 20s linear infinite;
}

.cube-3d .face {
    position: absolute;
    width: 120px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.9);
    backface-visibility: visible;
    border: 2px solid rgba(111, 163, 166, 0.4);
    background: linear-gradient(145deg, rgba(62, 76, 94, 0.9), rgba(111, 163, 166, 0.3));
}

.cube-3d .face-front  { transform: translateZ(60px); }
.cube-3d .face-back   { transform: rotateY(180deg) translateZ(60px); }
.cube-3d .face-right  { transform: rotateY(90deg) translateZ(60px); }
.cube-3d .face-left   { transform: rotateY(-90deg) translateZ(60px); }
.cube-3d .face-top    { transform: rotateX(90deg) translateZ(60px); }
.cube-3d .face-bottom { transform: rotateX(-90deg) translateZ(60px); }

@keyframes spin-3d {
    from { transform: rotateX(-18deg) rotateY(0deg); }
    to   { transform: rotateX(-18deg) rotateY(360deg); }
}

/* 3D layered cards (stack effect) */
.stack-3d {
    perspective: 800px;
}

.stack-3d .stack-item {
    transform-style: preserve-3d;
    transition: transform 0.5s ease;
}

.stack-3d .stack-item:nth-child(1) { transform: translateZ(-20px) scale(0.95); }
.stack-3d .stack-item:nth-child(2) { transform: translateZ(0); }
.stack-3d .stack-item:nth-child(3) { transform: translateZ(20px) scale(1.05); }

.stack-3d:hover .stack-item:nth-child(1) { transform: translateZ(-30px) rotateY(-5deg) scale(0.92); }
.stack-3d:hover .stack-item:nth-child(2) { transform: translateZ(10px) rotateY(0deg) scale(1); }
.stack-3d:hover .stack-item:nth-child(3) { transform: translateZ(40px) rotateY(5deg) scale(1.08); }

@media (prefers-reduced-motion: reduce) {
    .shape-3d,
    .cube-3d {
        animation: none;
    }
    .card-3d-tilt:hover {
        transform: none;
    }
}

