/* ============================================================
   RIDGELINE ROOFING CO. — bright, bouncy, cheerful
   sky · sun · coral · grass · cream
   ============================================================ */

:root {
  --sky: #55B6F5;
  --sky-deep: #2E96DC;
  --sky-pale: #BDE6FF;
  --sun: #FFC531;
  --coral: #FF6250;
  --grass: #4FC26B;
  --cream: #FFF7EA;
  --ink: #27313F;
  --white: #FFFFFF;
  --display: "Fredoka", sans-serif;
  --body: "Outfit", sans-serif;
  --hand: "Caveat", cursive;
  --spring: cubic-bezier(.34, 1.7, .5, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--body);
  background: var(--cream);
  color: var(--ink);
  overflow-x: hidden;
  line-height: 1.55;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; border: none; background: none; cursor: pointer; }

@media (pointer: fine) { body, a, button { cursor: none; } }

/* ---------- cursor: rotating shingle + chalk-line trail ---------- */
.cursor-shingle {
  position: fixed; top: 0; left: 0; z-index: 9999;
  width: 32px; height: 23px;
  pointer-events: none; display: none;
  transform: translate(-50%, -50%);
  transition: width .25s var(--spring), height .25s var(--spring);
}
@media (pointer: fine) { .cursor-shingle { display: block; } }
.cursor-shingle.grow { width: 46px; height: 33px; }
.chalk-dot {
  position: fixed; z-index: 9998;
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--coral);
  pointer-events: none;
  transform: translate(-50%, -50%);
}

/* ---------- topbar ---------- */
.topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px clamp(18px, 4vw, 48px);
  pointer-events: none;
}
.topbar > * { pointer-events: auto; }
.brand {
  display: flex; align-items: center; gap: 10px;
  font: 600 19px/1 var(--display); letter-spacing: 0.02em;
  color: var(--ink);
}
.brand svg { width: 30px; height: 30px; }
.brand span { font-weight: 400; opacity: .75; font-size: 14px; }
.topbar-line { font: 600 15px/1 var(--hand); font-size: 21px; color: var(--ink); opacity: .85; }
@media (max-width: 640px) { .topbar-line { display: none; } }

/* ---------- shared ---------- */
.kicker {
  display: inline-block;
  font: 600 13px/1 var(--display); letter-spacing: 0.16em; text-transform: uppercase;
  padding: 8px 16px; border-radius: 999px;
  margin-bottom: 18px;
}
.k-coral { background: #FFE3DE; color: #D8402F; }
.k-blue  { background: #DDF1FF; color: #1D7FC4; }
.k-grass { background: #E2F7E7; color: #2F9A4E; }
.k-sunlight { background: rgba(255,255,255,.28); color: var(--ink); }
.sec-head { text-align: center; padding: 0 20px; margin-bottom: clamp(30px, 5vh, 54px); }
.sec-head h2 {
  font: 600 clamp(2.2rem, 5.4vw, 4rem)/1.08 var(--display);
  letter-spacing: -0.01em;
}
.sec-head h2 em { font-style: normal; color: var(--coral); }
.sec-sub { margin-top: 12px; font-size: 1.1rem; opacity: .75; }
.pop { opacity: 0; transform: translateY(46px) scale(.94); } /* JS springs these in */

/* ============================================================
   1 · HERO
   ============================================================ */
.hero {
  position: relative;
  min-height: 100svh;
  background: linear-gradient(180deg, var(--sky) 0%, #7CC8F8 62%, #A9DCFB 100%);
  overflow: hidden;
  display: flex; flex-direction: column;
  align-items: center; justify-content: flex-end;
  padding-top: 90px;
}
.cloud {
  position: absolute;
  background: var(--white);
  border-radius: 999px;
  opacity: .92;
}
.cloud::before, .cloud::after {
  content: ""; position: absolute; background: inherit; border-radius: 50%;
}
.c1 { width: 180px; height: 56px; top: 16%; left: 8%; animation: drift 34s linear infinite; }
.c1::before { width: 74px; height: 74px; top: -36px; left: 30px; }
.c1::after { width: 52px; height: 52px; top: -22px; left: 92px; }
.c2 { width: 130px; height: 44px; top: 30%; right: 12%; animation: drift 46s linear infinite reverse; }
.c2::before { width: 56px; height: 56px; top: -26px; left: 22px; }
.c2::after { width: 40px; height: 40px; top: -16px; left: 66px; }
.c3 { width: 96px; height: 34px; top: 9%; left: 55%; opacity: .7; animation: drift 58s linear infinite; }
.c3::before { width: 42px; height: 42px; top: -20px; left: 18px; }
.c3::after { width: 30px; height: 30px; top: -12px; left: 50px; }
@keyframes drift { from { transform: translateX(-6vw); } to { transform: translateX(106vw); } }

.sun { position: absolute; top: 20px; right: clamp(10px, 5vw, 80px); width: clamp(150px, 17vw, 240px); z-index: 1; mix-blend-mode: screen; }
.sun-rays { transform-origin: 100px 100px; animation: sunspin 40s linear infinite; }
@keyframes sunspin { to { transform: rotate(360deg); } }

.hero-house { width: min(560px, 82vw); z-index: 2; }
.hero-house svg { width: 100%; height: auto; overflow: visible; }

.hero-copy { position: relative; z-index: 3; text-align: center; margin: -8px 0 0; padding-bottom: 20px; }
.hero-title {
  font: 700 clamp(2.6rem, 7.4vw, 6rem)/1 var(--display);
  letter-spacing: -0.01em;
  display: flex; gap: 0.28em; justify-content: center; flex-wrap: wrap;
}
.ht-word { display: inline-block; will-change: transform; }
.w-blue  { color: var(--white); text-shadow: 0 4px 0 rgba(30,110,160,.35); }
.w-coral { color: var(--sun); text-shadow: 0 4px 0 rgba(180,120,0,.3); }
.w-sun   { color: var(--white); text-shadow: 0 4px 0 rgba(30,110,160,.35); }
.hero-tag {
  margin-top: 16px;
  font: 400 clamp(1.1rem, 2.2vw, 1.5rem)/1.3 var(--body);
  color: var(--white);
}
.hero-tag b { font-weight: 700; }

.hero-hill {
  width: 140%; height: clamp(70px, 11vh, 120px);
  background: var(--grass);
  border-radius: 100% 100% 0 0;
  margin-top: -6px;
  z-index: 1;
}
.scroll-cue {
  position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%);
  z-index: 4; text-align: center;
  font: 600 16px/1.4 var(--hand); font-size: 20px; color: var(--ink);
}
.scroll-cue i { display: block; font-style: normal; animation: hop 1.6s var(--spring) infinite; }
@keyframes hop { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(7px); } }

/* ============================================================
   2 · WEATHER PLAYGROUND
   ============================================================ */
.weather { padding: clamp(80px, 12vh, 140px) clamp(16px, 4vw, 48px); background: var(--cream); }
.wx-panel {
  position: relative;
  max-width: 980px; margin: 0 auto;
  height: clamp(380px, 58vh, 560px);
  border-radius: 28px;
  border: 5px solid var(--ink);
  overflow: hidden;
  display: flex; align-items: flex-end; justify-content: center;
  transition: background 0.7s ease;
  box-shadow: 0 14px 0 rgba(39, 49, 63, 0.12);
}
.wx-sun  { background: linear-gradient(180deg, #63BDF7, #A9DCFB); }
.wx-rain { background: linear-gradient(180deg, #6F87A0, #9FB4C7); }
.wx-snow { background: linear-gradient(180deg, #9FB9D8, #D7E5F2); }
.wx-hail { background: linear-gradient(180deg, #7B8FA8, #ADC0D2); }
.wx-sun-badge { position: absolute; top: 6px; left: 10px; width: 130px; mix-blend-mode: screen; transition: opacity .6s, transform .6s var(--spring); }
.wx-panel:not(.wx-sun) .wx-sun-badge { opacity: .18; transform: scale(.8); }
.wx-house { width: min(430px, 66%); position: relative; z-index: 2; margin-bottom: -4px; }
.wx-house svg { width: 100%; height: auto; overflow: visible; }
#wxCanvas { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.wx-line {
  position: absolute; top: 26px; right: 30px; z-index: 4;
  max-width: 300px; text-align: right;
  font: 600 22px/1.25 var(--hand); font-size: 26px;
  color: var(--white); text-shadow: 0 2px 8px rgba(20,40,60,.35);
}
.wx-controls {
  display: flex; gap: 14px; justify-content: center; flex-wrap: wrap;
  margin-top: 26px;
}
.wx-btn {
  font: 600 1.05rem/1 var(--display);
  padding: 15px 26px; border-radius: 999px;
  background: var(--white); color: var(--ink);
  border: 3.5px solid var(--ink);
  box-shadow: 0 5px 0 var(--ink);
  transition: transform .15s var(--spring), box-shadow .15s, background .3s;
}
.wx-btn:hover { transform: translateY(-3px); box-shadow: 0 8px 0 var(--ink); }
.wx-btn:active { transform: translateY(3px) scale(.96); box-shadow: 0 2px 0 var(--ink); }
.wx-btn.is-on { background: var(--sun); }

/* ============================================================
   3 · SERVICES — tilt cards
   ============================================================ */
.services { padding: clamp(70px, 11vh, 130px) clamp(16px, 4vw, 48px); background: var(--cream); }
.svc-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: clamp(16px, 2vw, 26px);
  max-width: 1220px; margin: 0 auto;
  perspective: 900px;
}
.svc {
  border-radius: 24px;
  border: 4px solid var(--ink);
  padding: 30px 24px 28px;
  box-shadow: 0 8px 0 rgba(39, 49, 63, 0.16);
  transform-style: preserve-3d;
  will-change: transform;
}
.svc-blue  { background: #DDF1FF; }
.svc-sun   { background: #FFF0C2; }
.svc-coral { background: #FFE3DE; }
.svc-grass { background: #E2F7E7; }
.svc-icon {
  width: 74px; height: 74px; border-radius: 20px;
  background: var(--white); border: 3.5px solid var(--ink);
  display: grid; place-items: center;
  margin-bottom: 18px;
  transform: translateZ(34px);
}
.svc-icon svg { width: 44px; height: 44px; }
.svc h3 { font: 600 1.5rem/1.15 var(--display); margin-bottom: 8px; transform: translateZ(26px); }
.svc p { font-size: 1rem; opacity: .8; transform: translateZ(18px); }
@media (max-width: 980px) { .svc-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 540px) { .svc-grid { grid-template-columns: 1fr; max-width: 420px; } }

/* ============================================================
   3.5 · GALLERY — house-mask reveals
   ============================================================ */
.gallery { padding: clamp(70px, 11vh, 130px) clamp(16px, 4vw, 48px); background: #EAF6FF; }
.gal-grid {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: clamp(18px, 2.6vw, 32px);
  max-width: 1150px; margin: 0 auto;
}
.gal {
  position: relative; border-radius: 24px; overflow: hidden;
  border: 4px solid var(--ink);
  box-shadow: 0 10px 0 rgba(39, 49, 63, 0.14);
  background: var(--sky-pale);
}
.gal img { width: 100%; transition: transform 6s ease; }
.gal:hover img { transform: scale(1.06); }
.gal figcaption {
  position: absolute; left: 16px; bottom: 14px;
  font: 600 20px/1 var(--hand); font-size: 24px;
  color: var(--white);
  background: rgba(39, 49, 63, 0.72);
  padding: 8px 16px; border-radius: 999px;
}
@media (max-width: 700px) { .gal-grid { grid-template-columns: 1fr; } }

/* ============================================================
   4 · HOW IT WORKS — truck timeline
   ============================================================ */
.how { background: #DDF1FF; overflow: hidden; }
.how-pin {
  min-height: 100vh;
  display: flex; flex-direction: column; justify-content: center;
  padding: clamp(60px, 8vh, 90px) 0;
}
.road-wrap { position: relative; width: min(1400px, 96vw); margin: 0 auto; height: clamp(300px, 46vh, 430px); }
.road { position: absolute; inset: 0; width: 100%; height: 100%; }
.truck { position: absolute; top: 0; left: 0; width: clamp(84px, 9vw, 120px); z-index: 3; will-change: transform; }
.steps { list-style: none; }
.step {
  position: absolute; left: var(--sx); top: var(--sy);
  width: clamp(150px, 16vw, 210px);
  background: var(--white);
  border: 3.5px solid var(--ink); border-radius: 18px;
  padding: 14px 16px;
  box-shadow: 0 6px 0 rgba(39, 49, 63, 0.16);
  opacity: 0; transform: translateY(34px) scale(.8);
}
.step span {
  position: absolute; top: -16px; left: -12px;
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--coral); color: var(--white);
  border: 3px solid var(--ink);
  display: grid; place-items: center;
  font: 600 15px/1 var(--display);
}
.step h3 { font: 600 1.15rem/1.1 var(--display); margin-bottom: 4px; }
.step p { font-size: .88rem; opacity: .8; line-height: 1.35; }

/* mobile: vertical bouncy stepper */
@media (max-width: 860px) {
  .how-pin { min-height: 0; }
  .road-wrap { height: auto; padding-left: 40px; }
  .road, .truck { display: none; }
  .steps { display: flex; flex-direction: column; gap: 22px; border-left: 4px dashed var(--ink); padding: 8px 0 8px 26px; }
  .step { position: static; width: 100%; max-width: 420px; }
}

/* ============================================================
   5 · NUMBERS
   ============================================================ */
.numbers { background: var(--sun); border-top: 5px solid var(--ink); border-bottom: 5px solid var(--ink); }
.num-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 20px; max-width: 1200px; margin: 0 auto;
  padding: clamp(48px, 8vh, 80px) clamp(16px, 4vw, 48px);
  text-align: center;
}
.num strong {
  display: block;
  font: 700 clamp(2.1rem, 4.6vw, 3.6rem)/1 var(--display);
  font-variant-numeric: tabular-nums;
}
.num-text { text-transform: uppercase; letter-spacing: 0.02em; }
.num p { margin-top: 8px; font-weight: 500; opacity: .8; }
@media (max-width: 760px) { .num-grid { grid-template-columns: 1fr 1fr; row-gap: 40px; } }

/* ============================================================
   6 · CREW — polaroids
   ============================================================ */
.crew { padding: clamp(70px, 11vh, 130px) clamp(16px, 4vw, 48px); background: var(--cream); }
.crew-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: clamp(18px, 2.4vw, 30px);
  max-width: 1220px; margin: 0 auto;
}
.polaroid {
  position: relative;
  background: var(--white);
  border: 3px solid #E8E0D0;
  border-radius: 6px;
  padding: 12px 12px 14px;
  box-shadow: 0 10px 24px rgba(39, 49, 63, 0.16);
  rotate: var(--rot);
  transition: rotate .35s var(--spring), transform .35s var(--spring), box-shadow .35s;
}
.polaroid::before {
  content: "";
  position: absolute; top: -14px; left: 50%; transform: translateX(-50%) rotate(-3deg);
  width: 86px; height: 26px;
  background: var(--tape); opacity: .85;
  border-radius: 3px;
}
.polaroid:hover { rotate: 0deg; transform: translateY(-10px) scale(1.04); box-shadow: 0 24px 40px rgba(39, 49, 63, 0.24); z-index: 2; }
.polaroid img { border-radius: 3px; }
.polaroid figcaption { padding: 12px 4px 2px; text-align: center; }
.polaroid strong { display: block; font: 600 1.1rem/1.2 var(--display); }
.polaroid span { font: 600 19px/1.25 var(--hand); font-size: 21px; color: #5A6472; }
@media (max-width: 980px) { .crew-grid { grid-template-columns: 1fr 1fr; max-width: 640px; } }
@media (max-width: 480px) { .crew-grid { grid-template-columns: 1fr; max-width: 320px; } }

/* ============================================================
   7 · TESTIMONIALS — speech-bubble marquee
   ============================================================ */
.voices { padding: clamp(70px, 11vh, 130px) 0 clamp(80px, 12vh, 140px); background: #EAF6FF; overflow: hidden; }
.bubble-marquee { position: relative; }
.bubble-track {
  display: flex; gap: clamp(24px, 3vw, 44px);
  width: max-content;
  padding: 20px 30px 30px;
  animation: bubbles 38s linear infinite;
}
.bubble-marquee:hover .bubble-track { animation-play-state: paused; }
@keyframes bubbles { to { transform: translateX(-50%); } }
.bubble {
  position: relative;
  width: clamp(280px, 30vw, 380px); flex-shrink: 0;
  border: 4px solid var(--ink);
  border-radius: 26px;
  padding: 24px 24px 20px;
  box-shadow: 0 7px 0 rgba(39, 49, 63, 0.16);
}
.bubble::after {
  content: "";
  position: absolute; bottom: -18px; left: 46px;
  width: 26px; height: 26px;
  background: inherit;
  border: 4px solid var(--ink); border-top: none; border-left: none;
  transform: rotate(45deg);
  border-radius: 0 0 8px 0;
}
.bub-blue  { background: #DDF1FF; }
.bub-sun   { background: #FFF0C2; }
.bub-coral { background: #FFE3DE; }
.bub-grass { background: #E2F7E7; }
.bubble blockquote { font: 500 1.08rem/1.5 var(--body); }
.bubble figcaption { display: flex; align-items: center; gap: 12px; margin-top: 16px; }
.bubble figcaption img {
  width: 48px; height: 48px; border-radius: 50%;
  border: 3px solid var(--ink); object-fit: cover;
}
.bubble figcaption strong { display: block; font: 600 1rem/1.15 var(--display); }
.bubble figcaption span { font-size: .85rem; opacity: .75; }

/* ============================================================
   8 · CTA + FOOTER
   ============================================================ */
.cta {
  position: relative;
  background: linear-gradient(180deg, var(--sky) 0%, #7CC8F8 70%, #A9DCFB 100%);
  padding: clamp(90px, 14vh, 170px) clamp(16px, 4vw, 48px) 0;
  text-align: center;
  overflow: hidden;
}
.c4 { width: 150px; height: 48px; top: 14%; left: 10%; animation: drift 40s linear infinite; }
.c4::before { width: 62px; height: 62px; top: -30px; left: 26px; }
.c4::after { width: 44px; height: 44px; top: -18px; left: 78px; }
.c5 { width: 110px; height: 38px; top: 32%; right: 8%; animation: drift 52s linear infinite reverse; }
.c5::before { width: 48px; height: 48px; top: -22px; left: 18px; }
.c5::after { width: 34px; height: 34px; top: -14px; left: 56px; }
.cta-title {
  font: 700 clamp(2.6rem, 7vw, 5.6rem)/1.05 var(--display);
  color: var(--white);
  text-shadow: 0 5px 0 rgba(30, 110, 160, 0.35);
}
.cta-title em { font-style: normal; color: var(--sun); text-shadow: 0 5px 0 rgba(180, 120, 0, 0.3); }
.cta-sub { margin-top: 16px; font-size: clamp(1.05rem, 2vw, 1.3rem); color: var(--white); }
.cta-sub b { font-weight: 700; }
.cta-row {
  position: relative; z-index: 3;
  display: flex; gap: 18px; justify-content: center; align-items: center; flex-wrap: wrap;
  margin-top: clamp(30px, 5vh, 50px);
}
.big-btn {
  display: inline-block;
  font: 600 clamp(1.1rem, 1.8vw, 1.35rem)/1 var(--display);
  padding: 22px 46px; border-radius: 999px;
  background: var(--coral); color: var(--white);
  border: 4px solid var(--ink);
  box-shadow: 0 7px 0 var(--ink);
  will-change: transform;
  transition: box-shadow .15s;
}
.big-btn:active { box-shadow: 0 2px 0 var(--ink); }
.big-btn-ghost { background: var(--white); color: var(--ink); }
.cta-alt { margin-top: 22px; font: 600 20px/1 var(--hand); font-size: 23px; color: var(--white); }

.footer-scene { margin-top: clamp(40px, 7vh, 80px); line-height: 0; }
.footer-scene svg { width: 100%; height: clamp(110px, 16vh, 160px); }
.footer-row {
  position: relative; z-index: 2;
  background: var(--grass);
  display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 18px clamp(18px, 4vw, 48px) 26px;
  font-size: .95rem; color: #0F5A28;
}
.footer-row nav { display: flex; gap: 20px; }
.footer-row a { font-weight: 600; }
.footer-row a:hover { color: var(--white); }
.credit { font-weight: 700; }

/* ---------- squish utility (JS adds press bounce) ---------- */
.squish { transition: transform .18s var(--spring); }

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .cloud, .sun-rays, .scroll-cue i { animation: none; }
  .bubble-track { animation-duration: 300s; }
  .pop { opacity: 1; transform: none; }
  .step { opacity: 1; transform: none; }
}
