:root {
    --dark: #050505;
    --surface: #0F0F0F;
    --accent: #007AFF;
    --accent-dark: #005BBF;
    --slate: #94A3B8;
    --transition: cubic-bezier(0.2, 0, 0, 1);
    --font-sans: 'Inter', sans-serif;
    --font-display: 'Outfit', 'Plus Jakarta Sans', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

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

html {
    scroll-behavior: smooth;
    width: 100%;
    overflow-x: hidden;
}

body {
    background-color: var(--dark);
    color: white;
    font-family: var(--font-sans);
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
    position: relative;
    line-height: 1.5;
}

main {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
}

h1, h2, h3, h4, .font-display {
    font-family: var(--font-display);
}

/* Premium Layout Utilities */
.container-custom {
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
    max-width: 80rem; /* 7xl equivalent */
}

@media (min-width: 1400px) {
    .container-custom {
        max-width: 90rem;
    }
}

/* Navbar Styling */
.nav-link {
    position: relative;
    transition: color 0.3s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0%;
    height: 1.5px;
    background: var(--accent);
    transition: width 0.3s var(--transition);
}

.nav-link:hover {
    color: white;
}

.nav-link:hover::after {
    width: 100%;
}

/* Mobile Nav Links */
.mobile-nav-link {
    display: block;
    color: var(--slate);
    transition: color 0.3s ease;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.mobile-nav-link:hover {
    color: white;
}

/* Hero Mockup Styling */
.hero-mockup-container {
    transition: transform 0.6s var(--transition);
    perspective: 2000px;
    display: flex;
    justify-content: center;
}

.iphone-frame {
    width: 320px;
    height: 640px;
    background: #000;
    border: 12px solid #1a1a1a;
    border-radius: 4.5rem;
    position: relative;
    box-shadow: 
        0 10px 20px rgba(0,0,0,0.5), 
        0 40px 100px rgba(0,0,0,0.8), 
        inset 0 0 0 1px rgba(255,255,255,0.05);
    transform-style: preserve-3d;
    will-change: transform;
}

/* Dynamic Notch */
.iphone-frame::after {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 30px;
    background: #000;
    border-bottom-left-radius: 1.2rem;
    border-bottom-right-radius: 1.2rem;
    z-index: 20;
}

.iphone-screen {
    width: 100%;
    height: 100%;
    background: #0F0F0F;
    border-radius: 3.7rem;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    -webkit-mask-image: -webkit-radial-gradient(white, black);
}

/* Mockup Header */
.iphone-screen > div:first-child {
    padding: 2.25rem 1.25rem 0.75rem 1.25rem; 
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(26, 26, 26, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Editor Content */
.iphone-editor-content {
    font-family: var(--font-mono);
    font-size: 11px;
    line-height: 1.6;
    padding: 1.25rem;
    flex: 1;
    overflow-y: auto;
    scrollbar-width: none;
}

.iphone-editor-content::-webkit-scrollbar {
    display: none;
}

.iphone-editor-content .code-line {
    display: flex;
    gap: 0.75rem;
    white-space: pre;
}

.iphone-editor-content .line-number {
    color: rgba(148, 163, 184, 0.3);
    width: 1.2rem;
    text-align: right;
    flex-shrink: 0;
    user-select: none;
}

/* AI Suggestion Box inside Mockup */
.mockup-ai-box {
    margin-top: 1.5rem;
    padding: 1rem;
    background: rgba(0, 122, 255, 0.08);
    border: 1px solid rgba(0, 122, 255, 0.2);
    border-radius: 1rem;
    backdrop-filter: blur(4px);
}

/* Cards & Bento Grid */
.hover-lift {
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-8px);
    border-color: rgba(0, 122, 255, 0.3);
    box-shadow: 0 20px 40px -10px rgba(0,0,0,0.5);
}

/* Terminal Effects */
.terminal-window {
    box-shadow: 0 50px 120px -30px rgba(0,0,0,0.9), inset 0 1px 1px rgba(255,255,255,0.05);
    background: #0F0F0F;
}

.cursor-blink {
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    from, to { opacity: 1; }
    50% { opacity: 0; }
}

/* Reveal Animations */
.reveal-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s var(--transition), transform 0.8s var(--transition);
}

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

.delay-100 { transition-delay: 0.1s; }
.delay-200 { transition-delay: 0.2s; }
.delay-300 { transition-delay: 0.3s; }

/* Custom Scrollbar - Premium */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--dark);
}

::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
    border: 2px solid var(--dark);
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.2);
}

/* Language Icons Animation */
#languages .hover-lift:hover i {
    transform: scale(1.15);
    transition: transform 0.4s var(--transition);
}

/* Scroll Action Button */
.scroll-action-btn {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    background: rgba(15, 15, 15, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 50;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    color: var(--slate);
    padding: 0;
}

.scroll-action-btn:hover {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(0, 122, 255, 0.4);
}

.scroll-action-btn svg {
    width: 24px;
    height: 24px;
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    stroke-width: 2.5px;
}

#scrollToTopBtn.is-top-mode svg {
    transform: rotate(180deg);
}

/* Responsive Adjustments */
@media (max-width: 1024px) {
    .iphone-frame {
        width: 280px;
        height: 560px;
    }
}

@media (max-width: 640px) {
    .container-custom {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .iphone-frame {
        width: 260px;
        height: 520px;
        border-width: 8px;
        border-radius: 3rem;
    }
    .iphone-screen {
        border-radius: 2.5rem;
    }
    .iphone-frame::after {
        width: 80px;
        height: 25px;
        border-bottom-left-radius: 1rem;
        border-bottom-right-radius: 1rem;
    }
    .iphone-editor-content {
        font-size: 10px;
    }
    
    .scroll-action-btn {
        bottom: 1.5rem;
        right: 1.5rem;
        width: 3rem;
        height: 3rem;
    }
    .scroll-action-btn svg {
        width: 20px;
        height: 20px;
    }
}