/* ==========================================================================
   M&M Insulation Ltd — homepage (index.html)
   Loaded in addition to style.css.
   Concept: a technical roof cross-section. Left = what is taken out (dashed),
   right = what is fitted (solid brass). The numbered key and the service list
   below share the same numbers and highlight the matching part of the drawing.
   ========================================================================== */

/* Hero ------------------------------------------------------------------------- */
.home-hero{background:var(--ink);color:#fff;position:relative;}
.home-hero::before{
  content:"";position:absolute;inset:0;pointer-events:none;
  background:
    radial-gradient(900px 520px at 88% 8%,rgba(200,146,63,.15),transparent 62%),
    radial-gradient(700px 420px at -4% 100%,rgba(200,146,63,.07),transparent 62%);
}
.home-hero .wrap{
  position:relative;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,.98fr);
  column-gap:clamp(2rem,5vw,5rem);align-items:center;
  padding-block:clamp(2.5rem,5vw,4.5rem) clamp(4.75rem,8vw,7.5rem);
}
.home-hero h1{
  color:#fff;font-size:clamp(2.45rem,2.3vw + 1.6rem,4.05rem);line-height:1.03;letter-spacing:-.018em;
  max-width:13ch;margin-bottom:.42em;
}
.home-hero h1 em{font-style:normal;color:var(--accent-on-dark);}
.home-hero .hero-eyebrow-pill{margin-bottom:1.3rem;}
.home-hero .lede{color:rgba(255,255,255,.86);max-width:46ch;margin-bottom:1.9rem;}
.home-hero .hero-ctas{margin-bottom:2rem;}
.home-hero__ticks{display:flex;flex-wrap:wrap;gap:.55rem 1.8rem;}
.home-hero__ticks li{font-size:.9rem;}

/* The drawing */
.roof-wrap{width:100%;max-width:580px;justify-self:end;}
.roof{position:relative;}
.roof-svg{width:100%;height:auto;display:block;overflow:visible;}

.rs-frame{stroke:rgba(255,255,255,.8);stroke-width:1.8;}
.rs-fine{stroke:rgba(255,255,255,.3);stroke-width:1;}
.rs-dotted{stroke-dasharray:2 7;}

/* line-by-line draw-in on load */
.draw{stroke-dasharray:1;stroke-dashoffset:1;animation:rs-draw 1.5s var(--ease-out) both;animation-delay:var(--d,0s);}
@keyframes rs-draw{from{stroke-dashoffset:1;}to{stroke-dashoffset:0;}}
.zone{animation:rs-fade .9s ease both;}
.z1{animation-delay:1.1s;}.z2{animation-delay:1.25s;}.z3{animation-delay:1.4s;}.z4{animation-delay:1.55s;}
@keyframes rs-fade{from{opacity:0;}to{opacity:1;}}

.rs-removed{stroke:rgba(255,255,255,.85);stroke-width:1.6;stroke-dasharray:5 4;fill:rgba(255,255,255,.09);}
.rs-wool{stroke:rgba(255,255,255,.5);stroke-width:1;fill:none;stroke-linecap:round;}
.rs-foil{stroke:var(--accent-on-dark);stroke-width:1.7;fill:none;stroke-linecap:round;}
.rs-foil-x{stroke:var(--accent-on-dark);stroke-width:1;opacity:.65;fill:none;stroke-linecap:round;}
.rs-batts rect{fill:rgba(233,194,124,.14);stroke:var(--accent-on-dark);stroke-width:1.5;}
.rs-hatch{stroke:var(--accent-on-dark);stroke-width:1;opacity:.55;fill:none;}
.zone > *{transition:opacity .25s ease,stroke-width .25s ease,fill .25s ease;}

/* Hover/focus on a number, key item or service row lights up that part of the drawing
   and quietens the rest. Progressive enhancement: needs :has(), harmless without it. */
.home-hero:has([data-zone="1"]:is(:hover,:focus-visible)) .zone:not(.z1) > *,
.home-hero:has([data-zone="2"]:is(:hover,:focus-visible)) .zone:not(.z2) > *,
.home-hero:has([data-zone="3"]:is(:hover,:focus-visible)) .zone:not(.z3) > *,
.home-hero:has([data-zone="4"]:is(:hover,:focus-visible)) .zone:not(.z4) > *{opacity:.28;}
.home-hero:has([data-zone="1"]:is(:hover,:focus-visible)) .z1 .rs-removed,
.home-hero:has([data-zone="2"]:is(:hover,:focus-visible)) .z2 .rs-removed{stroke:#fff;stroke-width:2.2;fill:rgba(233,194,124,.2);}
.home-hero:has([data-zone="3"]:is(:hover,:focus-visible)) .z3 .rs-foil{stroke-width:2.8;}
.home-hero:has([data-zone="4"]:is(:hover,:focus-visible)) .z4 .rs-batts rect{fill:rgba(233,194,124,.34);}

/* numbered markers on the drawing (mouse/touch shortcuts; the key below is the accessible list) */
.hot{
  position:absolute;width:30px;height:30px;margin:-15px 0 0 -15px;border-radius:50%;
  background:var(--accent);color:var(--on-accent);display:grid;place-items:center;
  font:700 .82rem/1 'Public Sans',sans-serif;box-shadow:0 2px 10px rgba(0,0,0,.35);
  transition:transform var(--dur-fast) var(--ease-out);
}
.hot span{position:relative;z-index:1;}
.hot::after{
  content:"";position:absolute;inset:0;border-radius:50%;border:2px solid var(--accent-on-dark);
  animation:hot-ring 2.8s ease-out infinite;animation-delay:calc(var(--i,0) * .45s + 2s);opacity:0;
}
.hot:hover{transform:scale(1.14);}
@keyframes hot-ring{0%{transform:scale(1);opacity:.75;}100%{transform:scale(2);opacity:0;}}

/* key under the drawing: left column = removal (dashed rule), right = installation (solid rule) */
.roof-key{display:grid;grid-template-columns:1fr 1fr;gap:0 clamp(1rem,3vw,2rem);margin-top:1.4rem;}
.roof-key__title{
  display:flex;align-items:center;gap:.7rem;margin:0 0 .35rem;max-width:none;
  font:700 .72rem/1 'Public Sans',sans-serif;letter-spacing:.13em;text-transform:uppercase;color:var(--accent-on-dark);
}
.roof-key__title::after{content:"";flex:1;border-top:1.5px dashed rgba(255,255,255,.55);}
.roof-key__col--in .roof-key__title::after{border-top:2px solid var(--accent-on-dark);}
.roof-key a{
  display:flex;align-items:center;gap:.75rem;min-height:46px;border-top:1px solid var(--line-on-dark);
  color:#fff;font-weight:600;font-size:.94rem;line-height:1.25;transition:color var(--dur-fast);
}
.roof-key a b{
  flex:none;width:1.7rem;height:1.7rem;border-radius:50%;display:grid;place-items:center;
  background:rgba(233,194,124,.16);color:var(--accent-on-dark);font-size:.78rem;font-weight:700;
  transition:background var(--dur-fast),color var(--dur-fast);
}
.roof-key a:hover{color:var(--accent-on-dark);}
.roof-key a:hover b{background:var(--accent);color:var(--on-accent);}
.roof-note{margin:.9rem 0 0;max-width:none;font-size:.76rem;color:rgba(255,255,255,.55);}

@media (max-width:960px){
  .home-hero .wrap{grid-template-columns:1fr;row-gap:2.75rem;}
  .home-hero h1{max-width:16ch;}
  .roof-wrap{justify-self:center;max-width:540px;}
}
@media (max-width:480px){
  .roof-key{grid-template-columns:1fr;}
  .roof-key__col + .roof-key__col{margin-top:.9rem;}
  .hot{width:26px;height:26px;margin:-13px 0 0 -13px;font-size:.74rem;}
}

/* Statement band with the job photos --------------------------------------------------- */
.band{background:var(--ink);color:#fff;position:relative;overflow:hidden;}
.band::before{
  content:"";position:absolute;inset:0;pointer-events:none;
  background:radial-gradient(800px 420px at 8% 110%,rgba(200,146,63,.13),transparent 62%);
}
.band .wrap{
  position:relative;display:grid;grid-template-columns:minmax(0,.8fr) minmax(0,1.2fr);
  column-gap:clamp(2rem,5vw,5rem);align-items:center;padding-block:clamp(3.5rem,7vw,6rem);
}
.band .eyebrow{color:var(--accent-on-dark);}
.band h2{color:#fff;font-size:clamp(2.3rem,2.6vw + 1.3rem,3.9rem);line-height:1.03;letter-spacing:-.015em;max-width:11ch;margin-bottom:.4em;}
.band p{color:rgba(255,255,255,.84);max-width:40ch;margin-bottom:1.75rem;}
.band__photos{
  display:grid;grid-template-columns:minmax(0,1.08fr) minmax(0,.92fr);grid-template-rows:auto auto;
  grid-template-areas:"tall wide" "tall sq";gap:.8rem;
}
.band__ph{position:relative;margin:0;overflow:hidden;border:1px solid var(--line-on-dark);border-radius:var(--radius-s);background:var(--ink-deep);}
.band__ph img{display:block;width:100%;height:100%;object-fit:cover;}
.band__ph--tall{grid-area:tall;}
.band__ph--wide{grid-area:wide;aspect-ratio:4/3;}
.band__ph--sq{grid-area:sq;aspect-ratio:4/3;}
.band__ph figcaption{
  position:absolute;left:0;right:0;bottom:0;padding:1.6rem .85rem .6rem;font-size:.68rem;font-weight:700;letter-spacing:.06em;
  text-transform:uppercase;line-height:1.3;color:#fff;background:linear-gradient(0deg,rgba(15,22,38,.82),transparent);
}
@media (max-width:860px){
  .band .wrap{grid-template-columns:1fr;row-gap:2.5rem;}
  .band h2{max-width:none;}
  .band__photos{grid-template-columns:repeat(2,minmax(0,1fr));grid-template-areas:"wide wide" "tall sq";}
  .band__ph--wide{aspect-ratio:16/10;}
  .band__ph--tall,.band__ph--sq{aspect-ratio:3/4;}
}

/* Final call band: the phone number is the headline ---------------------------------------------- */
.callband{background:var(--ink-deep);color:#fff;position:relative;overflow:hidden;}
.callband::before{
  content:"";position:absolute;inset:0;pointer-events:none;
  background:radial-gradient(900px 440px at 92% 0%,rgba(200,146,63,.16),transparent 62%);
}
.callband .wrap{
  position:relative;display:grid;grid-template-columns:minmax(0,1.25fr) minmax(0,.75fr);
  gap:2rem clamp(2rem,5vw,5rem);align-items:end;padding-block:clamp(3.5rem,7vw,6rem);
}
.callband .eyebrow{color:var(--accent-on-dark);}
.callband h2{color:#fff;font-size:clamp(2.2rem,2.4vw + 1.3rem,3.6rem);line-height:1.04;margin:0 0 .35em;}
.call-big{
  display:inline-block;font-family:'Zilla Slab',Georgia,serif;font-weight:700;line-height:1.05;letter-spacing:-.01em;
  font-size:clamp(2.2rem,4.6vw + .4rem,4.6rem);color:var(--accent-on-dark);
  border-bottom:3px solid rgba(233,194,124,.4);transition:border-color var(--dur-fast),color var(--dur-fast);
}
.call-big:hover{border-color:var(--accent-on-dark);color:#fff;}
.callband__side p{color:rgba(255,255,255,.82);max-width:34ch;margin-bottom:1.4rem;}
@media (max-width:860px){.callband .wrap{grid-template-columns:1fr;align-items:start;}}

/* Reviews (snippets/reviews.html): placeholder cards until real reviews are supplied ------------------- */
.reviews{background:#fff;}
.review{
  position:relative;display:flex;flex-direction:column;margin:0;
  background:var(--fog);border:1px solid var(--border);border-top:4px solid var(--accent);border-radius:var(--radius-m);
  padding:clamp(1.5rem,2.6vw,2.2rem);
}
.review__mark{width:34px;height:auto;margin-bottom:1.1rem;fill:var(--accent);opacity:.9;}
.review__text{
  flex:1;margin:0 0 1.6rem;font-family:'Zilla Slab',Georgia,serif;font-size:clamp(1.05rem,.4vw + 1rem,1.25rem);
  line-height:1.4;color:var(--ink);
}
.review__who{display:flex;align-items:center;gap:.9rem;padding-top:1.2rem;border-top:1px solid var(--border);font-size:.92rem;line-height:1.45;}
.review__who strong{display:block;color:var(--ink);}
.review__meta{display:block;color:var(--slate);}
.review__avatar{
  flex:none;display:grid;place-items:center;width:46px;height:46px;border-radius:50%;
  background:var(--ink);color:var(--accent-on-dark);font:700 1.15rem/1 'Zilla Slab',Georgia,serif;
}
.reviews__source{margin:clamp(1.5rem,3vw,2.2rem) 0 0;max-width:none;font-size:.9rem;color:var(--slate);}

/* Services pointer card (the full list is on services.html) ------------------------------------------ */
.svc-strip{background:#fff;padding-block:clamp(1.75rem,4vw,3rem);}
.svc-card-cta{
  position:relative;overflow:hidden;background:var(--ink);color:#fff;border-radius:var(--radius-m);
  padding:clamp(1.75rem,3.6vw,2.9rem);
}
.svc-card-cta::before{
  content:"";position:absolute;inset:0;pointer-events:none;
  background:radial-gradient(620px 300px at 100% 0%,rgba(200,146,63,.18),transparent 62%);
}
.svc-card-cta > *{position:relative;}
.svc-card-cta .eyebrow{color:var(--accent-on-dark);margin-bottom:.5rem;}
.svc-card-cta h2{color:#fff;font-size:clamp(1.65rem,1.2vw + 1.3rem,2.4rem);line-height:1.1;margin:0 0 .45em;}
.svc-card-cta p{color:rgba(255,255,255,.85);font-size:1.05rem;max-width:62ch;margin:0 0 1.6rem;}
.svc-card-cta .btn svg{transition:transform var(--dur-med) var(--ease-out);}
.svc-card-cta .btn:hover svg{transform:translateX(4px);}
@media (max-width:560px){.svc-card-cta .btn{width:100%;}}

/* A review with a star rating and a title */
.review__mark{margin-bottom:.8rem;}
.review__stars{display:flex;gap:.2rem;margin:0 0 .7rem;}
.review__stars svg{width:20px;height:20px;fill:var(--accent);}
.review__title{margin:0 0 .5rem;max-width:none;font:700 1rem/1.3 'Public Sans',sans-serif;color:var(--ink);}
.review__text p{margin:0;max-width:none;font:inherit;color:inherit;}

/* Reviews carousel (assets/js/reviews.js) ---------------------------------------------------------
   3 cards at a time on desktop, 2 on tablet, 1 on mobile. The cards are a plain flex row, so before the script
   runs (and for the first paint) the first cards are already in place: no layout shift when it starts.        */
.rc{--gap:clamp(1rem,2vw,1.5rem);position:relative;}
/* extra padding + matching negative margin leaves room for the card shadow and hover lift inside the clip */
.rc-viewport{overflow:hidden;padding:18px 3px 28px;margin:-18px -3px -28px;touch-action:pan-y;}
.rc-track{
  --pv:1;display:flex;gap:var(--gap);
  transition:transform .7s cubic-bezier(.22,.61,.36,1);will-change:transform;
}
@media (min-width:640px){.rc-track{--pv:2;}}
@media (min-width:992px){.rc-track{--pv:3;}}
.rc-slide{flex:0 0 calc((100% - (var(--pv) - 1) * var(--gap)) / var(--pv));min-width:0;}

/* the cards: refined border, soft layered shadow, a slight lift on hover (pointer devices only) */
.rc .review{
  height:auto;border:1px solid rgba(22,35,61,.1);border-top:4px solid var(--accent);
  box-shadow:0 1px 2px rgba(22,35,61,.06),0 10px 26px -12px rgba(22,35,61,.22);
  transition:transform .3s var(--ease-out),box-shadow .3s var(--ease-out),opacity .6s ease;
}
@media (hover:hover){
  .rc .review:hover{transform:translateY(-4px);box-shadow:0 2px 4px rgba(22,35,61,.07),0 18px 34px -14px rgba(22,35,61,.32);}
}

/* once the script is running, cards outside the visible window fade out and the entering ones fade in */
.rc.is-enhanced .rc-slide{opacity:0;}
.rc.is-enhanced .rc-slide.is-in{opacity:1;}
.rc.is-static .rc-track,.rc.is-static .rc-slide{transition:none!important;}
.rc.is-dragging .rc-track{transition:none;cursor:grabbing;}
.rc.is-dragging .review{user-select:none;}

/* controls: hidden until the script has run, but they keep their space so nothing jumps */
.rc-controls{display:flex;align-items:center;justify-content:center;gap:.85rem;margin-top:1.9rem;min-height:46px;visibility:hidden;}
.rc.is-enhanced .rc-controls{visibility:visible;}
.rc-btn{
  flex:none;display:grid;place-items:center;width:46px;height:46px;border-radius:50%;cursor:pointer;
  background:#fff;color:var(--ink);border:1.5px solid rgba(22,35,61,.18);
  transition:background var(--dur-fast),color var(--dur-fast),border-color var(--dur-fast),transform var(--dur-fast);
}
.rc-btn svg{width:18px;height:18px;}
.rc-btn:hover{background:var(--ink);border-color:var(--ink);color:#fff;}
.rc-btn:active{transform:scale(.95);}
.rc-btn:focus-visible,.rc-dot:focus-visible{outline:3px solid var(--accent-deep);outline-offset:2px;}
.rc-toggle{width:38px;height:38px;margin-left:.35rem;}
.rc-toggle svg{width:14px;height:14px;}
.rc-toggle .rc-i-play,.rc.is-paused .rc-toggle .rc-i-pause{display:none;}
.rc.is-paused .rc-toggle .rc-i-play{display:block;}
.rc-dots{display:flex;align-items:center;}
.rc-dot{display:grid;place-items:center;padding:.8rem .28rem;background:none;border:0;cursor:pointer;}
.rc-dot::before{
  content:"";display:block;width:9px;height:9px;border-radius:99px;background:rgba(22,35,61,.22);
  transition:width .35s var(--ease-out),background-color .25s;
}
.rc-dot:hover::before{background:rgba(22,35,61,.45);}
.rc-dot[aria-current="true"]::before{width:26px;background:var(--accent);}
@media (max-width:480px){
  .rc-controls{gap:.5rem;}
  .rc-btn{width:42px;height:42px;}
  .rc-toggle{width:36px;height:36px;margin-left:.15rem;}
  .rc-dot{padding:.8rem .2rem;}
}

/* reduced motion: no sliding, fading or lifting (the script also switches autoplay off) */
@media (prefers-reduced-motion: reduce){
  .rc-track,.rc .review,.rc.is-enhanced .rc-slide,.rc-btn,.rc-dot::before{transition:none!important;}
  .rc .review:hover{transform:none;}
}

/* short reviews sit centred in the card (all cards keep one height, so the page never jumps as the carousel moves) */
.rc .review__text{display:flex;align-items:center;}

/* Audit fix: the numbered roof markers get a larger invisible tap area (the look is unchanged) */
.hot::before{content:"";position:absolute;inset:-9px;border-radius:50%;}
