/* The content of the page below the stage: one section per service ("Tafel") with its text and its picture,
   the "Raster" pictures (js/leistungen.js, js/leistungen-bilder.js).
   Names in Unbounded, reading text in Newsreader, labels in IBM Plex Mono (schriften.css).

   Why it is plain: on an iPhone, WebKit paints on the processor. A section scrolls like any section, nothing is
   sticky. The planes of a picture have no shadow, no filter and no mask, and move by transform and opacity only.
   Text sizes and the break between one and two columns follow the width of .site (cqw, @container), because
   next to the docked chat the page is half as wide. The measures of a picture do not: they are em of a width
   that is set from the window, without container units. */

/* ---------- Tokens. The colours of the page (--tinte, --grund, --gelb, --marker, --fest-tinte) and the three
   type families come from styles.css. ---------- */
:root {
  --linie-stark: #9a988f;
  --ton: #e2e0d7; /* a quiet plane on the ground */
  /* Width of the page, from the window: container units must not reach the pictures. */
  --seite: 100vw;
}
:root[data-theme="dark"] {
  --linie-stark: rgba(243, 242, 238, 0.42);
  --ton: #2b2b28;
}
@media (min-width: 1024px) {
  /* The docked chat takes half the window (styles.css); 8px spare for a scrollbar that takes room. */
  .chat-docked { --seite: calc(50vw - 8px); }
}

/* ---------- Section: text on top, picture below. Everything of a section is nested here. ---------- */
.tafel {
  display: grid; row-gap: 36px; max-width: 1440px; margin-inline: auto; padding: 56px 16px 64px; border-top: 1px solid var(--linie-stark);
  color: var(--tinte); font-family: var(--antiqua);
  .tafel__text { min-width: 0; }
  h2 { font: 700 clamp(28px, 3.2cqw, 46px) / 1.05 var(--marke); letter-spacing: -0.035em; text-wrap: balance; }
  .tafel__subline { margin-top: 0.5em; font-size: clamp(18px, 1.6cqw, 23px); line-height: 1.25; text-wrap: balance; }
  /* The client's question and the quote share one setting. */
  .tafel__frage, .tafel__zitat { font-size: clamp(18px, calc(1.42vw + 1px), 21.5px); line-height: 1.5; text-wrap: pretty; }
  .tafel__frage { margin-top: 1.5em; font-style: italic; }
  .tafel__zitat { margin: 0.75em 0 0; }
  .tafel__zitat mark { padding: 0 0.12em; margin: 0 -0.12em; background: linear-gradient(var(--marker), var(--marker)) no-repeat 0 62% / 100% 74%; color: inherit; }
  .tafel__liste { margin-top: 1.5em; font-size: clamp(16.5px, calc(1.14vw + 1px), 18px); line-height: 1.45; }
  .tafel__listentitel { margin-bottom: 0.75em; font: 500 11.5px / 1.2 var(--mono); letter-spacing: 0.09em; text-transform: uppercase; }
  .tafel__liste ul { list-style: none; padding: 0; display: grid; gap: 0.42em; }
  .tafel__liste li { display: grid; grid-template-columns: 1.15em minmax(0, 1fr); text-wrap: pretty; }
  .tafel__liste li::before { content: ""; width: 0.4em; height: 0.4em; margin-top: 0.56em; background: currentColor; }

  /* ---------- Picture: 36em wide, so it keeps its proportions from phone to desktop. Nothing inside reaches
     past its edge. Words on the planes are never broken (styles.css lets long words break elsewhere). ---------- */
  .tafel__bild {
    --bw: min(560px, calc(var(--seite) - 32px));
    position: relative; justify-self: center; width: var(--bw); font-size: calc(var(--bw) / 36); line-height: 1.5;
    contain: layout paint; overflow-wrap: normal;
  }
  .raster { position: relative; }
  .fl { position: absolute; }
  .fl__f { position: absolute; inset: 0; background: var(--tinte); transform-origin: 0 0; }
  .fl--gelb .fl__f { background: var(--gelb); }
  .fl--ton .fl__f, .fl--leer .fl__f { background: var(--ton); }
  .fl__t { position: relative; height: 100%; padding: 0.62em 0.8em; }
  .fl--frei .fl__t { padding: 0; }
  /* Still open: the plane stays quiet and gets a dashed edge. */
  .fl--leer .fl__t { border: 1.5px dashed var(--linie-stark); }
  .fl--ink { color: var(--grund); }
  /* Yellow stays yellow in both themes, with dark type. */
  .fl--gelb { color: var(--fest-tinte); }
  /* Before it builds up, a picture shows the grid: every plane waits pale in its cell, without lettering.
     --wartet and --blass are written once when the picture is built (leistungen-bilder.js). */
  .tafel__bild[data-state="empty"] .fl__f { transform: var(--wartet); opacity: var(--blass); }
  .tafel__bild[data-state="empty"] .fl__t { visibility: hidden; }

  .et { display: block; font: 500 max(10px, 0.92em) / 1.25 var(--mono); letter-spacing: 0.09em; text-transform: uppercase; }
  .fl p { margin-top: 0.12em; font: 400 1.3em / 1.2 var(--antiqua); text-wrap: pretty; }
  .fl p:first-child { margin-top: 0; }
  .fl--ink p, .fl--gelb p { font-weight: 500; }
  .fl h3 { color: inherit; font: 600 1em / 1.2 var(--marke); letter-spacing: -0.015em; }
  .fl--ton h3 { font-size: 1.25em; }
  .fl .gross { margin: 0; font: 800 8.2em / 0.84 var(--marke); letter-spacing: -0.05em; white-space: nowrap; }
  .fl .gross span { margin-left: 0.45em; font: 300 0.2em / 1 var(--marke); letter-spacing: 0; }
  .raster--native .fl--leer .fl__t { padding-inline: 0.5em; }
  .raster--native .fl--leer h3 { font-size: 0.95em; }

  /* ---------- Wide page: text and picture side by side, centred on each other, and in turns: the first
     and third section have the text left and the picture right, the second and
     fourth the picture left and the text right. ---------- */
  @container (min-width: 900px) {
    grid-template-columns: minmax(0, 54fr) minmax(0, 46fr); column-gap: 72px; align-items: center; padding: 96px 72px 104px;
    .tafel__bild { --bw: min(560px, calc(var(--seite) * 0.54 - 150px)); grid-area: 1 / 1; }
    .tafel__text { grid-area: 1 / 2; }
    /* Only panels count, so the band of the whitepaper (workshop.css) and the films between panels (film.css) do not change the turns. */
    &:nth-child(odd of .tafel) {
      grid-template-columns: minmax(0, 46fr) minmax(0, 54fr);
      .tafel__bild { grid-area: 1 / 2; }
      .tafel__text { grid-area: 1 / 1; }
    }
  }
}

/* "Mehr zu …" under a panel and under the owner's text: a word in Unbounded on the yellow stroke of the page, which rises on hover; the arrow moves on. */
:is(.tafel, .ueber) .tafel__mehr {
  appearance: none; display: inline-flex; align-items: center; gap: 0.45em; margin-top: 1.75em; padding: 0.35em 0.1em;
  border: 0; color: var(--tinte); cursor: pointer; font: 600 15px / 1.2 var(--marke); letter-spacing: -0.01em;
  background: linear-gradient(var(--marker), var(--marker)) no-repeat 0 88% / 100% 0.38em;
  transition: background-size var(--dur-fast) var(--ease);
  .icon { width: 17px; height: 17px; transition: translate var(--dur-fast) var(--ease); }
  &:hover { background-size: 100% 1.05em; }
  &:hover .icon { translate: 3px 0; }
  &:focus-visible { outline: 2px solid var(--c-focus); outline-offset: 3px; }
}

/* ---------- The site owner introduces himself, under the film and above the first panel (js/app.js). His portrait stands on a
   yellow plane with a name plate, in the manner of the grid pictures: flat planes, no shadow, and they move
   by translate and opacity only, once, when the section comes into the window (.ist-da). ---------- */
.ueber {
  display: grid; row-gap: 44px; max-width: 1440px; margin-inline: auto; padding: 56px 16px 64px; border-top: 1px solid var(--linie-stark);
  color: var(--tinte); font-family: var(--antiqua);
  .ueber__bild { position: relative; justify-self: start; width: min(280px, 70cqw); margin: 0 0 18px 18px; }
  .ueber__flaeche { position: absolute; inset: 0; background: var(--gelb); translate: -18px 18px; transition: translate 700ms var(--ease); }
  img { position: relative; display: block; width: 100%; height: auto; }
  .ueber__schild {
    position: absolute; left: 14px; bottom: -14px; padding: 0.62em 0.8em; background: var(--tinte); color: var(--grund);
    font: 500 11.5px / 1.2 var(--mono); letter-spacing: 0.09em; text-transform: uppercase; white-space: nowrap;
    transition: translate 700ms var(--ease) 180ms, opacity 400ms var(--ease) 180ms;
  }
  &:not(.ist-da) .ueber__flaeche { translate: 0 0; }
  &:not(.ist-da) .ueber__schild { translate: 0 -14px; opacity: 0; }
  .ueber__text { min-width: 0; }
  h2 { font: 700 clamp(28px, 3.2cqw, 46px) / 1.05 var(--marke); letter-spacing: -0.035em; text-wrap: balance; }
  .ueber__haltung { margin-top: 0.5em; font-size: clamp(18px, 1.6cqw, 23px); line-height: 1.3; }
  mark { padding: 0 0.12em; margin: 0 -0.12em; background: linear-gradient(var(--marker), var(--marker)) no-repeat 0 62% / 100% 74%; color: inherit; }
  .ueber__haltung ~ p { max-width: 36em; margin-top: 0.8em; font-size: clamp(18px, calc(1.42vw + 1px), 21.5px); line-height: 1.5; text-wrap: pretty; }
  .ueber__haltung + p { margin-top: 1.3em; }
  @container (min-width: 900px) {
    grid-template-columns: minmax(0, 42fr) minmax(0, 58fr); column-gap: 72px; align-items: center; padding: 104px 72px;
    .ueber__bild { justify-self: end; width: min(340px, 100%); margin: 0 0 22px 22px; }
    .ueber__flaeche { translate: -22px 22px; }
  }
}
@media (prefers-reduced-motion: reduce) { .ueber .ueber__flaeche, .ueber .ueber__schild { transition: none; } }

/* ---------- Close of the page: the button of the stage once more (.knopf, styles.css) ---------- */
.schluss { position: relative; min-height: 48svh; display: grid; place-content: center; }
.schluss::before { content: ""; position: absolute; inset: 0 5cqw auto; border-top: 1px solid var(--linie-stark); }
@container (max-width: 899.98px) { .schluss::before { inset-inline: 6cqw; } }
