/* =========================================
   REGTeches Professional Design System
   ========================================= */

/* --- FONTS --- */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;700&family=Space+Mono:wght@400;700&family=Syne:wght@700;800&display=swap');

/* --- CSS VARIABLES --- */
:root {
    /* Colors - Professional Tech Palette */
    --color-primary: #3385FF;
    --color-primary-dark: #0066FF;
    --color-primary-light: #5599FF;
    
    --color-accent: #FF4D79;
    --color-accent-light: #FF6B8F;
    
    --color-success: #00E5A0;
    --color-warning: #FFB82E;
    
    /* Dark Mode Colors (Now Default) */
    --color-bg-main: #0A0E17;
    --color-bg-subtle: #141824;
    --color-bg-muted: #1E2330;
    
    --color-text-primary: #E8EAED;
    --color-text-secondary: #9AA0A6;
    --color-text-muted: #6C7280;
    
    --color-border: #2A2F3C;
    --color-border-dark: #3A3F4C;
    
    /* Light Mode (Optional Override) */
    --color-light-bg: #FFFFFF;
    --color-light-surface: #F8F9FA;
    --color-light-elevated: #E9ECEF;
    --color-light-text: #1A1A1A;
    --color-light-text-secondary: #6C757D;
    --color-light-border: #DEE2E6;
    
    /* Typography */
    --font-display: 'Syne', sans-serif;
    --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'Space Mono', 'Courier New', monospace;
    
    /* Spacing Scale */
    --space-xs: 0.5rem;
    --space-sm: 0.75rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;
    
    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;
    
    /* Shadows - Enhanced for Dark Mode */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.5);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.6);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.7);
    --shadow-xl: 0 20px 50px rgba(0, 0, 0, 0.8);
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 400ms ease;
    
    /* Container Width */
    --container-sm: 640px;
    --container-md: 768px;
    --container-lg: 1024px;
    --container-xl: 1280px;
}

/* Light Mode Override (Optional) */
body.light-mode {
    --color-bg-main: var(--color-light-bg);
    --color-bg-subtle: var(--color-light-surface);
    --color-bg-muted: var(--color-light-elevated);
    
    --color-text-primary: var(--color-light-text);
    --color-text-secondary: var(--color-light-text-secondary);
    --color-text-muted: #ADB5BD;
    
    --color-border: var(--color-light-border);
    --color-border-dark: #CED4DA;
    
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.15);
}

/* --- RESET & BASE STYLES --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    color: var(--color-text-primary);
    background-color: var(--color-bg-main);
    overflow-x: hidden;
}

/* --- TYPOGRAPHY --- */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 800;
    line-height: 1.2;
    color: var(--color-text-primary);
    margin-bottom: var(--space-md);
}

h1 { font-size: clamp(2.5rem, 5vw, 4rem); }
h2 { font-size: clamp(2rem, 4vw, 3rem); }
h3 { font-size: clamp(1.5rem, 3vw, 2rem); }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1.125rem; }

p {
    margin-bottom: var(--space-md);
    color: var(--color-text-secondary);
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--color-primary-dark);
}

strong {
    font-weight: 700;
    color: var(--color-text-primary);
}

code {
    font-family: var(--font-mono);
    font-size: 0.875em;
    background: var(--color-bg-muted);
    padding: 0.2em 0.4em;
    border-radius: var(--radius-sm);
}

/* --- LAYOUT --- */
.container {
    width: 100%;
    max-width: var(--container-xl);
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

.container-sm { max-width: var(--container-sm); }
.container-md { max-width: var(--container-md); }
.container-lg { max-width: var(--container-lg); }

/* --- HEADER & NAVIGATION --- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(10, 14, 23, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--color-border);
    transition: all var(--transition-base);
}

body.light-mode .site-header {
    background: rgba(255, 255, 255, 0.95);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-lg) 0;
    gap: var(--space-xl);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--color-text-primary);
    text-decoration: none;
}

.logo-icon {
    height: 72px;
    width: 72px;
    flex-shrink: 0;
}

.logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1;
    gap: 0.18rem;
}

.logo-prefix {
    color: var(--color-primary);
}

.logo-suffix {
    color: var(--color-accent);
}

.logo-tagline {
    font-family: var(--font-body);
    font-size: 0.72rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-text-muted);
}

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

.nav-links {
    display: flex;
    gap: var(--space-lg);
    list-style: none;
}

.nav-link {
    font-weight: 500;
    font-size: 0.9375rem;
    color: var(--color-text-secondary);
    text-decoration: none;
    transition: color var(--transition-fast);
    position: relative;
}

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

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -0.5rem;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--color-primary);
    transition: width var(--transition-base);
}

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

.nav-cta {
    display: flex;
    gap: var(--space-sm);
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--space-sm);
}

.menu-toggle span {
    width: 24px;
    height: 2px;
    background: var(--color-text-primary);
    transition: all var(--transition-base);
}

/* --- BUTTONS --- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 0.75rem 1.5rem;
    font-family: var(--font-body);
    font-size: 0.9375rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all var(--transition-base);
    white-space: nowrap;
}

.btn-primary {
    background: var(--color-primary);
    color: white;
    box-shadow: 0 2px 8px rgba(51, 133, 255, 0.4), 0 0 20px rgba(51, 133, 255, 0.15);
}

.btn-primary:hover {
    background: var(--color-primary-light);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(51, 133, 255, 0.5), 0 0 30px rgba(51, 133, 255, 0.25);
    color: white;
}

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

.btn-secondary:hover {
    background: var(--color-bg-muted);
    border-color: var(--color-border-dark);
    transform: translateY(-2px);
    color: var(--color-text-primary);
}

.btn-accent {
    background: var(--color-accent);
    color: white;
    box-shadow: 0 2px 8px rgba(255, 77, 121, 0.4), 0 0 20px rgba(255, 77, 121, 0.15);
}

.btn-accent:hover {
    background: var(--color-accent-light);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 77, 121, 0.5), 0 0 30px rgba(255, 77, 121, 0.25);
    color: white;
}

.btn-outline {
    background: transparent;
    color: var(--color-primary);
    border: 2px solid var(--color-primary);
}

.btn-outline:hover {
    background: var(--color-primary);
    color: white;
}

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

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

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.0625rem;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* --- CARDS --- */
.card {
    background: var(--color-bg-main);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    transition: all var(--transition-base);
}

.card:hover {
    border-color: var(--color-primary);
    box-shadow: var(--shadow-lg), 0 0 30px rgba(51, 133, 255, 0.15);
    transform: translateY(-4px);
}

.card-header {
    margin-bottom: var(--space-lg);
}

.card-title {
    font-size: 1.5rem;
    margin-bottom: var(--space-sm);
}

.card-subtitle {
    color: var(--color-text-muted);
    font-size: 0.875rem;
}

/* --- SECTIONS --- */
section {
    padding: var(--space-3xl) 0;
}

.section-header {
    text-align: center;
    max-width: 720px;
    margin: 0 auto var(--space-3xl);
}

.section-title {
    margin-bottom: var(--space-md);
}

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

/* --- GRID LAYOUTS --- */
.grid {
    display: grid;
    gap: var(--space-xl);
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

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

@media (max-width: 640px) {
    .grid-2, .grid-3, .grid-4 { 
        grid-template-columns: 1fr; 
    }
}

/* --- FOOTER --- */
.site-footer {
    background: var(--color-bg-subtle);
    border-top: 1px solid var(--color-border);
    padding: var(--space-3xl) 0 var(--space-xl);
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: var(--space-2xl);
    margin-bottom: var(--space-2xl);
}

.footer-brand h3 {
    font-size: 1.5rem;
    margin-bottom: var(--space-md);
}

.footer-section h4 {
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-md);
    color: var(--color-text-primary);
}

.footer-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.footer-links a {
    color: var(--color-text-secondary);
    font-size: 0.9375rem;
}

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

.footer-bottom {
    padding-top: var(--space-xl);
    border-top: 1px solid var(--color-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-sm);
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

/* ── Visit counter ── */
.rc-counter-wrap {
    /* always visible; JS updates the number */
}
.rc-counter {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    color: var(--color-text-muted);
    background: rgba(51,133,255,0.07);
    border: 1px solid rgba(51,133,255,0.15);
    padding: 4px 12px;
    border-radius: var(--radius-full);
}
.rc-view-count {
    font-weight: 700;
    color: var(--color-primary);
}

/* --- FLOATING CONTACT BUTTON --- */
.float-contact {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 60px;
    height: 60px;
    background: var(--color-primary);
    color: white;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: var(--shadow-xl), 0 0 40px rgba(51, 133, 255, 0.3);
    cursor: pointer;
    transition: all var(--transition-base);
    z-index: 999;
    text-decoration: none;
}

.float-contact:hover {
    transform: scale(1.1);
    background: var(--color-primary-light);
    color: white;
    box-shadow: var(--shadow-xl), 0 0 50px rgba(51, 133, 255, 0.5);
}

/* --- UTILITIES --- */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-0 { margin-top: 0; }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }

.mb-0 { margin-bottom: 0; }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }

/* --- ANIMATIONS --- */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-40px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(40px); }
    to { opacity: 1; transform: translateX(0); }
}

.animate-fade-in {
    animation: fadeIn 0.6s ease forwards;
}

.animate-slide-left {
    animation: slideInLeft 0.6s ease forwards;
}

.animate-slide-right {
    animation: slideInRight 0.6s ease forwards;
}

/* Stagger animations */
.stagger > * {
    opacity: 0;
    animation: fadeIn 0.6s ease forwards;
}

.stagger > *:nth-child(1) { animation-delay: 0.1s; }
.stagger > *:nth-child(2) { animation-delay: 0.2s; }
.stagger > *:nth-child(3) { animation-delay: 0.3s; }
.stagger > *:nth-child(4) { animation-delay: 0.4s; }
.stagger > *:nth-child(5) { animation-delay: 0.5s; }
.stagger > *:nth-child(6) { animation-delay: 0.6s; }

/* --- RESPONSIVE --- */
@media (max-width: 1024px) {
    .footer-content {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-wrap: wrap;
    }
    
    .menu-toggle {
        display: flex;
    }
    
    .nav-main {
        display: none;
        width: 100%;
        flex-direction: column;
        gap: var(--space-md);
    }
    
    .nav-main.active {
        display: flex;
    }
    
    .nav-links {
        flex-direction: column;
        width: 100%;
    }
    
    .nav-cta {
        width: 100%;
        flex-direction: column;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .footer-bottom {
        flex-direction: column;
        gap: var(--space-md);
        text-align: center;
    }
}
