/* Brixwood Builders — Services (1000vh pinned scroll stage, ten services) */

/* This page is a dark surface in both themes — there is no light ground here
   to dim — so a second palette bought nothing and turned every photograph
   teal. body carries data-theme="light" and the whole page reads the neutral
   set, whatever the toggle says. The toggle still works and is still
   remembered; Home and Enquire still switch. Only this page sits it out.

   --svc-mark is declared here rather than on :root because a custom property
   resolves its var()s where it is declared: one left up on :root would still
   come out of the dark palette even though everything beneath it is light. */
body { --svc-mark: var(--accent-hover); }

/* The canvas behind the page comes from html, which sits outside the pinned
   scope and so would still be dark-mode --bg in the rubber-band overscroll at
   the top and bottom of a phone. Clearing it lets body's own background
   propagate up instead, so that seam matches the page in both themes. */
html { background: none; }
body { background: var(--surf); }

/* fixed nav row, top-centre, over the dark stage */
.svc-nav-wrap {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  justify-content: center;
  pointer-events: none;
}
.svc-nav-wrap .nav-row { pointer-events: auto; }
/* the wordmark and the Enquire link belong to the phone bar only — this page's
   desktop bar is the plate alone, and always has been */
.svc-nav-wrap .brand-logo-link { display: none; }
/* the menu button sits on the dark stage, so its plus reads from the on-surface
   ramp rather than --ink (which would be near-invisible here) */
.svc-nav-wrap .site-menu-toggle { color: var(--on-surf); }

.svc-stage {
  position: relative;
  height: 1000vh;
  background: var(--surf);
  font-family: var(--font-body);
  font-weight: 450;
}
.svc-pin {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  background: var(--surf);
}

/* crossfading striped backgrounds, one per service */
.svc-bg {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  transform: scale(1.04);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.svc-bg.is-active { opacity: 1; transform: scale(1); }

/* the photograph, over the striped plate — mirrors .rail__card-img on the
   home page, so a file that is missing shows the plate instead of a blank.

   This one fills the viewport, so the frame is wide on a laptop and tall on a
   phone, and a single landscape photo would be cropped to its middle third on
   a phone. services.js hands over both framings; the choice is made on screen
   shape rather than a width breakpoint, so a phone held sideways correctly
   gets the wide one.

   On a tall screen the two are layered rather than chosen between: the tall
   framing paints over the wide one, so a service that has no tall file falls
   back to its wide photograph instead of losing it. A var() fallback cannot
   do this — the variable is always set, and CSS has no way to know the file
   behind it is missing. */
.svc-bg__img {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-image: var(--photo-wide);
}
@media (max-aspect-ratio: 1 / 1) {
  .svc-bg__img { background-image: var(--photo-tall), var(--photo-wide); }
}

/* Tint, sitting over the photograph and under the copy. A flat fill and not a
   blur or a filter: both of those are a per-frame pass over the whole viewport
   while the stage scrolls, which is what costs a cheap phone its frame rate.
   This is one composited rectangle. Strength is --photo-tint in main.css. */
.svc-bg__img::after {
  content: "";
  position: absolute;
  inset: 0;
  background: color-mix(in srgb, var(--surf) var(--photo-tint), transparent);
}

.svc-content {
  position: relative;
  z-index: 4;
  box-sizing: border-box;
  height: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 76px 56px 48px;
  display: flex;
  flex-direction: column;
}

.svc-headwrap {
  width: 100vw;
  position: relative;
  left: 50%;
  transform: translateX(-50%);
  box-sizing: border-box;
  padding: 0 28px;
  margin-top: -38px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 40px;
}
.svc-headwrap__inner {
  margin-left: 15px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}
.svc-eyebrow {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 32px;
  line-height: 1.02;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  color: var(--on-surf);
}
.svc-head {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 29.2px;
  line-height: 1.12;
  letter-spacing: -0.022em;
  font-weight: 600;
  color: var(--on-surf-3);
  white-space: nowrap;
}

.svc-grid {
  flex: 1;
  width: 100vw;
  position: relative;
  left: 50%;
  transform: translateX(-50%);
  box-sizing: border-box;
  padding: 0 28px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.9fr) minmax(0, 1.35fr);
  align-items: center;
  gap: 48px;
  min-height: 0;
}

.svc-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-start;
}
.svc-row {
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 20px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--on-surf-2);
  transform: translateX(0);
  filter: blur(0.4px);
  opacity: 0.62;
  transition:
    color 0.45s ease, transform 0.45s ease, font-size 0.45s ease,
    letter-spacing 0.45s ease, filter 0.45s ease, opacity 0.45s ease;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  background: transparent;
  border: 0;
  padding: 0;
  text-align: left;
}
.svc-row.is-active {
  font-weight: 800;
  font-size: 22px;
  letter-spacing: 0.02em;
  color: var(--on-surf);
  transform: translateX(10px);
  filter: blur(0);
  opacity: 1;
}
.svc-row__hit {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 44px;
  transform: translateY(-50%);
}
.svc-row__dot {
  width: 5px;
  height: 5px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--svc-mark);
  opacity: 0;
  transition: opacity 0.45s ease;
}
.svc-row.is-active .svc-row__dot { opacity: 1; }

.svc-notes {
  position: relative;
  align-self: center;
  min-height: 190px;
  display: flex;
  justify-content: flex-end;
}
.svc-note {
  position: absolute;
  top: 0;
  right: 0;
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  opacity: 0;
  filter: blur(4px);
  transform: translateY(14px);
  transition: opacity 0.6s ease, filter 0.6s ease, transform 0.6s ease;
  pointer-events: none;
}
.svc-note.is-above { transform: translateY(-14px); }
.svc-note.is-active {
  opacity: 1;
  filter: blur(0);
  transform: translateY(0);
  pointer-events: auto;
}
.svc-note p {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 350;
  font-size: 14px;
  line-height: 1.72;
  letter-spacing: 0.005em;
  color: var(--on-surf-3);
  text-wrap: pretty;
}

.svc-progress {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.svc-progress__track {
  position: relative;
  width: 220px;
  height: 1.5px;
  background: var(--hair);
}
.svc-progress__fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0%;
  background: var(--svc-mark);
  opacity: 0.55;
}

/* Narrow screens carry the list alone. The descriptions are dropped rather than
   stacked: a homeowner already knows what a loft conversion is, and a note that
   re-writes itself while you scroll down to read it fights the scroll. The list
   keeps its 28px left offset and its type size — losing the note frees the
   height that was crushing it. */
@media (max-width: 820px) {
  /* 100vh per service is one wheel-flick on a desktop but nearly two thumb
     swipes on a phone; 60vh keeps the same choreography at a walkable pace */
  .svc-stage { height: 600vh; }

  .svc-content { padding: 66px 24px 36px; }
  /* the desktop heading tucks up under the centred nav; with the nav on its own
     row at phone widths that -38px pulls it straight into the links */
  .svc-headwrap { margin-top: 0; padding: 0 28px; }
  .svc-grid {
    grid-template-columns: 1fr;
    gap: 22px;
    align-content: center;
  }
  .svc-grid > .svc-mid,
  .svc-grid > .svc-notes { display: none; }
}


/* ----------------------------------------------------------- phone (720) */
/* The one page whose bar sits on the dark surface. Services pins its body to
   the light set, so --bg here is the light grey of every other page and would
   be badly wrong over the photograph — everything below reads from the
   on-surface ramp instead. No hairline either: a near-black strip against a
   photograph needs no help separating itself. */
@media (max-width: 720px) {
  .svc-nav-wrap {
    align-items: center;
    padding: 4px var(--page-pad-x-fluid) 0;
    transition: background-color 220ms var(--ease);
  }
  .is-scrolled .svc-nav-wrap { background: var(--surf); }

  .svc-nav-wrap .brand-logo-link,
  .svc-nav-wrap .top-enquire {
    display: inline-flex;
    pointer-events: auto;          /* the wrap itself is pointer-events: none */
  }
  .svc-nav-wrap .brand-logo-link { color: var(--on-surf); }
  .svc-nav-wrap .top-enquire { color: var(--on-surf-2); }
  .svc-nav-wrap .top-enquire:hover { color: var(--on-surf); }
}
