/* Below-fold styles. Critical CSS (variables, reset, nav, hero) is inlined in <style> in index.html for render performance. */

/* ---------------- 02 / Services ---------------- */
.services {
  min-height: 100svh;
  padding: clamp(6rem, 14vh, 10rem) var(--pad-x);
  /* Angled top edge — pitched like incoming section */
  clip-path: polygon(0 5%, 100% 0, 100% 100%, 0 100%);
  margin-top: -8%;
  padding-top: clamp(8rem, 18vh, 14rem);
  background: var(--slate);
}

.service-rows {
  border-bottom: 1px solid var(--line);
}

.service-row {
  display: grid;
  grid-template-columns: 3.5rem minmax(0, 1.15fr) minmax(0, 1fr);
  gap: clamp(1.25rem, 3vw, 3rem);
  align-items: start;
  padding: clamp(1.75rem, 4vh, 2.75rem) 0;
  border-top: 1px solid var(--line);
  position: relative;
  overflow: hidden;
  transition: background-color 0.35s var(--ease-snap);
}

/* Orange left bar slides in on hover */
.service-row::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--orange);
  transform: scaleY(0);
  transform-origin: top center;
  transition: transform 0.4s var(--ease-snap);
}

.service-row:hover::before,
.service-row:focus-within::before {
  transform: scaleY(1);
}

.service-idx {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  color: var(--orange);
  padding-top: 0.5em;
}

.service-title {
  font-family: var(--font-display);
  font-weight: 600;
  text-transform: uppercase;
  font-size: clamp(1.7rem, 3.8vw, 3.3rem);
  line-height: 1.02;
  color: var(--off-white);
}

.service-title-text {
  position: relative;
  display: inline-block;
}

/* Orange underline wipe on hover */
.service-title-text::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -0.07em;
  height: 0.085em;
  background: var(--orange);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.45s var(--ease-snap);
}

.service-row:hover .service-title-text::after,
.service-row:focus-within .service-title-text::after {
  transform: scaleX(1);
}

.service-meta {
  margin-top: 0.7rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  color: var(--grey-55);
}

.service-desc {
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--body-text);
  max-width: 46ch;
  padding-top: 0.45em;
}

/* ---------------- 03 / On the Roof ---------------- */
.roof-section {
  background: var(--slate-deep);
  clip-path: polygon(0 5%, 100% 0, 100% 100%, 0 100%);
  margin-top: -4rem;
  padding-top: 4rem;
}

.roof-media {
  position: relative;
  height: 62svh;
  overflow: hidden;
  will-change: clip-path;
}

.roof-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.8) contrast(1.08);
}

.roof-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(34, 37, 42, 0.65) 0%, rgba(34, 37, 42, 0.12) 35%, rgba(34, 37, 42, 0.78) 100%),
    linear-gradient(90deg, rgba(244, 123, 32, 0.06), transparent 55%);
}

.roof-overlay {
  position: relative;
  padding: 2.75rem var(--pad-x) 4.5rem;
}

.roof-label {
  display: block;
  margin-bottom: 2rem;
}

.ws-note {
  max-width: 26rem;
  margin-bottom: 1.4rem;
  padding: 1.1rem 1.3rem;
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--body-text);
  background: rgba(34, 37, 42, 0.72);
  border-left: 2px solid var(--orange);
}

.ws-note-key {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.28em;
  color: var(--orange);
  margin-bottom: 0.55rem;
}

.roof-title {
  margin-top: 2.5rem;
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
  font-size: clamp(2.8rem, 8.5vw, 7.5rem);
  line-height: 0.96;
  color: var(--off-white);
}

@media (min-width: 768px) {
  .roof-section {
    min-height: 100svh;
  }

  .roof-media {
    position: absolute;
    inset: 0;
    height: 100%;
  }

  .roof-overlay {
    position: absolute;
    inset: 0;
    padding: 0;
  }

  .roof-label {
    position: absolute;
    top: 7%;
    left: var(--pad-x);
    margin: 0;
  }

  .ws-note {
    position: absolute;
    margin: 0;
  }

  .ws-note-1 {
    top: 17%;
    left: var(--pad-x);
  }

  .ws-note-2 {
    top: 36%;
    right: var(--pad-x);
  }

  .ws-note-3 {
    bottom: 11%;
    left: var(--pad-x);
  }

  .roof-title {
    position: absolute;
    right: var(--pad-x);
    bottom: 8%;
    margin: 0;
    text-align: right;
  }
}

/* ---------------- 04 / Our Promise ---------------- */
.promise {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(6rem, 14vh, 10rem) var(--pad-x);
  clip-path: polygon(0 5%, 100% 0, 100% 100%, 0 100%);
  margin-top: -4rem;
  padding-top: clamp(8rem, 18vh, 14rem);
  background: var(--slate);
}

.manifesto-text {
  margin-top: 2.5rem;
  max-width: 1100px;
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
  font-size: clamp(2.1rem, 5.6vw, 4.9rem);
  line-height: 1.05;
  color: var(--off-white);
}

.manifesto-sub {
  margin-top: clamp(2.5rem, 6vh, 4rem);
  margin-left: clamp(0rem, 30vw, 24rem);
  max-width: 46ch;
  font-size: 1.02rem;
  line-height: 1.7;
  color: var(--body-text);
}

/* ---------------- 05 / Numbers ---------------- */
.numbers {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(6rem, 14vh, 10rem) var(--pad-x);
  background: var(--slate-raise);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  clip-path: polygon(0 5%, 100% 0, 100% 100%, 0 100%);
  margin-top: -4rem;
  padding-top: clamp(8rem, 18vh, 14rem);
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(2rem, 4vw, 3.5rem) clamp(1.5rem, 3vw, 2.5rem);
}

.stat {
  border-top: 1px solid var(--line);
  padding-top: 1.5rem;
}

.stat-num-row {
  display: flex;
  align-items: baseline;
  gap: 0.3rem;
  font-family: var(--font-mono);
}

.stat-num {
  font-size: clamp(2.4rem, 5.5vw, 4.6rem);
  font-weight: 500;
  line-height: 1;
  color: var(--off-white);
  font-variant-numeric: tabular-nums;
}

.stat-suffix {
  font-size: clamp(1.3rem, 2.8vw, 2.4rem);
  font-weight: 500;
  color: var(--orange);
}

.stat-label {
  margin-top: 0.9rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  color: var(--grey-55);
}

/* ---------------- 06 / Clients ---------------- */
.clients {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(6rem, 14vh, 10rem) var(--pad-x);
  clip-path: polygon(0 5%, 100% 0, 100% 100%, 0 100%);
  margin-top: -4rem;
  padding-top: clamp(8rem, 18vh, 14rem);
  background: var(--slate-deep);
}

.clients > .sec-label {
  margin-bottom: clamp(3rem, 8vh, 5rem);
}

.clients-inner {
  position: relative;
  max-width: 62rem;
}

.quote + .quote {
  margin-top: 3.5rem;
}

/* Stacked for the pinned crossfade — applied by JS on desktop only */
.clients.clients-pinned .clients-inner {
  display: grid;
}

.clients.clients-pinned .quote {
  grid-area: 1 / 1;
  margin-top: 0;
}

.review-stars { color: #f47b20; font-size: 1rem; letter-spacing: 0.1em; }

.quote-text {
  font-size: clamp(1.4rem, 3.2vw, 2.5rem);
  font-weight: 500;
  line-height: 1.32;
  color: var(--off-white);
}

.quote-mark {
  font-family: var(--font-display);
  color: var(--orange);
  margin-right: 0.3rem;
}

.quote-cite {
  margin-top: 2.25rem;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.24em;
  color: var(--grey-55);
}

.quote-cite cite {
  font-style: normal;
  color: var(--off-white);
}

/* ---------------- 07 / Areas ---------------- */
.areas {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(6rem, 14vh, 10rem) var(--pad-x);
  clip-path: polygon(0 5%, 100% 0, 100% 100%, 0 100%);
  margin-top: -4rem;
  padding-top: clamp(8rem, 18vh, 14rem);
  background: var(--slate);
}

.areas-intro {
  margin-top: 1.25rem;
  max-width: 40ch;
  font-size: clamp(1.05rem, 1.8vw, 1.4rem);
  color: var(--body-text);
}

.area-rows {
  border-bottom: 1px solid var(--line);
}

.area-row {
  position: relative;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
  padding: clamp(1rem, 2.6vh, 1.9rem) 0;
  border-top: 1px solid var(--line);
}

/* Orange marker bar slides in on hover */
.area-row::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 2rem;
  height: 4px;
  margin-top: -2px;
  background: var(--orange);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.45s var(--ease-snap);
}

.area-row:hover::before {
  transform: scaleX(1);
}

.area-name {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
  font-size: clamp(2.2rem, 8vw, 7.25rem);
  line-height: 1;
  color: var(--grey);
  transition: transform 0.5s var(--ease-snap), color 0.4s var(--ease-snap);
}

.area-row:hover .area-name {
  transform: translateX(2.9rem);
  color: var(--off-white);
}

.area-meta {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.24em;
  color: var(--grey-55);
  white-space: nowrap;
  transition: color 0.4s var(--ease-snap);
}

.area-row:hover .area-meta {
  color: var(--orange);
}

/* ---------------- 08 / Quote + footer ---------------- */
.book {
  padding: clamp(7rem, 15vh, 11rem) var(--pad-x) 2.5rem;
  background: var(--slate-deep);
  overflow: hidden;
  clip-path: polygon(0 5%, 100% 0, 100% 100%, 0 100%);
  margin-top: -4rem;
  padding-top: clamp(9rem, 18vh, 14rem);
}

/* Orange bar at top of footer instead of hazard stripe */
.orange-bar-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--orange);
}

.book-head {
  margin-top: 1.5rem;
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
  font-size: clamp(2.6rem, 8.8vw, 8rem);
  line-height: 0.97;
  color: var(--off-white);
}

.book-line {
  display: block;
  overflow: hidden;
  padding-bottom: 0.045em;
}

.book-line-inner {
  display: inline-block;
  will-change: transform;
}

.book-accent {
  color: var(--orange);
}

.book-phone {
  position: relative;
  display: inline-block;
  margin-top: clamp(2rem, 5vh, 3.25rem);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.8rem, 4.5vw, 3.6rem);
  letter-spacing: 0.03em;
  line-height: 1;
  color: var(--off-white);
  padding-bottom: 0.18em;
  transition: color 0.35s var(--ease-snap);
}

.book-phone::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 5px;
  background: var(--orange);
}

.book-phone:hover,
.book-phone:focus-visible {
  color: var(--orange);
}

.book-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 2.5rem 2rem;
  margin-top: clamp(5rem, 12vh, 8rem);
  padding-top: 3rem;
  border-top: 1px solid var(--line);
}

.book-col-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.28em;
  color: var(--orange);
  margin-bottom: 1rem;
}

.book-col p {
  font-size: 0.94rem;
  line-height: 1.75;
  color: var(--body-text);
}

.book-col a {
  border-bottom: 1px solid transparent;
  transition: color 0.3s var(--ease-snap), border-color 0.3s var(--ease-snap);
}

.book-col a:hover,
.book-col a:focus-visible {
  color: var(--off-white);
  border-color: var(--orange);
}

.book-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem 2rem;
  margin-top: clamp(4rem, 9vh, 6rem);
  padding-top: 1.75rem;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  color: var(--grey-35);
}

/* ---------------- Responsive ---------------- */
@media (max-width: 1024px) {
  .book-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 899px) {
  .hero-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 3rem;
    padding-top: 7.5rem;
    padding-bottom: 6.5rem;
  }

  .pitch-wrap {
    justify-self: center;
    width: min(76vw, 400px);
  }

  .service-row {
    grid-template-columns: 2.75rem minmax(0, 1fr);
  }

  .service-desc {
    grid-column: 2;
    padding-top: 0;
  }

  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .manifesto-sub {
    margin-left: 0;
  }
}

/* Reduce clip-path angles on mobile for smaller diagonal steps */
@media (max-width: 767px) {
  .hero {
    clip-path: polygon(0 0, 100% 0, 100% 94%, 0 100%);
    padding-bottom: 6%;
  }

  .services,
  .roof-section,
  .promise,
  .numbers,
  .clients,
  .areas,
  .book {
    clip-path: polygon(0 3%, 100% 0, 100% 100%, 0 100%);
    margin-top: -2rem;
  }

  .nav-links {
    display: none;
  }

  .hero-idx {
    top: 5.25rem;
  }

  .area-row:hover .area-name {
    transform: translateX(1.6rem);
  }

  .area-row::before {
    width: 1.1rem;
  }
}

@media (max-width: 560px) {
  .stats {
    grid-template-columns: minmax(0, 1fr);
  }

  .book-meta {
    grid-template-columns: minmax(0, 1fr);
  }

  .book-foot {
    flex-direction: column;
  }

  .nav-cta {
    font-size: 0.74rem;
    padding: 0.5em 0.85em;
  }

  .nav-brand {
    font-size: 1rem;
  }
}

/* ---------------- Reduced motion ---------------- */
/* body.no-motion is added by JS under prefers-reduced-motion:
   everything renders in its final, static state */
.no-motion .cue-line {
  display: none;
}

.no-motion .hero-sweep {
  width: 100vw;
}

.no-motion .clients.clients-pinned .clients-inner {
  display: block;
}

.no-motion .clients.clients-pinned .quote + .quote {
  margin-top: 3.5rem;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
