/* --- Global & Typography Base --- */
:root {
    --apple-radius: 22px;
    --apple-radius-mobile: 18px;
    --bg-modern: #87CEEB; /* Changed to requested Sky Blue background */
    --card-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
    --card-shadow-hover: 0 12px 24px rgba(0, 0, 0, 0.18);
    --transition-smooth: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

body.bg-light-modern {
    /* Fallback for older browsers */
    background-color: #D3B9FF; 
    
    /* Modern diagonal gradient: Sky Blue to Soft Icy Blue */
    background: linear-gradient(135deg, #87CEEB 0%, #76D7FF 100%);
    
    /* Keeps the gradient fixed so it doesn't break when scrolling */
    background-attachment: fixed; 
    
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    color: #656565;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: hidden;
}

/* --- Animations --- */
@keyframes fadeDown {
    from { opacity: 0; transform: translateY(-15px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- Header & Logo Styling --- */
.sticky-header {
    position: sticky;
    top: 0;
    z-index: 1020;
    background-color: #87CEEB; 
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    
    /* Increased header height to comfortably fit the larger desktop logo */
    height: 100px; 
    border-bottom: none; 
    -webkit-mask-image: linear-gradient(to bottom, black 90%, transparent 100%);
    mask-image: linear-gradient(to bottom, black 90%, transparent 100%);
}

.brand-logo {
    /* Increased significantly from 54px for desktop */
    height: 75px; 
    width: auto;
    object-fit: contain;
    transition: var(--transition-smooth);
}

.logo-container {
    animation: fadeDown 0.6s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
}

/* --- Search Input Styling --- */
.search-wrapper {
    position: relative;
    animation: fadeUp 0.5s ease-out 0.1s both;
}

.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #86868b;
    font-size: 1.1rem;
    pointer-events: none;
    transition: var(--transition-smooth);
}

.search-input {
    height: 48px;
    padding-left: 48px;
    padding-right: 20px;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    background-color: rgba(255, 255, 255, 0.9);
    font-size: 1rem;
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: var(--transition-smooth);
}

.search-input:focus {
    border-color: #ffffff;
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.45);
    background-color: #ffffff;
    transform: scale(1.015);
}

/* --- Apple App Icon Grid & Strict Uniform Tiles --- */
#servicesGrid {
    animation: fadeUp 0.6s cubic-bezier(0.25, 0.8, 0.25, 1) 0.2s both;
}

/* Base link wrapper layout centering everything */
.tile-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    background: transparent;
    border: none;
    padding: 8px;
    transition: var(--transition-smooth);
    -webkit-tap-highlight-color: transparent;
    width: 100%; /* Spans full grid cell layout width safely */
}

/* The structural "Squircle" container: Explicitly sized to keep all sizes identical */
.apple-app-icon {
    position: relative;
    width: 100px;  /* Locked desktop width */
    height: 100px; /* Locked desktop height */
    border-radius: var(--apple-radius);
    background: #ffffff !important; /* Forces every tile background to pure white */
    box-shadow: var(--card-shadow);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    transition: var(--transition-smooth);
    border: 1px solid rgba(255, 255, 255, 0.8);
}

/* Premium OS glare gloss effect overlay */
.apple-app-icon::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(circle at 50% 0%, rgba(255,255,255,0.4), transparent 60%);
    pointer-events: none;
}

/* Unified Icon Font/Glyph properties across all items */
.apple-app-icon i {
    font-size: 2.4rem !important; 
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: var(--transition-smooth);
}

/* Vibrant Icon Colors */
.icon-blue   { color: #0071e3; }
.icon-orange { color: #ff9500; }
.icon-green  { color: #28a745; }
.icon-purple { color: #af52de; }
.icon-pink   { color: #ff2d55; }
.icon-teal   { color: #00b894; }
.icon-yellow { color: #f5b041; }

/* Service Label Typography */
.tile-label {
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 0.85rem;

    color: #FFFFFF; /* Matches requested hex value */
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
    max-width: 100px;
    min-height: 2.6em; /* Reserves identical vertical baseline alignment */
}

/* --- Interactive Hover Rules (Desktop Only) --- */
@media (hover: hover) {
    .tile-wrapper:hover .apple-app-icon {
        transform: translateY(-6px) scale(1.04);
        box-shadow: var(--card-shadow-hover);
    }
    .tile-wrapper:hover .tile-label {
        color: #ffffff; /* Label contrasts beautifully against blue background when hovered */
    }
}

/* --- Mobile Tactile Native Tap Animation --- */
.tile-wrapper:active .apple-app-icon {
    transform: scale(0.92);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.1s cubic-bezier(0.25, 1, 0.5, 1);
}

/* --- Mobile Responsiveness Adjustments --- */
@media (max-width: 576px) {
    :root {
        --apple-radius: var(--apple-radius-mobile);
    }

    .brand-logo {
        height: 72px; 
    }
    
    /* Ensure smaller uniform sizes on mobile viewports */
    .apple-app-icon {
        width: 82px;
        height: 82px;
    }
    
    .apple-app-icon i {
        font-size: 2.0rem !important;
    }
    
    .tile-label {
        font-size: 0.78rem;
        max-width: 82px;
    }
    
    .row-cols-3 > * {
        flex: 0 0 33.333333%;
        max-width: 33.333333%;
    }
}

/* --- Footer Transitions --- */
footer {
    background-color: rgba(255, 255, 255, 0.9) !important;
}
.footer-links a {
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    transition: color 0.2s ease;
}
.footer-links a:hover {
    color: #87CEEB !important;
}