/* ============================================
   LIQUID GLASS DESIGN SYSTEM v2.0
   Pavel Gnatyuk - iOS Developer Portfolio
   Fresh Ocean/Aurora Theme
   ============================================ */

/* CSS Variables - Apple Liquid Glass Palette */
:root {
    /* Glass Effects - Deep Transparency */
    --glass-bg: rgba(255, 255, 255, 0.08);
    --glass-bg-medium: rgba(255, 255, 255, 0.12);
    --glass-bg-strong: rgba(255, 255, 255, 0.18);
    --glass-border: rgba(255, 255, 255, 0.25);
    --glass-border-strong: rgba(255, 255, 255, 0.4);
    --glass-shadow: rgba(0, 0, 0, 0.08);
    --glass-inner-shadow: rgba(255, 255, 255, 0.15);
    --blur-amount: 40px;
    --blur-strong: 60px;
    --blur-subtle: 20px;

    /* Liquid Glass Background - Subtle, Desaturated */
    --gradient-1: #f8f9fc;  /* Near white with blue tint */
    --gradient-2: #e8ecf4;  /* Soft gray-blue */
    --gradient-3: #f0f2f8;  /* Light steel */
    --gradient-4: #eaecf5;  /* Lavender gray */
    --gradient-5: #dfe4f0;  /* Muted periwinkle */
    --gradient-6: #e4e8f4;  /* Cool gray */
    --gradient-7: #f2f4fa;  /* Ice white */

    /* Liquid accent colors - Richer tints for glass */
    --liquid-tint-blue: rgba(100, 140, 200, 0.22);
    --liquid-tint-purple: rgba(140, 120, 180, 0.18);
    --liquid-tint-pink: rgba(180, 130, 160, 0.14);
    --liquid-tint-warm: rgba(180, 160, 140, 0.12);

    /* Text Colors - Softer contrast */
    --text-primary: #1d1d1f;
    --text-secondary: #515154;
    --text-light: #86868b;

    /* Accent Colors - iOS 26 Inspired */
    --accent-blue: #0071e3;
    --accent-teal: #30b0c7;
    --accent-cyan: #5ac8fa;
    --accent-purple: #af52de;
    --accent-indigo: #5856d6;

    /* Specular highlight */
    --specular-color: rgba(255, 255, 255, 0.6);
    --specular-soft: rgba(255, 255, 255, 0.25);

    /* Fonts */
    --font-main: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'SF Mono', Monaco, 'Courier New', monospace;

    /* Transitions - Liquid-like easing */
    --transition-smooth: cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
    --transition-liquid: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Reset & Base */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

/* Animated Background - Apple Liquid Glass */
.background-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    background:
        /* Soft liquid pools - very subtle */
        radial-gradient(ellipse 80% 60% at 20% 30%, var(--liquid-tint-blue) 0%, transparent 50%),
        radial-gradient(ellipse 70% 80% at 80% 70%, var(--liquid-tint-purple) 0%, transparent 45%),
        radial-gradient(ellipse 90% 70% at 60% 20%, var(--liquid-tint-pink) 0%, transparent 55%),
        radial-gradient(ellipse 60% 90% at 30% 80%, var(--liquid-tint-warm) 0%, transparent 50%),
        /* Base gradient - subtle and neutral */
        linear-gradient(165deg, var(--gradient-1) 0%, var(--gradient-2) 20%, var(--gradient-3) 40%, var(--gradient-4) 60%, var(--gradient-5) 80%, var(--gradient-1) 100%);
    background-size: 150% 150%, 180% 180%, 160% 160%, 140% 140%, 300% 300%;
    animation: liquidFlow 30s ease-in-out infinite, liquidShift 45s ease-in-out infinite;
}

@keyframes liquidFlow {
    0%, 100% {
        background-position: 0% 0%, 100% 100%, 50% 0%, 0% 100%, 0% 50%;
    }
    25% {
        background-position: 50% 50%, 50% 0%, 100% 50%, 50% 50%, 50% 0%;
    }
    50% {
        background-position: 100% 100%, 0% 50%, 0% 100%, 100% 0%, 100% 50%;
    }
    75% {
        background-position: 50% 0%, 100% 100%, 50% 50%, 50% 50%, 50% 100%;
    }
}

@keyframes liquidShift {
    0%, 100% { filter: saturate(1) brightness(1); }
    50% { filter: saturate(1.05) brightness(1.02); }
}

/* Floating Liquid Glass Elements */
.liquid-bubbles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.bubble {
    position: absolute;
    border-radius: 50%;
    /* Deep glass transparency with subtle tint */
    background:
        radial-gradient(ellipse 30% 30% at 25% 25%, var(--specular-color) 0%, transparent 70%),
        radial-gradient(ellipse 50% 50% at 50% 50%, rgba(255,255,255,0.06) 0%, rgba(255,255,255,0.02) 100%);
    backdrop-filter: blur(var(--blur-subtle));
    -webkit-backdrop-filter: blur(var(--blur-subtle));
    border: 1px solid rgba(255,255,255,0.2);
    animation: floatBubble linear infinite;
    box-shadow:
        /* Outer glow */
        0 8px 32px rgba(0, 0, 0, 0.04),
        /* Inner highlight top */
        inset 0 2px 4px rgba(255,255,255,0.2),
        /* Inner shadow bottom */
        inset 0 -2px 4px rgba(0,0,0,0.02);
}

/* Primary specular highlight - top left */
.bubble::after {
    content: '';
    position: absolute;
    top: 8%;
    left: 12%;
    width: 35%;
    height: 20%;
    background: linear-gradient(
        135deg,
        rgba(255,255,255,0.5) 0%,
        rgba(255,255,255,0.2) 50%,
        transparent 100%
    );
    border-radius: 50%;
    filter: blur(1px);
    transform: rotate(-15deg);
}

/* Secondary highlight - bottom right reflection */
.bubble::before {
    content: '';
    position: absolute;
    bottom: 12%;
    right: 15%;
    width: 20%;
    height: 12%;
    background: linear-gradient(
        315deg,
        rgba(255,255,255,0.25) 0%,
        transparent 100%
    );
    border-radius: 50%;
    filter: blur(2px);
}

@keyframes floatBubble {
    0% {
        transform: translateY(100vh) rotate(0deg) scale(1);
        opacity: 0;
    }
    8% {
        opacity: 0.6;
    }
    92% {
        opacity: 0.6;
    }
    100% {
        transform: translateY(-100vh) rotate(180deg) scale(1.02);
        opacity: 0;
    }
}

/* Glass Card - Apple Liquid Glass Style */
.glass {
    position: relative;
    background: var(--glass-bg);
    backdrop-filter: blur(var(--blur-amount)) saturate(1.8);
    -webkit-backdrop-filter: blur(var(--blur-amount)) saturate(1.8);
    border-radius: 24px;
    border: 1px solid var(--glass-border);
    box-shadow:
        0 8px 32px var(--glass-shadow),
        0 2px 8px rgba(0, 0, 0, 0.04),
        inset 0 1px 0 var(--glass-inner-shadow),
        inset 0 -1px 0 rgba(0,0,0,0.02);
    transition: all 0.5s var(--transition-liquid);
    overflow: hidden;
}

/* Specular highlight overlay */
.glass::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(
        180deg,
        rgba(255,255,255,0.12) 0%,
        rgba(255,255,255,0.04) 40%,
        transparent 100%
    );
    border-radius: 24px 24px 0 0;
    pointer-events: none;
}

.glass:hover {
    background: var(--glass-bg-medium);
    transform: translateY(-2px);
    box-shadow:
        0 16px 48px rgba(0, 0, 0, 0.1),
        0 4px 16px rgba(0, 0, 0, 0.06),
        inset 0 1px 0 rgba(255,255,255,0.25),
        inset 0 -1px 0 rgba(0,0,0,0.03);
    border-color: var(--glass-border-strong);
}

.glass-strong {
    background: var(--glass-bg-strong);
    backdrop-filter: blur(var(--blur-strong)) saturate(2);
    -webkit-backdrop-filter: blur(var(--blur-strong)) saturate(2);
}

/* Subtle animated shine on glass */
.glass::after {
    content: '';
    position: absolute;
    top: -100%;
    left: -100%;
    width: 80%;
    height: 80%;
    background: radial-gradient(
        ellipse at center,
        rgba(255,255,255,0.15) 0%,
        transparent 70%
    );
    opacity: 0;
    transition: opacity 0.5s var(--transition-liquid);
    pointer-events: none;
}

.glass:hover::after {
    opacity: 1;
    animation: glassShine 3s ease-in-out infinite;
}

@keyframes glassShine {
    0%, 100% {
        transform: translate(0%, 0%);
    }
    50% {
        transform: translate(20%, 20%);
    }
}

/* Navigation - Liquid Glass */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 1rem 2rem;
    transition: all 0.4s var(--transition-liquid);
}

.nav.scrolled {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(var(--blur-amount)) saturate(1.8);
    -webkit-backdrop-filter: blur(var(--blur-amount)) saturate(1.8);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.3),
        0 4px 24px rgba(0, 0, 0, 0.06);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    letter-spacing: -0.5px;
}

.nav-logo span {
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-teal));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    padding: 0.5rem 1rem;
    border-radius: 12px;
    transition: all 0.3s var(--transition-smooth);
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-teal));
    transition: all 0.3s var(--transition-smooth);
    transform: translateX(-50%);
    border-radius: 1px;
}

html.ui-ready .nav-links a:hover {
    color: var(--text-primary);
    background: rgba(255,255,255,0.5);
}

html.ui-ready .nav-links a:hover::after {
    width: 60%;
}

.nav-links a.active {
    color: var(--accent-blue);
}

/* Mobile Menu */
.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.nav-toggle span {
    width: 25px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all 0.3s var(--transition-smooth);
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 9rem 2rem 5rem;
    position: relative;
}

.hero-content {
    text-align: center;
    max-width: 800px;
    animation: fadeInUp 1s var(--transition-smooth);
    position: relative;
    z-index: 2;
}

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

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1.25rem;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 50px;
    border: 1px solid var(--glass-border);
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    animation: fadeInUp 1s var(--transition-smooth) 0.2s backwards;
}

.hero-badge-dot {
    width: 8px;
    height: 8px;
    background: linear-gradient(135deg, #34D399, #10B981);
    border-radius: 50%;
    animation: pulse 2s infinite;
    box-shadow: 0 0 10px rgba(52, 211, 153, 0.5);
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.2); }
}

.hero h1 {
    font-size: clamp(2.5rem, 8vw, 5rem);
    font-weight: 700;
    letter-spacing: -2px;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    animation: fadeInUp 1s var(--transition-smooth) 0.3s backwards;
}

.hero h1 .gradient-text {
    display: inline-block;
    background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-teal) 50%, var(--accent-cyan) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    background-size: 200% 100%;
    animation: shimmer 6s linear infinite;
    will-change: background-position;
    transform: translateZ(0);
}

@keyframes shimmer {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.hero-subtitle {
    font-size: clamp(1.125rem, 3vw, 1.5rem);
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 2.5rem;
    animation: fadeInUp 1s var(--transition-smooth) 0.4s backwards;
}

.hero-cta {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    animation: fadeInUp 1s var(--transition-smooth) 0.5s backwards;
}

/* Hero liquid blobs */
.hero-blobs {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(60% 60% at 20% 25%, rgba(120, 180, 255, 0.22) 0%, transparent 55%),
        radial-gradient(50% 50% at 80% 20%, rgba(180, 150, 255, 0.18) 0%, transparent 60%),
        radial-gradient(55% 55% at 75% 75%, rgba(140, 200, 255, 0.16) 0%, transparent 60%),
        radial-gradient(45% 45% at 30% 80%, rgba(200, 220, 255, 0.14) 0%, transparent 65%);
    filter: blur(0px);
}

/* Hero side devices */
.hero-device {
    position: absolute;
    top: 12%;
    width: 240px;
    height: 520px;
    pointer-events: auto;
    z-index: 1;
}

.hero-device-left {
    left: max(2%, 40px);
}

.hero-device-right {
    right: max(2%, 40px);
}

.device-card {
    position: absolute;
    inset: 0;
    border-radius: 32px;
    padding: 10px;
    opacity: 0.75;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.22);
    box-shadow:
        0 25px 60px rgba(0, 0, 0, 0.15),
        0 6px 20px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(12px) saturate(1.2);
    -webkit-backdrop-filter: blur(12px) saturate(1.2);
    overflow: hidden;
    transform-origin: center;
    transition: transform 1s ease;
}

.device-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 24px;
    opacity: 0.55;
    filter: blur(1px) saturate(0.9) brightness(1.0);
    display: block;
    transition: opacity 0.35s ease, filter 0.35s ease;
}

.hero-device:hover .device-card img,
.hero-device:focus-visible .device-card img {
    opacity: 0.95;
    filter: blur(0px) saturate(1.0) brightness(1.02);
}

.device-front {
    transform: rotate(-6deg) translate(0, 0) scale(1);
    animation: floatDeviceFront 38s ease-in-out infinite;
}

.device-back {
    transform: rotate(-2deg) translate(-12px, 18px) scale(0.92);
    filter: blur(2px) saturate(0.9);
    opacity: 0.7;
    animation: floatDeviceBack 46s ease-in-out infinite;
}

.hero-device-right .device-front {
    transform: rotate(7deg) translate(0, 0) scale(1);
}

.hero-device-right .device-back {
    transform: rotate(3deg) translate(12px, 20px) scale(0.92);
}

@keyframes floatDeviceFront {
    0%, 100% { transform: translate(0, 0) rotate(-6deg) scale(1); }
    25% { transform: translate(6px, -6px) rotate(-4deg) scale(1.01); }
    50% { transform: translate(-4px, 8px) rotate(-8deg) scale(0.99); }
    75% { transform: translate(4px, 4px) rotate(-5deg) scale(1.005); }
}

@keyframes floatDeviceBack {
    0%, 100% { transform: translate(-12px, 18px) rotate(-2deg) scale(0.92); }
    25% { transform: translate(-6px, 12px) rotate(0deg) scale(0.93); }
    50% { transform: translate(-16px, 22px) rotate(-3deg) scale(0.91); }
    75% { transform: translate(-10px, 14px) rotate(-1deg) scale(0.925); }
}

@media (prefers-reduced-motion: reduce) {
    .device-front,
    .device-back {
        animation: none !important;
        transform: none !important;
    }

    .gradient-text {
        animation: none !important;
        background-position: 50% 50%;
    }
}

@media (max-width: 1280px) {
    .hero {
        padding: 8rem 2rem 4rem;
    }
    .hero-device {
        opacity: 0.8;
        transform: scale(0.9);
    }
}

@media (max-width: 1024px) {
    .hero-device {
        display: none;
    }
    .hero {
        padding: 7rem 1.5rem 3rem;
    }
}

/* Buttons - Liquid Glass Style */
.btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    border-radius: 16px;
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    transition: all 0.4s var(--transition-liquid);
    cursor: pointer;
    border: none;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(180deg, rgba(255,255,255,0.25) 0%, transparent 100%);
    border-radius: 16px 16px 0 0;
    pointer-events: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-teal) 100%);
    color: white;
    box-shadow:
        0 4px 16px rgba(0, 113, 227, 0.3),
        inset 0 1px 0 rgba(255,255,255,0.2),
        inset 0 -1px 0 rgba(0,0,0,0.1);
}

.btn-primary:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow:
        0 8px 24px rgba(0, 113, 227, 0.4),
        inset 0 1px 0 rgba(255,255,255,0.3),
        inset 0 -1px 0 rgba(0,0,0,0.15);
    filter: brightness(1.05);
}

.btn-secondary {
    background: var(--glass-bg-medium);
    backdrop-filter: blur(var(--blur-subtle)) saturate(1.5);
    -webkit-backdrop-filter: blur(var(--blur-subtle)) saturate(1.5);
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.04),
        inset 0 1px 0 rgba(255,255,255,0.15);
}

.btn-secondary:hover {
    background: var(--glass-bg-strong);
    transform: translateY(-2px);
    border-color: var(--glass-border-strong);
    box-shadow:
        0 8px 20px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255,255,255,0.25);
}

.btn-appstore {
    background: #000;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
}

.btn-appstore:hover {
    background: #1a1a1a;
    transform: translateY(-2px);
}

.btn-appstore svg {
    width: 24px;
    height: 24px;
}

/* AI Tap Animation - Xcode-style pulse effect */
.btn.ai-tap {
    position: relative;
    overflow: hidden;
}

.btn.ai-tap::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(255, 255, 255, 0.4) 0%, rgba(255, 255, 255, 0) 60%);
    opacity: 0;
    transform: scale(0.6);
    transition: opacity 0.25s ease, transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    border-radius: inherit;
}

.btn.ai-tap.tap-animate::after {
    opacity: 1;
    transform: scale(1.1);
}

.btn-primary.ai-tap.tap-animate {
    transform: translateY(-1px) scale(1.01);
}

.btn-secondary.ai-tap.tap-animate {
    transform: translateY(-1px) scale(1.01);
}

/* Section Styles */
.section {
    padding: 6rem 2rem;
    position: relative;
}

.section-header {
    text-align: center;
    max-width: 600px;
    margin: 0 auto 4rem;
}

.section-label {
    display: inline-block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--accent-teal);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 1rem;
}

.section-title {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    letter-spacing: -1px;
    margin-bottom: 1rem;
}

.section-subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
}

/* Apps Grid */
.apps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

/* App Card */
.app-card {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.app-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-teal), var(--accent-cyan));
    opacity: 0;
    transition: opacity 0.3s var(--transition-smooth);
}

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

.app-icon {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    margin-bottom: 1.5rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    object-fit: cover;
}

.app-card h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.app-category {
    font-size: 0.875rem;
    color: var(--accent-teal);
    font-weight: 500;
    margin-bottom: 1rem;
}

.app-description {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.app-features {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.app-feature-tag {
    padding: 0.375rem 0.75rem;
    background: rgba(0, 180, 216, 0.1);
    color: var(--accent-teal);
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 8px;
    border: 1px solid rgba(0, 180, 216, 0.2);
}

.app-card-footer {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.app-link {
    color: var(--accent-blue);
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    transition: gap 0.3s var(--transition-smooth);
}

.app-link:hover {
    gap: 0.5rem;
}

/* App Page Styles */
.app-hero {
    min-height: 60vh;
    display: flex;
    align-items: center;
    padding: 10rem 2rem 4rem;
}

.app-hero-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.app-hero-text {
    animation: fadeInUp 0.8s var(--transition-smooth);
}

.app-hero-text h1 {
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 700;
    letter-spacing: -2px;
    margin-bottom: 1rem;
}

.app-hero-text .tagline {
    font-size: 1.5rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.app-hero-screenshots {
    position: relative;
    height: 500px;
    animation: fadeInUp 0.8s var(--transition-smooth) 0.2s backwards;
}

/* Hero screenshot stack uses <picture> now (WebP/JPEG). Position the <picture> nodes. */
.app-hero-screenshots picture {
    position: absolute;
    height: 450px;
    width: auto;
    border-radius: 24px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
    transition: all 0.4s var(--transition-smooth);
    cursor: pointer;
    user-select: none;
}

.app-hero-screenshots picture img {
    position: relative;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 24px;
    display: block;
}

.app-hero-screenshots picture:nth-child(1) {
    left: 0;
    top: 20px;
    z-index: 3;
    transform: rotate(-5deg);
}

.app-hero-screenshots picture:nth-child(2) {
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
}

.app-hero-screenshots picture:nth-child(3) {
    right: 0;
    top: 20px;
    z-index: 1;
    transform: rotate(5deg);
}

.app-hero-screenshots:hover picture:nth-child(1) {
    transform: rotate(-8deg) translateX(-10px);
}

.app-hero-screenshots:hover picture:nth-child(3) {
    transform: rotate(8deg) translateX(10px);
}

/* Screenshot Gallery */
.screenshot-gallery {
    padding: 4rem 2rem;
    overflow: hidden;
}

.screenshot-scroll {
    display: flex;
    gap: 1.5rem;
    overflow-x: auto;
    padding: 2rem 0;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    cursor: grab;
}

.screenshot-scroll::-webkit-scrollbar {
    display: none;
}

.screenshot-item {
    flex: 0 0 auto;
    scroll-snap-align: center;
}

.screenshot-item img {
    height: 500px;
    width: auto;
    border-radius: 24px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    transition: all 0.4s var(--transition-smooth);
}

.screenshot-item img:hover {
    transform: scale(1.02) translateY(-8px);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.15);
}

/* Features Section */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    max-width: 1000px;
    margin: 0 auto;
}

.feature-card {
    padding: 2rem;
    text-align: center;
}

.feature-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(0,180,216,0.1), rgba(0,150,199,0.1));
    border-radius: 16px;
    font-size: 1.75rem;
}

.feature-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}

.feature-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* About Page */
.about-hero {
    min-height: 80vh;
    display: flex;
    align-items: center;
    padding: 10rem 2rem 4rem;
}

.about-content {
    max-width: 1000px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 4rem;
    align-items: start;
}

.about-photo-container {
    position: relative;
    animation: fadeInUp 0.8s var(--transition-smooth);
}

.about-photo {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 24px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
}

.about-photo-decoration {
    position: absolute;
    top: -20px;
    right: -20px;
    width: 100%;
    height: 100%;
    border-radius: 24px;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-teal));
    z-index: -1;
    opacity: 0.25;
}

.about-text {
    animation: fadeInUp 0.8s var(--transition-smooth) 0.2s backwards;
}

.about-text h1 {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    letter-spacing: -1px;
    margin-bottom: 1.5rem;
}

.about-text .role {
    font-size: 1.25rem;
    color: var(--accent-teal);
    font-weight: 500;
    margin-bottom: 2rem;
}

.about-text p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
}

.about-stats {
    display: flex;
    gap: 2rem;
    margin: 2rem 0;
    padding: 1.5rem 0;
    border-top: 1px solid var(--glass-border);
    border-bottom: 1px solid var(--glass-border);
}

.stat {
    text-align: center;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-teal));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-light);
}

.social-links {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.social-link {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.3s var(--transition-smooth);
}

.social-link:hover {
    background: var(--glass-bg-strong);
    color: var(--accent-teal);
    transform: translateY(-3px);
}

/* Philosophy Section */
.philosophy-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    max-width: 1000px;
    margin: 0 auto;
}

.philosophy-card {
    padding: 2rem;
    text-align: center;
}

.philosophy-card .emoji {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.philosophy-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}

.philosophy-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Articles Section */
.articles-list {
    max-width: 800px;
    margin: 0 auto;
}

.article-item {
    display: flex;
    gap: 1.5rem;
    padding: 1.5rem;
    margin-bottom: 1rem;
    text-decoration: none;
    color: inherit;
}

.article-item:hover {
    transform: translateX(8px);
}

.article-date {
    flex: 0 0 80px;
    font-size: 0.875rem;
    color: var(--text-light);
    padding-top: 0.25rem;
}

.article-content h3 {
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.article-content p {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

/* Footer */
.footer {
    padding: 4rem 2rem;
    text-align: center;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--glass-border);
}

.footer-content {
    max-width: 600px;
    margin: 0 auto;
}

.footer-logo {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: var(--accent-teal);
}

.footer-copy {
    color: var(--text-light);
    font-size: 0.875rem;
}

/* Scroll to Top */
.scroll-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    background: var(--glass-bg-strong);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s var(--transition-smooth);
    z-index: 999;
    color: var(--text-secondary);
}

.scroll-top.visible {
    opacity: 1;
    visibility: visible;
}

.scroll-top:hover {
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-teal));
    color: white;
    transform: translateY(-3px);
    border-color: transparent;
}

/* Loading Animation */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--gradient-1), var(--gradient-2), var(--gradient-3));
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition: opacity 0.5s, visibility 0.5s;
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 3px solid rgba(255,255,255,0.3);
    border-top-color: var(--accent-teal);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 968px) {
    .app-hero-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .app-hero-screenshots {
        height: 400px;
    }
    
    .app-hero-screenshots picture {
        height: 350px;
    }
    
    .about-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .about-photo-container {
        max-width: 250px;
        margin: 0 auto;
    }
    
    .philosophy-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 300px;
        height: 100vh;
        background: rgba(255,255,255,0.95);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        flex-direction: column;
        padding: 6rem 2rem 2rem;
        transition: right 0.3s var(--transition-smooth);
        box-shadow: -10px 0 30px rgba(0,0,0,0.1);
    }

    /* Larger tap targets for iPhone */
    .nav-links a {
        font-size: 1.05rem;
        padding: 0.85rem 1rem;
    }
    
    .nav-links.open {
        right: 0;
    }
    
    .nav-toggle {
        display: flex;
        z-index: 1001;
    }
    
    .nav-toggle.open span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    
    .nav-toggle.open span:nth-child(2) {
        opacity: 0;
    }
    
    .nav-toggle.open span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -5px);
    }
    
    .apps-grid {
        grid-template-columns: 1fr;
    }
    
    .hero-cta {
        flex-direction: column;
        align-items: center;
    }
    
    .app-hero-screenshots {
        display: none;
    }
    
    .about-stats {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .article-item {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .article-date {
        flex: none;
    }

    /* iPhone-friendly safe areas + hero sizing */
    body {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
    }

    .hero {
        min-height: 100svh;
        padding-top: calc(6rem + env(safe-area-inset-top));
        padding-bottom: calc(2.5rem + env(safe-area-inset-bottom));
    }

    /* Mobile performance: slightly reduce heavy blurs */
    :root {
        --blur-amount: 24px;
        --blur-strong: 36px;
    }
}

/* Thumb-friendly CTAs on small phones */
@media (max-width: 480px) {
    .hero-cta {
        gap: 0.75rem;
    }

    .btn {
        width: 100%;
        justify-content: center;
        padding: 1.1rem 1.2rem;
        border-radius: 18px;
    }
}

/* Avoid sticky hover on touch devices (keeps desktop hover intact) */
@media (hover: none) and (pointer: coarse) {
    .glass:hover,
    .btn-primary:hover,
    .btn-secondary:hover,
    .app-link:hover,
    .social-link:hover {
        transform: none;
        box-shadow: inherit;
        filter: none;
    }
}

/* Prevent background scroll when mobile menu is open */
body.nav-open {
    overflow: hidden;
    height: 100vh;
}

/* Animations for scroll reveal */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s var(--transition-smooth);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================
   DARK MODE - Auto-detect system preference
   ============================================ */
@media (prefers-color-scheme: dark) {
    :root {
        /* Glass Effects - Adjusted for dark backgrounds */
        --glass-bg: rgba(255, 255, 255, 0.06);
        --glass-bg-medium: rgba(255, 255, 255, 0.10);
        --glass-bg-strong: rgba(255, 255, 255, 0.14);
        --glass-border: rgba(255, 255, 255, 0.12);
        --glass-border-strong: rgba(255, 255, 255, 0.22);
        --glass-shadow: rgba(0, 0, 0, 0.3);
        --glass-inner-shadow: rgba(255, 255, 255, 0.08);

        /* Dark Background Gradients */
        --gradient-1: #0d1117;
        --gradient-2: #161b22;
        --gradient-3: #1a1a2e;
        --gradient-4: #16213e;
        --gradient-5: #1a1a2e;
        --gradient-6: #0f0f1a;
        --gradient-7: #0d1117;

        /* Liquid tints - brighter for dark mode */
        --liquid-tint-blue: rgba(100, 160, 255, 0.12);
        --liquid-tint-purple: rgba(160, 120, 220, 0.10);
        --liquid-tint-pink: rgba(200, 130, 180, 0.08);
        --liquid-tint-warm: rgba(200, 160, 120, 0.06);

        /* Text Colors - Light on dark */
        --text-primary: #f5f5f7;
        --text-secondary: #a1a1a6;
        --text-light: #6e6e73;

        /* Accent Colors - slightly brighter for dark */
        --accent-blue: #2997ff;
        --accent-teal: #5ac8fa;
        --accent-cyan: #70d7ff;

        /* Specular highlights - subtler on dark */
        --specular-color: rgba(255, 255, 255, 0.3);
        --specular-soft: rgba(255, 255, 255, 0.12);
    }

    /* Navigation scrolled state - dark */
    .nav.scrolled {
        background: rgba(13, 17, 23, 0.8);
        border-bottom-color: rgba(255, 255, 255, 0.08);
    }

    /* Nav links hover - dark */
    .nav-links a:hover {
        background: rgba(255, 255, 255, 0.08);
    }

    /* Mobile menu - dark */
    .nav-links {
        background: rgba(13, 17, 23, 0.95);
    }

    /* Loading screen - dark */
    .loading-screen {
        background: linear-gradient(135deg, var(--gradient-1), var(--gradient-2), var(--gradient-3));
    }

    /* Footer - dark */
    .footer {
        background: rgba(13, 17, 23, 0.6);
        border-top-color: rgba(255, 255, 255, 0.08);
    }

    /* App Store button - invert for dark */
    .btn-appstore {
        background: #f5f5f7;
        color: #1d1d1f;
    }

    .btn-appstore:hover {
        background: #ffffff;
    }

    /* Feature tag adjustments */
    .app-feature-tag {
        background: rgba(90, 200, 250, 0.15);
        border-color: rgba(90, 200, 250, 0.25);
    }

    /* Screenshot shadows - darker for dark mode */
    .screenshot-item img {
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    }

    .screenshot-item img:hover {
        box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
    }

    /* App hero screenshots */
    .app-hero-screenshots picture {
        box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4);
    }

    /* About photo */
    .about-photo {
        box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4);
    }

    /* Hero blobs - dark */
    .hero-blobs {
        background:
            radial-gradient(60% 60% at 20% 25%, rgba(90, 140, 240, 0.24) 0%, transparent 55%),
            radial-gradient(50% 50% at 80% 20%, rgba(140, 110, 210, 0.20) 0%, transparent 60%),
            radial-gradient(55% 55% at 75% 75%, rgba(90, 140, 220, 0.18) 0%, transparent 60%),
            radial-gradient(45% 45% at 30% 80%, rgba(80, 110, 160, 0.16) 0%, transparent 65%);
    }

    /* Hero devices - dark */
    .device-card {
        opacity: 0.8;
        background: rgba(30, 35, 45, 0.55);
        border: 1px solid rgba(255, 255, 255, 0.08);
        box-shadow:
            0 25px 60px rgba(0, 0, 0, 0.45),
            0 8px 20px rgba(0, 0, 0, 0.3),
            inset 0 1px 0 rgba(255, 255, 255, 0.08);
        backdrop-filter: blur(12px) saturate(1.15);
        -webkit-backdrop-filter: blur(12px) saturate(1.15);
    }

    .device-card img {
        opacity: 0.6;
        filter: blur(1px) saturate(0.9) brightness(0.95);
    }

    .device-back {
        filter: blur(3px) saturate(0.85) brightness(0.9);
        opacity: 0.65;
    }

}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    html {
        scroll-behavior: auto;
    }
}

/* Print styles */
@media print {
    .nav, .scroll-top, .liquid-bubbles, .background-container {
        display: none;
    }
    
    body {
        background: white;
    }
    
    .glass {
        background: white;
        box-shadow: none;
        border: 1px solid #ddd;
    }
}
