/* ==========================================================================
   OpcVue Industrial Design System (Vanilla CSS)
   ========================================================================== */

:root {
    --bg-primary: #0B0F17;
    --bg-secondary: #101726;
    --bg-card: #131B2A;
    --bg-card-hover: #182337;
    --border-color: rgba(255, 255, 255, 0.08);
    --border-highlight: rgba(0, 229, 153, 0.35);
    
    --mint: #00E599;
    --mint-glow: rgba(0, 229, 153, 0.2);
    --mint-dark: #059669;
    --cyan: #00ABCB;
    --amber: #FFB300;
    --crimson: #FF3B30;
    --purple: #8B5CF6;
    
    --text-primary: #FFFFFF;
    --text-secondary: #94A3B8;
    --text-muted: #64748B;
    
    --font-main: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    
    --transition-smooth: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Reset & Base Setup */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    color-scheme: dark;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-main);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
}

/* Background Ambient Glows & Grid */
.glow-sphere {
    position: absolute;
    border-radius: 50%;
    filter: blur(140px);
    pointer-events: none;
    z-index: 0;
}

.glow-sphere-1 {
    top: -100px;
    left: 15%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(0, 229, 153, 0.12) 0%, rgba(0, 0, 0, 0) 70%);
}

.glow-sphere-2 {
    top: 400px;
    right: 5%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(0, 171, 203, 0.08) 0%, rgba(0, 0, 0, 0) 70%);
}

.grid-overlay {
    position: absolute;
    inset: 0;
    background-image: 
        linear-gradient(to right, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
    z-index: 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    position: relative;
    z-index: 1;
}

/* Typography & Utilities */
code {
    font-family: var(--font-mono);
    font-size: 0.85em;
    background: rgba(255, 255, 255, 0.06);
    color: var(--mint);
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

.gradient-text {
    background: linear-gradient(135deg, #00E599 0%, #00ABCB 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Navigation Bar */
.navbar-container {
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    background: rgba(11, 15, 23, 0.75);
    border-bottom: 1px solid var(--border-color);
}

.navbar {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.logo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: rgba(0, 229, 153, 0.1);
    border: 1px solid rgba(0, 229, 153, 0.25);
}

.brand-text {
    display: flex;
    align-items: center;
    font-weight: 800;
    font-size: 1.3rem;
    letter-spacing: -0.5px;
}

.brand-opc {
    color: #FFFFFF;
}

.brand-vue {
    color: var(--mint);
}

.beta-tag {
    margin-left: 8px;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--mint);
    background: rgba(0, 229, 153, 0.12);
    border: 1px solid rgba(0, 229, 153, 0.3);
    padding: 2px 6px;
    border-radius: 6px;
    letter-spacing: 0.5px;
}

.nav-links {
    display: flex;
    gap: 28px;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: var(--transition-smooth);
}

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

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-main);
    font-weight: 700;
    text-decoration: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition-smooth);
    border: none;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.85rem;
}

.btn-lg {
    padding: 12px 24px;
    font-size: 1rem;
    border-radius: 12px;
}

.btn-primary {
    background: var(--mint);
    color: #000000;
    box-shadow: 0 4px 20px var(--mint-glow);
}

.btn-primary:hover {
    background: #00ffaa;
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(0, 229, 153, 0.35);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.09);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.btn-subtext {
    display: block;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    opacity: 0.8;
}

.btn-maintext {
    display: block;
    font-size: 1rem;
    line-height: 1.1;
}

/* Hero Section */
.hero-section {
    padding: 80px 0 60px;
    position: relative;
    z-index: 1;
}

.hero-container {
    display: grid;
    grid-template-columns: 1fr 1.05fr;
    gap: 50px;
    align-items: center;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: rgba(0, 229, 153, 0.08);
    border: 1px solid rgba(0, 229, 153, 0.25);
    border-radius: 20px;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--mint);
    margin-bottom: 24px;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--mint);
    box-shadow: 0 0 10px var(--mint);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.85); }
}

.hero-title {
    font-size: 3.2rem;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -1px;
    margin-bottom: 20px;
}

.hero-description {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 32px;
    line-height: 1.7;
}

.hero-cta-group {
    display: flex;
    gap: 16px;
    margin-bottom: 36px;
    flex-wrap: wrap;
}

.hero-feature-tags {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.hero-feature-tags .tag {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Device Mockup Graphic */
.device-frame {
    background: #0E1420;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 40px rgba(0, 229, 153, 0.05);
    position: relative;
}

.app-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    padding: 0 4px;
}

.app-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 8px;
}

.live-pill {
    background: rgba(0, 229, 153, 0.12);
    border: 1px solid rgba(0, 229, 153, 0.3);
    color: var(--mint);
}

.pulse-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--mint);
    box-shadow: 0 0 6px var(--mint);
}

.pro-pill {
    background: rgba(255, 215, 0, 0.12);
    border: 1px solid rgba(255, 215, 0, 0.3);
    color: #FFD700;
}

.hmi-dashboard-preview {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.preview-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px 16px;
}

.widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.widget-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: #FFFFFF;
}

.widget-tag {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-muted);
}

.bit-tag {
    color: var(--mint);
}

/* SP vs PV Dual Bar */
.sppv-labels {
    display: flex;
    justify-content: space-between;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    margin-bottom: 8px;
}

.highlight-mint {
    color: var(--mint);
}

.sppv-bar-track {
    height: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    position: relative;
    overflow: hidden;
}

.sppv-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #059669, #00E599);
    border-radius: 6px;
    transition: width 0.3s ease;
}

.sppv-sp-marker {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 3px;
    background: #FFB300;
    transform: translateX(-50%);
    box-shadow: 0 0 6px #FFB300;
}

/* Dual widgets row */
.preview-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.gauge-circle-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.gauge-svg {
    width: 120px;
    height: 70px;
}

.gauge-text-val {
    position: absolute;
    bottom: 0;
    font-family: var(--font-mono);
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--mint);
}

.gauge-text-val small {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.numeric-val-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 70px;
}

.numeric-display {
    font-family: var(--font-mono);
    font-size: 1.6rem;
    font-weight: 800;
    color: #FFFFFF;
    letter-spacing: -0.5px;
}

.numeric-unit {
    font-size: 0.7rem;
    color: var(--text-secondary);
}

/* Control Word Bit Buttons */
.bit-buttons-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.bit-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 10px 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.bit-btn:hover {
    background: rgba(0, 229, 153, 0.08);
    border-color: rgba(0, 229, 153, 0.3);
}

.bit-btn.active {
    background: rgba(0, 229, 153, 0.18);
    border-color: var(--mint);
}

.bit-btn.active .bit-name {
    color: var(--mint);
    font-weight: 700;
}

.bit-num {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--text-muted);
}

.bit-name {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
}

/* Section Header */
.section-header {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 50px;
}

.section-badge {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--mint);
    background: rgba(0, 229, 153, 0.1);
    border: 1px solid rgba(0, 229, 153, 0.25);
    padding: 4px 12px;
    border-radius: 12px;
    margin-bottom: 12px;
    letter-spacing: 1px;
}

.section-title {
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 12px;
}

.section-subtitle {
    font-size: 1.05rem;
    color: var(--text-secondary);
}

/* Features Section */
.features-section {
    padding: 80px 0;
    position: relative;
    z-index: 1;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 24px;
}

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 30px;
    transition: var(--transition-smooth);
}

.feature-card:hover {
    background: var(--bg-card-hover);
    border-color: rgba(0, 229, 153, 0.3);
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}

.feature-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.feature-icon.mint { background: rgba(0, 229, 153, 0.12); color: var(--mint); }
.feature-icon.cyan { background: rgba(0, 171, 203, 0.12); color: var(--cyan); }
.feature-icon.amber { background: rgba(255, 179, 0, 0.12); color: var(--amber); }
.feature-icon.emerald { background: rgba(16, 185, 129, 0.12); color: #10B981; }
.feature-icon.purple { background: rgba(139, 92, 246, 0.12); color: var(--purple); }
.feature-icon.rose { background: rgba(244, 63, 94, 0.12); color: #F43F5E; }

.feature-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.feature-text {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Protocol Reference Table */
.protocols-section {
    padding: 80px 0;
    position: relative;
    z-index: 1;
}

.table-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

.protocol-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.95rem;
}

.protocol-table th, .protocol-table td {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.protocol-table th {
    background: rgba(255, 255, 255, 0.02);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.protocol-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 6px;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 700;
}

.badge-modbus { background: rgba(0, 171, 203, 0.15); color: var(--cyan); border: 1px solid rgba(0, 171, 203, 0.3); }
.badge-opc { background: rgba(0, 229, 153, 0.15); color: var(--mint); border: 1px solid rgba(0, 229, 153, 0.3); }

/* Security Section */
.security-section {
    padding: 60px 0;
    position: relative;
    z-index: 1;
}

.security-card {
    background: linear-gradient(135deg, rgba(19, 27, 42, 0.9) 0%, rgba(16, 23, 38, 0.9) 100%);
    border: 1.5px solid rgba(0, 229, 153, 0.25);
    border-radius: var(--radius-xl);
    padding: 48px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.security-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 36px;
}

.security-icon {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    background: rgba(0, 229, 153, 0.1);
    border: 1px solid rgba(0, 229, 153, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.security-title {
    font-size: 1.8rem;
    font-weight: 800;
}

.security-subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
}

.security-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
}

.security-item h4 {
    font-size: 1.05rem;
    font-weight: 700;
    color: #FFFFFF;
    margin-bottom: 6px;
}

.security-item p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* CTA Section */
.cta-section {
    padding: 80px 0;
    position: relative;
    z-index: 1;
}

.cta-card {
    background: radial-gradient(circle at center, rgba(0, 229, 153, 0.12) 0%, rgba(19, 27, 42, 0.9) 70%);
    border: 1px solid var(--border-highlight);
    border-radius: var(--radius-xl);
    padding: 60px 40px;
    text-align: center;
}

.cta-title {
    font-size: 2.4rem;
    font-weight: 800;
    margin-bottom: 14px;
}

.cta-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 30px;
}

.cta-actions {
    display: flex;
    justify-content: center;
}

/* Footer */
.footer {
    border-top: 1px solid var(--border-color);
    background: #080B11;
    padding: 50px 0 30px;
    position: relative;
    z-index: 1;
}

.footer-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 24px;
    margin-bottom: 30px;
}

.footer-tagline {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.footer-version {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--mint);
    margin-top: 2px;
}

.footer-links {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: var(--transition-smooth);
}

.footer-links a:hover {
    color: var(--mint);
}

.footer-bottom {
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    padding-top: 20px;
}

/* Responsive Breakpoints */
@media (max-width: 900px) {
    .hero-container {
        grid-template-columns: 1fr;
    }
    .hero-title {
        font-size: 2.5rem;
    }
    .nav-links {
        display: none;
    }
}

@media (max-width: 600px) {
    .hero-title {
        font-size: 2rem;
    }
    .preview-row {
        grid-template-columns: 1fr;
    }
    .security-card {
        padding: 24px;
    }
    .security-header {
        flex-direction: column;
        align-items: flex-start;
    }
}
