/* =====================================================================
   Garcia Brothers Roofers · Atlanta
   Identity: slate night field, cobalt brand, one sun accent.
   ===================================================================== */

:root {
  /* palette */
  --soot: #0B0C0E;
  --slate: #15181D;
  --slate-2: #1C2027;
  --line: #262B33;
  --chalk: #F3F4F1;
  --ash: #9BA1A8;
  --ash-2: #6F757D;
  --cobalt: #2F5BFF;
  --cobalt-deep: #1E3FCC;
  --cobalt-soft: #9FB4FF;
  --sun: #FFC857;

  /* type */
  --font-display: "Bahnschrift", "Avenir Next Condensed", "Roboto Condensed", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, system-ui, sans-serif;

  --t-1: clamp(0.8125rem, 0.78rem + 0.15vw, 0.875rem);
  --t0:  clamp(1rem, 0.95rem + 0.3vw, 1.125rem);
  --t1:  clamp(1.25rem, 1.1rem + 0.7vw, 1.625rem);
  --t2:  clamp(1.75rem, 1.4rem + 1.6vw, 2.75rem);
  --t3:  clamp(2.25rem, 1.6rem + 3.4vw, 4.75rem);
  --t4:  clamp(3rem, 2rem + 6vw, 7.5rem);
  --t5:  clamp(6rem, 3rem + 14vw, 15rem);

  /* rhythm */
  --s1: 0.5rem;
  --s2: 1rem;
  --s3: 1.5rem;
  --s4: 2rem;
  --s5: 3rem;
  --s6: 4.5rem;
  --s7: 6rem;
  --s8: 9rem;
  --section: clamp(5.5rem, 12vw, 10rem);
  --gutter: clamp(1.25rem, 4vw, 3.5rem);
  --max: 84rem;
  --radius: 4px;

  /* motion */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-inout: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-back: cubic-bezier(0.34, 1.4, 0.64, 1);
  --walk: 0;
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; background: var(--soot); }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--t0);
  line-height: 1.55;
  color: var(--chalk);
  background: var(--soot);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
h1, h2, h3, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, video, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
strong { font-weight: 700; }

:focus-visible { outline: 3px solid var(--sun); outline-offset: 3px; border-radius: var(--radius); }
:focus:not(:focus-visible) { outline: none; }

.skip {
  position: fixed; top: -100%; left: var(--gutter); z-index: 100;
  padding: 0.75rem 1rem; background: var(--sun); color: var(--soot); font-weight: 700;
}
.skip:focus { top: 0.75rem; }

.wrap { width: min(100% - 2 * var(--gutter), var(--max)); margin-inline: auto; }

/* ---------- type ---------- */
.h-display, .hero__title, .steps__num, .proof__num, .dial__num, .cta__title, .walk__beat {
  font-family: var(--font-display);
  font-stretch: 87.5%;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 0.94;
  text-wrap: balance;
}
.h-display { font-size: var(--t3); }
.kicker {
  font-size: var(--t-1);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ash);
  margin-bottom: var(--s3);
}
.kicker--sun { color: var(--sun); }
.lede { font-size: var(--t1); line-height: 1.4; color: var(--ash); max-width: 30ch; }

.section { padding-block: var(--section); }
.section__head { margin-bottom: var(--s6); }
.section__head .h-display { max-width: 16ch; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.6rem;
  min-height: 3.25rem; padding: 0.9rem 1.5rem;
  font-weight: 700; font-size: var(--t0); letter-spacing: -0.005em;
  border-radius: 999px; white-space: nowrap;
  transition: transform 0.35s var(--ease-out), background-color 0.3s var(--ease-out), box-shadow 0.35s var(--ease-out);
}
.btn--cobalt { background: var(--cobalt); color: #fff; box-shadow: 0 0 0 0 rgba(47, 91, 255, 0); }
.btn--cobalt:hover { background: var(--cobalt-deep); transform: translateY(-2px); box-shadow: 0 14px 34px -12px rgba(47, 91, 255, 0.75); }
.btn--cobalt:active { transform: translateY(0) scale(0.98); transition-duration: 0.12s; }

/* ---------- header ---------- */
.top {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: var(--s2);
  padding: 0.75rem var(--gutter);
  background: rgba(11, 12, 14, 0.72);
  background: color-mix(in srgb, var(--soot) 72%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid transparent;
  transition: border-color 0.4s var(--ease-out);
}
.top.is-scrolled { border-bottom-color: var(--line); }
.brand { display: inline-flex; align-items: center; gap: 0.7rem; color: var(--chalk); min-height: 2.75rem; }
.brand__mark { width: 2.25rem; height: 2.25rem; color: var(--cobalt); flex: none; transition: transform 0.5s var(--ease-back); }
.brand:hover .brand__mark { transform: translateY(-2px); }
.brand__name { display: none; font-weight: 700; letter-spacing: -0.01em; }
.top__phone {
  display: inline-flex; align-items: center; gap: 0.5rem;
  min-height: 2.75rem; padding: 0.55rem 1rem;
  font-weight: 700; font-size: 0.9375rem; font-variant-numeric: tabular-nums;
  border: 1px solid var(--line); border-radius: 999px; color: var(--chalk);
  background: rgba(21, 24, 29, 0.6);
  background: color-mix(in srgb, var(--slate) 60%, transparent);
  transition: border-color 0.3s var(--ease-out), background-color 0.3s var(--ease-out), transform 0.35s var(--ease-out);
}
.top__phone svg { width: 1.05rem; height: 1.05rem; color: var(--cobalt-soft); }
.top__phone:hover { border-color: var(--cobalt); background: var(--slate-2); transform: translateY(-1px); }
.top__phone:active { transform: scale(0.98); }

/* ---------- hero: walk the roof ---------- */
.hero { position: relative; height: 260svh; }
.hero__stage {
  position: sticky; top: 0;
  height: 100vh; height: 100svh;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr auto;
  isolation: isolate;
}
.hero__media { position: absolute; inset: 0; z-index: -1; background: var(--soot); }
.hero__sky {
  position: absolute; inset: 0;
  background:
    radial-gradient(120% 70% at 70% 0%, #1D2A55 0%, transparent 60%),
    linear-gradient(180deg, #0E1220 0%, var(--soot) 70%);
}
.hero__ridge { position: absolute; inset: auto 0 0 0; width: 100%; height: 100%; }
.hero__still, .hero__film {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: 50% 40%;
}
.hero__still {
  transform: scale(calc(1.06 + var(--walk) * 0.10)) translateY(calc(var(--walk) * -2.5%));
  transform-origin: 50% 60%;
  transition: opacity 0.6s var(--ease-out);
}
.hero.no-still .hero__still { opacity: 0; }
.hero__film { opacity: 0; transition: opacity 0.7s var(--ease-out); pointer-events: none; }
.hero.has-film .hero__film { opacity: 1; }
.hero.no-film .hero__film { display: none; }
/* soft vignette keeps the plate legible without a full scrim */
.hero__media::after {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(11, 12, 14, 0.55) 0%, rgba(11, 12, 14, 0) 28%),
    linear-gradient(0deg, rgba(11, 12, 14, 0.7) 0%, rgba(11, 12, 14, 0) 45%);
}

.hero__plate {
  grid-row: 3;
  margin: 0 var(--gutter) var(--gutter);
  padding: clamp(1.25rem, 4vw, 2.5rem);
  background: var(--soot);
  border-top: 3px solid var(--cobalt);
  max-width: 44rem;
}
.hero__title { font-size: var(--t4); margin-bottom: var(--s3); }
.hero__sub { color: var(--ash); max-width: 34ch; margin-bottom: var(--s4); }
.hero__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3); }
.rating-chip {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-size: var(--t-1); color: var(--ash); font-variant-numeric: tabular-nums;
}
.rating-chip svg { width: 1rem; height: 1rem; color: var(--sun); }
.rating-chip strong { color: var(--chalk); font-size: 1rem; }

/* HUD */
.walk {
  grid-row: 1;
  margin: calc(4.25rem + env(safe-area-inset-top, 0px)) var(--gutter) 0;
  width: min(100%, 22rem);
  color: var(--chalk);
}
.walk__head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 0.6rem; }
.walk__label { font-size: var(--t-1); font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; }
.walk__pct { font-family: var(--font-display); font-stretch: 87.5%; font-weight: 700; font-size: 1.1rem; font-variant-numeric: tabular-nums; color: var(--sun); }
.walk__track { position: relative; height: 2px; background: rgba(243, 244, 241, 0.22); border-radius: 2px; overflow: visible; }
.walk__track::before {
  content: ""; position: absolute; inset: 0; background: var(--chalk);
  transform: scaleX(var(--walk)); transform-origin: left;
}
.walk__tick {
  position: absolute; top: 50%; left: calc(var(--walk) * 100%);
  width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%;
  background: var(--sun); box-shadow: 0 0 0 4px rgba(255, 200, 87, 0.22);
}
.walk__beats { position: relative; height: 2.2em; margin-top: var(--s2); font-size: var(--t1); }
.walk__beat {
  position: absolute; inset: 0 auto auto 0; white-space: nowrap; letter-spacing: -0.02em;
  opacity: 0; transform: translateY(0.5em);
  transition: opacity 0.55s var(--ease-out), transform 0.7s var(--ease-out);
}
.walk__beat.is-on { opacity: 1; transform: translateY(0); }
.walk__beat.is-past { opacity: 0; transform: translateY(-0.5em); }

.hero.is-done .walk__label { color: var(--sun); }

/* ---------- reveal ---------- */
[data-reveal-child] {
  opacity: 0; transform: translateY(28px);
  transition: opacity 0.7s var(--ease-out), transform 0.9s var(--ease-out);
  transition-delay: calc(var(--i, 0) * 90ms);
}
.in [data-reveal-child] { opacity: 1; transform: none; }

/* ---------- the work ---------- */
.work { background: var(--soot); }
.work__grid { display: grid; gap: var(--s3); }
.work__item { position: relative; }
.work__frame {
  position: relative; overflow: hidden; border-radius: var(--radius);
  background:
    repeating-linear-gradient(135deg, transparent 0 14px, rgba(255, 255, 255, 0.025) 14px 15px),
    var(--slate);
  aspect-ratio: 4 / 3;
}
.work__frame img {
  width: 100%; height: 100%; object-fit: cover;
  transform: scale(1.001);
  transition: transform 1.1s var(--ease-out), opacity 0.6s var(--ease-out);
}
.work__frame img.is-missing { opacity: 0; }
.work__item:hover .work__frame img { transform: scale(1.045); }
.work__item figcaption {
  display: grid; gap: 0.2rem; padding-top: var(--s2);
  border-top: 1px solid var(--line);
  margin-top: var(--s2);
  transition: border-color 0.4s var(--ease-out);
}
.work__item:hover figcaption { border-top-color: var(--cobalt); }
.work__item figcaption strong { font-size: var(--t1); letter-spacing: -0.01em; line-height: 1.2; }
.work__item figcaption span { color: var(--ash); }

/* ---------- why ---------- */
.why { background: var(--slate); border-block: 1px solid var(--line); }
.why__grid { display: grid; gap: var(--s6); }
.why__frame {
  overflow: hidden; border-radius: var(--radius); aspect-ratio: 4 / 5;
  background:
    repeating-linear-gradient(135deg, transparent 0 14px, rgba(255, 255, 255, 0.025) 14px 15px),
    var(--slate-2);
}
.why__frame img { width: 100%; height: 100%; object-fit: cover; transition: opacity 0.6s var(--ease-out); }
.why__frame img.is-missing { opacity: 0; }
.why .section__head { margin-bottom: var(--s5); }
.claims { display: grid; gap: var(--s4); }
.claims li { padding-left: var(--s3); border-left: 3px solid var(--cobalt); }
.claims h3 { font-size: var(--t1); letter-spacing: -0.015em; line-height: 1.2; margin-bottom: 0.35rem; }
.claims p { color: var(--ash); max-width: 36ch; }

/* ---------- steps ---------- */
.steps__list { display: grid; gap: var(--s5); }
.steps__list li { padding-top: var(--s3); border-top: 1px solid var(--line); }
.steps__num { display: block; font-size: var(--t3); color: var(--cobalt); margin-bottom: var(--s3); }
.steps h3 { font-size: var(--t2); font-family: var(--font-display); font-stretch: 87.5%; font-weight: 700; letter-spacing: -0.02em; line-height: 1; margin-bottom: var(--s2); }
.steps p { color: var(--ash); max-width: 32ch; }

/* ---------- proof ---------- */
.proof { background: var(--slate); border-block: 1px solid var(--line); }
.proof__grid { display: grid; gap: var(--s5); align-items: center; }
.proof__score { display: grid; gap: var(--s2); }
.proof__num { font-size: var(--t5); line-height: 0.85; color: var(--chalk); font-variant-numeric: lining-nums; }
.stars { display: inline-flex; gap: 0.35rem; }
.stars i {
  --size: clamp(1.5rem, 1rem + 2vw, 2.25rem);
  width: var(--size); height: var(--size); display: block; position: relative;
  background: var(--line);
  clip-path: polygon(50% 2%, 63% 36%, 98% 38%, 71% 60%, 80% 96%, 50% 76%, 20% 96%, 29% 60%, 2% 38%, 37% 36%);
}
.stars i::after {
  content: ""; position: absolute; inset: 0; background: var(--sun);
  transform: scaleX(var(--fill, 1)); transform-origin: left;
  clip-path: inset(0);
  transition: transform 0.9s var(--ease-out);
  transition-delay: calc(var(--n, 0) * 90ms + 300ms);
}
.proof:not(.in) .stars i::after { transform: scaleX(0); }
.stars i:nth-child(1) { --n: 0; } .stars i:nth-child(2) { --n: 1; } .stars i:nth-child(3) { --n: 2; } .stars i:nth-child(4) { --n: 3; } .stars i:nth-child(5) { --n: 4; }
.proof__copy .h-display { max-width: 18ch; margin-bottom: var(--s3); }

/* ---------- cta ---------- */
.cta { padding-block: var(--section); }
.cta__title { font-size: var(--t4); margin-bottom: var(--s5); }
.dial {
  display: inline-grid; gap: 0.5rem; position: relative;
  padding-bottom: 0.6rem;
}
.dial__num { font-size: var(--t3); white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--chalk); transition: color 0.3s var(--ease-out); }
.dial__hint { font-size: var(--t-1); font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ash); }
.dial::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4px;
  background: var(--cobalt); transform-origin: left;
  transform: scaleX(0.18); transition: transform 0.7s var(--ease-out);
}
.dial:hover::after, .dial:focus-visible::after { transform: scaleX(1); }
.dial:hover .dial__num { color: var(--cobalt-soft); }

/* ---------- footer ---------- */
.foot { border-top: 1px solid var(--line); padding-block: var(--s5) calc(var(--s5) + env(safe-area-inset-bottom, 0px)); color: var(--ash); font-size: var(--t-1); }
.foot__grid { display: grid; gap: var(--s2); }
.foot__brand { display: inline-flex; align-items: center; gap: 0.6rem; color: var(--chalk); font-weight: 700; font-size: var(--t0); }
.foot__brand .brand__mark { width: 1.75rem; height: 1.75rem; }
.foot__phone { color: var(--chalk); font-weight: 700; font-size: var(--t0); font-variant-numeric: tabular-nums; width: fit-content; position: relative; }
.foot__phone::after { content: ""; position: absolute; left: 0; right: 0; bottom: -3px; height: 2px; background: var(--cobalt); transform: scaleX(0); transform-origin: left; transition: transform 0.5s var(--ease-out); }
.foot__phone:hover::after, .foot__phone:focus-visible::after { transform: scaleX(1); }

/* =====================================================================
   ≥ 600px
   ===================================================================== */
@media (min-width: 600px) {
  .brand__name { display: inline; }
  .work__grid { grid-template-columns: 1fr 1fr; }
  .work__item--tall { grid-row: span 2; display: grid; grid-template-rows: minmax(0, 1fr) auto; min-height: 0; }
  .work__item--tall .work__frame { aspect-ratio: auto; height: 100%; min-height: 0; }
  .work__item--tall .work__frame img { position: absolute; inset: 0; }
  .steps__list { grid-template-columns: repeat(3, 1fr); gap: var(--s4); }
  .foot__grid { grid-template-columns: 1fr auto; align-items: center; }
  .foot__legal { grid-column: 1; }
  .foot__phone { grid-column: 2; grid-row: 1; }
  .foot__meta { grid-column: 2; grid-row: 2; text-align: right; }
}

/* =====================================================================
   ≥ 900px — desktop hero: full-bleed film, plate bottom-left, HUD right
   ===================================================================== */
@media (min-width: 900px) {
  .hero { height: 320svh; }
  .hero__stage { grid-template-columns: 1fr auto; grid-template-rows: 1fr auto; }
  .hero__plate { grid-column: 1; grid-row: 2; max-width: 46rem; }
  .walk {
    grid-column: 2; grid-row: 2; align-self: end;
    margin: 0 var(--gutter) calc(var(--gutter) + 0.5rem) 0;
    width: 20rem;
  }
  .walk__beats { height: 2.4em; }

  .why__grid { grid-template-columns: 5fr 6fr; gap: var(--s8); align-items: center; }
  .proof__grid { grid-template-columns: auto 1fr; gap: var(--s8); }
  .work__grid { grid-template-columns: 7fr 5fr; gap: var(--s4); }
}

@media (min-width: 1200px) {
  .hero__plate { padding: 2.75rem 3rem; }
}

/* short phones: keep the whole hero inside one viewport, nothing clipped */
@media (max-width: 899px) and (max-height: 700px) {
  .hero__title { font-size: var(--t3); margin-bottom: var(--s2); }
  .hero__sub { display: none; }
  .hero__plate { padding: 1.25rem; }
  .walk__beats { font-size: var(--t0); height: 2em; margin-top: var(--s1); }
}

/* =====================================================================
   reduced motion
   ===================================================================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero { height: auto; }
  .hero__stage { position: relative; height: 100svh; }
  .hero__still { transform: none; }
  .walk__head, .walk__track { display: none; }
  .walk__beat { transition: none; }
  .walk__beat[data-beat="2"] { opacity: 1; transform: none; }
  [data-reveal-child] { opacity: 1; transform: none; transition: none; }
  .proof:not(.in) .stars i::after { transform: scaleX(var(--fill, 1)); }
  .stars i::after { transition: none; }
  .btn, .top__phone, .brand__mark, .work__frame img, .dial::after, .foot__phone::after { transition: none; }
}
