/* ══════════════════════════════════════════
   home.css — Homepage-Specific Styles
   Used exclusively by index.php.

   Sections:
   1.  Hero
   2.  Buttons
   3.  Stats Bar
   4.  Section Utilities
   5.  Why Choose Us
   6.  About Dark Band
   7.  About Canvas & Controls
   8.  Services
   9.  CTA Band
   10. Hero Entrance Animations
   11. Scroll Reveal
   12. Responsive
══════════════════════════════════════════ */


/* ══════════════════════════════════════════
   1. HERO
══════════════════════════════════════════ */
.m-hero {
    min-height: 100vh;
    background: var(--dark);
    background-image: url('../images/hero-home.jpg');
    background-attachment: fixed;
    background-size: cover;
    background-position: center 30%;
    position: relative;
    display: flex;
    align-items: flex-end;
    padding: 0 0 80px;
    overflow: hidden;
}

/* Dark gradient overlay */
.m-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        160deg,
        rgba(9, 14, 18, 0.82) 0%,
        rgba(9, 14, 18, 0.55) 50%,
        rgba(9, 14, 18, 0.92) 100%
    );
}
/* Small eyebrow label above headline */
.m-hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--teal);
    margin-bottom: 24px;
}

.m-hero-eyebrow::before {
    content: '';
    display: block;
    width: 32px;
    height: 1px;
    background: var(--teal);
    opacity: 0.7;
}

/* Decorative teal glow (bottom-left) */
.m-hero::after {
    content: '';
    position: absolute;
    bottom: -120px;
    left: -80px;
    width: 480px;
    height: 480px;
    background: radial-gradient(circle, rgba(0, 176, 240, 0.18) 0%, transparent 65%);
    pointer-events: none;
}

.m-hero-inner {
    position: relative;
    z-index: 2;
    width: 100%;
}

.m-hero h1 {
    font-size: clamp(2.8rem, 6vw, 5.4rem);
    font-weight: 800;
    line-height: 1.02;
    color: #fff;
    margin: 0 0 28px;
    letter-spacing: -0.02em;
    max-width: 780px;
}

.m-hero h1 em {
    font-style: normal;
    color: var(--teal);
}

.m-hero-sub {
    font-size: 1.05rem;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.6);
    max-width: 480px;
    line-height: 1.7;
    margin-bottom: 44px;
}

.m-hero-cta {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    align-items: center;
}


/* ══════════════════════════════════════════
   2. BUTTONS
══════════════════════════════════════════ */

/* ── Filled teal button ── */
.btn-primary-m {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--teal);
    color: #fff;
    font-family: var(--font-heading);
    font-size: 0.88rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 14px 30px;
    border-radius: 4px;
    text-decoration: none;
    transition: background 0.2s, transform 0.2s;
}

.btn-primary-m:hover {
    background: var(--teal2);
    transform: translateY(-2px);
    color: #fff;
    text-decoration: none;
}

/* ── Ghost / outline button ── */
.btn-ghost-m {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
    font-family: var(--font-heading);
    font-size: 0.88rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 14px 30px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    text-decoration: none;
    transition: border-color 0.2s, color 0.2s, transform 0.2s;
}

.btn-ghost-m:hover {
    border-color: var(--teal);
    color: var(--teal);
    transform: translateY(-2px);
    text-decoration: none;
}


/* ══════════════════════════════════════════
   3. STATS BAR
   Dark strip below hero with 3 headline figures
══════════════════════════════════════════ */
.m-statsbar {
    background: var(--dark2);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 36px 0;
}

.m-statsbar-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
}

.m-stat {
    text-align: center;
    padding: 0 24px;
    position: relative;
}

/* Vertical divider between stats */
.m-stat + .m-stat::before {
    content: '';
    position: absolute;
    left: 0;
    top: 15%;
    height: 70%;
    width: 1px;
    background: var(--border);
}

.m-stat-num {
    font-family: var(--font-heading);
    font-size: 2.6rem;
    font-weight: 800;
    color: var(--teal);
    line-height: 1;
    display: block;
    letter-spacing: -0.02em;
}

.m-stat-label {
    font-size: 0.78rem;
    color: var(--muted);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-top: 6px;
    display: block;
}


/* ══════════════════════════════════════════
   4. SECTION UTILITIES
   Shared heading/label/text styles used across
   multiple homepage sections
══════════════════════════════════════════ */

/* Small uppercase label with leading dash */
.m-section-label {
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--teal);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.m-section-label::before {
    content: '';
    display: block;
    width: 24px;
    height: 1.5px;
    background: var(--teal);
}

.m-section-title {
    font-family: var(--font-heading);
    font-size: clamp(2rem, 4vw, 3.1rem);
    font-weight: 800;
    line-height: 1.08;
    color: var(--dark2);
    letter-spacing: -0.02em;
    margin: 0 0 20px;
}

.m-section-title em {
    font-style: normal;
    color: var(--teal);
}

.m-section-desc {
    font-size: 1rem;
    color: #4a6070;
    line-height: 1.75;
    max-width: 460px;
    margin-bottom: 32px;
}


/* ══════════════════════════════════════════
   5. WHY CHOOSE US
   Light-background two-column section
══════════════════════════════════════════ */
.m-why {
    background: #f4f6f8;
    padding: 100px 0;
}

/* Two columns: text | 2×2 cards */
.m-why-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
    margin-top: 64px;
}

.m-why-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* ── Feature Card ── */
.m-card {
    background: #fff;
    border-radius: 12px;
    padding: 28px 24px;
    border: 1px solid rgba(18, 44, 52, 0.07);
    transition: transform 0.25s, box-shadow 0.25s;
    position: relative;
    overflow: hidden;
}

/* Teal left-border reveal on hover */
.m-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 0;
    background: var(--teal);
    border-radius: 2px;
    transition: height 0.3s;
}

.m-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 36px rgba(18, 44, 52, 0.1);
}

.m-card:hover::before {
    height: 100%;
}

.m-card-icon {
    width: 44px;
    height: 44px;
    background: rgba(0, 176, 240, 0.1);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    color: var(--teal);
    font-size: 1.3rem;
}

.m-card h4 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--dark2);
    margin: 0 0 8px;
    line-height: 1.25;
}

.m-card p {
    font-size: 0.84rem;
    color: #5a6e7c;
    line-height: 1.65;
    margin: 0;
}


/* ══════════════════════════════════════════
   6. ABOUT DARK BAND
   Full-width dark section housing the canvas animation
══════════════════════════════════════════ */
.m-about {
    background: var(--dark);
    padding: 100px 0;
    position: relative;
    overflow: hidden;
}

/* Decorative teal glow (top-right) */
.m-about::after {
    content: '';
    position: absolute;
    top: -150px;
    right: -150px;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(0, 176, 240, 0.1) 0%, transparent 60%);
    pointer-events: none;
}

/* Two columns: canvas | text */
.m-about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 64px;
    align-items: center;
    position: relative;
    z-index: 1;
}

/* Text colour overrides for dark background */
.m-about .m-section-title { color: #fff; }
.m-about .m-section-desc  { color: rgba(255, 255, 255, 0.5); }


/* ══════════════════════════════════════════
   7. ABOUT CANVAS & CONTROLS
   Interactive phase-diagram visualisation
══════════════════════════════════════════ */

/* Canvas wrapper card */
.m-canvas-wrap {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    background: #07161d;
    box-shadow:
        0 0 0 1px rgba(0, 176, 240, 0.2),
        0 20px 60px rgba(0, 176, 240, 0.12);
    aspect-ratio: 4 / 3;
}

#aboutCanvas {
    display: block;
    width: 100%;
    height: 100%;
}

/* Phase label chips overlaid on the canvas */
.phase-badge {
    position: absolute;
    top: 12px;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 3px 10px;
    border-radius: 20px;
    pointer-events: none;
    z-index: 2;
}

.phase-gas      { left: 12px;  background: rgba(0, 176, 240, 0.15); color: #4dd8ff;  border: 1px solid rgba(0, 176, 240, 0.3); }
.phase-liquid   { left: 50%;   transform: translateX(-50%); background: rgba(0, 200, 140, 0.15); color: #2fe8b0;  border: 1px solid rgba(0, 200, 140, 0.3); }
.phase-critical { right: 12px; background: rgba(255, 145, 50, 0.15); color: #ffaa55; border: 1px solid rgba(255, 145, 50, 0.3); }

/* Controls bar below canvas */
.about-controls {
    padding: 12px 18px 14px;
    background: rgba(0, 0, 0, 0.4);
    border-top: 1px solid rgba(0, 176, 240, 0.15);
}

.about-ctrl-label {
    font-size: 0.7rem;
    color: var(--teal);
    font-weight: 600;
    letter-spacing: 0.1em;
    display: block;
    margin-bottom: 7px;
}

/* Custom range slider */
.about-slider {
    -webkit-appearance: none;
    width: 100%;
    height: 4px;
    border-radius: 4px;
    background: linear-gradient(to right, #00b0f0 50%, rgba(255, 255, 255, 0.15) 50%);
    outline: none;
    margin-bottom: 5px;
    cursor: pointer;
}

.about-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: #00b0f0;
    box-shadow: 0 0 7px rgba(0, 176, 240, 0.7);
    cursor: pointer;
}

.about-ctrl-hint {
    font-size: 0.6rem;
    color: rgba(255, 255, 255, 0.3);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

#aboutPhaseLabel {
    color: rgba(255, 255, 255, 0.55);
    font-weight: 600;
}


/* ══════════════════════════════════════════
   8. SERVICES
   Three-card grid on a light background
══════════════════════════════════════════ */
.m-services {
    padding: 100px 0;
    background: #f4f6f8;
}

/* Header row: title left, "view all" link right */
.m-services-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 60px;
    gap: 32px;
    flex-wrap: wrap;
}

.m-services-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

/* ── Service Card ── */
.m-svc-card {
    background: #fff;
    border-radius: 12px;
    padding: 40px 32px;
    border: 1px solid rgba(18, 44, 52, 0.07);
    transition: transform 0.25s, box-shadow 0.25s;
    display: flex;
    flex-direction: column;
}

.m-svc-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 48px rgba(18, 44, 52, 0.1);
}

.m-svc-num {
    font-family: var(--font-heading);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    color: var(--teal);
    margin-bottom: 20px;
}

.m-svc-icon {
    font-size: 1.8rem;
    color: var(--teal);
    margin-bottom: 20px;
    line-height: 1;
}

.m-svc-card h5 {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--dark2);
    margin: 0 0 12px;
}

.m-svc-card p {
    font-size: 0.87rem;
    color: #5a6e7c;
    line-height: 1.7;
    flex: 1;
    margin: 0 0 24px;
}

.m-svc-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-heading);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--teal);
    text-decoration: none;
    transition: gap 0.2s;
}

.m-svc-link:hover {
    gap: 12px;
    color: var(--teal);
    text-decoration: none;
}


/* ══════════════════════════════════════════
   9. CTA BAND
   Dark image band at bottom of homepage
══════════════════════════════════════════ */
.m-cta {
    background: var(--mid);
    background-image: url('../images/hero-home.jpg');
    background-size: cover;
    background-attachment: fixed;
    background-position: center;
    padding: 100px 0;
    position: relative;
    overflow: hidden;
}

/* Overlay for text legibility */
.m-cta::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(13, 23, 32, 0.88);
}

/* Flex row: headline left, button right */
.m-cta-inner {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 48px;
    flex-wrap: wrap;
}

.m-cta h2 {
    font-family: var(--font-heading);
    font-size: clamp(1.8rem, 3.5vw, 2.8rem);
    font-weight: 800;
    color: #fff;
    max-width: 560px;
    line-height: 1.15;
    letter-spacing: -0.02em;
    margin: 0;
}

.m-cta h2 em {
    font-style: normal;
    color: var(--teal);
}


/* ══════════════════════════════════════════
   10. HERO ENTRANCE ANIMATIONS
   Each hero element fades up in sequence
══════════════════════════════════════════ */
@keyframes mFadeUp {
    from { opacity: 0; transform: translateY(22px); }
    to   { opacity: 1; transform: translateY(0);    }
}

.m-hero h1      { opacity: 0; animation: mFadeUp 0.7s 0.4s ease forwards; }
.m-hero-sub     { opacity: 0; animation: mFadeUp 0.7s 0.6s ease forwards; }
.m-hero-cta     { opacity: 0; animation: mFadeUp 0.7s 0.8s ease forwards; }


/* ══════════════════════════════════════════
   11. SCROLL REVEAL
   Hidden state is declared here in CSS so
   elements are invisible from the very first
   paint. JS (home.js) never injects these
   styles — it only adds .sr-visible to trigger
   the reveal. This eliminates flash/jump on load.
══════════════════════════════════════════ */

/* Sections — fade up as a whole */
.m-statsbar,
.m-why,
.m-about,
.m-services,
.m-cta {
    opacity: 0;
    transform: translateY(32px);
    transition: opacity 0.65s cubic-bezier(0.22, 1, 0.36, 1),
                transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: opacity, transform;
}

/* Cards — slightly snappier */
.m-card,
.m-svc-card,
.m-stat {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s cubic-bezier(0.22, 1, 0.36, 1),
                transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: opacity, transform;
}

/* Stagger cards within their grid containers */
.m-why-cards .m-card:nth-child(2) { transition-delay: 80ms;  }
.m-why-cards .m-card:nth-child(3) { transition-delay: 160ms; }
.m-why-cards .m-card:nth-child(4) { transition-delay: 240ms; }

.m-services-grid .m-svc-card:nth-child(2) { transition-delay: 100ms; }
.m-services-grid .m-svc-card:nth-child(3) { transition-delay: 200ms; }

.m-statsbar-grid .m-stat:nth-child(2) { transition-delay: 100ms; }
.m-statsbar-grid .m-stat:nth-child(3) { transition-delay: 200ms; }

/* Revealed state — added by JS IntersectionObserver */
.m-statsbar.sr-visible,
.m-why.sr-visible,
.m-about.sr-visible,
.m-services.sr-visible,
.m-cta.sr-visible,
.m-card.sr-visible,
.m-svc-card.sr-visible,
.m-stat.sr-visible {
    opacity: 1;
    transform: translateY(0);
}


/* ══════════════════════════════════════════
   12. RESPONSIVE
══════════════════════════════════════════ */
@media (max-width: 991px) {
    /* Stack two-column layouts */
    .m-why-grid,
    .m-about-grid         { grid-template-columns: 1fr; gap: 48px; }

    /* Two-column services on tablet */
    .m-services-grid      { grid-template-columns: 1fr 1fr; }

    /* Stats stacked vertically */
    .m-statsbar-grid      { grid-template-columns: 1fr; gap: 28px; }
    .m-stat + .m-stat::before { display: none; }

    /* Stack services header */
    .m-services-header    { flex-direction: column; align-items: flex-start; }

    /* Stack CTA */
    .m-cta-inner          { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 600px) {
    /* Single column on mobile */
    .m-services-grid { grid-template-columns: 1fr; }
    .m-why-cards     { grid-template-columns: 1fr; }
    .m-hero          { padding-bottom: 60px; }
}