/* =====================================================
   SMS Product Page — styles.css v4
   ===================================================== */

:root {
  --bg: #060d1a;
  --fg: #e8f0fc;
  --muted: #7a8fa8;
  --accent: #38bdf8;
  --phone-w: 290px;
  --phone-h: 580px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--fg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ── Header ─────────────────────────────────────────── */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 500;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 40px;
  background: linear-gradient(180deg, rgba(6,13,26,0.8) 0%, transparent 100%);
  backdrop-filter: blur(8px);
}

.brand {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff;
}

.site-header nav { display: flex; gap: 32px; }
.site-header nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s;
}
.site-header nav a:hover { color: #fff; }

/* ── Phone anchor (fixed center baseline) ──────────── */
.phone-anchor {
  position: fixed;
  top: 50vh;
  left: 50vw;
  z-index: 200;
  pointer-events: none;
  /* JS overrides transform of .phone child */
}

/* ── Phone mockup ───────────────────────────────────── */
.phone {
  width: var(--phone-w);
  height: var(--phone-h);
  border-radius: 46px;
  background: linear-gradient(160deg, #1a2235 0%, #0b1020 100%);
  border: 1.5px solid rgba(255,255,255,0.08);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 0;
  box-shadow:
    0 80px 160px rgba(0,0,0,0.7),
    0 24px 48px rgba(0,0,0,0.45),
    inset 0 1px 0 rgba(255,255,255,0.06);
  will-change: transform;
  /* Base position: centered on the anchor point */
  transform: translate(-50%, -50%);
  transition: box-shadow 0.4s ease;
}

.phone-notch {
  flex-shrink: 0;
  width: 88px;
  height: 7px;
  border-radius: 6px;
  background: rgba(255,255,255,0.05);
  margin: 0 auto 10px;
}

.phone-screen {
  flex: 1;
  border-radius: 32px;
  overflow: hidden;
  background: #f0f4ff;
  position: relative;
}

/* Individual slides — stacked, opacity driven purely by JS rAF */
.slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  /* No CSS transition — JS sets opacity directly each frame */
}

.slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  display: block;
}

.slide.active { opacity: 1; }

.phone-home {
  flex-shrink: 0;
  width: 76px;
  height: 5px;
  border-radius: 4px;
  background: rgba(255,255,255,0.08);
  margin: 10px auto 0;
}

/* ── Scenes ─────────────────────────────────────────── */
.scene {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  padding: 80px 40px;
}

/* ── Scene text blocks ──────────────────────────────── */
.scene-text {
  max-width: 440px;
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease, transform 0.8s cubic-bezier(0.2, 0.9, 0.3, 1);
}

.scene-text.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Centered hero / outro */
.scene-text.centered {
  max-width: 640px;
  text-align: center;
  margin: 0 auto;
}

/* Text on LEFT side (phone is on right) */
.scene-text.left {
  margin-right: auto;
  margin-left: 5vw;
}

/* Text on RIGHT side (phone is on left) */
.scene-text.right {
  margin-left: auto;
  margin-right: 5vw;
}

/* ── Typography ─────────────────────────────────────── */
.eyebrow {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
}

h1 {
  font-size: clamp(2.4rem, 5vw, 4rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: #fff;
  margin-bottom: 20px;
}

h2 {
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  color: #fff;
  margin-bottom: 16px;
}

.lead {
  font-size: 1.1rem;
  color: var(--muted);
  line-height: 1.65;
  margin-bottom: 24px;
}

.scene-text p {
  font-size: 1rem;
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 20px;
}

.scene-text ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.scene-text ul li {
  padding-left: 20px;
  position: relative;
  font-size: 0.95rem;
  color: var(--muted);
}

.scene-text ul li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--accent);
}

/* ── Role chips ─────────────────────────────────────── */
.role-chip {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 18px;
}

.chip-admin    { background: rgba(59,130,246,0.15); color: #60a5fa; border: 1px solid rgba(59,130,246,0.3); }
.chip-teacher  { background: rgba(245,158,11,0.15); color: #fbbf24; border: 1px solid rgba(245,158,11,0.3); }
.chip-guardian { background: rgba(16,185,129,0.15); color: #34d399; border: 1px solid rgba(16,185,129,0.3); }
.chip-student  { background: rgba(168,85,247,0.15); color: #c084fc; border: 1px solid rgba(168,85,247,0.3); }

/* ── Scroll cue ─────────────────────────────────────── */
.scroll-cue {
  margin-top: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.8rem;
}

.scroll-cue svg {
  width: 20px;
  height: 20px;
  animation: bounce 1.8s ease-in-out infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); opacity: 0.5; }
  50% { transform: translateY(5px); opacity: 1; }
}

/* ── CTA ────────────────────────────────────────────── */
.cta {
  display: inline-block;
  margin-top: 28px;
  padding: 14px 36px;
  border-radius: 100px;
  background: var(--accent);
  color: #060d1a;
  font-weight: 700;
  text-decoration: none;
  font-size: 1rem;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 0 40px rgba(56,189,248,0.35);
}

.cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 60px rgba(56,189,248,0.5);
}

/* ── Outro ──────────────────────────────────────────── */
.scene-outro {
  background: linear-gradient(180deg, transparent, rgba(56,189,248,0.04) 50%, transparent);
  justify-content: center;
}

/* ── Responsive / Mobile ─────────────────────────────── */
@media (max-width: 860px) {
  /* Hide the desktop fixed phone on mobile */
  .phone-anchor { display: none; }

  .scene {
    flex-direction: column;
    align-items: center;
    padding: 80px 24px 60px;
    gap: 40px;
  }

  .scene-text.left,
  .scene-text.right {
    max-width: 100%;
    margin: 0;
    text-align: center;
    order: 2;
  }

  .scene-text ul { display: inline-flex; flex-direction: column; text-align: left; }

  /* Hero: large centred text, no phone */
  .scene[data-scene="0"] {
    min-height: 90vh;
    justify-content: center;
    padding-top: 100px;
  }
  .scene[data-scene="0"] .scene-text {
    max-width: 100%;
    text-align: center;
    margin: 0;
  }

  /* Outro: full-height centered */
  .scene-outro {
    height: 100vh;
    min-height: unset;
    justify-content: center;
    padding: 0 24px;
  }
  .scene-outro .scene-text { text-align: center; max-width: 100%; }

  /* ── Mobile phone mockup injected per scene ─────────── */
  .mobile-phone {
    order: 1;
    width: 200px;
    height: 400px;
    border-radius: 38px;
    background: linear-gradient(160deg, #1a2235 0%, #0b1020 100%);
    border: 1.5px solid rgba(255,255,255,0.08);
    padding: 11px;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    box-shadow: 0 40px 80px rgba(0,0,0,0.6), 0 16px 32px rgba(0,0,0,0.4);
    /* enters from below, tilted */
    opacity: 0;
    transform: translateY(50px) rotateZ(var(--tilt, 6deg)) scale(0.9);
    transition: opacity 0.7s ease, transform 0.9s cubic-bezier(0.2, 0.9, 0.3, 1);
  }

  .mobile-phone.in-view {
    opacity: 1;
    transform: translateY(0) rotateZ(var(--tilt, 6deg)) scale(1);
    animation: mobile-float 4s ease-in-out 0.9s infinite;
  }

  @keyframes mobile-float {
    0%, 100% { transform: translateY(0)    rotateZ(var(--tilt, 6deg)) scale(1); }
    50%       { transform: translateY(-8px) rotateZ(var(--tilt, 6deg)) scale(1.01); }
  }

  .mobile-phone-notch {
    flex-shrink: 0;
    width: 64px; height: 6px;
    border-radius: 5px;
    background: rgba(255,255,255,0.05);
    margin: 0 auto 8px;
  }

  .mobile-phone-screen {
    flex: 1;
    border-radius: 24px;
    overflow: hidden;
    background: #f0f4ff;
  }

  .mobile-phone-screen img {
    width: 100%; height: 100%;
    object-fit: cover;
    object-position: top;
    display: block;
  }

  .mobile-phone-home {
    flex-shrink: 0;
    width: 56px; height: 4px;
    border-radius: 3px;
    background: rgba(255,255,255,0.08);
    margin: 8px auto 0;
  }
}

/* ── Subtle background noise / depth ────────────────── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% -10%, rgba(56,189,248,0.08) 0%, transparent 60%),
    radial-gradient(ellipse 50% 40% at 80% 110%, rgba(99,102,241,0.06) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}
