/* ==========================================================
   SERVICES PAGE
   Design language inherited from the Home page: pure-black
   canvas, degular display type, Inter body, uppercase
   orange-dot eyebrows, hairline dividers, zero shadows.
   Typography resolves to the global tokens in /css/main.css —
   no new scale is introduced here.

   The service list is a two-column editorial layout:
   LEFT  = orange number + title + capabilities
   RIGHT = short description + a 3-image showcase
   Rows are separated by a thin hairline. Scroll-reveal motion
   lives in /js/services-animations.js.
========================================================== */

main {
  --svc-gutter: clamp(1.25rem, 4vw, 2rem);
}


/* ==========================================================
   HERO  — two stacked zones inside one 100vh view:
   UPPER  = the oversized "Services" wordmark, centred both ways,
            with a hairline divider (2rem inset) on its lower edge.
   MIDDLE = the row of service tags that jump-scroll to each entry.
   LOWER  = eyebrow + a 2-line section heading on the LEFT and a
            4-line supporting paragraph on the RIGHT, sitting on
            the bottom padding (2rem).
========================================================== */

.services-hero {
  /* the minimum space above and below the tag row — the two are always
     equal, so the row sits centred between the wordmark and the heading */
  --svc-hero-gap: clamp(1.5rem, 4vh, 2.75rem);

  min-height: 100vh;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;

  /* top clears the fixed 70px header (header.css), so the free space is
     measured from under the bar; sides are the same gutter as the service
     list below — 2rem on desktop, easing to 1.25rem on phones */
  padding: 70px var(--svc-gutter) 2rem;
}

/* UPPER ZONE — the wordmark, centred across the page.

   The free height of the hero is shared out by three equal auto margins:
   above the wordmark, between the wordmark and the tags, and between the
   tags and the heading. The last two being equal is what centres the tag
   row between "Services" and the heading at any screen height. (The zone
   used to be flex: 1 and swallow all the free space itself, which left
   the tags hard against the heading: 197px of space above them, 81px
   below.) */
.services-hero__top {
  flex: 0 0 auto;
  margin-block: auto;
  display: flex;
  align-items: center;
  justify-content: center;

  /* border-bottom: 1px solid rgba(255, 255, 255, 0.14); */
}

.services-hero__word {
  margin: 0;
  text-align: center;
  /* tight leading + no descenders makes the glyphs sit visually high in
     their box — nudge down so it reads centred between header and line */
  transform: translateY(0.06em);

  font-family: var(--dz-font-display);
  font-size: clamp(3.25rem, 22vw, 22rem);
  line-height: 0.86;
  font-weight: var(--dz-heading-weight);
  letter-spacing: -0.02em;
  color: var(--dz-heading-color);
  white-space: nowrap;
}

/* ---- LOWER ZONE — heading left, paragraph right, sitting on the 2rem
   bottom padding; only as tall as its own content (same as About) ---- */

.services-hero__statement {
  flex: 0 0 auto;
  width: 100%;

  /* the same gap as above the tags, less the empty band the heading font
     carries above its capitals (~0.14em). Without that the tags are
     centred on the boxes, and read ~11px high against the letters. */
  padding-top: calc(var(--svc-hero-gap) - 0.14 * var(--dz-page-hero-size));
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  justify-content: space-between;
  gap: clamp(2rem, 7vw, 7rem);
  text-align: left;
}

.services-hero__col {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
}

.services-hero__eyebrow.dz-eyebrow {
  margin-bottom: clamp(1.25rem, 3vw, 1.75rem);
}

/* section-sized heading — copy + max-width tuned to wrap to 2 lines */
/* shared page-hero scale from main.css — identical on every page */
.services-hero__heading {
  margin: 0;
  max-width: 20ch;

  font-family: var(--dz-font-display);
  font-size: var(--dz-page-hero-size);
  line-height: var(--dz-page-hero-line);
  font-weight: var(--dz-heading-weight);
  letter-spacing: var(--dz-heading-tracking);
  color: var(--dz-heading-color);
}

/* supporting copy — right column, ~4 lines, sits on the heading's baseline */
.services-hero__para {
  flex: 0 1 44ch;
  max-width: 44ch;
  margin: 0 0 0.35em;

  font-family: var(--dz-font-body);
  font-size: var(--dz-body-size);
  line-height: var(--dz-body-line);
  color: var(--dz-body-color);
}

@media (max-width: 820px) {
  .services-hero__statement {
    flex-direction: column;
    align-items: flex-start;
    gap: clamp(1.5rem, 5vw, 2.5rem);
  }

  .services-hero__heading {
    max-width: 24ch;
  }

  .services-hero__para {
    flex-basis: auto;
    max-width: 52ch;
    margin-bottom: 0;
  }
}

/* in-flow row between the wordmark and the statement — never fixed /
   sticky. margin-bottom: auto is the third of the hero's equal auto
   margins (see .services-hero__top), so the space under the row always
   matches the space over it. */
.services-hero__tags {
  position: static;
  display: flex;
  justify-content: center;
  padding-top: var(--svc-hero-gap);
  margin-bottom: auto;
}

.services-hero__tags-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2rem;
}

.svc-tag {
  padding: 0.6rem 1.15rem;

  font-family: var(--dz-font-body);
  font-size: 0.9rem;
  color: rgba(var(--dz-fg-rgb), calc(0.62 + var(--dz-text-lift)));

  /* opaque so the hairline doesn't show through the pill */
  background: var(--dz-surface-1);
  border: 1px solid rgba(var(--dz-fg-rgb), 0.08);
  /* border-radius: 9px; */
  cursor: pointer;

  transition: color 0.25s ease, background-color 0.25s ease, border-color 0.25s ease;
}

.svc-tag:hover,
.svc-tag:focus-visible {
  color: var(--dz-fg);
  background: var(--dz-surface-3);
  border-color: rgba(var(--dz-fg-rgb), 0.22);
  outline: none;
}

/* ==========================================================
   SERVICE LIST
========================================================== */

.services-list {
  padding: 0 var(--svc-gutter);

  /* Full-width lines at both ends of the list: the top one opens it
     under the hero, above Branding; the bottom one closes it off above
     the footer (where the FAQ section's line used to be). They sit on
     the list itself, outside its side padding, so they run edge to edge
     — the lines between the rows stay inside the gutter. */
  border-top: 1px solid rgba(var(--dz-fg-rgb), 0.1);
  border-bottom: 1px solid rgba(var(--dz-fg-rgb), 0.1);
}

.svc-row {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 2fr);
  gap: clamp(2rem, 6vw, 6rem);
  align-items: start;

  padding: clamp(3rem, 6vw, 5.5rem) 0;

  /* jump-scroll target: keep the row clear of the fixed header */
  scroll-margin-top: clamp(84px, 12vh, 120px);
}

/* hairline between rows (the one above Branding is the list's own
   full-width top border) */
.svc-row + .svc-row {
  border-top: 1px solid rgba(var(--dz-fg-rgb), 0.1);
}


/* ---- Left column ---- */

.svc-row__num {
  display: block;
  font-family: var(--dz-font-display);
  font-size: 0.95rem;
  font-weight: var(--dz-medium-weight);
  letter-spacing: 0.02em;
  color: var(--dz-accent);
  font-variant-numeric: tabular-nums;
}

.svc-row__title {
  margin: clamp(0.9rem, 1.6vw, 1.35rem) 0 0;

  font-family: var(--dz-font-display);
  font-size: clamp(3rem, 4vw, 4rem);
  font-weight: var(--dz-heading-weight);
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--dz-fg);
  overflow-wrap: break-word;
  hyphens: manual;
}

.svc-row__caps {
  list-style: none;
  margin: clamp(1.75rem, 3vw, 2.5rem) 0 0;
  padding: 0;
}

.svc-row__caps li {
  display: flex;
  gap: 0.75rem;

  font-family: var(--dz-font-body);
  font-size: 1rem;
  line-height: 1.5;
  color: rgba(var(--dz-fg-rgb), calc(0.6 + var(--dz-text-lift)));
}

.svc-row__caps li + li {
  margin-top: clamp(0.7rem, 1.4vw, 1.1rem);
}

.svc-row__caps li::before {
  content: "\2014";               /* em dash */
  flex: 0 0 auto;
  color: rgba(var(--dz-fg-rgb), calc(0.38 + var(--dz-text-lift)));
}


/* ---- Right column ---- */

.svc-row__desc {
  margin: 0;
  max-width: 92ch;

  font-family: var(--dz-font-body);
  font-size: var(--dz-body-size);
  line-height: var(--dz-body-line);
  color: var(--dz-body-color);
}

.svc-row__shots {
  margin-top: clamp(2rem, 4vw, 3rem);

  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(0.75rem, 1.4vw, 1.25rem);
}

/* the frame — fixed size, clips the zoom. The scroll-in reveal
   (js/services-animations.js) moves the frame, so the image's own
   transform is left free for the hover. */
.svc-shot {
  overflow: hidden;
  background: rgba(var(--dz-fg-rgb), 0.04);
}

/* black and white at rest; on hover it turns to colour and zooms
   in a little inside its frame */
.svc-row__shots img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;

  filter: grayscale(1);
  transform: scale(1);
  transition:
    filter 0.6s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.svc-shot:hover img {
  filter: grayscale(0);
  transform: scale(1.08);
}


/* ==========================================================
   RESPONSIVE
========================================================== */

/* Tablet — keep two columns, tighten */
@media (max-width: 960px) {
  .services-hero__row {
    grid-template-columns: 1fr;
    gap: 1.75rem;
  }

  .svc-row {
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.9fr);
    gap: clamp(1.5rem, 4vw, 3rem);
  }
}

/* Mobile — single column, reordered:
   number, title, description, capabilities, images (stacked) */
@media (max-width: 1024px) {
  .svc-row {
    display: flex;
    flex-direction: column;
    gap: 0;
  }

  /* dissolve the column wrappers so every piece is a direct flex
     item of .svc-row and can be reordered */
  .svc-row__left,
  .svc-row__right {
    display: contents;
  }

  .svc-row__num    { order: 1; }
  .svc-row__title  { order: 2; }
  .svc-row__desc   { order: 3; margin-top: clamp(1.1rem, 4vw, 1.5rem); max-width: none; }
  .svc-row__caps   { order: 4; margin-top: clamp(1.5rem, 5vw, 2rem); }
  .svc-row__shots  { order: 5; grid-template-columns: 1fr; }

  .svc-row__shots img {
    aspect-ratio: 16 / 10;
  }
}


/* ==========================================================
   FAQ  — ported from the Contact page, scoped to .services-faq
   so it can't collide with anything else. Type resolves to the
   global tokens; the display size is kept from Contact for
   visual parity. Accordion behaviour: services-animations.js.
========================================================== */

.services-faq {
  width: 100%;
  box-sizing: border-box;
  padding: clamp(4rem, 9vw, 7rem) var(--svc-gutter);
  border-top: 1px solid rgba(var(--dz-fg-rgb), 0.1);
}

/* .dz-eyebrow supplies the dot + type; override only the rhythm */
.services-faq .faq-label.dz-eyebrow {
  margin-bottom: clamp(2rem, 5vh, 2.75rem);
}

.services-faq .faq-title {
  max-width: 980px;
  margin: 0 0 clamp(2.5rem, 5vw, 3.2rem);

  font-family: var(--dz-font-display);
  font-size: clamp(4rem, 7vw, 7rem);
  line-height: 0.92;
  font-weight: var(--dz-heading-weight);
  letter-spacing: -0.05em;
  color: var(--dz-fg);
}

.services-faq .faq-list {
  border-top: 1px solid rgba(var(--dz-fg-rgb), 0.12);
}

.services-faq .faq-item {
  border-bottom: 1px solid rgba(var(--dz-fg-rgb), 0.12);
}

.services-faq .faq-header {
  min-height: 75px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
  cursor: pointer;
  user-select: none;
}

.services-faq .faq-header span {
  font-family: var(--dz-font-body);
  font-size: 1.25rem;
  line-height: 1.45;
  font-weight: var(--dz-medium-weight);
  color: rgba(var(--dz-fg-rgb), calc(0.7 + var(--dz-text-lift)));
  transition: color 0.35s ease;
}

.services-faq .faq-header i {
  flex-shrink: 0;
  font-size: 1.65rem;
  color: rgba(var(--dz-fg-rgb), calc(0.35 + var(--dz-text-lift)));
  transition: color 0.35s ease, transform 0.35s ease;
}

.services-faq .faq-item:hover .faq-header span,
.services-faq .faq-item.active .faq-header span,
.services-faq .faq-item:hover .faq-header i,
.services-faq .faq-item.active .faq-header i {
  color: var(--dz-fg);
}

.services-faq .faq-answer {
  height: 0;
  overflow: hidden;
  will-change: height;
}

.services-faq .faq-content {
  max-width: 760px;
  padding: 12px 0;
}

.services-faq .faq-content p {
  margin: 0;
  font-family: var(--dz-font-body);
  font-size: 1rem;
  line-height: 1.9;
  color: rgba(var(--dz-fg-rgb), calc(0.62 + var(--dz-text-lift)));
}

@media (max-width: 1024px) {
  .services-faq .faq-title {
    font-size: 3.5rem;
    margin-bottom: 2.5rem;
  }
  .services-faq .faq-header { min-height: 70px; }
  .services-faq .faq-header span { font-size: 1.05rem; }
  .services-faq .faq-content { padding: 0 0 1.6rem; }
}

@media (max-width: 540px) {
  .services-faq .faq-title { font-size: 3rem; }
  .services-faq .faq-header { gap: 1rem; }
  .services-faq .faq-header span { font-size: 1rem; line-height: 1.5; }
  .services-faq .faq-header i { font-size: 1.45rem; }
}


/* ==========================================================
   PHONE  (≤ 767px) — shared mobile system from main.css
   · "Services" runs gutter to gutter (3.45em measured width)
   · the jump tags wrap as a tight cloud of chips
   · each service's three images become a swipeable strip that
     snaps one frame at a time, with the next frame peeking in —
     the page is a third of the height it was when they stacked
========================================================== */
@media (max-width: 1024px) {
  main {
    --svc-gutter: var(--dz-gutter);
  }

  .services-hero {
    min-height: 100svh;
    padding: 64px var(--svc-gutter) 1.75rem;
  }

  .services-hero__word {
    font-size: calc((100vw - 2 * var(--dz-gutter)) / 3.45);
  }

  .services-hero__tags-list {
    gap: 0.5rem;
  }

  .svc-tag {
    padding: 0.5rem 0.85rem;
    font-size: 0.85rem;
  }

  .svc-row {
    padding: 3.5rem 0;
  }

  .svc-row__shots {
    display: flex;
    gap: 0.75rem;
    margin-inline: calc(-1 * var(--svc-gutter));
    padding-inline: var(--svc-gutter);
    scroll-padding-inline: var(--svc-gutter);
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .svc-row__shots::-webkit-scrollbar {
    display: none;
  }

  /* each frame is 82% of the strip, so the next one peeks in */
  .svc-shot {
    flex: 0 0 auto;
    width: 82%;
    scroll-snap-align: start;
  }

  .svc-row__shots img {
    aspect-ratio: 4 / 5;
  }

  .services-faq {
    padding: var(--dz-section-py) var(--svc-gutter);
  }

  .services-faq .faq-title {
    font-size: clamp(2.5rem, 12vw, 3rem);
  }
}


/* ==========================================================
   REDUCED MOTION — services-animations.js skips its tweens;
   nothing here needs to change since content ships visible.
========================================================== */
@media (prefers-reduced-motion: reduce) {
  .services-faq .faq-answer { will-change: auto; }
}

/* the heading's hard line break leaves "and" orphaned on a phone —
   let the text wrap (balanced) instead of forcing it */
@media (max-width: 600px) {
  .services-hero__heading br {
    display: none;
  }

  .services-hero__heading {
    text-wrap: balance;
  }
}

/* very small phones (≤ 359px): the stacked title is the widest thing
   on the page — step it down so "Development" fits the 20px gutters */
@media (max-width: 359px) {
  .svc-row__title {
    font-size: clamp(1.9rem, 10.5vw, 2.4rem);
    overflow-wrap: anywhere;
  }
}

/* ==========================================================
   TEMPORARY — no service images on phones and tablets (≤ 1024px)
   Each row shows its title, description and capabilities only. The
   images are still in the markup and still show on desktop; delete
   this block to bring them back on small screens.
========================================================== */
@media (max-width: 1024px) {
  .svc-row__shots {
    display: none;
  }
}
