/*
  home.css
  The landing page: a light hero with the interactive broom, a services index,
  a visit checklist, one-at-a-time client quotes, and one closing call to action.
  Everything is scoped under .home so no other page is affected.
*/

.visually-hidden {
  border: 0;
  clip: rect(0 0 0 0);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.button--light {
  background: var(--color-paper);
  color: var(--color-deep);
}

.button--light:hover {
  background: var(--color-white);
}

/* ========== HERO ========== */
.home .hero {
  align-items: center;
  background:
    radial-gradient(900px 560px at 76% 46%, rgba(36, 82, 63, 0.09), transparent 70%),
    var(--color-paper);
  display: flex;
  margin-top: 0;
  min-height: 100vh;
  min-height: 100svh;
  overflow: hidden;
  padding: calc(var(--nav-height) + 24px) 0 36px;
  position: relative;
}

.home .hero__inner {
  align-items: center;
  display: grid;
  gap: clamp(28px, 4vw, 72px);
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.42fr);
  margin: 0;
  /* Text lines up with every section below; the picture may run closer to the right edge. */
  padding: 0 clamp(20px, 2.4vw, 40px) 0 max(var(--container-padding), calc((100% - var(--max-width)) / 2 + var(--container-padding)));
  width: 100%;
}

.home .hero__content {
  display: block;
  padding: 0;
}

.home .hero .eyebrow {
  color: var(--color-gold-ink);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.home .hero__title {
  color: var(--color-deep);
  font-size: clamp(38px, 3.9vw, 62px);
  letter-spacing: -0.015em;
  line-height: 1.04;
  margin-top: var(--space-4);
  text-wrap: balance;
}

.home .hero__copy {
  color: var(--color-text-dark-secondary);
  font-size: clamp(17px, 1.35vw, 20px);
  line-height: 1.6;
  margin-top: var(--space-5);
  max-width: 28em;
}

.home .hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-6);
}

.home .hero .button--primary {
  background: var(--color-deep);
  color: #fff;
}

.home .hero .button--primary:hover {
  background: var(--color-mid);
}

.home .hero .button--secondary {
  background: transparent;
  border: 1px solid rgba(16, 40, 30, 0.35);
  color: var(--color-deep);
}

.home .hero .button--secondary:hover {
  background: rgba(16, 40, 30, 0.06);
  border-color: var(--color-deep);
}

.home .hero__note {
  border-top: 1px solid rgba(16, 40, 30, 0.12);
  color: rgba(16, 40, 30, 0.62);
  font-size: 15px;
  margin-top: var(--space-6);
  max-width: 34em;
  padding-top: var(--space-4);
  text-wrap: pretty;
}

/* ----- The stage: the room (video) with the broom beside it ----- */
.stage {
  justify-self: end;
  padding-left: clamp(40px, 7.5%, 84px);
  position: relative;
  width: 100%;
}

.stage__frame {
  aspect-ratio: 16 / 11.4;
  background: #cdd3c8 url("../images/hero-poster.jpg") center / cover no-repeat;
  border-radius: 22px;
  box-shadow:
    0 48px 90px -46px rgba(16, 40, 30, 0.55),
    0 0 0 1px rgba(16, 40, 30, 0.06);
  margin-left: auto;
  overflow: hidden;
  position: relative;
  /* Never taller than the screen: the whole hero fits in one view. */
  width: min(100%, calc((100vh - var(--nav-height) - 150px) * 1.4));
  width: min(100%, calc((100svh - var(--nav-height) - 150px) * 1.4));
}

.stage__video,
.stage__canvas {
  height: 100%;
  inset: 0;
  position: absolute;
  width: 100%;
}

.stage__video {
  object-fit: cover;
}

.stage__canvas {
  opacity: 0;
}

/* When WebGL is available the canvas draws the video, so the ripple can bend it. */
.stage[data-gl="on"] .stage__canvas {
  opacity: 1;
}

.stage[data-gl="on"] .stage__video {
  opacity: 0;
}

.stage__shine {
  background: linear-gradient(105deg, transparent 38%, rgba(255, 255, 255, 0.28) 50%, transparent 62%);
  inset: 0;
  opacity: 0;
  pointer-events: none;
  position: absolute;
  transform: translateX(-60%);
}

.stage[data-state="done"] .stage__shine,
.stage.is-flash .stage__shine {
  animation: stage-shine 1.6s cubic-bezier(0.3, 0.6, 0.2, 1) both;
}

@keyframes stage-shine {
  0% { opacity: 0; transform: translateX(-60%); }
  25% { opacity: 1; }
  100% { opacity: 0; transform: translateX(60%); }
}

/* ----- The flying layer: the tail, the ripple ring and the broom, above everything ----- */
.hero__fx {
  inset: 0;
  pointer-events: none;
  position: absolute;
  z-index: 6;
}

.hero__fx-canvas {
  height: 100%;
  inset: 0;
  position: absolute;
  width: 100%;
}

/* A small straw broom. Its position and angle are set by js/broom.js. */
.broom {
  background: none;
  border: 0;
  cursor: pointer;
  height: var(--bh, 110px);
  left: 0;
  padding: 0;
  pointer-events: auto;
  position: absolute;
  top: 0;
  touch-action: manipulation;
  transform-origin: 50% 97%;
  -webkit-tap-highlight-color: transparent;
  width: var(--bw, 34px);
  will-change: transform, opacity;
}

/* A generous tap target around a small broom. */
.broom::after {
  content: "";
  inset: -10px -22px -4px;
  position: absolute;
}

html:not(.js-broom) .hero__fx {
  display: none;
}

.broom:focus-visible {
  border-radius: 8px;
  outline: 2px solid var(--color-deep);
  outline-offset: 5px;
}

.broom__body {
  display: block;
  filter: drop-shadow(0 8px 7px rgba(16, 40, 30, 0.28));
  height: 100%;
  transition: transform 0.5s cubic-bezier(0.3, 0.7, 0.2, 1);
  width: 100%;
}

.hero[data-state="idle"] .broom:hover .broom__body {
  transform: scale(1.12) rotate(-3deg);
}

.broom__art {
  display: block;
  height: 100%;
  width: 100%;
}

.broom__halo {
  animation: broom-halo 3.2s ease-out infinite;
  border: 1.5px solid rgba(201, 168, 76, 0.9);
  border-radius: 50%;
  bottom: -6%;
  height: 90%;
  left: 50%;
  opacity: 0;
  pointer-events: none;
  position: absolute;
  transform: translate(-50%, 0) scale(0.4);
  width: 260%;
}

.hero:not([data-state="idle"]) .broom__halo {
  animation: none;
}

@keyframes broom-halo {
  0% { opacity: 0; transform: translate(-50%, 0) scale(0.35); }
  25% { opacity: 0.85; }
  100% { opacity: 0; transform: translate(-50%, 0) scale(1); }
}

.broom__hint {
  left: 0;
  opacity: 0;
  pointer-events: none;
  position: absolute;
  top: 0;
  transition: opacity 0.6s ease;
  white-space: nowrap;
}

.broom__hint span {
  animation: hint-bob 3.6s ease-in-out infinite;
  background: var(--color-deep);
  border-radius: 999px;
  box-shadow: 0 10px 24px -12px rgba(16, 40, 30, 0.7);
  color: #fff;
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  padding: 7px 14px;
}

.hero[data-state="idle"].is-ready .broom__hint {
  opacity: 1;
  transition-delay: 1.4s;
}

@keyframes hint-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

/* Words that float on the ripple (set up by js/broom.js). */
.leaf {
  display: inline-block;
}

/* ----- After the sweep ----- */
.stage__done {
  align-items: center;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  background: rgba(252, 251, 247, 0.92);
  border-radius: 999px;
  bottom: 22px;
  box-shadow: 0 18px 40px -20px rgba(16, 40, 30, 0.6);
  display: flex;
  gap: 14px;
  left: calc(50% + clamp(56px, 7%, 110px));
  opacity: 0;
  padding: 8px 8px 8px 22px;
  pointer-events: none;
  position: absolute;
  transform: translate(-50%, 14px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
  white-space: nowrap;
  z-index: 4;
}

.stage[data-state="done"] .stage__done {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0);
  transition-delay: 0.3s;
}

.stage__done-text {
  color: var(--color-deep);
  font-size: 15px;
  font-weight: 500;
}

.stage__done-cta {
  background: var(--color-deep);
  border-radius: 999px;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  padding: 11px 20px;
  transition: background var(--transition);
}

.stage__done-cta:hover {
  background: var(--color-mid);
}

.stage__again {
  background: none;
  border: 0;
  color: var(--color-deep);
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  padding: 11px 14px 11px 6px;
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* ========== SERVICES: an index with a live preview ========== */
.home .services {
  background: var(--color-paper);
  padding: clamp(72px, 9vw, 132px) 0;
}

.services__layout {
  column-gap: clamp(40px, 6vw, 104px);
  display: grid;
  grid-template-areas:
    "intro preview"
    "list preview";
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  grid-template-rows: auto 1fr;
}

.services__intro {
  grid-area: intro;
}

.services__lead {
  color: var(--color-text-dark-secondary);
  font-size: var(--text-body-lg);
  line-height: 1.6;
  margin-top: var(--space-4);
  max-width: 30em;
}

.services__intro .section-link {
  display: inline-block;
  margin-top: var(--space-4);
}

.svc-list {
  grid-area: list;
  list-style: none;
  margin: var(--space-8) 0 0;
  padding: 0;
}

.svc {
  border-top: 1px solid rgba(16, 40, 30, 0.14);
}

.svc:last-child {
  border-bottom: 1px solid rgba(16, 40, 30, 0.14);
}

.svc__link {
  align-items: center;
  display: flex;
  gap: 18px;
  padding: 24px 0;
}

.svc__thumb {
  display: none;
}

.svc__text {
  display: block;
  padding-left: 0;
  position: relative;
  transition: padding-left 0.4s cubic-bezier(0.3, 0.7, 0.2, 1);
}

.svc__text::before {
  background: var(--color-gold);
  content: "";
  height: 2px;
  left: 0;
  position: absolute;
  top: 0.72em;
  transition: width 0.4s cubic-bezier(0.3, 0.7, 0.2, 1);
  width: 0;
}

.svc.is-active .svc__text {
  padding-left: 26px;
}

.svc.is-active .svc__text::before {
  width: 14px;
}

.svc__name {
  color: var(--color-deep);
  display: block;
  font-family: var(--font-display);
  font-size: clamp(24px, 2.4vw, 33px);
  line-height: 1.12;
  transition: color 0.3s ease;
}

.svc.is-active .svc__name {
  color: var(--color-mid);
}

.svc__desc {
  color: var(--color-text-dark-secondary);
  display: block;
  line-height: 1.55;
  margin-top: 8px;
  max-width: 34em;
}

.svc-preview {
  align-self: start;
  aspect-ratio: 4 / 4.6;
  background: var(--color-sage);
  border-radius: 20px;
  box-shadow: 0 40px 80px -48px rgba(16, 40, 30, 0.55);
  grid-area: preview;
  margin: 0;
  overflow: hidden;
  position: sticky;
  top: calc(var(--nav-height) + 36px);
}

.svc-preview__img {
  height: 100%;
  inset: 0;
  object-fit: cover;
  opacity: 0;
  position: absolute;
  transform: scale(1.05);
  transition: opacity 0.7s ease, transform 1.4s cubic-bezier(0.2, 0.7, 0.2, 1);
  width: 100%;
}

.svc-preview__img.is-on {
  opacity: 1;
  transform: scale(1);
}

/* ========== HOW A VISIT WORKS: a checklist sheet ========== */
.visit {
  background:
    radial-gradient(760px 420px at 12% 0%, rgba(201, 168, 76, 0.12), transparent 70%),
    var(--color-forest);
  padding: clamp(72px, 9vw, 128px) 0;
}

.visit .section-title {
  color: var(--color-text-primary);
}

.visit__layout {
  align-items: center;
  display: grid;
  gap: clamp(40px, 7vw, 120px);
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
}

.visit__copy p {
  color: var(--color-text-secondary);
  font-size: var(--text-body-lg);
  line-height: 1.65;
  margin-top: var(--space-4);
  max-width: 28em;
}

.sheet {
  background:
    repeating-linear-gradient(180deg, transparent 0, transparent 61px, rgba(16, 40, 30, 0.07) 61px, rgba(16, 40, 30, 0.07) 62px),
    var(--color-paper);
  border: 1px solid rgba(16, 40, 30, 0.1);
  border-radius: 6px 18px 6px 18px;
  box-shadow: 0 44px 80px -40px rgba(0, 0, 0, 0.6), 0 2px 0 rgba(255, 255, 255, 0.7) inset;
  padding: 34px clamp(24px, 3.4vw, 46px) 18px;
  transform: rotate(-1.1deg);
}

.sheet__title {
  color: var(--color-gold-ink);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.sheet__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sheet__list li {
  align-items: flex-start;
  display: flex;
  gap: 18px;
  padding: 18px 0;
}

.sheet__list strong {
  color: var(--color-deep);
  display: block;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 400;
  line-height: 1.2;
}

.sheet__list span {
  color: var(--color-text-dark-secondary);
  display: block;
  line-height: 1.5;
  margin-top: 4px;
}

.tick {
  flex: none;
  height: 30px;
  margin-top: 1px;
  width: 30px;
}

.tick rect {
  fill: var(--color-paper);
  stroke: var(--color-deep);
  stroke-width: 1.6;
}

.tick path {
  fill: none;
  stroke: var(--color-mid);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.6;
}

html.js-ticks .sheet .tick path {
  stroke-dasharray: 26;
  stroke-dashoffset: 26;
  transition: stroke-dashoffset 0.55s cubic-bezier(0.3, 0.7, 0.2, 1);
}

html.js-ticks .sheet .tick rect {
  transition: fill 0.4s ease 0.1s;
}

html.js-ticks .sheet.is-ticked .tick path {
  stroke-dashoffset: 0;
}

html.js-ticks .sheet.is-ticked .tick rect {
  fill: var(--color-sage);
}

html.js-ticks .sheet.is-ticked li:nth-child(1) .tick path,
html.js-ticks .sheet.is-ticked li:nth-child(1) .tick rect { transition-delay: 0.3s; }
html.js-ticks .sheet.is-ticked li:nth-child(2) .tick path,
html.js-ticks .sheet.is-ticked li:nth-child(2) .tick rect { transition-delay: 0.85s; }
html.js-ticks .sheet.is-ticked li:nth-child(3) .tick path,
html.js-ticks .sheet.is-ticked li:nth-child(3) .tick rect { transition-delay: 1.4s; }
html.js-ticks .sheet.is-ticked li:nth-child(4) .tick path,
html.js-ticks .sheet.is-ticked li:nth-child(4) .tick rect { transition-delay: 1.95s; }

/* ========== CLIENT QUOTES: one at a time ========== */
.quotes {
  background: var(--color-cream);
  padding: clamp(72px, 9vw, 128px) 0;
}

.quotes__title {
  color: var(--color-gold-ink);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.quotes__stage {
  display: grid;
  margin-top: var(--space-6);
}

.quote {
  grid-area: 1 / 1;
  margin: 0;
  opacity: 0;
  pointer-events: none;
  position: relative;
  transform: translateY(16px);
  transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.quote.is-active {
  opacity: 1;
  pointer-events: auto;
  transform: none;
}

.quote blockquote {
  color: var(--color-deep);
  font-family: var(--font-quote);
  font-size: clamp(30px, 4vw, 58px);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.005em;
  line-height: 1.16;
  margin: 0;
  max-width: 21em;
  text-wrap: balance;
}

.quote blockquote::before {
  content: "\201C";
  display: block;
  font-size: 1.6em;
  height: 0.5em;
  line-height: 0.9;
  margin-bottom: 0.1em;
  opacity: 0.5;
  color: var(--color-gold-ink);
}

.quote figcaption {
  align-items: baseline;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin-top: var(--space-6);
}

.quote__name,
.quote__place {
  color: var(--color-deep);
  font-family: var(--font-quote);
  font-size: 24px;
  font-style: italic;
  font-weight: 400;
}

.quote__place {
  color: rgba(16, 40, 30, 0.55);
}

.quote__place::before {
  content: "\2014\00a0";
}

.quotes__nav {
  display: flex;
  gap: 10px;
  margin-top: var(--space-7);
}

.quotes__dot {
  background: rgba(16, 40, 30, 0.22);
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  height: 8px;
  padding: 0;
  transition: width 0.4s ease, background 0.3s ease;
  width: 8px;
}

.quotes__dot.is-active {
  background: var(--color-deep);
  width: 30px;
}

/* ========== WHERE WE WORK + QUESTIONS ========== */
.home .service-area {
  background: var(--color-paper);
}

.home .faq {
  background: var(--color-sage-soft);
  padding: clamp(72px, 9vw, 120px) 0;
}

.home .faq__inner {
  align-items: start;
  display: grid;
  gap: clamp(32px, 6vw, 96px);
  grid-template-columns: minmax(0, 4fr) minmax(0, 7fr);
}

.faq__head {
  position: sticky;
  top: calc(var(--nav-height) + 36px);
}

.faq__more {
  color: var(--color-text-dark-secondary);
  line-height: 1.6;
  margin-top: var(--space-4);
}

.faq__more a {
  color: var(--color-deep);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ========== CLOSING CALL TO ACTION ========== */
.closing {
  background:
    radial-gradient(700px 360px at 85% 0%, rgba(201, 168, 76, 0.16), transparent 70%),
    var(--color-forest);
  color: var(--color-text-primary);
  padding: clamp(64px, 8vw, 112px) 0;
}

.closing__inner {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-6) var(--space-8);
  justify-content: space-between;
}

.closing__title {
  color: var(--color-text-primary);
  font-size: clamp(34px, 4.2vw, 58px);
  line-height: 1.05;
}

.closing__copy p {
  color: var(--color-text-secondary);
  font-size: var(--text-body-lg);
  line-height: 1.6;
  margin-top: var(--space-3);
  max-width: 30em;
}

.closing__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

/* ========== TABLETS AND PHONES ========== */
@media (max-width: 1080px) {
  .home .hero__inner {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  }
}

@media (max-width: 900px) {
  .home .hero {
    display: block;
    min-height: 0;
    padding: calc(var(--nav-height) + 20px) 0 36px;
  }

  .home .hero__inner {
    gap: var(--space-6);
    grid-template-columns: 1fr;
  }

  .home .hero__title {
    font-size: clamp(34px, 8.4vw, 50px);
  }

  .stage {
    justify-self: stretch;
    padding-left: 0;
    padding-bottom: 6px;
  }

  .stage__frame {
    aspect-ratio: 4 / 3;
    width: 100%;
  }

  .stage__done {
    bottom: auto;
    left: 50%;
    top: 14px;
  }

  .services__layout {
    grid-template-areas:
      "intro"
      "list";
    grid-template-columns: minmax(0, 1fr);
  }

  .svc-preview {
    display: none;
  }

  .svc-list {
    margin-top: var(--space-6);
  }

  .svc__link {
    gap: 16px;
    padding: 16px 0;
  }

  .svc__thumb {
    border-radius: 10px;
    display: block;
    flex: none;
    height: 82px;
    object-fit: cover;
    width: 82px;
  }

  .svc.is-active .svc__text {
    padding-left: 0;
  }

  .svc__text::before {
    display: none;
  }

  .svc__name {
    font-size: 21px;
  }

  .svc__desc {
    font-size: 15px;
    margin-top: 4px;
  }

  .visit__layout,
  .home .faq__inner {
    grid-template-columns: minmax(0, 1fr);
  }

  .faq__head {
    position: static;
  }
}

@media (max-width: 640px) {
  .home .hero__copy {
    font-size: 17px;
    margin-top: var(--space-4);
  }

  .home .hero__actions {
    margin-top: var(--space-5);
  }

  .home .hero__actions .button {
    flex: 1 1 100%;
  }

  .home .hero__note {
    display: none;
  }

  .stage__done {
    border-radius: 18px;
    flex-wrap: wrap;
    gap: 6px 10px;
    justify-content: center;
    padding: 12px 14px;
    white-space: normal;
    width: calc(100% - 28px);
  }

  .stage__done-text {
    flex: 1 1 100%;
    text-align: center;
  }

  .quote blockquote {
    font-size: clamp(26px, 7.4vw, 34px);
  }

  .closing__actions .button {
    flex: 1 1 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .broom__halo,
  .broom__hint span {
    animation: none;
  }

  .quote,
  .svc-preview__img,
  .svc__text,
  .svc__text::before {
    transition: none;
  }
}
