/* ═══════════════════════════════════════════════════════════════
   HidrogenONE — Shared CSS Foundation
   Used by: index.html, gest.html, serveq.html, atom.html
   ═══════════════════════════════════════════════════════════════ */

/* ═══ TOKENS ═══ */
:root {
    /* ─── Brand colors (legacy, kept for backwards compat) ─── */
    --color-bg: #050510;
    --color-text: #f5f5f7;
    --color-text-secondary: #a1a1aa;
    --color-blue: #007AFF;
    --color-purple: #5856D6;
    --color-orange: #FF9500;
    --color-pink: #FF2D55;
    --color-green: #30D158;
    --color-teal: #00D4AA;
    --color-cyan: #00B4D8;
    --color-yellow: #FFD60A;

    /* ─── Surface hierarchy (dark theme, subtle elevation) ─── */
    --surface-0: #050510;
    --surface-1: #0a0a18;
    --surface-2: #111124;
    --surface-3: #1a1a2e;
    --surface-glass: rgba(10, 10, 24, 0.6);

    /* ─── Text hierarchy (WCAG AA compliant on dark surfaces) ─── */
    --text-primary: #f5f5f7;
    --text-secondary: #a1a1aa;
    --text-tertiary: #71717a;
    --text-disabled: #52525b;

    /* ─── Border tokens ─── */
    --border-subtle: rgba(255, 255, 255, 0.06);
    --border-default: rgba(255, 255, 255, 0.1);
    --border-strong: rgba(255, 255, 255, 0.16);
    --border-accent: rgba(0, 122, 255, 0.35);

    /* ─── Fluid typography scale (rem-based, clamp-responsive) ─── */
    --fs-display: clamp(3rem, 8vw, 5.5rem);        /* 48 → 88 */
    --fs-h1: clamp(2.25rem, 5vw, 3.5rem);          /* 36 → 56 */
    --fs-h2: clamp(1.75rem, 4vw, 2.5rem);          /* 28 → 40 */
    --fs-h3: clamp(1.25rem, 2.5vw, 1.625rem);      /* 20 → 26 */
    --fs-body-lg: clamp(1.125rem, 1.75vw, 1.25rem); /* 18 → 20 */
    --fs-body: 1rem;                                /* 16 */
    --fs-small: 0.875rem;                           /* 14 */
    --fs-tiny: 0.75rem;                             /* 12 */

    /* ─── Line heights ─── */
    --lh-tight: 1.05;
    --lh-snug: 1.2;
    --lh-normal: 1.5;
    --lh-relaxed: 1.65;

    /* ─── Letter spacing ─── */
    --tracking-tighter: -0.04em;
    --tracking-tight: -0.02em;
    --tracking-normal: 0;
    --tracking-wide: 0.02em;
    --tracking-widest: 0.15em;

    /* ─── Spacing scale (8pt grid) ─── */
    --space-1: 0.25rem;   /*   4 */
    --space-2: 0.5rem;    /*   8 */
    --space-3: 0.75rem;   /*  12 */
    --space-4: 1rem;      /*  16 */
    --space-5: 1.5rem;    /*  24 */
    --space-6: 2rem;      /*  32 */
    --space-7: 3rem;      /*  48 */
    --space-8: 4rem;      /*  64 */
    --space-9: 5rem;      /*  80 */
    --space-10: 7.5rem;   /* 120 */
    --space-11: 10rem;    /* 160 */

    /* ─── Border radius ─── */
    --r-sm: 0.375rem;     /*  6 */
    --r-md: 0.75rem;      /* 12 */
    --r-lg: 1rem;         /* 16 */
    --r-xl: 1.5rem;       /* 24 */
    --r-2xl: 2rem;        /* 32 */
    --r-pill: 9999px;

    /* ─── Shadows (dark theme — subtle glow, no harsh drop) ─── */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.04);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.06);
    --shadow-xl: 0 24px 64px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.08);
    --shadow-glow-blue: 0 0 40px rgba(0, 122, 255, 0.3);
    --shadow-glow-purple: 0 0 40px rgba(88, 86, 214, 0.3);
    --shadow-glow-teal: 0 0 40px rgba(0, 212, 170, 0.3);

    /* ─── Z-index layers ─── */
    --z-base: 1;
    --z-sticky: 10;
    --z-dropdown: 50;
    --z-nav: 100;
    --z-modal: 500;
    --z-toast: 1000;
    --z-cursor: 9999;
    --z-scroll-progress: 10000;

    /* ─── Motion / easing ─── */
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --smooth: cubic-bezier(0.65, 0.05, 0, 1);
    --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
    --ease-in-out-quart: cubic-bezier(0.76, 0, 0.24, 1);

    /* ─── Per-page accents (inline :root overrides in each page) ─── */
    --accent: var(--color-blue);
    --accent-secondary: var(--color-purple);
    --glow: rgba(0, 122, 255, 0.15);
    --gradient: 135deg, #007AFF, #5856D6;
}

/* ─── Reduce motion support ─── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ═══ RESET ═══ */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: var(--font);
    background: var(--color-bg);
    color: var(--color-text);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* ═══ SCROLL PROGRESS ═══ */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--color-blue), var(--color-purple), var(--color-teal));
    z-index: var(--z-scroll-progress);
    width: 0%;
    box-shadow: 0 0 12px rgba(0, 122, 255, 0.5), 0 0 24px rgba(88, 86, 214, 0.25);
    transition: width 0.1s linear;
}

/* ═══ BACKGROUND — AURORA MESH ═══ */
.bg-animated {
    position: fixed;
    inset: 0;
    z-index: -2;
    overflow: hidden;
    background: var(--color-bg);
}
.bg-animated::before,
.bg-animated::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    will-change: transform;
}
.bg-animated::before {
    width: 60vw;
    height: 60vw;
    top: -20%;
    left: -10%;
    background: radial-gradient(circle, rgba(0, 122, 255, 0.28), transparent 60%);
    animation: auroraFloat1 22s ease-in-out infinite;
}
.bg-animated::after {
    width: 55vw;
    height: 55vw;
    top: 25%;
    right: -15%;
    background: radial-gradient(circle, rgba(88, 86, 214, 0.24), transparent 60%);
    animation: auroraFloat2 28s ease-in-out infinite;
}

@keyframes auroraFloat1 {
    0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
    33% { transform: translate3d(8vw, 6vh, 0) scale(1.1); }
    66% { transform: translate3d(-4vw, 10vh, 0) scale(0.95); }
}
@keyframes auroraFloat2 {
    0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
    50% { transform: translate3d(-10vw, -6vh, 0) scale(1.05); }
}

/* Grain overlay — subtle noise for premium feel */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    opacity: 0.05;
    mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml;utf8,<svg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.9'/></svg>");
}

.cursor-spotlight {
    position: fixed;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 122, 255, 0.05), transparent 70%);
    pointer-events: none;
    z-index: 1;
    transform: translate(-50%, -50%);
}

/* ═══ NAV ═══ */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 0 24px;
    height: 52px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    transition: all 0.3s ease;
}
.nav.scrolled {
    height: 44px;
    background: rgba(0, 0, 0, 0.95);
}
.nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}
.nav-logo {
    width: 32px;
    height: 32px;
    transition: all 0.3s;
}
.nav-brand:hover .nav-logo { transform: scale(1.1); filter: drop-shadow(0 0 8px rgba(0,122,255,0.5)); }
.nav-name {
    font-size: 18px;
    font-weight: 600;
    color: var(--color-text);
    transition: font-size 0.3s;
}
.nav.scrolled .nav-logo { width: 26px; height: 26px; }
.nav.scrolled .nav-name { font-size: 16px; }
.nav-links { display: flex; gap: 32px; }
.nav-link {
    position: relative;
    font-size: 14px;
    color: var(--color-text-secondary);
    text-decoration: none;
    transition: color 0.2s;
}
.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: currentColor;
    transition: width 0.3s var(--smooth);
}
.nav-link:hover::after { width: 100%; }
.nav-link:hover { color: var(--color-text); }
.nav-cta {
    padding: 8px 18px;
    font-size: 14px;
    font-weight: 500;
    color: white;
    background: linear-gradient(135deg, var(--color-blue), var(--color-purple));
    border-radius: 20px;
    text-decoration: none;
    transition: all 0.3s;
}
.nav-cta:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(0, 122, 255, 0.4);
}

/* ═══ BUTTONS ═══ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 18px 36px;
    font-size: 17px;
    font-weight: 600;
    border-radius: 30px;
    text-decoration: none;
    cursor: pointer;
    border: none;
    position: relative;
    overflow: hidden;
}
.btn-primary {
    background: linear-gradient(135deg, var(--color-blue), var(--color-purple));
    color: white;
    box-shadow: 0 10px 30px rgba(0, 122, 255, 0.3);
    transition: all 0.3s var(--spring);
}
.btn-primary:hover {
    box-shadow: 0 20px 50px rgba(0, 122, 255, 0.5);
    transform: scale(1.03);
}
.btn-primary:active {
    transform: scale(0.97) !important;
    transition: transform 0.1s !important;
}
/* Ripple effect */
.btn-ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255,255,255,0.3);
    transform: scale(0);
    animation: ripple 0.6s ease-out;
    pointer-events: none;
}
@keyframes ripple {
    to { transform: scale(4); opacity: 0; }
}
.btn-primary svg { transition: transform 0.3s var(--spring); }
.btn-primary:hover svg { transform: translateX(5px); }

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 18px 32px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 30px;
    text-decoration: none;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.04);
    color: var(--color-text);
    border: 1px solid rgba(255, 255, 255, 0.14);
    transition: all 0.3s var(--spring);
}
.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
}

/* ═══ SECTION LAYOUT ═══ */
.container { max-width: 1200px; margin: 0 auto; }

.section-header {
    text-align: center;
    margin-bottom: 72px;
}
.section-tag {
    display: inline-block;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-blue);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 16px;
}
.section-title {
    font-size: clamp(36px, 5vw, 52px);
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: 12px;
}
.section-subtitle {
    font-size: 18px;
    color: var(--color-text-secondary);
}

/* ═══ SECTION MASK TRANSITIONS ═══ */
.section-fade-top {
    position: relative;
}
.section-fade-top::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 0;
    right: 0;
    height: 80px;
    background: linear-gradient(to bottom, var(--color-bg), transparent);
    z-index: 3;
    pointer-events: none;
}

/* ═══ FOOTER ═══ */
.footer {
    padding: 48px 24px;
    border-top: 1px solid rgba(255,255,255,0.08);
}
.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: center;
}
.footer-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}
.footer-text { font-size: 13px; color: var(--color-text-secondary); }
.footer-links { display: flex; gap: 24px; }
.footer-link {
    font-size: 13px;
    color: var(--color-text-secondary);
    text-decoration: none;
    transition: color 0.2s;
}
.footer-link:hover { color: var(--color-text); }
.footer-legal {
    font-size: 11px;
    color: var(--color-text-secondary);
    text-align: center;
    line-height: 1.6;
    opacity: 0.7;
}
.footer-legal a { color: var(--color-text-secondary); text-decoration: underline; }
.footer-legal a:hover { color: var(--color-text); }

/* ═══ KEYFRAMES ═══ */
@keyframes gradientShift {
    0%, 100% { background-position: 0% center; }
    50% { background-position: 100% center; }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 0.6; transform: translateY(0); }
}

/* ═══ RESPONSIVE BASE ═══ */
@media (max-width: 768px) {
    .nav-links { display: none; }
    .cursor-spotlight { display: none; }
    .footer-top { flex-direction: column; gap: 16px; }
}

/* ═══ GSAP INITIAL ═══ */
.gs-reveal { visibility: hidden; }
