/* Home hero service showcase. Loaded on the home page only.
   Without JS only the first slide shows and the rail stays hidden, so the page reads as before. */

@property --tint { syntax: "<color>"; inherits: true; initial-value: #e3ece6; }

.showcase {
  --dwell: 7s;
  background:
    radial-gradient(55% 75% at 88% 28%, var(--tint), transparent 72%),
    radial-gradient(38% 55% at 4% 96%, color-mix(in srgb, var(--tint) 70%, transparent), transparent 70%);
  transition: --tint 1.4s var(--ease);
  padding-top: clamp(1.4rem, 3vw, 2.2rem);
}

.showcase__slides { display: grid; touch-action: pan-y; }
.showcase__slide { grid-area: 1 / 1; min-width: 0; align-self: start; }
.showcase:not(.is-ready) .showcase__slide:not(:first-child) { display: none; }

.showcase.is-ready .showcase__slide {
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .45s var(--ease), visibility 0s linear .45s;
}
.showcase.is-ready .showcase__slide.is-active {
  opacity: 1; visibility: visible; pointer-events: auto;
  transition: opacity .6s var(--ease) .1s, visibility 0s;
}

/* Entrance: copy sharpens into place line by line, the scene settles from slightly below. */
.showcase.is-ready .showcase__slide.is-active .hero__copy > * { animation: sc-in .8s var(--ease) both; }
.showcase.is-ready .showcase__slide.is-active .hero__copy > :nth-child(2) { animation-delay: .07s; }
.showcase.is-ready .showcase__slide.is-active .hero__copy > :nth-child(3) { animation-delay: .14s; }
.showcase.is-ready .showcase__slide.is-active .hero__copy > :nth-child(4) { animation-delay: .21s; }
.showcase.is-ready .showcase__slide.is-active .hero__copy > :nth-child(5) { animation-delay: .28s; }
.showcase.is-ready .showcase__slide.is-active .hero__visual { animation: sc-rise 1s var(--ease) .12s both; }
.showcase.is-ready .showcase__slide.is-active:first-child.is-first .hero__copy > *,
.showcase.is-ready .showcase__slide.is-active:first-child.is-first .hero__visual { animation: none; }

@keyframes sc-in { from { opacity: 0; transform: translateY(14px); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes sc-rise { from { opacity: 0; transform: translateY(26px) scale(.97); } to { opacity: 1; transform: none; } }

/* Large AI-search line straight under the local SEO sentence in the first slide. */
.ai-search {
  margin: 1.1rem 0 .35rem; font: 500 clamp(1.7rem, 3.4vw, 2.5rem)/1.05 var(--font-display);
  color: var(--forest); letter-spacing: -.01em;
}
.ai-search__note { margin: 0; max-width: 56ch; font-size: .95rem; color: var(--ink-soft); }

/* ---------- Rail: service tabs that double as the countdown ---------- */
/* Space is reserved before the script runs so the hero does not jump when the rail appears. */
.showcase__nav { display: flex; align-items: center; gap: .6rem; margin-bottom: clamp(1.8rem, 4vw, 3rem); max-width: 820px; }
.showcase:not(.is-ready) .showcase__nav { visibility: hidden; }
.showcase__rail {
  display: flex; gap: .35rem; flex: 1; min-width: 0; overflow-x: auto; scroll-snap-type: x proximity;
  scrollbar-width: none; padding: .25rem; border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 72%, transparent);
  border: 1px solid var(--line);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.showcase__rail::-webkit-scrollbar { display: none; }
.showcase__rail [role="tab"] {
  position: relative; flex: 1 0 auto; scroll-snap-align: center; overflow: hidden;
  min-height: 44px; padding: .55rem 1.05rem; border: 0; border-radius: 999px; background: transparent;
  font: 600 .88rem/1 var(--font-body, inherit); color: var(--ink-soft); cursor: pointer;
  transition: color .3s var(--ease), background-color .3s var(--ease);
}
.showcase__rail [role="tab"]:hover { color: var(--forest); background: rgba(14,58,50,.06); }
.showcase__rail [role="tab"][aria-selected="true"] { color: #fff; background: var(--forest); }
.showcase__rail [role="tab"] span { position: relative; z-index: 1; white-space: nowrap; }
.showcase__fill {
  position: absolute; left: 12%; right: 12%; bottom: 6px; height: 2px; border-radius: 2px;
  background: var(--brass); transform: scaleX(0); transform-origin: left; opacity: 0;
}
.showcase.is-playing [aria-selected="true"] .showcase__fill { opacity: 1; animation: sc-fill var(--dwell) linear forwards; }
.showcase.is-held [aria-selected="true"] .showcase__fill { animation-play-state: paused; }
@keyframes sc-fill { to { transform: scaleX(1); } }

.showcase__rail [role="tab"]:focus-visible { outline: 3px solid var(--brass); outline-offset: -3px; }

/* ---------- Scenes: one small working moment per service ---------- */
.scene {
  position: relative; max-width: 440px; margin-inline: auto; padding: 1.1rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow-lg);
  font-size: .9rem;
}
.scene__head { display: flex; align-items: center; gap: .55rem; padding-bottom: .8rem; margin-bottom: .9rem; border-bottom: 1px solid var(--line); }
.scene__head small { margin-left: auto; color: var(--ink-soft); font-size: .74rem; }
.scene__dot { width: 30px; height: 30px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #3f7a6c, var(--forest)); }

.chat { display: grid; gap: .55rem; }
.chat__msg { margin: 0; max-width: 85%; padding: .65rem .85rem; border-radius: 16px; line-height: 1.4; }
.chat__msg--in { background: #f1ede4; border-bottom-left-radius: 4px; justify-self: start; }
.chat__msg--out { background: var(--forest); color: #fff; border-bottom-right-radius: 4px; justify-self: end; }
.chat__typing { display: inline-flex; gap: 4px; margin: 0; padding: .6rem .8rem; background: #f1ede4; border-radius: 14px; justify-self: start; }
.chat__typing i { width: 6px; height: 6px; border-radius: 50%; background: #9aa59e; }
.is-active .chat__msg, .is-active .chat__typing { animation: sc-pop .5s var(--ease) both; animation-delay: calc(.6s + var(--i) * 1.15s); }
.is-active .chat__typing i { animation: sc-dot 1s ease-in-out infinite; }
.is-active .chat__typing i:nth-child(2) { animation-delay: .15s; } .is-active .chat__typing i:nth-child(3) { animation-delay: .3s; }
@keyframes sc-pop { from { opacity: 0; transform: translateY(8px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes sc-dot { 0%, 100% { transform: none; opacity: .5; } 50% { transform: translateY(-3px); opacity: 1; } }
.scene__chip { right: -10px; left: auto !important; }
.is-active .scene__chip { animation: sc-pop .6s var(--ease) 3.4s both; }

.scene--order { display: grid; grid-template-columns: 1.15fr .85fr; gap: 1rem; align-items: start; background: transparent; border: 0; box-shadow: none; padding: 0; }
.phone { padding: .9rem; border-radius: 26px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-lg); }
.phone__bar { font-weight: 700; color: var(--forest); padding: .2rem .2rem .7rem; font-size: .82rem; }
.phone__item { display: flex; justify-content: space-between; gap: .5rem; padding: .62rem .2rem; border-top: 1px solid var(--line); }
.phone__btn { margin-top: .7rem; padding: .7rem; text-align: center; border-radius: 999px; background: var(--forest); color: #fff; font-weight: 600; }
.is-active .phone__btn { animation: sc-press 1.1s var(--ease) .5s both; }
@keyframes sc-press { 0% { background: var(--brass); } 30% { transform: scale(.95); } 60% { transform: none; } 100% { background: var(--forest); } }
.printer { margin-top: 2.4rem; }
.printer__slot { height: 14px; border-radius: 8px; background: #2a332f; box-shadow: inset 0 -3px 0 #121815; }
.ticket {
  display: grid; gap: .25rem; margin: -4px 8px 0; padding: .8rem .7rem 1rem; background: #fff; font: 500 .74rem/1.3 ui-monospace, Consolas, monospace; color: #222;
  box-shadow: var(--shadow-md);
  -webkit-mask: radial-gradient(5px at 50% 100%, transparent 98%, #000) 0 0 / 12px 100%;
          mask: radial-gradient(5px at 50% 100%, transparent 98%, #000) 0 0 / 12px 100%;
}
.is-active .ticket { animation: sc-print 1.8s cubic-bezier(.3,.7,.3,1) 1.4s both; }
@keyframes sc-print { from { clip-path: inset(0 0 100% 0); transform: translateY(-14px); } to { clip-path: inset(0 0 0 0); transform: none; } }

.cal__head { display: flex; align-items: baseline; gap: .6rem; padding-bottom: .7rem; }
.cal__head small { margin-left: auto; color: var(--ink-soft); font-size: .74rem; }
.cal__row { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .7rem; padding: .62rem .5rem; border-top: 1px solid var(--line); border-radius: 10px; }
.cal__row em { font-style: normal; font-size: .74rem; font-weight: 600; color: var(--ink-soft); }
.cal__av { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: #e7efe9; color: var(--forest); font-size: .72rem; font-weight: 700; }
.cal__row--new { background: rgba(194,157,78,.14); }
.cal__row--new em { color: var(--brass-700); }
.is-active .cal__row--new { animation: sc-slot .7s var(--ease) 1.2s both; }
@keyframes sc-slot { from { opacity: 0; transform: translateX(-16px); background: transparent; } to { opacity: 1; transform: none; } }
.scene__assist { position: absolute; right: -14px; bottom: -34px; max-width: 74%; box-shadow: var(--shadow-md); }
.is-active .scene__assist { animation: sc-pop .6s var(--ease) 2.4s both; }

.scene--video { max-width: 300px; padding: .5rem; border-radius: 30px; background: #111a17; }
.reel { position: relative; aspect-ratio: 9 / 16; border-radius: 24px; overflow: hidden; background: #24302b; }
.reel img { width: 100%; height: 100%; object-fit: cover; }
.is-active .reel img { animation: sc-zoom calc(var(--dwell) + 1s) linear both; }
@keyframes sc-zoom { from { transform: scale(1.12); } to { transform: scale(1); } }
.reel__bar { position: absolute; left: 6%; right: 6%; bottom: 5%; height: 3px; border-radius: 3px; background: rgba(255,255,255,.3); overflow: hidden; }
.reel__bar i { display: block; height: 100%; background: #fff; transform: scaleX(0); transform-origin: left; }
.is-active .reel__bar i { animation: sc-fill var(--dwell) linear both; }

.langpage { padding: 1.6rem 1.5rem 1.8rem; }
.langpage__chips { display: flex; gap: .35rem; margin-bottom: 1.4rem; }
.langpage__chips span { padding: .3rem .65rem; border-radius: 999px; font-size: .74rem; font-weight: 700; color: var(--ink-soft); background: #f1ede4; }
.langpage__chips .is-on { background: var(--forest); color: #fff; }
.langpage__swap { display: grid; }
.langpage__swap p { grid-area: 1 / 1; margin: 0; }
.langpage__swap b { display: block; font: 500 1.7rem/1.1 var(--font-display); color: var(--ink); margin-bottom: .5rem; }
.langpage__swap span { color: var(--ink-soft); }
.langpage__swap p[lang="pl"] { opacity: 0; }
.langpage__btn { width: 46%; height: 40px; margin-top: 1.4rem; border-radius: 999px; background: var(--brass); }
.is-active .langpage__swap p[lang="en-GB"] { animation: sc-lang-a 5s var(--ease) 1s infinite both; }
.is-active .langpage__swap p[lang="pl"] { animation: sc-lang-b 5s var(--ease) 1s infinite both; }
.is-active .langpage__chips span:first-child { animation: sc-chip-a 5s step-end 1s infinite both; }
.is-active .langpage__chips span:nth-child(2) { animation: sc-chip-b 5s step-end 1s infinite both; }
@keyframes sc-lang-a { 0%, 40% { opacity: 1; filter: none; } 50%, 90% { opacity: 0; filter: blur(4px); } 100% { opacity: 1; filter: none; } }
@keyframes sc-lang-b { 0%, 40% { opacity: 0; filter: blur(4px); } 50%, 90% { opacity: 1; filter: none; } 100% { opacity: 0; filter: blur(4px); } }
@keyframes sc-chip-a { 0% { background: var(--forest); color: #fff; } 45% { background: #f1ede4; color: var(--ink-soft); } 95% { background: var(--forest); color: #fff; } }
@keyframes sc-chip-b { 0% { background: #f1ede4; color: var(--ink-soft); } 45% { background: var(--forest); color: #fff; } 95% { background: #f1ede4; color: var(--ink-soft); } }

@media (max-width: 860px) {
  .scene { max-width: 400px; }
  .scene__assist { right: 0; }
  .showcase__rail [role="tab"] { flex: 0 0 auto; }
}
@media (max-width: 480px) {
  .scene--order { grid-template-columns: 1fr; }
  .printer { margin-top: 0; }
  .scene--video { max-width: 230px; }
}

@media (prefers-reduced-motion: reduce) {
  .showcase { transition: none; }
  .showcase.is-ready .showcase__slide, .showcase.is-ready .showcase__slide.is-active { transition: opacity .2s linear; }
  .showcase { --dwell: 9s; }
  .showcase *:not(.showcase__fill), .showcase *::before, .showcase *::after { animation: none !important; }
  .langpage__swap p[lang="pl"] { opacity: 0; }
}
