:root {
    --primary: #ff6b9d;
    --primary-dark: #e84a7f;
    --primary-light: #ff9dc0;
    --primary-soft: rgba(255, 107, 157, 0.12);
    --secondary: #7c5cff;
    --secondary-light: #a78bfa;
    --accent: #ffb86b;
    --bg: #fffafc;
    --bg-alt: #fff0f5;
    --bg-card: #ffffff;
    --bg-glass: rgba(255, 255, 255, 0.65);
    --bg-glass-strong: rgba(255, 255, 255, 0.85);
    --text: #2d2233;
    --text-soft: #6b5b73;
    --text-muted: #9a8ba3;
    --border: rgba(255, 107, 157, 0.18);
    --border-soft: rgba(124, 92, 255, 0.1);
    --shadow-sm: 0 2px 8px rgba(255, 107, 157, 0.08);
    --shadow-md: 0 8px 28px rgba(255, 107, 157, 0.14);
    --shadow-lg: 0 18px 50px rgba(255, 107, 157, 0.2);
    --shadow-glow: 0 0 0 1px rgba(255, 107, 157, 0.15), 0 10px 40px rgba(124, 92, 255, 0.12);
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;
    --radius-pill: 999px;
    --grad-banner: linear-gradient(135deg, #ff6b9d 0%, #ff9dc0 30%, #a78bfa 70%, #7c5cff 100%);
    --grad-soft: linear-gradient(135deg, rgba(255, 107, 157, 0.1) 0%, rgba(124, 92, 255, 0.08) 100%);
    --grad-text: linear-gradient(120deg, #ff6b9d 0%, #7c5cff 100%);
    --font-sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --maxw: 1200px;
    --header-h: 72px;
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
    --transition: 0.35s var(--ease);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #14101a;
        --bg-alt: #1b1522;
        --bg-card: #211a2b;
        --bg-glass: rgba(33, 26, 43, 0.6);
        --bg-glass-strong: rgba(33, 26, 43, 0.88);
        --text: #f3eef7;
        --text-soft: #c9bcd4;
        --text-muted: #8f7f9c;
        --border: rgba(255, 107, 157, 0.22);
        --border-soft: rgba(167, 139, 250, 0.16);
        --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.35);
        --shadow-md: 0 8px 28px rgba(0, 0, 0, 0.45);
        --shadow-lg: 0 18px 50px rgba(0, 0, 0, 0.55);
        --shadow-glow: 0 0 0 1px rgba(255, 107, 157, 0.2), 0 10px 40px rgba(124, 92, 255, 0.25);
        --grad-soft: linear-gradient(135deg, rgba(255, 107, 157, 0.14) 0%, rgba(124, 92, 255, 0.14) 100%);
    }
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-h) + 16px);
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.75;
    color: var(--text);
    background: var(--bg);
    background-image:
        radial-gradient(1200px 600px at 10% -10%, rgba(255, 107, 157, 0.1), transparent 60%),
        radial-gradient(1000px 500px at 100% 0%, rgba(124, 92, 255, 0.1), transparent 55%);
    background-attachment: fixed;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}

img, svg {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition), opacity var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
summary:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 3px;
    border-radius: 4px;
}

ul, ol {
    list-style: none;
}

h1, h2, h3, h4 {
    line-height: 1.3;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: var(--text);
}

h1 { font-size: clamp(1.75rem, 4.2vw, 3rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2.1rem); }
h3 { font-size: clamp(1.1rem, 2vw, 1.35rem); }

p {
    color: var(--text-soft);
}

::selection {
    background: var(--primary);
    color: #fff;
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}
::-webkit-scrollbar-track {
    background: var(--bg-alt);
}
::-webkit-scrollbar-thumb {
    background: linear-gradient(var(--primary), var(--secondary));
    border-radius: var(--radius-pill);
    border: 2px solid var(--bg-alt);
}

/* ============ Header ============ */
header {
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    background: var(--bg-glass);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    transition: background var(--transition), box-shadow var(--transition);
}

header nav {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 0 24px;
}

header nav > div {
    display: flex;
    align-items: center;
    gap: 20px;
    min-height: var(--header-h);
    flex-wrap: wrap;
}

header nav > div > a:first-child {
    flex-shrink: 0;
    display: inline-flex;
    transition: transform var(--transition);
}

header nav > div > a:first-child:hover {
    transform: scale(1.04) rotate(-1deg);
}

header nav svg {
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
}

header nav ul {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
    flex-wrap: wrap;
}

header nav ul li a {
    display: inline-block;
    padding: 8px 14px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-soft);
    border-radius: var(--radius-pill);
    position: relative;
    transition: color var(--transition), background var(--transition), transform var(--transition);
}

header nav ul li a::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 4px;
    width: 0;
    height: 2px;
    background: var(--grad-text);
    border-radius: var(--radius-pill);
    transform: translateX(-50%);
    transition: width var(--transition);
}

header nav ul li a:hover {
    color: var(--primary);
    background: var(--primary-soft);
    transform: translateY(-1px);
}

header nav ul li a:hover::after {
    width: 60%;
}

header nav form {
    display: flex;
    align-items: center;
    gap: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    padding: 4px;
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition), border-color var(--transition);
}

header nav form:focus-within {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
}

header nav form label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

header nav form input[type="search"] {
    border: none;
    outline: none;
    background: transparent;
    font-family: inherit;
    font-size: 0.88rem;
    color: var(--text);
    padding: 8px 14px;
    width: 200px;
    min-width: 0;
}

header nav form input[type="search"]::placeholder {
    color: var(--text-muted);
}

header nav form button {
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 700;
    color: #fff;
    background: var(--grad-banner);
    background-size: 150% 150%;
    padding: 8px 20px;
    border-radius: var(--radius-pill);
    transition: transform var(--transition), box-shadow var(--transition), background-position var(--transition);
    white-space: nowrap;
}

header nav form button:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-md);
    background-position: 100% 50%;
}

header nav form button:active {
    transform: scale(0.97);
}

/* ============ Main ============ */
main {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 0 24px 80px;
}

main > section {
    padding: 64px 0;
    position: relative;
    scroll-margin-top: calc(var(--header-h) + 24px);
}

main > section + section::before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: min(100%, 720px);
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border), transparent);
}

main > section > h2 {
    position: relative;
    margin-bottom: 12px;
    padding-left: 20px;
    background: var(--grad-text);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

main > section > h2::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 1.2em;
    border-radius: var(--radius-pill);
    background: var(--grad-banner);
    box-shadow: 0 0 16px rgba(255, 107, 157, 0.5);
}

main > section > h2 + * {
    margin-top: 20px;
}

/* ============ Hero Banner ============ */
#home {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 48px;
    align-items: center;
    padding: 72px 0 80px;
    position: relative;
}

#home::before {
    content: "";
    position: absolute;
    inset: 24px -24px;
    border-radius: var(--radius-xl);
    background: var(--grad-banner);
    opacity: 0.07;
    filter: blur(40px);
    z-index: -1;
    animation: heroGlow 8s ease-in-out infinite alternate;
}

@keyframes heroGlow {
    from { opacity: 0.05; transform: scale(0.98); }
    to { opacity: 0.12; transform: scale(1.02); }
}

#home > div:first-child {
    animation: fadeUp 0.9s var(--ease) both;
}

#home h1 {
    margin-bottom: 24px;
    background: var(--grad-text);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    text-wrap: balance;
}

#home p {
    font-size: 1.02rem;
    margin-bottom: 16px;
    max-width: 60ch;
}

#home > div:last-child {
    animation: fadeUp 1.1s var(--ease) 0.15s both;
    display: flex;
    justify-content: center;
}

#home > div:last-child svg {
    width: 100%;
    max-width: 600px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    transition: transform var(--transition), box-shadow var(--transition);
}

#home > div:last-child svg:hover {
    transform: translateY(-6px) scale(1.015);
    box-shadow: var(--shadow-glow);
}

#home > div:first-child > div:last-child {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 32px;
}

#home > div:first-child > div:last-child a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 32px;
    font-weight: 700;
    font-size: 0.98rem;
    border-radius: var(--radius-pill);
    position: relative;
    overflow: hidden;
    transition: transform var(--transition), box-shadow var(--transition), background var(--transition), color var(--transition);
}

#home > div:first-child > div:last-child a:first-child {
    color: #fff;
    background: var(--grad-banner);
    background-size: 180% 180%;
    box-shadow: 0 10px 30px rgba(255, 107, 157, 0.35);
}

#home > div:first-child > div:last-child a:first-child:hover {
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 16px 40px rgba(255, 107, 157, 0.5);
    background-position: 100% 50%;
    color: #fff;
}

#home > div:first-child > div:last-child a:last-child {
    color: var(--primary);
    background: var(--bg-glass-strong);
    border: 1.5px solid var(--border);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

#home > div:first-child > div:last-child a:last-child:hover {
    transform: translateY(-3px);
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
    color: var(--primary-dark);
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(28px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============ Cards / Articles ============ */
article {
    background: var(--bg-card);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    padding: 28px 30px;
    margin-top: 20px;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

article::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--grad-banner);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.5s var(--ease);
}

article:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--border);
}

article:hover::before {
    transform: scaleX(1);
}

article h3 {
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

article h3::before {
    content: "";
    width: 10px;
    height: 10px;
    border-radius: 3px;
    background: var(--grad-banner);
    transform: rotate(45deg);
    flex-shrink: 0;
    box-shadow: 0 0 12px rgba(255, 107, 157, 0.5);
}

article p {
    font-size: 0.96rem;
}

article p + p {
    margin-top: 12px;
}

article a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 14px;
    font-weight: 700;
    font-size: 0.9rem;
    padding: 8px 18px;
    border-radius: var(--radius-pill);
    background: var(--primary-soft);
    transition: background var(--transition), transform var(--transition), gap var(--transition);
}

article a::after {
    content: "→";
    transition: transform var(--transition);
}

article a:hover {
    background: var(--primary);
    color: #fff;
    transform: translateX(2px);
}

article a:hover::after {
    transform: translateX(4px);
}

/* Grid layout for product / solution / industry / cases / news / articles */
#products,
#solutions,
#industry,
#cases,
#news,
#articles,
#knowledge {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
    align-items: stretch;
}

#products > h2,
#solutions > h2,
#industry > h2,
#cases > h2,
#news > h2,
#articles > h2,
#knowledge > h2 {
    grid-column: 1 / -1;
    margin-bottom: 0;
}

#products article,
#solutions article,
#industry article,
#cases article,
#news article,
#articles article,
#knowledge article {
    margin-top: 0;
    display: flex;
    flex-direction: column;
}

#products article p,
#solutions article p,
#industry article p,
#cases article p,
#news article p,
#articles article p,
#knowledge article p {
    flex: 1;
}

/* About section - two column feel */
#about {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 24px;
}

#about > h2 {
    grid-column: 1 / -1;
}

#about article {
    margin-top: 0;
}

#about article:nth-child(2) {
    background: var(--grad-soft);
}

/* Cases quotes */
#cases article:nth-child(4) p {
    padding: 12px 16px;
    border-left: 3px solid var(--primary);
    background: var(--bg-alt);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-style: italic;
    font-size: 0.92rem;
}

#cases article:nth-child(4) p + p {
    margin-top: 12px;
}

/* News date styling */
#news article p:first-of-type {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--primary);
    background: var(--primary-soft);
    padding: 4px 12px;
    border-radius: var(--radius-pill);
    margin-bottom: 10px;
}

/* ============ FAQ ============ */
#faq {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 16px;
    align-items: start;
}

#faq > h2 {
    grid-column: 1 / -1;
}

#faq details {
    background: var(--bg-card);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    padding: 0;
    overflow: hidden;
    transition: box-shadow var(--transition), border-color var(--transition), transform var(--transition);
}

#faq details:hover {
    border-color: var(--border);
    box-shadow: var(--shadow-sm);
}

#faq details[open] {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
}

#faq summary {
    cursor: pointer;
    padding: 18px 48px 18px 22px;
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text);
    position: relative;
    list-style: none;
    transition: color var(--transition), background var(--transition);
    user-select: none;
}

#faq summary::-webkit-details-marker {
    display: none;
}

#faq summary::after {
    content: "+";
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary);
    background: var(--primary-soft);
    border-radius: 50%;
    transition: transform var(--transition), background var(--transition), color var(--transition);
}

#faq details[open] summary {
    color: var(--primary);
    background: var(--grad-soft);
}

#faq details[open] summary::after {
    content: "−";
    transform: translateY(-50%) rotate(180deg);
    background: var(--primary);
    color: #fff;
}

#faq details p {
    padding: 0 22px 20px;
    font-size: 0.92rem;
    animation: fadeUp 0.4s var(--ease);
}

/* ============ HowTo ============ */
#howto {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

#howto > h2 {
    grid-column: 1 / -1;
}

#howto article {
    margin-top: 0;
}

#howto ol {
    counter-reset: step;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 8px;
}

#howto ol li {
    counter-increment: step;
    position: relative;
    padding: 12px 16px 12px 52px;
    background: var(--bg-alt);
    border-radius: var(--radius-md);
    font-size: 0.92rem;
    color: var(--text-soft);
    transition: transform var(--transition), box-shadow var(--transition);
}

#howto ol li::before {
    content: counter(step);
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.85rem;
    color: #fff;
    background: var(--grad-banner);
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(255, 107, 157, 0.35);
}

#howto ol li:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow-sm);
}

/* ============ Contact ============ */
#contact address {
    font-style: normal;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 14px;
    background: var(--bg-card);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
}

#contact address p {
    padding: 12px 16px;
    background: var(--bg-alt);
    border-radius: var(--radius-md);
    font-size: 0.92rem;
    transition: background var(--transition), transform var(--transition);
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: baseline;
}

#contact address p:hover {
    background: var(--primary-soft);
    transform: translateY(-2px);
}

#contact address strong {
    color: var(--primary);
    font-weight: 700;
}

#contact address a {
    font-weight: 600;
    word-break: break-all;
}

#contact article {
    margin-top: 0;
}

/* ============ Sitemap ============ */
#sitemap nav > ul {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    background: var(--bg-card);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

#sitemap nav > ul > li {
    position: relative;
}

#sitemap nav > ul > li > a {
    display: inline-block;
    padding: 8px 18px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-soft);
    background: var(--bg-alt);
    border-radius: var(--radius-pill);
    transition: all var(--transition);
}

#sitemap nav > ul > li > a:hover {
    color: #fff;
    background: var(--grad-banner);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

#sitemap nav ul ul {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
    padding-left: 12px;
    border-left: 2px solid var(--border);
}

#sitemap nav ul ul li a {
    font-size: 0.82rem;
    color: var(--text-muted);
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    transition: color var(--transition), background var(--transition);
}

#sitemap nav ul ul li a:hover {
    color: var(--primary);
    background: var(--primary-soft);
}

/* ============ Links ============ */
#links ul {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

#links ul li a {
    display: inline-block;
    padding: 10px 22px;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-soft);
    background: var(--bg-card);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-pill);
    transition: all var(--transition);
}

#links ul li a:hover {
    color: var(--primary);
    border-color: var(--primary);
    background: var(--primary-soft);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

/* ============ Footer ============ */
footer {
    background: var(--bg-alt);
    border-top: 1px solid var(--border);
    padding: 56px 24px 32px;
    position: relative;
    overflow: hidden;
}

footer::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--grad-banner);
}

footer > div {
    max-width: var(--maxw);
    margin: 0 auto 40px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 32px;
}

footer section h3 {
    font-size: 1.05rem;
    margin-bottom: 14px;
    color: var(--text);
    position: relative;
    padding-bottom: 10px;
}

footer section h3::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 36px;
    height: 3px;
    border-radius: var(--radius-pill);
    background: var(--grad-banner);
}

footer section p {
    font-size: 0.88rem;
    margin-bottom: 8px;
    line-height: 1.7;
}

footer section ul {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

footer section ul li a {
    font-size: 0.88rem;
    color: var(--text-soft);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: color var(--transition), transform var(--transition);
}

footer section ul li a::before {
    content: "›";
    color: var(--primary);
    font-weight: 700;
    transition: transform var(--transition);
}

footer section ul li a:hover {
    color: var(--primary);
    transform: translateX(3px);
}

footer section ul li a:hover::before {
    transform: translateX(2px);
}

footer > section {
    max-width: var(--maxw);
    margin: 0 auto 24px;
    padding: 20px 24px;
    background: var(--bg-card);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    transition: box-shadow var(--transition);
}

footer > section:hover {
    box-shadow: var(--shadow-sm);
}

footer > section h3 {
    font-size: 0.95rem;
    margin-bottom: 8px;
    color: var(--primary);
}

footer > section p {
    font-size: 0.84rem;
    color: var(--text-muted);
}

footer > p {
    max-width: var(--maxw);
    margin: 0 auto;
    text-align: center;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

footer > p small {
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* ============ Scroll Animations ============ */
@media (prefers-reduced-motion: no-preference) {
    main > section article,
    #faq details,
    #contact address,
    #sitemap nav > ul,
    #links ul li,
    footer > section {
        animation: revealUp 0.7s var(--ease) both;
        animation-timeline: view();
        animation-range: entry 0% entry 30%;
    }

    @supports not (animation-timeline: view()) {
        main > section article,
        #faq details,
        #contact address,
        #sitemap nav > ul,
        #links ul li,
        footer > section {
            animation: none;
        }
    }
}

@keyframes revealUp {
    from {
        opacity: 0;
        transform: translateY(32px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Staggered card delays */
#products article:nth-child(2) { animation-delay: 0.05s; }
#products article:nth-child(3) { animation-delay: 0.1s; }
#products article:nth-child(4) { animation-delay: 0.15s; }
#products article:nth-child(5) { animation-delay: 0.2s; }

/* ============ Responsive ============ */
@media (max-width: 1024px) {
    #home {
        grid-template-columns: 1fr;
        gap: 36px;
        text-align: center;
        padding: 48px 0 56px;
    }

    #home p {
        margin-left: auto;
        margin-right: auto;
    }

    #home > div:first-child > div:last-child {
        justify-content: center;
    }

    #home > div:last-child {
        order: -1;
    }

    header nav > div {
        gap: 14px;
    }

    header nav ul {
        order: 3;
        width: 100%;
        justify-content: center;
        padding-bottom: 8px;
    }

    header nav form {
        margin-left: auto;
    }
}

@media (max-width: 768px) {
    :root {
        --header-h: 64px;
    }

    body {
        font-size: 15px;
    }

    header nav {
        padding: 0 16px;
    }

    header nav > div {
        min-height: var(--header-h);
        padding: 10px 0;
    }

    header nav > div > a:first-child svg {
        width: 128px;
        height: 40px;
    }

    header nav ul {
        gap: 2px;
    }

    header nav ul li a {
        padding: 6px 10px;
        font-size: 0.82rem;
    }

    header nav form {
        width: 100%;
        order: 4;
    }

    header nav form input[type="search"] {
        flex: 1;
        width: auto;
    }

    main {
        padding: 0 16px 56px;
    }

    main > section {
        padding: 44px 0;
    }

    #home {
        padding: 36px 0 44px;
    }

    #home > div:first-child > div:last-child {
        flex-direction: column;
        align-items: stretch;
    }

    #home > div:first-child > div:last-child a {
        width: 100%;
    }

    article {
        padding: 22px 20px;
        border-radius: var(--radius-md);
    }

    #products,
    #solutions,
    #industry,
    #cases,
    #news,
    #articles,
    #knowledge,
    #about,
    #howto,
    #faq {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    #contact address {
        padding: 18px;
        grid-template-columns: 1fr;
    }

    #sitemap nav > ul {
        padding: 18px;
    }

    footer {
        padding: 40px 16px 24px;
    }

    footer > div {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    footer > section {
        padding: 16px 18px;
    }
}

@media (max-width: 480px) {
    h1 { font-size: 1.55rem; }
    h2 { font-size: 1.25rem; }

    header nav ul li a {
        padding: 5px 8px;
        font-size: 0.76rem;
    }

    #home > div:first-child > div:last-child a {
        padding: 12px 24px;
        font-size: 0.92rem;
    }

    article h3 {
        font-size: 1.05rem;
    }

    #links ul li a {
        padding: 8px 16px;
        font-size: 0.82rem;
    }
}

/* ============ Accessibility & Motion ============ */
@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;
    }
}

@media (hover: none) {
    article:hover,
    #home > div:last-child svg:hover,
    #contact address p:hover {
        transform: none;
    }
}

/* Print */
@media print {
    header, footer::before, #home > div:last-child, #links, #sitemap {
        display: none;
    }
    body {
        background: #fff;
        color: #000;
    }
    article {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
}