/* ==========================================================================
   Services — large-type list (homepage)
   Reference: kstoimenov.com › Services (huge uppercase rows, icon, roll on
   hover), adapted to our light section — colours as the "How I / Work"
   heading (faded ink → ink). Hover changes text colour only; the background
   never changes and nothing is drawn behind the row:
     rest  → title + icon in faded ink (--c-ink-faded); number and labels
             in ink
     hover → only the title changes: it rolls up to an ink copy, its icon
             turns ink and animates; number and labels stay as they are
   Markup in index.html (#services) · behaviour: services-type.js
   ========================================================================== */

/* directly under the section heading (its 90px bottom padding sets the gap) */
.svc-type {
  position: relative;
  margin-top: 10px;
}

/* -------------------------------------------- hover image (as Clients 06)
   One frame for the list, on the RIGHT: over the end of the hovered title and
   lifted above the row (clear of the icons on the left, stopping short of the
   tags / description column). Each row has its own slight tilt (--tilt);
   moving between rows glides, re-tilts and crossfades it; leaving the list
   hides it. --row-x / --row-y are set by services-type.js. */
.svc-media {
  position: absolute;
  inset: 0;
  z-index: 2;                       /* in front of the title's last letters */
  pointer-events: none;
}

.svc-frame {
  --frame-tilt: 0deg;
  position: absolute;
  top: var(--row-y, 50%);
  left: var(--row-x, 0px);
  width: 220px;
  aspect-ratio: 5 / 4;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-50%) rotate(calc(var(--frame-tilt) * 1.6)) scale(0.92);
  clip-path: inset(12% 0 12% 0);
  transition:
    top 0.55s var(--ease-out),
    left 0.55s var(--ease-out),
    opacity 0.35s var(--ease),
    transform 0.55s var(--ease-out),
    clip-path 0.55s var(--ease-out);
}

.svc-type.is-hovering .svc-frame {
  opacity: 1;
  transform: translateY(-50%) rotate(var(--frame-tilt)) scale(1);
  clip-path: inset(0 0 0 0);
}

.svc-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.25s var(--ease);
}

.svc-img.is-swapping {
  opacity: 0;
}

.svc-row {
  --ease-roll: cubic-bezier(0.76, 0, 0.24, 1);   /* reference roll curve */
  position: relative;
  z-index: 1;                       /* text above the hover image */
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr) 280px;   /* index · title · tags */
  align-items: center;
  column-gap: 30px;
  padding: 22px var(--col-pad);
  color: var(--c-ink-faded);
}

/* --------------------------------------------------------------- content */

/* number and labels: dark at rest and on hover — only the title changes */
.svc-row__index,
.svc-row__side {
  color: var(--c-ink);
  font-family: var(--font-mono);
  font-size: var(--fs-mono-sm, 13px);
  text-transform: uppercase;
}

.svc-row__side {
  position: relative;
  justify-self: end;
  width: 100%;
  text-align: right;
}

/* the labels stay in place on hover (the description that used to swap in
   is kept in the markup, not shown) */
.svc-row__tags {
  display: block;
}

.svc-row__desc {
  display: none;
}

.svc-row__title {
  display: flex;
  align-items: center;
  justify-self: center;
  gap: 0.16em;                     /* reference: 16px at 100px type */
  font-size: clamp(40px, 5.8vw, 82px);   /* at most 82px (was 96px; 89px on a 1536px laptop) */
  font-weight: 700;
  line-height: 0.9;
  letter-spacing: -0.045em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* The service icons (assets/images/services/service-icon-*.svg — their
   exact paths, inlined in each row) filled with the text colour, so they
   fade from faded ink to ink with the title. As the reference: 0.7× the
   type size (70px at 100px type), vertically centred on the title; the eye
   keeps its own proportion (70 × 37.76). The hover motion (spin / pop /
   twirl / blink, per data-anim) is played by services-type.js. */
.svc-row__icon {
  flex: none;
  width: 0.7em;
  height: 0.7em;
  transition: color 0.35s var(--ease);
}

.svc-row__icon--eye {
  height: 0.3777em;
}

.svc-row__icon svg {
  display: block;
  width: 100%;
  height: 100%;
}

/* roll: the title and its ink copy stacked in a one-line mask */
.svc-row__mask {
  display: block;
  overflow: hidden;
  padding-block: 0.06em;
}

.svc-row__roll {
  position: relative;
  display: block;
  transition: transform 0.55s var(--ease-roll);
  will-change: transform;
}

.svc-row__dup {
  position: absolute;
  top: calc(100% + 0.06em);
  left: 0;
  color: var(--c-ink);
}

/* ------------------------------------------------------------------ hover */

@media (hover: hover) and (pointer: fine) {
  .svc-row.is-hot .svc-row__roll { transform: translateY(calc(-100% - 0.06em)); }
  .svc-row.is-hot .svc-row__icon { color: var(--c-ink); }
}

/* touch: no hover, so the titles rest in full ink too */
@media (hover: none) {
  .svc-row { color: var(--c-ink); }
}

@media (prefers-reduced-motion: reduce) {
  .svc-row__roll, .svc-row__icon { transition: none; }
  .svc-frame { transition: opacity 0.35s var(--ease); }
}

/* ------------------------------------------------- lines under the list
   Reference layout (three short lines on one row), on the column grid
   (cols 1 · 2 · 3), all centred on one horizontal line.
   The lead: sans, 18px (--fs-title-md), ink. The two notes: the About
   caption style (.t-mono — mono, 13px, uppercase) in two tones, key words
   in ink and the rest in faded ink (.t-faded spans). */
/* the three lines centred on the page as one group, each centred in itself */
.svc-clients {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 80px;
  margin-top: 100px;
  text-align: center;
}

.svc-clients__lead,
.svc-clients__text {
  flex: 0 1 330px;
  max-width: 330px;
}

.svc-clients__lead {
  color: var(--c-ink);
  font-family: var(--font-sans);
  font-size: var(--fs-title-md);
  font-weight: 400;
  line-height: 1.45;
  letter-spacing: -0.01em;
}

.svc-clients__text { color: var(--c-ink); }

/* ------------------------------------------------------------- responsive */

@media (max-width: 1199px) {
  .svc-media { display: none; }      /* touch-sized screens: no hover image (as Clients) */
  .svc-row {
    grid-template-columns: auto minmax(0, 1fr);
    row-gap: 12px;
  }
  .svc-row__title { justify-self: start; white-space: normal; }
  .svc-row__side {
    width: auto;
    grid-column: 2;
    justify-self: start;
    text-align: left;
  }
  .svc-row__desc { display: none; }
  /* the three lines stack */
  /* stacked, still centred */
  .svc-clients { flex-direction: column; gap: 14px; margin-top: 70px; }
  .svc-clients__lead,
  .svc-clients__text { flex: none; }
}

@media (max-width: 809px) {
  .svc-type { margin-top: 0; }
  .svc-row { column-gap: 16px; padding-block: 18px; }
  .svc-row__title { font-size: clamp(30px, 8.4vw, 56px); }
}
