/* ── Pulsareon Professional Light Theme ── */

:root {
    --bg-primary: #FFFFFF;
    --bg-surface: #F8FAFC;
    --bg-soft: #F5F7FB;
    --bg-hero: #EEF4FF;
    --accent-blue: #2563EB;
    --accent-violet: #7C3AED;
    --accent-amber: #F59E0B;
    --text-primary: #0F172A;
    --text-secondary: #475569;
    --text-tertiary: #94A3B8;
    --border-color: #E2E8F0;
    --radius-sm: 0.625rem;
    --radius-md: 0.875rem;
    --radius-lg: 1.25rem;
    --radius-xl: 1.5rem;
    --shadow-sm: 0 10px 30px -22px rgba(15, 23, 42, 0.35);
    --shadow-md: 0 18px 44px -26px rgba(15, 23, 42, 0.42);
    --shadow-lg: 0 26px 70px -34px rgba(15, 23, 42, 0.48);
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica,
        Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    background:
        radial-gradient(circle at 15% 10%, rgba(37, 99, 235, 0.06), transparent 30rem),
        radial-gradient(circle at 85% 15%, rgba(124, 58, 237, 0.05), transparent 28rem),
        var(--bg-primary);
    color: var(--text-secondary);
}

/* ── Subtle grid pattern ── */
.bg-grid-pattern {
    background-image:
        linear-gradient(rgba(15, 23, 42, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(15, 23, 42, 0.025) 1px, transparent 1px);
    background-size: 88px 88px;
    mask-image: linear-gradient(180deg, rgba(0,0,0,0.8), rgba(0,0,0,0.15) 45%, transparent 85%);
}

/* ── Navigation ── */
.nav-scrolled {
    background-color: rgba(255, 255, 255, 0.96) !important;
    box-shadow: 0 12px 30px -26px rgba(15, 23, 42, 0.7);
    border-color: rgba(226, 232, 240, 0.75) !important;
}

.logo-img {
    border: 1px solid rgba(226, 232, 240, 0.95);
    box-shadow:
        0 0 0 3px rgba(255, 255, 255, 0.92),
        0 0 0 5px rgba(37, 99, 235, 0.10),
        0 8px 18px -14px rgba(15, 23, 42, 0.65);
}

.nav-link {
    position: relative;
    transition: color 0.2s ease;
}
.nav-link:hover { color: var(--accent-blue); }
.nav-link.is-active { color: var(--accent-blue); }
.nav-link.is-active::after {
    content: '';
    position: absolute;
    left: 0; right: 0; bottom: -22px;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-violet));
    border-radius: 999px;
    box-shadow: 0 0 12px rgba(37, 99, 235, 0.28);
}

.nav-cta {
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-violet));
    box-shadow: 0 12px 22px -16px rgba(37, 99, 235, 0.7);
}
.nav-cta:hover {
    filter: saturate(1.08) brightness(1.02);
    box-shadow: 0 16px 28px -18px rgba(37, 99, 235, 0.85);
}

/* ── Section header label ── */
.section-header {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}
.section-header::before {
    content: '';
    width: 1.5rem;
    height: 1px;
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-violet));
}

.section-soft {
    background:
        radial-gradient(circle at 80% 0%, rgba(124, 58, 237, 0.07), transparent 24rem),
        linear-gradient(180deg, #F8FAFC 0%, #F3F6FB 100%);
}

/* ── Cards ── */
.surface-card,
.surface-card-elevated {
    position: relative;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: transform 0.35s cubic-bezier(0.4,0,0.2,1),
                box-shadow 0.35s cubic-bezier(0.4,0,0.2,1),
                border-color 0.35s ease,
                background 0.35s ease;
}
.surface-card-elevated {
    box-shadow: var(--shadow-sm);
}
.surface-card::before,
.surface-card-elevated::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(37,99,235,0.22), rgba(124,58,237,0.18), transparent);
    opacity: 0;
    transition: opacity 0.35s ease;
}
.surface-card:hover,
.surface-card-elevated:hover {
    border-color: rgba(37, 99, 235, 0.25);
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    background: #FFFFFF;
}
.surface-card:hover::before,
.surface-card-elevated:hover::before {
    opacity: 1;
}

.card-accent-blue { border-left: 3px solid rgba(37, 99, 235, 0.68); }
.card-accent-violet { border-left: 3px solid rgba(124, 58, 237, 0.68); }
.card-accent-amber { border-left: 3px solid rgba(245, 158, 11, 0.72); }
.card-accent-slate { border-left: 3px solid rgba(100, 116, 139, 0.55); }

.service-icon {
    background: linear-gradient(135deg, #EFF6FF, #EEF2FF);
    box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.08), 0 10px 22px -18px rgba(37, 99, 235, 0.6);
}

.service-card::after {
    content: '';
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 999px;
    background: var(--accent-blue);
    box-shadow: 0 0 0 6px rgba(37, 99, 235, 0.08);
}
.service-card.accent-violet::after {
    background: var(--accent-violet);
    box-shadow: 0 0 0 6px rgba(124, 58, 237, 0.08);
}
.service-card.accent-amber::after {
    background: var(--accent-amber);
    box-shadow: 0 0 0 6px rgba(245, 158, 11, 0.10);
}

.tag {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    border: 1px solid rgba(226, 232, 240, 0.95);
    background: #F8FAFC;
    color: var(--text-secondary);
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    line-height: 1.25rem;
    transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.group:hover .tag {
    color: var(--accent-blue);
    border-color: rgba(37, 99, 235, 0.22);
    background: #EFF6FF;
}

/* ── Hero ── */
.hero-bg {
    background:
        radial-gradient(ellipse 80% 60% at 50% 28%, rgba(37,99,235,0.12) 0%, rgba(124,58,237,0.06) 36%, transparent 72%),
        radial-gradient(circle at 16% 36%, rgba(245, 158, 11, 0.08), transparent 18rem),
        linear-gradient(180deg, #F3F7FF 0%, #FFFFFF 92%);
}
.hero-bg::before,
.hero-bg::after {
    content: '';
    position: absolute;
    pointer-events: none;
    border-radius: 999px;
    filter: blur(4px);
}
.hero-bg::before {
    width: 16rem;
    height: 16rem;
    right: 7%;
    top: 18%;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.09), transparent 68%);
}
.hero-bg::after {
    width: 11rem;
    height: 11rem;
    left: 10%;
    bottom: 18%;
    background: radial-gradient(circle, rgba(124, 58, 237, 0.08), transparent 70%);
}
.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.5rem 0.8rem;
    border-radius: 999px;
    border: 1px solid rgba(37, 99, 235, 0.12);
    background: rgba(255, 255, 255, 0.72);
    color: var(--accent-blue);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    letter-spacing: 0.14em;
    box-shadow: var(--shadow-sm);
}
.hero-eyebrow::before {
    content: '';
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-violet));
    box-shadow: 0 0 0 5px rgba(37, 99, 235, 0.08);
}
.hero-headline {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(2.7rem, 7.5vw, 6.5rem);
    font-weight: 700;
    line-height: 1.08;
    letter-spacing: -0.035em;
    text-wrap: balance;
}
.hero-headline .text-slate-500 {
    font-size: clamp(1.25rem, 3vw, 1.75rem);
    font-weight: 500;
    line-height: 1.4;
    letter-spacing: 0;
}
.hero-stats-card {
    border: 1px solid rgba(226, 232, 240, 0.9);
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(16px);
    box-shadow: var(--shadow-md);
}
.hero-stats-card > div {
    position: relative;
}
.hero-stats-card > div:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 18%;
    right: -0.5rem;
    width: 1px;
    height: 64%;
    background: linear-gradient(180deg, transparent, rgba(203, 213, 225, 0.9), transparent);
}

.text-accent-blue {
    background: linear-gradient(135deg, #1D4ED8, #7C3AED 48%, #DB2777);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ── Section divider ── */
.section-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(148, 163, 184, 0.28), transparent);
    max-width: 860px;
    margin: 0 auto;
}

/* ── Contact and footer ── */
.contact-panel {
    position: relative;
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: var(--radius-xl);
    background:
        radial-gradient(circle at 50% 0%, rgba(37, 99, 235, 0.08), transparent 18rem),
        linear-gradient(180deg, rgba(248,250,252,0.96), rgba(255,255,255,0.98));
    box-shadow: var(--shadow-sm);
}
.footer-top-border {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(37, 99, 235, 0.45), rgba(124, 58, 237, 0.45), transparent);
}

/* ── Scroll progress ── */
#scroll-progress {
    contain: strict;
    pointer-events: none;
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-violet));
}

/* ── Back to top ── */
#back-to-top {
    box-shadow: 0 14px 28px -18px rgba(37, 99, 235, 0.75);
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.3s ease;
}
#back-to-top:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 36px -20px rgba(37, 99, 235, 0.85);
}

/* ── Fade-in sections ── */
.fade-in-section {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}
.fade-in-section.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger children */
[data-stagger] > * {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.fade-in-section.is-visible [data-stagger] > *,
[data-stagger].is-visible > * {
    opacity: 1;
    transform: translateY(0);
}

/* ── Magnetic button ── */
.magnetic-btn {
    transition: transform 0.2s ease, filter 0.2s ease, box-shadow 0.2s ease;
}

/* ── Focus ring ── */
:focus-visible {
    outline: 2px solid var(--accent-blue);
    outline-offset: 2px;
    border-radius: 4px;
}

/* ── Selection ── */
::selection {
    background: rgba(37, 99, 235, 0.15);
    color: var(--text-primary);
}

/* ── Custom scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-surface); }
::-webkit-scrollbar-thumb {
    background: #CBD5E1;
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: #94A3B8; }

/* ── Responsive refinements ── */
@media (max-width: 640px) {
    .hero-stats-card > div:nth-child(2)::after {
        display: none;
    }
    .hero-headline {
        letter-spacing: -0.025em;
    }
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
    .fade-in-section { opacity: 1; transform: none; }
    [data-stagger] > * { opacity: 1; transform: none; }
}
