/* Variables del “iPhone” */
:root {
  --iphone-width: 300px;
  --iphone-height: 600px;
  --screen-border: 12px;
}

/* Reset básico */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  font-family: 'Inter', sans-serif;
  color: #fff;
  background: #03010a;
}

/* Contenedor de scroll largo */
#scrolly-container {
  height: 450vh;
  position: relative;
  background: radial-gradient(circle at 50% 0%, #53486e 0%, #955caf 45%, #05010a 90%);
  background-size: 120% 160%;
  background-position: 50% 0%;
}

/* Escenario pegajoso */
#sticky-stage {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  z-index: 5;
}

/* iPhone 3D */
.iphone-container {
  width: var(--iphone-width);
  height: var(--iphone-height);
  position: relative;
  transform-style: preserve-3d;
  transform: rotateX(0deg) rotateY(0deg);
  transition: transform 0.1s linear;
  z-index: 10;
  pointer-events: auto;
}

.iphone-body {
  width: 100%;
  height: 100%;
  background: #1c1c1e;
  border-radius: 45px;
  position: relative;
  box-shadow:
    0 0 0 2px #333,
    0 0 0 6px #121212,
    0 20px 50px rgba(0, 0, 0, 0.6);
  padding: var(--screen-border);
  overflow: hidden;
  transform-style: preserve-3d;
}

.iphone-screen {
  width: 100%;
  height: 100%;
  background: #000;
  border-radius: 32px;
  position: relative;
  overflow: hidden;
}

/* Pantallas internas */
.screen-content {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 0.6s ease-in-out, transform 0.6s ease;
  transform: scale(1.05);
}

.screen-content.active {
  opacity: 1;
  transform: scale(1);
}

/* Dynamic Island */
.dynamic-island {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 25px;
  background: #000;
  border-radius: 20px;
  z-index: 20;
}

/* Botones laterales simulados */
.iphone-body::before {
  content: '';
  position: absolute;
  left: -8px;
  top: 100px;
  width: 4px;
  height: 30px;
  background: #333;
  border-radius: 2px 0 0 2px;
}

.iphone-body::after {
  content: '';
  position: absolute;
  right: -8px;
  top: 120px;
  width: 4px;
  height: 60px;
  background: #333;
  border-radius: 0 2px 2px 0;
}

/* ===== TEXT OVERLAY ===== */
.text-overlay {
  position: absolute;
  top: 50%;
  width: 320px;
  padding: 1.8rem;
  background: rgba(12, 8, 24, 0.7);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;

  opacity: 0;
  transform: translateY(-50%) translateX(40px);
  transition: opacity 0.5s ease, transform 0.5s ease;

  /* clave: por defecto NO captura clicks */
  pointer-events: none;

  /* por encima del iPhone */
  z-index: 20;
}

.text-overlay.visible {
  opacity: 1;
  transform: translateY(-50%) translateX(0);

  /* cuando aparece, SÍ captura clicks */
  pointer-events: auto;
}

.text-overlay h2 {
  margin-bottom: 0.5rem;
  font-size: 1.6rem;
  letter-spacing: 0.03em;
  background: linear-gradient(to right, #ffffff, #d0c3ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.text-overlay p {
  font-size: 0.95rem;
  line-height: 1.6;
  color: #e4ddff;
}

/* Posiciones izquierda / derecha */
.text-left { left: 8%; }
.text-right {
  right: 8%;
  transform: translateY(-50%) translateX(-40px);
}
.text-right.visible { transform: translateY(-50%) translateX(0); }

/* ===== BOTONES (BASE + VARIANTES) ===== */
.btn-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;

  padding: 12px 16px;
  border-radius: 16px;

  text-decoration: none;
  font-weight: 600;
  letter-spacing: .02em;

  color: #ffffff;
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.22);

  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);

  box-shadow: rgba(0, 0, 0, 0.45) 0px 12px 26px;
  transform: translateY(0);
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease;
}

.btn-link:hover {
  transform: translateY(-2px);
  box-shadow: rgba(0, 0, 0, 0.55) 0px 16px 34px;
}

.btn-link:active {
  transform: translateY(0px);
  box-shadow: rgba(0, 0, 0, 0.40) 0px 10px 22px;
}

.btn-link:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 3px rgba(208,195,255,0.28),
    rgba(0,0,0,0.55) 0px 16px 34px;
}

/* PRIMARY (blue neon) */
.btn-link.btn-primary{
  background: linear-gradient(135deg,
    rgba(40, 120, 255, 0.28),
    rgba(0, 210, 255, 0.22)
  );
  border-color: rgba(120, 200, 255, 0.45);
  box-shadow:
    0 10px 30px rgba(0, 140, 255, 0.35),
    inset 0 0 18px rgba(120, 220, 255, 0.25);
}

.btn-link.btn-primary:hover{
  background: linear-gradient(135deg,
    rgba(60, 160, 255, 0.38),
    rgba(40, 220, 255, 0.32)
  );
  border-color: rgba(160, 220, 255, 0.75);
  box-shadow:
    0 14px 36px rgba(0, 160, 255, 0.55),
    inset 0 0 22px rgba(160, 240, 255, 0.35);
}

/* GHOST (glass discreto) */
.btn-link.btn-ghost{
  background: rgba(0,0,0,0.14);
  border-color: rgba(255,255,255,0.18);
}

.btn-link.btn-ghost:hover{
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.26);
}

.text-overlay a { cursor: pointer; }

/* ===== FINAL SECTION (si la usas) ===== */
.final-section {
  height: 100vh;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.final-content {
  max-width: 640px;
  text-align: center;
}

.final-content h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
  letter-spacing: 0.06em;
}

.final-content p {
  color: #a0a0a0;
  margin-bottom: 2rem;
  line-height: 1.6;
}

/* ===== MOBILE FIRST / RESPONSIVE ===== */
@media (max-width: 900px) {
  :root {
    --iphone-width: 230px;
    --iphone-height: 480px;
  }

  .text-overlay {
    position: fixed;
    bottom: 5%;
    top: auto;
    left: 50%;
    width: min(90%, 420px);
    transform: translate(-50%, 20px);
    text-align: center;
  }

  .text-left,
  .text-right {
    left: 50%;
    right: auto;
    transform: translate(-50%, 20px);
  }

  .text-overlay.visible {
    transform: translate(-50%, 0);
  }

  /* Botón grande para móvil (aplica a ambos: primary y ghost) */
  .btn-link {
    width: auto;                 /* deja de forzar ancho completo */
    max-width: 180px;            /* límite visual elegante */
    padding: 14px 22px;          /* menos alto y ancho */
    font-size: 1rem;
    border-radius: 18px;

    display: inline-flex;        /* tamaño natural */
    justify-content: center;
    align-items: center;
}

  /* Si quieres más “impacto” del primary SOLO en móvil */
  .btn-link.btn-primary{
    background: linear-gradient(135deg,
      rgba(60, 170, 255, 0.45),
      rgba(40, 235, 255, 0.38)
    );
    box-shadow:
      0 16px 42px rgba(0, 180, 255, 0.65),
      inset 0 0 26px rgba(160, 240, 255, 0.45);
  }
}
