/* ===========================
   Andersen's HVACR LLC
   ADA Compliant | WCAG 2.1 AA
   Mobile-First Responsive
   =========================== */

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

:root {
    --color-primary: #1b2d4f;
    --color-primary-light: #2a4270;
    --color-accent: #e8762d;
    --color-accent-dark: #cf6520;
    --color-accent-light: #fdf0e7;
    --color-text: #1f2937;
    --color-text-light: #6b7280;
    --color-bg: #ffffff;
    --color-bg-alt: #f8f9fb;
    --color-bg-dark: #0f1b2e;
    --color-border: #e2e5ea;
    --color-success: #16a34a;
    --color-danger: #dc2626;
    --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --font-heading: var(--font-body);
    --max-width: 1140px;
    --radius: 8px;
    --radius-lg: 12px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
}

html { scroll-behavior: smooth; font-size: 100%; }

body {
    font-family: var(--font-body);
    color: var(--color-text);
    background: var(--color-bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

/* --- Skip Link (ADA) --- */
.skip-link {
    position: absolute;
    top: -100%;
    left: 1rem;
    background: var(--color-accent);
    color: #fff;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    z-index: 9999;
    font-weight: 600;
    text-decoration: none;
}
.skip-link:focus {
    top: 1rem;
    outline: 3px solid var(--color-primary);
    outline-offset: 2px;
}

/* --- Focus Styles (ADA) --- */
:focus-visible {
    outline: 3px solid var(--color-accent);
    outline-offset: 2px;
}

/* --- Screen Reader Only (ADA) --- */
.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;
}

/* --- Container --- */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* --- Typography --- */
h1, h2, h3, h4 {
    font-family: var(--font-heading);
    line-height: 1.2;
    margin-bottom: 0.75rem;
    color: var(--color-primary);
}
h1 { font-size: 2.5rem; font-weight: 800; }
h2 { font-size: 1.875rem; font-weight: 700; }
h3 { font-size: 1.25rem; font-weight: 600; }
h4 { font-size: 1.1rem; font-weight: 600; }
p { margin-bottom: 1rem; }
a { color: var(--color-accent); text-decoration: underline; }
a:hover { color: var(--color-accent-dark); }

/* --- Navigation --- */
header {
    position: sticky;
    top: 0;
    background: var(--color-primary);
    z-index: 100;
    box-shadow: var(--shadow-sm);
}
.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 0;
    padding-bottom: 0;
    min-height: 64px;
}
.logo {
    text-decoration: none;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.logo-text {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.2;
}
.logo-text .logo-llc {
    font-size: 0.75rem;
    font-weight: 400;
    opacity: 0.7;
    display: block;
}
.nav-links {
    display: flex;
    list-style: none;
    gap: 0.25rem;
    align-items: center;
}
.nav-links a {
    text-decoration: none;
    color: rgba(255,255,255,0.85);
    font-weight: 500;
    font-size: 0.9rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius);
    transition: background 0.2s, color 0.2s;
}
.nav-links a:hover,
.nav-links a:focus-visible {
    background: rgba(255,255,255,0.1);
    color: #fff;
}
.nav-links a.active {
    background: rgba(255,255,255,0.15);
    color: #fff;
}
.nav-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--color-accent) !important;
    color: #fff !important;
    font-weight: 600 !important;
    padding: 0.5rem 1rem !important;
    border-radius: var(--radius) !important;
    text-decoration: none !important;
    font-size: 0.9rem !important;
    white-space: nowrap;
    transition: background 0.2s !important;
}
.nav-cta:hover {
    background: var(--color-accent-dark) !important;
}
.nav-cta svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* Mobile menu toggle */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}
.hamburger,
.hamburger::before,
.hamburger::after {
    display: block;
    width: 24px;
    height: 2px;
    background: #fff;
    transition: transform 0.3s;
}
.hamburger { position: relative; }
.hamburger::before,
.hamburger::after {
    content: '';
    position: absolute;
    left: 0;
}
.hamburger::before { top: -7px; }
.hamburger::after { top: 7px; }
/* Hamburger open state */
.menu-toggle[aria-expanded="true"] .hamburger { background: transparent; }
.menu-toggle[aria-expanded="true"] .hamburger::before { top: 0; transform: rotate(45deg); }
.menu-toggle[aria-expanded="true"] .hamburger::after { top: 0; transform: rotate(-45deg); }

/* --- Hero --- */
.hero {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-bg-dark) 100%);
    color: #fff;
    padding: 5rem 0 4rem;
    position: relative;
    overflow: hidden;
}
.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 60%;
    height: 200%;
    background: radial-gradient(ellipse, rgba(232,118,45,0.12) 0%, transparent 70%);
    pointer-events: none;
}
.hero .container {
    position: relative;
    z-index: 1;
}
.hero h1 {
    color: #fff;
    font-size: 2.75rem;
    margin-bottom: 1rem;
    max-width: 700px;
}
.hero-sub {
    font-size: 1.2rem;
    opacity: 0.9;
    margin-bottom: 2rem;
    max-width: 560px;
    line-height: 1.6;
}
.hero-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 2rem;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
    line-height: 1.4;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary {
    background: var(--color-accent);
    color: #fff;
}
.btn-primary:hover {
    background: var(--color-accent-dark);
    color: #fff;
    box-shadow: var(--shadow-md);
}
.btn-outline {
    background: transparent;
    color: #fff;
    border: 2px solid rgba(255,255,255,0.4);
}
.btn-outline:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.7);
    color: #fff;
}
.btn-dark {
    background: var(--color-primary);
    color: #fff;
}
.btn-dark:hover {
    background: var(--color-primary-light);
    color: #fff;
}

/* --- Sections --- */
.section { padding: 4.5rem 0; }
.section-alt { background: var(--color-bg-alt); }
.section-dark {
    background: var(--color-primary);
    color: #fff;
}
.section-dark h2,
.section-dark h3 { color: #fff; }
.section-header {
    text-align: center;
    margin-bottom: 2.5rem;
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
}
.section-header p {
    color: var(--color-text-light);
    font-size: 1.05rem;
}
.section-dark .section-header p {
    color: rgba(255,255,255,0.75);
}

/* --- Service Cards --- */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}
.service-card {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    transition: box-shadow 0.2s, transform 0.2s;
}
.service-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}
.service-card-icon {
    width: 52px;
    height: 52px;
    background: var(--color-accent-light);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.25rem;
    font-size: 1.5rem;
}
.service-card h3 {
    color: var(--color-primary);
    margin-bottom: 0.5rem;
}
.service-card p {
    color: var(--color-text-light);
    font-size: 0.95rem;
    margin-bottom: 1rem;
}
.service-card .card-link {
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}
.service-card .card-link:hover {
    text-decoration: underline;
}

/* --- Trust Bar --- */
.trust-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    text-align: center;
}
.trust-item {
    padding: 1.5rem 1rem;
}
.trust-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    display: block;
}
.trust-item h3 {
    font-size: 1rem;
    color: #fff;
    margin-bottom: 0.25rem;
}
.trust-item p {
    font-size: 0.875rem;
    opacity: 0.75;
    margin-bottom: 0;
}

/* --- Area Grid --- */
.area-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem;
}
.area-tag {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    text-align: center;
    font-weight: 500;
    font-size: 0.95rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.area-tag:hover {
    border-color: var(--color-accent);
    box-shadow: var(--shadow-sm);
}

/* --- About --- */
.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}
.about-text h2 {
    text-align: left;
}
.about-placeholder {
    background: var(--color-bg-alt);
    border: 2px dashed var(--color-border);
    border-radius: var(--radius-lg);
    padding: 3rem;
    text-align: center;
    color: var(--color-text-light);
    font-size: 0.9rem;
}

/* --- Info Grid --- */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 2rem;
    text-align: center;
}
.info-item { padding: 1.5rem; }
.info-icon { font-size: 2rem; display: block; margin-bottom: 0.5rem; }
.info-item address { font-style: normal; }
.info-item a { color: var(--color-accent); }

/* --- Contact Form --- */
.contact-form {
    max-width: 620px;
    margin: 0 auto;
}
.contact-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: start;
}
.contact-info-block h3 {
    margin-bottom: 1.25rem;
}
.contact-detail {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    align-items: flex-start;
}
.contact-detail-icon {
    width: 40px;
    height: 40px;
    background: var(--color-accent-light);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.1rem;
}
.contact-detail-text h4 {
    margin-bottom: 0.15rem;
    font-size: 0.95rem;
}
.contact-detail-text p {
    margin-bottom: 0;
    font-size: 0.9rem;
    color: var(--color-text-light);
}
.contact-detail-text a {
    color: var(--color-accent);
    text-decoration: none;
}
.contact-detail-text a:hover {
    text-decoration: underline;
}

.form-group { margin-bottom: 1.25rem; }
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.375rem;
    font-size: 0.9rem;
}
.required { color: var(--color-danger); }
.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: var(--font-body);
    color: var(--color-text);
    background: var(--color-bg);
    transition: border-color 0.2s, box-shadow 0.2s;
    appearance: none;
    -webkit-appearance: none;
}
.form-group select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7280' fill='none' stroke-width='1.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2.5rem;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: var(--color-accent);
    outline: none;
    box-shadow: 0 0 0 3px rgba(232,118,45,0.15);
}
.form-group input[aria-invalid="true"],
.form-group textarea[aria-invalid="true"],
.form-group select[aria-invalid="true"] {
    border-color: var(--color-danger);
    box-shadow: 0 0 0 3px rgba(220,38,38,0.1);
}
.error-msg {
    color: var(--color-danger);
    font-size: 0.825rem;
    display: block;
    margin-top: 0.25rem;
}

/* --- Emergency Callout --- */
.emergency-callout {
    background: linear-gradient(135deg, var(--color-accent), var(--color-accent-dark));
    color: #fff;
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    text-align: center;
    margin-top: 2rem;
}
.emergency-callout h3 {
    color: #fff;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}
.emergency-callout p {
    opacity: 0.9;
    margin-bottom: 1.25rem;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}
.emergency-callout .btn {
    background: #fff;
    color: var(--color-accent-dark);
}
.emergency-callout .btn:hover {
    background: #f0f0f0;
}

/* --- Services Detail (services.html) --- */
.service-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: start;
    margin-bottom: 3rem;
    padding-bottom: 3rem;
    border-bottom: 1px solid var(--color-border);
}
.service-detail:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}
.service-detail:nth-child(even) {
    direction: rtl;
}
.service-detail:nth-child(even) > * {
    direction: ltr;
}
.service-detail-content h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}
.service-list {
    list-style: none;
    margin: 1rem 0;
}
.service-list li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
    font-size: 0.95rem;
    color: var(--color-text-light);
}
.service-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.85rem;
    width: 8px;
    height: 8px;
    background: var(--color-accent);
    border-radius: 50%;
}
.service-detail-visual {
    background: var(--color-bg-alt);
    border: 2px dashed var(--color-border);
    border-radius: var(--radius-lg);
    padding: 4rem 2rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}
.service-detail-visual .detail-icon {
    font-size: 3rem;
}
.service-detail-visual p {
    color: var(--color-text-light);
    font-size: 0.875rem;
    margin-bottom: 0;
}

/* --- Page Header --- */
.page-header {
    background: var(--color-primary);
    color: #fff;
    padding: 3.5rem 0 2.5rem;
}
.page-header h1 {
    color: #fff;
    margin-bottom: 0.5rem;
}
.page-header p {
    opacity: 0.8;
    max-width: 560px;
    font-size: 1.05rem;
}

/* --- Map Placeholder --- */
.map-placeholder {
    background: var(--color-bg-alt);
    border: 2px dashed var(--color-border);
    border-radius: var(--radius-lg);
    padding: 4rem 2rem;
    text-align: center;
    color: var(--color-text-light);
}

/* --- Footer --- */
footer {
    background: var(--color-bg-dark);
    color: rgba(255,255,255,0.8);
    padding: 3rem 0 2rem;
}
.footer-inner {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}
.footer-brand .logo-text {
    color: #fff;
    font-size: 1.1rem;
    display: block;
    margin-bottom: 0.5rem;
}
.footer-brand p {
    font-size: 0.875rem;
    opacity: 0.7;
    max-width: 280px;
}
.footer-col h4 {
    color: #fff;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}
.footer-col ul {
    list-style: none;
}
.footer-col li {
    margin-bottom: 0.5rem;
}
.footer-col a {
    color: rgba(255,255,255,0.65);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}
.footer-col a:hover {
    color: var(--color-accent);
}
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.825rem;
    opacity: 0.6;
}
.footer-bottom a {
    color: rgba(255,255,255,0.7);
}
.credit a:hover {
    color: var(--color-accent);
}

/* --- Responsive --- */
@media (max-width: 900px) {
    .about-content,
    .service-detail,
    .contact-split {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    .service-detail:nth-child(even) {
        direction: ltr;
    }
    .footer-inner {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    h1 { font-size: 2rem; }
    h2 { font-size: 1.5rem; }
    .hero { padding: 3.5rem 0 3rem; }
    .hero h1 { font-size: 2rem; }

    .menu-toggle { display: block; }
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--color-primary);
        flex-direction: column;
        padding: 0.5rem 1.5rem 1rem;
        gap: 0;
        border-top: 1px solid rgba(255,255,255,0.1);
        box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    }
    .nav-links.open { display: flex; }
    .nav-links li {
        padding: 0;
        border-bottom: 1px solid rgba(255,255,255,0.08);
    }
    .nav-links li:last-child { border-bottom: none; }
    .nav-links a {
        display: block;
        padding: 0.75rem 0;
        border-radius: 0;
    }
    .nav-cta {
        margin-top: 0.5rem;
        text-align: center;
        justify-content: center;
    }

    .section { padding: 2.5rem 0; }
    .form-row { grid-template-columns: 1fr; }
    .card-grid { grid-template-columns: 1fr; }

    .hero-actions {
        flex-direction: column;
        align-items: flex-start;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
}

/* --- Reduced Motion (ADA) --- */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .btn,
    .service-card,
    .nav-links a,
    .footer-col a { transition: none; }
}

/* --- High Contrast Mode (ADA) --- */
@media (forced-colors: active) {
    .btn { border: 2px solid currentColor; }
    .service-card { border: 2px solid currentColor; }
    .area-tag { border: 2px solid currentColor; }
    .nav-cta { border: 2px solid currentColor; }
}

/* --- Print --- */
@media print {
    header, .hero .btn, .contact-form, .map-placeholder, .emergency-callout { display: none; }
    .hero { background: none; color: #000; padding: 1rem 0; }
    .hero h1 { color: #000; }
    .section { padding: 1rem 0; }
    .section-dark { background: none; color: #000; }
    .section-dark h2, .section-dark h3 { color: #000; }
    footer { background: none; color: #000; border-top: 1px solid #000; }
}
