/*
  The services page (/services): a Night header, then all eight services in rows on white, after Clay's services page
  (clay.global/services, measured 2026-10-23 at 390, 768, 1024 and 1440). Below 768 px the picture sits above the text.
  From 768 px the picture and the text share a row and the rows alternate sides, the first with its text on the left:
  the text is 5/12 wide and the picture half the row, at most 606 px, the home cards' picture width (Rahul, 2026-10-23),
  with the space between them left over.
  Clay's pictures are tall (10:13) photos of its work; ours are the 16:9 service pictures the home cards use (public/images/services/),
  shown 4:3 as there, so the object in the middle square is always whole. Each row's --service-color, its picture's own field color,
  fills the block while the picture loads. Load after type.css, nav.css and blog.css, which supply the page width and
  gutters, the colors (--night, --slate, --fg, --muted), the reset, the focus rings and the nav's current-page rule.
  Breakpoints are the blog's: 768, 1250, 1550 and 1900 px. The motion is the title arrow's nudge, as on the home cards, under a mouse, the
  pills' press, and the rows' stack (below): each row is held in the middle of the screen and the next slides up over it.
*/

.services-page { --services-ease: cubic-bezier(0.23, 1, 0.32, 1); }

/* ── Night header, the same block as /work's ── */
.services-hero { padding-top: 112px; padding-bottom: 56px; }
@media (min-width: 768px) { .services-hero { padding-top: 140px; padding-bottom: 72px; } }
@media (min-width: 1250px) { .services-hero { padding-top: 160px; padding-bottom: 88px; } }
.services-hero__title { color: var(--fg); }
.services-hero__intro { max-width: 34em; margin-top: 20px; color: var(--muted); }
@media (min-width: 768px) { .services-hero__intro { margin-top: 24px; } }
.services-hero__link { color: var(--fg); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.services-hero__link:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; border-radius: 2px; }

/* ── The rows ── */
.services-all { padding-top: 56px; padding-bottom: 80px; }
@media (min-width: 768px) { .services-all { padding-top: 80px; padding-bottom: 112px; } }
@media (min-width: 1250px) { .services-all { padding-top: 120px; padding-bottom: 160px; } }

.service-rows { display: grid; gap: 64px; }
@media (min-width: 768px) { .service-rows { gap: 96px; } }
@media (min-width: 1250px) { .service-rows { gap: 144px; } }

/* The nav's service links land here: clear of the floating bar (it ends 88 px down) */
.service-row { scroll-margin-top: 16px; }

/* ── The stack, as the home page's cards stack (Rahul, 2026-11-17: "The way these service cards stack on the home page, let's replicate
   that"; from 2026-11-16 each row was held alone in the middle of the screen). The numbers are the home page's (src/components/services/,
   after 21st.dev's stacking card). services-page.js sets [data-stack] when the tallest row fits the room under the nav bar; otherwise the
   rows are a plain list. Each row is then a white card as tall as the tallest, sticky at one place (--stack-top) and drawn a step lower
   than the row before it (--stack-step: 25 px from 768 px, 8 px on a phone, less on a short screen), so the top edges of the rows under
   it show. A held row shrinks from its top edge as later rows arrive and a row's picture zooms from 2 to 1 while the row comes up the
   screen (services-page.js; the zoom is the animation below where the browser has scroll-driven ones). The step and the shrink are
   transforms, so every row sticks and lets go at the same scroll position and the deck leaves the screen whole. A covered row gives
   up its shadow (--shade), or eight would read as a dark frame. With reduced motion the rows still stack and nothing shrinks or zooms.
   From 768 px the card has room inside; on a phone it runs to the screen's edges with the text at the usual gutter. ── */
.service-rows[data-stack] { gap: max(var(--stack-gap, 0px), 64px); overflow-anchor: none; }
.service-rows[data-stack] > .service-row {
  position: sticky; top: var(--stack-top); box-sizing: border-box; min-height: var(--stack-h, 0);
  border: 1px solid rgb(12 14 18 / 0.1); border-radius: 28px; background-color: #fff;
  /* --shade (services-page.js) is 1 on the top row and 0 once the next row covers this one: a covered row loses its shadow and takes a
     faint grey face, so the edges that show under the top card read as cards on a white page (the home page's are dark on dark) */
  background-color: color-mix(in srgb, #fff, rgb(12 14 18) calc(4% * (1 - var(--shade, 1))));
  box-shadow: 0 -12px 32px -12px rgb(12 14 18 / calc(0.12 * var(--shade, 1)));
  transform: translateY(calc(var(--i, 0) * var(--stack-step, 0px))); transform-origin: 50% 0;   /* services-page.js adds the shrink to it */
}
.service-rows > .service-row:nth-child(2) { --i: 1; }
.service-rows > .service-row:nth-child(3) { --i: 2; }
.service-rows > .service-row:nth-child(4) { --i: 3; }
.service-rows > .service-row:nth-child(5) { --i: 4; }
.service-rows > .service-row:nth-child(6) { --i: 5; }
.service-rows > .service-row:nth-child(7) { --i: 6; }
.service-rows > .service-row:nth-child(8) { --i: 7; }
.service-rows > .service-row:nth-child(9) { --i: 8; }
.service-rows > .service-row:nth-child(10) { --i: 9; }
@media (min-width: 768px) { .service-rows[data-stack] > .service-row { padding: 24px; } }
@media (max-width: 767px) {
  .service-rows[data-stack] > .service-row {
    display: flex; flex-direction: column; justify-content: center;
    margin-inline: calc(-1 * var(--gutter)); padding: 12px var(--gutter); border-width: 1px 0 0; border-radius: 24px 24px 0 0;
  }
}
/* The picture's zoom, tied to the row's way up the screen: from its top edge at the bottom of the screen to the hold (--zoom-run, set by
   services-page.js against the screen with a phone's toolbar showing, so the zoom is never still running when the row is held).
   [data-zooming] is on only while the row is on its way up: a held row's picture has no animation on it and is drawn sharp. */
@keyframes service-row-zoom { from { transform: scale(2); } to { transform: none; } }
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .service-rows[data-stack] > .service-row { view-timeline: --service-row block; }
    .service-rows[data-stack] > .service-row[data-zooming] .service-row__media img { animation: service-row-zoom linear both; animation-timeline: --service-row; animation-range: entry 0% entry var(--zoom-run, 100%); }
  }
}
@media (min-width: 768px) {
  .service-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
  .service-row:nth-child(odd) { flex-direction: row-reverse; }
}

.service-row__media { position: relative; aspect-ratio: 4 / 3; margin-bottom: 24px; overflow: hidden; border-radius: 16px; background-color: var(--service-color); }
.service-row__media img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; }
/* A picture shown whole, at its own 16:9, where the 4:3 crop would cut what matters (AI Training's side logos; Rahul, 2026-10-23) */
.service-row__media--whole { aspect-ratio: 2752 / 1536; }
@media (min-width: 768px) {
  .service-row__media { flex: none; width: min(606px, calc(50% - 8px)); margin-bottom: 0; }
  .service-row__content { flex: none; width: calc(41.6667% - 9.3333px); }
}

/* Each picture's own field color, as on the home cards (services.css says how it was sampled), so the block matches the picture's
   edges while it loads. They sit close to the service card palette (docs/service-cards/README.md). */
.service-row[data-service="local-seo"] { --service-color: #337AEE; }
.service-row[data-service="seo"] { --service-color: #FEC003; }
.service-row[data-service="web-design"] { --service-color: #FD3487; }
.service-row[data-service="meta-ads"] { --service-color: #FF2F25; }
.service-row[data-service="crm"] { --service-color: #0DB2CA; }
.service-row[data-service="automations"] { --service-color: #0FBA79; }
.service-row[data-service="custom-software"] { --service-color: #8146F5; }
.service-row[data-service="ai-training"] { --service-color: #FF8500; }

.service-row__title { margin-bottom: 16px; color: var(--night); }
@media (min-width: 768px) { .service-row__title { margin-bottom: 20px; } }
@media (min-width: 1250px) { .service-row__title { margin-bottom: 28px; } }
@media (min-width: 1900px) { .service-row__title { margin-bottom: 32px; } }

.service-row__pitch { margin-bottom: 32px; color: var(--night); text-wrap: pretty; }   /* no single word alone on the last line */
@media (min-width: 1250px) { .service-row__pitch { margin-bottom: 40px; } }

/* What each service covers: plain lines, as on Clay's */
.service-row__list { display: grid; gap: 12px; font-weight: 500; color: var(--night); }
/* The Bakersfield hub: one dated local result under the list */
.service-row__proof { max-width: 36em; margin-top: 24px; color: rgb(12 14 18 / 0.72); }
.service-row__proof .svc-link { color: var(--night); }

/* The title links to the service's own page; the arrow is the home cards' */
.service-row__link { color: inherit; text-decoration: none; }
.service-row__nowrap { white-space: nowrap; }
.service-row__arrow { display: inline-flex; width: 0.6em; height: 0.6em; margin-left: 0.2em; vertical-align: 0.04em; transition: transform 150ms var(--services-ease); }
.service-row__arrow svg { width: 100%; height: 100%; }
@media (hover: hover) and (pointer: fine) { .service-row__link:hover .service-row__arrow { transform: translate(4px, -4px); } }
@media (prefers-reduced-motion: reduce) { .service-row__arrow, .service-row__link:hover .service-row__arrow { transform: none; transition: none; } }

/* The pages under a service (registry.PAGES; docs/pages/make-pages.py writes the links): pills after its list, outlined in the Night hairline
   and lit in the row's own color when pointed at or reached by key; 44 px tall to tap. They link only pages that are written or placeholders. */
.service-row__subs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; }
.service-row__sub { display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; border: 1px solid rgb(12 14 18 / 0.22); border-radius: 9999px; color: var(--night); font-weight: 500; text-decoration: none; transition: background-color 150ms var(--services-ease), border-color 150ms var(--services-ease), scale 160ms var(--services-ease); }
.service-row__sub:focus-visible { outline: 2px solid var(--night); outline-offset: 3px; background-color: color-mix(in srgb, var(--service-color) 14%, transparent); border-color: var(--service-color); }
@media (hover: hover) and (pointer: fine) { .service-row__sub:hover { background-color: color-mix(in srgb, var(--service-color) 14%, transparent); border-color: var(--service-color); } .service-row__sub:hover .service-row__arrow { transform: translate(4px, -4px); } }
.service-row__sub:active { scale: 0.97; }   /* a press shrinks the pill a little, as the buttons do */
.service-row__sub .service-row__arrow { width: 0.8em; height: 0.8em; margin-left: 0.35em; vertical-align: 0; }
@media (prefers-reduced-motion: reduce) {
  .service-row__sub { transition: background-color 150ms var(--services-ease), border-color 150ms var(--services-ease); }
  .service-row__sub:active { scale: none; }
  .service-row__sub:hover .service-row__arrow { transform: none; }
}

/* ── Ways to act (the review of 2026-11-13): the free call and the phone under the intro and in the closing band, as on the service
   pages; each row ends on a button to its own page, and its picture is a second link there (out of the tab order) ── */
.services-hero__ask { max-width: 34em; margin-top: 28px; color: var(--fg); }
/* The Bakersfield hub: one line of regional facts under the intro (towns, meeting in person, hours) */
.services-hero__local { max-width: 40em; margin-top: 16px; color: var(--muted); }
.services-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 16px; }
.services-ghost {
  display: inline-flex; align-items: center; gap: 10px; height: 52px; padding: 0 24px; border-radius: 9999px;
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.28); color: #fff;
  transition: scale 160ms var(--ease-out), background-color 150ms var(--ease-out);
}
.services-ghost svg { width: 18px; height: 18px; }
.services-ghost:active { scale: 0.97; }
@media (hover: hover) and (pointer: fine) { .services-ghost:hover { background-color: rgb(255 255 255 / 0.08); } }
@media (max-width: 639.98px) { .services-actions { flex-direction: column; align-items: stretch; } .services-actions > a { justify-content: center; } }
:is(.services-hero, .services-band) .services-actions a:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

.service-row__media-link { position: absolute; inset: 0; display: block; }
.service-row__see {
  display: inline-flex; align-items: center; gap: 8px; height: 48px; margin-top: 28px; padding: 0 24px; border-radius: 9999px;
  box-shadow: inset 0 0 0 1.5px var(--night); color: var(--night);
  transition: scale 160ms var(--ease-out), background-color 150ms var(--ease-out), color 150ms var(--ease-out);
}
.service-row__see svg { width: 18px; height: 18px; }
.service-row__see:active { scale: 0.97; }
@media (hover: hover) and (pointer: fine) { .service-row__see:hover { background-color: var(--night); color: #fff; } }
.service-row__see:focus-visible { outline: 2px solid var(--anchor); outline-offset: 2px; }
.service-row__see + .service-row__subs { margin-top: 20px; }

.services-band { display: flex; flex-direction: column; align-items: center; gap: 20px; margin-top: 96px; padding: 56px 24px; border-radius: 28px; background-color: var(--night); color: #fff; text-align: center; }
@media (min-width: 768px) { .services-band { padding: 88px 56px; } }
@media (min-width: 1250px) { .services-band { margin-top: 144px; } }
.services-band__title { max-width: 15em; color: #fff; text-wrap: balance; }
.services-band__line { max-width: 30em; color: rgb(255 255 255 / 0.75); }
.services-band__local { max-width: 36em; color: rgb(255 255 255 / 0.6); }   /* the hub's towns and hours, under its band line (Rahul, 2026-11-16: out of the hero) */
.services-band .services-actions { justify-content: center; margin-top: 8px; }
@media (max-width: 639.98px) { .services-band .services-actions { align-self: stretch; } }

/* ── The hub's quotes: one card each, stacked on a phone and side by side from 1024 px ── */
.services-quotes { padding-top: 0; }   /* the rows' section already ends in its own space */
.services-quotes__grid { display: grid; gap: 24px; }
.services-quotes__grid .svc-quote__text { font-size: clamp(1.25rem, 1.146rem + 0.442vw, 1.5rem); line-height: 1.3; }   /* t-h4's size: two quotes in a row stay short on a phone and fit half a row from 1024 px */
@media (min-width: 1024px) {
  .services-quotes__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; }
  .services-quotes__grid .svc-quote { max-width: none; padding: 56px 40px; }
}

@media (prefers-reduced-motion: reduce) {
  .services-ghost, .service-row__see { transition: background-color 150ms var(--ease-out), color 150ms var(--ease-out); }
  .services-ghost:active, .service-row__see:active { scale: 1; }
}

/* Phones (last, so it wins over the rules above): a wider picture and less air, so a row fits a 390 x 844 phone's room under the nav and the stack can hold it there */
@media (max-width: 767px) {
  .service-row__media { aspect-ratio: 16 / 9; margin-bottom: 20px; }
  .service-row__title { margin-bottom: 12px; }
  .service-row__pitch { margin-bottom: 24px; }
  .service-row__list { gap: 8px; }
  .service-row__see { margin-top: 20px; }
  .service-row__see + .service-row__subs { margin-top: 16px; }
}

/* The Bakersfield hub: a list line that opens the page selling that part */
.service-row__inline { color: inherit; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; text-decoration-color: rgb(12 14 18 / 0.35); }
@media (hover: hover) and (pointer: fine) { .service-row__inline:hover { text-decoration-color: currentColor; } }
.service-row__inline:focus-visible { outline: 2px solid var(--night); outline-offset: 2px; border-radius: 2px; }
