/* ==========================================================================
   SERVERWATCH - Infrastructure Monitoring Template
   A premium observability platform template inspired by Datadog/New Relic
   ========================================================================== */

/* ==========================================================================
   CSS CUSTOM PROPERTIES (DESIGN TOKENS)
   ========================================================================== */

:root {
    /* Brand Colors - Orange primary with dark UI */
    --color-primary-50: #fff7ed;
    --color-primary-100: #ffedd5;
    --color-primary-200: #fed7aa;
    --color-primary-300: #fdba74;
    --color-primary-400: #fb923c;
    --color-primary-500: #f97316;
    --color-primary-600: #ea580c;
    --color-primary-700: #c2410c;
    --color-primary-800: #9a3412;
    --color-primary-900: #7c2d12;

    /* Status Colors */
    --color-success: #22c55e;
    --color-success-light: #4ade80;
    --color-warning: #eab308;
    --color-warning-light: #facc15;
    --color-error: #ef4444;
    --color-error-light: #f87171;
    --color-info: #3b82f6;
    --color-info-light: #60a5fa;

    /* Metric Colors */
    --color-cpu: #8b5cf6;
    --color-memory: #06b6d4;
    --color-network: #10b981;
    --color-disk: #f59e0b;
    --color-requests: #ec4899;
    --color-latency: #6366f1;

    /* Neutral Scale - Dark theme base */
    --color-neutral-50: #fafafa;
    --color-neutral-100: #f4f4f5;
    --color-neutral-200: #e4e4e7;
    --color-neutral-300: #d4d4d8;
    --color-neutral-400: #a1a1aa;
    --color-neutral-500: #71717a;
    --color-neutral-600: #52525b;
    --color-neutral-700: #3f3f46;
    --color-neutral-800: #27272a;
    --color-neutral-850: #1f1f23;
    --color-neutral-900: #18181b;
    --color-neutral-950: #09090b;

    /* Background Colors */
    --bg-primary: #09090b;
    --bg-secondary: #18181b;
    --bg-tertiary: #27272a;
    --bg-elevated: #1f1f23;
    --bg-card: rgba(39, 39, 42, 0.5);
    --bg-card-hover: rgba(39, 39, 42, 0.8);

    /* Text Colors */
    --text-primary: #fafafa;
    --text-secondary: #a1a1aa;
    --text-tertiary: #71717a;
    --text-muted: #52525b;

    /* Border Colors */
    --border-default: rgba(63, 63, 70, 0.5);
    --border-hover: rgba(63, 63, 70, 0.8);
    --border-focus: var(--color-primary-500);

    /* Typography - IBM Plex family */
    --font-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;
    --font-sans: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

    /* Typography Scale */
    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.5rem;
    --text-3xl: 1.875rem;
    --text-4xl: 2.25rem;
    --text-5xl: 3rem;
    --text-6xl: 3.75rem;
    --text-hero: clamp(2.5rem, 6vw, 4.5rem);
    --text-display: clamp(2rem, 4vw, 3rem);

    /* Font Weights */
    --font-light: 300;
    --font-normal: 400;
    --font-medium: 500;
    --font-semibold: 600;
    --font-bold: 700;

    /* Line Heights */
    --leading-none: 1;
    --leading-tight: 1.25;
    --leading-snug: 1.375;
    --leading-normal: 1.5;
    --leading-relaxed: 1.625;
    --leading-loose: 2;

    /* Letter Spacing */
    --tracking-tight: -0.025em;
    --tracking-normal: 0;
    --tracking-wide: 0.025em;
    --tracking-wider: 0.05em;
    --tracking-widest: 0.1em;

    /* Spacing Scale (8px base) */
    --space-0: 0;
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;
    --space-20: 5rem;
    --space-24: 6rem;
    --space-32: 8rem;
    --space-40: 10rem;
    --space-48: 12rem;

    /* Border Radius */
    --radius-none: 0;
    --radius-sm: 0.25rem;
    --radius-md: 0.375rem;
    --radius-lg: 0.5rem;
    --radius-xl: 0.75rem;
    --radius-2xl: 1rem;
    --radius-3xl: 1.5rem;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.5);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5), 0 2px 4px -2px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -4px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.75);
    --shadow-glow-sm: 0 0 15px rgba(234, 88, 12, 0.3);
    --shadow-glow-md: 0 0 30px rgba(234, 88, 12, 0.4);
    --shadow-glow-lg: 0 0 60px rgba(234, 88, 12, 0.5);
    --shadow-glow-success: 0 0 20px rgba(34, 197, 94, 0.4);
    --shadow-glow-error: 0 0 20px rgba(239, 68, 68, 0.4);

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slower: 500ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-spring: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);

    /* Z-Index Scale */
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-fixed: 300;
    --z-modal-backdrop: 400;
    --z-modal: 500;
    --z-tooltip: 600;
    --z-toast: 700;

    /* Container */
    --container-max: 1280px;
    --container-padding: var(--space-6);
}

/* Light theme overrides */
[data-theme="light"] {
    --bg-primary: #ffffff;
    --bg-secondary: #f4f4f5;
    --bg-tertiary: #e4e4e7;
    --bg-elevated: #ffffff;
    --bg-card: rgba(244, 244, 245, 0.8);
    --bg-card-hover: rgba(228, 228, 231, 0.9);

    --text-primary: #18181b;
    --text-secondary: #52525b;
    --text-tertiary: #71717a;
    --text-muted: #a1a1aa;

    --border-default: rgba(228, 228, 231, 0.8);
    --border-hover: rgba(212, 212, 216, 0.9);

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

/* ==========================================================================
   BASE STYLES
   ========================================================================== */

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    font-size: var(--text-base);
    line-height: var(--leading-normal);
    color: var(--text-primary);
    background-color: var(--bg-primary);
    min-height: 100vh;
}

/* Selection */
::selection {
    background-color: var(--color-primary-600);
    color: white;
}

/* Focus */
:focus {
    outline: none;
}

:focus-visible {
    outline: 2px solid var(--color-primary-500);
    outline-offset: 2px;
}

/* Links */
a {
    color: inherit;
    text-decoration: none;
    transition: color var(--transition-fast);
}

/* Images */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Lists */
ul, ol {
    list-style: none;
}

/* Buttons */
button {
    font-family: inherit;
    font-size: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

/* Code */
code, pre {
    font-family: var(--font-mono);
}

/* ==========================================================================
   TYPOGRAPHY
   ========================================================================== */

h1, h2, h3, h4, h5, h6 {
    font-weight: var(--font-semibold);
    line-height: var(--leading-tight);
    letter-spacing: var(--tracking-tight);
}

.text-hero {
    font-size: var(--text-hero);
    font-weight: var(--font-bold);
    line-height: var(--leading-none);
    letter-spacing: -0.03em;
}

.text-display {
    font-size: var(--text-display);
    font-weight: var(--font-semibold);
    line-height: var(--leading-tight);
}

.text-mono {
    font-family: var(--font-mono);
}

.text-gradient {
    background: linear-gradient(135deg, var(--color-primary-400), var(--color-primary-600));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-gradient-orange {
    background: linear-gradient(135deg, #fb923c, #ea580c, #c2410c);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ==========================================================================
   LAYOUT
   ========================================================================== */

.container {
    width: 100%;
    max-width: var(--container-max);
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--container-padding);
    padding-right: var(--container-padding);
}

.container-lg {
    max-width: 1440px;
}

.container-sm {
    max-width: 960px;
}

/* Section Spacing */
.section {
    padding-top: var(--space-20);
    padding-bottom: var(--space-20);
}

.section-lg {
    padding-top: var(--space-32);
    padding-bottom: var(--space-32);
}

/* ==========================================================================
   NAVIGATION
   ========================================================================== */

.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: var(--z-sticky);
    background: rgba(9, 9, 11, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-default);
    transition: all var(--transition-base);
}

[data-theme="light"] .nav {
    background: rgba(255, 255, 255, 0.8);
}

.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-weight: var(--font-bold);
    font-size: var(--text-lg);
}

.nav-logo-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--color-primary-500), var(--color-primary-700));
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-links {
    display: none;
    align-items: center;
    gap: var(--space-1);
}

@media (min-width: 1024px) {
    .nav-links {
        display: flex;
    }
}

.nav-link {
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.nav-link:hover {
    color: var(--text-primary);
    background: var(--bg-card);
}

.nav-link.active {
    color: var(--color-primary-500);
}

.nav-dropdown {
    position: relative;
}

.nav-dropdown-trigger {
    display: flex;
    align-items: center;
    gap: var(--space-1);
}

.nav-dropdown-content {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 240px;
    padding: var(--space-2);
    background: var(--bg-secondary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all var(--transition-base);
}

.nav-dropdown:hover .nav-dropdown-content {
    opacity: 1;
    visibility: visible;
    transform: translateY(4px);
}

.nav-dropdown-link {
    display: block;
    padding: var(--space-3) var(--space-4);
    font-size: var(--text-sm);
    color: var(--text-secondary);
    border-radius: var(--radius-lg);
    transition: all var(--transition-fast);
}

.nav-dropdown-link:hover {
    color: var(--text-primary);
    background: var(--bg-card);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.nav-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    color: var(--text-primary);
    border-radius: var(--radius-lg);
    transition: background var(--transition-fast);
}

.nav-toggle:hover {
    background: var(--bg-card);
}

@media (min-width: 1024px) {
    .nav-toggle.mobile-menu {
        display: none;
    }
}

/* Mobile Menu */
.mobile-nav {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-primary);
    padding: var(--space-6);
    transform: translateX(100%);
    transition: transform var(--transition-slow);
    z-index: var(--z-fixed);
    overflow-y: auto;
}

.mobile-nav.active {
    transform: translateX(0);
}

.mobile-nav-link {
    display: block;
    padding: var(--space-4) 0;
    font-size: var(--text-lg);
    font-weight: var(--font-medium);
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-default);
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-5);
    font-family: var(--font-sans);
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    line-height: var(--leading-tight);
    text-decoration: none;
    border-radius: var(--radius-lg);
    transition: all var(--transition-fast);
    cursor: pointer;
    border: none;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-primary-500), var(--color-primary-600));
    color: white;
    box-shadow: var(--shadow-glow-sm);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--color-primary-400), var(--color-primary-500));
    box-shadow: var(--shadow-glow-md);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-default);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover {
    color: var(--text-primary);
    background: var(--bg-card);
}

.btn-lg {
    padding: var(--space-4) var(--space-6);
    font-size: var(--text-base);
    border-radius: var(--radius-xl);
}

.btn-sm {
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-xs);
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: var(--radius-lg);
}

/* ==========================================================================
   CARDS
   ========================================================================== */

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    transition: all var(--transition-base);
}

.card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.card-glow {
    position: relative;
}

.card-glow::before {
    content: '';
    position: absolute;
    inset: -1px;
    background: linear-gradient(135deg, var(--color-primary-500), transparent, var(--color-primary-500));
    border-radius: inherit;
    opacity: 0;
    transition: opacity var(--transition-base);
    z-index: -1;
}

.card-glow:hover::before {
    opacity: 0.5;
}

/* Dashboard Card */
.dashboard-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-xl);
    overflow: hidden;
}

.dashboard-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4) var(--space-5);
    border-bottom: 1px solid var(--border-default);
}

.dashboard-card-title {
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.dashboard-card-body {
    padding: var(--space-5);
}

/* Metric Card */
.metric-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
}

.metric-label {
    font-size: var(--text-xs);
    font-weight: var(--font-medium);
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wider);
    margin-bottom: var(--space-1);
}

.metric-value {
    font-family: var(--font-mono);
    font-size: var(--text-2xl);
    font-weight: var(--font-bold);
    color: var(--text-primary);
}

.metric-change {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    font-size: var(--text-xs);
    font-weight: var(--font-medium);
    margin-top: var(--space-1);
}

.metric-change.positive {
    color: var(--color-success);
}

.metric-change.negative {
    color: var(--color-error);
}

/* ==========================================================================
   STATUS INDICATORS
   ========================================================================== */

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: var(--radius-full);
    animation: pulse-status 2s infinite;
}

.status-dot.operational {
    background: var(--color-success);
    box-shadow: var(--shadow-glow-success);
}

.status-dot.degraded {
    background: var(--color-warning);
}

.status-dot.incident {
    background: var(--color-error);
    box-shadow: var(--shadow-glow-error);
}

@keyframes pulse-status {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-1) var(--space-3);
    font-size: var(--text-xs);
    font-weight: var(--font-medium);
    border-radius: var(--radius-full);
}

.status-badge.operational {
    background: rgba(34, 197, 94, 0.1);
    color: var(--color-success);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.status-badge.degraded {
    background: rgba(234, 179, 8, 0.1);
    color: var(--color-warning);
    border: 1px solid rgba(234, 179, 8, 0.3);
}

.status-badge.incident {
    background: rgba(239, 68, 68, 0.1);
    color: var(--color-error);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Uptime Badge */
.uptime-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.2);
    border-radius: var(--radius-lg);
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    color: var(--color-success);
}

.uptime-value {
    font-size: var(--text-lg);
    font-weight: var(--font-bold);
}

/* ==========================================================================
   PROGRESS BARS & GRAPHS
   ========================================================================== */

.progress-bar {
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: var(--radius-full);
    transition: width var(--transition-slow);
}

.progress-fill.cpu {
    background: linear-gradient(90deg, var(--color-cpu), #a78bfa);
}

.progress-fill.memory {
    background: linear-gradient(90deg, var(--color-memory), #22d3ee);
}

.progress-fill.network {
    background: linear-gradient(90deg, var(--color-network), #34d399);
}

.progress-fill.disk {
    background: linear-gradient(90deg, var(--color-disk), #fbbf24);
}

/* Metric Graph Bars */
.metric-bars {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 48px;
}

.metric-bar {
    flex: 1;
    background: linear-gradient(180deg, var(--color-primary-500), var(--color-primary-700));
    border-radius: var(--radius-sm);
    min-height: 4px;
    transition: height var(--transition-base);
}

.metric-bar:hover {
    background: var(--color-primary-400);
}

/* Live Graph */
.live-graph {
    position: relative;
    height: 120px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.live-graph-line {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60%;
    background: linear-gradient(180deg, var(--color-primary-500), transparent);
    clip-path: polygon(
        0% 100%,
        5% 80%,
        10% 85%,
        15% 70%,
        20% 75%,
        25% 60%,
        30% 65%,
        35% 50%,
        40% 55%,
        45% 40%,
        50% 45%,
        55% 30%,
        60% 35%,
        65% 40%,
        70% 35%,
        75% 50%,
        80% 45%,
        85% 55%,
        90% 50%,
        95% 60%,
        100% 55%,
        100% 100%
    );
    animation: graph-update 3s ease-in-out infinite;
}

@keyframes graph-update {
    0%, 100% { transform: scaleY(1); }
    50% { transform: scaleY(1.1); }
}

/* ==========================================================================
   ALERT TIMELINE
   ========================================================================== */

.alert-timeline {
    position: relative;
    padding-left: var(--space-6);
}

.alert-timeline::before {
    content: '';
    position: absolute;
    left: 9px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border-default);
}

.alert-item {
    position: relative;
    padding-bottom: var(--space-4);
}

.alert-item::before {
    content: '';
    position: absolute;
    left: -21px;
    top: 4px;
    width: 10px;
    height: 10px;
    border-radius: var(--radius-full);
    border: 2px solid var(--bg-primary);
}

.alert-item.critical::before {
    background: var(--color-error);
    box-shadow: var(--shadow-glow-error);
}

.alert-item.warning::before {
    background: var(--color-warning);
}

.alert-item.info::before {
    background: var(--color-info);
}

.alert-item.resolved::before {
    background: var(--color-success);
}

.alert-time {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    color: var(--text-tertiary);
    margin-bottom: var(--space-1);
}

.alert-message {
    font-size: var(--text-sm);
    color: var(--text-primary);
}

.alert-meta {
    font-size: var(--text-xs);
    color: var(--text-tertiary);
    margin-top: var(--space-1);
}

/* ==========================================================================
   SERVICE MAP
   ========================================================================== */

.service-map {
    position: relative;
    background: var(--bg-tertiary);
    border-radius: var(--radius-xl);
    padding: var(--space-8);
    min-height: 300px;
}

.service-node {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
}

.service-node-icon {
    width: 56px;
    height: 56px;
    background: var(--bg-secondary);
    border: 2px solid var(--border-default);
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-base);
}

.service-node:hover .service-node-icon {
    border-color: var(--color-primary-500);
    box-shadow: var(--shadow-glow-sm);
}

.service-node-label {
    font-size: var(--text-xs);
    font-weight: var(--font-medium);
    color: var(--text-secondary);
}

.service-node.healthy .service-node-icon {
    border-color: var(--color-success);
}

.service-node.unhealthy .service-node-icon {
    border-color: var(--color-error);
    animation: pulse-node 1s infinite;
}

@keyframes pulse-node {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
}

.service-connection {
    position: absolute;
    height: 2px;
    background: var(--border-default);
    transform-origin: left center;
}

.service-connection.active {
    background: var(--color-success);
    box-shadow: 0 0 4px var(--color-success);
}

/* ==========================================================================
   HERO SECTION
   ========================================================================== */

.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 80px;
    position: relative;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 20%, rgba(234, 88, 12, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(139, 92, 246, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(6, 182, 212, 0.05) 0%, transparent 70%);
    pointer-events: none;
}

.hero-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 60px 60px;
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    background: rgba(234, 88, 12, 0.1);
    border: 1px solid rgba(234, 88, 12, 0.2);
    border-radius: var(--radius-full);
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    color: var(--color-primary-400);
    margin-bottom: var(--space-6);
}

.hero-title {
    font-size: var(--text-hero);
    font-weight: var(--font-bold);
    line-height: 1.1;
    letter-spacing: -0.03em;
    margin-bottom: var(--space-6);
}

.hero-subtitle {
    font-size: var(--text-xl);
    color: var(--text-secondary);
    max-width: 600px;
    margin-bottom: var(--space-8);
}

.hero-cta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-4);
}

/* Hero Dashboard Preview */
.hero-dashboard {
    position: relative;
    margin-top: var(--space-12);
}

.dashboard-preview {
    background: var(--bg-secondary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-2xl);
    overflow: hidden;
    box-shadow: var(--shadow-2xl);
}

.dashboard-preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4) var(--space-6);
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-default);
}

.dashboard-preview-dots {
    display: flex;
    gap: var(--space-2);
}

.dashboard-preview-dot {
    width: 12px;
    height: 12px;
    border-radius: var(--radius-full);
    background: var(--border-default);
}

.dashboard-preview-dot.red { background: #ef4444; }
.dashboard-preview-dot.yellow { background: #eab308; }
.dashboard-preview-dot.green { background: #22c55e; }

.dashboard-preview-title {
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    color: var(--text-secondary);
}

.dashboard-preview-body {
    padding: var(--space-6);
    display: grid;
    gap: var(--space-4);
}

/* ==========================================================================
   FEATURES SECTION
   ========================================================================== */

.feature-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: var(--space-6);
}

@media (min-width: 640px) {
    .feature-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .feature-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    transition: all var(--transition-base);
}

.feature-card:hover {
    border-color: var(--color-primary-500);
    transform: translateY(-4px);
    box-shadow: var(--shadow-glow-sm);
}

.feature-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--color-primary-600), var(--color-primary-800));
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-4);
}

.feature-icon svg {
    width: 24px;
    height: 24px;
    color: white;
}

.feature-title {
    font-size: var(--text-lg);
    font-weight: var(--font-semibold);
    margin-bottom: var(--space-2);
}

.feature-description {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    line-height: var(--leading-relaxed);
}

/* ==========================================================================
   INTEGRATIONS
   ========================================================================== */

.integrations-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-4);
}

@media (min-width: 640px) {
    .integrations-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 768px) {
    .integrations-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

@media (min-width: 1024px) {
    .integrations-grid {
        grid-template-columns: repeat(8, 1fr);
    }
}

.integration-item {
    aspect-ratio: 1;
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3);
    transition: all var(--transition-fast);
}

.integration-item:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
    transform: scale(1.05);
}

.integration-logo {
    width: 32px;
    height: 32px;
    opacity: 0.7;
    transition: opacity var(--transition-fast);
}

.integration-item:hover .integration-logo {
    opacity: 1;
}

.integration-name {
    font-size: var(--text-xs);
    color: var(--text-tertiary);
    text-align: center;
}

/* ==========================================================================
   PRICING
   ========================================================================== */

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: var(--space-6);
    max-width: 1000px;
    margin: 0 auto;
}

@media (min-width: 768px) {
    .pricing-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.pricing-card {
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-2xl);
    padding: var(--space-8);
    display: flex;
    flex-direction: column;
    transition: all var(--transition-base);
}

.pricing-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-4px);
}

.pricing-card.featured {
    background: var(--bg-secondary);
    border: 2px solid var(--color-primary-500);
    position: relative;
}

.pricing-card.featured::before {
    content: 'Most Popular';
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    padding: var(--space-1) var(--space-4);
    background: var(--color-primary-500);
    color: white;
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    border-radius: var(--radius-full);
}

.pricing-name {
    font-size: var(--text-lg);
    font-weight: var(--font-semibold);
    margin-bottom: var(--space-2);
}

.pricing-description {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    margin-bottom: var(--space-6);
}

.pricing-price {
    display: flex;
    align-items: baseline;
    gap: var(--space-1);
    margin-bottom: var(--space-6);
}

.pricing-amount {
    font-size: var(--text-4xl);
    font-weight: var(--font-bold);
}

.pricing-unit {
    font-size: var(--text-sm);
    color: var(--text-tertiary);
}

.pricing-features {
    flex: 1;
    margin-bottom: var(--space-8);
}

.pricing-feature {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    padding: var(--space-3) 0;
    border-bottom: 1px solid var(--border-default);
}

.pricing-feature:last-child {
    border-bottom: none;
}

.pricing-feature svg {
    width: 20px;
    height: 20px;
    color: var(--color-success);
    flex-shrink: 0;
}

.pricing-feature span {
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

/* ==========================================================================
   CODE BLOCKS
   ========================================================================== */

.code-block {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.code-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-3) var(--space-4);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-default);
}

.code-header-title {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    color: var(--text-tertiary);
}

.code-copy {
    font-size: var(--text-xs);
    color: var(--text-tertiary);
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.code-copy:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.code-content {
    padding: var(--space-4);
    overflow-x: auto;
}

.code-content pre {
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    line-height: var(--leading-relaxed);
    color: var(--text-secondary);
}

.code-content .keyword { color: var(--color-primary-400); }
.code-content .string { color: var(--color-success); }
.code-content .comment { color: var(--text-muted); }
.code-content .number { color: var(--color-warning); }

/* ==========================================================================
   TESTIMONIALS
   ========================================================================== */

.testimonial-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: var(--space-6);
}

@media (min-width: 768px) {
    .testimonial-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .testimonial-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.testimonial-card {
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
}

.testimonial-quote {
    font-size: var(--text-base);
    color: var(--text-secondary);
    line-height: var(--leading-relaxed);
    margin-bottom: var(--space-6);
}

.testimonial-author {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.testimonial-avatar {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: var(--font-bold);
    color: var(--color-primary-500);
}

.testimonial-name {
    font-weight: var(--font-semibold);
}

.testimonial-role {
    font-size: var(--text-sm);
    color: var(--text-tertiary);
}

/* ==========================================================================
   FOOTER
   ========================================================================== */

.footer {
    padding: var(--space-16) 0 var(--space-8);
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-default);
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-8);
    margin-bottom: var(--space-12);
}

@media (min-width: 768px) {
    .footer-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 1024px) {
    .footer-grid {
        grid-template-columns: 2fr repeat(4, 1fr);
    }
}

.footer-brand {
    grid-column: span 2;
}

@media (min-width: 1024px) {
    .footer-brand {
        grid-column: span 1;
    }
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-lg);
    font-weight: var(--font-bold);
    margin-bottom: var(--space-4);
}

.footer-description {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    line-height: var(--leading-relaxed);
    max-width: 280px;
}

.footer-heading {
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wider);
    color: var(--text-tertiary);
    margin-bottom: var(--space-4);
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.footer-link {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    transition: color var(--transition-fast);
}

.footer-link:hover {
    color: var(--text-primary);
}

.footer-bottom {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    padding-top: var(--space-8);
    border-top: 1px solid var(--border-default);
}

@media (min-width: 768px) {
    .footer-bottom {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}

.footer-copyright {
    font-size: var(--text-sm);
    color: var(--text-tertiary);
}

.footer-social {
    display: flex;
    gap: var(--space-4);
}

.footer-social-link {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
    border-radius: var(--radius-lg);
    transition: all var(--transition-fast);
}

.footer-social-link:hover {
    color: var(--text-primary);
    background: var(--bg-card);
}

/* ==========================================================================
   FORMS
   ========================================================================== */

.form-group {
    margin-bottom: var(--space-4);
}

.form-label {
    display: block;
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    color: var(--text-secondary);
    margin-bottom: var(--space-2);
}

.form-input {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    font-family: inherit;
    font-size: var(--text-base);
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-input:focus {
    outline: none;
    border-color: var(--color-primary-500);
    box-shadow: 0 0 0 3px rgba(234, 88, 12, 0.1);
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
}

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%2371717a' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right var(--space-3) center;
    background-repeat: no-repeat;
    background-size: 20px;
    padding-right: var(--space-10);
}

/* ==========================================================================
   ANIMATIONS
   ========================================================================== */

/* Reveal animations */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

.reveal-left {
    opacity: 0;
    transform: translateX(-40px);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-left.active {
    opacity: 1;
    transform: translateX(0);
}

.reveal-right {
    opacity: 0;
    transform: translateX(40px);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-right.active {
    opacity: 1;
    transform: translateX(0);
}

.reveal-scale {
    opacity: 0;
    transform: scale(0.9);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-scale.active {
    opacity: 1;
    transform: scale(1);
}

/* Stagger delays */
.stagger-1 { transition-delay: 0.1s; }
.stagger-2 { transition-delay: 0.2s; }
.stagger-3 { transition-delay: 0.3s; }
.stagger-4 { transition-delay: 0.4s; }
.stagger-5 { transition-delay: 0.5s; }
.stagger-6 { transition-delay: 0.6s; }
.stagger-7 { transition-delay: 0.7s; }
.stagger-8 { transition-delay: 0.8s; }

/* Float animation */
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

.animate-float {
    animation: float 6s ease-in-out infinite;
}

/* Pulse glow */
@keyframes pulse-glow {
    0%, 100% { box-shadow: var(--shadow-glow-sm); }
    50% { box-shadow: var(--shadow-glow-md); }
}

.animate-pulse-glow {
    animation: pulse-glow 2s ease-in-out infinite;
}

/* Typing effect */
@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

.typing-cursor::after {
    content: '|';
    animation: blink 1s step-end infinite;
    color: var(--color-primary-500);
}

/* Counter animation */
@keyframes count-up {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.counter-animate {
    animation: count-up 0.5s ease-out forwards;
}

/* Shimmer loading */
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.shimmer {
    background: linear-gradient(90deg,
        var(--bg-tertiary) 25%,
        var(--bg-card-hover) 50%,
        var(--bg-tertiary) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

/* ==========================================================================
   REDUCED 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;
    }

    .reveal,
    .reveal-left,
    .reveal-right,
    .reveal-scale {
        opacity: 1;
        transform: none;
    }
}

/* ==========================================================================
   UTILITIES
   ========================================================================== */

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.sr-only:focus {
    position: fixed;
    top: var(--space-4);
    left: var(--space-4);
    width: auto;
    height: auto;
    padding: var(--space-4);
    background: var(--bg-primary);
    color: var(--text-primary);
    clip: auto;
    z-index: var(--z-toast);
}

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mx-auto { margin-left: auto; margin-right: auto; }

.flex { display: flex; }
.inline-flex { display: inline-flex; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.flex-col { flex-direction: column; }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }

.grid { display: grid; }

.w-full { width: 100%; }
.max-w-4xl { max-width: 56rem; }
.max-w-3xl { max-width: 48rem; }
.max-w-2xl { max-width: 42rem; }

/* ==========================================================================
   SCROLLBAR
   ========================================================================== */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-default);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-hover);
}

/* ==========================================================================
   PRINT STYLES
   ========================================================================== */

@media print {
    .nav,
    .footer,
    .btn,
    .no-print {
        display: none !important;
    }

    body {
        background: white;
        color: black;
    }

    .section {
        padding: 1rem 0;
    }
}
