/* Peila Landing Page — Styles */

/* ===========================
   CSS Reset
   =========================== */

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

html {
  scroll-behavior: smooth;
}

img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
}

input, button, textarea, select {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

ul, ol {
  list-style: none;
}

/* ===========================
   Custom Properties
   =========================== */

:root {
  --bg: #F0E8DC;
  --text: #0f172a;
  --text-secondary: #64748b;
  --primary: #6164ed;
  --primary-light: #818cf8;
  --surface: #ffffff;
  --footer-bg: #0f172a;
  --footer-text: #f1f5f9;
  --shadow: 0 4px 24px rgba(15, 23, 42, 0.08);
  --shadow-hover: 0 8px 32px rgba(15, 23, 42, 0.12);
  --radius: 16px;
  --max-width: 1120px;
}

/* ===========================
   Base Typography & Body
   =========================== */

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: 'Public Sans', system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Outfit', system-ui, -apple-system, sans-serif;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text);
}

h1 {
  font-size: 3.5rem;
  letter-spacing: -0.02em;
}

h2 {
  font-size: 2.5rem;
  letter-spacing: -0.01em;
}

h3 {
  font-size: 1.5rem;
}

p {
  color: var(--text-secondary);
}

/* ===========================
   Layout
   =========================== */

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

section {
  padding: 100px 0;
  position: relative;
  z-index: 1;
}

section:not(#hero) {
  background: var(--bg);
}

section h2 {
  text-align: center;
  margin-bottom: 48px;
}

/* ===========================
   Footer
   =========================== */

#footer {
  background: var(--footer-bg);
  color: var(--footer-text);
  padding: 60px 0 0;
  position: relative;
  z-index: 1;
}

#footer p {
  color: var(--footer-text);
}

.footer-grid {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 40px;
}

.footer-brand img {
  margin-bottom: 12px;
}

.footer-brand p {
  color: #94a3b8;
  font-size: 0.9rem;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-links a {
  color: var(--footer-text);
  text-decoration: none;
  font-size: 0.9rem;
}

.footer-links a:hover {
  text-decoration: underline;
}

.footer-badges {
  display: flex;
  gap: 12px;
}

.store-badge--small {
  font-size: 0.8rem;
  padding: 8px 14px;
  height: auto;
}

.footer-bottom {
  margin-top: 40px;
  padding: 20px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
}

.footer-bottom p {
  color: #64748b;
  font-size: 0.8rem;
}

/* ===========================
   Hero
   =========================== */

#hero {
  min-height: 100vh;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 60px;
}

.hero-text {
  max-width: 500px;
}

.hero-label {
  text-transform: uppercase;
  letter-spacing: 3px;
  font-size: 0.75rem;
  color: var(--primary);
  font-weight: 600;
  margin-bottom: 16px;
  display: block;
}

.hero-text h1 {
  font-family: 'Outfit', system-ui, -apple-system, sans-serif;
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 24px;
}

.hero-text p {
  font-size: 1.125rem;
  color: var(--text-secondary);
  max-width: 420px;
  line-height: 1.6;
  margin-bottom: 32px;
}

.hero-phone {
  perspective: 1200px;
}

.phone-frame {
  width: 280px;
  border-radius: 40px;
  border: 8px solid #1a1a2e;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.phone-frame img {
  width: 100%;
  display: block;
}

.hero-ctas {
  display: flex;
  flex-direction: row;
  gap: 12px;
}

.store-badge {
  height: 50px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 20px;
  background: #0f172a;
  color: white;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 500;
}

.store-badge svg {
  display: inline;
}

.scroll-hint {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  animation: bounce 2s ease-in-out infinite;
}
@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); opacity: 0.6; }
  50% { transform: translateX(-50%) translateY(10px); opacity: 1; }
}

/* ===========================
   Features
   =========================== */

.features-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.feature-card {
  background: var(--surface);
  padding: 32px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.feature-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #e8e9fd;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
}

.feature-icon svg {
  display: inline;
}

.feature-card h3 {
  font-family: 'Outfit', system-ui, -apple-system, sans-serif;
  font-size: 1.25rem;
  margin-top: 16px;
  margin-bottom: 8px;
}

.feature-card p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.5;
}

/* ===========================
   Comparison — Free vs Pro
   =========================== */

.section-subtitle {
  text-align: center;
  color: var(--text-secondary);
  font-size: 1.125rem;
  max-width: 560px;
  margin: 16px auto 48px;
}

.plan-cards {
  display: flex;
  gap: 24px;
  justify-content: center;
}

.plan-card {
  background: var(--surface);
  padding: 40px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  flex: 1;
  max-width: 400px;
  display: flex;
  flex-direction: column;
}

.plan-card .price {
  margin: 8px 0 0;
}

.plan-card .btn {
  margin-top: auto;
}

.plan-card .plan-features {
  margin-bottom: 24px;
  flex: 1;
}

.plan-card--pro {
  background:
    linear-gradient(var(--surface), var(--surface)) padding-box,
    linear-gradient(135deg, var(--primary), var(--primary-light), var(--primary)) border-box;
  border: 2px solid transparent;
  position: relative;
}

.plan-badge {
  position: absolute;
  top: -12px;
  right: 24px;
  background: var(--primary);
  color: white;
  padding: 4px 16px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
}

.plan-card h3 {
  font-family: 'Outfit', system-ui, -apple-system, sans-serif;
  font-size: 1.75rem;
  margin-bottom: 4px;
}

.plan-subtitle {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 24px;
}

.plan-features {
  list-style: none;
  padding: 0;
}

.plan-features li {
  padding: 10px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  display: flex;
  align-items: center;
  gap: 8px;
}

.plan-value {
  font-weight: 700;
  color: var(--primary);
  min-width: 80px;
}

.plan-check::before {
  content: "\2713";
  color: #16a34a;
  font-weight: 700;
  margin-right: 8px;
}

.plan-dash::before {
  content: "\2014";
  color: #94a3b8;
  margin-right: 8px;
}

.plan-dash {
  color: #94a3b8;
}

/* ===========================
   Screenshots Carousel
   =========================== */

#screenshots {
  overflow: hidden;
}

.phone-carousel {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  perspective: 1200px;
  padding: 40px 0;
}

.phone-mockup {
  flex-shrink: 0;
  transition: transform 0.5s ease, opacity 0.5s ease;
}

.phone-mockup:nth-child(1) { transform: rotateY(15deg) scale(0.9); opacity: 0.8; }
.phone-mockup:nth-child(2) { transform: rotateY(8deg) scale(0.95); opacity: 0.9; }
.phone-mockup:nth-child(3) { transform: rotateY(0deg) scale(1); }
.phone-mockup:nth-child(4) { transform: rotateY(-8deg) scale(0.95); opacity: 0.9; }
.phone-mockup:nth-child(5) { transform: rotateY(-15deg) scale(0.9); opacity: 0.8; }

.phone-mockup .phone-frame {
  width: 200px;
  border-radius: 32px;
  border: 6px solid #1a1a2e;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.phone-mockup .phone-frame img {
  width: 100%;
  display: block;
}

.phone-mockup:hover {
  transform: rotateY(0deg) scale(1.05) translateY(-8px);
  opacity: 1;
  z-index: 2;
}

/* ===========================
   Pricing
   =========================== */

.pricing-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 48px;
}

.pricing-toggle-label {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: color 0.3s ease;
  user-select: none;
}

.pricing-toggle-label--active {
  color: var(--text);
  font-weight: 600;
}

.pricing-toggle-switch {
  width: 52px;
  height: 28px;
  background: var(--primary);
  border-radius: 14px;
  border: none;
  cursor: pointer;
  position: relative;
  padding: 0;
  transition: background 0.3s ease;
}

.pricing-toggle-pill {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  background: white;
  border-radius: 50%;
  transition: transform 0.3s ease;
}

.pricing-toggle-switch.active .pricing-toggle-pill {
  transform: translateX(24px);
}

.pricing-save-badge {
  font-size: 0.75rem;
  font-weight: 600;
  color: #16a34a;
  background: #dcfce7;
  padding: 4px 10px;
  border-radius: 12px;
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.pricing-save-badge.visible {
  opacity: 1;
  transform: scale(1);
}

.price-container {
  position: relative;
}

.pricing-cards {
  display: flex;
  gap: 24px;
  justify-content: center;
}

.pricing-card {
  background: var(--surface);
  padding: 40px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  flex: 1;
  max-width: 380px;
  display: flex;
  flex-direction: column;
}

.pricing-card--pro {
  background:
    linear-gradient(var(--surface), var(--surface)) padding-box,
    linear-gradient(135deg, var(--primary), var(--primary-light), var(--primary)) border-box;
  border: 2px solid transparent;
  position: relative;
}

.price {
  font-family: 'Outfit', system-ui, -apple-system, sans-serif;
  font-size: 3rem;
  font-weight: 700;
  margin: 16px 0;
}

.price span {
  font-size: 1rem;
  color: var(--text-secondary);
  font-weight: 400;
}

.price-alt {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 24px;
}

.price--monthly,
.price--yearly {
  margin: 16px 0;
}

.pricing-card ul {
  list-style: none;
  padding: 0;
  margin-bottom: 32px;
  flex: 1;
}

.pricing-card li {
  padding: 8px 0;
  color: var(--text-secondary);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.btn {
  display: inline-block;
  padding: 14px 32px;
  border-radius: 12px;
  font-weight: 600;
  text-decoration: none;
  text-align: center;
  transition: all 0.3s ease;
  width: 100%;
}

.btn--primary {
  background: var(--primary);
  color: white;
}

.btn--primary:hover {
  background: #5153d4;
  transform: translateY(-2px);
}

.btn--secondary {
  background: transparent;
  color: var(--text);
  border: 2px solid var(--text);
}

.btn--secondary:hover {
  background: var(--text);
  color: var(--bg);
  transform: translateY(-2px);
}

/* ===========================
   Scroll Reveal Animations
   =========================== */

[data-reveal] {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
[data-reveal].revealed {
  opacity: 1;
  transform: translateY(0);
}
[data-reveal-left] {
  opacity: 0;
  transform: translateX(-40px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
[data-reveal-left].revealed {
  opacity: 1;
  transform: translateX(0);
}
[data-reveal-right] {
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
[data-reveal-right].revealed {
  opacity: 1;
  transform: translateX(0);
}

/* ===========================
   Responsive — 768px
   =========================== */

@media (max-width: 768px) {
  .hero-content {
    flex-direction: column;
    text-align: center;
    padding-top: 120px;
  }

  .hero-text {
    align-items: center;
    display: flex;
    flex-direction: column;
  }

  .hero-phone .phone-frame {
    width: 220px;
  }

  .hero-ctas {
    justify-content: center;
  }

  .features-grid {
    grid-template-columns: 1fr;
  }

  .plan-cards {
    flex-direction: column;
    align-items: center;
  }

  .phone-carousel {
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    justify-content: flex-start;
    padding: 20px;
    gap: 16px;
    -webkit-overflow-scrolling: touch;
  }

  .phone-mockup {
    scroll-snap-align: center;
    min-width: 240px;
    transform: none;
    opacity: 1;
  }

  .phone-mockup .phone-frame {
    width: 240px;
  }

  .pricing-cards {
    flex-direction: column;
    align-items: center;
  }

  .footer-grid {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
}

/* ===========================
   Reduced Motion
   =========================== */

@media (prefers-reduced-motion: reduce) {
  [data-reveal], [data-reveal-left], [data-reveal-right] {
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
  .scroll-hint { animation: none; }
  .feature-card, .pricing-card { transition: none !important; }
}
