@property --ty { syntax: '<length-percentage>'; inherits: false; initial-value: 0px; }
@property --tx { syntax: '<length-percentage>'; inherits: false; initial-value: 0px; }
:root {
  --ampY: 20px;           /* amplituda pionowa */
  --ampX: 4px;           /* amplituda pozioma */
  --durY: 3s;             /* czas pionowy */
  --durX: 15s;             /* czas poziomy */
  --easing: ease-in-out;  /* sposób poruszania */
  --direction: normal;    /* normal = start w dół, reverse = start w górę */
}
body{
  background-color: #000000;
  margin: 0;
  color: #ffffff;
}

h2{
  font-size: 2.5rem;
}
img{
  position: absolute;
}

button{
  padding: .8rem 1.5rem;
  border-radius: 3rem;
  border: #212121 solid 2px;
  background-color: #212121;
  color: #ffffff;
  position: absolute;
  z-index: 100;
  display: flex;
  align-items: center;
}
button:hover{
  border-color: #ffffff;
  background-color: #21212100;
  color: #ffffff;
  position: absolute;
  z-index: 100;
  cursor: pointer;
}

section{
  height: 100vh;
  position: relative;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  background-image: url(assets/bg.png);
  background-position: center center;
}

.desktop{
display: block;
}

.typewriter{
text-transform: uppercase;
text-align: center;
z-index: 100;
}

.updown {
  display: inline-block;
  transform-origin: center;
  /* łączymy oba kierunki przez translate(X,Y) sterowane zmiennymi */
  transform: translate(var(--tx, 0), var(--ty, 0));
  will-change: transform;

  /* Dwie animacje równolegle: pion + „chaotyczny” poziom */
  animation-name: bobY, driftX;
  animation-duration: var(--durY), var(--durX);
  animation-timing-function: var(--easing), linear;
  animation-iteration-count: infinite, infinite;
  animation-direction: var(--direction), alternate; /* reverse działa na pion */
}

/* Pion: tak ustawione klatki, by reverse faktycznie startował w górę */
@keyframes bobY {
  0%   { --ty: 0px; }
  25%  { --ty: var(--ampY); }              /* w dół */
  50%  { --ty: 0px; }
  75%  { --ty: calc(var(--ampY) * -1); }   /* w górę */
  100% { --ty: 0px; }
}

/* Poziom: lekko „chaotyczny” dryf (bez opóźnień) */
@keyframes driftX {
  0%   { --tx: 0px; }
  15%  { --tx: calc(var(--ampX) * 0.7); }
  30%  { --tx: calc(var(--ampX) * -1); }
  55%  { --tx: calc(var(--ampX) * 0.5); }
  75%  { --tx: calc(var(--ampX) * -0.4); }
  100% { --tx: 0px; }
}

@media (prefers-reduced-motion: reduce) {
  .updown { animation: none; transform: none; }
}
@media only screen and (max-width: 767px) {
.desktop{
display: none;
}
}