/* Self-hosted fonts (latin subset) */
@font-face{font-family:"Libre Franklin";font-style:normal;font-weight:700;font-display:swap;src:url("../assets/fonts/libre-franklin-latin-700-normal.woff2") format("woff2")}
@font-face{font-family:"Roboto";font-style:normal;font-weight:400;font-display:swap;src:url("../assets/fonts/roboto-latin-400-normal.woff2") format("woff2")}
@font-face{font-family:"Roboto";font-style:normal;font-weight:500;font-display:swap;src:url("../assets/fonts/roboto-latin-500-normal.woff2") format("woff2")}
@font-face{font-family:"Roboto";font-style:normal;font-weight:700;font-display:swap;src:url("../assets/fonts/roboto-latin-700-normal.woff2") format("woff2")}
@font-face{font-family:"Roboto";font-style:italic;font-weight:400;font-display:swap;src:url("../assets/fonts/roboto-latin-400-italic.woff2") format("woff2")}

/* ==========================================================================
   Taurus Home Inspections — homepage
   Tokens come from the Figma variables (get_variable_defs).
   Mobile-first; breakpoints: 640 / 900 / 1200.
   ========================================================================== */

:root {
  /* brand */
  --brand-primary: #3e2824;
  --brand-accent: #00a9a7;
  --brand-secondary: #aed136;
  /* color roles */
  --color-text: #183052;
  --color-text-muted: #475569;
  --color-surface: #f8fafc;
  --color-border: #d8c6a5;
  --color-button-bg: #3e2824;
  --color-button-text: #f8fafc;
  /* type */
  --font-heading: "Libre Franklin", system-ui, sans-serif;
  --font-body: "Roboto", system-ui, sans-serif;
  /* spacing (Figma space-* scale) */
  --space-2: 2px;
  --space-8: 8px;
  --space-12: 12px;
  --space-16: 16px;
  --space-20: 20px;
  --space-24: 24px;
  --space-32: 32px;
  --space-48: 48px;
  --space-64: 64px;
  /* layout */
  --container-max: 1200px;
  --gutter: 24px;
  --section-spacing: 48px;
  --radius-button: 4px;
  --radius-lg: 16px;
}

*, *::before, *::after { box-sizing: border-box; }
/* No CSS scroll-behavior: smooth here. It makes reloads animate back to the old scroll position.
   Smooth anchor scrolling is done in main.js for link clicks only. */
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 24px;
  color: var(--color-text);
  background: #fff;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
h1, h2, h3, p, ul { margin: 0; }
a { color: inherit; }

.container {
  width: 100%;
  max-width: calc(var(--container-max) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

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

/* ---------- Typography ---------- */
.eyebrow {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 13px;
  line-height: 16px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand-accent);
}
.h2 {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 28px;
  line-height: 36px;
  color: var(--brand-primary);
}
.h3 {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 22px;
  line-height: 28px;
  color: var(--brand-primary);
}
.body-lg { font-weight: 500; font-size: 20px; line-height: 28px; }
@media (min-width: 900px) {
  .h2 { font-size: 32px; line-height: 40px; }
  .h3 { font-size: 24px; line-height: 30px; }
}

/* ---------- Button ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-12);
  padding: var(--space-16);
  background: var(--color-button-bg);
  color: var(--color-button-text);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 16px;
  line-height: 20px;
  text-decoration: none;
  border-radius: var(--radius-button);
  border: 0;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color .15s ease;
}
.btn:hover { background: #2a1a17; }
.btn:focus-visible, .nav a:focus-visible, summary:focus-visible, .nav-toggle:focus-visible {
  outline: 3px solid var(--brand-accent);
  outline-offset: 2px;
}
.btn img { width: 16px; height: 16px; }

/* ---------- Header ---------- */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  border-bottom: 1px solid var(--color-border); background: #fff;
}
/* Header is fixed, so reserve its full-size height; anchors stop below the condensed header */
:root { --header-h: 129px; }
html { scroll-padding-top: 96px; }
body { padding-top: var(--header-h); }
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-16);
  padding-block: var(--space-16);
  position: relative;
}
.logo img { width: 96px; height: 96px; }
.header-actions { display: flex; align-items: center; gap: var(--space-12); }
.header-cta { display: none; }

.nav-toggle {
  width: 48px; height: 48px;
  display: inline-flex; align-items: center; justify-content: center;
  background: none; border: 1px solid var(--color-border); border-radius: var(--radius-button);
  color: var(--brand-primary); cursor: pointer;
}
.nav-toggle svg { width: 24px; height: 24px; }
.nav-toggle .icon-close { display: none; }
.nav-toggle[aria-expanded="true"] .icon-open { display: none; }
.nav-toggle[aria-expanded="true"] .icon-close { display: block; }

.nav {
  display: none;
  position: absolute;
  top: 100%; left: 0; right: 0;
  background: #fff;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  padding: var(--space-16) var(--gutter) var(--space-24);
  z-index: 20;
}
.nav.is-open { display: block; max-height: calc(100vh - 80px); overflow-y: auto; }
.nav ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; }
.nav a {
  display: block;
  padding: 14px 0;
  font-weight: 500;
  line-height: 20px;
  color: var(--brand-primary);
  text-decoration: none;
  border-bottom: 1px solid var(--color-border);
}
.nav .btn { display: flex; margin-top: var(--space-16); width: 100%; padding: var(--space-16); border-bottom: 0; color: var(--color-button-text); text-decoration: none; }
.nav a:hover { text-decoration: underline; }

@media (min-width: 900px) {
  :root { --header-h: 197px; }
  .site-header__inner {
    display: block;
    height: 196px;           /* matches Figma header: logo top-left, CTA top-right, nav bottom-right */
    padding-block: var(--space-24);
  }
  .logo img { width: 150px; height: 150px; }
  .nav-toggle { display: none; }
  .header-actions { position: absolute; top: 39px; right: var(--gutter); }
  .header-cta { display: inline-flex; }
  .nav {
    display: block;
    position: absolute;
    top: auto; bottom: 28px; right: var(--gutter); left: auto;
    padding: 0; border: 0; background: none;
  }
  .nav ul { flex-direction: row; gap: var(--space-32); }
  .nav a { padding: 0; border: 0; }
  .nav .btn { display: none; }
}

/* ---------- Hero ---------- */
.hero__inner {
  display: grid;
  gap: var(--space-32);
  padding-top: var(--section-spacing);
}
.hero h1 {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: clamp(40px, 11vw, 72px);
  line-height: 1.08;
  color: var(--brand-primary);
}
.hero__subhead {
  margin-top: var(--space-20);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: clamp(24px, 5vw, 32px);
  line-height: 1.25;
  color: var(--brand-accent);
}
.hero__copy { margin-top: var(--space-20); display: grid; gap: 24px; }
.hero__actions { margin-top: var(--space-20); }
.hero__media img { width: 100%; height: auto; max-height: 500px; object-fit: contain; }
@media (min-width: 900px) {
  .hero__inner { grid-template-columns: 563fr 552fr; gap: var(--space-48); align-items: start; }
}

/* ---------- Story ---------- */
.story {
  position: relative;
  isolation: isolate;
  padding-block: 172px var(--section-spacing);   /* clears the torn paper edge on small screens */
  background: #fff;
}
.story::before {
  content: "";
  position: absolute; inset: 0; z-index: -1;
  /* Paper on top of an opaque white copy of its shape, so the hero house can slide in from behind it */
  background:
    url("../assets/story-torn.webp") bottom center / 100% 100% no-repeat,
    url("../assets/story-torn-solid.webp") bottom center / 100% 100% no-repeat;
}
.story__copy { max-width: 725px; margin-inline: auto; text-align: center; display: grid; gap: var(--space-20); }
.story__copy .body { display: grid; gap: 24px; }
@media (min-width: 640px) { .story { padding-top: 136px; } }
@media (min-width: 900px) { .story { padding-top: 120px; } }

/* ---------- Video band ---------- */
.band {
  background-color: var(--brand-primary);
  position: relative;
  isolation: isolate;
  padding-block: var(--section-spacing);
}
.band::before {
  content: "";
  position: absolute; inset: 0; z-index: -1;
  background: url("../assets/pattern-brown.webp") top left / 576px auto repeat;
  opacity: .25;
}
.band__inner { display: grid; gap: var(--space-24); justify-items: center; text-align: center; }
.band h2 { color: #fff; }
.video {
  position: relative;
  display: block;
  width: 100%;
  max-width: 672px;
  aspect-ratio: 672 / 379;
  background: #000;
}
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video__btn { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; background: #000; cursor: pointer; }
.video__btn img { width: 100%; height: 100%; object-fit: cover; display: block; }
.video__btn:hover .video__play, .video__btn:focus-visible .video__play { background: #c00; }
.video__btn:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.video__play {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 68px; height: 48px; border-radius: 12px; background: #f00; display: grid; place-items: center;
}
.video__play::before {
  content: ""; border-style: solid; border-width: 10px 0 10px 18px; border-color: transparent transparent transparent #fff; margin-left: 4px;
}

/* ---------- Services (accordion) ---------- */
.section { padding-block: var(--section-spacing); }
.section__head { display: grid; gap: var(--space-20); }
.section__head p:last-child { max-width: 685px; }
.faq-list { margin-top: var(--space-20); display: grid; gap: var(--space-20); }
.faq {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  padding: var(--space-24);
}
.faq summary {
  list-style: none;
  display: flex;
  align-items: flex-start;
  gap: var(--space-16);
  cursor: pointer;
}
.faq summary::-webkit-details-marker { display: none; }
.faq__icon { width: 67px; height: 55px; flex: none; object-fit: contain; }
.faq__titles { flex: 1; min-width: 0; }
.faq__titles .h3 { display: block; }
.faq__titles .body-lg { display: block; color: var(--color-text); }
.faq__toggle {
  flex: none; width: 24px; height: 24px;
  font-family: var(--font-heading); font-weight: 700; font-size: 24px; line-height: 30px;
  color: var(--brand-secondary); text-align: center;
}
.faq__toggle::before { content: "+"; }
.faq[open] .faq__toggle::before { content: "\2212"; }
.faq__body { margin-top: var(--space-12); display: grid; gap: 24px; }
.faq__body ul { padding-left: 24px; margin: 0; }
.faq__body li + li { margin-top: 0; }
.faq[open] .faq__body { padding-bottom: 24px; }   /* Figma keeps a trailing blank line */
.services .section__head p:last-child { max-width: 615px; }
@media (max-width: 639px) {
  .faq summary { flex-wrap: wrap; }
  .faq__icon { width: 50px; height: 41px; }
  .faq__titles { flex-basis: calc(100% - 50px - 24px - 32px); }
  .faq__titles .body-lg { font-size: 18px; line-height: 26px; }
}

/* ---------- Pricing ---------- */
.pricing {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding-block: var(--section-spacing);
}
.pricing::before, .footer::before {
  content: "";
  position: absolute; inset: 0; z-index: -2;
  background: url("../assets/paper-bg.webp") bottom center / 100% 100% no-repeat;
}
.pricing::after {
  content: "";
  position: absolute; inset: 0; z-index: -1;
  background: url("../assets/buildings-bg.svg") bottom center / auto 100% no-repeat;
  pointer-events: none;
}
.cards { display: grid; gap: var(--space-24); grid-template-columns: 1fr; }
.pricing .cards { margin-top: var(--space-20); }
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  padding: var(--space-24);
  display: grid; align-content: start; gap: var(--space-16);
}
.card--shadow { filter: drop-shadow(2px 2px 2px rgba(24, 48, 82, .25)); }
.card__icon { height: 60px; width: auto; }
.pricing__note { margin-top: var(--space-20); font-style: italic; max-width: 781px; }
@media (min-width: 640px) { .pricing .cards { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 899px) and (min-width: 640px) { .pricing .cards { grid-template-columns: 1fr 1fr; } }

/* ---------- About (why Taurus) ---------- */
.why .cards { margin-top: var(--space-20); }
@media (min-width: 640px) { .why .cards { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1000px) { .why .cards { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1000px) { .why .card { min-height: 249px; } }

/* ---------- Inspector ---------- */
.inspector {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding-block: var(--section-spacing) 176px;   /* clears the torn paper edge along the bottom */
  background: #fff;
}
.inspector::before {
  content: "";
  position: absolute; inset: 0; z-index: -2;
  background: url("../assets/torn-edge.webp") bottom center / 100% 100% no-repeat;
  transform: scaleX(-1);   /* Figma mirrors this layer; torn edge sits along the bottom */
}
.inspector__watermark {
  position: absolute; z-index: -1;
  right: calc(50% - 600px + 24px);
  top: 52px; width: 274px; height: 320px;
  opacity: .1;
  transform: scaleX(-1);
  display: none;
}
.inspector__inner { display: grid; gap: var(--space-32); position: relative; }
.photo { position: relative; width: min(100%, 520px); margin-inline: auto; padding: 24px 18px 8px; }
.photo__frame {
  position: relative;
  aspect-ratio: 484 / 550;
  overflow: hidden;
  box-shadow: 4px 4px 4px rgba(0, 0, 0, .25);
  transform: rotate(-2deg);
}
.photo__frame img { position: absolute; width: 100%; height: 132.2%; top: -24.84%; left: .35%; max-width: none; object-fit: cover; }
.photo__pin { position: absolute; top: 0; left: 50%; margin-left: -20px; width: 65px; height: 65px; z-index: 2; }
.inspector__copy { display: grid; gap: var(--space-20); align-content: start; }
.inspector__copy .h3 { color: var(--color-text); }
.inspector__copy .body { display: grid; gap: 24px; }
@media (min-width: 640px) { .inspector { padding-block: var(--section-spacing) 152px; } }
@media (min-width: 900px) {
  .inspector { padding-block: var(--section-spacing) 120px; }
  .inspector__inner { grid-template-columns: 520px 1fr; gap: var(--space-48); align-items: start; }
  .inspector__watermark { display: block; }
  .photo { margin: 0; width: 520px; padding: 29px 18px 0; }
}
@media (min-width: 1200px) { .inspector__watermark { right: calc(50% - 600px + 0px); } }

/* ---------- Reviews ---------- */
.reviews .carousel {
  margin-top: var(--space-20);
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 85%;
  gap: var(--space-24);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 2px 2px 8px;
  -webkit-overflow-scrolling: touch;
}
.review {
  scroll-snap-align: start;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  padding: var(--space-24);
  display: flex; flex-direction: column; gap: var(--space-16);
}
.review__stars { display: flex; height: 40px; }
.review__stars img { width: 24px; height: 24px; }
.review blockquote { margin: 0; font-weight: 500; font-size: 20px; line-height: 28px; }
.review figcaption, .review cite { font-size: 14px; line-height: 22px; font-style: normal; }
.reviews__cta { margin-top: var(--space-24); }
@media (min-width: 900px) {
  .reviews .carousel { grid-auto-flow: row; grid-template-columns: repeat(3, 1fr); grid-auto-columns: auto; overflow: visible; }
}

/* ---------- Footer / contact ---------- */
.footer {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding-block: var(--space-48);
  text-align: center;
}
.footer::after {
  content: "";
  position: absolute; inset: 0; z-index: -1;
  background: url("../assets/footer-buildings.svg") bottom center / auto 100% no-repeat;
  pointer-events: none;
}
.footer__inner { display: grid; gap: var(--space-24); justify-items: center; }
.footer__lead { max-width: 750px; display: grid; gap: 0; }
.footer__lead strong a { text-decoration: underline; }
.footer__contact { font-weight: 500; font-size: 20px; line-height: 28px; }
.footer__contact a { text-decoration: underline; }
.footer__divider { width: 100%; height: 2px; background: var(--color-border); margin-top: var(--space-8); }
.footer__legal { font-size: 12px; line-height: 18px; color: var(--color-text-muted); }
.footer__legal a { text-decoration: underline; }
.footer .h2 { margin-top: -4px; }

/* ---------- Scroll effects (progressive enhancement; skipped for reduced motion) ---------- */
@media (prefers-reduced-motion: no-preference) {
  /* Fade and rise. Only hidden when JS has added .js to <html>, so content never depends on scripts */
  .js .reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity .6s ease, transform .6s ease;
    transition-delay: var(--reveal-delay, 0s);
  }
  .js .reveal.is-visible { opacity: 1; transform: none; }

  /* Pushpin drops in once the photo is on screen */
  .js .photo .photo__pin { opacity: 0; transform: translateY(-36px) scale(1.25) rotate(-18deg); }
  .js .photo.is-visible .photo__pin {
    opacity: 1; transform: none;
    transition: opacity .25s ease .45s, transform .5s cubic-bezier(.3, 1.5, .5, 1) .45s;
  }

  /* Smooth accordion open/close (browsers without ::details-content just snap, as before) */
  @supports selector(::details-content) {
    .faq { interpolate-size: allow-keywords; }
    .faq::details-content {
      block-size: 0; overflow: hidden;
      transition: block-size .35s ease, content-visibility .35s allow-discrete;
    }
    .faq[open]::details-content { block-size: auto; }
  }
}

/* ---------- Sticky header: condenses after scrolling ---------- */
.site-header { transition: box-shadow .25s ease; }
.site-header.is-scrolled { box-shadow: 0 2px 14px rgba(24, 48, 82, .12); }
.site-header__inner { transition: padding .25s ease, height .25s ease; }
.logo img { transition: width .25s ease, height .25s ease; }
.site-header.is-scrolled .site-header__inner { padding-block: 8px; }
.site-header.is-scrolled .logo img { width: 56px; height: 56px; }

@media (min-width: 900px) {
  .site-header.is-scrolled .site-header__inner { height: 80px; padding-block: 8px; }
  .site-header.is-scrolled .logo img { width: 64px; height: 64px; }
  .header-actions, .nav { transition: top .25s ease, bottom .25s ease, right .25s ease, transform .25s ease; }
  .site-header.is-scrolled .header-actions { top: 50%; transform: translateY(-50%); }
  /* Nav moves onto the same row, left of the CTA (--cta-w is measured in main.js) */
  .site-header.is-scrolled .nav {
    bottom: auto; top: 50%; transform: translateY(-50%);
    right: calc(var(--gutter) + var(--cta-w, 220px) + var(--space-32));
  }
}
@media (prefers-reduced-motion: reduce) {
  .site-header, .site-header__inner, .logo img, .header-actions, .nav { transition: none; }
}

/* Hero illustration rises up from behind the torn paper of the story section on page load.
   Transform only (no opacity), so the image paints immediately and LCP isn't delayed.
   The story section sits above the hero (z-index) and has no solid background, so
   its paper covers the house while the transparent area above the tear shows it. */
.hero { position: relative; z-index: 0; }
.story { z-index: 1; background: transparent; }
@media (prefers-reduced-motion: no-preference) {
  .hero__media img { animation: hero-rise 1.1s cubic-bezier(.2, .7, .2, 1) .15s both; }
}
@keyframes hero-rise {
  from { transform: translateY(170px); }
  to   { transform: none; }
}
