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

:root {
    --bg: #0a0a0f;
    --bg-card: #12121a;
    --bg-card-hover: #1a1a26;
    --border: #1e1e2e;
    --text: #e4e4e7;
    --text-muted: #71717a;
    --primary: #6366f1;
    --primary-light: #818cf8;
    --primary-glow: rgba(99, 102, 241, 0.15);
    --accent: #22d3ee;
    --radius: 12px;
    --radius-sm: 8px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
    -webkit-tap-highlight-color: transparent;
}

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

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* === Buttons === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 32px;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    gap: 8px;
}

.btn--primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 0 24px var(--primary-glow);
}

.btn--primary:hover {
    background: var(--primary-light);
    box-shadow: 0 0 40px var(--primary-glow);
    transform: translateY(-2px);
}

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

.btn--outline:hover {
    border-color: var(--primary);
    color: var(--primary-light);
}

.btn--full { width: 100%; }

/* === Header === */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 16px 0;
    transition: var(--transition);
    background: transparent;
}

.header--scrolled {
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 12px 0;
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.15rem;
    font-weight: 700;
}

.logo__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--primary);
    color: #fff;
    border-radius: 8px;
    font-weight: 800;
    font-size: 1.1rem;
}

.logo__dot { color: var(--primary-light); }

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

.nav__link {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
    transition: var(--transition);
    position: relative;
}

.nav__link:hover,
.nav__link--active { color: var(--text); }

.nav__link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: var(--transition);
}

.nav__link:hover::after { width: 100%; }

.header__right {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Language Switcher */
.lang-switcher {
    display: flex;
    gap: 4px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 3px;
}

.lang-btn {
    padding: 6px 12px;
    font-size: 0.75rem;
    font-weight: 600;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 6px;
    transition: var(--transition);
    font-family: inherit;
    letter-spacing: 0.5px;
}

.lang-btn:hover { color: var(--text); }

.lang-btn.active {
    background: var(--primary);
    color: #fff;
}

/* Burger */
.burger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.burger span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: var(--transition);
}

.burger.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger.active span:nth-child(2) { opacity: 0; }
.burger.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* === Hero === */
.hero {
    padding: 160px 0 100px;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--primary-glow) 0%, transparent 70%);
    pointer-events: none;
}

.hero__inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 64px;
    align-items: center;
}

.hero__badge {
    display: inline-block;
    padding: 8px 16px;
    background: var(--primary-glow);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--primary-light);
    margin-bottom: 24px;
}

.hero__title {
    font-size: clamp(2.2rem, 5vw, 3.5rem);
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 20px;
    letter-spacing: -0.02em;
}

.hero__subtitle {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 36px;
    max-width: 500px;
    line-height: 1.7;
}

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

/* Terminal */
.terminal {
    background: #0d0d14;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.terminal__header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: rgba(30, 30, 46, 0.5);
    border-bottom: 1px solid var(--border);
}

.terminal__dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.terminal__dot--red { background: #ff5f57; }
.terminal__dot--yellow { background: #febc2e; }
.terminal__dot--green { background: #28c840; }

.terminal__title {
    margin-left: auto;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.terminal__body { padding: 20px; min-height: 120px; }

.terminal__line {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
    font-size: 0.9rem;
}

.terminal__prompt { color: var(--accent); font-weight: 700; }
.terminal__cmd { color: var(--text); }

.terminal__cursor {
    color: var(--primary-light);
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    50% { opacity: 0; }
}

/* === Section Common === */
.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-title {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    font-weight: 800;
    margin-bottom: 16px;
    letter-spacing: -0.02em;
}

.section-subtitle {
    font-size: 1.05rem;
    color: var(--text-muted);
    max-width: 500px;
    margin: 0 auto;
}

/* === Services === */
.services {
    padding: 100px 0;
    position: relative;
}

.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;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    opacity: 0;
    transition: var(--transition);
}

.service-card:hover {
    border-color: rgba(99, 102, 241, 0.3);
    background: var(--bg-card-hover);
    transform: translateY(-4px);
}

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

.service-card__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    background: var(--primary-glow);
    border-radius: 12px;
    color: var(--primary-light);
    margin-bottom: 24px;
}

.service-card__title {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.service-card__text {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 20px;
    line-height: 1.7;
}

.service-card__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    list-style: none;
}

.service-card__tags li {
    padding: 4px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 100px;
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* === About / Stats === */
.about {
    padding: 100px 0;
    background: linear-gradient(180deg, transparent, rgba(99, 102, 241, 0.03), transparent);
}

.about__grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.stat-card {
    text-align: center;
    padding: 40px 24px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: var(--transition);
}

.stat-card:hover {
    border-color: rgba(99, 102, 241, 0.3);
    transform: translateY(-4px);
}

.stat-card__number {
    font-size: 2.8rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-light), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.stat-card__label {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* === Process === */
.process { padding: 100px 0; }

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

.process__steps::before {
    content: '';
    position: absolute;
    top: 40px;
    left: 10%;
    right: 10%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border), var(--border), transparent);
}

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

.step__number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 2px solid var(--primary);
    color: var(--primary-light);
    font-weight: 800;
    font-size: 1.1rem;
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
}

.step__title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.step__text {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.7;
}

/* === Contact === */
.contact {
    padding: 100px 0;
    background: linear-gradient(180deg, transparent, rgba(99, 102, 241, 0.03), transparent);
}

.contact-form {
    max-width: 640px;
    margin: 0 auto;
}

.contact-form__row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 0.95rem;
    font-family: inherit;
    transition: var(--transition);
    outline: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-muted);
    opacity: 0.6;
}

.form-group select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2371717a' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 44px;
}

.form-group select option {
    background: var(--bg-card);
    color: var(--text);
}

.form-status {
    text-align: center;
    margin-top: 16px;
    font-size: 0.9rem;
    min-height: 24px;
}

.form-status--success { color: #22c55e; }
.form-status--error { color: #ef4444; }

/* Captcha */
.captcha {
    display: flex;
    align-items: center;
    gap: 12px;
}

.captcha canvas {
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    flex-shrink: 0;
}

.captcha__refresh {
    width: 44px;
    height: 44px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 1.3rem;
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
}

.captcha__refresh:hover {
    border-color: var(--primary);
    color: var(--primary-light);
}

.captcha input {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 1.1rem;
    font-family: inherit;
    transition: var(--transition);
    outline: none;
    letter-spacing: 4px;
    text-align: center;
}

.captcha input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

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

.footer__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}

.footer__tagline {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 8px;
}

.footer__links a {
    color: var(--text-muted);
    font-size: 0.9rem;
    transition: var(--transition);
}

.footer__links a:hover { color: var(--primary-light); }

.footer__copy {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* === Tablet (<=1024px) === */
@media (max-width: 1024px) {
    .services__grid { grid-template-columns: 1fr 1fr; }
    .about__grid { grid-template-columns: repeat(4, 1fr); }
    .process__steps { grid-template-columns: repeat(2, 1fr); }
    .hero__inner { gap: 40px; }
}

/* === Mobile (<=768px) === */
@media (max-width: 768px) {
    /* Prevent iOS zoom on input focus */
    input, select, textarea { font-size: 16px !important; }

    .container { padding: 0 16px; }

    /* Nav overlay */
    .nav {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(10, 10, 15, 0.98);
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 32px;
        z-index: 99;
    }
    .nav.active { display: flex; }
    .nav__link { font-size: 1.4rem; padding: 8px 0; }

    .burger { display: flex; z-index: 100; }

    /* Hero */
    .hero { padding: 120px 0 60px; }
    .hero__inner {
        grid-template-columns: 1fr;
        gap: 36px;
        text-align: center;
    }
    .hero__badge { font-size: 0.8rem; }
    .hero__title { font-size: 1.8rem; }
    .hero__subtitle {
        font-size: 1rem;
        margin: 0 auto 28px;
    }
    .hero__actions {
        justify-content: center;
        flex-direction: column;
        gap: 12px;
    }
    .hero__actions .btn { width: 100%; }

    /* Terminal */
    .terminal__body { padding: 14px; min-height: 80px; }
    .terminal__line { font-size: 0.8rem; }

    /* Sections */
    .services, .about, .process, .contact { padding: 60px 0; }
    .section-header { margin-bottom: 36px; }
    .section-title { font-size: 1.5rem; }
    .section-subtitle { font-size: 0.95rem; }

    /* Services */
    .services__grid { grid-template-columns: 1fr; gap: 16px; }
    .service-card { padding: 24px; }
    .service-card__icon { width: 48px; height: 48px; margin-bottom: 16px; }
    .service-card__title { font-size: 1.15rem; }
    .service-card__text { font-size: 0.9rem; margin-bottom: 14px; }

    /* Stats */
    .about__grid { grid-template-columns: 1fr 1fr; gap: 12px; }
    .stat-card { padding: 24px 16px; }
    .stat-card__number { font-size: 2rem; }
    .stat-card__label { font-size: 0.8rem; }

    /* Process */
    .process__steps { grid-template-columns: 1fr 1fr; gap: 16px; }
    .process__steps::before { display: none; }
    .step { padding: 20px 12px; }
    .step__number { width: 44px; height: 44px; font-size: 0.95rem; margin-bottom: 14px; }
    .step__title { font-size: 1rem; }
    .step__text { font-size: 0.85rem; }

    /* Form */
    .contact-form__row { grid-template-columns: 1fr; }
    .form-group input,
    .form-group select,
    .form-group textarea { padding: 12px 14px; }

    /* Captcha */
    .captcha { flex-wrap: wrap; gap: 10px; }
    .captcha canvas { width: 140px; height: 44px; }
    .captcha__refresh { width: 44px; height: 44px; }
    .captcha input { min-width: 0; }

    /* Buttons - bigger touch targets */
    .btn { padding: 16px 24px; font-size: 1rem; min-height: 50px; }

    /* Lang switcher */
    .lang-btn { padding: 8px 10px; font-size: 0.85rem; min-width: 36px; min-height: 36px; }

    /* Footer */
    .footer { padding: 32px 0; }
    .footer__inner {
        flex-direction: column;
        text-align: center;
        gap: 12px;
    }
}

/* === Small phones (<=420px) === */
@media (max-width: 420px) {
    .hero { padding: 110px 0 48px; }
    .hero__title { font-size: 1.5rem; }
    .hero__subtitle { font-size: 0.9rem; }
    .hero__badge { font-size: 0.75rem; padding: 6px 12px; }

    .about__grid { grid-template-columns: 1fr 1fr; gap: 8px; }
    .stat-card { padding: 20px 10px; }
    .stat-card__number { font-size: 1.7rem; }

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

    .services, .about, .process, .contact { padding: 48px 0; }

    .section-title { font-size: 1.3rem; }

    .captcha {
        flex-direction: row;
        justify-content: center;
    }
    .captcha canvas { width: 120px; height: 40px; }
    .captcha input { flex: 1; }
}

/* ───────── enhancements for /new/ ───────── */

/* Hero aurora — two slow-drifting blurred blobs */
.hero { isolation: isolate; }

.hero__aurora {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.hero__blob {
    position: absolute;
    width: 560px;
    height: 560px;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.55;
    will-change: transform;
}

.hero__blob--a {
    top: -160px;
    left: -140px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.55), transparent 70%);
    animation: heroFloatA 22s ease-in-out infinite alternate;
}

.hero__blob--b {
    bottom: -180px;
    right: -100px;
    background: radial-gradient(circle, rgba(34, 211, 238, 0.32), transparent 70%);
    animation: heroFloatB 28s ease-in-out infinite alternate;
}

@keyframes heroFloatA {
    0%   { transform: translate3d(0, 0, 0) scale(1); }
    100% { transform: translate3d(60px, 80px, 0) scale(1.08); }
}

@keyframes heroFloatB {
    0%   { transform: translate3d(0, 0, 0) scale(1); }
    100% { transform: translate3d(-80px, -60px, 0) scale(0.94); }
}

/* Subtle dot grid behind hero, fades to bg at edges */
.hero__grid {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.045) 1px, transparent 0);
    background-size: 28px 28px;
    mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 55%, transparent 100%);
    -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 55%, transparent 100%);
    pointer-events: none;
    z-index: 0;
}

.hero .container { position: relative; z-index: 1; }

/* Remove the old radial ::before so it doesn't double up with the new aurora */
.hero::before { display: none; }

/* Pointer-follow spotlight on cards (only on fine pointer) */
@media (pointer: fine) {
    .service-card,
    .stat-card {
        --mx: 50%;
        --my: 50%;
    }

    .service-card::after,
    .stat-card::after {
        content: '';
        position: absolute;
        inset: 0;
        border-radius: inherit;
        background: radial-gradient(
            600px circle at var(--mx) var(--my),
            rgba(99, 102, 241, 0.12),
            transparent 40%
        );
        opacity: 0;
        transition: opacity 0.25s ease;
        pointer-events: none;
    }

    .service-card:hover::after,
    .stat-card:hover::after {
        opacity: 1;
    }
}

.service-card { position: relative; }
.stat-card    { position: relative; }

/* Count-up: animate color fade in as numbers roll */
.stat-card__number.is-counting {
    animation: numGlow 1.6s ease-out;
}

@keyframes numGlow {
    0%   { filter: brightness(1) drop-shadow(0 0 0 transparent); }
    50%  { filter: brightness(1.15) drop-shadow(0 0 14px rgba(129, 140, 248, 0.35)); }
    100% { filter: brightness(1) drop-shadow(0 0 0 transparent); }
}

/* Primary CTA — very faint breathing glow */
.btn--primary {
    animation: btnPulse 4s ease-in-out infinite;
}

@keyframes btnPulse {
    0%, 100% { box-shadow: 0 0 24px var(--primary-glow); }
    50%      { box-shadow: 0 0 36px rgba(99, 102, 241, 0.28); }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
    .hero__blob,
    .btn--primary,
    .stat-card__number {
        animation: none !important;
    }
    .hero__blob { opacity: 0.35; }
}

/* Mobile: disable aurora motion and scale it down to keep paint cheap */
@media (max-width: 768px) {
    .hero__blob { width: 360px; height: 360px; filter: blur(70px); animation: none; }
    .hero__blob--a { top: -100px; left: -80px; opacity: 0.45; }
    .hero__blob--b { bottom: -100px; right: -60px; opacity: 0.35; }
    .btn--primary { animation: none; }
}
