/* ============================================
   CIA Development — Design System
   Apple-inspired, Professional Blue palette
   ============================================ */

/* Skip Navigation */
.skip-link {
    position: absolute;
    top: -100%;
    left: 16px;
    z-index: 10000;
    padding: 8px 16px;
    background: var(--blue-700);
    color: #fff;
    border-radius: 4px;
    font-size: 14px;
    text-decoration: none;
}
.skip-link:focus {
    top: 16px;
}

:root {
    /* Professional Blue Palette */
    --blue-950: #0a1628;
    --blue-900: #0f2a4d;
    --blue-800: #1a4a7a;
    --blue-700: #1e5fad;  /* Primary blue */
    --blue-600: #2d7bc4;
    --blue-500: #3a8fd9;
    --blue-400: #52a3e8;
    --blue-300: #74b8f0;
    --blue-200: #95ccf5;
    --blue-100: #d8eeff;
    --blue-50:  #f0f7ff;

    /* Neutrals */
    --gray-950: #0a0a0a;
    --gray-900: #141414;
    --gray-800: #1e1e1e;
    --gray-700: #333333;
    --gray-600: #555555;
    --gray-500: #777777;
    --gray-400: #999999;
    --gray-300: #bbbbbb;
    --gray-200: #e0e0e0;
    --gray-100: #f2f2f2;
    --gray-50:  #fafafa;
    --white:    #ffffff;

    /* Typography */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-display: 'DM Sans', 'Inter', sans-serif;

    /* Spacing */
    --section-padding: clamp(80px, 12vw, 160px);
    --container-max: 1200px;
    --container-wide: 1400px;

    /* Transitions */
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
    --transition-base: 0.3s var(--ease-out-quart);
    --transition-slow: 0.6s var(--ease-out-expo);
    --transition-reveal: 0.9s var(--ease-out-expo);
}

/* ============================================
   Reset & Base
   ============================================ */

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-size: 16px;
}

body {
    font-family: var(--font-primary);
    color: var(--gray-900);
    background: var(--white);
    line-height: 1.6;
    overflow-x: hidden;
}

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

img {
    display: block;
    max-width: 100%;
}

/* ============================================
   Container
   ============================================ */

.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 clamp(24px, 5vw, 64px);
}

/* ============================================
   Reveal Animations
   ============================================ */

.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity var(--transition-reveal), transform var(--transition-reveal);
}

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

/* Stagger children */
.reveal:nth-child(2) { transition-delay: 0.08s; }
.reveal:nth-child(3) { transition-delay: 0.16s; }
.reveal:nth-child(4) { transition-delay: 0.24s; }
.reveal:nth-child(5) { transition-delay: 0.32s; }
.reveal:nth-child(6) { transition-delay: 0.40s; }

/* ============================================
   Navigation
   ============================================ */

.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 20px 0;
    transition: all 0.4s var(--ease-out-quart);
}

.nav.scrolled {
    padding: 12px 0;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.nav-inner {
    max-width: var(--container-wide);
    margin: 0 auto;
    padding: 0 clamp(24px, 5vw, 64px);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    display: flex;
    align-items: center;
    z-index: 10;
}

.nav-logo-img {
    height: 56px;
    width: auto;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 40px;
}

.nav-links a {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-600);
    transition: color var(--transition-base);
    letter-spacing: 0.01em;
}

.nav-links a:hover {
    color: var(--gray-900);
}

.nav-cta {
    background: var(--blue-700);
    color: var(--white) !important;
    padding: 10px 24px;
    border-radius: 100px;
    font-size: 0.875rem !important;
    transition: background var(--transition-base), transform var(--transition-base) !important;
}

.nav-cta:hover {
    background: var(--blue-800) !important;
    transform: scale(1.02);
}

/* Mobile Toggle */
.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 6px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    z-index: 10;
}

.nav-toggle span {
    display: block;
    width: 24px;
    height: 1.5px;
    background: var(--gray-900);
    transition: all 0.3s var(--ease-out-quart);
    transform-origin: center;
}

.nav-toggle.active span:first-child {
    transform: rotate(45deg) translate(2.5px, 2.5px);
}

.nav-toggle.active span:last-child {
    transform: rotate(-45deg) translate(2.5px, -2.5px);
}

/* Mobile Menu */
.mobile-menu {
    position: fixed;
    inset: 0;
    z-index: 999;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s var(--ease-out-quart);
}

.mobile-menu.active {
    opacity: 1;
    pointer-events: all;
}

.mobile-menu-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 32px;
}

.mobile-link {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 500;
    color: var(--gray-900);
    transition: color var(--transition-base);
}

.mobile-link:hover {
    color: var(--blue-700);
}

/* ============================================
   Hero
   ============================================ */

.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 120px 0 80px;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 60% 50% at 50% 0%, rgba(30, 95, 173, 0.06) 0%, transparent 70%),
        radial-gradient(ellipse 40% 40% at 80% 20%, rgba(82, 163, 232, 0.04) 0%, transparent 60%),
        radial-gradient(ellipse 40% 40% at 20% 80%, rgba(30, 95, 173, 0.03) 0%, transparent 60%);
    pointer-events: none;
}

.hero-content {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 clamp(24px, 5vw, 64px);
    text-align: center;
}

.hero-eyebrow {
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--blue-600);
    margin-bottom: 24px;
}

.hero-title {
    font-family: var(--font-display);
    font-size: clamp(2.75rem, 7vw, 5.5rem);
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: -0.03em;
    color: var(--gray-950);
    margin-bottom: 28px;
}

.hero-title span {
    display: block;
}

.hero-accent {
    background: linear-gradient(135deg, var(--blue-700), var(--blue-500));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-sub {
    font-size: clamp(1.0625rem, 2vw, 1.25rem);
    line-height: 1.7;
    color: var(--gray-500);
    max-width: 600px;
    margin: 0 auto 48px;
}

.hero-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

/* Scroll Indicator */
.hero-scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
}

.scroll-line {
    width: 1px;
    height: 48px;
    background: linear-gradient(to bottom, var(--blue-400), transparent);
    animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
    0%, 100% { opacity: 0.3; transform: scaleY(0.5); transform-origin: top; }
    50% { opacity: 1; transform: scaleY(1); transform-origin: top; }
}

/* ============================================
   Buttons
   ============================================ */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 16px 36px;
    font-size: 0.9375rem;
    font-weight: 600;
    border-radius: 100px;
    border: none;
    cursor: pointer;
    transition: all var(--transition-base);
    letter-spacing: 0.01em;
}

.btn-primary {
    background: var(--blue-700);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--blue-800);
    transform: scale(1.03);
    box-shadow: 0 8px 32px rgba(30, 95, 173, 0.25);
}

.btn-ghost {
    background: transparent;
    color: var(--gray-700);
    border: 1.5px solid var(--gray-200);
}

.btn-ghost:hover {
    border-color: var(--gray-400);
    transform: scale(1.03);
}

.btn-full {
    width: 100%;
    justify-content: center;
}

/* ============================================
   Section Base
   ============================================ */

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

.section-header {
    margin-bottom: clamp(48px, 6vw, 80px);
}

.section-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--blue-600);
    margin-bottom: 16px;
}

.section-title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.03em;
    color: var(--gray-950);
}

/* ============================================
   Work / Portfolio
   ============================================ */

.section-work {
    background: var(--gray-50);
}

.work-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 32px;
}

.work-card {
    display: block;
    border-radius: 20px;
    overflow: hidden;
    background: var(--white);
    border: 1px solid rgba(0, 0, 0, 0.06);
    transition: all 0.5s var(--ease-out-expo);
}

.work-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.08), 0 8px 20px rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.02);
}

.work-card-visual {
    position: relative;
    overflow: hidden;
    background: var(--gray-900);
}

/* Screenshot Image */
.work-card-screenshot {
    overflow: hidden;
    aspect-ratio: 16 / 10;
}

.work-card-screenshot img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    transition: transform 0.6s var(--ease-out-expo), opacity 0.4s;
    opacity: 0.92;
}

.work-card:hover .work-card-screenshot img {
    transform: scale(1.03);
    opacity: 1;
}

/* Work Card Info */
.work-card-info {
    padding: 28px 32px 32px;
}

.work-card-category {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--blue-600);
    margin-bottom: 8px;
}

.work-card-title {
    font-family: var(--font-display);
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 8px;
    letter-spacing: -0.01em;
}

.work-card-desc {
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--gray-500);
    margin-bottom: 16px;
}

.work-card-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--blue-700);
    transition: gap var(--transition-base);
}

.work-card:hover .work-card-link {
    gap: 10px;
}

/* ============================================
   Services
   ============================================ */

.services-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2px;
    background: var(--gray-200);
    border-radius: 20px;
    overflow: hidden;
}

.service-card {
    background: var(--white);
    padding: clamp(32px, 4vw, 48px);
    transition: background var(--transition-base);
}

.service-card:hover {
    background: var(--blue-50);
}

.service-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: var(--blue-50);
    color: var(--blue-700);
    margin-bottom: 24px;
    transition: all var(--transition-base);
}

.service-card:hover .service-icon {
    background: var(--blue-700);
    color: var(--white);
}

.service-title {
    font-family: var(--font-display);
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 12px;
    letter-spacing: -0.01em;
}

.service-desc {
    font-size: 0.9375rem;
    line-height: 1.65;
    color: var(--gray-500);
}

/* ============================================
   Approach
   ============================================ */

.section-approach {
    background: var(--blue-950);
    color: var(--white);
}

.section-approach .section-label {
    color: var(--blue-400);
}

.section-approach .section-title {
    color: var(--white);
}

.approach-timeline {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    position: relative;
}

.approach-timeline::before {
    content: '';
    position: absolute;
    top: 48px;
    left: 10%;
    right: 10%;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--blue-800), var(--blue-800), transparent);
}

.approach-step {
    text-align: center;
    padding: 0 clamp(16px, 2vw, 32px);
}

.step-number {
    font-family: var(--font-display);
    font-size: 3rem;
    font-weight: 700;
    color: var(--blue-700);
    line-height: 1;
    margin-bottom: 24px;
    opacity: 0.5;
    transition: opacity var(--transition-base);
}

.approach-step:hover .step-number {
    opacity: 1;
}

.step-title {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--blue-100);
}

.step-desc {
    font-size: 0.9375rem;
    line-height: 1.65;
    color: var(--blue-300);
    opacity: 0.8;
}

/* ============================================
   Stats
   ============================================ */

.section-stats {
    background: var(--blue-950);
    padding: 0 0 var(--section-padding);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.stats-grid {
    display: flex;
    justify-content: center;
    gap: clamp(48px, 8vw, 120px);
    padding: clamp(40px, 6vw, 80px) 0;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.stat {
    text-align: center;
}

.stat-number {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 700;
    color: var(--blue-400);
    line-height: 1;
    display: inline;
}

.stat-suffix {
    font-family: var(--font-display);
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
    color: var(--blue-400);
    display: inline;
}

.stat-label {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.4);
    margin-top: 8px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    font-weight: 500;
}

/* ============================================
   Contact
   ============================================ */

.section-contact {
    background: var(--gray-50);
}

.contact-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(48px, 8vw, 120px);
    align-items: start;
}

.contact-title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.03em;
    color: var(--gray-950);
    margin-bottom: 20px;
}

.contact-sub {
    font-size: 1.0625rem;
    line-height: 1.7;
    color: var(--gray-500);
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.form-group label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 8px;
    letter-spacing: 0.02em;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 14px 18px;
    font-family: var(--font-primary);
    font-size: 0.9375rem;
    color: var(--gray-900);
    background: var(--white);
    border: 1.5px solid var(--gray-200);
    border-radius: 12px;
    outline: none;
    transition: border-color var(--transition-base), box-shadow var(--transition-base);
    -webkit-appearance: none;
    appearance: none;
}

.form-group select {
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23999' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: var(--blue-500);
    box-shadow: 0 0 0 3px rgba(30, 95, 173, 0.1);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--gray-400);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

/* ============================================
   Footer
   ============================================ */

.footer {
    padding: 48px 0;
    background: var(--white);
    border-top: 1px solid var(--gray-200);
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 24px;
}

.footer-brand {
    display: flex;
    align-items: center;
}

.footer-logo-img {
    height: 52px;
    width: auto;
}

.footer-links {
    display: flex;
    gap: 32px;
}

.footer-links a {
    font-size: 0.875rem;
    color: var(--gray-500);
    transition: color var(--transition-base);
}

.footer-links a:hover {
    color: var(--gray-900);
}

.footer-social {
    display: flex;
    gap: 16px;
}

.footer-social a {
    color: var(--gray-500);
    transition: color var(--transition-base);
}

.footer-social a:hover {
    color: var(--gray-900);
}

.footer-copy {
    font-size: 0.8125rem;
    color: var(--gray-400);
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 1024px) {
    .work-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .approach-timeline {
        grid-template-columns: repeat(2, 1fr);
        gap: 48px;
    }

    .approach-timeline::before {
        display: none;
    }

    .contact-layout {
        grid-template-columns: 1fr;
        gap: 48px;
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

    .nav-toggle {
        display: flex;
    }

    .hero-title {
        font-size: clamp(2.25rem, 10vw, 3.5rem);
    }

    .services-grid {
        grid-template-columns: 1fr;
    }

    .approach-timeline {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .approach-step {
        text-align: left;
        display: flex;
        gap: 24px;
        align-items: flex-start;
    }

    .step-number {
        font-size: 2rem;
        flex-shrink: 0;
        margin-bottom: 0;
    }

    .stats-grid {
        flex-direction: column;
        align-items: center;
        gap: 40px;
    }

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

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

    .work-card-visual {
        padding: 24px 24px 0;
    }

    .work-card-info {
        padding: 24px;
    }
}

@media (max-width: 480px) {
    .hero-actions {
        flex-direction: column;
        width: 100%;
    }

    .hero-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

/* ============================================
   Smooth page load
   ============================================ */

body.loaded .hero .reveal {
    opacity: 1;
    transform: translateY(0);
}

body:not(.loaded) .hero .reveal {
    transition-delay: 0s;
}

body.loaded .hero .reveal:nth-child(1) { transition-delay: 0.1s; }
body.loaded .hero .reveal:nth-child(2) { transition-delay: 0.2s; }
body.loaded .hero .reveal:nth-child(3) { transition-delay: 0.3s; }
body.loaded .hero .reveal:nth-child(4) { transition-delay: 0.4s; }
body.loaded .hero .reveal:nth-child(5) { transition-delay: 0.5s; }
body.loaded .hero .reveal:nth-child(6) { transition-delay: 0.6s; }

/* ============================================
   Custom cursor glow (desktop)
   ============================================ */

.cursor-glow {
    position: fixed;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(30, 95, 173, 0.04) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
    transform: translate(-50%, -50%);
    transition: opacity 0.3s;
}
