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

html {
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--f-body);
    font-size: 16px;
    line-height: 1.6;
    overflow-x: hidden;
}

body.has-fine-pointer {
    cursor: none;
}

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

a {
    color: inherit;
}

button {
    font: inherit;
    color: inherit;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: var(--bg);
}

::-webkit-scrollbar-thumb {
    background: rgba(59, 130, 246, 0.35);
    border-radius: 2px;
}

/* ===== FOCUS (accessibility) ===== */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--blue);
    outline-offset: 3px;
    border-radius: 2px;
}

/* ===== CUSTOM CURSOR (fine-pointer devices only) ===== */
#c-dot,
#c-ring {
    display: none;
}

body.has-fine-pointer #c-dot,
body.has-fine-pointer #c-ring {
    display: block;
}

#c-dot {
    width: 7px;
    height: 7px;
    background: var(--blue);
    border-radius: 50%;
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: var(--z-cursor-dot);
    transform: translate(-50%, -50%);
    box-shadow: 0 0 12px var(--blue), 0 0 24px var(--blue-glow);
    transition: transform .1s, background .2s;
}

#c-ring {
    width: 30px;
    height: 30px;
    border: 1.5px solid rgba(59, 130, 246, .55);
    border-radius: 50%;
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: var(--z-cursor-ring);
    transform: translate(-50%, -50%);
    transition: width .2s, height .2s, border-color .2s;
}

/* ===== BACKGROUND CANVAS ===== */
#bg-canvas {
    position: fixed;
    inset: 0;
    z-index: var(--z-canvas);
    pointer-events: none;
}

/* ===== LAYOUT ===== */
section {
    position: relative;
    z-index: var(--z-content);
}

.container {
    max-width: var(--container-w);
    margin: 0 auto;
    padding: 0 24px;
}

.divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border), transparent);
}

/* ===== TYPOGRAPHY UTILS ===== */
.chrome-grad {
    background: linear-gradient(120deg,
            #E8EEF8 0%, var(--chrome) 25%,
            var(--blue) 55%, var(--chrome) 78%, #E8EEF8 100%);
    background-size: 220% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: sweep 5s linear infinite;
}

.label {
    font-family: var(--f-head);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 3.5px;
    text-transform: uppercase;
    color: var(--blue);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.label::before {
    content: '';
    display: block;
    width: 20px;
    height: 1px;
    background: var(--blue);
}

.sec-title {
    font-family: var(--f-display);
    font-size: clamp(26px, 3.8vw, 40px);
    font-weight: 700;
    line-height: 1.08;
    margin-bottom: 14px;
}

.sec-sub {
    font-size: 15px;
    color: var(--text-sec);
    line-height: 1.75;
    max-width: 540px;
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 13px 26px;
    border-radius: var(--radius-sm);
    font-family: var(--f-head);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    text-decoration: none;
    cursor: pointer;
    border: none;
    position: relative;
    overflow: hidden;
    transition: all var(--dur-base) ease;
    touch-action: manipulation;
    min-height: 44px;
}

body.has-fine-pointer .btn {
    cursor: none;
}

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

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -120%;
    width: 55%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .22), transparent);
    transform: skewX(-20deg);
    transition: left .55s ease;
}

.btn-primary:hover::before {
    left: 160%;
}

.btn-primary:hover {
    background: #2563EB;
    box-shadow: 0 0 28px rgba(59, 130, 246, .5), 0 6px 20px rgba(59, 130, 246, .28);
    transform: translateY(-2px);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-ghost {
    background: transparent;
    color: var(--chrome);
    border: 1px solid var(--chrome-dim);
}

.btn-ghost:hover {
    border-color: var(--chrome);
    background: var(--chrome-faint);
    box-shadow: 0 0 18px rgba(192, 212, 232, .1);
    transform: translateY(-2px);
}

/* ===== REVEAL (fallback when GSAP unavailable / JS disabled) ===== */
.rev {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity var(--dur-slow) ease, transform var(--dur-slow) ease;
}

.rev.show {
    opacity: 1;
    transform: translateY(0);
}

.d1 { transition-delay: .1s; }
.d2 { transition-delay: .2s; }
.d3 { transition-delay: .3s; }
.d4 { transition-delay: .4s; }
.d5 { transition-delay: .5s; }

/* JS-driven pages get animations from GSAP instead of the CSS fallback */
.js-gsap .rev {
    opacity: 1;
    transform: none;
    transition: none;
}

noscript .rev {
    opacity: 1;
}
