/* Design tokens and global reset */

:root {
    --primary: #4b2a63;
    --primary-dark: #3a2050;
    --primary-light: #844cac;
    --primary-pale: #c7a6de;
    --accent: #9bcf6a;
    --accent-hover: #87b857;
    --error: #c7553a;
    --cream: #f6f5f1;
    --white: #ffffff;
    --charcoal: #1a1a1a;
    /* Charcoal alpha scale — opacity variants of --charcoal for text, borders, and fills on light backgrounds */
    --charcoal-80: rgba(26, 26, 26, 0.8);
    --charcoal-75: rgba(26, 26, 26, 0.75);
    --charcoal-60: rgba(26, 26, 26, 0.6);
    --charcoal-50: rgba(26, 26, 26, 0.5);
    --charcoal-45: rgba(26, 26, 26, 0.45);
    --charcoal-40: rgba(26, 26, 26, 0.4);
    --charcoal-15: rgba(26, 26, 26, 0.15);
    --charcoal-10: rgba(26, 26, 26, 0.1);
    --charcoal-07: rgba(26, 26, 26, 0.07);
    --charcoal-05: rgba(26, 26, 26, 0.05);
    --charcoal-04: rgba(26, 26, 26, 0.04);

    /* Primary alpha scale — opacity variants of --primary for fills, borders, and shadows on light backgrounds */
    --primary-70: rgba(75, 42, 99, 0.7);
    --primary-65: rgba(75, 42, 99, 0.65);
    --primary-60: rgba(75, 42, 99, 0.6);
    --primary-55: rgba(75, 42, 99, 0.55);
    --primary-50: rgba(75, 42, 99, 0.5);
    --primary-45: rgba(75, 42, 99, 0.45);
    --primary-40: rgba(75, 42, 99, 0.4);
    --primary-35: rgba(75, 42, 99, 0.35);
    --primary-30: rgba(75, 42, 99, 0.3);
    --primary-25: rgba(75, 42, 99, 0.25);
    --primary-22: rgba(75, 42, 99, 0.22);
    --primary-20: rgba(75, 42, 99, 0.2);
    --primary-18: rgba(75, 42, 99, 0.18);
    --primary-15: rgba(75, 42, 99, 0.15);
    --primary-12: rgba(75, 42, 99, 0.12);
    --primary-10: rgba(75, 42, 99, 0.1);
    --primary-08: rgba(75, 42, 99, 0.08);
    --primary-07: rgba(75, 42, 99, 0.07);
    --primary-06: rgba(75, 42, 99, 0.06);
    --primary-05: rgba(75, 42, 99, 0.05);
    --primary-04: rgba(75, 42, 99, 0.04);
    --primary-03: rgba(75, 42, 99, 0.03);

    /* Easing presets — smooth: standard motion; spring: bouncy entrances; soft: gentle in-out */
    --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-soft: cubic-bezier(0.25, 0.1, 0.25, 1);

    --duration-fast: 150ms;
    --duration-base: 250ms;
    --duration-slow: 350ms;

    --radius-pill: 9999px;

    /* Semantic color aliases */
    --surface: #f6f5f1;
    --surface-dark: #2a1738;
    --surface-darker: #1a0e25;
    --on-surface: #1a1a1a;
    --white: #ffffff;

    /* Radius scale */
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 24px;
    --radius-xl: 32px;

    /* Typography */
    --font-display: "Manrope", sans-serif;
    --font-ui: "Inter", -apple-system, sans-serif;
    --font-mono: "JetBrains Mono", monospace;

    /* Type scale — font sizes */
    --fs-display-xl: clamp(44px, 5.8vw, 78px);
    --fs-display-lg: clamp(36px, 4.4vw, 60px);
    --fs-display-md: clamp(30px, 3.4vw, 44px);
    --fs-display-sm: clamp(20px, 2.2vw, 26px);

    --fs-num-2xl: 64px;
    --fs-num-xl: clamp(1.75rem, 2.5vw, 2.25rem);
    --fs-num-lg: 22px;
    --fs-num-md: 18px;

    --fs-headline-lg: 26px;

    --fs-body-lg: 17px;
    --fs-body-md: 16px;
    --fs-body-sm: 15px;
    --fs-body-base: 14px;
    --fs-body-xs: 13px;

    --fs-ui-lg: 12.5px;
    --fs-ui-md: 12px;
    --fs-ui-sm: 10.5px;

    --fs-label-lg: 11.5px;
    --fs-label-md: 10.5px;
    --fs-label-sm: 10px;
    --fs-label-xs: 9.5px;
    --fs-label-2xs: 9px;

    --fs-mono-md: 11.5px;
    --fs-mono-sm: 10.5px;
    --fs-mono-xs: 9.5px;

    /* Spacing scale — 2xs(8) xs(12) sm(16) md(24) lg(32) xl(48) 2xl(56) 3xl(72) 4xl(96) */
    --spacing-2xs: 8px;
    --spacing-xs: 12px;
    --spacing-sm: 16px;
    --spacing-md: 24px;
    --spacing-lg: 32px;
    --spacing-xl: 48px;
    --spacing-2xl: 56px;
    --spacing-3xl: 72px;
    --spacing-4xl: 96px;

    /* Shadow — canonical elevation for light-bg cards */
    --shadow-card:
        0 1px 2px rgba(0, 0, 0, 0.04), 0 4px 16px rgba(0, 0, 0, 0.06),
        0 12px 40px var(--primary-08);

    /* White alpha scale — for text/borders on dark surfaces */
    --white-95: rgba(255, 255, 255, 0.95);
    --white-70: rgba(255, 255, 255, 0.7);
    --white-52: rgba(255, 255, 255, 0.52);
    --white-50: rgba(255, 255, 255, 0.5);
    --white-45: rgba(255, 255, 255, 0.45);
    --white-38: rgba(255, 255, 255, 0.38);
    --white-35: rgba(255, 255, 255, 0.35);
    --white-30: rgba(255, 255, 255, 0.3);
    --white-25: rgba(255, 255, 255, 0.25);
    --white-22: rgba(255, 255, 255, 0.22);
    --white-12: rgba(255, 255, 255, 0.12);
    --white-09: rgba(255, 255, 255, 0.09);
    --white-08: rgba(255, 255, 255, 0.08);
    --white-05: rgba(255, 255, 255, 0.05);
    --white-04: rgba(255, 255, 255, 0.04);
    --white-03: rgba(255, 255, 255, 0.03);

    /* Missing primary stop */
    --primary-14: rgba(75, 42, 99, 0.14);

    /* Missing charcoal stops */
    --charcoal-55: rgba(26, 26, 26, 0.55);
    --charcoal-35: rgba(26, 26, 26, 0.35);
    --charcoal-20: rgba(26, 26, 26, 0.2);

    /* Z-index scale */
    --z-base: 1;
    --z-overlay: 10;
    --z-nav: 50;
    --z-dropdown: 100;
    --z-fixed: 9999;

    /* Shadow: hover elevation (one step above --shadow-card) */
    --shadow-card-hover:
        0 2px 4px rgba(0, 0, 0, 0.06),
        0 8px 24px rgba(0, 0, 0, 0.08),
        0 20px 56px var(--primary-14);

    /* Dark surfaces */
    --surface-dashboard: #1c1228;
    --surface-deepest: #150b1f;

    /* Emotion state colors (voice section) */
    --emotion-frustrated: #c7553a;
    --emotion-uncertain: #d4a04b;

    /* Third-party brand colors */
    --brand-shopify: #95bf47;

    /* Accent foreground greens (eligible pills, resolved checks) */
    --accent-fg-dark: #3b6d11;
    --accent-fg-mid: #5a9a2a;

    /* Avatar palette (dashboard mockup) */
    --avatar-purple: #7f77dd;
    --avatar-blue: #5b9bd5;

    /* Icon green (integrations callout) */
    --icon-green: #4d8f2a;

    /* Backdrop-filter presets */
    --backdrop-blur-sm: blur(8px);
    --backdrop-blur-md: blur(12px);
    --backdrop-blur-base: blur(16px) saturate(180%);
    --backdrop-blur-lg: blur(18px) saturate(180%);
    --backdrop-blur-xl: blur(28px) saturate(220%);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
html {
    scroll-behavior: smooth;
    height: 100%;
}

body {
    background: var(--cream);
    color: var(--charcoal);
    font-family: var(--font-ui);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    line-height: 1.5;
    position: relative;
    min-height: 100%;
    display: flex;
    flex-direction: column;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    /* background:
        radial-gradient(
            ellipse 90% 70% at 85% 10%,
            rgba(199, 166, 222, 0.55) 0%,
            transparent 55%
        ),
        radial-gradient(
            ellipse 70% 60% at 10% 90%,
            rgba(132, 76, 172, 0.18) 0%,
            transparent 60%
        ),
        linear-gradient(180deg, #f3ebf7 0%, var(--cream) 45%, #efe6f5 100%); */
    z-index: 0;
    pointer-events: none;
}

/* ─── Dot matrix background ─── */
.dot-matrix {
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: 0.7;
    z-index: 0;
    /* background-image: radial-gradient(circle, var(--primary-22) 0.9px, transparent 1.2px); */
    background-size: 28px 28px;
    mask-image: radial-gradient(ellipse 80% 60% at 70% 30%, #000 0%, transparent 75%);
    -webkit-mask-image: radial-gradient(
        ellipse 80% 60% at 70% 30%,
        #000 0%,
        transparent 75%
    ); /* Safari requires -webkit- prefix for mask-image */
}

/* ─── Cursor glow (JS-controlled via shared.js) ─── */
/* --mx and --my are set in real-time on mousemove */
.cursor-glow {
    position: fixed;
    width: 520px;
    height: 520px;
    left: var(--mx, 70%);
    top: var(--my, 30%);
    transform: translate(-50%, -50%);
    /* background: radial-gradient(circle, rgba(132, 76, 172, 0.28) 0%, rgba(199, 166, 222, 0.12) 40%, transparent 70%); */
    pointer-events: none;
    z-index: 0;
    transition:
        left 400ms var(--ease-soft),
        top 400ms var(--ease-soft);
    filter: blur(8px);
}

/* ===== SHARED ANIMATIONS ===== */
@keyframes pulse-dot {
    0%,
    100% {
        transform: scale(0.55);
        opacity: 0.9;
    }
    50% {
        transform: scale(0.85);
        opacity: 1;
    }
}
@keyframes pulse-ring {
    0% {
        box-shadow: 0 0 0 0 rgba(155, 207, 106, 0.6);
    }
    70% {
        box-shadow: 0 0 0 8px rgba(155, 207, 106, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(155, 207, 106, 0);
    }
}
@keyframes pulse-lime {
    0% {
        box-shadow: 0 0 0 0 rgba(155, 207, 106, 0.6);
    }
    70% {
        box-shadow: 0 0 0 6px rgba(155, 207, 106, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(155, 207, 106, 0);
    }
}
@keyframes reveal-up {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
@keyframes reveal-player {
    from {
        opacity: 0;
        transform: translateY(24px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}
@keyframes bubble-in {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
@keyframes wave {
    0%,
    100% {
        transform: scaleY(0.4);
    }
    50% {
        transform: scaleY(1);
    }
}
@keyframes float-reveal {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}
@keyframes scroll-travel {
    0% {
        top: -28px;
    }
    100% {
        top: 28px;
    }
}
@keyframes float-pulse {
    0%,
    100% {
        transform: translateY(0);
        box-shadow:
            0 8px 24px rgba(155, 207, 106, 0.4),
            0 0 0 4px rgba(155, 207, 106, 0.15);
    }
    50% {
        transform: translateY(-3px);
        box-shadow:
            0 12px 32px rgba(155, 207, 106, 0.5),
            0 0 0 8px rgba(155, 207, 106, 0.1);
    }
}
@keyframes reveal-scale {
    from {
        opacity: 0;
        transform: scale(0.94);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}
@keyframes flatline {
    0%,
    100% {
        transform: scaleY(0.15);
    }
    48%,
    52% {
        transform: scaleY(0.15);
    }
    50% {
        transform: scaleY(0.9);
    }
}
@keyframes dial-in {
    from {
        opacity: 0;
        letter-spacing: 0.4em;
    }
    to {
        opacity: 1;
        letter-spacing: 0.25em;
    }
}
@keyframes uptime-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(155, 207, 106, 0.6);
    }
    70% {
        box-shadow: 0 0 0 6px rgba(155, 207, 106, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(155, 207, 106, 0);
    }
}

/* ===== SHARED SECTION HEADERS ===== */
.section-intro {
    text-align: center;
}
.section-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-2xs);
    padding: 7px 14px;
    background: var(--primary-06);
    border: 1px solid var(--primary-15);
    border-radius: var(--radius-pill);
    font-size: var(--fs-label-lg);
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--primary);
}
.section-eyebrow .dot {
    width: 5px;
    height: 5px;
    background: var(--accent);
    border-radius: 50%;
}
.section-title {
    color: var(--charcoal);
    margin-top: 20px;
    max-width: 22ch;
    margin-left: auto;
    margin-right: auto;
}
.section-title .italic {
    font-style: italic;
    color: var(--primary);
    position: relative;
}
.section-title .italic::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -0.03em;
    height: 0.05em;
    /* background: linear-gradient(
        90deg,
        transparent,
        var(--primary-40),
        transparent
    ); */
}
.section-subtitle {
    margin-top: 18px;
    font-size: var(--fs-body-lg);
    line-height: 1.55;
    color: var(--charcoal-75);
    max-width: 56ch;
    margin-left: auto;
    margin-right: auto;
}

/* ===== TYPE SCALE CLASSES ===== */

/* Display — Manrope, fluid, for section/page-level headings */
.ts-display-xl {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: var(--fs-display-xl);
    line-height: 1.0;
    letter-spacing: -0.04em;
}
.ts-display-lg {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: var(--fs-display-lg);
    line-height: 1.04;
    letter-spacing: -0.035em;
}
.ts-display-md {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: var(--fs-display-md);
    line-height: 1.1;
    letter-spacing: -0.03em;
}
.ts-display-sm {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: var(--fs-display-sm);
    line-height: 1.3;
    letter-spacing: -0.02em;
}

/* Headline — Manrope, fixed size, for card/component headings */
.ts-headline-lg {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: var(--fs-headline-lg);
    line-height: 1.15;
    letter-spacing: -0.025em;
}

/* Numeric — Manrope, for metric/stat values */
.ts-num-2xl {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: var(--fs-num-2xl);
    line-height: 0.96;
    letter-spacing: -0.04em;
}
.ts-num-xl {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: var(--fs-num-xl);
    line-height: 1;
    letter-spacing: -0.035em;
}
.ts-num-lg {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: var(--fs-num-lg);
    line-height: 1;
    letter-spacing: -0.015em;
}
.ts-num-md {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: var(--fs-num-md);
    line-height: 1;
    letter-spacing: -0.015em;
}

/* Body — Inter */
.ts-body-lg {
    font-size: var(--fs-body-lg);
    line-height: 1.6;
}
.ts-body-md {
    font-size: var(--fs-body-md);
    line-height: 1.6;
}
.ts-body-base {
    font-size: var(--fs-body-base);
    line-height: 1.5;
}
.ts-body-xs {
    font-size: var(--fs-body-xs);
    line-height: 1.5;
}

/* Label — Inter, uppercase + tracked */
.ts-label-lg {
    font-size: var(--fs-label-lg);
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    line-height: 1;
}
.ts-label-md {
    font-size: var(--fs-label-md);
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    line-height: 1;
}
.ts-label-sm {
    font-size: var(--fs-label-sm);
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    line-height: 1;
}
.ts-label-xs {
    font-size: var(--fs-label-xs);
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    line-height: 1;
}

/* Mono — JetBrains Mono, tabular numerals */
.ts-mono-md {
    font-family: var(--font-mono);
    font-size: var(--fs-mono-md);
    font-variant-numeric: tabular-nums;
}
.ts-mono-sm {
    font-family: var(--font-mono);
    font-size: var(--fs-mono-sm);
    font-variant-numeric: tabular-nums;
}
.ts-mono-xs {
    font-family: var(--font-mono);
    font-size: var(--fs-mono-xs);
    font-variant-numeric: tabular-nums;
}
