/* ── Base ───────────────────────────────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
}

/* ── Brand scrollbar — Webkit + Firefox ─────────────────────────────────── */
* {
    scrollbar-width: thin;
    scrollbar-color: #7943b1 transparent;
}
*::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}
*::-webkit-scrollbar-track {
    background: rgba(55, 0, 104, 0.04);
    border-radius: 10px;
}
*::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #370068 0%, #7943b1 100%);
    border: 2px solid transparent;
    background-clip: padding-box;
    border-radius: 10px;
    min-height: 36px;
}
*::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #501b87 0%, #9056c4 100%);
    background-clip: padding-box;
}
*::-webkit-scrollbar-corner { background: transparent; }
/* Small / inline scrollers (horizontal table scroll, dropdown lists) */
.kd-scroll-thin::-webkit-scrollbar { width: 6px; height: 6px; }
.kd-scroll-thin::-webkit-scrollbar-thumb { border-radius: 6px; }

body {
    font-family: 'Outfit', sans-serif;
    background-color: #ffffff;
    color: #191c1d;
    /* Paypas-style soft gradient blobs */
    background-image:
        radial-gradient(ellipse 60% 80% at -8% 50%, rgba(114, 67, 177, 0.10) 0%, transparent 65%),
        radial-gradient(ellipse 50% 60% at 108% 45%, rgba(87, 51, 168, 0.07) 0%, transparent 65%),
        radial-gradient(ellipse 40% 40% at 50% 100%, rgba(0, 179, 218, 0.05) 0%, transparent 60%);
}

/* ── Typography ─────────────────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Outfit', sans-serif;
    letter-spacing: -0.02em;
}

/* ── Apple/Stripe inspired modern type scale (used on all pages) ────────── */
.page-hero-title {
    font-size: clamp(2rem, 4vw, 3.5rem);
    font-weight: 600;
    line-height: 1.08;
    letter-spacing: -0.03em;
}
.page-section-title {
    font-size: clamp(1.625rem, 2.4vw, 2.125rem);
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: -0.025em;
}
.page-eyebrow {
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}
/* Breadcrumb — sits above the hero eyebrow on inner pages */
.page-breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 12.5px;
    font-weight: 500;
    color: #6b6675;
    margin-bottom: 18px;
}
.page-breadcrumb a {
    color: #6b6675;
    text-decoration: none;
    transition: color 0.15s ease;
}
.page-breadcrumb a:hover { color: #370068; }
.page-breadcrumb .sep {
    font-size: 9px;
    opacity: 0.5;
    line-height: 1;
}
.page-breadcrumb .current {
    color: #191c1d;
    font-weight: 600;
}
.page-lead {
    font-size: clamp(1rem, 1.15vw, 1.18rem);
    line-height: 1.6;
}
.page-divider {
    border-color: rgba(55, 0, 104, 0.08);
}
/* Gradient fade divider — for major section separators */
.fade-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, rgba(55, 0, 104, 0.22) 50%, transparent 100%);
    border: 0;
}
/* Dark variant — for dark backgrounds (footer on dark, etc.) */
.fade-divider-dark {
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.18) 50%, transparent 100%);
    border: 0;
}
/* Light variant for primary (purple) backgrounds */
.fade-divider-light {
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.25) 50%, transparent 100%);
    border: 0;
}

/* Brand surface — matches primary button color (#370068) with subtle depth via orbs. */
.dark-gradient-bg {
    position: relative;
    background: #370068;
    overflow: hidden;
}
.dark-gradient-bg > * { position: relative; z-index: 1; }
.dark-gradient-bg::before {
    content: '';
    position: absolute;
    top: -10rem;
    right: -10rem;
    width: 32rem;
    height: 32rem;
    border-radius: 9999px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.14) 0%, transparent 65%);
    filter: blur(60px);
    pointer-events: none;
    z-index: 0;
}
.dark-gradient-bg::after {
    content: '';
    position: absolute;
    bottom: -8rem;
    left: -8rem;
    width: 26rem;
    height: 26rem;
    border-radius: 9999px;
    background: radial-gradient(circle, rgba(196, 181, 253, 0.22) 0%, transparent 65%);
    filter: blur(50px);
    pointer-events: none;
    z-index: 0;
}

/* Slim variant */
.dark-gradient-bg-slim {
    position: relative;
    background: #370068;
    overflow: hidden;
}
.dark-gradient-bg-slim > * { position: relative; z-index: 1; }
.dark-gradient-bg-slim::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 60% 200% at 85% 50%, rgba(255, 255, 255, 0.10) 0%, transparent 70%),
        radial-gradient(ellipse 50% 150% at 15% 50%, rgba(196, 181, 253, 0.14) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.page-card {
    transition: transform 0.4s cubic-bezier(.16,1,.3,1), border-color 0.3s, box-shadow 0.3s;
}
@media (min-width: 1024px) {
    .page-card:hover {
        transform: translateY(-2px);
    }
}
/* Big faded numbers for process / step displays */
.page-step-num {
    font-size: clamp(4.5rem, 7.5vw, 7rem);
    font-weight: 200;
    line-height: 0.9;
    letter-spacing: -0.04em;
    background: linear-gradient(180deg, rgba(55, 0, 104,0.85) 0%, rgba(55, 0, 104,0.05) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
/* Subtle grid background for hero sections */
.page-hero-grid {
    background-image:
        linear-gradient(rgba(0,0,0,0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0,0,0,0.025) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: radial-gradient(ellipse 90% 70% at 50% 40%, black 30%, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 40%, black 30%, transparent 75%);
}
/* Body background override on modern pages (remove blob gradients) */
body.modern-page {
    background-image: none;
}
/* Section padding rhythm */
@media (min-width: 1024px) {
    .page-section { padding-top: 7rem; padding-bottom: 7rem; }
}

/* ── Gradient text ──────────────────────────────────────────────────────── */
.text-gradient {
    background: linear-gradient(110deg, #7943b1 0%, #00b3da 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ── Glass nav ──────────────────────────────────────────────────────────── */
.glass-nav {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(114, 67, 177, 0.08);
}

/* ── Glass card ─────────────────────────────────────────────────────────── */
.glass-card {
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(114, 67, 177, 0.10);
    box-shadow:
        0 4px 6px -1px rgba(55, 0, 104, 0.04),
        0 20px 40px -8px rgba(55, 0, 104, 0.08);
}

/* ── Blob decorators (reusable) ─────────────────────────────────────────── */
.blob {
    border-radius: 9999px;
    filter: blur(72px);
    pointer-events: none;
    position: absolute;
}

.blob-primary   { background: rgba(121, 67, 177, 0.12); }
.blob-secondary { background: rgba(0, 179, 218, 0.08); }

/* ── Pixel / dot background ─────────────────────────────────────────────── */
.pixel-bg {
    background-image: radial-gradient(rgba(114, 67, 177, 0.08) 1px, transparent 1px);
    background-size: 18px 18px;
}

/* ── Code accent line ───────────────────────────────────────────────────── */
.code-line {
    position: relative;
}

.code-line::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(180deg, #370068, #7943b1);
    border-radius: 2px;
}

/* ── Material Symbols ───────────────────────────────────────────────────── */
.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

/* ── Dropdown menus ─────────────────────────────────────────────────────── */
.has-dropdown { position: relative; }

.dropdown-panel {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(6px);
    padding-top: 14px; /* invisible bridge — keeps hover alive over the gap */
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    /* Delay close on mouseleave to prevent flicker when crossing the gap */
    transition: opacity 0.18s ease 0.12s, transform 0.18s ease 0.12s, visibility 0s linear 0.3s;
    z-index: 100;
}

.has-dropdown:hover .dropdown-panel,
.has-dropdown:focus-within .dropdown-panel {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
    /* Open immediately on hover */
    transition: opacity 0.18s ease 0s, transform 0.18s ease 0s, visibility 0s linear 0s;
}

.dropdown-inner {
    background: #ffffff;
    border: 1px solid rgba(114, 67, 177, 0.10);
    border-radius: 16px;
    box-shadow: 0 8px 30px -4px rgba(55, 0, 104, 0.12), 0 2px 8px -2px rgba(0,0,0,0.06);
    padding: 6px;
    min-width: 210px;
    white-space: nowrap;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 14.5px;
    font-weight: 500;
    color: #191c1d;
    text-decoration: none;
    transition: background 0.12s, color 0.12s;
}

.dropdown-item:hover {
    background: #f3f4f5;
    color: #370068;
}

.dropdown-item:hover i { color: #370068; }

.dropdown-item i {
    font-size: 18px;
    width: 22px;
    text-align: center;
    color: #7c7482;
    flex-shrink: 0;
    transition: color 0.12s;
}

/* Chevron rotation on parent hover */
.has-dropdown:hover .nav-chevron {
    transform: rotate(180deg);
}
.nav-chevron {
    transition: transform 0.2s ease;
    display: inline-block;
}

/* ── Smooth scroll ──────────────────────────────────────────────────────── */
html {
    scroll-behavior: smooth;
}

/* ─────────────────────────────────────────────────────────────────────────
   PAGE TRANSITION — top progress bar + spinner overlay
   Universally responsive: mobile (clamp font/spinner), desktop, tablet, TV.
   Respects prefers-reduced-motion. Injected by main.js.
   ───────────────────────────────────────────────────────────────────────── */

/* Top progress bar — fixed, gradient, animated slide */
.page-transition-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: clamp(2px, 0.25vw, 4px);
    z-index: 99999;
    pointer-events: none;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(55, 0, 104, 0.85) 35%,
        #7943b1 50%,
        rgba(55, 0, 104, 0.85) 65%,
        transparent 100%
    );
    background-size: 200% 100%;
    box-shadow: 0 0 12px rgba(55, 0, 104, 0.55);
    opacity: 0;
    transform: translateY(-100%);
    transition: opacity 0.18s ease, transform 0.18s ease;
}
.page-transition-bar.is-active {
    opacity: 1;
    transform: translateY(0);
    animation: pageTransitionSlide 1.1s ease-in-out infinite;
}
@keyframes pageTransitionSlide {
    0%   { background-position:  100% 0; }
    100% { background-position: -100% 0; }
}

/* Full-screen overlay — appears only after a brief delay (slow nav) */
.page-transition-overlay {
    position: fixed;
    inset: 0;
    z-index: 99998;
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(10px) saturate(140%);
    -webkit-backdrop-filter: blur(10px) saturate(140%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: clamp(1rem, 2vw, 1.75rem);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.22s ease, visibility 0s linear 0.22s;
}
.page-transition-overlay.is-active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: opacity 0.22s ease, visibility 0s linear 0s;
}

/* Spinner — sized fluidly so it looks right on phone → tv */
.page-transition-spinner {
    width:  clamp(40px, 5vw, 64px);
    height: clamp(40px, 5vw, 64px);
    border: clamp(2.5px, 0.32vw, 4px) solid rgba(55, 0, 104, 0.16);
    border-top-color: #370068;
    border-right-color: #7943b1;
    border-radius: 50%;
    animation: pageTransitionSpin 0.85s linear infinite;
}
@keyframes pageTransitionSpin {
    to { transform: rotate(360deg); }
}

/* Optional caption under spinner */
.page-transition-overlay__label {
    font-size: clamp(11px, 0.85vw, 14px);
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(55, 0, 104, 0.7);
}

/* Subtle main fade so the page itself feels like it's "leaving" */
body.page-leaving main {
    opacity: 0.65;
    transition: opacity 0.22s ease;
}

/* TV / very large displays — give the overlay more breathing room */
@media (min-width: 1920px) {
    .page-transition-spinner {
        width:  76px;
        height: 76px;
        border-width: 4.5px;
    }
}

/* Reduce motion — no animation, no overlay */
@media (prefers-reduced-motion: reduce) {
    .page-transition-bar,
    .page-transition-overlay {
        display: none !important;
    }
    body.page-leaving main {
        opacity: 1 !important;
    }
}
