html,
body {
  width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  background: linear-gradient(
    to bottom,
    #002f34 0%,
    #1f5e63 40%,
    #eaf4f5 85%,
    #ffffff 100%
  );
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ======================
   TOP BAR
====================== */

.top-bar {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px 0;
}

.top-bar::before,
.top-bar::after {
  content: "";
  flex: 1;
  height: 1px;
  background-color: white;
}

.top-logo {
  height: 50px;
  margin: 0 30px;
}

.github-fixed {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 999;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.github-icon {
  width: 28px;
  height: 28px;
  fill: white;
  transition: opacity 0.3s;
}

.github-fixed:hover .github-icon {
  opacity: 0.7;
}

/* ======================
   LAYOUT
====================== */

.main-flex {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  justify-content: flex-end;
  align-items: center;
  width: 100%;
  margin-top: 50px;
  overflow-x: hidden;
}

.phone-controls-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  flex-grow: 1;
  width: 100%;
  overflow-x: hidden;
}

.play-icon-img {
  width: 12px;
  height: 12px;
  display: block;
}

.phones-row {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 40px;
  flex-wrap: wrap;
  width: 100%;
  overflow-x: hidden;
}

.phone-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 100%;
}

/* ======================
   REBOOT / HERO
====================== */

.reboot-image {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  margin: 110px 0 30px;
}

.reboot-shine-wrapper {
  position: relative;
  width: 550px;
  max-width: 90vw;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
}

.reboot-logo {
  width: 100%;
  height: auto;
  display: block;
  opacity: 0;
  transform: scale(0.95);
  transition: opacity 2s ease, transform 2s ease;
}

.reboot-logo.fade-in {
  opacity: 1;
  transform: scale(1);
}

.reboot-shine-wrapper::after {
  content: "";
  position: absolute;
  inset: 0;
  left: -100%;
  transform: skewX(-20deg);
  pointer-events: none;
  opacity: 0;
}

.reboot-shine-wrapper.start-shine::after {
  background: linear-gradient(
    120deg,
    transparent 0%,
    rgba(0, 140, 255, 0.3) 50%,
    transparent 100%
  );
  opacity: 1;
  animation: shine-sweep 1.5s ease-in-out forwards;
}

/* ======================
   SCROLL ARROW
====================== */

.scroll-arrow {
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 60px;
  overflow: hidden;
}

.arrow-line {
  width: 4px;
  height: 40px;
  background-color: white;
  transform: translateY(-100%);
  animation: drop-line 1s ease-out 1.2s forwards;
}

.arrow-tip {
  width: 0;
  height: 0;
  border-left: 12px solid transparent;
  border-right: 12px solid transparent;
  border-top: 14px solid white;
  clip-path: inset(0 0 100% 0);
  animation: unmask-tip 0.6s ease-out 2.2s forwards;
  margin-top: -2px;
}

.start-bounce {
  animation: bounce-pair 1.4s ease-in-out infinite;
}

/* ======================
   PHONE CORE
====================== */

.phone-wrapper {
  --offscreen-x: -100vw;

  position: relative;
  width: 320px;
  aspect-ratio: 9 / 18.5;

  opacity: 0;
  transform: translateX(var(--offscreen-x));
  transition: transform 2.5s ease, opacity 2.5s ease;

  max-width: 100%;
}

.phone-wrapper.animate-in {
  transform: translateX(0) rotateY(360deg);
  opacity: 1;
}

.phone-wrapper.animate-out {
  transform: translateX(var(--offscreen-x));
  opacity: 0;
  transition: transform 1s ease, opacity 1s ease;
}

.phone-left {
  --offscreen-x: -100vw;
}

.phone-right {
  --offscreen-x: 100vw;
}

/* ======================
   VIDEO & OVERLAY
====================== */

.video-behind {
  position: absolute;
  top: -1.3%;
  left: 4%;
  width: 92%;
  height: 95.7%;
  border-radius: 70px;
  overflow: hidden;
  z-index: 1;
}

.video-behind video {
  width: 100%;
  height: 100%;
  border-radius: 68px 68px 75px 75px;
  transform: translateY(0.3%);
}

.phone-overlay {
  position: relative;
  width: 100%;
  height: 93.3%;
  z-index: 2;
  pointer-events: none;
  display: block;
}

/* ======================
   CONTROLS
====================== */

.controls {
  border-radius: 14px;
  padding: 0 14px;
  width: 90%;
  max-width: 320px;

  display: flex;
  flex-direction: column;
  gap: 10px;

  margin-top: -44px;
  margin-bottom: 30px;

  opacity: 0;
  transform: translateY(-30px);
  transition: transform 0.8s ease, opacity 0.8s ease;
  pointer-events: none;
}

.controls.controls-in {
  opacity: 1;
  transform: translateY(20px);
  pointer-events: auto;
}

.controls.controls-out {
  opacity: 0;
  transform: translateY(-30px);
  pointer-events: none;
}

.controls input[type="range"] {
  width: 100%;
  appearance: none;
  height: 6px;
  background: #ccc;
  border-radius: 3px;
  outline: none;
  cursor: pointer;
}

.controls input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 14px;
  height: 14px;
  background: #002f34;
  border-radius: 50%;
  cursor: pointer;
}

.button-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.button-row input[type="range"] {
  flex: 1 1 auto;
}

/* FIX: button blijft exact dezelfde maat bij text/img */
.controls button {
  background: none;
  border: none;
  color: #000;
  cursor: pointer;
  transition: color 0.25s ease;

  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;

  line-height: 1;
  padding: 0;
  font-size: 22px;
}

.controls button.is-playing {
  color: #1f5e63;
}

#remainingLeft,
#remainingRight {
  color: #000;
  font-size: 14px;
  min-width: 48px;
  text-align: right;
  flex-shrink: 0;
}

/* ======================
   MOBILE
====================== */

@media (max-width: 600px) {
  html,
  body {
    overflow-x: hidden;
  }

  .top-logo {
    height: 40px;
    margin: 0 15px;
  }

  .main-flex {
    margin-top: 26px;
  }

  .reboot-image {
    margin: 70px 0 18px;
  }

  .reboot-shine-wrapper {
    width: 78%;
  }

  .phones-row {
    gap: 18px;
    padding: 0 10px;
  }

  .phone-wrapper {
    width: clamp(210px, 62vw, 250px);
  }

  .video-behind {
    border-radius: 60px;
  }

  .video-behind video {
    border-radius: 58px 58px 64px 64px;
  }

  .controls {
    max-width: clamp(210px, 62vw, 250px);
    width: 100%;
    padding: 0 10px;
    gap: 8px;

    margin-top: -46px;
    margin-bottom: 16px;

    transform: translateY(-18px);
  }

  .controls.controls-in {
    transform: translateY(8px);
  }

  .controls button {
    width: 34px;
    height: 34px;
    font-size: 20px;
  }

  #remainingLeft,
  #remainingRight {
    font-size: 12px;
  }

  .button-row {
    gap: 6px;
  }

  #remainingLeft,
  #remainingRight {
    min-width: 36px;
  }

  .play-icon-img {
    width: 16px;
    height: 16px;
  }
}

/* ======================
   ANIMATIONS
====================== */

@keyframes shine-sweep {
  0% {
    left: -100%;
    opacity: 1;
  }
  100% {
    left: 100%;
    opacity: 0;
  }
}

@keyframes drop-line {
  to {
    transform: translateY(0);
  }
}

@keyframes unmask-tip {
  from {
    clip-path: inset(0 0 100% 0);
  }
  to {
    clip-path: inset(0 0 0 0);
  }
}

@keyframes bounce-pair {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(10px);
  }
}
