:root {
    /* Day Mode (Frosted Pearl/Opalescent) */
    --bg-color: #f0f4f8;
    --text-color: #1e293b;
    --text-muted: #64748b;
    --glass-bg: rgba(255, 255, 255, 0.6);
    --glass-border: rgba(255, 255, 255, 0.4);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
    --primary-color: #3b82f6;
    --accent-1: #8b5cf6;
    --accent-2: #ec4899;
    --accent-3: #3b82f6;
    --btn-bg: linear-gradient(135deg, #60a5fa, #8b5cf6);
    --btn-hover: linear-gradient(135deg, #3b82f6, #7c3aed);
    --card-hover-shadow: 0 15px 40px rgba(139, 92, 246, 0.15);
}

[data-theme="dark"] {
    /* Dark Mode (Deep Interstellar Nebula) */
    --bg-color: #080711;
    --text-color: #f8fafc;
    --text-muted: #94a3b8;
    --glass-bg: rgba(25, 20, 35, 0.4);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
    --primary-color: #8b5cf6;
    --accent-1: #8b5cf6;
    --accent-2: #ec4899;
    --accent-3: #3b82f6;
    --btn-bg: linear-gradient(135deg, #8b5cf6, #ec4899);
    --btn-hover: linear-gradient(135deg, #7c3aed, #db2777);
    --card-hover-shadow: 0 15px 40px rgba(139, 92, 246, 0.3);
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 100px; /* Offset for fixed nav */
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
    transition: background-color 0.5s ease, color 0.5s ease;
}

/* Background Nebula Effects */
.nebula-bg {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    z-index: -1;
    overflow: hidden;
    background: var(--bg-color);
    transition: background 0.5s ease;
}

.nebula-blob {
    position: absolute;
    filter: blur(80px);
    border-radius: 50%;
    opacity: 0.5;
    animation: float 20s infinite alternate cubic-bezier(0.4, 0, 0.2, 1);
    mix-blend-mode: screen;
}
[data-theme="light"] .nebula-blob {
    mix-blend-mode: multiply;
    opacity: 0.3;
}

.blob-1 {
    width: 600px; height: 600px;
    background: var(--accent-1);
    top: -10%; left: -10%;
}
.blob-2 {
    width: 500px; height: 500px;
    background: var(--accent-2);
    bottom: -10%; right: -5%;
    animation-delay: -5s;
}
.blob-3 {
    width: 700px; height: 700px;
    background: var(--accent-3);
    top: 40%; left: 30%;
    animation-delay: -10s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(5%, 5%) scale(1.1); }
    66% { transform: translate(-5%, 8%) scale(0.9); }
    100% { transform: translate(8%, -5%) scale(1.05); }
}

/* Cursor Glow */
.cursor-glow {
    position: fixed;
    width: 400px; height: 400px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.15) 0%, rgba(0,0,0,0) 70%);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 0;
    transition: opacity 0.3s;
}

/* Glassmorphism Utilities */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: 1.5rem;
}

/* Navigation */
.glass-nav {
    position: fixed;
    top: 1rem; left: 50%;
    transform: translateX(-50%);
    width: 90%; max-width: 1200px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    z-index: 1000;
    background: var(--glass-bg);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--glass-border);
    border-radius: 999px;
    box-shadow: var(--glass-shadow);
    transition: all 0.3s ease;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(to right, var(--accent-1), var(--accent-2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 1px;
}

.nav-links { display: flex; gap: 2rem; }
.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
}
.nav-links a:hover, .nav-links a.active { color: var(--text-color); }
.nav-links a::after {
    content: ''; position: absolute; width: 0; height: 2px;
    bottom: -4px; left: 0;
    background: var(--primary-color);
    transition: width 0.3s ease;
}
.nav-links a:hover::after, .nav-links a.active::after { width: 100%; }

.nav-actions { display: flex; align-items: center; gap: 1rem; }

.btn-primary {
    background: var(--btn-bg);
    color: #fff;
    padding: 0.75rem 2rem;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
}
.btn-primary:hover {
    transform: translateY(-2px);
    background: var(--btn-hover);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.6);
}

.btn-secondary {
    background: transparent;
    color: var(--text-color);
    padding: 0.75rem 2rem;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 500;
    border: 1px solid var(--glass-border);
    transition: all 0.3s ease;
}
.btn-secondary:hover {
    background: rgba(255,255,255,0.1);
    border-color: var(--text-color);
}

.theme-toggle {
    background: transparent; border: none; cursor: pointer;
    color: var(--text-color); display: flex; align-items: center;
    padding: 0.5rem; border-radius: 50%;
    transition: background 0.3s;
}
.theme-toggle:hover { background: rgba(255,255,255,0.1); }
.theme-toggle svg { width: 20px; height: 20px; }
[data-theme="dark"] .sun-icon { display: block; }
[data-theme="dark"] .moon-icon { display: none; }
:root:not([data-theme="dark"]) .sun-icon { display: none; }
:root:not([data-theme="dark"]) .moon-icon { display: block; }


/* Sections */
.section {
    padding: 8rem 5% 4rem;
    position: relative;
    z-index: 10;
    max-width: 1200px;
    margin: 0 auto;
}
.section-title {
    text-align: center; font-size: 2.5rem; margin-bottom: 4rem;
    background: linear-gradient(to right, #fff, var(--text-muted));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
[data-theme="light"] .section-title {
    background: linear-gradient(to right, #1e293b, #64748b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding-top: 6rem;
    position: relative;
    z-index: 10;
}

.hero h1 {
    font-size: 4.5rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    background: linear-gradient(to right, #fff, var(--accent-1), var(--accent-3));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    max-width: 900px;
}

[data-theme="light"] .hero h1 {
    background: linear-gradient(to right, #1e293b, var(--accent-1), var(--accent-3));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-muted);
    max-width: 700px;
    margin-bottom: 3rem;
}

.hero-actions {
    display: flex; gap: 1rem; margin-bottom: 4rem;
}

/* Latency Compass Widget */
.compass-widget {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 2rem;
    padding: 1rem 2rem;
    display: flex; align-items: center; gap: 1rem;
    box-shadow: var(--glass-shadow);
    animation: pulse 4s infinite alternate;
}
.compass-icon {
    width: 24px; height: 24px; color: var(--accent-2);
    animation: spin 10s linear infinite;
}
.compass-text { font-size: 0.9rem; color: var(--text-muted); }
.compass-ping { font-weight: bold; color: #10b981; font-family: monospace; font-size: 1.1rem; }

@keyframes spin { 100% { transform: rotate(360deg); } }
@keyframes pulse { 100% { box-shadow: 0 0 20px rgba(236, 72, 153, 0.2); } }

/* Cards & Hover Effects */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--glass-border);
    border-radius: 1.5rem;
    padding: 2.5rem;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

.glass-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    border-radius: 1.5rem;
    padding: 2px;
    background: linear-gradient(135deg, rgba(255,255,255,0.2), rgba(255,255,255,0));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    transition: opacity 0.3s;
}

.glass-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: var(--card-hover-shadow);
    border-color: rgba(139, 92, 246, 0.4);
}

/* Grids */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 2rem; }

.card-icon svg {
    width: 40px; height: 40px; margin-bottom: 1.5rem;
    color: var(--accent-1);
}

.glass-card h3 { font-size: 1.5rem; margin-bottom: 1rem; }
.glass-card p { color: var(--text-muted); }

/* Segmented Controller */
.scenario-controller {
    display: flex;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 999px;
    padding: 0.5rem;
    margin: 0 auto 3rem;
    max-width: 800px;
    position: relative;
}

.scenario-btn {
    flex: 1; text-align: center; padding: 0.75rem 1rem;
    cursor: pointer; color: var(--text-muted);
    font-weight: 500; position: relative; z-index: 2;
    transition: color 0.3s; border: none; background: none;
}
.scenario-btn.active { color: #fff; }
[data-theme="light"] .scenario-btn.active { color: #000; }

.scenario-indicator {
    position: absolute; top: 0.5rem; left: 0.5rem;
    height: calc(100% - 1rem); width: calc(25% - 0.25rem);
    background: rgba(139, 92, 246, 0.3);
    border-radius: 999px;
    z-index: 1;
    transition: transform 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
}
[data-theme="light"] .scenario-indicator { background: rgba(59, 130, 246, 0.2); }

/* Pricing */
.pricing-header {
    text-align: center; margin-bottom: 3rem;
}
.pricing-toggle {
    display: inline-flex; align-items: center; gap: 1rem;
    background: var(--glass-bg); border-radius: 999px;
    padding: 0.5rem 1rem; border: 1px solid var(--glass-border);
}
.toggle-switch {
    width: 50px; height: 26px; background: var(--glass-border);
    border-radius: 26px; position: relative; cursor: pointer;
}
.toggle-switch::after {
    content: ''; position: absolute; width: 22px; height: 22px;
    background: var(--primary-color); border-radius: 50%;
    top: 2px; left: 2px; transition: transform 0.3s;
}
.toggle-switch.annual::after { transform: translateX(24px); }
.discount-badge {
    background: rgba(236, 72, 153, 0.2); color: var(--accent-2);
    font-size: 0.75rem; padding: 0.2rem 0.5rem; border-radius: 4px;
}

.price-card {
    display: flex; flex-direction: column;
}
.price-card.popular {
    border: 1px solid var(--accent-1);
    box-shadow: 0 0 30px rgba(139, 92, 246, 0.15);
    transform: scale(1.05);
}
.price-card.popular:hover { transform: translateY(-10px) scale(1.05); }

.price-header { border-bottom: 1px solid var(--glass-border); padding-bottom: 1.5rem; margin-bottom: 1.5rem; }
.price-amount { font-size: 3rem; font-weight: 700; color: var(--text-color); margin: 1rem 0; }
.price-amount span { font-size: 1rem; color: var(--text-muted); font-weight: 400; }
.price-card ul { list-style: none; flex-grow: 1; margin-bottom: 2rem; }
.price-card ul li { margin-bottom: 1rem; display: flex; align-items: center; gap: 0.5rem; color: var(--text-muted); }
.price-card ul li svg { width: 20px; height: 20px; color: var(--accent-1); }

/* FAQ & Footer */
.faq-item { border-bottom: 1px solid var(--glass-border); padding: 1.5rem 0; }
.faq-item h4 { font-size: 1.2rem; margin-bottom: 0.5rem; }
.faq-item p { color: var(--text-muted); }

footer {
    border-top: 1px solid var(--glass-border);
    padding: 4rem 5% 2rem;
    margin-top: 5rem;
    background: rgba(0,0,0,0.2);
    position: relative; z-index: 10;
}
[data-theme="light"] footer { background: rgba(255,255,255,0.3); }

.footer-links { display: flex; justify-content: center; gap: 2rem; margin-bottom: 2rem; }
.footer-links a { color: var(--text-muted); text-decoration: none; transition: color 0.3s; }
.footer-links a:hover { color: var(--text-color); }
.copyright { text-align: center; color: var(--text-muted); font-size: 0.875rem; }

/* Subpage styling */
.page-content { padding: 3rem; }
.page-content h1 { font-size: 2.5rem; margin-bottom: 2rem; border-bottom: 1px solid var(--glass-border); padding-bottom: 1rem; }
.page-content h2 { margin: 2rem 0 1rem; color: var(--primary-color); }
.page-content p { color: var(--text-muted); margin-bottom: 1rem; }
.page-content ul { margin-left: 1.5rem; color: var(--text-muted); margin-bottom: 1rem; }

/* Responsive */
@media (max-width: 900px) {
    .grid-3, .pricing-table { grid-template-columns: repeat(2, 1fr); }
    .price-card.popular { transform: none; }
    .price-card.popular:hover { transform: translateY(-10px); }
    .hero h1 { font-size: 3.5rem; }
}

@media (max-width: 768px) {
    .nav-links { display: none; }
    .grid-3, .grid-2, .pricing-table { grid-template-columns: 1fr; }
    .hero h1 { font-size: 2.5rem; }
    .scenario-controller { flex-wrap: wrap; border-radius: 1rem; }
    .scenario-indicator { display: none; }
    .scenario-btn { flex: 1 1 50%; border-radius: 0.5rem; }
    .scenario-btn.active { background: rgba(139, 92, 246, 0.3); }
    .hero-actions { flex-direction: column; width: 100%; max-width: 300px; }
}
