/* ===== Reset ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  /* prevent text selection / copy on tap-hold */
  -webkit-user-select: none;
  user-select: none;
  /* prevent iOS long-press copy/callout menu */
  -webkit-touch-callout: none;
}

:root {
  --page-max: 480px;
  --title-size: clamp(1.9rem, 8vw, 2.6rem);
  --subtitle-size: clamp(0.95rem, 4vw, 1.15rem);
  --pad-x: clamp(20px, 6vw, 40px);
}

html, body { height: 100%; }

html {
  /* one continuous gradient across the WHOLE screen, including safe areas */
  background: linear-gradient(160deg, #f7f9ff 0%, #eef1fb 45%, #eae6f9 100%);
  background-attachment: fixed;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: transparent;          /* let the html gradient show through */
  color: #1c2340;
  height: 100dvh;
  overflow: hidden;                 /* no page scroll for an intro screen */
  overscroll-behavior: none;        /* stop rubber-band bounce in WebView */
  display: flex;
  justify-content: center;
}

/* ===== Layout: column that distributes space, no overlap ===== */
.intro {
  width: 100%;
  max-width: var(--page-max);
  height: 100%;                 /* fill the flex parent (viewport) exactly */
  /* safe-area insets live here so the gradient stays edge-to-edge behind them */
  padding:
    calc(clamp(20px, 4vh, 40px) + env(safe-area-inset-top))
    var(--pad-x)
    calc(clamp(24px, 4vh, 40px) + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: clamp(10px, 1.6vh, 16px);
  overflow: hidden;
}

/* ===== Wi-Fi icon ===== */
.wifi-icon {
  width: clamp(52px, 15vw, 72px);
  aspect-ratio: 1;
  flex-shrink: 0;
}
.wifi-icon svg { width: 100%; height: 100%; }

/* ===== Text ===== */
.title {
  font-size: var(--title-size);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.5px;
  color: #141a33;
  flex-shrink: 0;
}
.subtitle {
  font-size: var(--subtitle-size);
  color: #6b7185;
  line-height: 1.5;
  max-width: 34ch;
  flex-shrink: 0;
}

/* Tighten spacing between icon and heading */
.wifi-icon { margin-bottom: -6px; }
.title { margin-top: 2px; }
.subtitle { margin-top: -6px; }

/* ===== Illustration: absorbs available vertical space ===== */
.illustration {
  position: relative;
  width: 100%;
  max-width: 380px;
  flex: 1 1 auto;      /* take all leftover height between text and button */
  min-height: 0;       /* allow it to shrink so nothing overflows */
  display: flex;
  align-items: center;
  justify-content: center;
}

/* The image window */
.map-frame {
  width: 100%;
  height: 100%;
  min-height: 0;
  border-radius: 22px;
  overflow: hidden;
  /* soft entrance on load (handles opacity + rise) */
  animation: fadeInUp 0.8s ease-out both;
}
.map-svg {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  /* continuous gentle floating (handles transform) */
  animation: float 4s ease-in-out infinite;
}

/* Wi-Fi pins: gentle staggered bob */
.pin { transform-box: fill-box; transform-origin: center bottom; }
.pin-1 { animation: pinBob 3s ease-in-out infinite; }
.pin-2 { animation: pinBob 3s ease-in-out infinite 0.6s; }
.pin-3 { animation: pinBob 3s ease-in-out infinite 1.2s; }

/* Radiating pulse under each pin */
.pin-pulse { transform-box: fill-box; transform-origin: center; }
.pin-1 .pin-pulse { animation: pulse 2.4s ease-out infinite; }
.pin-2 .pin-pulse { animation: pulse 2.4s ease-out infinite 0.8s; }
.pin-3 .pin-pulse { animation: pulse 2.4s ease-out infinite 1.6s; }

@keyframes pinBob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}
@keyframes pulse {
  0%   { transform: scale(0.6); opacity: 0.55; }
  70%  { transform: scale(2.4); opacity: 0; }
  100% { transform: scale(2.4); opacity: 0; }
}

/* Continuous floating motion */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-12px); }
}

/* Soft entrance on load */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Respect users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  .map-svg, .map-frame, .pin, .pin-pulse { animation: none; }
}

/* ===== CTA button ===== */
.get-started {
  width: 100%;
  max-width: 360px;
  flex-shrink: 0;
  padding: clamp(16px, 2.4vh, 20px);
  font-size: clamp(1.05rem, 4.6vw, 1.25rem);
  font-weight: 600;
  color: #1c2340;
  background: #ffffff;
  border: none;
  border-radius: 40px;
  touch-action: manipulation;   /* remove double-tap-to-zoom + 300ms delay */
  box-shadow: 0 12px 34px rgba(90, 110, 190, 0.28);
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.15s ease, background 0.12s ease, color 0.12s ease;
}
.get-started:hover { transform: translateY(-2px); box-shadow: 0 16px 40px rgba(90, 110, 190, 0.34); }

/* Pressed state: change color so the tap is clearly registered */
.get-started:active,
.get-started.pressed {
  transform: translateY(1px) scale(0.98);
  background: #4a5aa8;                 /* fills with brand blue/purple */
  color: #ffffff;                      /* text turns white for contrast */
  box-shadow: 0 6px 18px rgba(74, 90, 168, 0.4);
}

/* ===== iPad / large screens: centered phone-width card ===== */
@media (min-width: 768px) {
  html {
    background: linear-gradient(160deg, #eef1fb 0%, #e7e9f7 100%);
  }
  body { align-items: center; }
  .intro {
    height: min(92dvh, 900px);
    border-radius: 44px;
    background: linear-gradient(160deg, #f7f9ff 0%, #eef1fb 45%, #eae6f9 100%);
    box-shadow: 0 30px 80px rgba(60, 80, 150, 0.18);
  }
  .illustration { max-width: 340px; }
}

/* ===== Short screens (iPhone 8) ===== */
@media (max-height: 700px) {
  .title { font-size: clamp(1.7rem, 7.5vw, 2.2rem); }
  .intro { gap: clamp(6px, 1.2vh, 12px); }
}
