/* «Mehr als ein Chat» with the Kontexus X as the one thing that moves.
   Tiles are things (apps, files, the Swiss operation); the X is Kontexus at work. The X
   sits small left of the content like the winch of a lift: it turns with the scroll, a thin
   cable runs up from it, and its marks run with the turn, so the X seems to take us down.
   On the way, the pieces of each card come out of it one by one: an app here, a line of
   text, the next app there. When a card is complete, the X stands as an X. No box around
   the content, no tile grid in the background. Without the script or with reduced motion
   the blocks stay side by side. */

/* calm background below the hero: the tile wall stays the hero's own */
#produkt::before { display: none; }
#produkt.section { padding-top: 24px; }

/* the section in normal flow: title and the three blocks one below the other on the right;
   on the left the shaft (a dashed line down the whole section) and the X, which stays at
   the same height in the window while the blocks pass it */
.spin.is-on { position: relative; margin-top: 8px; }
.spin.is-on .spin__stage { position: relative; display: grid; grid-template-columns: clamp(64px, 7vw, 96px) minmax(0, 1fr); grid-template-rows: auto;
  column-gap: clamp(28px, 4vw, 64px); padding: 4vh 0 18vh; }
.spin:not(.is-on) .spin__wheel { display: none; }
.spin.is-on .spin__main { display: contents; }
/* the X: sticky in the middle of the window, inside the left column that spans the whole section */
.spin.is-on .spin__wheel { grid-column: 1; grid-row: 1; align-self: start; position: sticky; top: calc(50vh + var(--nav-h) / 2 - clamp(32px, 3.5vw, 48px));
  z-index: 3; width: 100%; aspect-ratio: 1; }
.spin__x { display: block; width: 100%; height: 100%; overflow: visible; }
.spin__x { background: radial-gradient(circle, var(--bg, #fbfbfa) 0 46%, transparent 47%); border-radius: 50%; }
/* the shaft: the line the X travels down */
.spin__shaft { display: none; }
.spin.is-on .spin__shaft { display: block; position: absolute; left: 50%; width: 2px; margin-left: -1px; z-index: -1; pointer-events: none;
  /* light at the top, stronger towards the X */
  background: linear-gradient(180deg, #dbe6fd, #c3d6fb 45%, #8fb2f7); border-radius: 2px;
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 60px); mask-image: linear-gradient(180deg, transparent, #000 60px); }
/* the X at work, as in the app: arms flare, core pulses */
/* slower than the app's .85 s: on the page it reads as a calm pulse, not a blink */
.spin__wheel.is-busy .kxa { animation: kxFlare 1.6s cubic-bezier(.65,0,.35,1) infinite; }
.spin__wheel.is-busy .kxc { transform-box: fill-box; transform-origin: center; animation: kxCore 1.6s cubic-bezier(.65,0,.35,1) infinite; }
/* the steps left on the line: only a gap in the line, no mark (a small logo looked like a fault) */
.spin.is-on .spin__node { display: none !important; }
.spin__node { position: absolute; z-index: 2; width: 26px; height: 26px; margin: -13px 0 0 -13px; border-radius: 7px; background: #fff; border: 1px solid #e3e5e8;
  box-shadow: 0 2px 6px rgba(20,24,34,.06); display: grid; place-items: center; opacity: 0; transform: scale(.4); transition: opacity .25s ease, transform .4s cubic-bezier(.2,1.4,.4,1); pointer-events: none; }
.spin__node.is-on { opacity: 1; transform: none; }
.spin__node img { width: 16px; height: 16px; border-radius: 4px; display: block; }
.spin__node svg { width: 16px; height: 16px; display: block; }
.spin:not(.is-on) .spin__node { display: none; }
#produkt .spin.is-on .spin__panels { grid-column: 2; grid-row: 1; position: relative; display: flex; flex-direction: column; gap: 0; container-type: normal; }
/* one floor per block: the block stays in the middle of the window while its floor passes,
   the X turns and builds it; then the page moves on to the next floor */
.spin__floor { position: relative; height: 160vh; }
.spin__floor:last-child { height: 150vh; }
/* permissions and asking belong together: the permissions block is held shorter and the
   approval follows close behind it */
.spin__floor--short { height: 130vh; }
/* the title's floor: shorter, the X writes it word by word */
.spin__floor--head { height: 115vh; }
#produkt .spin.is-on .spin__floor > .section__head { position: sticky; top: calc(50vh + var(--nav-h) / 2); transform: translateY(-50%); margin: 0; }
.spin.is-on .pop--w { display: inline-block; }
#produkt .spin.is-on .spin__floor > .ptile { position: sticky; top: calc(50vh + var(--nav-h) / 2); transform: none; }   /* top set per block by v6.js */

/* the blocks: no box, picture and text side by side, each about half a window high */
#produkt .spin.is-on .spin__panels .ptile { max-width: 1000px; min-height: 0; aspect-ratio: auto;
  display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); align-items: center; gap: clamp(32px, 5vw, 72px); padding: 0;
  background: none; border: 0; box-shadow: none; border-radius: 0; }
#produkt .spin.is-on .spin__panels .ptile::before, #produkt .spin.is-on .spin__panels .ptile::after, #produkt .spin.is-on .ptile__clip { display: none; }
#produkt .spin.is-on .spin__panels .ptile .card__vis { min-height: 0; margin: 0; aspect-ratio: auto; }
#produkt .spin.is-on .spin__panels .ptile .card__txt h3 { font-size: 1.6rem; line-height: 1.2; }
#produkt .spin.is-on .spin__panels .ptile .card__txt p { font-size: 1.0625rem; line-height: 1.6; }
/* empty tiles are not things: left out here */
#produkt .spin.is-on .miniwall .tile--empty { visibility: hidden; }

/* a piece that comes out of the X: from the X's centre (--fx, --fy, set by v6.js), small,
   to its place; text slides in a little from the left */
.spin.is-on .pop { opacity: 0; transform: translate(var(--fx, -40px), var(--fy, 0px)) scale(.18);
  transition: transform .6s cubic-bezier(.2,1.25,.35,1), opacity .2s ease; }
.spin.is-on .pop.is-on { opacity: 1; transform: none; }
.spin.is-on .pop--txt { transform: translateX(-14px); transition: transform .45s cubic-bezier(.2,.8,.2,1), opacity .35s ease; }
.spin.is-on .pop--txt.is-on { transform: none; }

/* the section title is drawn in from the left as the stage comes in */
.spin.is-on .g-text { clip-path: inset(-4px calc((1 - var(--g, 0)) * 100%) -4px 0); }

/* ---- card 2: the permission window, as in the app (groups with Aus / Nachfragen / Erlaubt) ---- */
.spin.is-on #freigabe .card__vis, .spin.is-on #rechte .card__vis { display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start; height: auto; }
/* the approval card in its chat: the request as a bubble on the right, a step, then the card */
.chatx { display: none; }
.spin.is-on .chatx { display: flex; flex-direction: column; gap: 12px; max-width: 460px; margin-bottom: 14px; }
.chatx__b { align-self: flex-end; max-width: 88%; background: #ececec; border-radius: 16px; padding: 8px 13px; font-size: 13.5px; line-height: 1.45; color: #1c1e24; }
.chatx__st { display: flex; align-items: center; gap: 9px; font-size: 13px; color: #5b6270; }
.chatx__st img { width: 16px; height: 16px; border-radius: 4px; }
.perm { display: none; }
.spin.is-on .perm { display: block; width: 100%; max-width: 460px; background: #fff; border: 1px solid #e5e5e5; border-radius: 16px; box-shadow: 0 8px 28px rgba(0,0,0,.06); font-size: 12px; }
.perm__hd { display: flex; align-items: center; gap: 9px; padding: 10px 12px; border-bottom: 1px solid #eee; }
.perm__hd img { width: 22px; height: 22px; border-radius: 6px; }
.perm__hd b { font-size: 13px; font-weight: 600; }
.perm__row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 12px; }
.perm__row + .perm__row { border-top: 1px solid #f1f1f1; }
.perm__l { display: flex; flex-direction: column; min-width: 0; }
.perm__l b { font-weight: 600; font-size: 12.5px; }
.perm__l span { color: #8a8f98; font-size: 11px; line-height: 1.3; }
.seg { position: relative; flex: none; display: grid; grid-template-columns: repeat(3, 1fr); padding: 3px; border-radius: 999px; background: #f0f1f3; font-size: 11px; font-weight: 500; }
.seg span { position: relative; z-index: 1; padding: 4px 9px; text-align: center; color: #6e6e6e; white-space: nowrap; transition: color .2s ease .1s; }
.seg__th { position: absolute; top: 3px; bottom: 3px; left: 3px; width: calc((100% - 6px) / 3); border-radius: 999px; background: #0d0d0d;
  transform: translateX(calc(var(--s, 0) * 100%)); transition: transform .45s cubic-bezier(.3,1.3,.5,1); }
.seg:not([data-at]) span:nth-of-type(1), .seg[data-at="0"] span:nth-of-type(1), .seg[data-at="1"] span:nth-of-type(2), .seg[data-at="2"] span:nth-of-type(3) { color: #fff; }
/* the approval card lies over the lower part of the permission window, like a second window */
.spin.is-on #freigabe .ask { max-width: 460px; width: 100%; align-self: flex-start; margin: 0; position: relative; left: auto; top: auto; transform: none; z-index: 2; }
.spin.is-on #freigabe .ask.pop:not(.is-on) { transform: translate(var(--fx, -40px), var(--fy, 0px)) scale(.18); }
.pb--mid { background: #f0f1f3; color: #333; }
.ask__foot .pb--mid { display: none; }
.spin.is-on .ask__foot .pb--mid { display: inline-flex; }

/* phones and narrow windows: the shaft and the X at the left edge, the blocks in one column */
@media (max-width: 900px) {
  .spin.is-on .spin__stage { grid-template-columns: 36px minmax(0, 1fr); column-gap: 16px; padding-bottom: 10vh; }
  .spin.is-on .spin__wheel { width: 36px; top: calc(50vh + var(--nav-h) / 2 - 18px); }
  .spin__floor { height: 140vh; }
  .spin__floor--short { height: 120vh; }
  #produkt .spin.is-on .spin__panels .ptile { grid-template-columns: 1fr; gap: 22px; min-height: 0; }
  #produkt .spin.is-on .spin__panels .ptile .card__txt h3 { font-size: 1.3rem; }
  #produkt .spin.is-on .spin__panels .ptile .card__txt p { font-size: 1rem; }
  .spin.is-on #freigabe .ask, .spin.is-on .chatx, .spin.is-on .perm { max-width: none; }
  /* phones: the rows of the permission window without their line of explanation */
  .perm__l span { display: none; }
}

/* the section title: not shown (the hero says it, the blocks show it), kept for screen readers */
.spin.is-on .spin__srhead { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* block 4: Switzerland as dots, the flag tile at Bern, the leaf at the lower right */
.chmap { display: none; }
.spin.is-on #souveraenitaet .card__vis { position: relative; }
.spin.is-on .chmap { display: block; position: relative; width: 100%; aspect-ratio: 1.560; }
.chdot { position: absolute; width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%; background: #6B9FFF; }
.spin.is-on .chdot.pop { transition: transform .7s cubic-bezier(.2,1.1,.35,1), opacity .2s ease; }
.spin.is-on #souveraenitaet .miniwall { position: absolute; inset: 0; display: block; }
.spin.is-on #souveraenitaet .miniwall > li { position: absolute; width: 58px; }
/* the flag tile beside the leaf, in a row under the map, not on it */
.spin.is-on #souveraenitaet .miniwall > li:not(.tile--leaf):not(.tile--empty) { right: 72px; bottom: -82px; }
.spin.is-on #souveraenitaet .miniwall > li.tile--leaf { right: 0; bottom: -82px; }

/* bigger windows on desktop: the permission window, the chat and the approval card a step larger */
@media (min-width: 901px) {
  .spin.is-on .perm { font-size: 13px; }
  .perm__hd b { font-size: 14.5px; } .perm__l b { font-size: 13.5px; } .perm__l span { font-size: 12px; }
  .seg { font-size: 12px; } .seg span { padding: 5px 11px; }
  .chatx__b { font-size: 15px; padding: 10px 15px; } .chatx__st { font-size: 14px; } .chatx__st img { width: 18px; height: 18px; }
  .spin.is-on #freigabe .ask { font-size: 14px; }
  .spin.is-on #freigabe .ask .pb { height: 32px; font-size: 13.5px; }
}

/* the second connector window, a little lower and to the right, like a second window */
.spin.is-on .perm--2 { margin: 14px 0 0 32px; width: calc(100% - 32px); position: relative; z-index: 1; }
.perm__hd img[src*="bexio"] { border-radius: 6px; }

/* phones: the permission rows put their control under the label, the buttons of the
   approval card stay on one line, the two Swiss tiles get room under the map */
@media (max-width: 900px) {
  .perm__row { flex-wrap: wrap; gap: 6px; }
  .perm__l { flex: 1 0 100%; }
  .seg { flex: 1 0 100%; }
  .spin.is-on .perm--2 { margin: 12px 0 0 18px; width: calc(100% - 18px); }
  .spin.is-on #freigabe .ask .pb { padding: 0 10px; font-size: 12px; white-space: nowrap; }
  .spin.is-on #freigabe .ask__foot { gap: 4px; }
  #produkt .spin.is-on .spin__panels #souveraenitaet .card__vis { margin-bottom: 76px; }
  .spin.is-on #souveraenitaet .miniwall > li { width: 50px; }
  .spin.is-on #souveraenitaet .miniwall > li:not(.tile--leaf):not(.tile--empty) { right: 60px; bottom: -66px; }
  .spin.is-on #souveraenitaet .miniwall > li.tile--leaf { bottom: -66px; }
}

/* block 1: fifteen apps in five columns and three rows (four rows made the block too tall) */
.spin.is-on .miniwall--15 { grid-template-columns: repeat(5, 1fr); }

/* block 1: the app tiles at the size of the other content, not blown up to the column
   width (16 apps in 4 x 4, tiles about 66 px) */
.spin.is-on #agent .miniwall { max-width: 300px; gap: 12px; }

/* space between the floors: when a block lets go, the next one follows with a clear gap
   instead of right under it */
.spin__floor { margin-bottom: 24vh; }
.spin__floor:last-child { margin-bottom: 0; }
@media (max-width: 900px) { .spin__floor { margin-bottom: 16vh; } .spin__floor:last-child { margin-bottom: 0; } }

/* the faint tile grid between the blocks (v6.js places it and cuts it to the gaps; it
   stands still while a block is held) */
.spin__tiles { display: none; }
.spin.is-on .spin__tiles { display: block; position: fixed; left: 0; right: 0; z-index: -1; pointer-events: none;
  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='.5' stroke='%23141822' stroke-opacity='.07' vector-effect='non-scaling-stroke'/></svg>");
  background-repeat: repeat; }

/* the X goes once the section has passed (v6.js sets .is-gone) */
.spin__wheel { transition: opacity .3s ease; }
.spin__wheel.is-gone { opacity: 0; pointer-events: none; }

/* phones: no blur behind the bar (it costs a lot while scrolling on Android), an almost
   opaque background instead */
@media (max-width: 760px) {
  .nav { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; background: rgba(251,251,250,.97) !important; }
}

/* the X on its own layer: when it turns, the graphics chip rotates the finished image
   instead of the browser painting the SVG again every frame (costly on phone screens) */
.spin.is-on .spin__x { will-change: transform; transform: translateZ(0); }
/* phones: no flaring arms or pulsing core while a block is built (they repaint the SVG on
   every frame); the X only turns */
@media (max-width: 760px) {
  .spin__wheel.is-busy .kxa, .spin__wheel.is-busy .kxc { animation: none; }
}

/* phones: the large pieces (windows, the request, the steps, the approval card) fade in
   from a little below instead of flying out of the X: across the width of a phone their
   flight and spring made the screen seem to jump. The small ones (app tiles, map dots)
   still come out of the X. Nothing overshoots on phones. */
@media (max-width: 760px) {
  .spin.is-on .pop { transition: transform .5s cubic-bezier(.2,.8,.2,1), opacity .25s ease; }
  .spin.is-on .perm.pop, .spin.is-on .ask.pop, .spin.is-on .chatx__b.pop, .spin.is-on .chatx__st.pop { transform: translateY(14px); transition: transform .45s cubic-bezier(.2,.8,.2,1), opacity .35s ease; }
  .spin.is-on .perm.pop.is-on, .spin.is-on .ask.pop.is-on, .spin.is-on .chatx__b.pop.is-on, .spin.is-on .chatx__st.pop.is-on { transform: none; }
  .spin.is-on #freigabe .ask.pop:not(.is-on) { transform: translateY(14px); }
}

/* phones: the map's dots fade in at their place instead of flying out of the X (some 300
   dots in flight at once made the turning X stutter) */
@media (max-width: 760px) {
  .spin.is-on .chdot.pop { transform: none; transition: opacity .4s ease; }
}

/* «Anmelden» (to the app, for existing customers): in the bar before the language switch;
   on phones, where the bar only has room for «Preise», in the footer's bottom line */
/* like the other links in the bar: same type, grey, darker on hover, no background */
.nav__login { font-size: .9375rem; font-weight: 500; color: var(--muted, #5b6270); padding: 0 4px; transition: color .15s ease; }
.nav__login:hover { color: var(--text, #1c1e24); }
.footer__login { display: none; }
@media (max-width: 760px) {
  .nav__login { display: none; }
  .footer__login { display: inline; }
}

/* the bar: the link of the section in view in blue, no background; the active language
   the same way, so the two read alike */
.nav__links a { transition: color .2s ease, border-color .2s ease; }
.nav__links a.is-current { color: var(--accent, #3674d9); }
.langsw a.is-active { color: var(--accent, #3674d9); background: none; }
@media (max-width: 760px) {
  .nav__links a[href="#preise"].is-current { color: var(--accent, #3674d9); border-color: rgba(54,116,217,.45); }
}

/* the language as a small menu in the bar (the footer keeps the row of all four) */
.langdd { position: relative; }
.langdd > summary { list-style: none; display: inline-flex; align-items: center; gap: 4px; cursor: pointer; padding: 6px 6px 6px 8px; border-radius: 8px;
  font-size: .75rem; font-weight: 600; letter-spacing: .04em; color: var(--accent, #3674d9); }
.langdd > summary::-webkit-details-marker { display: none; }
.langdd > summary svg { width: 12px; height: 12px; transition: transform .2s ease; }
.langdd[open] > summary svg { transform: rotate(180deg); }
.langdd > summary:hover { background: rgba(20,24,34,.05); }
.langdd__menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 140px; padding: 6px; background: #fff; border: 1px solid rgba(20,24,34,.09);
  border-radius: 12px; box-shadow: 0 12px 32px -12px rgba(20,24,34,.28); display: flex; flex-direction: column; z-index: 60; }
.langdd__menu a { padding: 7px 10px; border-radius: 8px; font-size: .875rem; color: var(--text, #1c1e24); }
.langdd__menu a:hover { background: rgba(20,24,34,.05); }
.langdd__menu a.is-active { color: var(--accent, #3674d9); }
@media (max-width: 760px) { .nav .langdd { display: none; } }   /* phones: the footer carries the language */

/* the ETH start-up mark in the footer: a copy without the file's transparent margin
   (eth-startup-tight.png), so its left edge lines up with the LLMify logo and the text */
.footer__eth { height: 30px; width: auto; margin-top: 22px; }
