/* ============================================================
   Envoi Tech – Home page (index.html only)
   Builds on styles.css, which the privacy, terms and data-deletion
   pages share; nothing here affects them.
   ============================================================ */

body { overflow-x: hidden; }

/* ── NAV LINKS ── */
.nav-links { display: flex; gap: 1.75rem; }
.nav-links a {
  color: var(--gray-600);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  transition: color 0.15s;
}
.nav-links a:hover { color: var(--green); }
@media (max-width: 720px) { .nav-links { display: none; } }

/* ── BUTTON ARROW (the Envoi "send" motif) ── */
.btn-arrow {
  width: 18px; height: 18px;
  fill: none; stroke: currentColor; stroke-width: 2.5;
  stroke-linecap: round; stroke-linejoin: round;
  transition: transform 0.25s cubic-bezier(.2,.8,.2,1);
}
.btn-primary:hover .btn-arrow { transform: translateX(4px); }

/* ── HERO ── */
.home-hero {
  position: relative;
  overflow: hidden;
  text-align: left;
  padding: 5rem 1.5rem 4.5rem;
}
.home-hero::before {
  /* soft light behind the phones */
  content: "";
  position: absolute;
  width: 640px; height: 640px;
  right: -120px; top: -80px;
  background: radial-gradient(circle, rgba(82,183,136,0.35) 0%, rgba(82,183,136,0) 65%);
  pointer-events: none;
}
.hero-grid {
  position: relative;
  max-width: 1080px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 3rem;
  align-items: center;
}
.home-hero h1 { margin: 0 0 1.25rem; max-width: 560px; }
.home-hero p { margin: 0 0 2rem; max-width: 500px; }
.home-hero .hero-buttons { justify-content: flex-start; }
.platforms {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.75rem;
}
.platforms li {
  font-size: 0.8rem;
  font-weight: 600;
  color: rgba(255,255,255,0.8);
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: 100px;
  padding: 0.25rem 0.75rem;
}

.hero-devices {
  position: relative;
  height: 560px;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* ── DEVICE FRAMES ──
   Real device frames (images/iphone-17-pro-frame.png and
   images/ipad-pro-13-frame.png, from "Device Mockups/make_mockups.py") laid
   over the screenshots. The screen sits exactly in each frame's cut-out:
   iPhone 1206x2622 at (72,72) in a 1350x2766 frame; iPad 2064x2752 at
   (102,102) in 2268x2956. The percentages below come from those numbers. */
.phone {
  position: relative;
  width: 260px;
  aspect-ratio: 1350 / 2766;
  filter: drop-shadow(0 26px 30px rgba(0,0,0,0.32)) drop-shadow(0 6px 10px rgba(0,0,0,0.18));
}
.phone::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background: url("images/iphone-17-pro-frame.png") center / 100% 100% no-repeat;
  pointer-events: none;
}
.phone-screen {
  position: absolute;
  left: 5.333%;
  top: 2.603%;
  width: 89.334%;
  height: 94.794%;
  border-radius: 13.5% / 6.2%;
  overflow: hidden;
  background: #f2f2f7;
}
.phone-screen img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
/* a faint reflection across the glass */
.phone-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(118deg, rgba(255,255,255,0.12) 0%, rgba(255,255,255,0.03) 26%, rgba(255,255,255,0) 40%);
  pointer-events: none;
}
.phone-front { z-index: 2; transform: translateX(40px); }
.phone-back {
  position: absolute;
  z-index: 1;
  width: 220px;
  left: 8%;
  top: 70px;
  transform: rotate(-7deg);
  opacity: 0.94;
}
.phone-sm { width: 210px; }

/* Rotating screens: crossfade with a slight drift, like switching tabs */
.rotator img {
  opacity: 0;
  transform: scale(1.02);
  transition: opacity 0.7s ease, transform 1.2s ease;
}
.rotator img.is-active { opacity: 1; transform: scale(1); }
.rotator-dots {
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(calc(-50% + 40px));
  display: flex;
  gap: 6px;
}
.rotator-dots span {
  width: 6px; height: 6px;
  border-radius: 6px;
  background: rgba(255,255,255,0.35);
  transition: width 0.3s ease, background 0.3s ease;
}
.rotator-dots span.is-active { width: 18px; background: var(--green-bright); }

/* iPad Pro 13" */
.tablet {
  position: relative;
  width: 100%;
  max-width: 520px;
  aspect-ratio: 2268 / 2956;
  filter: drop-shadow(0 30px 34px rgba(27,67,50,0.35)) drop-shadow(0 8px 12px rgba(0,0,0,0.15));
}
.tablet::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background: url("images/ipad-pro-13-frame.png") center / 100% 100% no-repeat;
  pointer-events: none;
}
.tablet-screen {
  position: absolute;
  left: 4.497%;
  top: 3.451%;
  width: 91.006%;
  height: 93.099%;
  border-radius: 1.8% / 1.35%;
  overflow: hidden;
  background: #f2f2f7;
}
.tablet-screen img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tablet-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(118deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 34%);
  pointer-events: none;
}

/* ── FEATURE CARDS: app-style tiles with tinted icon badges ── */
.home-features {
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}
.home-features .feature-card {
  border-radius: 20px;
  box-shadow: 0 1px 2px rgba(17,17,17,0.04), 0 8px 24px rgba(45,106,79,0.07);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.home-features .feature-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 2px 4px rgba(17,17,17,0.05), 0 16px 32px rgba(45,106,79,0.12);
}
.home-features .feature-icon {
  width: 48px; height: 48px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--tint, #2D6A4F) 14%, white);
}
.home-features .feature-icon svg { stroke: var(--tint, var(--green)); }

/* ── SHOWCASE ── */
.showcase { background: var(--white); }
.showcase-head {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
}
.showcase-icon {
  width: 64px; height: 64px;
  border-radius: 15px;
  flex-shrink: 0;
  box-shadow: 0 6px 16px rgba(0,0,0,0.12);
  margin-top: 0.2rem;
}
.showcase-head .section-sub { margin-bottom: 2.5rem; }
.showcase-phones {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  justify-items: center;
}
.showcase-phones .phone { width: 100%; max-width: 230px; }
.showcase-phones .phone:nth-child(even) { margin-top: 2.5rem; }
.store-links {
  display: flex;
  gap: 0.875rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 3rem;
}
.store-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  background: #111;
  color: #fff;
  text-decoration: none;
  padding: 0.6rem 1.2rem 0.6rem 0.9rem;
  border-radius: 12px;
  transition: transform 0.15s ease, background 0.15s ease;
}
.store-btn:hover { transform: translateY(-1px); background: #000; }
.store-btn svg {
  width: 24px; height: 24px;
  fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}
.store-btn span { display: flex; flex-direction: column; font-weight: 700; line-height: 1.15; }
.store-btn small { font-size: 0.7rem; font-weight: 500; opacity: 0.75; }

/* ── STAFF ── */
.staff-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3.5rem;
  align-items: center;
}
.staff .section-sub { margin-bottom: 1.75rem; }
.staff-list { list-style: none; display: grid; gap: 0.85rem; }
.staff-list li {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  font-size: 0.97rem;
  color: var(--gray-600);
  line-height: 1.5;
}
.staff-list strong { color: var(--gray-800); }
.staff-list .dot {
  flex-shrink: 0;
  width: 10px; height: 10px;
  margin-top: 0.45rem;
  border-radius: 3px;
  background: var(--tint);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--tint) 18%, transparent);
}
.staff-devices { position: relative; display: flex; justify-content: center; width: 100%; }
.phone-overlap {
  position: absolute;
  width: 170px;
  right: -10px;
  bottom: -30px;
}

/* ── HOW IT WORKS: a line that draws itself, ending in the arrow ── */
.home-steps { position: relative; padding-top: 0.25rem; }
.steps-track {
  position: absolute;
  top: 20px;
  left: 20px;
  right: 8%;
  height: 2px;
  pointer-events: none;
}
.steps-line {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--green) 0%, var(--green-bright) 100%);
  border-radius: 2px;
  transform-origin: left center;
}
.steps-head {
  position: absolute;
  right: -10px;
  top: -9px;
  width: 20px; height: 20px;
  fill: var(--green-bright);
}
.home-steps .step { position: relative; z-index: 1; }
.home-steps .step-num { box-shadow: 0 0 0 6px var(--white); }

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-devices { height: 480px; }
  .phone-front { transform: none; width: 220px; }
  .phone-back { width: 190px; left: calc(50% - 200px); top: 50px; }
  .rotator-dots { transform: translateX(-50%); }
  .staff-grid { grid-template-columns: 1fr; }
  .staff-devices { max-width: 520px; margin: 0 auto 2rem; }
  .steps-track { display: none; }
}
@media (max-width: 640px) {
  .showcase-phones { grid-template-columns: repeat(2, 1fr); }
  .showcase-phones .phone:nth-child(even) { margin-top: 1.5rem; }
  .showcase-head { flex-direction: column; }
  .phone-overlap { width: 120px; right: 0; }
  .phone-back { left: 4%; }
}

/* ============================================================
   MOTION (only when html.motion is set: JS on, Reduce Motion off)
   ============================================================ */

/* Scroll reveal: rise and fade in, staggered within a group */
.motion .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.7s cubic-bezier(.2,.8,.2,1);
  transition-delay: var(--d, 0ms);
}
.motion .reveal.is-in { opacity: 1; transform: none; }

/* Steps line draws across when the section comes into view */
.motion .steps-line { transform: scaleX(0); transition: transform 1.4s cubic-bezier(.65,0,.35,1) 0.2s; }
.motion .steps-head { opacity: 0; transform: translateX(-12px); transition: opacity 0.3s ease 1.4s, transform 0.4s ease 1.4s; }
.motion .home-steps.is-in .steps-line { transform: scaleX(1); }
.motion .home-steps.is-in .steps-head { opacity: 1; transform: none; }

/* Hero devices drift in after the intro */
.motion .hero-devices .phone-front { animation: rise-in 0.9s cubic-bezier(.2,.8,.2,1) both; animation-delay: var(--hero-delay, 0.1s); }
.motion .hero-devices .phone-back { animation: rise-in-tilt 1s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(var(--hero-delay, 0.1s) + 0.15s); }
.motion .hero-copy > * { animation: fade-up 0.7s cubic-bezier(.2,.8,.2,1) both; }
.motion .hero-copy > :nth-child(2) { animation-delay: 0.08s; }
.motion .hero-copy > :nth-child(3) { animation-delay: 0.16s; }
.motion .hero-copy > :nth-child(4) { animation-delay: 0.24s; }
.motion .hero-copy > :nth-child(5) { animation-delay: 0.32s; }
.motion.intro { --hero-delay: 1.35s; }
.motion.intro .hero-copy > * { animation-delay: calc(1.2s + var(--i, 0s)); }
.motion.intro .hero-copy > :nth-child(2) { --i: 0.08s; }
.motion.intro .hero-copy > :nth-child(3) { --i: 0.16s; }
.motion.intro .hero-copy > :nth-child(4) { --i: 0.24s; }
.motion.intro .hero-copy > :nth-child(5) { --i: 0.32s; }

@keyframes fade-up { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes rise-in { from { opacity: 0; transform: translate(40px, 40px); } to { opacity: 1; transform: translateX(40px); } }
@keyframes rise-in-tilt { from { opacity: 0; transform: translateY(50px) rotate(-2deg); } to { opacity: 0.94; transform: rotate(-7deg); } }
@media (max-width: 900px) {
  @keyframes rise-in { from { opacity: 0; transform: translateY(40px); } to { opacity: 1; transform: none; } }
}

/* ── OPENING "SEND-OFF" (same motion as the app's launch) ── */
.intro-overlay { display: none; }
.motion.intro .intro-overlay {
  display: flex;
  position: fixed;
  inset: 0;
  z-index: 1000;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 45%, #2f7556 0%, #2D6A4F 45%, #1B4332 100%);
  animation: intro-out 0.45s ease 1.15s forwards;
}
.intro-mark { width: 150px; height: 150px; overflow: visible; }
.intro-frame {
  fill: none;
  stroke: #fff;
  stroke-width: 6;
  stroke-dasharray: 640;
  stroke-dashoffset: 640;
  animation: draw-frame 0.6s cubic-bezier(.65,0,.35,1) 0.05s forwards;
}
.intro-e rect, .intro-arrow > * { fill: #fff; }
.intro-e {
  opacity: 0;
  transform-origin: 100px 100px;
  animation: pop-in 0.35s cubic-bezier(.2,.8,.2,1) 0.35s forwards;
}
.intro-arrow {
  opacity: 0;
  animation:
    pop-in 0.35s cubic-bezier(.2,.8,.2,1) 0.45s forwards,
    send-off 0.45s cubic-bezier(.55,0,.75,.35) 0.85s forwards;
}
.intro-trail {
  transform-box: fill-box;
  transform-origin: right center;
  animation: trail-stretch 0.45s cubic-bezier(.55,0,.75,.35) 0.85s forwards;
}

@keyframes draw-frame { to { stroke-dashoffset: 0; } }
@keyframes pop-in { from { opacity: 0; transform: scale(0.92); } to { opacity: 1; transform: none; } }
@keyframes send-off {
  0%   { opacity: 1; transform: translateX(0); }
  100% { opacity: 0; transform: translateX(110vw); }
}
@keyframes trail-stretch { to { transform: scaleX(4); } }
@keyframes intro-out { to { opacity: 0; visibility: hidden; } }
