:root {
    --bg-color: #ffffff;
    --text-primary: #171717;
    --text-secondary: #525252;
    --text-tertiary: #a3a3a3;
    --brand-blue: #3b82f6;
    --brand-cyan: #06b6d4;
    
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    
    --radius-pill: 999px;
    --radius-lg: 32px;
    --radius-md: 24px;
    
    --transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

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

html { overflow-x: hidden; }

body { 
    font-family: var(--font-main); color: var(--text-primary); 
    background-color: var(--bg-color); line-height: 1.5; 
    -webkit-font-smoothing: antialiased; overflow-x: hidden;
}

a { text-decoration: none; color: inherit; transition: var(--transition); }
ul { list-style: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }

/* Typography */
h1, h2, h3 { font-weight: 500; letter-spacing: -0.04em; line-height: 1.1; overflow-wrap: break-word; word-break: break-word; }
p { letter-spacing: -0.01em; color: var(--text-secondary); }

.container { max-width: 1440px; margin: 0 auto; padding: 0 4rem; position: relative; z-index: 10; }
@media (max-width: 768px) { .container { padding: 0 1.5rem; } }

/* --- Header --- */
header { 
    position: fixed; top: 0; left: 0; width: 100%; height: 80px;
    background: rgba(255, 255, 255, 0.9); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    z-index: 100; display: flex; align-items: center; border-bottom: 1px solid rgba(0,0,0,0.03);
}
.nav-inner { display: flex; justify-content: space-between; align-items: center; width: 100%; }

.logo-area { display: flex; align-items: center; gap: 3rem; }
.logo { display: flex; align-items: center; gap: 8px; font-size: 1.25rem; font-weight: 600; letter-spacing: -0.03em; }
.logo svg { width: 22px; height: 22px; }
.logo span { font-weight: 400; color: var(--text-secondary); }

.nav-links { display: flex; gap: 2rem; }
.nav-links a { font-size: 0.9rem; font-weight: 500; color: var(--text-secondary); display: flex; align-items: center; position: relative; }
.nav-links a:hover { color: var(--text-primary); }
.nav-links a.active { color: var(--text-primary); font-weight: 600; }
.nav-links a.active::after { content: ''; position: absolute; bottom: -4px; left: 0; right: 0; height: 2px; background: var(--text-primary); border-radius: 2px; }

.nav-actions { display: flex; align-items: center; gap: 1.5rem; }
.btn-download-pill { 
    background: #171717; color: #fff; padding: 0.6rem 1.2rem; 
    border-radius: var(--radius-pill); font-size: 0.9rem; font-weight: 500;
    display: flex; align-items: center; gap: 6px; transition: var(--transition);
}
.btn-download-pill:hover { background: #333; transform: translateY(-1px); }
.btn-download-pill svg { width: 16px; height: 16px; fill: currentColor; }

/* Language Switch */
.lang-links { display: flex; align-items: center; gap: 0.25rem; }
.lang-link { font-size: 0.82rem; font-weight: 500; color: var(--text-tertiary); padding: 0.3rem 0.65rem; border-radius: 8px; transition: var(--transition); }
.lang-link:hover { color: var(--text-primary); background: #f5f5f5; }
.lang-link.active { color: var(--text-primary); background: #f0f0f0; }

/* --- Hero Section --- */
.hero { 
    min-height: 100vh; display: flex; align-items: center; justify-content: center; 
    text-align: center; position: relative; padding-top: 80px;
}
#hero-canvas { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; }
.hero-content { position: relative; z-index: 10; max-width: 900px; display: flex; flex-direction: column; align-items: center; }
.hero-pre { display: flex; align-items: center; gap: 8px; font-weight: 500; font-size: 1.1rem; margin-bottom: 2rem; color: var(--text-primary); }
.hero h1 { font-size: clamp(3rem, 6vw, 5.5rem); margin-bottom: 1.5rem; font-weight: 500; letter-spacing: -0.05em; line-height: 1.05; min-height: 1.1em; }
.hero-desc { font-size: 1.25rem; color: var(--text-secondary); max-width: 700px; margin-bottom: 2.5rem; line-height: 1.6; }

/* Typewriter Animation — pure opacity, no transform, no will-change.
   Opacity-only transitions are always GPU-composited without promoting layers. */
.char {
    display: inline-block;
    opacity: 0;
    animation: revealChar 0.5s ease-out forwards;
}
@keyframes revealChar {
    from { opacity: 0; }
    to   { opacity: 1; }
}
.typewriter-cursor {
    display: inline-block; width: 2px; height: 0.75em;
    background: linear-gradient(180deg, var(--brand-blue), var(--brand-cyan));
    vertical-align: baseline;
    margin-left: 4px; border-radius: 2px;
    animation: smoothBlink 1s ease-in-out infinite;
}
@keyframes smoothBlink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

.hero-buttons { display: flex; gap: 1rem; }
.btn-large { 
    padding: 1rem 2rem; border-radius: var(--radius-pill); font-size: 1.1rem; 
    font-weight: 500; display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: var(--transition);
}
.btn-dark { background: var(--text-primary); color: #fff; }
.btn-dark:hover { background: #333; transform: scale(1.02); box-shadow: 0 10px 20px rgba(0,0,0,0.1); }
.btn-light { background: #f5f5f5; color: var(--text-primary); }
.btn-light:hover { background: #e5e5e5; }

.section-padding { padding: 8rem 0; }

/* --- Downloads Platforms (Pills) --- */
.platforms-container { display: flex; flex-wrap: wrap; justify-content: center; gap: 1rem; margin-top: 3rem; }
.platform-pill { 
    display: flex; align-items: center; gap: 10px; 
    padding: 1rem 1.8rem; border-radius: var(--radius-pill); 
    background: #fff; border: 1px solid #e5e5e5; 
    font-size: 1.05rem; font-weight: 500; cursor: pointer; transition: var(--transition);
    text-decoration: none; color: var(--text-primary);
}
.platform-pill:hover { border-color: var(--brand-blue); transform: translateY(-3px); box-shadow: 0 10px 20px rgba(0,0,0,0.05); color: var(--brand-blue); }
.platform-pill svg { width: 22px; height: 22px; fill: currentColor; }

/* --- Section: Split Config/Routing Feature --- */
.split-layout { display: grid; grid-template-columns: 1fr 1.2fr; gap: 6rem; align-items: center; }
.split-text h2 { font-size: clamp(2.5rem, 4vw, 3.5rem); margin-bottom: 1.5rem; }
.split-text p { font-size: 1.2rem; line-height: 1.6; color: var(--text-secondary); margin-bottom: 2rem; }

.glow-card-wrapper { position: relative; padding: 2px; border-radius: var(--radius-lg); background: linear-gradient(135deg, #fde047, #f97316, #3b82f6, #10b981); box-shadow: 0 30px 60px rgba(0,0,0,0.08); }
.glow-card-wrapper::after { content: ''; position: absolute; inset: 0; background: inherit; filter: blur(20px); z-index: -1; opacity: 0.4; }
.glow-card-inner { background: #fff; border-radius: calc(var(--radius-lg) - 2px); padding: 3rem; height: 100%; }

.mock-editor { font-family: 'Courier New', Courier, monospace; font-size: 0.9rem; line-height: 1.7; color: #374151; }
.mock-header { display: flex; gap: 8px; margin-bottom: 2rem; border-bottom: 1px solid #f3f4f6; padding-bottom: 1rem; color: #9ca3af; font-family: var(--font-main); font-size: 0.85rem;}
.mock-line { display: flex; gap: 1rem; }
.mock-num { color: #cbd5e1; user-select: none; width: 20px; text-align: right; }
.c-keyword { color: #c026d3; } .c-string { color: #16a34a; } .c-tag { color: #2563eb; } .c-prop { color: #ea580c; }

/* --- Section: Clients (Large Cards) --- */
.cards-header { text-align: center; margin-bottom: 4rem; }
.cards-header h2 { font-size: clamp(2.5rem, 4vw, 3.5rem); margin-bottom: 1rem; }

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; }
.large-image-card { 
    background: #f8fafc; border-radius: var(--radius-md); height: 450px; 
    padding: 3rem 2rem; display: flex; flex-direction: column; justify-content: flex-end;
    position: relative; overflow: hidden; transition: var(--transition); border: 1px solid #f1f5f9;
}
.large-image-card:hover { transform: translateY(-5px); box-shadow: 0 20px 40px rgba(0,0,0,0.08); border-color: #e2e8f0; }
.large-image-card h3 { font-size: 2rem; color: #fff; position: relative; z-index: 2; line-height: 1.1; margin-bottom: 1rem; }
.large-image-card p { color: rgba(255,255,255,0.9); position: relative; z-index: 2; font-size: 1rem; margin-bottom: 1.5rem; line-height: 1.5; }

.card-bg-1 { position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0) 70%), url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%"><rect width="100%" height="100%" fill="%230f172a"/></svg>') center/cover; }
.card-bg-2 { position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0) 70%), url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%"><rect width="100%" height="100%" fill="%23334155"/></svg>') center/cover; }
.card-bg-3 { position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0) 70%), url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%"><rect width="100%" height="100%" fill="%23475569"/></svg>') center/cover; }

/* --- Section: Stats & Open Source (Particle Braces) --- */
.particle-section { position: relative; padding: 8rem 0; overflow: hidden; border-top: 1px solid #f5f5f5; border-bottom: 1px solid #f5f5f5; }
.dot-pattern-bg { position: absolute; inset: 0; z-index: 0; background-image: radial-gradient(#cbd5e1 1px, transparent 1px); background-size: 30px 30px; opacity: 0.4; }
.particle-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; position: relative; z-index: 10; }
.particle-box { display: flex; flex-direction: column; align-items: center; text-align: center; position: relative; padding: 4rem 2rem; }

.svg-brackets { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 100%; height: 120%; z-index: -1; opacity: 0.8; }
.pill-label { background: #fff; border: 1px solid #e5e5e5; padding: 0.4rem 1rem; border-radius: var(--radius-pill); font-size: 0.85rem; font-weight: 500; margin-bottom: 1.5rem; display: inline-block; color: var(--brand-blue); }
.particle-box h3 { font-size: 3.5rem; margin-bottom: 1rem; line-height: 1; letter-spacing: -0.05em; }
.particle-box p { font-size: 1.1rem; color: var(--text-secondary); margin-bottom: 2rem; max-width: 300px; }

/* --- Section: More Features (Dark Cards) --- */
.features-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2rem; margin-top: 3rem; }
.feature-card-dark { cursor: pointer; }
.feature-img { 
    background: #0a0a0a; border-radius: var(--radius-md); aspect-ratio: 1/1; 
    margin-bottom: 1.5rem; position: relative; overflow: hidden;
    display: flex; align-items: center; justify-content: center; transition: var(--transition);
}
.feature-card-dark:hover .feature-img { transform: translateY(-4px); box-shadow: 0 20px 40px rgba(0,0,0,0.1); }
.feature-img svg { width: 60%; height: 60%; opacity: 0.8; }
.feature-card-dark h4 { font-size: 1.4rem; font-weight: 500; margin-bottom: 0.5rem; }
.feature-card-dark p { font-size: 0.95rem; color: var(--text-tertiary); line-height: 1.5; }

/* Footer */
footer { padding: 5rem 0 3rem; background: #fafafa; margin-top: 5rem; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 4rem; margin-bottom: 4rem; }
.footer-brand .logo { margin-bottom: 1rem; }
.footer-brand p { max-width: 300px; font-size: 0.95rem; }
.footer-col h4 { font-size: 1rem; color: var(--text-primary); margin-bottom: 1.5rem; }
.footer-col ul li { margin-bottom: 0.8rem; font-size: 0.95rem; }
.footer-col a:hover { color: var(--brand-blue); }
.footer-bottom { border-top: 1px solid #e5e5e5; padding-top: 2rem; display: flex; justify-content: space-between; align-items: center; font-size: 0.9rem; color: var(--text-tertiary); }

/* --- Mobile Navigation --- */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 36px; height: 36px;
    padding: 7px;
    cursor: pointer;
    flex-shrink: 0;
}
.mobile-menu-btn span {
    display: block;
    width: 22px; height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s;
    transform-origin: center;
}
.mobile-menu-btn.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.mobile-menu-btn.open span:nth-child(2) { opacity: 0; }
.mobile-menu-btn.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-nav {
    display: none;
    position: fixed;
    top: 80px; left: 0; right: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    padding: 1rem 1.5rem 1.5rem;
    z-index: 99;
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 0.25s ease, transform 0.25s ease;
    pointer-events: none;
}
.mobile-nav.open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}
.mobile-nav-links {
    display: flex;
    flex-direction: column;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #f0f0f0;
}
.mobile-nav-links a {
    font-size: 1rem; font-weight: 500;
    color: var(--text-secondary);
    padding: 0.7rem 0.75rem;
    border-radius: 8px;
    transition: background 0.2s, color 0.2s;
}
.mobile-nav-links a:hover,
.mobile-nav-links a.active {
    color: var(--text-primary);
    background: #f5f5f5;
}
.mobile-lang-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.mobile-lang-links a {
    font-size: 0.82rem; font-weight: 500;
    color: var(--text-tertiary);
    padding: 0.3rem 0.65rem;
    border-radius: 8px;
    border: 1px solid #e5e5e5;
    transition: var(--transition);
}
.mobile-lang-links a:hover { color: var(--text-primary); border-color: #aaa; }
.mobile-lang-links a.active { color: var(--text-primary); background: #f0f0f0; border-color: #ddd; }

/* Clash Meta dark section responsive */
.clash-meta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 5rem; align-items: center; }
@media (max-width: 1024px) {
    .split-layout { grid-template-columns: 1fr; gap: 4rem; }
    .grid-3, .features-grid { grid-template-columns: repeat(2, 1fr); }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .clash-meta-grid { grid-template-columns: 1fr; gap: 3rem; }
}
@media (max-width: 768px) {
    .nav-links { display: none; }
    .lang-links { display: none; }
    .mobile-menu-btn { display: flex; }
    .mobile-nav { display: block; }
    .grid-3, .features-grid, .particle-grid, .footer-grid { grid-template-columns: 1fr; }
    .hero h1 { font-size: 1.8rem; letter-spacing: -0.03em; }
    .hero-pre { font-size: 0.85rem; flex-wrap: wrap; justify-content: center; gap: 6px; }
    .hero-desc { font-size: 1rem; }
    .hero-buttons { flex-direction: column; width: 100%; max-width: 320px; }
    .btn-large { width: 100%; }
    .platform-pill { padding: 0.75rem 1.2rem; font-size: 0.95rem; }
    .clash-meta-grid { grid-template-columns: 1fr; }
    .section-padding { padding: 5rem 0; }
    .glow-card-inner { padding: 1.5rem; }
    .particle-box { padding: 2.5rem 1rem; }
    .particle-box h3 { font-size: 2.5rem; }
    .footer-bottom { flex-direction: column; gap: 1rem; text-align: center; }
    footer { padding: 3.5rem 0 2rem; margin-top: 3rem; }
    .large-image-card { height: 340px; padding: 2rem 1.5rem; }
}

/* --- Section Label --- */
.section-label { color: var(--brand-blue); font-size: 0.85rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 0.75rem; display: block; }

/* --- Section: How it Works (3 Steps) --- */
.steps-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; margin-top: 4rem; position: relative; }
.steps-grid::before { content: ''; position: absolute; top: 32px; left: calc(16.6% + 2.5rem); right: calc(16.6% + 2.5rem); height: 2px; border-top: 2px dashed #e5e5e5; z-index: 0; }
.step-card { text-align: center; position: relative; z-index: 1; padding: 0 1rem; }
.step-num { width: 64px; height: 64px; border-radius: var(--radius-pill); background: var(--text-primary); color: #fff; font-size: 1.3rem; font-weight: 600; display: flex; align-items: center; justify-content: center; margin: 0 auto 1.5rem; letter-spacing: -0.04em; }
.step-card h3 { font-size: 1.2rem; margin-bottom: 0.75rem; }
.step-card p { font-size: 0.95rem; color: var(--text-tertiary); line-height: 1.65; }

/* --- Section: Protocol Support Badges --- */
.protocol-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-top: 3rem; }
.protocol-badge { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 16px; padding: 1.4rem 1rem; text-align: center; transition: var(--transition); cursor: default; }
.protocol-badge:hover { border-color: var(--brand-blue); background: #eff6ff; transform: translateY(-2px); }
.proto-name { font-size: 1rem; font-weight: 600; color: var(--text-primary); margin-bottom: 0.3rem; }
.proto-desc { font-size: 0.8rem; color: var(--text-tertiary); }

/* --- Section: FAQ Accordion --- */
.faq-list { margin-top: 3rem; border-top: 1px solid #efefef; }
.faq-item { border-bottom: 1px solid #efefef; }
.faq-question { width: 100%; text-align: left; padding: 1.5rem 0; font-size: 1.05rem; font-weight: 500; display: flex; justify-content: space-between; align-items: center; gap: 1.5rem; cursor: pointer; background: none; border: none; font-family: inherit; color: var(--text-primary); transition: color 0.3s; }
.faq-question:hover { color: var(--brand-blue); }
.faq-icon { width: 28px; height: 28px; border-radius: 50%; background: #f5f5f5; display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: var(--transition); }
.faq-icon svg { width: 14px; height: 14px; transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1); }
.faq-item.open .faq-icon { background: var(--text-primary); }
.faq-item.open .faq-icon svg { transform: rotate(45deg); stroke: #fff; }
.faq-answer { max-height: 0; overflow: hidden; transition: max-height 0.5s cubic-bezier(0.16, 1, 0.3, 1); }
.faq-answer-inner { padding-bottom: 1.75rem; color: var(--text-secondary); line-height: 1.8; font-size: 1rem; max-width: 840px; }
.faq-item.open .faq-answer { max-height: 2000px; }

/* --- Section: CTA Banner --- */
.cta-section { background: var(--text-primary); border-radius: var(--radius-lg); padding: 5rem 4rem; text-align: center; color: #fff; position: relative; overflow: hidden; }
.cta-section::before { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse at 25% 60%, rgba(59,130,246,0.35) 0%, transparent 55%), radial-gradient(ellipse at 75% 40%, rgba(6,182,212,0.25) 0%, transparent 55%); }
.cta-section > * { position: relative; z-index: 1; }
.cta-section h2 { font-size: clamp(2rem, 4vw, 3rem); color: #fff; margin-bottom: 1rem; }
.cta-section p { color: rgba(255,255,255,0.65); font-size: 1.15rem; margin-bottom: 2.5rem; max-width: 580px; margin-left: auto; margin-right: auto; }
.cta-buttons { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.btn-white { background: #fff; color: var(--text-primary); padding: 0.9rem 2rem; border-radius: var(--radius-pill); font-size: 1rem; font-weight: 500; display: inline-flex; align-items: center; gap: 8px; transition: var(--transition); }
.btn-white:hover { background: #f0f0f0; transform: translateY(-2px); box-shadow: 0 10px 20px rgba(0,0,0,0.15); }
.btn-ghost-white { border: 1.5px solid rgba(255,255,255,0.25); color: rgba(255,255,255,0.85); padding: 0.9rem 2rem; border-radius: var(--radius-pill); font-size: 1rem; font-weight: 500; display: inline-flex; align-items: center; gap: 8px; transition: var(--transition); }
.btn-ghost-white:hover { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.5); transform: translateY(-2px); }

@media (max-width: 1024px) {
    .steps-grid::before { display: none; }
    .protocol-grid { grid-template-columns: repeat(2, 1fr); }
    .cta-section { padding: 3.5rem 2.5rem; }
}
@media (max-width: 768px) {
    .steps-grid, .protocol-grid { grid-template-columns: 1fr; }
    .cta-section { padding: 2.5rem 1.5rem; border-radius: var(--radius-md); }
    .features-grid { grid-template-columns: 1fr !important; }
    .split-text h2 { font-size: 1.5rem; }
    .split-text p { font-size: 1rem; }
    .cards-header h2 { font-size: 1.5rem; }
    .protocol-grid { grid-template-columns: repeat(2, 1fr); }
    .step-card { padding: 0 0.5rem; }
    .step-num { width: 52px; height: 52px; font-size: 1.1rem; }
}
