/* Apple Design System - Dynamic Theme */
:root {
    /* Base Variables (Default Dark Mode) */
    --bg-color: #000000;
    --nav-bg: rgba(29, 29, 31, 0.72);
    /* Official Apple Nav Dark */
    --card-bg: #161617;
    --card-bg-hover: #1d1d1f;
    --text-primary: #f5f5f7;
    --text-secondary: #86868b;
    --link-blue: #2997ff;
    --border-color: rgba(255, 255, 255, 0.08);
    /* Dark subtle border */
    --footer-bg: #1d1d1f;
    --icon-bg: #2a2a2c;
    --icon-border: rgba(255, 255, 255, 0.08);
    --nav-border: rgba(255, 255, 255, 0.12);

    --max-width: 1080px;
    /* Slightly wider for 3 columns */
    --card-radius: 20px;
    /* Slightly smaller radius for denser grid */
    --icon-radius: 22.37%;
    --transition: cubic-bezier(0.4, 0, 0.2, 1);
    /* Apple-like ease */
}

/* Light Mode Overrides */
[data-theme="light"] {
    --bg-color: #f5f5f7;
    --nav-bg: rgba(251, 251, 253, 0.72);
    /* Official Apple Nav Light */
    --card-bg: #ffffff;
    --card-bg-hover: #ffffff;
    /* Light mode hover often uses shadow/scale rather than color change */
    --text-primary: #1d1d1f;
    --text-secondary: #86868b;
    --link-blue: #0066cc;
    --border-color: rgba(0, 0, 0, 0.05);
    /* Very subtle in light */
    --footer-bg: #ffffff;
    --icon-bg: #f5f5f7;
    --icon-border: rgba(0, 0, 0, 0.05);
    --nav-border: rgba(210, 210, 215, 0.3);
    /* Subtle separator */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 48px;
    /* Height of nav */
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: "SF Pro Display", "SF Pro Icons", "Helvetica Neue", "Helvetica", "Arial", sans-serif;
    line-height: 1.4;
    overflow-x: hidden;
    transition: background-color 0.4s ease, color 0.4s ease;
}

/* Mouse Glow Effect */
.mouse-glow {
    position: fixed;
    top: 0;
    left: 0;
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, rgba(0, 102, 204, 0.25) 0%, rgba(0, 102, 204, 0) 70%);
    pointer-events: none;
    z-index: 0;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 1s ease;
    mix-blend-mode: screen;
}

[data-theme="light"] .mouse-glow {
    background: radial-gradient(circle, rgba(0, 102, 204, 0.15) 0%, rgba(0, 102, 204, 0) 70%);
    mix-blend-mode: multiply;
}

body:hover .mouse-glow {
    opacity: 1;
}


a {
    text-decoration: none;
    color: inherit;
    -webkit-tap-highlight-color: transparent;
}

/* Navigation - Apple Official Style */
nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 48px;
    background: var(--nav-bg);
    backdrop-filter: saturate(180%) blur(20px);
    /* The Apple Magic Formula */
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    z-index: 9999;
    display: flex;
    justify-content: center;
    border-bottom: 1px solid transparent;
    /* Often handled by background color, but can add variable */
    transition: background-color 0.4s ease;
}

.nav-content {
    max-width: var(--max-width);
    width: 100%;
    padding: 0 22px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.nav-logo {
    font-size: 19px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 4px;
    opacity: 0.9;
    transition: opacity 0.2s;
}

.nav-logo:hover {
    opacity: 1;
}

/* Nav Links */
.nav-left {
    display: flex;
    align-items: center;
    gap: 40px;
}

.nav-links {
    display: flex;
    gap: 24px;
}

.nav-links a {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: color 0.2s ease;
    letter-spacing: -0.01em;
}

.nav-links a:hover {
    color: var(--text-primary);
}

/* Nav Right Actions */
.nav-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.lang-selector {
    position: relative;
}

.lang-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-primary);
    padding: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.lang-btn:hover {
    opacity: 1;
}

.lang-btn svg {
    width: 20px;
    height: 20px;
}

.lang-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: var(--nav-bg);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 8px;
    min-width: 140px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    display: none;
    flex-direction: column;
    z-index: 10000;
}

.lang-dropdown.show {
    display: flex;
}

.lang-dropdown button {
    background: transparent;
    border: none;
    padding: 8px 12px;
    text-align: left;
    color: var(--text-primary);
    font-size: 13px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}

.lang-dropdown button:hover {
    background: rgba(255, 255, 255, 0.1);
}

[data-theme="light"] .lang-dropdown button:hover {
    background: rgba(0, 0, 0, 0.05);
}

/* Theme Toggle Button */
.theme-toggle {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-primary);
    padding: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.theme-toggle:hover {
    opacity: 1;
}

.theme-toggle svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

/* Main Container */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 22px;
}

/* Hero Section */
.hero {
    padding-top: 180px;
    padding-bottom: 110px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    /* Entry animation logic handled by JS class toggling or simple keyframes */
    animation: fadeUpHero 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes fadeUpHero {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero h1 {
    font-size: 80px;
    line-height: 1.05;
    font-weight: 700;
    letter-spacing: -0.005em;
    margin-bottom: 14px;
    color: var(--text-primary);
}

.hero p {
    font-size: 24px;
    line-height: 1.35;
    font-weight: 400;
    color: var(--text-secondary);
    max-width: 660px;
    margin-bottom: 30px;
}

.hero-cta {
    font-size: 17px;
    color: var(--link-blue);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s;
}

.hero-cta:hover {
    text-decoration: underline;
    gap: 6px;
}

.hero-cta::after {
    content: '›';
    font-size: 18px;
    font-weight: 600;
    margin-top: -2px;
}

/* 3-Column Grid System */
.grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    /* The requested 3 columns */
    gap: 24px;
    padding-bottom: 120px;
}

/* Card Design - Uniform for 3-Col */
.card {
    background-color: var(--card-bg);
    border-radius: var(--card-radius);
    overflow: hidden;
    position: relative;
    padding: 40px 32px;
    height: 480px;
    /* Fixed height for uniformity */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    text-align: center;
    cursor: pointer;
    box-shadow: 0 0 0 0 transparent;
    /* Initial state */

    /* Animation Properties */
    transition: transform 0.4s var(--transition), box-shadow 0.4s var(--transition), background-color 0.4s ease;
    will-change: transform, box-shadow;
}

/* Card Spotlight Overlay */
.card::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 10;
    background: radial-gradient(800px circle at var(--mouse-x, 0px) var(--mouse-y, 0px),
            rgba(255, 255, 255, 0.12),
            transparent 40%);
    opacity: 0;
    transition: opacity 0.5s;
    pointer-events: none;
}

.card:hover::before {
    opacity: 1;
}

[data-theme="light"] .card::before {
    background: radial-gradient(800px circle at var(--mouse-x, 0px) var(--mouse-y, 0px),
            rgba(0, 100, 255, 0.08),
            transparent 40%);
}

.card-horizontal::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 10;
    background: radial-gradient(500px circle at var(--mouse-x, 0px) var(--mouse-y, 0px),
            rgba(255, 255, 255, 0.12),
            transparent 45%);
    opacity: 0;
    transition: opacity 0.5s;
    pointer-events: none;
}

.card-horizontal:hover::before {
    opacity: 1;
}

[data-theme="light"] .card-horizontal::before {
    background: radial-gradient(500px circle at var(--mouse-x, 0px) var(--mouse-y, 0px),
            rgba(0, 100, 255, 0.08),
            transparent 45%);
}


/* Hover Effects - Elegant Lift */
.card:hover {
    transform: scale(1.02) translateY(-4px);
    /* Slight lift and scale */
    background-color: var(--card-bg-hover);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
    /* Soft deep shadow */
}

/* Light mode specific hover shadow boost */
[data-theme="light"] .card:hover,
[data-theme="light"] .card-horizontal:hover {
    box-shadow: 0 22px 50px rgba(0, 0, 0, 0.08);
}


/* App Icon */
.app-icon {
    width: 100px;
    height: 100px;
    background: var(--icon-bg);
    border-radius: var(--icon-radius);
    margin-bottom: 32px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--icon-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 600;
    overflow: hidden;
    transition: transform 0.4s var(--transition);
}

.card .app-icon {
    margin-top: auto;
}



.app-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card:hover .app-icon {
    transform: scale(1.05);
    /* Icon gently pulses up on card hover */
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

/* Card Content Typography */
.eyebrow {
    font-size: 12px;
    font-weight: 600;
    color: var(--link-blue);
    /* Changed to blue for accent */
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.card-title {
    font-size: 24px;
    line-height: 1.1;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
}

/* Horizontal Card Support */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    padding-bottom: 200px;
}


.card-horizontal {
    background-color: var(--card-bg);
    border-radius: var(--card-radius);
    overflow: hidden;
    position: relative;
    padding: 32px;
    height: 160px;
    display: flex;
    flex-direction: row;
    align-items: center;
    text-align: left;
    cursor: pointer;
    transition: transform 0.4s var(--transition), box-shadow 0.4s var(--transition), background-color 0.4s ease;
    will-change: transform, box-shadow;
}

.card-horizontal:hover {
    transform: scale(1.02) translateY(-4px);
    background-color: var(--card-bg-hover);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
}

.card-horizontal .app-icon {
    width: 80px;
    height: 80px;
    margin-bottom: 0;
    margin-right: 24px;
    flex-shrink: 0;
}

.card-horizontal .card-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.card-horizontal .card-title {
    font-size: 22px;
    margin-bottom: 4px;
}

.card-horizontal .card-desc {
    margin-bottom: 0;
    max-width: 100%;
}


.card-desc {
    font-size: 14px;
    line-height: 1.45;
    color: var(--text-secondary);
    max-width: 280px;
    margin-bottom: 24px;
}

/* Button inside card */
.card-btn {
    background: rgba(134, 134, 139, 0.16);
    /* Subtle grey background */
    color: var(--text-secondary);
    padding: 8px 18px;
    border-radius: 980px;
    font-size: 13px;
    font-weight: 600;
    margin-top: auto;
    margin-bottom: auto;
    transition: all 0.3s var(--transition);
}


.card:hover .card-btn {
    background: #0071e3;
    color: #fff;
}

/* Scroll Animation Classes */
.fade-up-entry {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 1s cubic-bezier(0.16, 1, 0.3, 1), transform 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.fade-up-entry.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Footer */
footer {
    width: 100%;
    color: var(--text-secondary);
    font-size: 12px;
    padding: 50px 0;
    border-top: 1px solid var(--border-color);
}


.footer-inner-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 22px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-links a {
    color: var(--text-secondary);
    margin-right: 20px;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--text-primary);
    text-decoration: underline;
}

/* Responsive Logic */
@media (max-width: 1024px) {

    .grid,
    .tools-grid {
        grid-template-columns: repeat(2, 1fr);
        /* Drop to 2 columns on tablet */
    }

    .card {
        height: 460px;
    }

    .card-horizontal {
        height: 140px;
        padding: 20px;
    }

}

@media (max-width: 768px) {

    .grid,
    .tools-grid {
        grid-template-columns: 1fr;
        /* 1 Column on mobile */
        gap: 24px;
    }

    .card {
        height: auto;
        min-height: 420px;
        padding: 40px 24px;
    }

    .card-horizontal {
        height: auto;
        min-height: 120px;
    }


    .hero h1 {
        font-size: 40px;
    }

    .footer-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .nav-links {
        gap: 16px;
    }
}