/* Apps carousel - golinski-ventures.pl/apps/ */

:root {
  --stage-bg: #6C5CE0;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --dur: 650ms;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: #0b0b10;
}

body {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #fff;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

.stage {
  position: relative;
  width: 100%;
  height: 100svh;
  min-height: 560px;
  overflow: hidden;
  background-color: var(--stage-bg);
  transition: background-color var(--dur) var(--ease);
}

/* 1. grain */
.grain {
  position: absolute;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  opacity: 0.4;
  background-size: 200px 200px;
  background-repeat: repeat;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='0.08'/%3E%3C/svg%3E");
}

/* 2. ghost word */
.ghost {
  position: absolute;
  inset-inline: 0;
  top: 13%;
  z-index: 2;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  user-select: none;
  font-family: Anton, Impact, "Haettenschweiler", sans-serif;
  font-size: clamp(90px, 28vw, 380px);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  white-space: nowrap;
  color: #fff;
  transition: opacity 260ms var(--ease);
}

.ghost span {
  display: block;
  transform-origin: center;
}

/* 3. brand */
.brand {
  position: absolute;
  top: 1.5rem;
  left: 1rem;
  z-index: 60;
  display: block;
  opacity: 0.9;
  transition: opacity 200ms var(--ease);
}

.brand img {
  display: block;
  width: 148px;
  height: auto;
}

.brand:hover,
.brand:focus-visible { opacity: 1; }

/* 4. carousel */
.carousel {
  position: absolute;
  inset: 0;
  z-index: 3;
}

.figure {
  position: absolute;
  aspect-ratio: 584 / 1241;
  transform: translateX(-50%);
  transform-origin: bottom center;
  will-change: transform, filter, opacity, left, bottom, height;
  transition:
    transform var(--dur) var(--ease),
    filter var(--dur) var(--ease),
    opacity var(--dur) var(--ease),
    left var(--dur) var(--ease),
    bottom var(--dur) var(--ease),
    height var(--dur) var(--ease);
}

.figure a {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 6%;
  transition: transform 200ms var(--ease);
}

/* tylko aktywny telefon "podnosi sie" - to on prowadzi do landingu.
   Nieaktywne dostaja delikatne rozjasnienie, bo tylko wysuwaja sie na srodek. */
.figure[data-role="center"] a:hover { transform: translateY(-6px); }
.figure:not([data-role="center"]) a:hover { transform: scale(1.06); }

.figure a:focus-visible {
  outline: 3px solid rgba(255, 255, 255, 0.9);
  outline-offset: 8px;
}

.figure img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: bottom center;
  filter: drop-shadow(0 24px 48px rgba(0, 0, 0, 0.28));
}

/* base geometry - roles, depth; sizes are set per breakpoint below */
.figure[data-role="center"]    { left: 50%; bottom: -2%; height: 78%; z-index: 20; opacity: 1;    filter: none; }
.figure[data-role="left"]      { left: 31%; bottom:  9%; height: 30%; z-index: 10; opacity: 0.85; filter: blur(2px); }
.figure[data-role="right"]     { left: 69%; bottom:  9%; height: 30%; z-index: 10; opacity: 0.85; filter: blur(2px); }
.figure[data-role="far-left"]  { left: 14%; bottom: 30%; height: 17%; z-index: 5;  opacity: 0.78; filter: blur(4px); }
.figure[data-role="far-right"] { left: 86%; bottom: 30%; height: 17%; z-index: 5;  opacity: 0.78; filter: blur(4px); }
.figure[data-role="back"]      { left: 50%; bottom: 12%; height: 20%; z-index: 4;  opacity: 1;    filter: blur(4px); }

/* 5. copy + nav */
.panel {
  position: absolute;
  bottom: 1.5rem;
  left: 1rem;
  z-index: 60;
  max-width: 300px;
}

.panel-head {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  margin-bottom: 0.5rem;
}

.panel-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  transition: opacity 260ms var(--ease);
}

.app-name {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  opacity: 0.95;
  transition: opacity 260ms var(--ease);
}

.app-desc {
  display: none;
  margin: 0 0 1rem;
  font-size: 0.8125rem;
  line-height: 1.6;
  opacity: 0.85;
  transition: opacity 260ms var(--ease);
}

.nav {
  display: flex;
  gap: 0.75rem;
}

.nav button {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  padding: 0;
  border: 2px solid #fff;
  border-radius: 999px;
  background: transparent;
  color: #fff;
  cursor: pointer;
  transition: transform 150ms var(--ease), background-color 150ms var(--ease);
}

.nav button:hover { transform: scale(1.08); background-color: rgba(255, 255, 255, 0.12); }
.nav button:active { transform: scale(0.98); }
.nav button:focus-visible { outline: 3px solid rgba(255, 255, 255, 0.55); outline-offset: 3px; }

/* 6. cta */
.cta {
  position: absolute;
  bottom: 1.5rem;
  right: 1rem;
  z-index: 60;
}

.cta a,
.cta span {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-family: Anton, Impact, sans-serif;
  font-size: clamp(20px, 4vw, 56px);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  opacity: 0.95;
  transition: opacity 200ms var(--ease);
}

.cta a:hover,
.cta a:focus-visible { opacity: 1; }
.cta span { opacity: 0.55; }
.cta svg { width: 1.25rem; height: 1.25rem; }

.is-swapping .app-name,
.is-swapping .app-desc,
.is-swapping .panel-icon,
.is-swapping .ghost,
.is-swapping .cta a,
.is-swapping .cta span { opacity: 0; }

/* screen-reader only */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

@media (min-width: 640px) {
  .ghost { top: 15%; }
  .brand { left: 2rem; }
  .brand img { width: 190px; }

  .panel { left: 2rem; }
  .panel-icon { width: 44px; height: 44px; border-radius: 11px; }
  .app-name { font-size: 1.375rem; }
  .app-desc { display: block; }
  .nav button { width: 4rem; height: 4rem; }

  .cta { right: 2rem; }
  .cta svg { width: 2rem; height: 2rem; }
}

/* full-width layout: figures stand on the floor, copy sits beside them */
@media (min-width: 1280px) {
  .panel { bottom: 5rem; left: 6rem; }
  .cta { bottom: 5rem; right: 2.5rem; }

  .figure[data-role="center"]    { left: 50%; bottom: -3%; height: 84%; }
  .figure[data-role="left"]      { left: 33%; bottom:  9%; height: 30%; }
  .figure[data-role="right"]     { left: 67%; bottom:  9%; height: 30%; }
  .figure[data-role="far-left"]  { left: 14%; bottom: 30%; height: 17%; }
  .figure[data-role="far-right"] { left: 86%; bottom: 30%; height: 17%; }
  .figure[data-role="back"]      { left: 50%; bottom: 12%; height: 20%; }
}

/* narrow layout: copy sits under the figures, not beside them */
@media (max-width: 1279px) {
  .figure[data-role="center"]    { left: 50%; height: 54%; bottom: 23%; }
  .figure[data-role="left"]      { left: 24%; height: 17%; bottom: 34%; }
  .figure[data-role="right"]     { left: 76%; height: 17%; bottom: 34%; }
  .figure[data-role="far-left"]  { left: 12%; height: 12%; bottom: 42%; opacity: 0.72; }
  .figure[data-role="far-right"] { left: 88%; height: 12%; bottom: 42%; opacity: 0.72; }
  .figure[data-role="back"]      { left: 50%; height: 12%; bottom: 30%; }
}

@media (min-width: 640px) and (max-width: 1279px) {
  .figure[data-role="center"]    { height: 60%; bottom: 22%; }
  .figure[data-role="left"]      { left: 22%; height: 20%; bottom: 33%; }
  .figure[data-role="right"]     { left: 78%; height: 20%; bottom: 33%; }
  .figure[data-role="far-left"]  { left: 8%;  height: 14%; bottom: 41%; }
  .figure[data-role="far-right"] { left: 92%; height: 14%; bottom: 41%; }
  .figure[data-role="back"]      { left: 50%; height: 14%; bottom: 30%; }
}

@media (prefers-reduced-motion: reduce) {
  :root { --dur: 1ms; }
  .stage, .figure, .ghost, .app-name, .app-desc, .panel-icon, .cta a, .cta span {
    transition-duration: 1ms;
  }
}
