:root {
    --primary: #0ea5e9;
    --primary-dark: #0284c7;
    --primary-light: #38bdf8;
}

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

body {
    font-family: -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;
}

.hero-bg {
    background:
        radial-gradient(1200px 600px at 85% -10%, rgba(14, 165, 233, 0.15), transparent 60%),
        radial-gradient(900px 500px at -10% 110%, rgba(56, 189, 248, 0.12), transparent 60%),
        linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
}

.nav-scrolled {
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
}

.section-header {
    position: relative;
    display: inline-block;
}

.section-header:after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 60px;
    height: 3px;
    background: linear-gradient(to right, #0ea5e9, #38bdf8);
    border-radius: 3px;
}

.tech-card,
.team-card,
.case-card {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
        box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1),
        border-color 0.3s ease;
    contain: layout style;
}

.tech-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

.team-card:hover,
.case-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px -10px rgba(15, 23, 42, 0.15);
}

.nav-link {
    position: relative;
    transition: color 0.2s ease;
}

.nav-link:hover {
    color: #0284c7;
}

.nav-link.is-active {
    color: #0284c7;
}

.nav-link.is-active:after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -22px;
    height: 2px;
    background: linear-gradient(to right, #0ea5e9, #38bdf8);
    border-radius: 2px;
}

.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);
}

#scroll-progress {
    contain: strict;
    pointer-events: none;
}

#back-to-top {
    box-shadow: 0 4px 14px rgba(14, 165, 233, 0.4);
}

/* Toast notification */
.toast {
    position: fixed;
    left: 50%;
    bottom: 32px;
    transform: translate(-50%, 24px);
    background: #0f172a;
    color: #fff;
    padding: 12px 20px;
    border-radius: 9999px;
    font-size: 14px;
    box-shadow: 0 12px 32px -8px rgba(15, 23, 42, 0.4);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
    z-index: 200;
}

.toast.is-visible {
    opacity: 1;
    transform: translate(-50%, 0);
}

.toast.is-success {
    background: #047857;
}

.toast.is-error {
    background: #b91c1c;
}

/* Focus ring for keyboard users */
:focus-visible {
    outline: 2px solid #0ea5e9;
    outline-offset: 2px;
    border-radius: 4px;
}

/* Honor users who prefer 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;
    }
}
