/* Reset & Base */
:root {
    /* Dark Mode Palette - Apple Inspired */
    --bg-color: #000000;         /* Pure Black */
    --bg-secondary: #1c1c1e;     /* Dark Gray (Cards/Sections) */
    --bg-tertiary: #2c2c2e;      /* Slightly lighter for inputs/hovers */
    
    --text-primary: #f5f5f7;     /* Off-white */
    --text-secondary: #86868b;   /* Muted Gray */
    
    --accent-color: #2997ff;     /* Apple Blue (Light Mode is usually #0066cc, Dark is lighter) */
    --accent-hover: #0077ED;
    
    --border-color: #38383a;     /* Dark Border */
    
    --navbar-bg: rgba(28, 28, 30, 0.85); /* Translucent Dark */
    
    --navbar-height: 48px;
    --max-width: 980px;
    
    /* Animation Variables */
    --ease-apple: cubic-bezier(0.25, 0.1, 0.25, 1);
    --ease-cinematic: cubic-bezier(0.4, 0.0, 0.2, 1); /* Cinematic Motion */
    --ease-ps5: cubic-bezier(0.3, 0.0, 0.3, 1);
    --transition-speed: 0.6s; /* Slower for elegance */
    
    /* Glassmorphism System */
    --glass-bg: rgba(28, 28, 30, 0.65);
    --glass-border: 1px solid rgba(255, 255, 255, 0.08);
    
    /* Shadows for depth in dark mode */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px rgba(41, 151, 255, 0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.5;
    font-size: 17px;
    font-weight: 400;
    overflow-x: hidden;
    
    /* Page Entrance Animation */
    opacity: 0;
    animation: pageFadeIn 0.8s var(--ease-cinematic) forwards;
}

@keyframes pageFadeIn {
    from { opacity: 0; transform: scale(0.98); }
    to { opacity: 1; transform: scale(1); }
}

a {
    text-decoration: none;
    color: inherit;
    transition: color var(--transition-speed) var(--ease-apple);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.1;
    margin-bottom: 0.5em;
    color: var(--text-primary);
}

h1 { font-size: 48px; }
h2 { font-size: 40px; }
h3 { font-size: 28px; }

p {
    margin-bottom: 1.5em;
    color: var(--text-secondary);
}

/* Layout */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
}

section {
    padding: 100px 0;
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--navbar-height);
    background: var(--navbar-bg);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    z-index: 9999;
    border-bottom: 1px solid rgba(255,255,255,0.05); /* Ultra subtle */
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: var(--max-width);
    padding: 0 20px;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.logo img {
    height: 26px;
    width: auto;
    display: block;
    filter: drop-shadow(0 2px 6px rgba(0,0,0,0.4));
}

.nav-links {
    display: flex;
    gap: 30px;
}

.nav-links a {
    font-size: 12px;
    color: #d1d1d6; 
    opacity: 0.8;
    position: relative;
    transition: all 0.3s var(--ease-cinematic);
}

.nav-links a:hover {
    opacity: 1;
    color: var(--accent-color);
    text-shadow: 0 0 10px rgba(41, 151, 255, 0.4); /* Glow text */
}

.nav-links a:active,
.nav-links a:focus-visible {
    opacity: 1;
    color: var(--accent-color);
}

.nav-links a.active {
    opacity: 1;
    color: var(--accent-color);
    text-shadow: 0 0 10px rgba(41, 151, 255, 0.4);
}

.nav-links a[aria-current="page"] {
    opacity: 1;
    color: var(--accent-color);
    text-shadow: 0 0 10px rgba(41, 151, 255, 0.4);
}

/* Underline slide effect for nav links */
.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 1px;
    bottom: -4px;
    left: 0;
    background-color: var(--accent-color);
    transition: width 0.3s var(--ease-cinematic);
}

.nav-links a:hover::after {
    width: 100%;
}

.nav-links a.active::after {
    width: 100%;
}

.nav-links a[aria-current="page"]::after {
    width: 100%;
}

.auth-btn {
    font-size: 12px;
    background: var(--text-primary);
    color: var(--bg-color) !important;
    padding: 4px 12px;
    border-radius: 12px;
    opacity: 1 !important;
    font-weight: 500;
    transition: all 0.3s var(--ease-ps5);
}

.auth-btn:hover {
    background: var(--accent-color);
    color: white !important;
    box-shadow: 0 0 15px rgba(41, 151, 255, 0.5);
    transform: scale(1.05);
}

/* Hero Section */
.hero {
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding-top: var(--navbar-height);
    background: radial-gradient(circle at 50% 30%, #1c1c1e 0%, #000000 70%);
    position: relative;
    overflow: hidden;
}

.hero h1 {
    font-size: 56px;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.hero p {
    font-size: 24px;
    max-width: 600px;
    margin: 0 auto 30px;
    color: var(--text-secondary);
}
.hero-logo {
    height: 64px;
    margin: 10px auto 20px;
    display: block;
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.5));
    opacity: 0.95;
}
.logo-fallback {
    text-align: center;
    font-weight: 600;
    color: var(--text-primary);
    opacity: 0.9;
    margin: 10px auto 20px;
}

.hero::before {
    content: '';
    position: absolute;
    inset: -20%;
    background: radial-gradient(1200px 800px at calc(50% + var(--bgX, 0px)) calc(30% + var(--bgY, 0px)), rgba(41,151,255,0.12), rgba(0,0,0,0) 60%);
    filter: blur(30px);
    pointer-events: none;
}

.tilt {
    transform-style: preserve-3d;
    will-change: transform;
    transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateZ(0) scale(var(--scale, 1));
    transition: transform 0.2s var(--ease-cinematic);
}

.btn {
    display: inline-block;
    background-color: var(--accent-color);
    color: white;
    padding: 12px 24px;
    border-radius: 20px;
    font-size: 17px;
    font-weight: 500;
    transition: all 0.4s var(--ease-cinematic);
    border: none;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    will-change: transform, box-shadow, filter, opacity;
}

.btn:hover {
    transform: translateY(-1px) scale(1.03);
    box-shadow: 0 0 20px rgba(41, 151, 255, 0.25);
}

.btn:active {
    transform: scale(0.98);
    filter: brightness(0.95);
}

.btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px rgba(41, 151, 255, 0.6);
}

.btn.appear {
    animation: btnReveal 0.6s var(--ease-cinematic) both;
}

@keyframes btnReveal {
    from { opacity: 0; transform: translateY(10px) scale(0.98); filter: blur(4px); }
    to { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}

.btn-secondary {
    background-color: transparent;
    color: var(--accent-color);
    border: 1px solid rgba(255,255,255,0.1);
    margin-left: 10px;
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: var(--accent-color);
    box-shadow: 0 0 15px rgba(41, 151, 255, 0.2);
}

.btn-cta {
    will-change: box-shadow, transform, filter, opacity;
    animation: ctaReveal 0.9s var(--ease-cinematic) 0.2s both, ctaPulse 2.6s var(--ease-cinematic) 1.2s infinite, ctaFloat 6s var(--ease-cinematic) 0s infinite alternate;
    position: relative;
}

.btn-cta:hover {
    transform: translateY(-1px) scale(1.045);
    box-shadow: 0 0 24px rgba(41, 151, 255, 0.35);
}

.btn-cta:active {
    transform: scale(0.98);
    filter: brightness(0.95);
}

@keyframes ctaReveal {
    from { opacity: 0; transform: translateY(12px) scale(0.98); filter: blur(6px); }
    to { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}

@keyframes ctaPulse {
    0%, 100% { box-shadow: 0 0 0 rgba(41, 151, 255, 0); }
    50% { box-shadow: 0 0 32px rgba(41, 151, 255, 0.55); }
}

@keyframes ctaFloat {
    0% { transform: translateY(0) translateX(0); }
    50% { transform: translateY(-2.5px) translateX(2px); }
    100% { transform: translateY(0) translateX(0); }
}

.btn-cta::before {
    content: '';
    position: absolute;
    top: 0;
    left: -35%;
    width: 35%;
    height: 100%;
    pointer-events: none;
    background: linear-gradient(120deg, rgba(255,255,255,0), rgba(255,255,255,0.18), rgba(255,255,255,0));
    transform: skewX(-25deg);
    opacity: 0;
    animation: ctaGlint 2.8s var(--ease-cinematic) 1.2s infinite;
}

@keyframes ctaGlint {
    0% { left: -35%; opacity: 0; }
    15% { opacity: 0.8; }
    50% { left: 110%; opacity: 0; }
    100% { left: 110%; opacity: 0; }
}

@keyframes ripple {
    from { transform: translate(-50%, -50%) scale(0); opacity: 0.6; }
    to { transform: translate(-50%, -50%) scale(1); opacity: 0; }
}

.btn .ripple, .btn-cta .ripple {
    position: absolute;
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    pointer-events: none;
    background: rgba(41, 151, 255, 0.35);
    animation: ripple 600ms var(--ease-cinematic);
}

/* Cards (Services, Differentials) */
.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 40px;
    margin-top: 40px;
}
.card .thumb {
    width: 100%;
    height: 100px;
    aspect-ratio: auto;
    object-fit: contain;
    border-radius: 16px;
    margin-bottom: 16px;
    background: #1a1a1a;
}
.card .thumb-contain {
    object-fit: contain;
    background: #000000;
}

.card {
    background: var(--bg-secondary);
    padding: 40px;
    border-radius: 20px;
    text-align: left;
    transition: all 0.5s var(--ease-ps5);
    border: 1px solid rgba(255,255,255,0.03);
    position: relative;
    overflow: hidden;
    transform-style: preserve-3d;
    perspective: 800px;
}

/* PS5 Style: Glass/Glow Hover Effect */
.card:hover {
    transform: translateY(-8px) scale(1.01);
    box-shadow: var(--shadow-md), var(--shadow-glow);
    background: #252527;
    border-color: rgba(41, 151, 255, 0.3);
}

.card h3 {
    font-size: 24px;
    margin-bottom: 15px;
    color: var(--text-primary);
        transition: color 0.3s ease;
    }

    .card:hover h3 {
        color: var(--accent-color);
}

.icon {
    display: inline-block;
    width: 22px;
    height: 22px;
    margin-right: 8px;
    vertical-align: -4px;
    fill: currentColor;
    color: var(--accent-color);
    opacity: 0.9;
}

.card p {
    color: var(--text-secondary);
}
.card a.card-link {
    display: block;
    color: inherit;
    position: relative;
    overflow: hidden;
}

/* Forms */
.form-container {
    max-width: 400px;
    margin: 100px auto;
    padding: 40px;
    background: var(--bg-secondary);
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.05);
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.3s ease;
}

.form-container:hover {
    box-shadow: var(--shadow-glow);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-group input, .form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    background: rgba(0,0,0,0.3); 
    color: var(--text-primary);
    transition: all 0.3s var(--ease-cinematic);
}

.form-group input:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 15px rgba(41, 151, 255, 0.2);
    transform: scale(1.01);
}

/* Animations - Hybrid Apple + PS5 */

/* Base Fade Class - Progressive Enhancement & Continuous Render */
.fade-in {
    opacity: 1;
    transform: none;
    transition: opacity 1s var(--ease-cinematic), 
                transform 1s var(--ease-cinematic), 
                filter 1s var(--ease-cinematic);
    will-change: opacity, transform, filter;
}

/* Only hide if JS is loaded and running */
body.js-loaded .fade-in {
    opacity: 0;
    transform: translateY(40px) scale(0.98); /* Minimal slide */
    filter: blur(12px); /* Glass-like blur start */
}

body.js-loaded .fade-in.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
    /* No animation property needed, transition handles it bi-directionally */
}

/* Removed @keyframes revealCinematic as we use transitions now for bi-directional support */

/* Stagger delays */
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }

/* Footer */
footer {
    background: var(--bg-secondary);
    padding: 60px 0 20px;
    margin-top: 100px;
    font-size: 12px;
    color: var(--text-secondary);
    border-top: 1px solid rgba(255,255,255,0.05);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    padding-bottom: 20px;
    margin-bottom: 20px;
}

.footer-col h4 {
    color: var(--text-primary);
    margin-bottom: 10px;
}

.footer-col ul li {
    margin-bottom: 8px;
}

.footer-col ul li a {
    color: var(--text-secondary);
    transition: color 0.3s ease;
}
.footer-col ul li a:hover {
    color: var(--text-primary);
    text-decoration: underline;
}

/* Utilities */
.text-center { text-align: center; }
.mt-5 { margin-top: 50px; }
.mb-5 { margin-bottom: 50px; }

/* Mobile Menu Icon */
.mobile-menu-icon {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 24px;
    height: 18px;
    cursor: pointer;
    z-index: 10001;
}

.mobile-menu-icon span {
    width: 100%;
    height: 2px;
    background-color: var(--text-primary);
    transition: all 0.3s var(--ease-cinematic);
    border-radius: 2px;
}

/* Hamburger Animation (X shape) */
.mobile-menu-icon.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 6px);
}
.mobile-menu-icon.active span:nth-child(2) {
    opacity: 0;
}
.mobile-menu-icon.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -6px);
}

/* Mobile */
@media (max-width: 768px) {
    h1 { font-size: 40px; }
    h2 { font-size: 32px; }
    .hero-logo { height: 48px; }
    
    .mobile-menu-icon {
        display: flex;
    }

    .nav-links { 
        display: flex; 
        flex-direction: column;
        position: fixed;
        top: 0;
        right: -100%; /* Hidden by default */
        width: 70%;
        height: 100vh;
        background: rgba(28, 28, 30, 0.95); /* Deep Dark Glass */
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        padding: 80px 40px;
        gap: 30px;
        transition: right 0.5s var(--ease-cinematic);
        box-shadow: -10px 0 30px rgba(0,0,0,0.5);
        z-index: 10000;
        align-items: flex-start;
    }

    .nav-links.active {
        right: 0;
    }

    .nav-links li {
        width: 100%;
        opacity: 0;
        transform: translateX(20px);
        transition: all 0.5s var(--ease-cinematic);
    }

    /* Staggered animation for menu items */
    .nav-links.active li {
        opacity: 1;
        transform: translateX(0);
    }
    .nav-links.active li:nth-child(1) { transition-delay: 0.1s; }
    .nav-links.active li:nth-child(2) { transition-delay: 0.2s; }
    .nav-links.active li:nth-child(3) { transition-delay: 0.3s; }
    .nav-links.active li:nth-child(4) { transition-delay: 0.4s; }
    .nav-links.active li:nth-child(5) { transition-delay: 0.5s; }
    .nav-links.active li:nth-child(6) { transition-delay: 0.6s; }

    .nav-links a {
        font-size: 18px;
        color: var(--text-primary);
        font-weight: 500;
    }
    
    .nav-links a:hover {
        color: var(--accent-color);
    }
}
