/* =========================================================
   mdp.graphics — interaktivní scény (hovor, robot, YouTube)
   Navazuje na css/style.css, používá stejné tokeny.
   ========================================================= */

html.fx-lock, html.fx-lock body { overflow: hidden !important; }

.fx {
  position: fixed; inset: 0; z-index: 95;
  display: grid; place-items: center;
  padding: 24px;
}
.fx[hidden] { display: none; }
.fx-bg {
  position: absolute; inset: 0; background: rgba(6, 7, 8, .82);
  -webkit-backdrop-filter: blur(18px) saturate(1.1); backdrop-filter: blur(18px) saturate(1.1);
  opacity: 0; transition: opacity .4s var(--ease);
}
.fx.open .fx-bg { opacity: 1; }

/* =========================================================
   HOVOR
   ========================================================= */
.call {
  position: relative; width: min(100%, 380px);
  padding: 22px 26px 26px; border-radius: 26px; text-align: center;
  background: linear-gradient(180deg, #16181a 0%, #0b0c0d 100%);
  box-shadow: inset 0 0 0 1px rgba(246, 242, 233, .12), 0 40px 90px -30px #000;
  transform: translateY(26px) scale(.96); opacity: 0;
  transition: transform .5s var(--ease), opacity .35s var(--ease);
}
.fx.open .call { transform: none; opacity: 1; }
.fx-declined .call { transform: translateY(18px) scale(.94); opacity: 0; }

.call-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.call-state {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent);
}
.call-net { font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em; color: var(--dim); }

.call-who { margin-top: 26px; }
.call-avatar {
  position: relative; width: 92px; height: 92px; margin: 0 auto;
  border-radius: 50%; display: grid; place-items: center;
  background: var(--paper); color: var(--ink);
  font-family: var(--display); font-weight: 700; font-size: 46px; line-height: 1;
}
.call-avatar::after {
  content: ""; position: absolute; inset: -6px; border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(246, 242, 233, .16);
}
.fx-call.ringing .call-avatar::after { animation: callPulse 1.6s ease-out infinite; }
@keyframes callPulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 61, 46, .5); }
  70% { box-shadow: 0 0 0 22px rgba(255, 61, 46, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 61, 46, 0); }
}
.fx-call.ringing .call { animation: callShake 1.8s ease-in-out .15s 2; }
@keyframes callShake {
  0%, 100% { transform: none; }
  8% { transform: translateX(-3px) rotate(-.4deg); }
  16% { transform: translateX(3px) rotate(.4deg); }
  24% { transform: translateX(-2px); }
  32% { transform: translateX(2px); }
  40% { transform: none; }
}

.call-name {
  margin-top: 18px; font-family: var(--display); font-weight: 700; text-transform: uppercase;
  font-size: 34px; line-height: 1; letter-spacing: .01em;
}
.call-sub { margin-top: 8px; font-family: var(--mono); font-size: 11px; letter-spacing: .04em; color: var(--mute); }
.call-time { margin-top: 12px; font-family: var(--mono); font-size: 13px; color: var(--accent); font-variant-numeric: tabular-nums; }

.call-ring { display: flex; justify-content: center; gap: 44px; margin-top: 28px; }
.call-ring[hidden] { display: none; }
.call-btn {
  display: grid; place-items: center; gap: 8px;
  width: 68px; padding: 0; background: none; border: 0; cursor: pointer;
  color: var(--paper);
}
.call-btn svg { width: 30px; height: 30px; padding: 17px; box-sizing: content-box; border-radius: 50%; transition: transform .25s var(--ease), background .25s; }
.call-btn span { font-family: var(--mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--mute); white-space: nowrap; }
.call-acc svg { background: #2fbf5a; color: #04160a; }
.call-dec svg { background: var(--accent); color: #fff; transform: rotate(135deg); }
.call-btn:hover svg { transform: scale(1.08); }
.call-dec:hover svg { transform: rotate(135deg) scale(1.08); }

.call-info { display: flex; flex-direction: column; gap: 10px; margin-top: 22px; }
.call-info[hidden] { display: none; }
.call-mail { width: 100%; text-transform: none; letter-spacing: .01em; font-size: 12.5px; }
.call-links { display: flex; gap: 8px; }
.call-links .btn { flex: 1 1 auto; }
.call-hang {
  margin-top: 16px; width: 100%; height: 40px; border-radius: 3px;
  background: rgba(255, 61, 46, .12); color: var(--accent);
  font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
  box-shadow: inset 0 0 0 1px rgba(255, 61, 46, .4);
  transition: background .25s;
}
.call-hang:hover { background: rgba(255, 61, 46, .2); }
.call-hang[hidden] { display: none; }

/* =========================================================
   ROBOT
   ========================================================= */
.fx-robot .fx-bg { background: rgba(6, 7, 8, .55); }
.robot {
  position: relative; width: clamp(128px, 15vw, 178px); height: auto; overflow: visible;
  transform: translate3d(0, -118vh, 0) rotate(-12deg); opacity: 0;
  transition: transform .62s cubic-bezier(.2, 1.3, .45, 1), opacity .25s;
  filter: drop-shadow(0 18px 30px rgba(0, 0, 0, .55));
}
.fx-robot.drop .robot { transform: translate3d(0, 0, 0) rotate(0deg); opacity: 1; }
.fx-robot.land .robot { animation: robotSquash .42s cubic-bezier(.3, 1.5, .5, 1); }
.fx-robot.wave .r-arm.r { animation: robotWave .55s ease-in-out 2; transform-origin: 93px 80px; }
.fx-robot.fade .robot { opacity: 0; transform: translate3d(0, -14px, 0); }
.r-bulb { animation: robotBlink 1.1s steps(2, end) infinite; }
.r-eye { transform-origin: center; animation: robotEye 3.2s infinite; }
.r-shadow { opacity: 0; transition: opacity .3s; }
.fx-robot.drop .r-shadow { opacity: .22; }

@keyframes robotSquash {
  0% { transform: translateY(0) scale(1); }
  30% { transform: translateY(7px) scale(1.09, .88); }
  65% { transform: translateY(-2px) scale(.97, 1.03); }
  100% { transform: translateY(0) scale(1); }
}
@keyframes robotWave { 0%, 100% { transform: rotate(0deg); } 50% { transform: rotate(-38deg); } }
@keyframes robotBlink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: .25; } }
@keyframes robotEye { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.12); } }

.robot-txt {
  position: absolute; left: 0; right: 0; top: calc(50% + clamp(90px, 11vw, 125px));
  text-align: center; font-family: var(--mono); font-size: 11px; letter-spacing: .16em;
  text-transform: uppercase; color: var(--mute); opacity: 0; transition: opacity .3s .1s;
}
.fx-robot.drop .robot-txt { opacity: 1; }

/* =========================================================
   YOUTUBE — přepnutí obrazovky
   ========================================================= */
.fx-tube .fx-bg { background: rgba(6, 7, 8, .5); }
.tube { position: fixed; inset: 0; display: grid; place-items: center; overflow: hidden; }
.tube-line {
  position: absolute; left: 50%; top: 50%; width: 0; height: 3px; margin: -1.5px 0 0;
  transform: translateX(-50%);
  background: var(--paper);
  transition: width .26s cubic-bezier(.2, .9, .3, 1), height .32s cubic-bezier(.2, .9, .3, 1), margin .32s;
}
.fx-tube.on .tube-line { width: 100vw; }
.fx-tube.flash .tube-line { width: 100vw; height: 100vh; margin-top: -50vh; }
.tube-play {
  position: relative; z-index: 2; width: 96px; height: 96px; border-radius: 50%;
  display: grid; place-items: center; background: var(--accent); color: #fff;
  opacity: 0; transform: scale(.6); transition: opacity .25s, transform .4s cubic-bezier(.3, 1.5, .5, 1);
}
.tube-play svg { width: 40px; height: 40px; margin-left: 6px; }
.fx-tube.flash .tube-play { opacity: 1; transform: scale(1); }
.tube-txt {
  position: absolute; z-index: 2; top: calc(50% + 78px); left: 0; right: 0; text-align: center;
  font-family: var(--mono); font-size: 11.5px; letter-spacing: .2em; text-transform: uppercase;
  color: var(--ink); opacity: 0; transition: opacity .3s .1s;
}
.fx-tube.flash .tube-txt { opacity: 1; }
.fx-tube.go .tube { opacity: 0; transition: opacity .38s var(--ease); }

/* =========================================================
   doprovodné efekty v obsahu
   ========================================================= */
.auto-panel.lit .pipe li::before { animation: pipeDot .7s var(--ease) both; }
.auto-panel.lit .pipe li:nth-child(1)::before { animation-delay: 0s; }
.auto-panel.lit .pipe li:nth-child(2)::before { animation-delay: .12s; }
.auto-panel.lit .pipe li:nth-child(3)::before { animation-delay: .24s; }
.auto-panel.lit .pipe li:nth-child(4)::before { animation-delay: .36s; }
.auto-panel.lit .pipe li:nth-child(5)::before { animation-delay: .48s; }
.auto-panel.lit .pipe li:nth-child(6)::before { animation-delay: .6s; }
@keyframes pipeDot {
  0% { box-shadow: 0 0 0 0 rgba(255, 61, 46, .85); }
  100% { box-shadow: 0 0 0 4px rgba(255, 61, 46, .16); }
}
.auto-panel.lit .pipe li { animation: pipeStep .6s var(--ease) both; }
.auto-panel.lit .pipe li:nth-child(1) { animation-delay: 0s; }
.auto-panel.lit .pipe li:nth-child(2) { animation-delay: .12s; }
.auto-panel.lit .pipe li:nth-child(3) { animation-delay: .24s; }
.auto-panel.lit .pipe li:nth-child(4) { animation-delay: .36s; }
.auto-panel.lit .pipe li:nth-child(5) { animation-delay: .48s; }
.auto-panel.lit .pipe li:nth-child(6) { animation-delay: .6s; }
@keyframes pipeStep { from { opacity: .28; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.yt-grid.pop .yt-card { animation: tubeCard .55s var(--ease) var(--d, 0s) both; }
@keyframes tubeCard { from { opacity: 0; transform: translateY(18px) scale(.96); } to { opacity: 1; transform: none; } }

/* =========================================================
   KLAPKA (Práce)
   ========================================================= */
.fx-clap .fx-bg { background: rgba(6, 7, 8, .62); }
.clap-wrap { position: relative; display: flex; flex-direction: column; align-items: center; }
.clap { width: min(84vw, 420px); filter: drop-shadow(0 30px 60px rgba(0, 0, 0, .55)); }
.clap-arm {
  height: 44px; border-radius: 3px 3px 0 0;
  background: repeating-linear-gradient(112deg, var(--paper) 0 26px, #08090a 26px 52px);
  transform-origin: 4% 100%; transform: rotate(-27deg);
  transition: transform .17s cubic-bezier(.7, 0, .2, 1);
}
.fx-clap.snap .clap-arm { transform: rotate(0deg); animation: clapBounce .3s cubic-bezier(.3, 1.6, .5, 1) .17s; }
@keyframes clapBounce { 0% { transform: rotate(0deg); } 40% { transform: rotate(-5deg); } 100% { transform: rotate(0deg); } }
.clap-body {
  margin-top: -4px; padding: 16px 20px 22px; border-radius: 0 0 4px 4px;
  background: #0e0f10; box-shadow: inset 0 0 0 1px rgba(246, 242, 233, .14);
  display: grid; gap: 12px;
}
.clap-row { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--dim); }
.clap-row b, .clap-row em { font-style: normal; font-weight: 500; }
.clap-title { font-family: var(--display); font-weight: 700; text-transform: uppercase; font-size: clamp(46px, 6vw, 64px); line-height: .86; letter-spacing: .01em; }
.clap-txt { margin-top: 18px; font-family: var(--mono); font-size: 10.5px; letter-spacing: .18em; text-transform: uppercase; color: var(--mute); }

/* =========================================================
   EXPORT (Služby)
   ========================================================= */
.fx-render .fx-bg { background: rgba(6, 7, 8, .74); }
.render { position: relative; z-index: 1; width: min(86vw, 460px); }
.render-top { display: flex; justify-content: space-between; align-items: baseline; font-family: var(--mono); font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--mute); }
.render-pct { font-family: var(--display); font-size: 30px; font-weight: 700; letter-spacing: .02em; color: var(--accent); font-variant-numeric: tabular-nums; }
.render-bar { margin-top: 10px; height: 6px; border-radius: 2px; background: rgba(246, 242, 233, .14); overflow: hidden; box-shadow: inset 0 0 0 1px rgba(246, 242, 233, .08); }
.render-bar i { display: block; height: 100%; background: var(--accent); transform-origin: 0 50%; transform: scaleX(0); transition: transform .16s linear; }
.render-txt { margin-top: 16px; text-align: center; font-family: var(--mono); font-size: 10px; letter-spacing: .2em; text-transform: uppercase; color: var(--dim); }

/* naskakování obsahu po scéně */
.cases.pop .case { animation: caseIn .55s var(--ease) both; }
.cases.pop .case:nth-child(1) { animation-delay: 0s; }
.cases.pop .case:nth-child(2) { animation-delay: .09s; }
.cases.pop .case:nth-child(3) { animation-delay: .18s; }
@keyframes caseIn { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }

.svc-grid.pop .svc { animation: svcIn .5s var(--ease) both; }
.svc-grid.pop .svc:nth-child(1) { animation-delay: 0s; }
.svc-grid.pop .svc:nth-child(2) { animation-delay: .1s; }
.svc-grid.pop .svc:nth-child(3) { animation-delay: .2s; }
@keyframes svcIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }

/* na dotykových zařízeních menší robot a kratší záběry */
@media (max-width: 760px) {
  .call { padding: 20px 18px 22px; border-radius: 22px; }
  .call-name { font-size: 28px; }
  .call-ring { gap: 30px; }
  .call-btn svg { width: 26px; height: 26px; padding: 15px; }
  .call-links { flex-direction: column; }
  .robot { width: 112px; }
}

/* prepsani na YouTube: na telefonu bez celoobrazovkoveho zablesku */
@media (max-width: 760px), (hover: none) {
  .fx-tube.flash .tube-line { height: 3px; margin-top: -1.5px; }
  .fx-tube.flash .tube-txt { color: var(--paper); }
  .clap { width: min(88vw, 420px); }
  .render-pct { font-size: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  .fx-call.ringing .call, .fx-call.ringing .call-avatar::after, .r-bulb, .r-eye { animation: none !important; }
  .robot { transition: none; }
}
