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

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

body {
    overflow-x: hidden;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

img {
    max-width: 100%;
    height: auto;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    color: var(--color-text-main);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.03em;
}

p {
    color: var(--color-text-secondary);
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition-fast);
}

ul {
    list-style: none;
}

/* Utilities */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

.flex {
    display: flex;
}

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

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

.grid {
    display: grid;
    gap: 20px;
}

.text-gradient {
    background: linear-gradient(to right, var(--color-primary), var(--color-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.section {
    padding: 80px 0;
    position: relative;
    z-index: 1;
}

.hidden {
    display: none;
}

/* Scroll Animations */
.fade-in-section {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
    will-change: opacity, visibility;
}

.fade-in-section.is-visible {
    opacity: 1;
    transform: none;
}

/* ===========================================================
   NEURAL PARTICLE FIELD (global ambient background)
   =========================================================== */
#neural-field {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    opacity: 0;
    transition: opacity 1.2s ease;
}

#neural-field.is-live {
    opacity: 1;
}

/* ===========================================================
   "INITIALIZING…" BOOT OVERLAY
   =========================================================== */
#boot-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000000;
    transition: opacity 0.5s ease;
}

#boot-overlay.is-done {
    opacity: 0;
    pointer-events: none;
}

#boot-overlay .boot-text {
    font-family: var(--font-mono);
    font-size: 0.95rem;
    letter-spacing: 0.18em;
    color: var(--color-primary);
    text-transform: uppercase;
}

#boot-overlay .boot-text::after {
    content: '_';
    animation: bootBlink 0.8s step-end infinite;
}

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

/* ===========================================================
   SCROLL-REVEAL UTILITIES (enhanced)
   =========================================================== */
.reveal-up {
    opacity: 0;
    transform: translateY(60px);
    transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}

.reveal-up.is-visible {
    opacity: 1;
    transform: none;
}

/* Stagger children — set --i on each child for incremental delay */
.stagger > .is-visible,
.stagger.is-visible > * {
    transition-delay: calc(var(--i, 0) * 0.1s);
}

/* Cards scale slightly on entry */
.reveal-scale {
    opacity: 0;
    transform: translateY(40px) scale(0.96);
    transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}

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

/* Clip-path reveal for section titles */
.reveal-clip {
    clip-path: inset(0 100% 0 0);
    transition: clip-path 0.8s ease;
}

.reveal-clip.is-visible {
    clip-path: inset(0 0% 0 0);
}

/* ===========================================================
   GLOWING ACCENT LINE (shimmer divider / card top border)
   =========================================================== */
.accent-line {
    height: 1px;
    width: 100%;
    border: none;
    background: linear-gradient(90deg, transparent, var(--color-primary), transparent);
    background-size: 200% auto;
    animation: shimmer 3s linear infinite;
}

@keyframes shimmer {
    0% { background-position: -200% center; }
    100% { background-position: 200% center; }
}

@media (prefers-reduced-motion: reduce) {
    #neural-field { display: none; }
    .accent-line { animation: none; }
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
}

@media (max-width: 900px) {
    html {
        font-size: 15px;
    }

    .container {
        padding: 0 16px;
    }

    .section {
        padding: 64px 0;
    }

    .flex {
        flex-wrap: wrap;
    }

    .flex-between {
        flex-direction: column;
        align-items: flex-start;
        gap: 28px;
    }
}
