/**
 * Circuit Nexus Theme
 * ====================
 * Elektronische Leiterplatten-Ästhetik für HENX3D
 *
 * Features:
 * - PCB Green Background
 * - Copper Trace Paths
 * - LED Glow Effects
 * - SMD Component Style
 * - Via Holes & Solder Pads
 * - Circuit Animation
 *
 * @version 1.0.0
 * @created 2026-01-06
 */

:root {
    /* Colors - PCB & Electronics */
    --circuit-pcb-darkest: #0d1f15;
    --circuit-pcb-dark: #1a4d2e;
    --circuit-pcb-green: #2d7a4a;
    --circuit-pcb-light: #4a9668;

    /* Copper & Metallic */
    --circuit-copper-gold: #d4af37;
    --circuit-copper-dark: #b8941f;
    --circuit-solder-silver: #c0c0c0;
    --circuit-tin: #d1d5db;

    /* LED Colors */
    --circuit-led-red: #ef4444;
    --circuit-led-green: #10b981;
    --circuit-led-blue: #3b82f6;
    --circuit-led-yellow: #fbbf24;

    /* Trace Glow */
    --circuit-trace-glow: #ffd700;
    --circuit-active-path: #00ff88;

    /* Neutral */
    --circuit-white: #ffffff;
    --circuit-off-white: #f8fafc;
    --circuit-silk-screen: #e2e8f0;

    /* Typography */
    --circuit-font-heading: 'Exo 2', 'Roboto Mono', monospace;
    --circuit-font-body: 'IBM Plex Sans', 'Arial', sans-serif;
    --circuit-font-mono: 'JetBrains Mono', 'Courier New', monospace;

    /* Spacing */
    --circuit-space-xs: 0.5rem;
    --circuit-space-sm: 1rem;
    --circuit-space-md: 1.5rem;
    --circuit-space-lg: 2rem;
    --circuit-space-xl: 3rem;

    /* Borders */
    --circuit-border-width: 2px;
    --circuit-border-radius: 4px;

    /* Shadows & Glows */
    --circuit-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --circuit-shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --circuit-shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --circuit-glow-copper: 0 0 20px rgba(212, 175, 55, 0.6),
                           0 0 40px rgba(212, 175, 55, 0.3);
    --circuit-glow-green: 0 0 20px rgba(16, 185, 129, 0.8),
                          0 0 40px rgba(16, 185, 129, 0.4);
    --circuit-glow-active: 0 0 20px rgba(0, 255, 136, 0.8),
                           0 0 40px rgba(0, 255, 136, 0.4);

    /* Transitions */
    --circuit-transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);

    /* Standard CSS Variables for Compatibility */
    --color-bg: var(--circuit-pcb-darkest);
    --color-bg-elevated: var(--circuit-pcb-dark);
    --color-bg-subtle: var(--circuit-pcb-darkest);
    --color-bg-secondary: var(--circuit-pcb-dark);
    --color-bg-tertiary: var(--circuit-pcb-green);
    --color-text: var(--circuit-off-white);
    --color-text-muted: var(--circuit-silk-screen);
    --color-text-subtle: var(--circuit-tin);
    --color-primary: var(--circuit-copper-gold);
    --color-primary-dark: var(--circuit-copper-dark);
    --color-primary-light: var(--circuit-trace-glow);
    --color-border: var(--circuit-pcb-green);
    --color-line: var(--circuit-pcb-light);
    --background-color: var(--circuit-pcb-darkest);
    --card-background: var(--circuit-pcb-dark);
    --input-background: var(--circuit-pcb-green);
    --input-text: var(--circuit-white);
    --text-color: var(--circuit-off-white);
    --border-color: var(--circuit-pcb-green);
    --card-bg: var(--circuit-pcb-dark);
    --input-bg: var(--circuit-pcb-green);
    --input-border: var(--circuit-copper-gold);
    --button-text: var(--circuit-pcb-darkest);
    color-scheme: dark;
}

/* PCB Background with Circuit Traces */
body {
    font-family: var(--circuit-font-body);
    color: var(--circuit-silk-screen);
    background: var(--circuit-pcb-darkest);
    background-image:
        /* Horizontal traces */
        repeating-linear-gradient(
            0deg,
            transparent 0px,
            transparent 49px,
            var(--circuit-copper-dark) 49px,
            var(--circuit-copper-dark) 50px
        ),
        /* Vertical traces */
        repeating-linear-gradient(
            90deg,
            transparent 0px,
            transparent 49px,
            var(--circuit-copper-dark) 49px,
            var(--circuit-copper-dark) 50px
        );
    background-size: 50px 50px;
    position: relative;
}

/* FR4 Texture Overlay */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg,
        transparent 0%,
        rgba(45, 122, 74, 0.05) 50%,
        transparent 100%
    );
    pointer-events: none;
    z-index: 0;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--circuit-font-heading);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--circuit-white);
}

h1 { font-size: 4rem; }
h2 { font-size: 3rem; }
h3 { font-size: 2.25rem; }

.circuit-title {
    color: var(--circuit-copper-gold);
    text-shadow: var(--circuit-glow-copper);
    position: relative;
    display: inline-block;
}

/* Circuit trace underline */
.circuit-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--circuit-copper-gold);
    box-shadow: var(--circuit-glow-copper);
}

/* Buttons - SMD Style */
.btn-primary,
.btn-circuit {
    padding: var(--circuit-space-sm) var(--circuit-space-xl);
    font-family: var(--circuit-font-mono);
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--circuit-pcb-darkest);
    background: var(--circuit-led-green);
    border: 2px solid var(--circuit-copper-gold);
    border-radius: var(--circuit-border-radius);
    cursor: pointer;
    transition: all var(--circuit-transition);
    box-shadow: var(--circuit-shadow-md),
                var(--circuit-glow-green);
    position: relative;
}

.btn-circuit::before {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    width: 6px;
    height: 6px;
    background: var(--circuit-solder-silver);
    border-radius: 50%;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3);
}

.btn-circuit::after {
    content: '';
    position: absolute;
    top: -3px;
    right: -3px;
    width: 6px;
    height: 6px;
    background: var(--circuit-solder-silver);
    border-radius: 50%;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3);
}

.btn-circuit:hover {
    background: var(--circuit-active-path);
    box-shadow: var(--circuit-shadow-lg),
                var(--circuit-glow-active);
    transform: translateY(-2px);
}

.btn-secondary,
.btn-trace {
    padding: var(--circuit-space-sm) var(--circuit-space-xl);
    font-family: var(--circuit-font-mono);
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--circuit-copper-gold);
    background: transparent;
    border: 2px solid var(--circuit-copper-gold);
    border-radius: var(--circuit-border-radius);
    cursor: pointer;
    transition: all var(--circuit-transition);
}

.btn-trace:hover {
    background: rgba(212, 175, 55, 0.1);
    box-shadow: var(--circuit-glow-copper);
}

/* Cards - SMD Components */
.card,
.service-card,
.portfolio-card {
    position: relative;
    padding: var(--circuit-space-lg);
    background: linear-gradient(135deg,
        var(--circuit-pcb-dark) 0%,
        var(--circuit-pcb-darkest) 100%
    );
    border: 2px solid var(--circuit-copper-gold);
    border-radius: var(--circuit-border-radius);
    box-shadow: var(--circuit-shadow-md);
    transition: all var(--circuit-transition);
    overflow: hidden;
}

/* Solder pads in corners */
.card::before,
.card::after {
    content: '';
    position: absolute;
    width: 10px;
    height: 10px;
    background: radial-gradient(circle,
        var(--circuit-solder-silver) 0%,
        var(--circuit-tin) 100%
    );
    border-radius: 50%;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3),
                0 0 8px rgba(192, 192, 192, 0.4);
}

.card::before {
    top: 10px;
    left: 10px;
}

.card::after {
    top: 10px;
    right: 10px;
}

/* Circuit trace animation on hover */
.card:hover {
    transform: translateY(-4px);
    border-color: var(--circuit-active-path);
    box-shadow: var(--circuit-shadow-lg),
                var(--circuit-glow-active);
}

.card:hover::before,
.card:hover::after {
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3),
                0 0 12px var(--circuit-active-path);
}

/* Via holes on card */
.card-header::before,
.card-header::after {
    content: '';
    position: absolute;
    width: 8px;
    height: 8px;
    background: var(--circuit-pcb-darkest);
    border: 2px solid var(--circuit-copper-gold);
    border-radius: 50%;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.5);
}

.card-header::before {
    bottom: -12px;
    left: 10px;
}

.card-header::after {
    bottom: -12px;
    right: 10px;
}

/* Card Header */
.card-header {
    display: flex;
    align-items: center;
    gap: var(--circuit-space-md);
    margin-bottom: var(--circuit-space-md);
    padding-bottom: var(--circuit-space-md);
    border-bottom: 2px solid var(--circuit-copper-gold);
    position: relative;
}

.card-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--circuit-led-green);
    border: 2px solid var(--circuit-copper-gold);
    border-radius: var(--circuit-border-radius);
    box-shadow: var(--circuit-glow-green);
    font-size: 1.75rem;
    color: var(--circuit-pcb-darkest);
}

/* Hero Section */
.hero-section {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg,
        var(--circuit-pcb-darkest) 0%,
        var(--circuit-pcb-dark) 100%
    );
}

.hero-content {
    text-align: center;
    max-width: 1200px;
    padding: var(--circuit-space-xl) var(--circuit-space-lg);
    z-index: 10;
}

.hero-tagline {
    font-family: var(--circuit-font-mono);
    font-size: 0.875rem;
    color: var(--circuit-led-green);
    text-transform: uppercase;
    letter-spacing: 0.2em;
    margin-bottom: var(--circuit-space-md);
    padding: var(--circuit-space-xs) var(--circuit-space-md);
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid var(--circuit-led-green);
    border-left: 4px solid var(--circuit-led-green);
    display: inline-block;
}

/* Grid Layout */
.circuit-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--circuit-space-xl);
    padding: var(--circuit-space-xl) var(--circuit-space-lg);
}

/* Navigation */
header.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(13, 31, 21, 0.95);
    border-bottom: 2px solid var(--circuit-copper-gold);
    box-shadow: var(--circuit-shadow-lg);
    backdrop-filter: blur(10px);
    z-index: 100;
}

.nav-link {
    padding: var(--circuit-space-sm) var(--circuit-space-md);
    color: var(--circuit-silk-screen);
    font-family: var(--circuit-font-mono);
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-decoration: none;
    transition: all var(--circuit-transition);
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--circuit-led-green);
    transition: all var(--circuit-transition);
    transform: translateX(-50%);
    box-shadow: var(--circuit-glow-green);
}

.nav-link:hover,
.nav-link.active {
    color: var(--circuit-led-green);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

/* Section Divider - Copper Trace */
.section-divider {
    width: 100%;
    height: 3px;
    background: var(--circuit-copper-gold);
    margin: var(--circuit-space-xl) 0;
    box-shadow: var(--circuit-glow-copper);
    position: relative;
}

/* Via holes on divider */
.section-divider::before,
.section-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 10px;
    height: 10px;
    background: var(--circuit-pcb-darkest);
    border: 2px solid var(--circuit-copper-gold);
    border-radius: 50%;
    transform: translateY(-50%);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.5);
}

.section-divider::before {
    left: 30px;
}

.section-divider::after {
    right: 30px;
}

/* Forms */
.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: var(--circuit-space-sm) var(--circuit-space-md);
    font-family: var(--circuit-font-mono);
    font-size: 0.875rem;
    color: var(--circuit-white);
    background: var(--circuit-pcb-dark);
    border: 2px solid var(--circuit-copper-dark);
    border-radius: var(--circuit-border-radius);
    transition: all var(--circuit-transition);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: var(--circuit-led-green);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.3),
                var(--circuit-glow-green);
}

/* LED Indicator Styles */
.led-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3);
    animation: led-pulse 2s ease-in-out infinite;
}

.led-indicator.red {
    background: var(--circuit-led-red);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3),
                0 0 10px var(--circuit-led-red);
}

.led-indicator.green {
    background: var(--circuit-led-green);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3),
                0 0 10px var(--circuit-led-green);
}

.led-indicator.blue {
    background: var(--circuit-led-blue);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3),
                0 0 10px var(--circuit-led-blue);
}

@keyframes led-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Stats - Digital Display Style */
.stat-number {
    font-family: var(--circuit-font-mono);
    font-size: 4rem;
    font-weight: 700;
    color: var(--circuit-led-green);
    text-shadow: var(--circuit-glow-green);
}

.stat-label {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--circuit-copper-gold);
}

/* Footer */
.site-footer {
    background: var(--circuit-pcb-darkest);
    border-top: 2px solid var(--circuit-copper-gold);
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.3);
}

/* Utilities */
.text-copper { color: var(--circuit-copper-gold); }
.text-led-green { color: var(--circuit-led-green); }
.text-led-red { color: var(--circuit-led-red); }
.text-led-blue { color: var(--circuit-led-blue); }
.bg-pcb { background: var(--circuit-pcb-dark); }
.glow-copper { box-shadow: var(--circuit-glow-copper); }
.glow-green { box-shadow: var(--circuit-glow-green); }

/* Circuit path container for JS */
#circuit-paths-svg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

/* Data packets container */
#data-packets-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
}

/* Responsive */
@media (max-width: 768px) {
    h1 { font-size: 2.5rem; }
    h2 { font-size: 2rem; }

    .stat-number { font-size: 2.5rem; }

    .circuit-grid {
        grid-template-columns: 1fr;
    }
}
