/* The stacked hero (phones, tablets and laptops up to the limits of STACKED in hero.js),
   read as the Kontexus app itself: no card around the chat, the example runs on the page
   background without a label, no subtitle and no buttons («Preise» is in the bar), the steps close together as in
   the app. No input field: it looked as if one could type into it. One design for every
   stacked width; the desktop wall is the other. All rules are scoped to .is-stack, so they
   never touch the wall. Loaded after hero.css. */

/* every stacked width, flat windows included */
@media all {
  /* no buttons: «Preise» is in the bar right above, and the section below follows directly */
  body #usecases .hero.is-stack .ctas { display: none; }
  /* no subtitle either: the example right below shows what it says, and the title leads
     straight into it (the heading stays the only text before the request) */
  body #usecases .hero.is-stack .sub { display: none; }

  /* the chat without its card */
  body #usecases .hero.is-stack .screen { margin-top: 36px; padding-top: 0; border-top: 0; }
  body #usecases .hero.is-stack .mcard { background: none; border: 0; border-radius: 0; box-shadow: none; }
  body #usecases .hero.is-stack .mc { padding: 0 0 8px; }
  body #usecases .hero.is-stack .mc__prompt { max-width: 86%; }
  /* the request arrives as if just sent: it rises a little and fades in */
  body #usecases .hero.is-stack .mc .mc__prompt { transform: translateY(14px); transition: opacity .4s ease, transform .5s cubic-bezier(.2,.8,.2,1); }
  body #usecases .hero.is-stack .mc.p-on .mc__prompt { transform: none; }
  /* the steps close together, the answer right under them, as in the app */
  body #usecases .hero.is-stack .mc__list { margin-top: 18px; gap: 10px; --rg: 10px; }
  body #usecases .hero.is-stack .mc__ans { padding-top: 14px; }
  body #usecases .hero.is-stack .mc__result { line-height: 1.5; }
  body #usecases .hero.is-stack .origin { margin-top: 40px; }
}

/* phones: text and chat share one width; title and logo sized to the screen */
@media (max-width: 760px) {
  /* on first load the hero fills the screen below the bar, its content in the middle */
  body #usecases .hero.is-stack { min-height: calc(100vh - var(--nav-h)); min-height: calc(100svh - var(--nav-h)); display: flex; }
  body #usecases .hero.is-stack .hero__inner { flex: 1; justify-content: center; }
  /* «Betrieben in der Schweiz» at the bottom edge of the first screen, not right under the
     example: the example keeps room for the longest answer, and that room read as a gap
     above the line */
  body #usecases .hero.is-stack .hero__inner { position: relative; padding-bottom: 72px; }
  body #usecases .hero.is-stack .origin { position: absolute; left: 0; right: 0; bottom: 28px; margin: 0; }
  body #usecases .hero.is-stack .hero__inner { padding: 24px 20px 36px; }
  body #usecases .hero.is-stack .logo { width: 220px; margin-bottom: 22px; }
  body #usecases .hero.is-stack .tagline { font-size: clamp(2rem, 9.6vw, 2.6rem); line-height: 1.04; margin: 0 0 14px; }
  body #usecases .hero.is-stack .sub { max-width: none; font-size: 1.0625rem; line-height: 1.5; }
}
@media (max-width: 760px) and (max-height: 700px) {
  body #usecases .hero.is-stack .logo { width: 190px; margin-bottom: 14px; }
  body #usecases .hero.is-stack .screen { margin-top: 22px; }
}

/* tablets and laptops in the stacked layout: the same design, a little more air */
@media (min-width: 761px) {
  body #usecases .hero.is-stack .screen { margin-top: 48px; }
  body #usecases .hero.is-stack .mc__prompt { max-width: 78%; }
}

/* the faint tile layer behind the stacked hero (stackbg.js): a very faint grid, app tiles
   barely visible, the tiles of the running example lit */
.sbg { display: none; }
#usecases .hero.is-stack:not(.is-land) .sbg { display: block; position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
/* the tiles lie in a child over the wave (stackbg.js places them) */
#usecases .sbg__grid { position: absolute; inset: 0;
  background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'><rect x='0.5' y='0.5' width='79' height='79' rx='17.6' fill='%23ffffff' fill-opacity='.4' stroke='%23141822' stroke-opacity='.05' vector-effect='non-scaling-stroke'/></svg>"); }
/* only hinted (tablets, laptops): at the sides it shows faintly, towards the middle, where
   the content is, it almost disappears; and it fades out towards the bottom. Phones get a
   mask drawn by stackbg.js instead. */
#usecases .hero.is-stack:not(.is-land) .sbg {
  -webkit-mask-image: linear-gradient(90deg, #000, rgba(0,0,0,.12) 30%, rgba(0,0,0,.12) 70%, #000), linear-gradient(180deg, #000 65%, transparent);
  mask-image: linear-gradient(90deg, #000, rgba(0,0,0,.12) 30%, rgba(0,0,0,.12) 70%, #000), linear-gradient(180deg, #000 65%, transparent);
  -webkit-mask-composite: source-in; mask-composite: intersect; }
/* phones: the mask is drawn by stackbg.js from the real positions (grid everywhere except
   behind the logo, the example and the Swiss line) */
@media (max-width: 760px) {
  #usecases .hero.is-stack:not(.is-land) .sbg { opacity: .6; -webkit-mask-composite: source-over; mask-composite: add; }
}
body #usecases .hero.is-stack:not(.is-land) .hero__inner { position: relative; z-index: 1; }
.sbg__t { position: absolute; border-radius: 22%; background: #fff; border: 1px solid rgba(20,24,34,.08); display: grid; place-items: center; overflow: hidden;
  opacity: .16; filter: grayscale(1); transition: opacity .5s ease, filter .5s ease, box-shadow .5s ease; }
.sbg__t img { width: 62%; height: 62%; object-fit: contain; display: block; }
.sbg__t--sq { border: 0; background: none; }
.sbg__t--sq img { width: 100%; height: 100%; }
.sbg__t.is-lit { opacity: .95; filter: none; box-shadow: 0 6px 16px -8px rgba(20,24,34,.25); }

/* the short line between title and example: stacked layout only (the desktop has the subtitle) */
.sub-short { display: none; }
body #usecases .hero.is-stack .sub-short { display: block; order: 0; margin: 12px auto 0; max-width: 34ch; text-align: center; font-size: 1rem; line-height: 1.45; color: var(--muted, #5b6270); text-wrap: balance; }

/* the traces running along tiles of the faint grid (stackbg.js); inside the layer, so they
   share its mask: faint behind the text, clearer at the sides */
.sbg__trace { position: absolute; left: 0; top: 0; pointer-events: none; }

/* a light blue wave runs through the tiles now and then: only inside the tiles (masked
   with the same grid as the tiles, stackbg.js sets its size and place), the gaps stay
   plain. The gradient moves inside the masked element (background-position), so the tile
   shapes stay put. Shares the layer's mask; none with reduced motion. */
/* (switched off: only the discreet grid stays) */
#usecases .sbg__wave { display: none; }
#usecases .sbg__wave-off { position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(105deg, transparent 38%, rgba(107,159,255,.28) 46%, rgba(54,116,217,.36) 50%, rgba(107,159,255,.28) 54%, transparent 62%);
  background-size: 300% 100%; background-position: 100% 0; background-repeat: no-repeat;
  -webkit-mask-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'><rect x='0.5' y='0.5' width='79' height='79' rx='17.6' fill='%23000'/></svg>");
  mask-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'><rect x='0.5' y='0.5' width='79' height='79' rx='17.6' fill='%23000'/></svg>");
  -webkit-mask-repeat: repeat; mask-repeat: repeat;
  animation: sbgwave 8s cubic-bezier(.45,0,.55,1) infinite; }
@keyframes sbgwave { 0% { background-position: 100% 0; } 62%, 100% { background-position: 0% 0; } }
@media (prefers-reduced-motion: reduce) { #usecases .sbg__wave { animation: none; opacity: 0; } }
