/* Mr Sauber, services: the eight services as photo cards floating on shallow, clear water over the page (js/cards.js
   moves them and draws the water). Here: where they stand - a loose grid, four columns on a landscape screen, three or
   two upright. Every card has its own size (--s,
   x --svc-u, the grid's card width), is set off its place (--x, --y, x the same width: the columns stand higher and
   lower), and has its own lean (--r, deg) and depth (--d: 0 far, 1 near; the script floats a near card more and shifts
   it more with the mouse, and its shadow here is deeper). Under each card the room for its name and line: shown when the
   card is pointed at or focused, or always without a mouse. Without the script the same grid stands still, every name
   shown. */
@font-face { font-family: "Zodiak"; src: url("../fonts/zodiak-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Switzer"; src: url("../fonts/switzer-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Switzer"; src: url("../fonts/switzer-600.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }

/* the section is the container the grid is measured in (cqw: its content's width); sideways it clips (flying words) */
.svc {
  --svc-gap: clamp(18px, 2.8vw, 56px);   /* between the columns */
  --svc-row: clamp(28px, 5svh, 76px);    /* between the rows, after the captions */
  --svc-name: clamp(20px, min(1.85vw, 3.4svh), calc(30px + 30 * var(--lp-k, 0px)));   /* a card's name */
  position: relative; container-type: inline-size; overflow-x: clip;
  padding: clamp(72px, 13svh, 170px) var(--pad) clamp(70px, 13svh, 170px);
  background: var(--bg, #F7F9FB); color: var(--navy, #0D3B66);
}
.svc *, .svc *::before, .svc *::after { box-sizing: border-box; }
/* line-height: about the headline motion's pitch (its navy bar and the gap), so splitting it changes nothing */
.svc__h { position: relative; z-index: 2; width: fit-content; max-width: 100%; margin: 0 auto; text-align: center;
  font: 400 clamp(44px, min(7.6vw, 12.5svh), calc(140px + 140 * var(--lp-k, 0px)))/1.38 var(--display, "Zodiak", Georgia, serif); letter-spacing: -.03em; text-wrap: balance; }
.svc__h.tfx--live { z-index: 10; }   /* its flying words pass in front of the cards */

/* the grid. --svc-u: a card's width at --s 1 - a share of its column, never taller than --svc-tall. The columns' offsets
   reach below the grid: its padding keeps room for them (--svc-drop, x --svc-u) */
.svc__list {
  --svc-cols: 4; --svc-fill: .72; --svc-tall: 44svh; --svc-drop: .9;
  --svc-u: min((100cqw - (var(--svc-cols) - 1) * var(--svc-gap)) / var(--svc-cols) * var(--svc-fill), var(--svc-tall) * .5625);
  display: grid; grid-template-columns: repeat(var(--svc-cols), minmax(0, 1fr)); gap: var(--svc-row) var(--svc-gap);
  margin: clamp(44px, 9svh, 110px) 0 0; padding: 0 0 calc(var(--svc-drop) * var(--svc-u)); list-style: none;
}
.svc__card { position: relative; left: calc(var(--x, 0) * var(--svc-u)); top: calc(var(--y, 0) * var(--svc-u)); margin: 0; outline: none; -webkit-tap-highlight-color: transparent; }
/* the card that floats (its transform and opacity are the script's): the shadow and the photo. Round corners like the
   fan's were: 13 % of the width, drawn on the photo itself. At rest it leans as the script leans it (and so does the
   wet page's copy of it) */
.svc__float { position: relative; width: calc(var(--svc-u) * var(--s, 1)); aspect-ratio: 9 / 16; margin: 0 auto; container-type: inline-size;
  transform: rotate(calc(var(--r, 0) * 1deg)); }
/* the water the cards float on (cards.js draws it: the light the surface gathers, its rings, the cards under it): a
   canvas of the section's own, behind the cards, the screen's height, sticking at the screen's top while the section
   passes (so it only ever holds what is seen) */
.svc__pool { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.svc__pool canvas { position: sticky; top: 0; display: block; width: 100%; height: min(100%, 100vh); height: min(100%, 100lvh); }
.landing.wet .svc__pool { display: none; }   /* (the wet page, wetpage.js's copy of this page, is still: no water of its own) */
/* a card's wet face as it comes up out of the water (cards.js draws it: its work picture under the water running down
   it, the drop at its lowest corner, the front that dries it from the top): over the photo, inside the float so it
   rides the card exactly, with room round the face for the drop (its box is set by the script); shown only while wet */
.svc__wet { position: absolute; display: block; pointer-events: none; visibility: hidden; }
.svc__wet.is-on { visibility: visible; }
.landing.wet .svc__wet { display: none; }
.svc__pic { position: relative; display: block; width: 100%; height: 100%; }
.svc__pic img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 13% / 7.3125%; -webkit-user-drag: none;
  box-shadow: 0 0 0 1px rgba(13, 59, 102, .06); }   /* a hairline keeps a light photo's edge on the light page */
/* its shadow, tinted from the navy (never grey-black): wide and soft under a near card, closer and lighter under a far
   one (cqw: x the card's width), and a tight one under the edge */
.svc__shade, .svc__lift { position: absolute; inset: 0; border-radius: 13% / 7.3125%; pointer-events: none; }
.svc__shade { box-shadow: 0 calc(6cqw + 8cqw * var(--d, .5)) calc(12cqw + 16cqw * var(--d, .5)) calc(-5cqw - 3cqw * var(--d, .5)) rgba(13, 59, 102, calc(.26 + .14 * var(--d, .5))),
  0 calc(1cqw + .6cqw * var(--d, .5)) calc(3cqw + 1.5cqw * var(--d, .5)) rgba(13, 59, 102, .13); }
/* ... and the one it casts when it comes up (cards.js adds it): softer, wider and lower, shown by its opacity alone (a
   shadow moved or grown would leave the page showing between it and the card) */
.svc__lift { opacity: 0; box-shadow: 0 calc(15cqw + 5cqw * var(--d, .5)) calc(32cqw + 8cqw * var(--d, .5)) -7cqw rgba(13, 59, 102, .34), 0 3cqw 9cqw rgba(13, 59, 102, .1); }

/* the caption: the name in Zodiak - the script turns it white on a navy bar, which lies across the card's lower edge
   like the hero's bars across its photograph - and its line in Switzer under it */
.svc__cap { position: relative; margin: clamp(14px, 2.4svh, 26px) auto 0; text-align: center; }
.svc.is-live .svc__cap { margin-top: calc(var(--svc-name) * -.66); }   /* (the bar's middle on the card's edge) */
.svc__name { width: fit-content; max-width: 100%; margin: 0 auto; font: 400 var(--svc-name)/1.36 var(--display, "Zodiak", Georgia, serif);
  letter-spacing: -.02em; text-wrap: balance; }   /* long compounds break at their soft hyphen (never inside a word) */
.svc__text { max-width: 21em; margin: clamp(8px, 1.3svh, 13px) auto 0; font: 400 clamp(13.5px, 1vw, 16px)/1.5 var(--sans, "Switzer", system-ui, sans-serif); color: rgba(13, 59, 102, .8); text-wrap: balance; }

/* With the script. Until the section is the script's, nothing of it shows (the still grid would flash); a card is not
   drawn until it comes (cards.js writes its opacity); near the screen every card has its layers. The line comes once
   the name has turned (.is-on, .is-line) */
.svc.lp-wait:not(.is-live) .svc__list { visibility: hidden; }
.svc.is-live .svc__float { opacity: 0; }
.svc.is-near .svc__float { will-change: transform, opacity; }
.svc.is-live .svc__text { opacity: 0; transform: translate3d(0, 6px, 0); transition: opacity .2s, transform .2s; }
.svc.is-live .svc__card.is-line .svc__text { opacity: 1; transform: none; transition: opacity .5s ease-out, transform .7s var(--out, ease-out); }
/* with a mouse the whole caption comes and goes with its card (held under it on whole px by the script) */
@media (hover: hover) and (pointer: fine) {
  .svc.is-near .svc__lift { will-change: opacity; }
  .svc.is-live .svc__cap { opacity: 0; transition: opacity .28s var(--out, ease-out); }
  .svc.is-live .svc__card.is-on .svc__cap { opacity: 1; transition: opacity .18s ease-out; }
}
.svc__card:focus-visible .svc__pic img { outline: 2px solid var(--navy, #0D3B66); outline-offset: 5px; }   /* navy: gold on the light page is under 3:1 */

/* ---------- wide: four columns; the second row keeps each column's offset ---------- */
.svc__card:nth-child(1) { --s: .94; --x: .08; --y: .44; --r: -3.2; --d: .35; }
.svc__card:nth-child(2) { --s: 1.1; --x: -.06; --y: 0; --r: 2.2; --d: 1; }
.svc__card:nth-child(3) { --s: .88; --x: .04; --y: .72; --r: -1.8; --d: .15; }
.svc__card:nth-child(4) { --s: 1.02; --x: -.08; --y: .18; --r: 3.4; --d: .7; }
.svc__card:nth-child(5) { --s: 1.04; --x: -.05; --y: .56; --r: 2.6; --d: .8; }
.svc__card:nth-child(6) { --s: .9; --x: .09; --y: -.06; --r: -2.9; --d: .25; }
.svc__card:nth-child(7) { --s: 1.08; --x: -.03; --y: .86; --r: 1.7; --d: .95; }
.svc__card:nth-child(8) { --s: .92; --x: .06; --y: .14; --r: -2.4; --d: .3; }

/* ---------- narrow: a phone held upright, a tablet, a small window (site.css asks the same question): three columns,
   two on a phone; the cards fill their columns, every column set lower than the one before or after ---------- */
@media (max-width: 900px) and (orientation: portrait), (max-width: 900px) and (min-height: 541px) {
  /* (a name as large as its column holds "Teppich- & Polster-" on one line) */
  .svc { --svc-gap: clamp(14px, 4vw, 28px); --svc-row: clamp(26px, 4.4svh, 50px); --svc-name: clamp(16px, 2.7vw, 22px); padding: clamp(60px, 10svh, 110px) var(--pad) clamp(56px, 10svh, 110px); }
  .svc__h { font-size: clamp(40px, min(13vw, 7.4svh), 96px); }
  .svc__list { --svc-cols: 3; --svc-fill: .9; --svc-tall: 9999px; --svc-drop: .64; margin-top: clamp(30px, 6svh, 64px); }
  .svc__text { margin-top: 8px; font-size: 13px; line-height: 1.45; }
  .svc__card:nth-child(1) { --s: .96; --x: .03; --y: .3; --r: -2.2; --d: .5; }
  .svc__card:nth-child(2) { --s: 1; --x: -.02; --y: 0; --r: 1.8; --d: .9; }
  .svc__card:nth-child(3) { --s: .94; --x: .02; --y: .56; --r: -1.4; --d: .3; }
  .svc__card:nth-child(4) { --s: 1; --x: -.03; --y: .34; --r: 2; --d: .8; }
  .svc__card:nth-child(5) { --s: .95; --x: .03; --y: .02; --r: -2.4; --d: .35; }
  .svc__card:nth-child(6) { --s: .98; --x: -.02; --y: .6; --r: 1.5; --d: .7; }
  .svc__card:nth-child(7) { --s: .95; --x: .02; --y: .28; --r: -1.7; --d: .4; }
  .svc__card:nth-child(8) { --s: 1; --x: -.02; --y: .04; --r: 2.3; --d: .85; }
  @media (max-width: 600px) {
    .svc { --svc-name: clamp(16px, 4.4vw, 22px); }
    .svc__list { --svc-cols: 2; --svc-fill: .94; --svc-drop: .66; }
    .svc__card:nth-child(1) { --s: 1; --x: -.02; --y: 0; --r: -2; --d: .6; }
    .svc__card:nth-child(2) { --s: .96; --x: .03; --y: .6; --r: 2.3; --d: .9; }
    .svc__card:nth-child(3) { --s: .97; --x: .03; --y: .04; --r: 1.7; --d: .35; }
    .svc__card:nth-child(4) { --s: 1; --x: -.02; --y: .57; --r: -1.6; --d: .7; }
    .svc__card:nth-child(5) { --s: 1; --x: -.03; --y: -.02; --r: -2.2; --d: .85; }
    .svc__card:nth-child(6) { --s: .96; --x: .02; --y: .63; --r: 2; --d: .4; }
    .svc__card:nth-child(7) { --s: .97; --x: .02; --y: .03; --r: 1.5; --d: .5; }
    .svc__card:nth-child(8) { --s: 1; --x: -.03; --y: .6; --r: -2.3; --d: .8; }
  }
}
/* ---------- low: a phone held sideways, any low wide window - the four columns, smaller, a card at most 62 % of the
   screen's height ---------- */
@media (orientation: landscape) and (max-height: 540px) {
  .svc { --svc-row: 24px; --svc-name: clamp(15px, 4.4svh, 20px); padding: calc(var(--lp-head, 76px) + 14px) var(--pad) 56px; }
  .svc__h { font-size: clamp(28px, min(4.6vw, 10svh), 52px); }
  .svc__list { --svc-tall: 62svh; --svc-fill: .76; margin-top: 30px; }
  .svc__text { margin-top: 6px; font-size: 12px; line-height: 1.4; }
}
@media (prefers-reduced-motion: reduce) {
  .svc .svc__cap, .svc .svc__text { transition: none !important; }
}
