/* =============================================
   CRISTIAN STANESCU - Portfolio Styles
   Clean, accessible, dark mode support
   ============================================= */

/* ===== CSS VARIABLES - LIGHT MODE ===== */
:root {
    /* Colors */
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: #dbeafe;
    --accent: #f59e0b;
    --success: #10b981;
    --danger: #ef4444;
    
    /* Text */
    --text: #111827;
    --text-light: #4b5563;
    --text-muted: #9ca3af;
    
    /* Backgrounds */
    --bg: #ffffff;
    --bg-alt: #f3f4f6;
    --bg-card: #ffffff;
    
    /* Borders */
    --border: #e5e7eb;
    --border-light: #f3f4f6;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.07), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
    
    /* Typography */
    --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-size-base: 16px;
    
    /* Spacing */
    --section-padding: 60px;
    --container-width: 1000px;
    
    /* Effects */
    --radius: 8px;
    --radius-lg: 12px;
    --transition: 0.25s ease;
}

/* ===== DARK MODE ===== */
[data-theme="dark"] {
    --text: #f9fafb;
    --text-light: #d1d5db;
    --text-muted: #6b7280;
    
    --bg: #0f172a;
    --bg-alt: #1e293b;
    --bg-card: #1e293b;
    
    --border: #334155;
    --border-light: #1e293b;
    
    --primary-light: #1e3a5f;
    
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
}

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

.reduce-motion *, .reduce-motion *::before, .reduce-motion *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
}

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

html {
    scroll-behavior: smooth;
    font-size: var(--font-size-base);
}

body {
    font-family: var(--font);
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    transition: background var(--transition), color var(--transition);
}

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

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

img {
    max-width: 100%;
    height: auto;
}

h1, h2, h3 {
    font-weight: 700;
    line-height: 1.2;
    color: var(--text);
}

h1 { font-size: clamp(2rem, 4vw, 2.75rem); }
h2 { font-size: 1.5rem; margin-bottom: 0.75rem; }
h3 { font-size: 1.125rem; }

p { color: var(--text-light); }

/* ===== UTILITIES ===== */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

.section-subtitle {
    text-align: center;
    color: var(--text-light);
    margin-bottom: 2rem;
}

/* ===== ACCESSIBILITY CONTROLS ===== */
.a11y-controls {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 999;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.a11y-toggle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid var(--border);
    background: var(--bg-card);
    color: var(--text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
    box-shadow: var(--shadow);
}

.a11y-toggle:hover, .a11y-toggle:focus {
    border-color: var(--primary);
    background: var(--primary-light);
}

.a11y-menu {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 8px;
    box-shadow: var(--shadow-lg);
    min-width: 140px;
}

.a11y-controls:hover .a11y-menu,
.a11y-controls:focus-within .a11y-menu {
    display: flex;
}

.a11y-menu hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 4px 0;
}

.a11y-btn {
    padding: 8px 12px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius);
    color: var(--text);
    font-size: 0.875rem;
    cursor: pointer;
    text-align: left;
    transition: all var(--transition);
}

.a11y-btn:hover, .a11y-btn:focus {
    background: var(--primary-light);
    border-color: var(--primary);
}

[data-theme="dark"] .theme-icon.light,
[data-theme="light"] .theme-icon.dark {
    display: none;
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    border: 2px solid transparent;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
}

.btn:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 2px;
}

.btn-primary {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
}

.btn-primary:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.btn-outline {
    background: transparent;
    color: var(--text);
    border-color: var(--border);
}

.btn-outline:hover {
    background: var(--bg-alt);
    border-color: var(--text-muted);
}

.btn-lg { padding: 14px 28px; }
.btn-sm { padding: 8px 16px; font-size: 0.875rem; }
.btn-block { width: 100%; }

/* ===== HEADER ===== */
.header {
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: background var(--transition), border-color var(--transition);
}

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    max-width: var(--container-width);
    margin: 0 auto;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text);
}

.logo-letters {
    width: 40px;
    height: 40px;
    background: var(--primary);
    color: #ffffff;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
}

.logo-letters.small {
    width: 32px;
    height: 32px;
    font-size: 0.875rem;
}

.logo-text {
    font-weight: 600;
    font-size: 1.125rem;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 28px;
}

.nav-menu a {
    color: var(--text-light);
    font-weight: 500;
    font-size: 0.9375rem;
    transition: color var(--transition);
}

.nav-menu a:hover {
    color: var(--text);
}

/* Mobile Nav */
.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.nav-toggle span {
    width: 22px;
    height: 2px;
    background: var(--text);
    border-radius: 1px;
    transition: all var(--transition);
}

/* ===== HERO ===== */
.hero {
    padding: 80px 0 60px;
    text-align: center;
    background: var(--bg-alt);
    transition: background var(--transition);
}

.hero h1 {
    margin-bottom: 1rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-subtitle {
    font-size: 1.125rem;
    color: var(--text-light);
    max-width: 500px;
    margin: 0 auto 2rem;
}

.hero-ctas {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ===== SECTIONS ===== */
.services, .portfolio, .pricing, .about {
    padding: var(--section-padding) 0;
}

.services { background: var(--bg); }
.portfolio { background: var(--bg-alt); }
.pricing { background: var(--bg); }
.about { background: var(--bg-alt); }

.services h2, .portfolio h2, .pricing h2, .about h2, .contact h2 {
    text-align: center;
}

/* ===== SERVICES ===== */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 1.5rem;
}

.service-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: all var(--transition);
}

.service-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.service-icon {
    width: 48px;
    height: 48px;
    background: var(--primary-light);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    color: var(--primary);
}

.service-card h3 {
    margin-bottom: 6px;
}

.service-card p {
    font-size: 0.9375rem;
    margin-bottom: 0;
}

/* ===== PORTFOLIO ===== */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 1.5rem;
}

.portfolio-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition);
}

.portfolio-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.portfolio-preview {
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hvac-preview {
    background: linear-gradient(135deg, #1e40af, #3b82f6);
}

.preview-icon {
    font-size: 2rem;
    font-weight: 700;
    color: #ffffff;
}

.preview-icon.plus {
    color: var(--text-muted);
    font-size: 2.5rem;
}

.portfolio-info {
    padding: 20px;
}

.portfolio-info h3 {
    margin-bottom: 4px;
}

.portfolio-info p {
    font-size: 0.875rem;
    margin-bottom: 12px;
}

.portfolio-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.portfolio-tags span {
    background: var(--bg-alt);
    color: var(--text-light);
    padding: 4px 10px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 500;
}

.cta-card .portfolio-preview {
    background: var(--bg-alt);
    border: 2px dashed var(--border);
}

/* ===== PRICING ===== */
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
    margin-top: 1.5rem;
}

.pricing-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px 24px;
    text-align: center;
    transition: all var(--transition);
    position: relative;
}

.pricing-card:hover {
    box-shadow: var(--shadow-lg);
}

.pricing-card.featured {
    border-color: var(--primary);
    box-shadow: var(--shadow);
}

.pricing-badge {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary);
    color: #ffffff;
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
}

.pricing-card h3 {
    font-size: 1.25rem;
    margin-bottom: 4px;
}

.pricing-tagline {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.pricing-price {
    margin-bottom: 4px;
}

.pricing-price .currency {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-light);
    vertical-align: top;
}

.pricing-price .amount {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text);
}

.pricing-monthly {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.pricing-features {
    text-align: left;
    margin-bottom: 20px;
}

.pricing-features li {
    padding: 8px 0;
    font-size: 0.9375rem;
    color: var(--text-light);
    border-bottom: 1px solid var(--border-light);
}

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

.pricing-guarantee {
    text-align: center;
    margin-top: 2rem;
    padding: 16px;
    background: var(--bg-alt);
    border-radius: var(--radius);
    font-size: 0.9375rem;
    color: var(--text-light);
    font-weight: 500;
}

/* ===== ABOUT ===== */
.about-content {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.about p {
    margin-bottom: 1rem;
}

.about p:last-child {
    margin-bottom: 0;
}

/* ===== CONTACT ===== */
.contact {
    padding: var(--section-padding) 0;
    background: var(--primary);
    color: #ffffff;
}

.contact h2 {
    color: #ffffff;
}

.contact .section-subtitle {
    color: rgba(255, 255, 255, 0.85);
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: start;
}

.contact-info p {
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 1.5rem;
}

.contact-methods {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
}

.contact-methods strong {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.7;
    margin-bottom: 4px;
}

.contact-methods a, .contact-methods span {
    color: #ffffff;
}

.contact-form {
    background: var(--bg);
    border-radius: var(--radius-lg);
    padding: 28px;
    color: var(--text);
}

.form-group {
    margin-bottom: 16px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 4px;
    color: var(--text);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: inherit;
    background: var(--bg);
    color: var(--text);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

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

/* ===== FOOTER ===== */
.footer {
    background: var(--bg-alt);
    padding: 24px 0;
    text-align: center;
    border-top: 1px solid var(--border);
}

.footer-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 8px;
}

.footer-content span {
    color: var(--text-light);
    font-size: 0.9375rem;
}

.footer p {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-bottom: 0;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    :root {
        --section-padding: 50px;
    }
    
    .a11y-controls {
        top: auto;
        bottom: 20px;
    }
    
    .nav-menu {
        position: fixed;
        inset: 0;
        background: var(--bg);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 20px;
        transform: translateX(100%);
        transition: transform var(--transition);
        z-index: 50;
    }
    
    .nav-menu.active {
        transform: translateX(0);
    }
    
    .nav-toggle {
        display: flex;
        z-index: 60;
    }
    
    .hero {
        padding: 50px 0 40px;
    }
    
    .hero-ctas {
        flex-direction: column;
    }
    
    .contact-grid {
        grid-template-columns: 1fr;
    }
    
    .contact-info {
        text-align: center;
    }
    
    .contact-methods {
        justify-content: center;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .logo-text {
        display: none;
    }
    
    .services-grid,
    .portfolio-grid,
    .pricing-grid {
        grid-template-columns: 1fr;
    }
}
