/* ============================================
   EcoSource Iowa - Environmental Compliance Solutions
   ============================================ */

/* --- CSS Reset & Custom Properties --- */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    /* Primary - Deep forest green (from ecosourceiowa.com) */
    --primary: #444D41;
    --primary-light: #5a6356;
    --primary-dark: #343d31;

    /* Secondary - Professional teal (from ecosourceiowa.com) */
    --secondary: #035772;
    --secondary-light: #0a7a9e;
    --secondary-dark: #062134;

    /* Accent - Olive green (logo color from ecosourceiowa.com) */
    --accent: #C3CA90;
    --accent-light: #D4E375;
    --accent-dark: #869514;

    /* Neutrals (from ecosourceiowa.com) */
    --white: #FFFFFF;
    --off-white: #F6F9F5;
    --light-gray: #BBC0B9;
    --medium-gray: #80877D;
    --dark-gray: #313E4F;
    --near-black: #091405;

    /* Functional */
    --success: #16a34a;
    --error: #dc2626;
    --warning: #d97706;

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.12);

    /* Layout */
    --max-width: 1200px;
    --topbar-height: 30px;
    --header-height: 80px;
    --header-height-scrolled: 64px;

    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
}

/* --- Skip Link --- */
.skip-link {
    position: absolute;
    top: -100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent);
    color: var(--white);
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    z-index: 10000;
    text-decoration: none;
    font-weight: 600;
    transition: top 0.3s;
}
.skip-link:focus { top: 0.5rem; }

/* --- Focus Visible --- */
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* --- Wave Divider --- */
.wave-divider {
    position: relative;
    margin: 0;
    line-height: 0;
}
.wave-divider svg {
    width: 100%;
    height: 40px;
    display: block;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--dark-gray);
    background: var(--white);
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--secondary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--secondary-light);
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Raleway', 'Open Sans', sans-serif;
    font-weight: 700;
    color: var(--primary);
    line-height: 1.2;
}

h1 { font-size: 2.75rem; }
h2 { font-size: 2.25rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

p { margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }

/* --- Utility Classes --- */

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
}

.section {
    padding: 80px 0;
}

.section--alt {
    background: var(--off-white);
}

.section--dark {
    background: var(--primary);
    color: var(--white);
}

.section--dark h2,
.section--dark h3,
.section--dark h4 {
    color: var(--white);
}

.text-center { text-align: center; }

.section-subtitle {
    font-size: 1.1rem;
    color: var(--medium-gray);
    max-width: 650px;
    margin: 0 auto 48px;
    text-align: center;
}

.section--dark .section-subtitle {
    color: var(--accent-light);
}

.section-title {
    text-align: center;
    margin-bottom: 16px;
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: var(--secondary);
    margin: 16px auto 0;
    border-radius: 2px;
}

/* --- Buttons --- */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 32px;
    font-family: 'Raleway', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    border: 2px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    transition: all var(--transition-normal);
    text-decoration: none;
    line-height: 1;
}

.btn--primary {
    background: var(--secondary-dark);
    color: var(--white);
    border-color: var(--secondary-dark);
}

.btn--primary:hover {
    background: var(--secondary);
    border-color: var(--secondary);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn--outline {
    background: transparent;
    color: var(--white);
    border-color: var(--white);
}

.btn--outline:hover {
    background: var(--white);
    color: var(--primary);
    transform: translateY(-2px);
}

.btn--outline-dark {
    background: transparent;
    color: var(--secondary);
    border-color: var(--secondary);
}

.btn--outline-dark:hover {
    background: var(--secondary);
    color: var(--white);
    transform: translateY(-2px);
}

.btn--small {
    padding: 10px 20px;
    font-size: 0.85rem;
}

/* --- Header & Navigation --- */

.topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1001;
    background: var(--secondary-dark);
    color: var(--white);
    font-size: 0.78rem;
    padding: 6px 0;
    text-align: center;
    font-family: 'Open Sans', sans-serif;
}

.topbar a {
    color: var(--accent-light);
    text-decoration: none;
    font-weight: 600;
}

.topbar a:hover {
    text-decoration: underline;
}

.topbar__inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    position: relative;
}

.topbar__socials {
    position: absolute;
    right: 24px;
    display: flex;
    gap: 10px;
    align-items: center;
}

.topbar__socials a {
    color: var(--accent);
    transition: color var(--transition-fast);
    display: flex;
}

.topbar__socials a:hover {
    color: var(--white);
}

.topbar__socials svg {
    width: 15px;
    height: 15px;
}

.topbar__inner svg {
    width: 14px;
    height: 14px;
    color: var(--accent-light);
}

.header {
    position: fixed;
    top: 30px;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--white);
    height: var(--header-height);
    transition: all var(--transition-normal);
    border-bottom: 1px solid transparent;
}

.header--scrolled {
    height: var(--header-height-scrolled);
    box-shadow: var(--shadow-md);
    border-bottom-color: var(--light-gray);
}

.header__inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.header__logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--primary);
}

.header__logo img {
    height: 54px;
    width: auto;
    object-fit: contain;
    transition: height var(--transition-normal);
}

.header--scrolled .header__logo img {
    height: 42px;
}

.header__logo-text {
    font-family: 'Raleway', sans-serif;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--primary);
    line-height: 1.1;
}

.header__logo-text span {
    display: block;
    font-size: 0.65rem;
    font-weight: 400;
    color: var(--medium-gray);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.nav {
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav__link {
    padding: 8px 16px;
    font-family: 'Raleway', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--dark-gray);
    border-radius: 6px;
    transition: all var(--transition-fast);
    text-decoration: none;
}

.nav__link:hover,
.nav__link--active {
    color: var(--secondary);
    background: rgba(3, 87, 114, 0.06);
}

.nav__cta {
    margin-left: 8px;
    color: var(--white) !important;
    background: var(--secondary) !important;
    border-color: var(--secondary) !important;
}

.nav__cta:hover {
    color: var(--white) !important;
    background: var(--secondary-dark) !important;
    border-color: var(--secondary-dark) !important;
}

/* Mobile Menu Toggle */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 1001;
}

.hamburger__line {
    width: 24px;
    height: 2px;
    background: var(--primary);
    border-radius: 2px;
    transition: all var(--transition-normal);
}

.hamburger--active .hamburger__line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger--active .hamburger__line:nth-child(2) {
    opacity: 0;
}

.hamburger--active .hamburger__line:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* --- Hero Section --- */

.hero {
    position: relative;
    min-height: 600px;
    display: flex;
    align-items: center;
    padding: 150px 0 80px;
    background: linear-gradient(rgba(6, 33, 52, 0.7), rgba(52, 61, 49, 0.75)), url('/images/hero-bg.jpg') center/cover no-repeat;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M54.627 0l.83.828-1.415 1.415L51.8 0h2.827zM5.373 0l-.83.828L5.96 2.243 8.2 0H5.374zM48.97 0l3.657 3.657-1.414 1.414L46.143 0h2.828zM11.03 0L7.372 3.657 8.787 5.07 13.857 0H11.03zm32.284 0L49.8 6.485 48.384 7.9l-7.9-7.9h2.83zM16.686 0L10.2 6.485 11.616 7.9l7.9-7.9h-2.83zM22.344 0L13.858 8.485 15.272 9.9l9.9-9.9h-2.828zM32 0l-3.486 3.485L26.1 5.9l5.9-5.9h0zm5.656 0l-9.9 9.9 1.415 1.414L39.07 1.414 37.656 0zm-16.97 0l-9.9 9.9 1.414 1.414L22.1 1.414 20.686 0zM9.414 0L0 9.414v2.829L12.243 0H9.414zM0 12.243L0 14.07l14.07-14.07h-2.827L0 12.243z' fill='%23ffffff' fill-opacity='0.03' fill-rule='evenodd'/%3E%3C/svg%3E");
    animation: heroPattern 30s linear infinite;
}

@keyframes heroPattern {
    0% { transform: translateX(0); }
    100% { transform: translateX(60px); }
}

.hero__content {
    position: relative;
    z-index: 1;
    max-width: 700px;
}

.hero__badge {
    display: inline-block;
    padding: 6px 16px;
    background: rgba(255,255,255,0.12);
    color: var(--accent-light);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    border-radius: 20px;
    margin-bottom: 24px;
    border: 1px solid rgba(255,255,255,0.15);
}

.hero__title {
    font-size: 3.25rem;
    color: var(--white);
    margin-bottom: 20px;
    line-height: 1.1;
}

.hero__subtitle {
    font-size: 1.2rem;
    color: var(--accent-light);
    margin-bottom: 36px;
    max-width: 550px;
    line-height: 1.7;
}

.hero__actions {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.hero__decoration {
    position: absolute;
    right: -100px;
    top: 50%;
    transform: translateY(-50%);
    width: 500px;
    height: 500px;
    opacity: 0.06;
    z-index: 0;
}

/* --- About Section --- */

.about__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.about__content h2 {
    margin-bottom: 20px;
}

.about__content p {
    color: var(--medium-gray);
    font-size: 1.05rem;
}

.about__highlights {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 32px;
}

.about__highlight {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.about__highlight-icon {
    width: 40px;
    height: 40px;
    min-width: 40px;
    background: rgba(3, 87, 114, 0.08);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--secondary);
}

.about__highlight-icon svg {
    width: 20px;
    height: 20px;
}

.about__highlight h4 {
    font-size: 0.95rem;
    margin-bottom: 2px;
}

.about__highlight p {
    font-size: 0.85rem;
    color: var(--medium-gray);
    margin: 0;
}

.about__image {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    background: var(--light-gray);
    aspect-ratio: 4/3;
    display: flex;
    align-items: center;
    justify-content: center;
}

.about__image-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary-dark) 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--white);
    padding: 40px;
    text-align: center;
}

.about__image-placeholder svg {
    width: 80px;
    height: 80px;
    margin-bottom: 16px;
    opacity: 0.6;
}

.about__image-placeholder p {
    font-size: 0.9rem;
    opacity: 0.7;
}

/* --- Divisions Section --- */

.divisions__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
}

.division-card {
    background: var(--white);
    border-radius: 16px;
    padding: 48px 40px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--light-gray);
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    display: block;
    cursor: pointer;
}

.division-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--secondary);
    transform: scaleX(0);
    transition: transform var(--transition-normal);
}

.division-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.division-card:hover::before {
    transform: scaleX(1);
}

.division-card__logo {
    max-width: 200px;
    height: auto;
    margin-bottom: 8px;
}

.division-card__icon {
    width: 64px;
    height: 64px;
    background: rgba(3, 87, 114, 0.08);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    color: var(--secondary);
}

.division-card__icon svg {
    width: 32px;
    height: 32px;
}

.division-card h3 {
    margin-bottom: 12px;
}

.division-card p {
    color: var(--medium-gray);
    margin-bottom: 24px;
    line-height: 1.7;
}

.division-card__link {
    font-weight: 600;
    font-family: 'Raleway', sans-serif;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.division-card__link svg {
    width: 16px;
    height: 16px;
    transition: transform var(--transition-fast);
}

.division-card__link:hover svg {
    transform: translateX(4px);
}

/* --- Stats Bar --- */

.stats {
    padding: 48px 0;
    background: var(--primary);
    position: relative;
    overflow: hidden;
}

.stats::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200' viewBox='0 0 200 200'%3E%3Ccircle cx='100' cy='100' r='80' fill='none' stroke='%23ffffff' stroke-width='0.5' opacity='0.06'/%3E%3Ccircle cx='100' cy='100' r='60' fill='none' stroke='%23ffffff' stroke-width='0.5' opacity='0.05'/%3E%3Ccircle cx='100' cy='100' r='40' fill='none' stroke='%23ffffff' stroke-width='0.5' opacity='0.04'/%3E%3Ccircle cx='100' cy='100' r='20' fill='none' stroke='%23ffffff' stroke-width='0.5' opacity='0.03'/%3E%3C/svg%3E");
    background-size: 200px 200px;
    pointer-events: none;
}

.stats::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(195, 202, 144, 0.08) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.stats__grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 32px;
    text-align: center;
    position: relative;
    z-index: 1;
}

.stat {
    color: var(--white);
}

.stat__value {
    font-family: 'Raleway', sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--white);
}

.stat__label {
    font-size: 0.85rem;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* --- Services Grid --- */

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr));
    gap: 24px;
}

.service-card {
    background: var(--white);
    border-radius: 12px;
    padding: 32px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--light-gray);
    transition: all var(--transition-normal);
}

.service-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.service-card__icon {
    width: 48px;
    height: 48px;
    background: rgba(3, 87, 114, 0.08);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    color: var(--secondary);
}

.service-card__icon svg {
    width: 24px;
    height: 24px;
}

.service-card h4 {
    margin-bottom: 8px;
}

.service-card p {
    color: var(--medium-gray);
    font-size: 0.9rem;
    line-height: 1.6;
}

/* --- CTA Section --- */

.cta-section {
    padding: 80px 0;
    background: linear-gradient(135deg, var(--secondary-dark) 0%, var(--secondary) 100%);
    text-align: center;
    color: var(--white);
    position: relative;
    overflow: hidden;
}

.cta-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30 5 L55 30 L30 55 L5 30 Z' fill='none' stroke='%23ffffff' stroke-width='0.6' opacity='0.07'/%3E%3Cpath d='M30 15 L45 30 L30 45 L15 30 Z' fill='none' stroke='%23ffffff' stroke-width='0.4' opacity='0.05'/%3E%3C/svg%3E");
    background-size: 60px 60px;
    pointer-events: none;
}

.cta-section::after {
    content: '';
    position: absolute;
    top: -30%;
    right: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(212, 227, 117, 0.1) 0%, transparent 60%);
    border-radius: 50%;
    pointer-events: none;
}

.cta-section .container {
    position: relative;
    z-index: 1;
}

.cta-section h2 {
    color: var(--white);
    margin-bottom: 16px;
}

.cta-section p {
    color: var(--accent-light);
    font-size: 1.1rem;
    max-width: 500px;
    margin: 0 auto 32px;
}

/* --- Team Grid --- */

.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
    gap: 32px;
}

.team-card {
    background: var(--white);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--light-gray);
    transition: all var(--transition-normal);
}

.team-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.team-card__photo {
    width: 100%;
    aspect-ratio: 1;
    background: linear-gradient(135deg, var(--accent) 0%, var(--primary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    color: var(--white);
    font-family: 'Raleway', sans-serif;
    font-weight: 700;
}

.team-card__info {
    padding: 24px;
    text-align: center;
}

.team-card__info h3 {
    font-size: 1.2rem;
    margin-bottom: 4px;
}

.team-card__info .role {
    color: var(--secondary);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.team-card__info p {
    font-size: 0.9rem;
    color: var(--medium-gray);
}

/* --- Contact Page --- */

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
}

.contact-form {
    background: var(--white);
    border-radius: 16px;
    padding: 40px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--light-gray);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-family: 'Raleway', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 6px;
    color: var(--dark-gray);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--light-gray);
    border-radius: 8px;
    font-family: 'Open Sans', sans-serif;
    font-size: 0.95rem;
    color: var(--dark-gray);
    background: var(--white);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(3, 87, 114, 0.1);
}

.form-group textarea {
    min-height: 140px;
    resize: vertical;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--accent-dark);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-message {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    margin-top: 16px;
    display: none;
}

.form-message--success {
    background: rgba(22, 163, 74, 0.08);
    color: var(--success);
    border: 1px solid rgba(22, 163, 74, 0.2);
    display: block;
}

.form-message--error {
    background: rgba(220, 38, 38, 0.08);
    color: var(--error);
    border: 1px solid rgba(220, 38, 38, 0.2);
    display: block;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.contact-info-card {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.contact-info-card__icon {
    width: 48px;
    height: 48px;
    min-width: 48px;
    background: rgba(3, 87, 114, 0.08);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--secondary);
}

.contact-info-card__icon svg {
    width: 22px;
    height: 22px;
}

.contact-info-card h4 {
    margin-bottom: 4px;
}

.contact-info-card p,
.contact-info-card a {
    color: var(--medium-gray);
    font-size: 0.95rem;
}

.contact-info-card a:hover {
    color: var(--secondary);
}

.contact-map {
    border-radius: 16px;
    overflow: hidden;
    height: 300px;
    border: 1px solid var(--light-gray);
}

.contact-map iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

/* --- Footer --- */

.footer {
    background: var(--near-black);
    color: var(--accent);
    padding: 40px 0 0;
}

.footer__grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.2fr;
    gap: 32px;
    margin-bottom: 24px;
}

.footer__brand p {
    font-size: 0.9rem;
    line-height: 1.7;
    color: var(--accent-dark);
    margin-top: 16px;
}

.footer__socials {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.footer__socials a {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: rgba(255,255,255,0.1);
    color: var(--accent);
    transition: all var(--transition-fast);
}

.footer__socials a:hover {
    background: rgba(255,255,255,0.2);
    color: var(--white);
    transform: translateY(-2px);
}

.footer__socials svg {
    width: 18px;
    height: 18px;
}

.footer h4 {
    color: var(--white);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
}

.footer__links {
    list-style: none;
}

.footer__links li {
    margin-bottom: 10px;
}

.footer__links a {
    color: var(--accent-dark);
    font-size: 0.9rem;
    transition: color var(--transition-fast);
}

.footer__links a:hover {
    color: var(--white);
}

.footer__contact-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 0.85rem;
    line-height: 1.4;
    color: var(--accent-dark);
}

.footer__contact-item svg {
    width: 16px;
    height: 16px;
    min-width: 16px;
    margin-top: 3px;
    color: var(--secondary-light);
}

.footer__contact-item a {
    color: var(--accent-dark);
}

.footer__contact-item a:hover {
    color: var(--white);
}

.footer__bottom {
    border-top: 1px solid rgba(255,255,255,0.08);
    padding: 16px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: var(--accent-dark);
}

/* --- Page Hero (interior pages) --- */

.page-hero {
    padding: 170px 0 60px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary-dark) 100%);
    text-align: center;
    color: var(--white);
    position: relative;
    overflow: hidden;
}

.page-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 20 L20 0 L40 20 L20 40 Z' fill='none' stroke='%23ffffff' stroke-width='0.4' opacity='0.05'/%3E%3C/svg%3E");
    background-size: 40px 40px;
    pointer-events: none;
}

.page-hero::after {
    content: '';
    position: absolute;
    bottom: -60%;
    left: -5%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(195, 202, 144, 0.1) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.page-hero .container {
    position: relative;
    z-index: 1;
}

.page-hero h1 {
    color: var(--white);
    margin-bottom: 12px;
}

.page-hero p {
    color: var(--accent-light);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* --- Services Page Specific --- */

.services-section-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 32px;
}

.services-jumplinks {
    background: var(--off-white);
    border-bottom: 1px solid var(--light-gray);
    padding: 20px 0;
}

.services-jumplinks__group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.services-jumplinks__group:last-child {
    margin-bottom: 0;
}

.services-jumplinks__group strong {
    font-family: 'Raleway', sans-serif;
    font-size: 0.85rem;
    color: var(--primary);
    margin-right: 4px;
}

.services-jumplinks__group a {
    font-size: 0.8rem;
    color: var(--secondary);
    text-decoration: none;
    padding: 4px 10px;
    border-radius: 4px;
    background: var(--white);
    border: 1px solid var(--light-gray);
    transition: all var(--transition-fast);
}

.services-jumplinks__group a:hover {
    background: var(--secondary);
    color: var(--white);
    border-color: var(--secondary);
}

.service-detail-card[id] {
    scroll-margin-top: calc(var(--header-height) + var(--topbar-height) + 16px);
}

.services-section-header__logo {
    max-width: 180px;
    height: auto;
}

.services-section-header__icon {
    width: 56px;
    height: 56px;
    min-width: 56px;
    background: rgba(3, 87, 114, 0.08);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--secondary);
}

.services-section-header__icon svg {
    width: 28px;
    height: 28px;
}

.services-section-header h2 {
    margin-bottom: 0;
}

.services-section-header h2::after {
    display: none;
}

.services-section-header p {
    color: var(--medium-gray);
    margin: 4px 0 0;
    font-size: 0.95rem;
}

.services-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
    gap: 20px;
}

.service-detail-card {
    background: var(--white);
    border-radius: 12px;
    padding: 0;
    border: 1px solid var(--light-gray);
    transition: all var(--transition-normal);
    overflow: hidden;
}

.service-detail-card__img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
}

.service-detail-card__body {
    padding: 24px 28px 28px;
}

.service-detail-card:hover {
    border-color: var(--secondary);
    box-shadow: var(--shadow-sm);
}

.service-detail-card h4 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.service-detail-card h4 svg {
    width: 20px;
    height: 20px;
    color: var(--secondary);
    min-width: 20px;
}

.service-detail-card p {
    color: var(--medium-gray);
    font-size: 0.9rem;
    line-height: 1.6;
}

/* --- Careers Page --- */

.careers-perks {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
    gap: 24px;
}

.perk-card {
    background: var(--white);
    border-radius: 12px;
    padding: 32px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--light-gray);
    text-align: center;
}

.perk-card__icon {
    width: 56px;
    height: 56px;
    background: rgba(3, 87, 114, 0.08);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    color: var(--secondary);
}

.perk-card__icon svg {
    width: 28px;
    height: 28px;
}

.perk-card h4 {
    margin-bottom: 8px;
}

.perk-card p {
    color: var(--medium-gray);
    font-size: 0.9rem;
}

/* --- Hero Title Accent --- */

.hero__title-accent {
    background: linear-gradient(90deg, var(--accent-light) 0%, #7ecbdb 50%, var(--accent-light) 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shimmer 4s ease-in-out infinite;
}

@keyframes shimmer {
    0%, 100% { background-position: 0% center; }
    50% { background-position: 200% center; }
}

/* --- Scroll Animations --- */

.fade-in {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in--visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- Service Card Hover Glow --- */

.service-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 12px;
    opacity: 0;
    transition: opacity var(--transition-normal);
    pointer-events: none;
    box-shadow: 0 0 0 1px var(--secondary), 0 8px 30px rgba(3, 87, 114, 0.12);
}

.service-card {
    position: relative;
}

.service-card:hover::after {
    opacity: 1;
}

/* --- Pulsing Emergency Badge --- */

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(3, 87, 114, 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(3, 87, 114, 0); }
}

.contact-info-card__icon--pulse {
    animation: pulse 2s ease-in-out infinite;
}

/* --- Typing Cursor for Hero --- */

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* --- Admin Panel --- */

.admin-login {
    max-width: 400px;
    margin: 120px auto 60px;
    padding: 40px;
    background: var(--white);
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--light-gray);
}

.admin-login h2 {
    text-align: center;
    margin-bottom: 24px;
}

.admin-dashboard {
    max-width: 1000px;
    margin: 100px auto 60px;
    padding: 0 24px;
}

.admin-dashboard h2 {
    margin-bottom: 24px;
}

.admin-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 32px;
}

.admin-stat-card {
    background: var(--white);
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--light-gray);
    text-align: center;
}

.admin-stat-card .value {
    font-family: 'Raleway', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    color: var(--secondary);
}

.admin-stat-card .label {
    color: var(--medium-gray);
    font-size: 0.85rem;
    margin-top: 4px;
}

.admin-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.contact-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--light-gray);
}

.contact-table th,
.contact-table td {
    padding: 14px 16px;
    text-align: left;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--light-gray);
}

.contact-table th {
    background: var(--off-white);
    font-family: 'Raleway', sans-serif;
    font-weight: 600;
    color: var(--primary);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.contact-table tr.unread {
    background: rgba(3, 87, 114, 0.03);
    font-weight: 600;
}

.contact-table .actions {
    display: flex;
    gap: 8px;
}

.contact-table .actions button {
    padding: 6px 12px;
    border: 1px solid var(--light-gray);
    border-radius: 6px;
    background: var(--white);
    cursor: pointer;
    font-size: 0.8rem;
    transition: all var(--transition-fast);
}

.contact-table .actions button:hover {
    border-color: var(--secondary);
    color: var(--secondary);
}

.contact-table .actions button.delete:hover {
    border-color: var(--error);
    color: var(--error);
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    background: var(--error);
    color: var(--white);
    font-size: 0.7rem;
    font-weight: 700;
}

/* --- Responsive --- */

@media (max-width: 1024px) {
    .footer__grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }

    .container { padding: 0 16px; }

    .section { padding: 48px 0; }

    /* Topbar - compact single line */
    .topbar { font-size: 0.7rem; padding: 4px 0; }
    .topbar__inner { padding: 0 12px; gap: 3px; flex-wrap: nowrap; }
    .topbar__inner > svg { display: none; }
    .topbar__socials { position: static; gap: 10px; margin-left: auto; flex-shrink: 0; }
    .topbar__socials svg { width: 16px; height: 16px; }

    /* Header - shorter on mobile */
    .header { height: 64px; top: 26px; }
    .header--scrolled { height: 56px; }
    .header__logo img { height: 40px; }
    .header--scrolled .header__logo img { height: 34px; }
    .header__logo-text { font-size: 1.1rem; }
    .header__logo-text span { font-size: 0.6rem; }

    /* Mobile nav */
    .hamburger { display: flex; }

    .nav {
        position: fixed;
        top: 0;
        right: -300px;
        width: 300px;
        height: 100vh;
        height: 100dvh;
        background: var(--white);
        flex-direction: column;
        padding: 80px 32px 32px;
        box-shadow: var(--shadow-lg);
        transition: right var(--transition-normal);
        gap: 0;
        align-items: stretch;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .nav--open {
        right: 0;
    }

    .nav__link {
        padding: 14px 0;
        border-bottom: 1px solid var(--light-gray);
        font-size: 1rem;
    }

    .nav__cta {
        margin-left: 0;
        margin-top: 16px;
        text-align: center;
        padding: 14px 32px;
    }

    /* Mobile overlay */
    .nav-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.4);
        z-index: 999;
        opacity: 0;
        pointer-events: none;
        transition: opacity var(--transition-normal);
    }

    .nav-overlay--visible {
        opacity: 1;
        pointer-events: auto;
    }

    /* Hero */
    .hero {
        min-height: auto;
        padding: 100px 0 48px;
    }

    .hero__badge { font-size: 0.7rem; padding: 5px 12px; margin-bottom: 16px; }
    .hero__title { font-size: 2rem; margin-bottom: 14px; }
    .hero__subtitle { font-size: 0.95rem; margin-bottom: 24px; }
    .hero__decoration { display: none; }

    /* About */
    .about__grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .about__image { order: -1; }
    .about__content p { font-size: 0.95rem; }

    /* Divisions */
    .divisions__grid {
        grid-template-columns: 1fr;
    }

    .division-card {
        padding: 28px 20px;
    }

    .division-card__logo { max-width: 160px; }

    .division-card p {
        margin-bottom: 16px;
        font-size: 0.9rem;
    }

    /* Stats */
    .stats { padding: 36px 0; }

    .stats__grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px 16px;
    }

    .stat__value { font-size: 1.75rem; }
    .stat__label { font-size: 0.75rem; }

    /* Services */
    .services-grid {
        grid-template-columns: 1fr;
    }

    .services-detail-grid {
        grid-template-columns: 1fr;
    }

    /* Services section header - stack on mobile */
    .services-section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .services-section-header__logo { max-width: 150px; }

    .services-jumplinks { padding: 14px 0; }

    .services-jumplinks__group {
        gap: 6px;
    }

    .services-jumplinks__group a {
        padding: 8px 14px;
        font-size: 0.82rem;
    }

    /* Contact */
    .contact-grid {
        grid-template-columns: 1fr;
    }

    .contact-form {
        padding: 20px;
    }

    .form-group { margin-bottom: 14px; }

    .form-group label { font-size: 0.85rem; margin-bottom: 4px; }

    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 10px 12px;
        font-size: 0.9rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    /* Page hero - less padding since header is smaller */
    .page-hero { padding: 120px 0 40px; }

    /* Team */
    .team-grid {
        grid-template-columns: 1fr;
    }

    .team-card__photo { aspect-ratio: 16/10; }

    .team-card__info { padding: 16px; }
    .team-card__info p { font-size: 0.85rem; }

    /* Footer */
    .footer { padding: 32px 0 0; }

    .footer__grid {
        grid-template-columns: 1fr 1fr;
        gap: 24px;
    }

    .footer__brand { grid-column: 1 / -1; }
    .footer__brand p { font-size: 0.85rem; margin-top: 12px; }

    .footer h4 { font-size: 0.8rem; margin-bottom: 8px; }

    .footer__links li { margin-bottom: 6px; }
    .footer__links a { font-size: 0.85rem; }

    .footer__contact-item { font-size: 0.8rem; margin-bottom: 6px; }

    .footer__bottom {
        flex-direction: column;
        gap: 6px;
        text-align: center;
        padding: 12px 0;
    }

    /* Admin */
    .admin-login {
        margin: 100px 16px 40px;
        padding: 28px 20px;
    }

    .admin-dashboard {
        margin-top: 80px;
        padding: 0 16px;
    }

    .admin-stats {
        grid-template-columns: 1fr;
    }

    .contact-table {
        font-size: 0.8rem;
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .contact-table th,
    .contact-table td {
        padding: 10px 8px;
        white-space: nowrap;
    }

    /* CTA */
    .cta-section { padding: 48px 0; }
    .cta-section h2 { font-size: 1.5rem; }
    .cta-section p { font-size: 0.95rem; margin-bottom: 24px; }

    /* Buttons - appropriate touch targets */
    .btn {
        padding: 14px 28px;
        font-size: 0.95rem;
    }

    .btn--small {
        padding: 10px 20px;
        font-size: 0.85rem;
    }

    /* Section titles */
    .section-subtitle {
        font-size: 0.95rem;
        margin-bottom: 32px;
    }

    .section-title { margin-bottom: 12px; }
}

@media (max-width: 480px) {
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.4rem; }
    h3 { font-size: 1.15rem; }

    .container { padding: 0 14px; }

    .section { padding: 40px 0; }

    /* Topbar - ultra compact */
    .topbar { font-size: 0.65rem; }
    .topbar__inner { gap: 2px; padding: 0 10px; }

    .hero {
        padding: 90px 0 40px;
    }

    .hero__badge { font-size: 0.65rem; padding: 4px 10px; margin-bottom: 12px; }
    .hero__title { font-size: 1.65rem; }
    .hero__subtitle { font-size: 0.9rem; line-height: 1.6; }

    .hero__actions {
        flex-direction: column;
        gap: 10px;
    }

    .hero__actions .btn {
        width: 100%;
        justify-content: center;
    }

    .about__highlights {
        grid-template-columns: 1fr;
    }

    .about__grid { gap: 24px; }
    .about__content h2 { margin-bottom: 14px; }

    .division-card { padding: 24px 16px; }
    .division-card__logo { max-width: 140px; }

    .stats { padding: 28px 0; }
    .stats__grid { gap: 16px 12px; }
    .stat__value { font-size: 1.5rem; }
    .stat__label { font-size: 0.7rem; letter-spacing: 0.5px; }

    .page-hero {
        padding: 100px 0 32px;
    }

    .page-hero h1 { font-size: 1.5rem; }
    .page-hero p { font-size: 0.95rem; }

    .service-card {
        padding: 20px;
    }

    .perk-card {
        padding: 20px;
    }

    .cta-section { padding: 40px 0; }
    .cta-section h2 { font-size: 1.35rem; }

    /* Footer 1-col on very small */
    .footer__grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .footer__bottom { font-size: 0.75rem; }

    .footer {
        padding: 32px 0 0;
    }
}

/* Back to top button */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: var(--accent);
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 90;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}
.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.back-to-top:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
