/* ==========================================================================
   Levio Flow — "Module" block: 3D glass cards + slide-deck viewer
   Uses the tokens from landing.css
   ========================================================================== */

#module { overflow: clip; }
#module::before {
  content: ""; position: absolute; inset: 10% -10% auto; height: 70%; z-index: -1; pointer-events: none;
  background:
    radial-gradient(600px 380px at 20% 40%, rgba(138, 28, 53, .32), transparent 70%),
    radial-gradient(520px 360px at 82% 60%, rgba(29, 90, 69, .30), transparent 70%);
  filter: blur(10px);
}

/* ---------- Filter chips ---------- */
.mod-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 38px 0 34px; }
.mod-chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 999px;
  font-size: 14px; font-weight: 600; color: var(--text-dim);
  background: var(--surface); border: 1px solid var(--line-soft);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  transition: color .3s, background .3s, border-color .3s, transform .3s var(--ease);
}
.mod-chip span { font-size: 11px; font-weight: 700; color: var(--text-mute); padding: 1px 7px; border-radius: 999px; background: rgba(255, 255, 255, .06); }
.mod-chip:hover { color: var(--text); transform: translateY(-1px); }
.mod-chip.active { color: #2a1606; border-color: transparent; background: linear-gradient(120deg, #b88d3a, #f3dfa6 55%, #d6b061); }
.mod-chip.active span { color: #2a1606; background: rgba(42, 22, 6, .14); }
.mod-chip:focus-visible, .mod-card:focus-visible, .deck-btn:focus-visible, .deck-nav:focus-visible { outline: 2px solid var(--gold-400); outline-offset: 3px; }

/* ---------- Cards (shared) ---------- */
.mod-card {
  --rx: 0deg; --ry: 0deg; --gx: 50%; --gy: 0%; --lift: 0px;
  --acc: rgba(138, 28, 53, .55);
  position: relative; display: block; width: 100%; padding: 0; border: 0; background: none; text-align: left;
  perspective: 1100px; color: var(--text); -webkit-tap-highlight-color: transparent;
}
.mod-card.g-gastro, .mod-card.g-einkauf { --acc: rgba(29, 90, 69, .6); }
.mod-card.g-hotel { --acc: rgba(201, 162, 78, .42); }
.mod-inner {
  position: relative; display: block; height: 100%; border-radius: var(--radius);
  transform-style: preserve-3d;
  transform: rotateX(var(--rx)) rotateY(var(--ry)) translateY(var(--lift));
  transition: transform .5s var(--ease), box-shadow .5s var(--ease);
  box-shadow:
    0 2px 0 rgba(255, 255, 255, .04) inset,
    0 28px 60px -24px rgba(0, 0, 0, .85),
    0 50px 90px -50px var(--acc);
}
.mod-card:hover .mod-inner, .mod-card:focus-visible .mod-inner {
  --lift: -6px;
  transition: transform .18s linear, box-shadow .5s var(--ease);
  box-shadow:
    0 2px 0 rgba(255, 255, 255, .05) inset,
    0 46px 80px -28px rgba(0, 0, 0, .9),
    0 60px 120px -40px var(--acc);
}
.mod-glass {
  position: absolute; inset: 0; border-radius: inherit; overflow: hidden;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, .085), rgba(255, 255, 255, .02) 45%, rgba(255, 255, 255, .035)),
    radial-gradient(120% 90% at 100% 100%, var(--acc), transparent 60%),
    rgba(22, 10, 13, .55);
  border: 1px solid rgba(230, 199, 122, .16);
  backdrop-filter: blur(16px) saturate(140%); -webkit-backdrop-filter: blur(16px) saturate(140%);
  transform: translateZ(0);
}
.mod-glass::before {   /* gold hairline on the top edge */
  content: ""; position: absolute; inset: 0 12% auto; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(243, 223, 166, .7), transparent);
}
.mod-glare {
  position: absolute; inset: 0; opacity: 0; transition: opacity .4s;
  background: radial-gradient(480px circle at var(--gx) var(--gy), rgba(255, 241, 201, .16), transparent 45%);
  mix-blend-mode: screen;
}
.mod-card:hover .mod-glare { opacity: 1; }

.mod-body { position: relative; display: flex; flex-direction: column; gap: 8px; transform: translateZ(28px); }
.mod-cat { font-size: 11px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: var(--gold-400); }
.mod-title { font-family: var(--font-display); font-weight: 600; font-size: 30px; line-height: 1.05; letter-spacing: -.005em; }
.mod-tag { font-size: 15px; line-height: 1.5; color: var(--text-dim); }
.mod-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.mod-pills span {
  font-size: 11.5px; font-weight: 600; color: var(--gold-300); padding: 4px 10px; border-radius: 999px;
  border: 1px solid rgba(230, 199, 122, .28); background: rgba(0, 0, 0, .18); white-space: nowrap;
}

/* ---------- Grid cards ---------- */
.mod-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 26px; }
.mod-grid .mod-card { min-height: 340px; }
.mod-grid .mod-inner { padding: 26px 150px 70px 26px; }
.mod-no {
  position: absolute; right: 22px; top: 14px; transform: translateZ(14px);
  font-family: var(--font-display); font-weight: 700; font-size: 64px; line-height: 1; letter-spacing: -.02em;
  color: transparent; -webkit-text-stroke: 1px rgba(230, 199, 122, .45);
}
.mod-phone {
  position: absolute; right: 22px; bottom: 22px; width: 104px; aspect-ratio: 540 / 1169;
  border-radius: 18px; padding: 4px; background: #120306;
  box-shadow: 0 0 0 1px rgba(230, 199, 122, .25), 0 22px 40px -10px rgba(0, 0, 0, .85);
  transform: translateZ(46px) rotate(4deg);
  transition: transform .6s var(--ease);
}
.mod-phone img { width: 100%; height: 100%; object-fit: cover; border-radius: 14px; }
.mod-card:hover .mod-phone { transform: translateZ(80px) rotate(0deg) translateY(-6px); }
.mod-foot {
  position: absolute; left: 26px; right: 150px; bottom: 22px; transform: translateZ(22px);
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  font-size: 13px; color: var(--text-mute);
}
.mod-foot .mod-go { color: var(--gold-300); font-weight: 600; white-space: nowrap; }
.mod-foot .mod-go i { display: inline-block; font-style: normal; transition: transform .35s var(--ease); }
.mod-card:hover .mod-go i { transform: translateX(5px); }

/* entrance + filter */
.mod-grid .mod-card { transition: opacity .5s var(--ease), transform .5s var(--ease); }
.js .mod-grid .mod-card:not(.in) { opacity: 0; transform: translateY(40px) scale(.97); }
.mod-grid .mod-card.in { transition-delay: calc(var(--i) % 3 * 70ms); }
.mod-grid .mod-card.is-hidden { display: none; }

/* ---------- Featured card (overview presentation) ---------- */
.mod-feature { min-height: 0; margin-bottom: 26px; --acc: rgba(201, 162, 78, .38); }
.mod-feature .mod-inner { display: flex; align-items: center; gap: 34px; padding: 30px 36px; }
.mod-feature .mod-glass {
  background:
    linear-gradient(120deg, rgba(255, 255, 255, .09), rgba(255, 255, 255, .02) 50%, rgba(255, 255, 255, .05)),
    radial-gradient(90% 140% at 0% 0%, rgba(138, 28, 53, .55), transparent 60%),
    radial-gradient(70% 120% at 100% 100%, rgba(29, 90, 69, .45), transparent 60%),
    rgba(22, 10, 13, .55);
}
.mod-emblem { flex: none; transform: translateZ(50px); }
.mod-emblem img { width: 150px; height: auto; filter: drop-shadow(0 18px 30px rgba(0, 0, 0, .7)) drop-shadow(0 0 30px rgba(201, 162, 78, .2)); }
.mod-feature .mod-body { flex: 1; min-width: 0; }
.mod-feature .mod-title { font-size: clamp(30px, 3.2vw, 42px); }
.mod-feature .mod-tag { font-size: 16px; max-width: 560px; }
.mod-feature .mod-go { flex: none; transform: translateZ(40px); pointer-events: none; }

/* ---------- Deck viewer ---------- */
html.deck-lock, html.deck-lock body { overflow: hidden; }
.deck { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 16px; }
.deck[hidden] { display: none; }
.deck-backdrop {
  position: absolute; inset: 0; background: rgba(8, 3, 5, .72);
  backdrop-filter: blur(14px) saturate(120%); -webkit-backdrop-filter: blur(14px) saturate(120%);
  opacity: 0; transition: opacity .4s var(--ease);
}
.deck-panel {
  position: relative; display: flex; flex-direction: column;
  width: min(1320px, 100%); max-height: 100%;
  border-radius: 26px; overflow: hidden;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, .015) 40%),
    radial-gradient(80% 60% at 0% 0%, rgba(107, 20, 40, .45), transparent 70%),
    radial-gradient(70% 60% at 100% 100%, rgba(21, 65, 50, .4), transparent 70%),
    rgba(18, 8, 11, .92);
  border: 1px solid var(--line);
  box-shadow: 0 60px 160px -40px rgba(0, 0, 0, .9), 0 0 0 1px rgba(255, 255, 255, .03) inset;
  opacity: 0; transform: scale(.92) translateY(20px);
  transition: opacity .45s var(--ease), transform .55s var(--ease);
}
.deck.open .deck-backdrop { opacity: 1; }
.deck.open .deck-panel { opacity: 1; transform: none; }
.deck-panel:fullscreen { width: 100%; max-height: none; height: 100%; border-radius: 0; border: 0; }

.deck-head { display: flex; align-items: center; gap: 12px; padding: 16px 18px 12px 24px; }
.deck-ttl { flex: 1; min-width: 0; }
.deck-ttl small { display: block; font-size: 11px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: var(--gold-400); }
.deck-ttl h3 {
  margin: 2px 0 0; font-family: var(--font-display); font-weight: 600; font-size: 28px; line-height: 1.1;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.deck-note { font-size: 12px; color: var(--text-mute); padding: 5px 10px; border: 1px solid var(--line-soft); border-radius: 999px; white-space: nowrap; }
.deck-note[hidden] { display: none; }
.deck-btn, .deck-nav {
  flex: none; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--surface); color: var(--text); font-size: 17px;
  transition: background .3s, transform .3s var(--ease), opacity .3s;
}
.deck-btn svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.deck-btn:hover, .deck-nav:hover:not(:disabled) { background: var(--surface-2); transform: translateY(-1px); }
.deck-nav:disabled { opacity: .3; cursor: default; }
.deck-head [data-rot] { display: none; }

.deck-view { position: relative; flex: 1; min-height: 0; display: grid; place-items: center; padding: 0 18px; }
.deck-stage {
  --s: .5;
  position: relative; width: min(100%, calc((100dvh - 210px) * 16 / 9)); aspect-ratio: 16 / 9;
  border-radius: 14px; overflow: hidden; background: var(--deck-bg, #2A0710);
  box-shadow: 0 30px 70px -20px rgba(0, 0, 0, .85), 0 0 0 1px rgba(230, 199, 122, .14);
  transition: opacity .22s, transform .22s var(--ease);
  touch-action: pan-y;
}
.deck-panel:fullscreen .deck-stage { width: min(100%, calc((100dvh - 150px) * 16 / 9)); }
.deck-stage.swap { opacity: 0; transform: scale(.98); }
.dk-wait {
  position: absolute; inset: 0; display: grid; place-items: center; color: var(--text-dim); font-size: 15px;
  background: radial-gradient(circle at 50% 50%, rgba(201, 162, 78, .12), transparent 60%);
}
.dk-tap { position: absolute; top: 0; bottom: 0; width: 26%; z-index: 5; border: 0; padding: 0; background: none; cursor: pointer; }
.dk-tap.l { left: 0; cursor: w-resize; }
.dk-tap.r { right: 0; cursor: e-resize; }

.deck-progress { height: 2px; margin: 14px 18px 0; background: rgba(255, 255, 255, .07); border-radius: 2px; overflow: hidden; }
.deck-progress i { display: block; height: 100%; background: var(--gold-grad); transform-origin: 0 50%; transform: scaleX(0); transition: transform .5s var(--ease); }
.deck-foot { display: flex; align-items: center; gap: 12px; padding: 12px 18px 16px; }
.deck-count { min-width: 64px; text-align: center; font-size: 14px; font-variant-numeric: tabular-nums; color: var(--text-dim); }
.deck-spacer { flex: 1; }
.deck.at-end .deck-nextdeck { box-shadow: 0 0 0 1px var(--gold-500), 0 0 30px -6px rgba(201, 162, 78, .6); }
.deck-unrot, .deck-rothint { display: none; }

/* one slide = the original 1920×1080 <section>, scaled to the stage */
.dk-slide {
  position: absolute; inset: 0; opacity: 0; visibility: hidden;
  transform: translateX(4%) scale(.985);
  transition: opacity .5s var(--ease), transform .7s var(--ease), visibility 0s .7s;
}
.dk-slide.past { transform: translateX(-4%) scale(.985); }
.dk-slide.on { opacity: 1; visibility: visible; transform: none; transition: opacity .5s var(--ease), transform .7s var(--ease), visibility 0s; }
.dk-slide > section {
  position: absolute; left: 0; top: 0; width: 1920px; height: 1080px; overflow: hidden;
  transform: scale(var(--s)); transform-origin: 0 0;
  line-height: 1.2; text-align: left; letter-spacing: normal; -webkit-font-smoothing: antialiased;
  color-scheme: light;   /* keeps the embedded animations' iframes transparent */
}
.dk-slide section * { margin: 0; }
.dk-slide section p, .dk-slide section h1, .dk-slide section h2, .dk-slide section h3 { font-weight: inherit; }
.dk-slide section h1, .dk-slide section h2, .dk-slide section h3 { font-size: inherit; }
.dk-slide section ul { padding-left: 1.1em; }
.dk-slide section hr { border: 0; height: 0; }
.dk-slide section table { border-collapse: collapse; border-spacing: 0; }
.dk-slide section th { text-align: left; font-weight: 600; }
.dk-slide section img { max-width: none; }
.dk-slide section svg.xi { display: block; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.dk-slide section svg.xc { position: absolute; left: 0; top: 0; width: 1px; height: 1px; overflow: visible; pointer-events: none; }
.dk-slide section x-embed { display: block; }
.dk-slide section x-embed iframe { display: block; width: 100%; height: 100%; border: 0; background: transparent; pointer-events: none; }
.dk-slide section video { display: block; }

/* build-in animations ("rise 1", "fade 2", "pop 3" …) replay each time a slide is shown */
.dk-slide [data-bi] { opacity: 0; }
.dk-slide.play [data-bi] { animation: dk-fade .7s var(--ease) both; animation-delay: calc(var(--o, 1) * 260ms + 120ms); }
.dk-slide.play [data-bi="rise"] { animation-name: dk-rise; }
.dk-slide.play [data-bi="pop"] { animation-name: dk-pop; animation-duration: .55s; }
@keyframes dk-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes dk-rise { from { opacity: 0; translate: 0 48px; } to { opacity: 1; translate: 0 0; } }
@keyframes dk-pop { 0% { opacity: 0; scale: .4; } 70% { opacity: 1; scale: 1.08; } 100% { opacity: 1; scale: 1; } }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .mod-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
  .mod-grid .mod-card.in { transition-delay: calc(var(--i) % 2 * 70ms); }
}
@media (max-width: 720px) {
  .mod-chips { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; margin: 26px -16px 22px; padding: 4px 16px; scrollbar-width: none; }
  .mod-chips::-webkit-scrollbar { display: none; }
  .mod-chip { flex: none; }
  .mod-grid { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .mod-grid .mod-card { min-height: 0; }
  .mod-grid .mod-inner { padding: 18px 108px 52px 18px; min-height: 212px; }
  .mod-no { font-size: 44px; right: 16px; top: 12px; }
  .mod-phone { width: 74px; right: 18px; bottom: 16px; border-radius: 14px; padding: 3px; }
  .mod-phone img { border-radius: 11px; }
  .mod-title { font-size: 25px; }
  .mod-tag { font-size: 14px; }
  .mod-pills span { font-size: 11px; }
  .mod-foot { left: 18px; right: 108px; bottom: 16px; }
  .mod-feature .mod-inner { flex-direction: column; align-items: flex-start; gap: 16px; padding: 22px; }
  .mod-emblem img { width: 96px; }
  .mod-feature .mod-go { align-self: stretch; }

  .deck { padding: 0; }
  .deck-panel { width: 100%; height: 100%; max-height: none; border-radius: 0; border: 0; }
  .deck-head { padding: calc(10px + env(safe-area-inset-top)) 12px 8px 16px; gap: 8px; }
  .deck-ttl h3 { font-size: 22px; }
  .deck-note { display: none; }
  .deck-view { padding: 0 10px; }
  .deck-stage { width: 100%; border-radius: 10px; }
  .deck-foot { flex-wrap: wrap; gap: 10px; padding: 10px 12px calc(14px + env(safe-area-inset-bottom)); }
  .deck-spacer { display: none; }
  .deck-count { flex: 1; }
  .deck-nextdeck, .deck-cta { flex: 1 1 100%; }
  .deck-nextdeck .lbl { display: none; }
}
/* phones held upright: offer a rotated, full-screen view of the slide */
@media (max-width: 720px) and (orientation: portrait) {
  .deck-head [data-rot] { display: grid; }
  .deck-rothint {
    display: inline-flex; align-items: center; gap: 8px; margin-top: 14px; padding: 9px 16px; border-radius: 999px;
    font-size: 14px; font-weight: 600; color: var(--gold-300); background: var(--surface); border: 1px solid var(--line);
  }
  .deck-rothint svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .deck-view { align-content: center; }
  .deck.rot .deck-stage {
    position: fixed; left: 50%; top: 50%; z-index: 4; border-radius: 0;
    width: min(100dvh, 100vw * 16 / 9);
    transform: translate(-50%, -50%) rotate(90deg);
  }
  .deck.rot .deck-view::after { content: ""; position: fixed; inset: 0; z-index: 3; background: #000; }
  .deck.rot .deck-unrot {
    display: grid; place-items: center; position: fixed; z-index: 6; right: 12px; top: calc(12px + env(safe-area-inset-top));
    width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line); background: rgba(18, 8, 11, .8); color: var(--text);
  }
}
@media (max-height: 520px) and (orientation: landscape) {
  .deck { padding: 0; }
  .deck-panel { width: 100%; height: 100%; max-height: none; border-radius: 0; border: 0; }
  .deck-head { padding: 6px 12px 4px 16px; }
  .deck-ttl h3 { font-size: 18px; }
  .deck-ttl small, .deck-note, .deck-progress { display: none; }
  .deck-stage { width: min(100%, calc((100dvh - 108px) * 16 / 9)); }
  .deck-foot { padding: 6px 12px; }
  .deck-btn, .deck-nav { width: 36px; height: 36px; }
}
@media (prefers-reduced-motion: reduce) {
  .mod-inner, .mod-phone, .dk-slide, .deck-panel, .deck-backdrop { transition: none !important; }
  .dk-slide [data-bi] { opacity: 1; }
  .dk-slide.play [data-bi] { animation: none; }
  .js .mod-grid .mod-card:not(.in) { opacity: 1; transform: none; }
}
