/* ═════════════════════════════════════════════════════════════════════════
   SERVICES — "from the story out"
   One pinned stage, five chapters and an ending, driven by the overlay's own
   scroll box. One protagonist travels through all of it:
     a dot (Strategy) → the SC mark and its faces (Identity)
     → the pixel face coming alive (Web) → a line of light that opens into
     film (Film) → the film becoming one tile of a feed that stops (Content)
     → a quick montage of the mark that settles on the default SC.
   Layout lives here; the big names are sized and placed by services.js so
   they always fit the screen. Copy: texty/SERVICES.md
   ═════════════════════════════════════════════════════════════════════════ */

/* M PLUS Rounded 1c (the sub-services; 500 / 700 / 800, with Czech): @font-face in index.html — the site's small labels use it too */
@font-face {
  font-family: 'Young Serif';
  src: url('assets/fonts/young-serif-latin-400-normal.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

#services-view {
  --ink: #1B1819;
  --paper: #FFFFFF;
  --warm: #F2EFE9;
  --fg: var(--ink);
  --serif: 'Young Serif', 'Iowan Old Style', Georgia, serif;
  --sub-font: 800 1em/1.12 'M PLUS Rounded 1c', 'Arial Rounded MT Bold', 'Helvetica Neue', sans-serif;
  --g: clamp(20px, 4.2vw, 76px);                          /* outer gutter */
  --top: max(12vh, 92px);                                  /* clear of corner logo + timeline */
  --bot: max(9vh, 78px);                                   /* clear of the bottom menu */
  --lead: clamp(28px, min(3.3vw, 6vh), 58px);
  --body: clamp(16px, min(1.3vw, 2.35vh), 21px);
  --sub: clamp(18px, min(1.6vw, 2.9vh), 28px);
  position: fixed;
  inset: 0;
  z-index: 90;                              /* above the wheel, below menu (150) + modal (200) */
  background: var(--paper);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.45s ease;
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
#services-view.open { opacity: 1; pointer-events: auto; }

#services-scroll {
  position: absolute;
  inset: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
}
#services-scroll::-webkit-scrollbar { display: none; }
#services-scroll:focus { outline: none; }
#services-driver { position: relative; height: 1200vh; }   /* exact height set by JS */
#services-stage {
  position: sticky;
  top: 0;
  height: 100vh;                            /* exact px set by JS (mobile toolbars) */
  overflow: hidden;
  background: var(--paper);                 /* per-frame colour set by JS */
  color: var(--fg);
}

/* ── shared chrome: timeline + close (follow --fg on dark chapters) ───────── */
#services-timeline {
  position: fixed;
  z-index: 5;
  left: 50%;
  top: calc(2.4vh + 22px);
  transform: translate(-50%, -50%);
  display: grid;
  grid-template-columns: repeat(5, minmax(64px, 108px));
  column-gap: 6px;
  color: var(--fg);
  transition: color 0.35s ease;
}
#services-timeline button {
  border: 0;
  background: none;
  padding: 0;
  cursor: pointer;
  text-align: left;
  color: inherit;
  opacity: 0.38;
  font: 700 0.76rem/1 var(--lbl);
  letter-spacing: -0.005em;
  text-transform: lowercase;
  transition: opacity 0.3s ease;
}
#services-timeline button.on { opacity: 1; }
#services-timeline button:hover { opacity: 0.8; }
#services-timeline .tl-bar {
  display: block;
  height: 2px;
  margin-bottom: 8px;
  background: color-mix(in srgb, currentColor 16%, transparent);
  overflow: hidden;
}
#services-timeline .tl-fill {
  display: block;
  height: 100%;
  background: currentColor;
  transform-origin: left;
  transform: scaleX(0);
}

/* the global chrome while Services is open (no ×: the menu leads on; GET IN TOUCH in the corner — index.html) */
body.svc-dark #corner-logo { filter: invert(1) !important; }
body.svc-dark #dyn-island { box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.16); }

/* ── actors (shared between chapters) ───────────────────────────────────── */
.sv-actor { position: absolute; left: 0; top: 0; pointer-events: none; will-change: transform; }

/* the drop — Strategy's centre; splits in two, sheds droplets, the SC spreads out of them */
.sv-goo { width: 100%; height: 100%; overflow: visible; visibility: hidden; color: var(--fg); fill: currentColor; will-change: auto; }

/* the SC mark, all faces stacked; JS shows one at a time */
.sv-glyph { transform-origin: 0 0; visibility: hidden; color: var(--fg); }
.sv-glyph .sv-gi { position: absolute; inset: 0; transform-origin: 50% 50%; }
.sv-glyph svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; fill: currentColor; display: none; }
.sv-glyph svg.on { display: block; }
.sv-glyph .sv-morph { position: absolute; left: -25%; top: -25%; width: 150%; height: 150%; display: none; }

/* Web: the pixel face as ~300 live squares */
.sv-px { width: 100%; height: 100%; visibility: hidden; will-change: auto; }

/* Film: a projector slit that opens into the footage */
.sv-film { width: 100%; height: 100%; visibility: hidden; transform-origin: 0 0; background: #000; overflow: hidden; }
/* the picture's box (--vy, --vh: services.js layout): the whole screen, on a phone a 16:9 frame */
.sv-film video {
  position: absolute;
  left: 0;
  top: var(--vy, 0px);
  width: 100%;
  height: var(--vh, 100%);
  object-fit: cover;
  opacity: 0;
}
.sv-film video.on { opacity: 1; }
.sv-film video.v-tall { object-fit: contain; }     /* a vertical film: fills the 9:16 tile exactly */
.sv-film .sv-flash { position: absolute; inset: 0; background: #F6F2EA; }
.sv-film .sv-shade {
  position: absolute;
  left: 0;
  right: 0;
  top: var(--vy, 0px);
  height: var(--vh, 100%);
  background:
    linear-gradient(to top, rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0) 44%),
    linear-gradient(to bottom, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0) 30%),
    linear-gradient(to right, rgba(0, 0, 0, 0.35), rgba(0, 0, 0, 0) 42%),
    linear-gradient(to left, rgba(0, 0, 0, 0.35), rgba(0, 0, 0, 0) 30%);
}

/* Content: the feed */
.sv-feed {
  width: 100%;
  height: 100%;
  visibility: hidden;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, rgba(0, 0, 0, 0.25) 7%, #000 19%);   /* chrome stays legible */
  mask-image: linear-gradient(to bottom, transparent 0, rgba(0, 0, 0, 0.25) 7%, #000 19%);
}
.sv-tile {
  position: absolute;
  left: 0;
  top: 0;
  border-radius: 14px;
  overflow: hidden;
  background: #E8E6E1;
  will-change: transform, opacity;
}
.sv-tile img,
.sv-tile video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.sv-tile.zoom img { transform: scale(1.09); }      /* stills with a baked-in letterbox */
.sv-tile.t-ink { background: var(--ink); color: var(--warm); }
.sv-tile.t-warm { background: var(--warm); color: var(--ink); }
.sv-tile svg { position: absolute; left: 50%; top: 50%; width: 62%; height: auto; transform: translate(-50%, -50%); fill: currentColor; overflow: visible; }

/* ── chapters: type (the actors above carry the pictures) ──────────────── */
.sv { position: absolute; inset: 0; visibility: hidden; pointer-events: none; color: var(--fg); }
.sv > * { position: absolute; margin: 0; will-change: transform, opacity; }
.sv .sv-col > * { margin: 0; will-change: transform, opacity; }

/* the big names: sized + placed by JS (they always fit on screen) */
.sv .sv-name {
  left: 0;
  top: 0;
  font-weight: 700;
  font-size: 100px;
  letter-spacing: -0.055em;
  line-height: 1;
  white-space: nowrap;
  color: var(--fg);
  transform-origin: 0 0;
}
.sv-lead { font-weight: 700; letter-spacing: -0.03em; line-height: 1.02; font-size: var(--lead); text-wrap: balance; }
.sv-body {
  font-size: var(--body);
  line-height: 1.42;
  font-weight: 500;
  letter-spacing: -0.005em;
  color: color-mix(in srgb, var(--fg) 88%, transparent);
  max-width: 25em;
  text-wrap: pretty;
}
.sv-list { list-style: none; padding: 0; margin: 0; font: var(--sub-font); font-size: calc(var(--sub) * 1.08); letter-spacing: -0.04em; text-transform: lowercase; }
/* the type looks printed: edges a touch soaked into the paper (#svInk in index.html) */
.sv-list li, .sv-list dd, .sv-identity .sv-now-name span { filter: url(#svInk); }
.sv-sr {                                  /* for screen readers (and the no-motion version) */
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* STRATEGY — a centre, and a word that has not been inked yet. */
.sv-strategy .sv-col {
  left: var(--g);
  top: var(--ctop);
  width: min(12.6em, 52vw);
  display: flex;
  flex-direction: column;
  gap: 26px;
  font-size: var(--slead);
}
.sv-strategy .sv-lead { font-size: 1em; }
.sv-strategy .sv-lead .w { display: inline; }
.sv-strategy .sv-body { font-size: var(--body); max-width: 24em; }
.sv-strategy .sv-tree { left: var(--dot-x); top: calc(var(--dot-y) + 24px); right: var(--g); }
.sv-strategy .sv-stem {
  position: absolute;
  left: -0.5px;
  top: 0;
  width: 1px;
  height: 100%;
  background: color-mix(in srgb, var(--fg) 45%, transparent);
  transform-origin: top;
}
.sv-strategy .sv-list li { position: relative; padding: 0.28em 0 0.28em 30px; }
.sv-strategy .sv-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.9em;
  width: 18px;
  height: 1px;
  background: color-mix(in srgb, var(--fg) 45%, transparent);
  transform-origin: left;
  transform: scaleX(var(--k, 0));
}

/* IDENTITY — the name runs up the spine; each sub-service gets a face of
   the mark and a legend. */
.sv-identity .sv-col { display: contents; }
.sv-identity .sv-col > * { position: absolute; }
.sv-identity .sv-now { left: var(--col-l); right: var(--g); top: var(--top); }
.sv-identity .sv-ticks { display: flex; gap: 5px; margin: 0 0 20px; }
.sv-identity .sv-ticks i { width: 20px; height: 2px; background: currentColor; opacity: 0.18; transition: opacity 0.3s ease; }
.sv-identity .sv-ticks i.on { opacity: 1; }
.sv-identity .sv-now-name {
  margin: 0;
  font: var(--sub-font);
  font-size: clamp(32px, min(3.4vw, 6vh), 62px);
  letter-spacing: -0.045em;
  text-transform: lowercase;
  line-height: 1.06;
  overflow: hidden;
  padding-bottom: 0.08em;
}
.sv-identity .sv-now-name span { display: inline-block; }
.sv-identity .sv-now-leg { margin: 12px 0 0; font-size: var(--body); line-height: 1.42; font-weight: 500; color: color-mix(in srgb, var(--fg) 88%, transparent); max-width: 21em; }
.sv-identity .sv-lead { left: var(--col-l); right: var(--g); bottom: var(--bot); }
.sv-identity .sv-body { left: var(--body-l); bottom: var(--bot); width: min(24em, var(--body-w)); }

/* WEB — the pixel face comes alive under the cursor; the name is drawn on
   in steps; the lead types itself and waits with a caret. */
.sv-web .sv-col {
  left: max(56vw, calc(50vw + 40px));
  right: var(--g);
  bottom: var(--bot);
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.sv-web .sv-lead .h { color: transparent; }
.sv-web .sv-caret {
  display: inline-block;
  width: 0.42em;
  height: 0.74em;
  margin: 0 0.04em -0.04em 0.06em;
  background: var(--fg);
  animation: svBlink 1.05s steps(1) infinite;
}
@keyframes svBlink { 50% { opacity: 0; } }
.sv-web .sv-stay { font-size: 13px; font-weight: 500; letter-spacing: 0.01em; color: color-mix(in srgb, var(--fg) 60%, transparent); font-variant-numeric: tabular-nums; }
.sv-web .sv-stay b { color: var(--fg); font-weight: 700; }
.sv-web .sv-list { display: flex; flex-wrap: wrap; gap: 2px 0; }
.sv-web .sv-list li { white-space: nowrap; }
.sv-web .sv-list li:not(:last-child)::after { content: '/'; margin: 0 0.45em; opacity: 0.3; }

/* FILM — lights off. A slit of light opens into the footage. Title over
   picture, the lead as a subtitle, the crafts rolling like end credits. */
.sv-film-ch { color: #FFFFFF; --fg: #FFFFFF; }
.sv-film-ch .sv-body { left: var(--g); top: 0; width: min(24em, 40vw); color: rgba(255, 255, 255, 0.92); text-shadow: 0 1px 12px rgba(0, 0, 0, 0.35); }
.sv-film-ch .sv-name { color: #FFFFFF; }
.sv-film-ch .sv-sub {
  left: 50%;
  top: 0;
  width: min(80vw, 760px);
  margin-left: calc(min(80vw, 760px) / -2);
  text-align: center;
  font-size: clamp(16px, 1.5vw, 26px);
  font-weight: 500;
  letter-spacing: 0.005em;
  line-height: 1.3;
  color: #FFFFFF;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7), 0 0 18px rgba(0, 0, 0, 0.35);
}
.sv-film-ch .sv-credits {
  right: var(--g);
  top: 0;
  width: min(26vw, 340px);
  height: 50vh;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 16%, #000 84%, transparent);
  mask-image: linear-gradient(to bottom, transparent, #000 16%, #000 84%, transparent);
}
/* once they are up, the credits take the wheel, a finger or the mouse (services.js: they run on faster) */
.sv-film-ch .sv-credits.live { pointer-events: auto; touch-action: none; cursor: grab; -webkit-user-select: none; user-select: none; }
.sv-film-ch .sv-credits.live.dragging { cursor: grabbing; }
.sv-film-ch .sv-credits .sv-list {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  text-align: center;
  font-size: clamp(16px, min(1.35vw, 2.4vh), 23px);
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.94);
  will-change: transform;
}
/* like end credits: the role in the studio's heavy round type, the names under it set like the subtitle */
.sv-film-ch .sv-credits .sv-list > div { margin: 0 0 1.9em; }
.sv-film-ch .sv-credits dt {
  margin: 0 0 0.35em;
  font: var(--sub-font);
  font-size: 1.12em;
  letter-spacing: -0.04em;
  text-transform: lowercase;
  color: #FFFFFF;
  filter: url(#svInk);
}
.sv-film-ch .sv-credits dd {
  margin: 0;
  font: 500 0.86em/1.5 'Helvetica Neue', Helvetica, Arial, sans-serif;
  letter-spacing: 0.005em;
  text-transform: none;
  color: rgba(255, 255, 255, 0.92);
  filter: none;
}

/* CONTENT — a feed that runs past the name… until one frame stops it. */
.sv-content .sv-name { color: #FFFFFF; mix-blend-mode: difference; }
.sv-content .sv-col { left: var(--g); top: max(22vh, 150px); width: min(46vw, 680px); display: flex; flex-direction: column; gap: 22px; }
.sv-content .sv-list { display: flex; flex-wrap: wrap; gap: 4px 0; }
.sv-content .sv-list li { white-space: nowrap; }
.sv-content .sv-list li:not(:last-child)::after { content: '+'; margin: 0 0.4em; opacity: 0.35; }
.sv-content .sv-body { max-width: 24em; }

/* THE END — the mark settles; one door out, and the menu opens. */
.sv-end .sv-cta {
  left: 50%;
  top: 0;
  height: 64px;
  padding: 0 36px;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: #FFFFFF;
  font: 800 0.88rem/64px var(--lbl);
  letter-spacing: -0.005em;
  text-transform: lowercase;
  white-space: nowrap;
  cursor: pointer;
  pointer-events: auto;
  box-shadow: 0 10px 30px rgba(27, 24, 25, 0.22);
  transition: box-shadow 0.3s ease;
}
.sv-end .sv-cta:hover { box-shadow: 0 14px 40px rgba(27, 24, 25, 0.32); }
.sv-end .sv-cta span { display: inline-block; transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1); }
.sv-end .sv-cta:hover span { transform: translateX(3px); }

/* ── portrait tablets: Identity stacks its copy under the mark ─────────── */
#services-view.is-tall .sv-identity .sv-col { display: flex; flex-direction: column; gap: 24px; position: absolute; left: var(--col-l); right: var(--g); top: var(--col-t); }
#services-view.is-tall .sv-identity .sv-col > * { position: relative; left: auto; right: auto; top: auto; bottom: auto; width: auto; }

/* ── phones ────────────────────────────────────────────────────────────── */
@media (max-width: 767px) {
  #services-view { --g: 20px; --top: max(13vh, 96px); --bot: calc(3vh + 98px); --lead: 7.4vw; --body: 15.5px; --sub: 17px; }
  /* timeline: bars only, top centre; once GET IN TOUCH is up, in the gap between it and the logo (services.js) */
  #services-timeline { grid-template-columns: repeat(5, 32px); column-gap: 5px; }
  #services-timeline button { font-size: 0; letter-spacing: 0; padding: 12px 0; }
  #services-timeline .tl-bar { margin-bottom: 0; }

  .sv-strategy .sv-col { width: auto; right: var(--g); gap: 18px; }
  .sv-strategy .sv-list li { padding-left: 26px; }

  .sv-identity .sv-col { display: flex; flex-direction: column; gap: 18px; position: absolute; left: var(--col-l); right: var(--g); top: var(--col-t); }
  .sv-identity .sv-col > * { position: relative; left: auto; right: auto; top: auto; bottom: auto; width: auto; }
  .sv-identity .sv-now-name { font-size: 26px; }
  .sv-identity .sv-ticks { margin-bottom: 12px; }
  .sv-identity .sv-lead { font-size: 6.6vw; }

  .sv-web .sv-col { left: var(--g); right: var(--g); gap: 12px; }
  .sv-web .sv-body { display: none; }

  .sv-film-ch .sv-credits { width: auto; left: var(--g); right: var(--g); }
  .sv-film-ch .sv-body { width: auto; right: var(--g); }

  .sv-content .sv-col { left: var(--g); right: var(--g); width: auto; top: var(--top); gap: 16px; }
  .sv-content .sv-lead { font-size: 8.2vw; }
}

/* ── no motion: the same chapters, simply one below the other ───────────── */
#services-view.svc-static #services-driver { height: auto !important; }
#services-view.svc-static #services-stage { position: static; height: auto !important; overflow: visible; background: var(--paper) !important; }
#services-view.svc-static .sv-actor,
#services-view.svc-static .sv-now,
#services-view.svc-static .sv-stem,
#services-view.svc-static .sv-caret,
#services-view.svc-static .sv-stay { display: none !important; }
#services-view.svc-static .sv {
  position: relative;
  inset: auto;
  visibility: visible;
  min-height: 80vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 20px;
  padding: 16vh var(--g) 10vh;
  color: var(--ink);
  --fg: var(--ink);
}
#services-view.svc-static .sv > *,
#services-view.svc-static .sv-col > * {
  position: relative !important;
  inset: auto !important;
  width: auto !important;
  max-width: 44rem;
  margin: 0 !important;
  opacity: 1 !important;
  transform: none !important;
  clip-path: none !important;
  visibility: visible !important;
  text-align: left !important;
  color: var(--ink) !important;
  text-shadow: none !important;
}
#services-view.svc-static .sv-col { display: flex !important; flex-direction: column; gap: 20px; }
#services-view.svc-static .sv-name { font-size: clamp(56px, 12vw, 180px) !important; mix-blend-mode: normal; order: -2; }
#services-view.svc-static .sv-lead { font-size: clamp(26px, 3.4vw, 54px); order: -1; }
#services-view.svc-static .sv-lead .h { color: var(--ink); }
#services-view.svc-static .sv-sr { position: relative !important; width: auto; height: auto; overflow: visible; clip: auto; white-space: normal; }
#services-view.svc-static .sv-sr li[data-leg]::after { content: ' — ' attr(data-leg); font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: var(--body); opacity: 0.8; }
#services-view.svc-static .sv-credits { height: auto !important; -webkit-mask-image: none; mask-image: none; overflow: visible; }
#services-view.svc-static .sv-credits .sv-list { position: static; text-align: left; transform: none !important; }
#services-view.svc-static .sv-credits dt { color: var(--ink); }
#services-view.svc-static .sv-list li { opacity: 1 !important; transform: none !important; }
#services-view.svc-static .sv-list li::before { transform: none; }
#services-view.svc-static .sv-end { min-height: 50vh; align-items: flex-start; }
#services-view.svc-static .sv-end .sv-cta { left: auto; color: #FFFFFF !important; }
