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

:root {
    --bg: #0a0a0f;
    --bg-card: #12121a;
    --bg-section: #0e0e16;
    --surface: #1a1a2e;
    --text: #e8e8f0;
    --text-muted: #8888a0;
    --accent: #7c3aed;
    --accent2: #06b6d4;
    --gradient: linear-gradient(135deg, #7c3aed, #06b6d4);
    --gradient-glow: linear-gradient(135deg, rgba(124,58,237,.15), rgba(6,182,212,.15));
    --border: rgba(255,255,255,.06);
    --radius: 16px;
    --radius-sm: 10px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --mono: 'JetBrains Mono', monospace;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

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

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

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

/* ===== HEADER ===== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 16px 0;
    background: rgba(10, 10, 15, .85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
}

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

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

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

.nav {
    display: flex;
    gap: 32px;
}

.nav-link {
    font-size: .9rem;
    color: var(--text-muted);
    transition: color .25s;
}

.nav-link:hover {
    color: var(--text);
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 28px;
    border-radius: 50px;
    font-size: .95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all .3s;
    border: none;
    font-family: var(--font);
}

.btn-primary {
    background: var(--gradient);
    color: #fff;
    box-shadow: 0 4px 24px rgba(124,58,237,.3);
}

.btn-primary:hover {
    box-shadow: 0 8px 32px rgba(124,58,237,.5);
    transform: translateY(-2px);
}

.btn-ghost {
    background: transparent;
    border: 1px solid rgba(255,255,255,.15);
    color: var(--text);
}

.btn-ghost:hover {
    border-color: var(--accent);
    background: rgba(124,58,237,.08);
}

.btn-lg {
    padding: 16px 40px;
    font-size: 1.05rem;
}

.header-cta {
    padding: 10px 22px;
    font-size: .85rem;
}

/* ===== HERO ===== */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    overflow: hidden;
    padding-top: 80px;
}

.hero-bg-glow {
    position: absolute;
    top: -30%;
    left: -10%;
    width: 70%;
    height: 120%;
    background: radial-gradient(ellipse, rgba(124,58,237,.12) 0%, transparent 70%);
    pointer-events: none;
}

.hero-inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.hero-tag {
    font-family: var(--mono);
    font-size: .85rem;
    color: var(--accent2);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 20px;
}

.hero-title {
    font-size: clamp(2.2rem, 4.5vw, 3.5rem);
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 24px;
}

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

.hero-sub {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 480px;
    margin-bottom: 36px;
}

.hero-btns {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.hero-scroll-hint {
    position: absolute;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: .8rem;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(8px); }
}

/* ===== 3D FLIP CARD ===== */
.hero-visual {
    display: flex;
    justify-content: center;
    align-items: center;
}

.flip-card {
    width: 300px;
    height: 380px;
    perspective: 1000px;
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform .8s cubic-bezier(.34,1.3,.45,1);
}

.flip-card.flipped .flip-card-inner {
    transform: rotateY(180deg);
}

.flip-card-front,
.flip-card-back {
    position: absolute;
    inset: 0;
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    backface-visibility: hidden;
}

.flip-card-front {
    background: var(--bg-card);
    border: 1px solid var(--border);
    box-shadow: 0 20px 60px rgba(0,0,0,.4), inset 0 1px 0 rgba(255,255,255,.05);
}

.flip-card-back {
    background: var(--gradient);
    transform: rotateY(180deg);
}

.card-logo {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    background: var(--gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 24px;
}

.card-name {
    font-size: 1.4rem;
    font-weight: 700;
}

.card-type {
    font-size: .85rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.back-icon {
    font-size: 3rem;
    margin-bottom: 20px;
}

.back-text {
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
    text-align: center;
    padding: 0 24px;
}

/* ===== SECTIONS ===== */
.section {
    padding: 100px 0;
}

.section-dark {
    background: var(--bg-section);
}

.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-tag {
    font-family: var(--mono);
    font-size: .8rem;
    color: var(--accent2);
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.section-title {
    font-size: clamp(1.8rem, 3vw, 2.5rem);
    font-weight: 700;
}

/* ===== SERVICES ===== */
.services-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.service-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 36px 28px;
    transition: transform .3s, border-color .3s;
}

.service-card:hover {
    border-color: rgba(124,58,237,.3);
    transform: translateY(-4px);
}

.service-icon {
    font-size: 2.5rem;
    margin-bottom: 20px;
}

.service-card h3 {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 12px;
}

.service-card p {
    font-size: .9rem;
    color: var(--text-muted);
    line-height: 1.65;
}

/* ===== PROJECTS ===== */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.project-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform .3s;
}

.project-card:hover {
    transform: translateY(-4px);
}

.project-preview {
    position: relative;
}

.project-thumb {
    height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.thumb-1 { background: linear-gradient(135deg, #1a1040, #0d1b2a); }
.thumb-2 { background: linear-gradient(135deg, #0d2137, #0a1628); }
.thumb-3 { background: linear-gradient(135deg, #162033, #0b1520); }
.thumb-4 { background: linear-gradient(135deg, #1a1535, #0f1a2a); }

.play-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(255,255,255,.1);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: #fff;
    cursor: pointer;
    transition: background .3s, transform .3s;
    border: 1px solid rgba(255,255,255,.15);
}

.play-btn:hover {
    background: var(--accent);
    transform: scale(1.1);
}

.project-info {
    padding: 24px;
}

.project-tag {
    display: inline-block;
    font-family: var(--mono);
    font-size: .7rem;
    color: var(--accent2);
    background: rgba(6,182,212,.1);
    padding: 4px 10px;
    border-radius: 20px;
    margin-bottom: 12px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.project-info h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.project-info p {
    font-size: .85rem;
    color: var(--text-muted);
}

/* ===== PROCESS ===== */
.process-steps {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.process-step {
    text-align: center;
    padding: 32px 20px;
}

.step-num {
    font-family: var(--mono);
    font-size: 2rem;
    font-weight: 700;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 16px;
}

.process-step h3 {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.process-step p {
    font-size: .85rem;
    color: var(--text-muted);
    line-height: 1.6;
}

/* ===== CTA ===== */
.section-cta {
    padding: 80px 0;
}

.cta-card {
    text-align: center;
    background: var(--gradient-glow);
    border: 1px solid rgba(124,58,237,.2);
    border-radius: var(--radius);
    padding: 64px 40px;
}

.cta-card h2 {
    font-size: clamp(1.6rem, 2.5vw, 2.2rem);
    font-weight: 700;
    margin-bottom: 16px;
}

.cta-card p {
    color: var(--text-muted);
    margin-bottom: 32px;
    font-size: 1rem;
}

/* ===== FOOTER ===== */
.footer {
    border-top: 1px solid var(--border);
    padding: 48px 0 32px;
}

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

.footer-brand p {
    font-size: .8rem;
    color: var(--text-muted);
    margin-top: 4px;
}

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

.footer-links a {
    font-size: .85rem;
    color: var(--text-muted);
    transition: color .25s;
}

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

.footer-copy {
    font-size: .75rem;
    color: var(--text-muted);
    width: 100%;
    text-align: center;
    margin-top: 24px;
}

/* ===== SCROLL ANIMATIONS ===== */
.rv {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity .75s cubic-bezier(.22,1,.36,1), transform .75s cubic-bezier(.22,1,.36,1);
}

.rv.in {
    opacity: 1;
    transform: none;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 960px) {
    .hero-inner {
        grid-template-columns: 1fr;
        text-align: center;
    }
    .hero-sub {
        margin-left: auto;
        margin-right: auto;
    }
    .hero-btns {
        justify-content: center;
    }
    .hero-visual {
        margin-top: 40px;
    }
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .process-steps {
        grid-template-columns: repeat(2, 1fr);
    }
    .nav {
        display: none;
    }
}

@media (max-width: 600px) {
    .services-grid,
    .projects-grid,
    .process-steps {
        grid-template-columns: 1fr;
    }
    .footer-inner {
        flex-direction: column;
        text-align: center;
    }
    .footer-links {
        justify-content: center;
    }
}

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
    }
    .rv {
        opacity: 1 !important;
        transform: none !important;
    }
    .hero-scroll-hint {
        animation: none;
    }
    html {
        scroll-behavior: auto;
    }
}