/* ===== Custom Properties ===== */
:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-tertiary: #1a1a2e;
    --accent: #6c63ff;
    --accent-glow: #8b83ff;
    --accent-subtle: rgba(108, 99, 255, 0.1);
    --text-primary: #e8e8ed;
    --text-secondary: #9494a8;
    --text-heading: #ffffff;
    --border: rgba(255, 255, 255, 0.06);
    --gradient-hero: linear-gradient(135deg, #6c63ff 0%, #3b82f6 100%);
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --container: 1120px;
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    font-family: var(--font);
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text-primary);
    background: var(--bg-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

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

/* ===== Layout ===== */
.container {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.section {
    padding: 7rem 0;
}

.section__label {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 1rem;
    position: relative;
    padding-left: 2.5rem;
}

.section__label::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    width: 2rem;
    height: 2px;
    background: var(--accent);
}

.section__title {
    font-size: clamp(1.8rem, 3vw, 2.8rem);
    font-weight: 800;
    color: var(--text-heading);
    line-height: 1.2;
    margin-bottom: 1.5rem;
}

.section__subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin-bottom: 3rem;
}

/* ===== Navigation ===== */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 1.25rem 0;
    transition: background 0.3s ease, backdrop-filter 0.3s ease, padding 0.3s ease;
}

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

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

.nav__logo {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-heading);
    letter-spacing: -0.02em;
}

.nav__logo span {
    color: var(--accent);
}

.nav__links {
    display: flex;
    list-style: none;
    gap: 2.5rem;
}

.nav__links a {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: color 0.2s ease;
    position: relative;
}

.nav__links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: width 0.2s ease;
}

.nav__links a:hover,
.nav__links a.active {
    color: var(--text-heading);
}

.nav__links a.active::after {
    width: 100%;
}

.nav__toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    z-index: 1001;
}

.nav__toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-heading);
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.nav__toggle.open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.nav__toggle.open span:nth-child(2) {
    opacity: 0;
}

.nav__toggle.open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ===== Hero ===== */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.hero__bg {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.hero__orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
}

.hero__orb--1 {
    width: 500px;
    height: 500px;
    background: var(--accent);
    top: -10%;
    right: -5%;
    animation: orbFloat1 18s ease-in-out infinite;
}

.hero__orb--2 {
    width: 400px;
    height: 400px;
    background: #3b82f6;
    bottom: -10%;
    left: -5%;
    animation: orbFloat2 22s ease-in-out infinite;
}

.hero__orb--3 {
    width: 300px;
    height: 300px;
    background: #8b5cf6;
    top: 40%;
    left: 40%;
    animation: orbFloat3 15s ease-in-out infinite;
}

@keyframes orbFloat1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(-60px, 40px) scale(1.1); }
    66% { transform: translate(30px, -20px) scale(0.95); }
}

@keyframes orbFloat2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(50px, -30px) scale(1.05); }
    66% { transform: translate(-40px, 50px) scale(0.9); }
}

@keyframes orbFloat3 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-70px, -40px) scale(1.15); }
}

.hero__content {
    position: relative;
    text-align: center;
    max-width: 800px;
}

.hero__badge {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    padding: 0.4rem 1.2rem;
    border-radius: 100px;
    margin-bottom: 2rem;
    background: rgba(255, 255, 255, 0.03);
}

.hero__title {
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    font-weight: 800;
    color: var(--text-heading);
    line-height: 1.1;
    letter-spacing: -0.03em;
    margin-bottom: 1.5rem;
}

.hero__subtitle {
    font-size: clamp(1rem, 1.5vw, 1.2rem);
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 2.5rem;
    line-height: 1.7;
}

.hero__cta {
    display: inline-block;
    padding: 0.9rem 2.5rem;
    background: var(--gradient-hero);
    color: #fff;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 100px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 20px rgba(108, 99, 255, 0.3);
}

.hero__cta:hover {
    transform: scale(1.03);
    box-shadow: 0 6px 30px rgba(108, 99, 255, 0.5);
}

.hero__scroll {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
}

.hero__scroll span {
    display: block;
    width: 2px;
    height: 40px;
    background: var(--text-secondary);
    opacity: 0.4;
    position: relative;
    overflow: hidden;
}

.hero__scroll span::after {
    content: '';
    position: absolute;
    top: -100%;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--accent);
    animation: scrollLine 2s ease-in-out infinite;
}

@keyframes scrollLine {
    0% { top: -100%; }
    50% { top: 100%; }
    100% { top: 100%; }
}

/* ===== About ===== */
.about__grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 4rem;
    align-items: start;
    margin-top: 1rem;
}

.about__text p {
    margin-bottom: 1.25rem;
    color: var(--text-primary);
}

.about__text p:last-child {
    margin-bottom: 0;
}

.about__stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.stat {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    transition: border-color 0.3s ease;
}

.stat:hover {
    border-color: rgba(108, 99, 255, 0.2);
}

.stat__number {
    display: block;
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--accent);
    margin-bottom: 0.3rem;
    line-height: 1.2;
}

.stat__label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* ===== Services ===== */
.services {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.services__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.card {
    background: rgba(26, 26, 46, 0.5);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2rem;
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition-delay: calc(var(--i, 0) * 0.1s);
}

.card:hover {
    transform: translateY(-4px);
    border-color: rgba(108, 99, 255, 0.3);
    box-shadow: 0 8px 30px rgba(108, 99, 255, 0.1);
}

.card__icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-subtle);
    border-radius: 12px;
    margin-bottom: 1.25rem;
    color: var(--accent);
}

.card__icon svg {
    width: 24px;
    height: 24px;
}

.card__title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-heading);
    margin-bottom: 0.75rem;
}

.card__text {
    font-size: 0.92rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* ===== Contact ===== */
.contact {
    text-align: center;
}

.contact .section__title {
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.contact__subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 3rem;
}

.contact__links {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
}

.contact__link {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-primary);
    padding: 0.75rem 1.5rem;
    border: 1px solid var(--border);
    border-radius: 100px;
    background: var(--bg-secondary);
    transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.contact__link:hover {
    border-color: var(--accent);
    color: var(--text-heading);
    background: var(--accent-subtle);
}

.contact__link svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* ===== Footer ===== */
.footer {
    border-top: 1px solid var(--border);
    padding: 2rem 0;
    text-align: center;
}

.footer__logo {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.footer__logo span {
    color: var(--accent);
}

.footer__cvr {
    font-size: 0.8rem;
    color: var(--text-secondary);
    opacity: 0.5;
    margin-top: 0.5rem;
}

.footer__copy {
    font-size: 0.8rem;
    color: var(--text-secondary);
    opacity: 0.6;
    margin-top: 0.25rem;
}

/* ===== Noise/Grain Overlay ===== */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: none;
    opacity: 0.035;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 256px 256px;
}

/* ===== Card Border Glow ===== */
.card {
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    background: conic-gradient(from var(--glow-angle, 0deg), transparent 60%, var(--accent) 80%, var(--accent-glow) 90%, transparent 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: -1;
}

.card::after {
    content: '';
    position: absolute;
    inset: 1px;
    border-radius: inherit;
    background: rgba(26, 26, 46, 0.5);
    z-index: -1;
}

.card:hover::before {
    opacity: 0.5;
    animation: glowSpin 6s linear infinite;
}

@keyframes glowSpin {
    to { --glow-angle: 360deg; }
}

@property --glow-angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}

/* ===== Scroll Reveal ===== */
[data-reveal] {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

[data-reveal].visible {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger cards */
.card[data-reveal] {
    transition-delay: calc(var(--i, 0) * 0.15s);
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
    .about__grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
}

@media (max-width: 768px) {
    .section {
        padding: 5rem 0;
    }

    .nav__toggle {
        display: flex;
    }

    .nav__links {
        position: fixed;
        inset: 0;
        background: rgba(10, 10, 15, 0.97);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2.5rem;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
    }

    .nav__links.open {
        opacity: 1;
        pointer-events: all;
    }

    .nav__links a {
        font-size: 1.5rem;
    }

    .hero__orb--1 {
        width: 300px;
        height: 300px;
    }

    .hero__orb--2 {
        width: 250px;
        height: 250px;
    }

    .hero__orb--3 {
        width: 200px;
        height: 200px;
    }

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

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

    .contact__link {
        width: 100%;
        max-width: 340px;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .about__stats {
        grid-template-columns: 1fr;
    }
}

/* ===== Reduced Motion ===== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    html {
        scroll-behavior: auto;
    }

    [data-reveal] {
        opacity: 1;
        transform: none;
    }

    body::after {
        display: none;
    }
}
