/* CSS Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Light Theme - Soft Pastel Beach Palette */
    --bg-primary: #ffffff;
    --bg-secondary: #f8f4f0;
    --bg-tertiary: #ede4dc;
    --text-primary: #4a5568;
    --text-secondary: #718096;
    --text-tertiary: #a0aec0;
    --accent: #9dc4d4;
    --accent-hover: #7eb0c4;
    --accent-light: #d4e8f0;
    --accent-peach: #f4c4b4;
    --accent-peach-hover: #e8a894;
    --accent-pink: #f8d4d8;
    --accent-coral: #ec9c94;
    --border: #e2d8cc;
    --border-light: #f0e8dc;
    --card-bg: #ffffff;
    --shadow-sm: 0 1px 3px 0 rgba(74, 85, 104, 0.1), 0 1px 2px 0 rgba(74, 85, 104, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(74, 85, 104, 0.1), 0 2px 4px -1px rgba(74, 85, 104, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(74, 85, 104, 0.1), 0 4px 6px -2px rgba(74, 85, 104, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(74, 85, 104, 0.1), 0 10px 10px -5px rgba(74, 85, 104, 0.04);
}

[data-theme="dark"] {
    /* Dark Theme - Muted Pastel Palette */
    --bg-primary: #2d3748;
    --bg-secondary: #374151;
    --bg-tertiary: #4b5563;
    --text-primary: #f7fafc;
    --text-secondary: #e2e8f0;
    --text-tertiary: #cbd5e0;
    --accent: #9dc4d4;
    --accent-hover: #b8d8e4;
    --accent-light: #2d4f5f;
    --accent-peach: #f4c4b4;
    --accent-peach-hover: #f8d0c4;
    --accent-pink: #f8d4d8;
    --accent-coral: #ec9c94;
    --border: #4b5563;
    --border-light: #5a6478;
    --card-bg: #374151;
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.3), 0 1px 2px 0 rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 0 10px 10px -5px rgba(0, 0, 0, 0.3);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.7;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Header - Clean & Professional */
header {
    background-color: var(--card-bg);
    border-bottom: 1px solid var(--border);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    background-color: rgba(255, 255, 255, 0.95);
}

[data-theme="dark"] header {
    background-color: rgba(30, 41, 59, 0.95);
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.logo h1 {
    font-size: 1.75rem;
    color: var(--accent);
    font-weight: 700;
    letter-spacing: -0.025em;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 2.5rem;
    align-items: center;
}

nav a {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.2s ease;
    padding: 0.5rem 0;
    position: relative;
}

nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--accent);
    transition: width 0.3s ease;
}

nav a:hover,
nav a.active {
    color: var(--accent);
}

nav a:hover::after,
nav a.active::after {
    width: 100%;
}

nav a:focus,
#theme-toggle:focus {
    outline: 2px solid var(--accent);
    outline-offset: 4px;
    border-radius: 4px;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.75rem;
    cursor: pointer;
    padding: 0.5rem;
    color: var(--text-primary);
    z-index: 101;
    transition: opacity 0.2s ease;
}

.mobile-menu-toggle:hover {
    opacity: 0.7;
}

.mobile-menu-toggle:focus {
    outline: 2px solid var(--accent);
    outline-offset: 4px;
    border-radius: 4px;
}

#theme-toggle {
    background: none;
    border: none;
    font-size: 1.35rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: background-color 0.2s ease;
}

#theme-toggle:hover {
    background-color: var(--bg-secondary);
}

[data-theme="dark"] .icon-light {
    display: none;
}

[data-theme="light"] .icon-dark,
.icon-dark {
    display: none;
}

[data-theme="dark"] .icon-dark {
    display: inline;
}

/* Badge Theme Switching */
.badge-dark {
    display: none;
}

[data-theme="dark"] .badge-light {
    display: none;
}

[data-theme="dark"] .badge-dark {
    display: inline;
}

/* Ensure consistent badge heights */
.app-links img {
    height: 40px;
    width: auto;
    vertical-align: middle;
}

/* Hero Section - Soft Pastel Beach */
.hero {
    background: linear-gradient(135deg, #d4e8f0 0%, #f8d4d8 50%, #f4c4b4 100%);
    color: #4a5568;
    padding: 2.75rem 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 30% 50%, rgba(255, 255, 255, 0.3) 0%, transparent 50%);
    pointer-events: none;
}

.hero .container {
    position: relative;
    z-index: 1;
}

.hero h2 {
    font-size: 3.5rem;
    margin-bottom: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.025em;
    line-height: 1.1;
}

.hero .intro {
    font-size: 1.4rem;
    font-weight: 400;
    opacity: 0.95;
    max-width: 600px;
    margin: 0 auto;
    letter-spacing: -0.01em;
}

/* Content Sections - Clean Layout */
.content-section {
    padding: 1.75rem 0;
}

.alt-bg {
    background-color: var(--bg-secondary);
}

.content-section h2 {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    font-weight: 700;
    letter-spacing: -0.025em;
}

.content-section h3 {
    font-size: 1.5rem;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
    font-weight: 600;
}

.content-section p {
    color: var(--text-secondary);
    margin-bottom: 0.875rem;
    font-size: 1.125rem;
    line-height: 1.7;
}

.content-section ul {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.content-section li {
    color: var(--text-secondary);
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

/* App Cards - Premium Design */
#apps {
    background-color: var(--bg-primary);
}

.app-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-md);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

.app-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-xl);
    border-color: var(--accent-light);
}

.app-icon {
    flex-shrink: 0;
    width: 90px;
    height: 90px;
    background: linear-gradient(135deg, #d4e8f0 0%, #f8d4d8 50%, #f4c4b4 100%);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

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

.app-content {
    flex: 1;
}

.app-card h3 {
    font-size: 1.875rem;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    margin-top: 0;
    font-weight: 700;
    letter-spacing: -0.025em;
}

.app-card p {
    margin-bottom: 1.25rem;
    color: var(--text-secondary);
    font-size: 1.0625rem;
    line-height: 1.6;
}

.app-links {
    display: flex;
    gap: 0.875rem;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    padding: 0 1.75rem;
    background-color: var(--accent);
    color: white;
    text-decoration: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.9375rem;
    line-height: 1;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-sm);
    border: none;
}

.btn:hover {
    background-color: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn:active {
    transform: translateY(0);
}

.btn-secondary {
    background-color: var(--accent-peach);
    color: white;
}

.btn-secondary:hover {
    background-color: var(--accent-peach-hover);
}

/* Legal Section */
.legal-links {
    list-style: none;
    margin-left: 0;
}

.legal-links li {
    margin-bottom: 1rem;
}

.legal-links a {
    color: var(--accent);
    text-decoration: none;
    font-size: 1.125rem;
    font-weight: 500;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

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

/* Footer - Minimal & Clean */
footer {
    background-color: var(--card-bg);
    border-top: 1px solid var(--border);
    padding: 2.5rem 0;
    text-align: center;
    color: var(--text-tertiary);
}

footer p {
    font-size: 0.9375rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 20px;
    }

    .mobile-menu-toggle {
        display: block;
    }

    nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 85%;
        max-width: 320px;
        height: 100vh;
        background-color: var(--card-bg);
        box-shadow: -4px 0 16px rgba(0, 0, 0, 0.1);
        transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 100;
        overflow-y: auto;
    }

    nav.open {
        right: 0;
    }

    nav ul {
        flex-direction: column;
        gap: 0;
        width: 100%;
        padding: 6rem 2rem 2rem;
    }

    nav li {
        width: 100%;
        border-bottom: 1px solid var(--border-light);
    }

    nav a {
        display: block;
        padding: 1.25rem 0;
        font-size: 1.0625rem;
    }

    nav a::after {
        display: none;
    }

    .mobile-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: rgba(0, 0, 0, 0.5);
        backdrop-filter: blur(4px);
        z-index: 99;
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    .mobile-overlay.active {
        display: block;
        opacity: 1;
    }

    .hero {
        padding: 4.5rem 0;
    }

    .hero h2 {
        font-size: 2.25rem;
        line-height: 1.2;
    }

    .hero .intro {
        font-size: 1.125rem;
    }

    .content-section {
        padding: 3.5rem 0;
    }

    .content-section h2 {
        font-size: 1.875rem;
        margin-bottom: 1.5rem;
    }

    .content-section p,
    .content-section li {
        font-size: 1.0625rem;
    }

    .app-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 2rem 1.5rem;
    }

    .app-icon {
        width: 100px;
        height: 100px;
        font-size: 3.25rem;
    }

    .app-card h3 {
        font-size: 1.625rem;
        margin-top: 1rem;
    }

    .app-links {
        justify-content: center;
    }

    .btn {
        height: 40px;
        padding: 0 1.5rem;
        font-size: 0.9rem;
    }
}

/* Tablet adjustments */
@media (max-width: 1024px) and (min-width: 769px) {
    .hero h2 {
        font-size: 3rem;
    }

    .content-section h2 {
        font-size: 2.25rem;
    }

    .app-card {
        padding: 2.25rem;
    }
}

/* Print styles */
@media print {
    header {
        position: static;
    }

    nav, #theme-toggle, .mobile-menu-toggle {
        display: none;
    }

    .hero {
        background: #2563eb;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .app-card {
        page-break-inside: avoid;
    }
}
