/* ==========================================================================
   Services page — hero + services grid overrides.
   Loads AFTER style.css so it can lean on the existing tokens + cursor
   + header behaviour from main.js.
   ========================================================================== */

/* ── Hero ─────────────────────────────────────────────────────────────── */
.svc-hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  padding: clamp(120px, 13vh, 160px) clamp(24px, 5vw, 72px) clamp(40px, 5vh, 72px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  /* Background inherited from <main> which uses --bg-primary (#fff3eb) —
     exact match with the homepage hero. */
  overflow: hidden;
}

/* Top-left kicker — small uppercase label above the headline. */
.svc-hero__kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-sans, 'Onest'), sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(13, 13, 13, 0.62);
}
.svc-hero__kicker::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent, #ff914d);
  box-shadow: 0 0 0 5px color-mix(in oklab, var(--accent, #ff914d) 22%, transparent);
}

/* ── Kinetic headline (Barlow Condensed 800) ─────────────────────────── */
.svc-hero__title {
  font-family: 'Barlow Condensed', 'Onest', sans-serif;
  font-weight: 800;
  /* Tightened so the full copy fits in a single viewport on ≥992px. */
  font-size: clamp(3rem, 8.6vw, 9.4rem);
  line-height: 0.86;
  letter-spacing: -0.015em;
  text-transform: uppercase;
  color: #0d0d0d;
  margin: clamp(14px, 2.4vh, 40px) 0 0;
  max-width: 100%;
}
.svc-hero__title .svc-hero__word {
  display: inline-block;
  will-change: transform, opacity;
}
.svc-hero__title .svc-hero__accent {
  color: var(--accent, #ff914d);
  font-style: italic;
  font-family: 'Instrument Serif', serif;
  font-weight: 400;
  letter-spacing: -0.01em;
}

/* ── Bottom row — tagline (left) + subhead (right) ───────────────────── */
.svc-hero__foot {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: clamp(24px, 4vw, 80px);
  align-items: end;
  margin-top: clamp(28px, 5vh, 64px);
}
.svc-hero__foot p {
  font-family: var(--font-sans, 'Onest'), sans-serif;
  font-weight: 400;
  font-size: clamp(14px, 1vw, 17px);
  line-height: 1.55;
  color: rgba(13, 13, 13, 0.7);
  margin: 0;
  max-width: 44ch;
}
.svc-hero__foot__right {
  justify-self: end;
  text-align: right;
}
.svc-hero__foot__right p { color: #0d0d0d; font-weight: 500; }

/* Small marker on the right side above the subhead */
.svc-hero__marker {
  font-family: var(--font-sans, 'Onest'), sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(13, 13, 13, 0.5);
  margin-bottom: 8px;
  display: block;
}

/* Ensure the fixed header from style.css sits on top of the hero cleanly.
   The site-wide header ::before uses --bg tokens, so no override needed. */

/* Reveal animation — headline words fade in + rise on load. */
@media (prefers-reduced-motion: no-preference) {
  .svc-hero__title .svc-hero__word {
    opacity: 0;
    transform: translateY(0.14em);
    animation: svc-word-in 0.9s var(--ease-out) both;
  }
  .svc-hero__title .svc-hero__word:nth-child(1) { animation-delay: 0.15s; }
  .svc-hero__title .svc-hero__word:nth-child(2) { animation-delay: 0.22s; }
  .svc-hero__title .svc-hero__word:nth-child(3) { animation-delay: 0.29s; }
  .svc-hero__title .svc-hero__word:nth-child(4) { animation-delay: 0.36s; }
  .svc-hero__title .svc-hero__word:nth-child(5) { animation-delay: 0.43s; }
  .svc-hero__title .svc-hero__word:nth-child(6) { animation-delay: 0.5s;  }
  .svc-hero__title .svc-hero__word:nth-child(7) { animation-delay: 0.57s; }
  .svc-hero__title .svc-hero__word:nth-child(8) { animation-delay: 0.64s; }
  .svc-hero__title .svc-hero__word:nth-child(9) { animation-delay: 0.71s; }
  .svc-hero__title .svc-hero__word:nth-child(10){ animation-delay: 0.78s; }
  .svc-hero__foot,
  .svc-hero__kicker {
    opacity: 0;
    animation: svc-word-in 0.8s var(--ease-out) 0.9s both;
  }
}
@keyframes svc-word-in {
  to { opacity: 1; transform: none; }
}

/* ==========================================================================
   Services grid — 2×2 tiles with hover-reveal inset panel + scroll fade-in
   ========================================================================== */
.svc-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid rgba(13, 13, 13, 0.14);
  background: var(--bg, #fff3eb);
  background-image: radial-gradient(rgba(13, 13, 13, 0.06) 1px, transparent 1px);
  background-size: 24px 24px;
}
.svc-tile {
  position: relative;
  padding: clamp(28px, 3.4vw, 64px);
  min-height: clamp(240px, 26vw, 340px);
  border-right: 1px solid rgba(13, 13, 13, 0.14);
  border-bottom: 1px solid rgba(13, 13, 13, 0.14);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
  background: transparent;
  /* JS injects a custom cursor — hide the OS cursor to prevent double
     cursor rendering. */
  cursor: none;
  opacity: 0;
  transform: translateY(var(--rise-lg));
  transition: opacity var(--dur-base) var(--ease-out),
              transform var(--dur-base) var(--ease-out),
              background-color var(--dur-fast) var(--ease-state),
              color var(--dur-fast) var(--ease-state);
}
.svc-tile,
.svc-tile * { cursor: none; }
.svc-tile:nth-child(2n)              { border-right: none; }
.svc-tile:nth-last-child(-n+2)       { border-bottom: none; }
.svc-grid.is-visible .svc-tile { opacity: 1; transform: translateY(0); }
/* 70ms step — the site-wide --stagger. Was 100ms here, 150ms on .ab-approach
   and 70ms on the heroes; three different cadences on pages reached from the
   same nav. The trailing 0s pair keeps hover colour instant. */
.svc-grid.is-visible .svc-tile:nth-child(1) { transition-delay: 0ms, 0ms, 0s, 0s; }
.svc-grid.is-visible .svc-tile:nth-child(2) { transition-delay: var(--stagger), var(--stagger), 0s, 0s; }
.svc-grid.is-visible .svc-tile:nth-child(3) { transition-delay: 140ms, 140ms, 0s, 0s; }
.svc-grid.is-visible .svc-tile:nth-child(4) { transition-delay: 210ms, 210ms, 0s, 0s; }

.svc-tile__num {
  position: absolute;
  top: clamp(20px, 2vw, 32px);
  left: clamp(24px, 3vw, 56px);
  font-family: var(--font-sans, 'Onest'), sans-serif;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.14em;
  color: rgba(13, 13, 13, 0.55);
  transition: color 0.5s var(--ease-in-out);
  z-index: 2;
}
.svc-tile__arrow {
  position: absolute;
  top: clamp(20px, 2vw, 32px);
  right: clamp(24px, 3vw, 56px);
  width: 26px;
  height: 26px;
  color: rgba(13, 13, 13, 0.5);
  transition: transform 0.5s var(--ease-in-out),
              color 0.5s var(--ease-in-out);
  z-index: 2;
}
.svc-tile__arrow svg { width: 100%; height: 100%; display: block; }

.svc-tile__body {
  position: relative;
  z-index: 2;
  padding: clamp(20px, 2vw, 32px);
  margin: 0 clamp(-20px, -2vw, -32px) clamp(-20px, -2vw, -32px);
  background: transparent;
  border-radius: 0;
  transition: background-color 0.5s var(--ease-in-out),
              color 0.5s var(--ease-in-out),
              margin 0.5s var(--ease-in-out),
              border-radius 0.5s var(--ease-in-out);
}
.svc-tile__title {
  font-family: 'Barlow Condensed', 'Onest', sans-serif;
  font-weight: 800;
  font-size: clamp(1.6rem, 2.2vw, 2.6rem);
  line-height: 1;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  color: #0d0d0d;
  margin: 0 0 clamp(12px, 1.4vh, 20px);
  transition: color 0.5s var(--ease-in-out);
}
.svc-tile__desc {
  font-family: var(--font-sans, 'Onest'), sans-serif;
  font-weight: 400;
  font-size: clamp(13px, 0.95vw, 15px);
  line-height: 1.55;
  color: rgba(13, 13, 13, 0.75);
  margin: 0;
  transition: color 0.5s var(--ease-in-out);
}

/* Hover — cell darkens, body wrapper reveals as an accent inset panel. */
.svc-tile:hover,
.svc-tile:focus-within {
  background-color: #0d0d0d;
  color: #fff3eb;
}
.svc-tile:hover .svc-tile__num,
.svc-tile:focus-within .svc-tile__num { color: rgba(255, 243, 235, 0.6); }
.svc-tile:hover .svc-tile__arrow,
.svc-tile:focus-within .svc-tile__arrow {
  color: #fff3eb;
  transform: translate(2px, -2px);
}
.svc-tile:hover .svc-tile__body,
.svc-tile:focus-within .svc-tile__body {
  background: var(--accent, #ff914d);
  color: #0d0d0d;
  margin: 0;
  border-radius: clamp(6px, 0.8vw, 12px);
}
.svc-tile:hover .svc-tile__title,
.svc-tile:focus-within .svc-tile__title { color: #0d0d0d; }
.svc-tile:hover .svc-tile__desc,
.svc-tile:focus-within .svc-tile__desc { color: rgba(13, 13, 13, 0.85); }

@media (prefers-reduced-motion: reduce) {
  .svc-tile { transition-duration: 0.001s; transform: none; opacity: 1; }
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 991.98px) {
  .svc-hero {
    padding: clamp(96px, 12vh, 140px) 24px 48px;
    min-height: auto;
  }
  .svc-hero__title { font-size: clamp(3rem, 14vw, 8rem); line-height: 0.9; }
  .svc-hero__foot { grid-template-columns: 1fr; gap: 24px; }
  .svc-hero__foot__right { justify-self: start; text-align: left; }

  .svc-tile { min-height: clamp(220px, 32vw, 300px); padding: clamp(24px, 4vw, 40px); }
  .svc-tile__title { font-size: clamp(1.4rem, 3.2vw, 2rem); }
}
@media (max-width: 767.98px) {
  .svc-grid { grid-template-columns: 1fr; }
  .svc-tile {
    border-right: none !important;
    border-bottom: 1px solid rgba(13, 13, 13, 0.14);
    min-height: auto;
    padding: 28px 24px;
  }
  .svc-tile:last-child { border-bottom: none; }
}
@media (max-width: 575.98px) {
  .svc-hero {
    padding: 92px 20px 40px;
  }
  .svc-hero__title {
    font-size: clamp(2.6rem, 14vw, 4.6rem);
  }
  .svc-hero__foot p { font-size: 13px; }
}
