/* ==========================================================================
   DESIGN SYSTEM
   ========================================================================== */
:root {
    /* Colors - Vibrant & Modern */
    --color-bg: #FFFFFF;
    --color-surface: #F5F5F7;
    --color-surface-alt: #FBFBFD;
    --color-text-primary: #1D1D1F;
    --color-text-secondary: #86868B;
    --color-border: #D2D2D7;
    
    /* Brand Accent Colors */
    --color-accent: #0071E3; /* Apple Blue */
    --color-accent-2: #BF5AF2; /* Apple Purple */
    --color-accent-3: #FF375F; /* Apple Pink */
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, var(--color-accent), var(--color-accent-2), var(--color-accent-3));
    
    /* Typography */
    --font-primary: 'Geom', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    
    /* Fluid Typography (Clamp) 
       Based on 320px to 1440px viewport widths */
    --text-xs: clamp(0.75rem, 0.71rem + 0.18vw, 0.875rem);
    --text-sm: clamp(0.875rem, 0.84rem + 0.18vw, 1rem);
    --text-base: clamp(1rem, 0.96rem + 0.18vw, 1.125rem);
    --text-lg: clamp(1.125rem, 1.05rem + 0.36vw, 1.375rem);
    --text-xl: clamp(1.25rem, 1.07rem + 0.89vw, 1.875rem);
    --text-2xl: clamp(1.5rem, 1.21rem + 1.43vw, 2.5rem);
    --text-3xl: clamp(2rem, 1.57rem + 2.14vw, 3.5rem);
    --text-4xl: clamp(2.5rem, 1.79rem + 3.57vw, 5rem);
    --text-5xl: clamp(3rem, 2.14rem + 4.29vw, 6rem);
    --text-huge: clamp(3.5rem, 2.21rem + 6.43vw, 8rem);
    
    /* Spacing System - Magazine Scale */
    --space-xs: clamp(0.5rem, 0.43rem + 0.36vw, 0.75rem);
    --space-sm: clamp(1rem, 0.86rem + 0.71vw, 1.5rem);
    --space-md: clamp(2rem, 1.71rem + 1.43vw, 3rem);
    --space-lg: clamp(4rem, 3.43rem + 2.86vw, 6rem);
    --space-xl: clamp(6rem, 5.14rem + 4.29vw, 9rem);
    --space-2xl: clamp(8rem, 6.57rem + 7.14vw, 13rem);
    
    /* Layout */
    --content-width: 1600px;
    --padding-fluid: clamp(1rem, 0.43rem + 2.86vw, 3rem);
    --radius: 12px;
    
    /* Motion */
    --ease-out: cubic-bezier(0.215, 0.61, 0.355, 1);
    --ease-in-out: cubic-bezier(0.645, 0.045, 0.355, 1);
    --duration-fast: 0.2s;
    --duration-medium: 0.6s;
    --duration-slow: 1.2s;
}

/* ==========================================================================
   RESET & FOUNDATION
   ========================================================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    overflow-x: hidden;
}

body {
    font-family: var(--font-primary);
    background-color: var(--color-bg);
    color: var(--color-text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

img, picture, svg, video {
    display: block;
    max-width: 100%;
    height: auto;
}

a {
    color: inherit;
    text-decoration: none;
}

ul, ol {
    list-style: none;
}

button {
    background: none;
    border: none;
    font: inherit;
    cursor: pointer;
    color: inherit;
}

::selection {
    background-color: var(--color-accent);
    color: var(--color-bg);
}

:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 4px;
}

/* ==========================================================================
   TYPOGRAPHY
   ========================================================================== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 500;
    line-height: 1.05;
    letter-spacing: -0.03em;
}

p {
    color: var(--color-text-secondary);
    max-width: 70ch;
}

.text-huge { font-size: var(--text-huge); letter-spacing: -0.04em; }
.text-5xl { font-size: var(--text-5xl); }
.text-4xl { font-size: var(--text-4xl); }
.text-3xl { font-size: var(--text-3xl); }
.text-2xl { font-size: var(--text-2xl); }
.text-xl { font-size: var(--text-xl); }
.text-lg { font-size: var(--text-lg); }
.text-base { font-size: var(--text-base); }
.text-sm { font-size: var(--text-sm); }
.text-xs { font-size: var(--text-xs); }

.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }

.text-primary { color: var(--color-text-primary); }
.text-secondary { color: var(--color-text-secondary); }
.text-accent { color: var(--color-accent); }
.text-accent-2 { color: var(--color-accent-2); }

.text-gradient {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.uppercase { text-transform: uppercase; letter-spacing: 0.05em; }

/* ==========================================================================
   LAYOUT STRUCTURE
   ========================================================================== */
.container {
    width: 100%;
    max-width: var(--content-width);
    margin: 0 auto;
    padding: 0 var(--padding-fluid);
}

.section {
    padding: var(--space-2xl) 0;
}

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

.bg-dark {
    background-color: var(--color-text-primary);
    color: var(--color-bg);
}

.bg-dark p {
    color: #A1A1AA;
}

/* Grids & Utilities */
.grid-12 {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: var(--space-md);
}

.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-8 { margin-top: 2rem; }
.mt-12 { margin-top: 4.5rem; } /* Adjusted to push buttons down significantly */
.mt-32 { margin-top: 8rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mb-12 { margin-bottom: 3rem; }
.mb-16 { margin-bottom: 4rem; }
.mb-24 { margin-bottom: 6rem; }
.my-4 { margin-top: 1rem; margin-bottom: 1rem; }
.mx-auto { margin-left: auto; margin-right: auto; }
.text-center { text-align: center; }
.block { display: block; }
.hidden { display: none; }
.items-center { align-items: center; }
.w-full { width: 100%; }
.h-px { height: 1px; }
.bg-border { background-color: var(--color-border); }
.rounded-xl { border-radius: 1rem; }
.aspect-square { aspect-ratio: 1 / 1; }
.object-cover { object-fit: cover; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }
.max-w-xs { max-width: 20rem; }
.hover\:text-accent:hover { color: var(--color-accent); }
.hover\:text-primary:hover { color: var(--color-text-primary); }
.transition-colors { transition-property: color, background-color, border-color; transition-duration: 0.2s; }
.font-light { font-weight: 300; }
.font-medium { font-weight: 500; }
.font-bold { font-weight: 700; }
.tracking-tight { letter-spacing: -0.025em; }
.tracking-widest { letter-spacing: 0.1em; }
.leading-tight { line-height: 1.25; }
.py-16 { padding-top: 4rem; padding-bottom: 4rem; }

.col-span-6 { grid-column: span 6 / span 6; }
.col-span-12 { grid-column: span 12 / span 12; }

@media (min-width: 768px) {
    .md\:block { display: block; }
    .md\:col-span-2 { grid-column: span 2 / span 2; }
    .md\:col-span-4 { grid-column: span 4 / span 4; }
    .md\:col-span-5 { grid-column: span 5 / span 5; }
    .md\:col-span-6 { grid-column: span 6 / span 6; }
    .md\:col-span-8 { grid-column: span 8 / span 8; }
    .md\:col-start-3 { grid-column-start: 3; }
    .md\:col-start-7 { grid-column-start: 7; }
    .md\:mt-0 { margin-top: 0; }
    .md\:mb-0 { margin-bottom: 0; }
}

/* ==========================================================================
   COMPONENTS
   ========================================================================== */

/* Navigation */
.global-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: var(--space-sm) 0;
    z-index: 100;
    transition: background-color var(--duration-fast), border-bottom var(--duration-fast);
    border-bottom: 1px solid transparent;
}

.global-nav.is-scrolled {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--color-border);
}

.nav-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo img {
    width: 170px;
    object-fit: contain;
}

.nav-links {
    display: none;
}

@media (min-width: 1024px) {
    .nav-links {
        display: flex;
        gap: var(--space-md);
    }
}

.nav-link {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--color-text-primary);
    position: relative;
    padding: var(--space-xs) 0;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background-color: var(--color-text-primary);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform var(--duration-medium) var(--ease-out);
}

.nav-link:hover::after,
.nav-link.is-active::after {
    transform: scaleX(1);
    transform-origin: left;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 2rem;
    font-size: var(--text-sm);
    font-weight: 500;
    border-radius: 9999px;
    transition: transform var(--duration-fast) var(--ease-out), background-color var(--duration-fast);
    white-space: nowrap;
}

.btn-sm {
    padding: 0.5rem 1rem;
}

.btn-lg {
    font-size: var(--text-lg);
    padding: 1.5rem 3rem;
}

.btn-primary {
    background-color: var(--color-accent);
    color: var(--color-bg);
    border: none;
}

.btn-primary:hover {
    transform: scale(1.02);
    background-color: #0077ED;
}

.btn-outline {
    border: 1px solid var(--color-border);
    color: var(--color-text-primary);
}

.btn-outline:hover {
    border-color: var(--color-text-primary);
    transform: scale(1.02);
}

.btn-link {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--color-text-primary);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding-bottom: 2px;
    border-bottom: 1px solid var(--color-border);
    transition: border-color var(--duration-fast), color var(--duration-fast);
}

.btn-link:hover {
    border-color: var(--color-accent);
    color: var(--color-accent);
}

/* ==========================================================================
   MODULES
   ========================================================================== */

/* Hero */
.hero-module {
    min-height: 100vh;
    min-height: 100svh; /* Modern mobile Safari fix */
    padding-top: var(--space-2xl);
    padding-bottom: var(--space-xl);
    display: flex;
    align-items: flex-end;
}

.hero-content {
    grid-column: 1 / -1;
    z-index: 10;
}

@media (min-width: 1024px) {
    .hero-content {
        grid-column: 1 / 10;
    }
}

.hero-image-wrapper {
    margin-top: var(--space-xl);
    width: 100%;
    aspect-ratio: 16/9;
    overflow: hidden;
    border-radius: var(--radius);
    position: relative;
}

/* No overlay */

.hero-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Statement Module (Who We Are) */
.statement-label {
    grid-column: 1 / -1;
    margin-bottom: var(--space-sm);
}

.statement-text {
    grid-column: 1 / -1;
}

@media (min-width: 768px) {
    .statement-label {
        grid-column: 1 / 4;
        margin-bottom: 0;
    }
    .statement-text {
        grid-column: 4 / 12;
    }
}

/* Services Module (Editorial Asymmetrical) */
.service-list {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
}

.service-item {
    border-top: 1px solid var(--color-border);
    padding: var(--space-lg) var(--space-md);
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-md);
    transition: all var(--duration-medium) var(--ease-out);
    position: relative;
    overflow: hidden;
}

.service-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 0;
    background-color: var(--color-surface);
    transition: width var(--duration-medium) var(--ease-out);
    z-index: -1;
}

.service-item:hover::before {
    width: 100%;
}

.service-item:last-child {
    border-bottom: 1px solid var(--color-border);
}

@media (min-width: 1024px) {
    .service-item {
        grid-template-columns: repeat(12, 1fr);
        align-items: center;
        padding: var(--space-lg) var(--space-sm);
    }
    
    .service-title { grid-column: 1 / 5; }
    .service-desc { grid-column: 5 / 9; }
    .service-visual { grid-column: 10 / 13; justify-self: end; }
}

.service-title {
    font-size: var(--text-3xl);
    margin: 0;
    transition: color var(--duration-fast), transform var(--duration-medium) var(--ease-out);
}

.service-item:hover .service-title {
    color: var(--color-accent);
    transform: translateX(10px);
}

.service-visual i {
    transition: all var(--duration-medium) var(--ease-out);
    display: inline-block;
}

.service-item:hover .service-visual i {
    color: var(--color-accent-2);
    transform: scale(1.1) rotate(5deg);
}

/* Work Module */
.work-item {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-md);
    margin-bottom: var(--space-2xl);
}

.work-item:last-child {
    margin-bottom: 0;
}

@media (min-width: 1024px) {
    .work-item {
        grid-template-columns: repeat(12, 1fr);
        align-items: end;
    }
    .work-visual { grid-column: 1 / 9; }
    .work-info { grid-column: 10 / 13; padding-bottom: var(--space-sm); }
    
    .work-item.reverse .work-visual { grid-column: 5 / 13; }
    .work-item.reverse .work-info { grid-column: 1 / 4; grid-row: 1; }
}

.work-visual {
    border-radius: var(--radius);
    overflow: hidden;
    position: relative;
}

.work-visual img {
    width: 100%;
    height: auto;
    display: block;
}

.work-meta {
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-secondary);
    margin-bottom: var(--space-sm);
    display: block;
}

/* Process Module (Timeline) */
.process-timeline {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
    border-left: 1px solid var(--color-border);
    padding-left: var(--space-md);
}

@media (min-width: 768px) {
    .process-timeline {
        flex-direction: row;
        border-left: none;
        border-top: 1px solid var(--color-border);
        padding-left: 0;
        padding-top: var(--space-md);
        overflow-x: auto;
        -ms-overflow-style: none;
        scrollbar-width: none;
    }
    .process-timeline::-webkit-scrollbar {
        display: none;
    }
}

.process-step {
    flex: 1 0 250px;
}

.process-number {
    font-size: var(--text-xs);
    color: var(--color-accent);
    margin-bottom: var(--space-sm);
}

/* Footer */
.global-footer {
    padding: var(--space-2xl) 0 var(--space-md);
    background-color: var(--color-bg);
    border-top: 1px solid var(--color-border);
}

.footer-top {
    margin-bottom: var(--space-2xl);
}

.footer-bottom {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    padding-top: var(--space-md);
    border-top: 1px solid var(--color-border);
}

.footer-logo {
    width: 170px;
    object-fit: contain;
}

@media (min-width: 768px) {
    .footer-bottom {
        flex-direction: row;
        justify-content: space-between;
    }
}

/* ==========================================================================
   ANIMATIONS & REVEALS
   ========================================================================== */
.reveal, .reveal-slide-left, .reveal-slide-right, .reveal-scale {
    opacity: 0;
    will-change: opacity, transform;
    transition: opacity 1.0s cubic-bezier(0.16, 1, 0.3, 1) 150ms, transform 1.0s cubic-bezier(0.16, 1, 0.3, 1) 150ms;
}

/* Delay Utilities */
.delay-100 { transition-delay: 250ms !important; }
.delay-200 { transition-delay: 350ms !important; }

.reveal {
    transform: translateY(80px);
}
.reveal-slide-left {
    transform: translateX(80px);
}
.reveal-slide-right {
    transform: translateX(-80px);
}
.reveal-scale {
    transform: scale(0.85);
}

.reveal.is-visible, 
.reveal-slide-left.is-visible, 
.reveal-slide-right.is-visible {
    opacity: 1;
    transform: translate(0, 0);
}

.reveal-scale.is-visible {
    opacity: 1;
    transform: scale(1);
}

/* Keyframes & Additional Animations */
@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-15px); }
    100% { transform: translateY(0px); }
}

.animate-float {
    animation: float 6s ease-in-out infinite;
}

.animate-float-delayed {
    animation: float 7s ease-in-out 1s infinite;
}

/* Removed pulse glow animations entirely */

/* Parallax */
.parallax-element {
    will-change: transform;
}

/* Delay modifiers */
.delay-100 { transition-delay: 0.1s; }
.delay-200 { transition-delay: 0.2s; }
.delay-300 { transition-delay: 0.3s; }
.delay-400 { transition-delay: 0.4s; }

@media (prefers-reduced-motion: reduce) {
    .reveal, .animate-float, .animate-float-delayed {
        transition: none !important;
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }
    .hero-image-wrapper img {
        transition: none !important;
        transform: none !important;
    }
    .work-visual img {
        transition: none !important;
    }
}

/* ==========================================================================
   INTERACTIVE EFFECTS (Framer-style)
   ========================================================================== */
@media (pointer: fine) {
    body, a, button, .btn {
        cursor: none;
    }
    
    .cursor-dot, .cursor-outline {
        position: fixed;
        top: 0;
        left: 0;
        border-radius: 50%;
        z-index: 9999;
        pointer-events: none;
        transform: translate(-50%, -50%);
    }
    
    .cursor-dot {
        width: 6px;
        height: 6px;
        background-color: var(--color-accent);
    }
    
    .cursor-outline {
        width: 32px;
        height: 32px;
        border: 1px solid rgba(0, 113, 227, 0.4);
        transition: width 0.2s var(--ease-out), height 0.2s var(--ease-out), background-color 0.2s var(--ease-out), border-color 0.2s var(--ease-out);
        will-change: width, height, transform, background-color;
    }
    
    .cursor-outline.is-hovering {
        width: 56px;
        height: 56px;
        background-color: rgba(0, 113, 227, 0.08);
        border-color: transparent;
    }
}

.scrub-word {
    transition: opacity 1.2s var(--ease-out);
}
