/* =========================================================
   Cube Services — main stylesheet
   Tokens are declared in style.css (:root) and inherited here.
   ========================================================= */

body{
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--color-ink);
    background: var(--color-paper);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4{
    font-family: 'Manrope', 'Inter', sans-serif;
    font-weight: 800;
    line-height: 1.15;
    margin: 0 0 .5em;
    color: var(--color-navy);
}
p{ margin: 0 0 1em; }
.container{
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}
.screen-reader-text, .skip-link{
    position: absolute; width: 1px; height: 1px; overflow: hidden;
    clip: rect(1px,1px,1px,1px); white-space: nowrap;
}
.skip-link:focus{
    position: fixed; top: 8px; left: 8px; width: auto; height: auto;
    background: var(--color-purple); color: #fff; padding: 10px 16px;
    border-radius: 6px; z-index: 999; clip: auto;
}
:focus-visible{ outline: 3px solid var(--color-orange); outline-offset: 2px; }

/* -------------------------- Buttons -------------------------- */
.btn{
    display: inline-flex; align-items: center; justify-content: center;
    gap: 8px; padding: 14px 28px; border-radius: 8px;
    font-weight: 700; font-size: 15px; border: 2px solid transparent;
    transition: transform .15s ease, background-color .15s ease, border-color .15s ease;
    cursor: pointer;
}
.btn:hover{ transform: translateY(-1px); }
.btn-sm{ padding: 10px 20px; font-size: 14px; }
.btn-primary{ background: var(--color-purple); color: #fff; }
.btn-primary:hover{ background: var(--color-purple-dark); }
.btn-outline-white{ border-color: rgba(255,255,255,.7); color: #fff; }
.btn-outline-white:hover{ background: rgba(255,255,255,.12); }
.btn-white{ background: #fff; color: var(--color-purple-dark); }
.btn-white:hover{ background: #f0edf7; }

.eyebrow{
    color: var(--color-purple); font-weight: 700; font-size: 13px;
    letter-spacing: .04em; margin-bottom: 8px;
}
.eyebrow-light{ color: rgba(255,255,255,.85); }

/* -------------------------- Header -------------------------- */
.site-header{
    position: sticky; top: 0; z-index: 100;
    background: #fff; border-bottom: 1px solid var(--color-line);
}
.header-inner{
    display: flex; align-items: center; justify-content: space-between;
    height: 76px; gap: 24px;
}
.site-branding .custom-logo{ max-height: 48px; width: auto; }
.site-logo-fallback{ display: flex; align-items: center; gap: 10px; }
.logo-mark{
    width: 34px; height: 34px; border-radius: 6px;
    background: linear-gradient(135deg, var(--color-purple), var(--color-navy));
    display: inline-block;
}
.logo-mark-light{ background: linear-gradient(135deg, #fff, #cfc4e6); }
.logo-text{ font-family: 'Manrope', sans-serif; font-weight: 800; font-size: 15px; letter-spacing: .03em; color: var(--color-navy); line-height: 1.1; }
.logo-text small{ font-weight: 600; font-size: 10px; letter-spacing: .12em; color: var(--color-purple); }

.primary-nav{ flex: 1; display: flex; justify-content: center; }
.nav-menu{ display: flex; gap: 28px; }
.nav-link{ font-weight: 600; font-size: 14.5px; color: var(--color-ink); padding: 8px 2px; position: relative; }
.nav-link:hover{ color: var(--color-purple); }
.nav-menu li.current-menu-item .nav-link{ color: var(--color-purple); }

.menu-toggle{
    display: none; flex-direction: column; gap: 5px; background: none;
    border: none; padding: 8px; cursor: pointer;
}
.menu-toggle-bar{ width: 24px; height: 2px; background: var(--color-navy); border-radius: 2px; }

/* -------------------------- Hero -------------------------- */
.hero{
    position: relative; color: #fff; overflow: hidden;
    background: var(--hero-bg, none) center/cover no-repeat, var(--color-navy);
    min-height: 620px; display: flex; align-items: center;
}
.hero-overlay{
    position: absolute; inset: 0;
    background: linear-gradient(90deg, rgba(20,20,43,.88) 0%, rgba(20,20,43,.55) 45%, rgba(20,20,43,.15) 75%);
}
.hero-inner{ position: relative; z-index: 1; padding-top: 60px; padding-bottom: 60px; margin-left: 0; }
.hero-content{ max-width: 560px; }
.hero-title{ font-size: clamp(34px, 5vw, 52px); margin-bottom: 20px; color: #fff; }
.hero-line{ display: block; }
.hero-accent{ color: #B491E0; }
.hero-subtitle{ font-size: 18px; font-weight: 600; color: #fff; margin-bottom: 18px; }
.hero-bullets{ margin-bottom: 32px; }
.hero-bullets li{ display: flex; align-items: flex-start; gap: 10px; font-size: 14.5px; color: rgba(255,255,255,.9); margin-bottom: 8px; }
.hero-bullets .check{ color: #B491E0; font-weight: 800; }
.hero-actions{ display: flex; flex-wrap: wrap; gap: 14px; }

/* -------------------------- Features strip -------------------------- */
.features-strip{ padding: 56px 0; background: #fff; }
.features-grid{ display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px; text-align: center; }
.feature-icon{
    display: inline-flex; align-items: center; justify-content: center;
    width: 56px; height: 56px; border-radius: 50%; margin-bottom: 16px;
    color: #fff;
}
.feature-icon svg{ width: 26px; height: 26px; }
.icon-purple{ background: var(--color-purple); }
.icon-teal{ background: var(--color-teal); }
.icon-orange{ background: var(--color-orange); }
.icon-green{ background: var(--color-green); }
.feature-item h3{ font-size: 15.5px; margin-bottom: 6px; }
.feature-item p{ font-size: 13.5px; color: #63636f; margin: 0; }

/* -------------------------- Services section -------------------------- */
.services-section{ padding: 72px 0; background: var(--color-mist); }
.section-heading-row{
    display: flex; align-items: flex-end; justify-content: space-between;
    margin-bottom: 40px; gap: 24px;
}
.section-heading-row h2{ font-size: 30px; margin: 0; }
.services-cta-mobile{ display: none; margin-top: 24px; width: 100%; }

.services-grid{ display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.service-card{
    background: #fff; border-radius: 14px; overflow: hidden;
    border: 1px solid var(--color-line); padding-bottom: 24px;
    display: flex; flex-direction: column;
}
.service-card-media{ height: 160px; background: var(--color-line); overflow: hidden; }
.service-card-media img{ width: 100%; height: 100%; object-fit: cover; }
.service-card-media-placeholder{ width: 100%; height: 100%; background: linear-gradient(135deg, #e4e1ec, #d6d1e6); }
.service-icon-badge{
    display: inline-flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; border-radius: 50%; color: #fff;
    margin: -22px 24px 12px; box-shadow: 0 4px 10px rgba(0,0,0,.15);
}
.service-icon-badge svg{ width: 20px; height: 20px; }
.service-card h3{ font-size: 17px; margin: 0 24px 8px; }
.service-card p{ font-size: 14px; color: #63636f; margin: 0 24px 12px; flex: 1; }
.learn-more{ font-weight: 700; color: var(--color-purple); font-size: 14px; margin: 0 24px; }
.learn-more:hover{ text-decoration: underline; }

/* -------------------------- Rebate banner -------------------------- */
.rebate-banner{ position: relative; color: #fff; overflow: hidden; }
.rebate-banner-bg{
    position: absolute; inset: 0;
    background: url('../images/mountain-placeholder.jpg') center/cover no-repeat, var(--color-navy);
}
.rebate-banner::before{
    content: ""; position: absolute; inset: 0;
    background: linear-gradient(90deg, var(--color-purple-dark) 0%, var(--color-purple-dark) 38%, rgba(61,31,99,.15) 70%);
    z-index: 0;
}
.rebate-banner-inner{ position: relative; z-index: 1; padding: 72px 0; max-width: 480px; }
.rebate-banner-inner h2{ color: #fff; font-size: 38px; margin-bottom: 4px; }
.rebate-banner-inner h2 span{ display: block; }
.rebate-sub{ font-weight: 700; text-transform: none; margin-bottom: 16px; }
.rebate-text{ color: rgba(255,255,255,.85); margin-bottom: 24px; font-size: 14.5px; }

/* -------------------------- Why heat pumps -------------------------- */
.why-section{ padding: 72px 0; text-align: center; }
.why-section h2{ font-size: 30px; margin-bottom: 40px; }
.why-grid{ display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px; }
.why-item h3{ font-size: 15.5px; margin-bottom: 6px; }
.why-item p{ font-size: 13.5px; color: #63636f; margin: 0; }

/* -------------------------- Gallery -------------------------- */
.gallery-section{ padding: 72px 0; background: var(--color-mist); }
.gallery-strip{ display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
.gallery-item{ aspect-ratio: 1 / 1; border-radius: 10px; overflow: hidden; }
.gallery-item img{ width: 100%; height: 100%; object-fit: cover; }
.gallery-placeholder{ width: 100%; height: 100%; background: linear-gradient(135deg, #d6d1e6, #b7c9d8); }

/* -------------------------- Testimonials -------------------------- */
.testimonials-section{ padding: 72px 0; }
.testimonials-section h2{ font-size: 30px; margin-bottom: 40px; }
.testimonials-grid{ display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.testimonial-card{ background: #fff; border: 1px solid var(--color-line); border-radius: 14px; padding: 28px; }
.stars{ margin-bottom: 12px; }
.star{ color: #E0A93A; font-size: 16px; }
.star-empty{ color: #ddd; }
.testimonial-text{ font-size: 14.5px; color: #444; margin-bottom: 20px; }
.testimonial-author{ display: flex; align-items: center; gap: 10px; }
.testimonial-author img, .avatar-placeholder{
    width: 40px; height: 40px; border-radius: 50%; object-fit: cover;
    background: linear-gradient(135deg, var(--color-purple), var(--color-teal));
}
.testimonial-author strong{ display: block; font-size: 14px; }
.testimonial-author span{ font-size: 12.5px; color: #888; }

/* -------------------------- Final CTA -------------------------- */
.final-cta{
    background: linear-gradient(120deg, var(--color-purple-dark), var(--color-navy));
    color: #fff; text-align: center; padding: 56px 0;
}
.final-cta h2{ color: #fff; font-size: 26px; margin-bottom: 6px; }
.final-cta p{ color: rgba(255,255,255,.8); margin-bottom: 24px; }
.final-cta-actions{ display: flex; justify-content: center; gap: 16px; flex-wrap: wrap; }

/* -------------------------- Footer -------------------------- */
.site-footer{ background: var(--color-navy); color: rgba(255,255,255,.75); padding-top: 56px; }
.footer-grid{ display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; padding-bottom: 40px; }
.footer-logo{ display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.footer-logo .logo-text{ color: #fff; }
.footer-brand p{ font-size: 13.5px; }
.footer-col h4{ color: #fff; font-size: 14px; margin-bottom: 14px; }
.footer-menu li, .footer-col p{ font-size: 13.5px; margin-bottom: 8px; }
.footer-menu a:hover{ color: #fff; }
.footer-badges{ color: rgba(255,255,255,.6); font-size: 12.5px; }
.social-links{ display: flex; gap: 10px; margin-top: 10px; }
.social-links a{
    width: 30px; height: 30px; border-radius: 50%; background: rgba(255,255,255,.08);
    display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700;
}
.footer-bottom{ border-top: 1px solid rgba(255,255,255,.1); padding: 18px 0; text-align: center; font-size: 12.5px; }

/* -------------------------- Generic page templates -------------------------- */
.page-header{ background: var(--color-mist); padding: 40px 0; }
.page-header h1{ font-size: 32px; margin: 8px 0 0; }
.breadcrumb{ font-size: 13px; color: #888; }
.breadcrumb a{ color: var(--color-purple); }
.page-container{ padding: 48px 0 72px; }
.page-featured-image{ margin-bottom: 32px; border-radius: 14px; overflow: hidden; }
.entry-content{ max-width: 780px; font-size: 16px; }
.entry-content h2{ font-size: 24px; margin-top: 1.4em; }
.entry-content img{ border-radius: 10px; }

.contact-layout{ display: grid; grid-template-columns: 1.6fr 1fr; gap: 48px; align-items: start; }
.cube-fallback-form{ display: flex; flex-direction: column; gap: 14px; max-width: 520px; margin-top: 24px; }
.cube-fallback-form input, .cube-fallback-form textarea{
    padding: 12px 14px; border: 1px solid var(--color-line); border-radius: 8px; font-size: 14px;
}
.cube-form-note{ font-size: 12.5px; color: #999; }
.contact-info-col{ background: var(--color-mist); border-radius: 14px; padding: 28px; }
.contact-info-col h3{ font-size: 17px; }
.contact-info-col a{ color: var(--color-purple); font-weight: 600; }

.service-cta-box{
    margin-top: 40px; padding: 32px; background: var(--color-mist);
    border-radius: 14px; text-align: center;
}
.page-header-service .service-icon-badge{ margin: 0 0 12px; }

.post-list{ display: grid; gap: 32px; }
.post-card{ display: grid; grid-template-columns: 260px 1fr; gap: 24px; }
.post-card-media img{ border-radius: 10px; }
.post-meta{ font-size: 12.5px; color: #999; }
.pagination{ margin-top: 32px; }

.error-404{ text-align: center; padding: 96px 0; }

/* -------------------------- Responsive -------------------------- */
@media (max-width: 1024px){
    .services-grid, .features-grid, .why-grid{ grid-template-columns: repeat(2, 1fr); }
    .testimonials-grid{ grid-template-columns: 1fr; }
    .gallery-strip{ grid-template-columns: repeat(3, 1fr); }
    .footer-grid{ grid-template-columns: 1fr 1fr; }
    .contact-layout{ grid-template-columns: 1fr; }
    .post-card{ grid-template-columns: 1fr; }
}

@media (max-width: 782px){
    .primary-nav{
        position: fixed; top: 76px; left: 0; right: 0; bottom: 0;
        background: #fff; transform: translateX(100%); transition: transform .25s ease;
        padding: 24px; overflow-y: auto; z-index: 99;
    }
    .primary-nav.is-open{ transform: translateX(0); }
    .nav-menu{ flex-direction: column; gap: 4px; }
    .nav-link{ display: block; padding: 14px 4px; border-bottom: 1px solid var(--color-line); }
    .menu-toggle{ display: flex; }
    .header-cta{ display: none; }

    .hero{ min-height: auto; text-align: left; }
    .hero-inner{ padding-top: 40px; padding-bottom: 40px; }
    .hero-title{ font-size: 32px; }

    .features-grid, .why-grid, .services-grid{ grid-template-columns: 1fr; }
    .section-heading-row{ flex-direction: column; align-items: flex-start; }
    .services-cta-desktop{ display: none; }
    .services-cta-mobile{ display: inline-flex; }
    .gallery-strip{ grid-template-columns: repeat(2, 1fr); }
    .footer-grid{ grid-template-columns: 1fr; text-align: left; }
    .rebate-banner-inner{ padding: 48px 0; }
    .final-cta-actions{ flex-direction: column; }
    .final-cta-actions .btn{ width: 100%; }
}

@media (max-width: 480px){
    .hero-title{ font-size: 28px; }
    .container{ padding: 0 18px; }
}

/* -------------------------- Scroll reveal animations -------------------------- */
/* Elements only start hidden once JS has confirmed it can run (html.js-animate),
   so content is never hidden for no-JS visitors or if the observer fails to load. */
.js-animate .animate-on-scroll{
    opacity: 0;
    transform: translateY(28px);
    transition: opacity .7s cubic-bezier(.2,.7,.2,1), transform .7s cubic-bezier(.2,.7,.2,1);
    transition-delay: var(--reveal-delay, 0ms);
    will-change: opacity, transform;
}
.js-animate .animate-on-scroll.in-view{
    opacity: 1;
    transform: none;
}
.js-animate .animate-fade{ transform: none; }
.js-animate .animate-fade.in-view{ opacity: 1; }
.js-animate .animate-fade:not(.in-view){ opacity: 0; }

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce){
    *{ animation: none !important; transition: none !important; }
    .js-animate .animate-on-scroll{ opacity: 1 !important; transform: none !important; }
}
