/* =========================================
   TW Electrical Contractor — style.css
   Clean · Corporate · Minimal
   ========================================= */

/* --- Design Tokens --- */
:root {
    --bg: #EAF3FC;
    --bg-alt: #FFFFFF;
    --bg-deep: #DCEBF9;
    --primary: #0B1E5B;
    --primary-700: #14307F;
    --accent: #1E5FDB;
    --accent-soft: #D9E6FB;
    --text: #0F172A;
    --text-muted: #52617A;
    --border: #D6E4F3;
    --border-strong: #B9CDE8;
    --shadow-sm: 0 1px 2px rgba(11, 30, 91, 0.06);
    --shadow-md: 0 8px 24px rgba(11, 30, 91, 0.08);
    --shadow-lg: 0 20px 48px rgba(11, 30, 91, 0.12);
    --radius: 14px;
    --radius-sm: 10px;
    --radius-lg: 20px;
    --max-w: 1200px;
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img { max-width: 100%; display: block; height: auto; }
a { color: var(--accent); text-decoration: none; transition: color .2s ease; }
a:hover { color: var(--primary); }
ul { list-style: none; }

/* --- Typography --- */
h1, h2, h3, h4, h5 {
    font-family: inherit;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: -0.02em;
    line-height: 1.15;
}
h1 { font-size: clamp(2.25rem, 4.5vw, 3.75rem); font-weight: 800; }
h2 { font-size: clamp(1.75rem, 3vw, 2.5rem); }
h3 { font-size: 1.2rem; font-weight: 600; }
h4 { font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--primary); }
p  { color: var(--text-muted); }
.lead { font-size: 1.125rem; color: var(--text-muted); max-width: 560px; }

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

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 16px;
}
.eyebrow .dot {
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 4px rgba(30, 95, 219, 0.15);
}

/* --- Layout --- */
.container {
    width: 100%;
    max-width: var(--max-w);
    margin-inline: auto;
    padding-inline: 24px;
}

.section {
    padding: clamp(64px, 9vw, 120px) 0;
}
.section-alt { background: var(--bg-alt); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }

.section-head {
    max-width: 640px;
    margin: 0 auto clamp(36px, 5vw, 56px);
    text-align: center;
}
.section-head h2 { margin-bottom: 14px; }

/* --- Accessibility --- */
.skip-link {
    position: absolute; left: -9999px;
    background: var(--primary); color: #fff;
    padding: 10px 16px; border-radius: 0 0 8px 0;
    z-index: 100;
}
.skip-link:focus { left: 0; top: 0; }

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 24px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.95rem;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all .2s ease;
    white-space: nowrap;
}
.btn-primary {
    background: var(--primary);
    color: #fff;
    box-shadow: var(--shadow-sm);
}
.btn-primary:hover {
    background: var(--primary-700);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}
.btn-ghost {
    background: transparent;
    color: var(--primary);
    border-color: var(--border-strong);
}
.btn-ghost:hover {
    background: var(--bg-alt);
    border-color: var(--primary);
    color: var(--primary);
}
.btn-ghost-light {
    background: transparent;
    color: #fff;
    border-color: rgba(255,255,255,0.4);
}
.btn-ghost-light:hover { background: rgba(255,255,255,0.1); color: #fff; }
.btn-white {
    background: #fff;
    color: var(--primary);
}
.btn-white:hover { background: var(--accent-soft); color: var(--primary); }
.btn-full { width: 100%; padding: 15px 24px; }

/* --- Header / Nav --- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(234, 243, 252, 0.85);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--border);
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 76px;
    gap: 24px;
}
.logo img { height: 52px; width: auto; }

.site-nav { display: flex; align-items: center; gap: 32px; }
.site-nav ul { display: flex; gap: 30px; }
.site-nav a {
    color: var(--primary);
    font-weight: 500;
    font-size: 0.95rem;
    position: relative;
    padding: 6px 0;
}
.site-nav a:hover { color: var(--accent); }
.site-nav a.active { color: var(--accent); }
.site-nav a.active::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: -2px;
    height: 2px; background: var(--accent); border-radius: 2px;
}

/* Mobile nav toggle */
.nav-toggle, .nav-toggle-label { display: none; }

/* --- Hero --- */
.hero {
    padding: clamp(56px, 8vw, 100px) 0 clamp(72px, 10vw, 120px);
    position: relative;
    overflow: hidden;
}
.hero::before {
    content: "";
    position: absolute; inset: 0;
    background:
        radial-gradient(1000px 500px at 100% 0%, rgba(30, 95, 219, 0.08), transparent 60%),
        radial-gradient(800px 400px at 0% 80%, rgba(11, 30, 91, 0.06), transparent 60%);
    pointer-events: none;
}
.hero-inner {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: clamp(40px, 6vw, 80px);
    align-items: center;
    position: relative;
}
.hero-copy h1 { margin-bottom: 20px; }
.hero-copy .lead { margin-bottom: 32px; }
.hero-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 48px;
}
.hero-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    padding-top: 28px;
    border-top: 1px solid var(--border-strong);
}
.hero-stats li { display: flex; flex-direction: column; }
.hero-stats strong {
    font-size: 1.5rem;
    color: var(--primary);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 2px;
}
.hero-stats span {
    font-size: 0.85rem;
    color: var(--text-muted);
}
.hero-media {
    position: relative;
}
.hero-media img {
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    aspect-ratio: 4/5;
    object-fit: cover;
    width: 100%;
}

/* --- Page Hero (inner pages) --- */
.page-hero {
    padding: clamp(56px, 8vw, 96px) 0 clamp(40px, 6vw, 64px);
    text-align: left;
    position: relative;
    overflow: hidden;
}
.page-hero::before {
    content: ""; position: absolute; inset: 0;
    background: radial-gradient(900px 400px at 80% 0%, rgba(30, 95, 219, 0.08), transparent 70%);
    pointer-events: none;
}
.page-hero .container { position: relative; max-width: 820px; }
.page-hero h1 { margin-bottom: 20px; }

/* --- Grids --- */
.grid { display: grid; gap: 24px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* --- Cards --- */
.card {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px 28px;
    transition: all .25s ease;
}
.card:hover {
    border-color: var(--border-strong);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.service-card .card-icon {
    width: 48px; height: 48px;
    border-radius: 12px;
    background: var(--accent-soft);
    color: var(--accent);
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 20px;
}
.service-card .card-icon svg { width: 24px; height: 24px; }
.service-card h3 { margin-bottom: 8px; color: var(--primary); }
.service-card p { font-size: 0.95rem; }

.values .value-num {
    display: inline-block;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: 0.1em;
    margin-bottom: 14px;
}
.values h3 { margin-bottom: 8px; }
.values p { font-size: 0.95rem; }

/* --- Project cards --- */
.project {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: all .25s ease;
}
.project:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--border-strong);
}
.project img {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
}
.project figcaption { padding: 20px 22px; }
.project .tag {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
    background: var(--accent-soft);
    padding: 4px 10px;
    border-radius: 999px;
    margin-bottom: 10px;
}
.project h3 { color: var(--primary); }

/* --- Split --- */
.split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(40px, 6vw, 80px);
    align-items: center;
}
.split-media img {
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    aspect-ratio: 4/3;
    object-fit: cover;
    width: 100%;
}
.split h2 { margin-bottom: 16px; }
.split p { margin-bottom: 16px; }

/* --- Service Detail rows --- */
.service-detail {
    display: grid;
    grid-template-columns: 1fr 1.15fr;
    gap: clamp(40px, 6vw, 80px);
    align-items: center;
}
.service-detail.reverse .service-detail-media { order: 2; }
.service-detail-media img {
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    aspect-ratio: 4/3;
    object-fit: cover;
    width: 100%;
}
.service-detail h2 { margin-bottom: 16px; }
.service-detail p { margin-bottom: 20px; }

/* --- Check list --- */
.check-list {
    display: grid;
    gap: 10px;
    margin-top: 16px;
}
.check-list li {
    position: relative;
    padding-left: 28px;
    color: var(--text);
    font-size: 0.96rem;
}
.check-list li::before {
    content: "";
    position: absolute;
    left: 0; top: 8px;
    width: 16px; height: 16px;
    border-radius: 50%;
    background: var(--accent-soft);
    border: 2px solid var(--accent);
}
.check-list li::after {
    content: "";
    position: absolute;
    left: 5px; top: 11px;
    width: 6px; height: 3px;
    border-left: 2px solid var(--accent);
    border-bottom: 2px solid var(--accent);
    transform: rotate(-45deg);
}

/* --- Credentials --- */
.credentials {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(40px, 6vw, 80px);
    align-items: center;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: clamp(32px, 5vw, 56px);
}
.credentials h2 { margin-bottom: 14px; }
.credentials-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px 16px;
}
.credentials-list li {
    display: flex;
    flex-direction: column;
    padding: 18px 20px;
    background: var(--bg);
    border-radius: var(--radius-sm);
}
.credentials-list strong {
    font-size: 1.15rem;
    color: var(--primary);
    font-weight: 700;
    margin-bottom: 2px;
    letter-spacing: -0.01em;
}
.credentials-list span {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* --- CTA Banner --- */
.cta-banner {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-700) 100%);
    color: #fff;
    padding: clamp(48px, 6vw, 80px) 0;
}
.cta-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
    flex-wrap: wrap;
}
.cta-inner h2 { color: #fff; margin-bottom: 6px; }
.cta-inner p { color: rgba(255,255,255,0.75); }
.cta-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* --- Contact --- */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1.4fr;
    gap: clamp(32px, 5vw, 64px);
    align-items: start;
}
.contact-info h2 { margin-bottom: 12px; }
.contact-info p { margin-bottom: 28px; }
.info-list {
    display: grid;
    gap: 20px;
}
.info-list li {
    display: flex;
    flex-direction: column;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}
.info-list li:last-child { border-bottom: none; padding-bottom: 0; }
.info-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 6px;
    font-weight: 600;
}
.info-list a, .info-list span:not(.info-label) {
    font-size: 1rem;
    color: var(--primary);
    font-weight: 500;
}
.info-list a:hover { color: var(--accent); }

/* Form */
.contact-form {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: clamp(28px, 4vw, 40px);
    display: grid;
    gap: 20px;
}
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
.form-row { display: flex; flex-direction: column; }
.form-row label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 8px;
    letter-spacing: 0.02em;
}
.form-row input,
.form-row select,
.form-row textarea {
    font-family: inherit;
    font-size: 0.98rem;
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--border-strong);
    border-radius: 10px;
    padding: 13px 16px;
    transition: all .2s ease;
    width: 100%;
}
.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
    outline: none;
    border-color: var(--accent);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(30, 95, 219, 0.12);
}
.form-row textarea { resize: vertical; min-height: 140px; }
.form-note {
    font-size: 0.82rem;
    color: var(--text-muted);
    text-align: center;
    margin-top: 4px;
}

/* --- Footer --- */
.site-footer {
    background: var(--primary);
    color: rgba(255,255,255,0.75);
    margin-top: 0;
}
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.3fr;
    gap: 40px;
    padding: clamp(56px, 7vw, 80px) 24px clamp(40px, 5vw, 56px);
}
.footer-brand img {
    height: 50px;
    margin-bottom: 18px;
    filter: brightness(0) invert(1);
    opacity: 0.95;
}
.footer-brand p {
    color: rgba(255,255,255,0.65);
    font-size: 0.9rem;
    max-width: 340px;
}
.site-footer h4 {
    color: #fff;
    font-size: 0.78rem;
    margin-bottom: 16px;
}
.site-footer ul { display: grid; gap: 10px; }
.site-footer li, .site-footer a {
    color: rgba(255,255,255,0.7);
    font-size: 0.92rem;
    transition: color .2s ease;
}
.site-footer a:hover { color: #fff; }

.footer-base {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding: 22px 0;
}
.footer-base .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}
.footer-base p {
    font-size: 0.82rem;
    color: rgba(255,255,255,0.55);
}

/* =========================================
   Responsive
   ========================================= */
@media (max-width: 1024px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .credentials { grid-template-columns: 1fr; }
    .contact-grid { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
    /* Mobile nav */
    .nav-toggle-label {
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: 5px;
        width: 40px; height: 40px;
        cursor: pointer;
        z-index: 60;
    }
    .nav-toggle-label span {
        display: block;
        width: 22px; height: 2px;
        background: var(--primary);
        transition: all .25s ease;
        border-radius: 2px;
    }
    .site-nav {
        position: fixed;
        top: 76px; left: 0; right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        background: var(--bg-alt);
        border-bottom: 1px solid var(--border);
        padding: 24px;
        transform: translateY(-120%);
        transition: transform .3s ease;
        box-shadow: var(--shadow-md);
    }
    .site-nav ul {
        flex-direction: column;
        gap: 0;
        width: 100%;
        margin-bottom: 16px;
    }
    .site-nav ul li { border-bottom: 1px solid var(--border); }
    .site-nav ul li:last-child { border-bottom: none; }
    .site-nav a {
        display: block;
        padding: 14px 4px;
        font-size: 1rem;
    }
    .site-nav a.active::after { display: none; }
    .nav-cta { width: 100%; }
    .nav-toggle:checked ~ .site-nav {
        transform: translateY(0);
    }
    .nav-toggle:checked ~ .nav-toggle-label span:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }
    .nav-toggle:checked ~ .nav-toggle-label span:nth-child(2) {
        opacity: 0;
    }
    .nav-toggle:checked ~ .nav-toggle-label span:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }

    /* Layout collapses */
    .hero-inner { grid-template-columns: 1fr; }
    .hero-media { order: -1; }
    .hero-media img { aspect-ratio: 16/10; }
    .split { grid-template-columns: 1fr; }
    .service-detail { grid-template-columns: 1fr; }
    .service-detail.reverse .service-detail-media { order: -1; }
}

@media (max-width: 560px) {
    .grid-4 { grid-template-columns: 1fr; }
    .grid-3 { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; gap: 32px; }
    .hero-stats { grid-template-columns: 1fr; gap: 18px; text-align: left; }
    .form-grid { grid-template-columns: 1fr; }
    .credentials-list { grid-template-columns: 1fr; }
    .cta-inner { flex-direction: column; align-items: flex-start; }
    .footer-base .container { flex-direction: column; align-items: flex-start; }
    .logo img { height: 44px; }
}

@media (max-width: 380px) {
    .btn { padding: 12px 18px; font-size: 0.9rem; }
    .hero-actions { flex-direction: column; align-items: stretch; }
    .hero-actions .btn { width: 100%; }
}
