/* ==========================================================================
   Home 03 — "What I Actually Do": five service cards + CTA strip
   Markup: resources/views/components/services/*.blade.php
   Data: config/site.php (services) · config/services_section.php (copy, look)

   Grid: 1 column (compact cards) → 2 + a wide 5th (640) → 3 + 2 (960) →
   5 in a row (1200), where subgrid lines up art, titles, lists and links
   across all five so they read as one system.
   Motion: transform/opacity only; reduced motion is handled in base.css.
   ========================================================================== */

.svc {
  --svc-pad: calc(var(--hdr-inset) + var(--hdr-pad));   /* same content edge as the header and hero */
  --svc-tile-shadow:
    0 10px 22px -12px rgb(15 23 42 / 0.30),
    0 2px 4px rgb(15 23 42 / 0.06),
    inset 0 -2px 0 rgb(15 23 42 / 0.05);

  background: var(--warm-50);
  padding-block: clamp(48px, 5.5vw, 88px); /* owner 2026-09-29: no wasted space */
}

.svc__wrap {
  max-width: var(--hdr-max);
  margin-inline: auto;
  padding-inline: var(--svc-pad);
}

/* ---- Head ---------------------------------------------------------------- */

.svc__head {
  display: grid;
  gap: 18px 40px;
  margin-bottom: clamp(28px, 3.6vw, 48px);
}

@media (min-width: 1024px) {
  .svc__head {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
  }
}

/* One step under the hero H1 (max 3.75rem there, 4.5rem at 1024+). */
.svc__title {
  margin: 14px 0 0;
  color: var(--ink-900);
  font-size: clamp(2.25rem, 1.3rem + 3.4vw, 4rem);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.svc__lede {
  max-width: 48rem;
  margin-top: 16px;
  color: var(--slate-700);
  font-size: clamp(1.0625rem, 0.98rem + 0.35vw, 1.3125rem);
  line-height: 1.5;
  text-wrap: pretty;
}

/* ---- Handwritten note ---------------------------------------------------- */

.svc-note {
  position: relative;
  justify-self: end;
  width: max-content;
  padding: 0 4px 44px 0;
  color: var(--slate-700);
  transform: rotate(-5deg);
}

.svc-note__text {
  font-family: var(--font-hand);
  font-size: 1rem;
  line-height: 1.3;
}

@media (min-width: 640px) {
  .svc-note__text { font-size: 1.125rem; }
}

@media (max-width: 639.98px) {
  .svc-note { margin-top: -6px; padding-bottom: 44px; }
  .svc-note__arrow { left: -18px; width: 42px; height: 40px; }
}

.svc-note__text span { display: block; }

.svc-note__arrow {
  position: absolute;
  left: -22px;
  bottom: -4px;
  width: 52px;
  height: 48px;
  color: var(--ink-900);
}

@media (min-width: 1024px) {
  .svc-note { margin-right: clamp(0px, 5vw, 88px); padding-bottom: 52px; }
  .svc-note__text { font-size: 1.4375rem; }
  .svc-note__arrow { left: -30px; width: 62px; height: 58px; }
}

/* Arrow draws itself when the head scrolls in (only if it started off-screen). */
.svc__head.reveal .svc-note__arrow path { stroke-dasharray: 100; stroke-dashoffset: 100; }
.svc__head.reveal.is-in .svc-note__arrow path {
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 700ms var(--ease-out) 350ms;
}

/* ---- Grid ------------------------------------------------------------------ */

.svc__grid {
  display: grid;
  gap: 14px;
}

/* Each card is a size container (wide-card layouts below); switched off at 1200 for subgrid. */
.svc-card { container: svc-card / inline-size; }

@media (min-width: 640px) {
  .svc__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  .svc-card:last-child { grid-column: 1 / -1; }
}

@media (min-width: 960px) {
  .svc__grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .svc-card { grid-column: span 2; }
  .svc-card:nth-child(n + 4) { grid-column: span 3; }
}

@media (min-width: 1200px) {
  .svc__grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    grid-template-rows: repeat(5, auto);
    column-gap: 16px;
    row-gap: 0;
  }
  .svc-card,
  .svc-card:nth-child(n + 4),
  .svc-card:last-child {
    container-type: normal; /* containment would stop the subgrid; no container queries needed here */
    grid-column: auto;
    grid-row: span 5;
    display: grid;
    grid-template-rows: subgrid;
  }
}

/* ---- Card -------------------------------------------------------------------- */

.svc-card__body {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 24px 22px 18px;
  border: 1px solid var(--tone-line);
  border-radius: var(--r-xl);
  background: linear-gradient(180deg, var(--tone-bg) 0%, color-mix(in srgb, var(--tone-bg) 30%, var(--paper)) 72%);
  box-shadow: 0 1px 2px rgb(15 23 42 / 0.04), 0 14px 30px -24px rgb(15 23 42 / 0.30);
  transition: transform var(--t-base) var(--ease-out), border-color var(--t-base) var(--ease-out);
}

/* Hover shadow on a pseudo-element so only its opacity animates. */
.svc-card__body::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  box-shadow: 0 28px 50px -30px rgb(15 23 42 / 0.40);
  opacity: 0;
  transition: opacity var(--t-base) var(--ease-out);
  pointer-events: none;
}

@media (min-width: 1200px) {
  .svc-card__body {
    grid-row: 1 / -1;
    display: grid;
    grid-template-rows: subgrid;
  }
}

@media (hover: hover) {
  .svc-card__body:hover { transform: translateY(-4px); border-color: var(--tone-edge); }
  .svc-card__body:hover::before { opacity: 1; }
  .svc-card__body:hover .svc-card__link .icon { transform: translateX(4px); }
}

.svc-card__body:focus-within { border-color: var(--tone-edge); }

.svc-card__art {
  height: 104px;
  margin-bottom: 20px;
}

.svc-card__title {
  margin: 0;
  color: var(--ink-900);
  font-size: 1.375rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.svc-card__summary {
  margin-top: 10px;
  color: var(--slate-700);
  font-size: 0.9375rem;
  line-height: 1.5;
}

.svc-card__more { margin-top: 20px; }

.svc-card__toggle { display: none; }

.svc-card__features {
  display: grid;
  gap: 10px;
  padding-top: 18px;
  border-top: 1px solid var(--tone-line);
}

.svc-card__features li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--slate-800);
  font-size: 0.9375rem;
  line-height: 1.35;
}

.svc-card__features .icon {
  flex-shrink: 0;
  margin-top: 1px;
  color: var(--tone-mark);
}

.svc-card__link {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 8px;
  min-height: 44px;
  margin-top: auto;
  padding-top: 18px;
  color: var(--tone-ink);
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
}

@media (min-width: 1200px) {
  /* Titles share one row: sit each on the row's floor so the summary follows it
     directly (a one-line title gets the spare space above, next to the art). */
  .svc-card__title { align-self: end; }
  .svc-card__features { gap: 9px; }
  .svc-card__features li { font-size: 0.875rem; }
  .svc-card__link { align-self: end; }
}

/* The whole card is the link's hit area; the ring is drawn around the card. */
.svc-card__link::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
}

.svc-card__link:focus-visible { outline: none; }
.svc-card__link:focus-visible::after {
  outline: 2px solid var(--color-focus);
  outline-offset: 3px;
  border-radius: var(--r-xl);
}

.svc-card__link .icon { transition: transform var(--t-base) var(--ease-out); }

/* Wide cards (the 3 + 2 bottom row, the 5th card on tablets): features in two columns. */
@media (min-width: 640px) {
  @container svc-card (min-width: 420px) {
    .svc-card__features { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 20px; }
  }

  /* Full-width 5th card on tablets: art | text | features side by side. */
  @container svc-card (min-width: 600px) {
    .svc-card__body {
      display: grid;
      grid-template-columns: 136px minmax(0, 1fr) minmax(0, 1.15fr);
      grid-template-areas:
        "art title   more"
        "art summary more"
        "art link    more";
      grid-template-rows: auto auto 1fr;
      column-gap: 28px;
      align-items: start;
    }
    .svc-card__art { grid-area: art; margin: 0; }
    .svc-card__title { grid-area: title; }
    .svc-card__summary { grid-area: summary; }
    .svc-card__more { grid-area: more; margin: 0; }
    .svc-card__features { grid-template-columns: 1fr; padding-top: 0; border-top: 0; }
    .svc-card__link { grid-area: link; margin-top: 0; }
  }
}

/* Phones: compact row (art beside the text), list folded behind "What's included". */
@media (max-width: 639.98px) {
  .svc-card__body {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr) auto;
    grid-template-areas:
      "art  title   title"
      "art  summary summary"
      "more more    link";
    column-gap: 14px;
    padding: 18px 16px 12px;
  }
  .svc-card__art { grid-area: art; height: auto; margin: 2px 0 0; }
  .svc-card__title { grid-area: title; font-size: 1.125rem; }
  .svc-card__summary { grid-area: summary; margin-top: 4px; font-size: 0.875rem; line-height: 1.45; }

  .svc-card__more { grid-area: more; margin-top: 8px; }
  .svc-card__toggle {
    position: relative;
    z-index: 2; /* above the card-wide link */
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 44px;
    border-radius: var(--r-sm);
    color: var(--tone-ink);
    font-size: 0.875rem;
    font-weight: 600;
    list-style: none;
    cursor: pointer;
  }
  .svc-card__toggle::-webkit-details-marker { display: none; }
  .svc-card__toggle .icon { transition: transform var(--t-base) var(--ease-out); }
  .svc-card__more[open] .svc-card__toggle .icon { transform: rotate(180deg); }
  .svc-card__features { gap: 8px; padding: 6px 0 8px; border-top: 0; }
  .svc-card__features li { font-size: 0.875rem; }

  .svc-card__link {
    grid-area: link;
    align-self: start;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin: 8px 0 0;
    padding: 0;
    border: 1px solid var(--tone-line);
    border-radius: 50%;
    background: var(--paper);
  }
  .svc-card__link-text {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
}

/* ---- Illustration (em-based; font-size scales the whole piece) ------------ */

.svc-art {
  position: relative;
  width: 12.8em;
  height: 10em;
  font-size: 10px;
}

.svc-art > * { position: absolute; }

@media (max-width: 639.98px) {
  .svc-art { font-size: 5.6px; }
}

.svc-art__tile {
  --s: 5em;
  display: grid;
  place-items: center;
  width: var(--s);
  height: var(--s);
  border-radius: 1.2em;
  background: var(--paper);
  box-shadow: var(--svc-tile-shadow);
  color: var(--ink-900);
}

.svc-art__tile svg { width: 56%; height: 56%; }
.svc-art__mark svg { width: 100%; height: 100%; }

.svc-art__window {
  width: 9.2em;
  height: 6.8em;
  overflow: hidden;
  border: 1px solid var(--slate-200);
  border-radius: 0.9em;
  background: var(--paper);
  box-shadow: var(--svc-tile-shadow);
}

.svc-art__window::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 1.6em;
  background: color-mix(in srgb, var(--tone-mark) 14%, var(--paper));
}

.svc-art__dots {
  position: absolute;
  top: 0.55em;
  left: 0.7em;
  display: flex;
  gap: 0.35em;
}

.svc-art__dots span {
  width: 0.5em;
  height: 0.5em;
  border-radius: 50%;
  background: var(--tone-mark);
  opacity: 0.55;
}

.svc-art__lines {
  position: absolute;
  top: 2.6em;
  left: 0.9em;
  right: 0.9em;
  display: grid;
  gap: 0.6em;
}

.svc-art__lines span {
  height: 0.55em;
  border-radius: 0.3em;
  background: var(--slate-200);
}

.svc-art__lines span:nth-child(1) { width: 72%; }
.svc-art__lines span:nth-child(3) { width: 54%; }

.svc-art__chart { color: var(--tone-mark); }
.svc-art__chart svg { width: 72%; height: 72%; }

.svc-art__halo { stroke: var(--paper); }

/* SEO: search page, the Google G, a rising line across the window */
.svc-art--seo .svc-art__window { left: 3.4em; top: 0.2em; }
.svc-art--seo .svc-art__tile--front { --s: 5em; left: 0; top: 4.6em; }
.svc-art--seo .svc-art__trend { left: 5em; top: 2.4em; width: 7.4em; height: 4.5em; color: var(--tone-mark); }

/* Google Ads: the mark, a results tile */
.svc-art--ads .svc-art__mark { left: 0.4em; top: 0.8em; width: 7.2em; height: 6.5em; }
.svc-art--ads .svc-art__chart { --s: 5.2em; left: 6.8em; top: 4.4em; }

/* Performance: Meta + Instagram, a results tile */
.svc-art--performance .svc-art__mark { left: 0; top: 2em; width: 6.6em; height: 6.6em; }
.svc-art--performance .svc-art__tile--ig { --s: 4.8em; left: 6.6em; top: 0.2em; }
.svc-art--performance .svc-art__chart { --s: 4.4em; left: 7.8em; top: 5.4em; }

/* AI automation: n8n, ChatGPT, a data store */
.svc-art--automation .svc-art__mark { left: 0; top: 2em; width: 6.4em; height: 6.4em; }
.svc-art--automation .svc-art__tile--ai { --s: 5em; left: 6.8em; top: 0.3em; }
.svc-art--automation .svc-art__tile--db { --s: 3.8em; left: 5.4em; top: 6em; color: var(--blue-600); }
.svc-art--automation .svc-art__tile--db svg { width: 52%; height: 52%; }

/* WordPress: the mark on a round tile in front of a site */
.svc-art--wordpress .svc-art__window { left: 4.2em; top: 0.4em; }
.svc-art--wordpress .svc-art__tile--round { --s: 6.4em; left: 0; top: 3em; border-radius: 50%; }
.svc-art--wordpress .svc-art__tile--round svg { width: 78%; height: 78%; }

/* ---- CTA strip ------------------------------------------------------------- */

.svc-strip {
  display: grid;
  gap: 20px;
  margin-top: clamp(16px, 2vw, 24px);
  padding: 22px 20px;
  border: 1px solid var(--color-border);
  border-radius: var(--r-xl);
  background: color-mix(in srgb, var(--paper) 65%, var(--slate-100));
}

.svc-strip__proof {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
}

.svc-strip__tools { display: flex; }

.svc-strip__tool {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-left: -10px;
  border: 2px solid var(--paper);
  border-radius: 50%;
  background: var(--paper);
  box-shadow: 0 6px 14px -8px rgb(15 23 42 / 0.35), 0 1px 2px rgb(15 23 42 / 0.06);
  color: var(--ink-900);
}

.svc-strip__tool:first-child { margin-left: 0; }
.svc-strip__tool svg { width: 22px; height: 22px; }

.svc-strip__statement {
  color: var(--slate-700);
  font-size: 1rem;
  line-height: 1.45;
}

.svc-strip__statement strong {
  display: block;
  margin-top: 2px;
  color: var(--ink-900);
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.svc-strip__next {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 16px;
  padding-top: 20px;
  border-top: 1px solid var(--color-border);
}

.svc-strip__icon {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: var(--r-md);
  background: var(--color-primary-soft);
  color: var(--blue-600);
}

.svc-strip__copy { flex: 1 1 14rem; min-width: 0; }

.svc-strip__title {
  margin: 0;
  color: var(--ink-900);
  font-size: 1rem;
  font-weight: 700;
}

.svc-strip__text {
  margin-top: 4px;
  color: var(--slate-600);
  font-size: 0.875rem;
  line-height: 1.45;
}

/* Matches the header's Book a Call. */
.svc-strip__btn {
  display: inline-flex;
  flex: 1 1 100%;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 52px;
  padding-inline: 22px;
  border-radius: var(--r-md);
  background: var(--color-primary);
  color: var(--color-on-primary);
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color var(--t-fast) var(--ease-out), transform var(--t-fast) var(--ease-out);
}

.svc-strip__btn:hover { background: var(--color-primary-hover); }
.svc-strip__btn:active { background: var(--color-primary-active); transform: translateY(1px); }
.svc-strip__btn:focus-visible { outline-offset: 3px; }
.svc-strip__btn .icon { transition: transform var(--t-base) var(--ease-out); }
.svc-strip__btn:hover .icon { transform: translateX(3px); }

@media (min-width: 640px) {
  .svc-strip { padding: 24px 28px; }
  .svc-strip__proof { flex-direction: row; align-items: center; gap: 24px; }
  .svc-strip__btn { flex: 0 0 auto; }
}

@media (min-width: 1024px) {
  .svc-strip {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    align-items: center;
    gap: 32px;
    padding: 26px 32px;
  }
  .svc-strip__next {
    flex-wrap: nowrap;
    padding: 4px 0 4px 32px;
    border-top: 0;
    border-left: 1px solid var(--color-border);
  }
}
