/* ==========================================================================
   PetFiles — Section-specific Layouts
   ========================================================================== */

/* ---- Hero ---- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: var(--nav-height);
  position: relative;
  overflow: hidden;
}

/* Spacer that collapses as nav brand shrinks into place */
.hero__brand-spacer {
  overflow: hidden;
  will-change: max-height;
}

/* Nav brand: JS animates width/height/fontSize directly for crisp SVG */

.hero__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-6xl);
  align-items: center;
}

.hero__content {
  position: relative;
  z-index: 2;
}

.hero__headline {
  margin-bottom: var(--space-xl);
}

.hero__subheadline {
  font-size: var(--font-size-md);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-3xl);
  max-width: 50ch;
}

.hero__ctas {
  display: flex;
  gap: var(--space-lg);
  align-items: center;
  margin-bottom: var(--space-xl);
}

.hero__trust {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

/* Device mockup */
.hero__device-wrapper {
  position: relative;
  display: flex;
  justify-content: center;
  z-index: 1;
}

.hero__device-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 400px;
  height: 400px;
  border-radius: var(--radius-full);
  background: radial-gradient(circle, rgba(45, 75, 65, 0.08) 0%, transparent 70%);
  pointer-events: none;
}

[data-theme="dark"] .hero__device-glow,
.dark .hero__device-glow {
  background: radial-gradient(circle, rgba(91, 138, 114, 0.1) 0%, transparent 70%);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .hero__device-glow {
    background: radial-gradient(circle, rgba(91, 138, 114, 0.1) 0%, transparent 70%);
  }
}

.device-frame {
  width: 280px;
  background-color: var(--color-text-primary);
  border-radius: 40px;
  padding: 4px;
  box-shadow: var(--shadow-xl);
  position: relative;
}

.device-frame__dynamic-island {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 84px;
  height: 20px;
  background-color: #000;
  border-radius: 999px;
  z-index: 2;
}

.device-frame__screen {
  border-radius: 36px;
  overflow: hidden;
  aspect-ratio: 9/19.5;
}

.device-frame__screen img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ---- Features ---- */
.features__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-2xl);
}

@media (max-width: 768px) {
  .features__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .features__grid {
    grid-template-columns: 1fr;
  }
}

/* ---- How It Works ---- */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4xl);
  position: relative;
}

.steps::before {
  content: '';
  position: absolute;
  top: 40px;
  left: calc(16.66% + 32px);
  right: calc(16.66% + 32px);
  height: 2px;
  border-top: 2px dashed var(--color-surface-border);
}

.step {
  text-align: center;
  position: relative;
  z-index: 1;
}

.step__number {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 80px;
  font-weight: var(--font-weight-bold);
  color: var(--color-secondary);
  opacity: 0.2;
  z-index: -1;
  line-height: 1;
}

.step__icon {
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--color-bg);
  border: 2px solid var(--color-surface-border);
  border-radius: var(--radius-full);
  margin: 0 auto var(--space-xl);
  font-size: var(--font-size-2xl);
  color: var(--color-primary);
  position: relative;
  z-index: 2;
}

.step__title {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  margin-bottom: var(--space-sm);
}

.step__text {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
}

@media (max-width: 768px) {
  .steps {
    grid-template-columns: 1fr;
    gap: var(--space-3xl);
  }

  .steps::before {
    top: 0;
    bottom: 0;
    left: 40px;
    right: auto;
    width: 2px;
    height: auto;
    border-top: none;
    border-left: 2px dashed var(--color-surface-border);
  }

  .step {
    text-align: left;
    padding-left: 110px;
  }

  .step__icon {
    position: absolute;
    left: 0;
    margin: 0;
  }

  .step__number {
    left: 40px;
    top: -8px;
    font-size: 60px;
  }
}

/* ---- Screenshot Carousel ---- */
.carousel {
  position: relative;
  max-width: 100%;
  overflow: hidden;
}

.carousel__track {
  display: flex;
  gap: var(--space-2xl);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: var(--space-5xl) var(--space-lg);
}

.carousel__track::-webkit-scrollbar {
  display: none;
}

.carousel__slide {
  flex: 0 0 auto;
  scroll-snap-align: center;
}

.carousel__slide .device-frame {
  width: 220px;
  transition: transform 0.4s cubic-bezier(0.25, 0.1, 0.25, 1),
              opacity 0.4s ease;
}

/* Faster transition during hover for responsive dock feel */
.carousel__track:hover .carousel__slide .device-frame {
  transition-duration: 0.12s;
}

.carousel__controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2xl);
  margin-top: var(--space-2xl);
}

.carousel__btn {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--color-surface-border);
  border-radius: var(--radius-full);
  background: var(--color-bg);
  color: var(--color-text-secondary);
  font-size: var(--font-size-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.carousel__btn:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.carousel__dots {
  display: flex;
  gap: 0;
}

.carousel__dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background-color: var(--color-surface-border);
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  padding: 10px;
  background-clip: content-box;
}

.carousel__dot.active {
  background-color: var(--color-primary);
  width: 24px;
  border-radius: 4px;
}

/* ---- Pricing ---- */
.pricing__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3xl);
  max-width: 800px;
  margin: 0 auto;
  align-items: start;
}

@media (max-width: 640px) {
  .pricing__grid {
    grid-template-columns: 1fr;
  }

  .pricing-card--featured {
    transform: none;
    order: -1;
  }

  .pricing-card--featured:hover {
    transform: translateY(-4px);
  }
}

/* ---- Download CTA ---- */
.download-cta {
  background-color: var(--color-primary);
  padding: var(--space-9xl) 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.download-cta::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60' viewBox='0 0 60 60'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cellipse cx='30' cy='35' rx='12' ry='10'/%3E%3Cellipse cx='17' cy='18' rx='5' ry='7' transform='rotate(25 17 18)'/%3E%3Cellipse cx='25' cy='10' rx='4.5' ry='6' transform='rotate(10 25 10)'/%3E%3Cellipse cx='35' cy='10' rx='4.5' ry='6' transform='rotate(-10 35 10)'/%3E%3Cellipse cx='43' cy='18' rx='5' ry='7' transform='rotate(-25 43 18)'/%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}

.download-cta h2 {
  color: #fff;
  margin-bottom: var(--space-xl);
  position: relative;
}

.download-cta p {
  color: rgba(255, 255, 255, 0.8);
  margin: 0 auto var(--space-3xl);
  font-size: var(--font-size-md);
  position: relative;
}

.download-cta__buttons {
  display: flex;
  justify-content: center;
  gap: var(--space-lg);
  flex-wrap: wrap;
  position: relative;
}

.download-cta__android-soon {
  color: rgba(255, 255, 255, 0.5);
  font-size: var(--font-size-sm);
  margin-top: var(--space-xl);
  position: relative;
}

.download-cta__qr {
  margin-top: var(--space-2xl);
  position: relative;
}

.download-cta__qr img {
  width: 120px;
  height: 120px;
  border-radius: var(--radius-default);
}

@media (max-width: 768px) {
  .download-cta__qr {
    display: none;
  }
}

/* ---- FAQ ---- */
.faq__grid {
  max-width: 800px;
  margin: 0 auto;
}

/* ---- Footer ---- */
.footer {
  background-color: var(--color-primary-variant);
  color: rgba(255, 255, 255, 0.7);
  padding: var(--space-6xl) 0 var(--space-3xl);
}

.footer__grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--space-4xl);
  margin-bottom: var(--space-4xl);
}

.footer__brand {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}

.footer__brand img {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
}

.footer__brand span {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-bold);
  color: #fff;
}

.footer__tagline {
  font-size: var(--font-size-sm);
  color: rgba(255, 255, 255, 0.5);
  max-width: 30ch;
}

.footer h3 {
  color: #fff;
  font-size: var(--font-size-sm);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: var(--space-lg);
}

.footer__links {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.footer__link {
  font-size: var(--font-size-sm);
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.footer__link:hover {
  color: #fff;
}

.footer__bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: var(--space-2xl);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: var(--font-size-xs);
  color: rgba(255, 255, 255, 0.4);
}

@media (max-width: 768px) {
  .hero__grid {
    grid-template-columns: 1fr;
    text-align: center;
    gap: var(--space-4xl);
  }

  .hero__subheadline {
    margin-left: auto;
    margin-right: auto;
  }

  .hero__ctas {
    justify-content: center;
  }

  .hero__device-wrapper {
    order: -1;
  }

  .device-frame {
    width: 220px;
  }

  /* Disable brand animation on mobile — render nav normally */
  .hero__brand-spacer {
    display: none;
  }

  .nav__brand {
    transform: none !important;
  }

  .nav__brand img {
    width: 36px !important;
    height: 36px !important;
  }

  .nav__brand span {
    font-size: var(--font-size-lg) !important;
  }

  .nav__brand {
    gap: var(--space-sm) !important;
  }

  .footer__grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3xl);
  }

  .footer__brand-col {
    grid-column: 1 / -1;
  }

  .footer__bottom {
    flex-direction: column;
    gap: var(--space-sm);
    text-align: center;
  }
}

@media (max-width: 480px) {
  .footer__grid {
    grid-template-columns: 1fr;
  }
}
