/* ═══════════════════════════════════════════════════
   PEBL LANDING PAGE — Design System & Styles
   Dark, earthy, minimal. Teal accent on charcoal.
   ═══════════════════════════════════════════════════ */

/* ─── Tokens ─── */
:root {
  /* Backgrounds */
  --bg:          #111111;
  --bg-surface:  #1a1a1a;
  --bg-card:     #1e1e1e;
  --bg-elevated: #252525;

  /* Text */
  --text-primary:   #f0ece4;
  --text-secondary: #9a948a;
  --text-muted:     #5a5650;

  /* Accent — teal, pulled from the app's ColorScheme seedColor */
  --accent:        #5eead4;
  --accent-dim:    #2dd4a8;
  --accent-glow:   rgba(94, 234, 212, 0.12);

  /* Warm pebble tones (from the icon) */
  --pebble-light: #f0ece4;
  --pebble-mid:   #c4b9a8;
  --pebble-dark:  #8a7e6e;

  /* Radius */
  --r-sm:  8px;
  --r-md:  14px;
  --r-lg:  22px;
  --r-xl:  32px;

  /* Spacing */
  --s-page:  clamp(1.25rem, 5vw, 6rem);
  --s-sec:   clamp(5rem, 12vh, 10rem);

  /* Transition */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }
a   { color: inherit; text-decoration: none; }

/* ─── Utility ─── */
.section-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 var(--s-page);
}

.section-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.section-title {
  font-family: 'DM Serif Display', serif;
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 400;
  line-height: 1.15;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

/* ─── Reveal animation ─── */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ══════════════════════════════════════
   NAV
   ══════════════════════════════════════ */
#nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 0 var(--s-page);
  transition: background 0.4s, backdrop-filter 0.4s;
}

#nav.scrolled {
  background: rgba(17, 17, 17, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(240, 236, 228, 0.06);
}

.nav-inner {
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
}

.nav-wordmark {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--pebble-light);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.nav-links a {
  transition: color 0.3s;
}

.nav-links a:hover {
  color: var(--text-primary);
}

.nav-cta {
  background: var(--accent);
  color: var(--bg) !important;
  padding: 0.5rem 1.25rem;
  border-radius: var(--r-xl);
  font-weight: 600;
  transition: transform 0.3s var(--ease), box-shadow 0.3s;
}

.nav-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px var(--accent-glow);
}

/* ══════════════════════════════════════
   HERO
   ══════════════════════════════════════ */
#hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 6rem var(--s-page) 3rem;
  overflow: hidden;
}

.hero-glow {
  position: absolute;
  top: -20%;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 800px;
  background: radial-gradient(circle, rgba(94,234,212,0.06) 0%, transparent 70%);
  pointer-events: none;
}

.hero-content {
  max-width: 1120px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 4rem;
}

.hero-text {
  flex: 1;
  min-width: 0;
}

.hero-tagline {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.25rem;
}

.hero-title {
  font-family: 'DM Serif Display', serif;
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 400;
  line-height: 1.08;
  color: var(--pebble-light);
  margin-bottom: 1.5rem;
}

.hero-subtitle {
  font-size: 1.1rem;
  line-height: 1.7;
  color: var(--text-secondary);
  max-width: 440px;
  margin-bottom: 2.5rem;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  border: none;
  cursor: pointer;
  border-radius: var(--r-xl);
  padding: 0.75rem 1.75rem;
  transition: transform 0.3s var(--ease), box-shadow 0.3s, background 0.3s;
}

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

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 28px var(--accent-glow);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid rgba(240,236,228,0.12);
}

.btn-ghost:hover {
  color: var(--text-primary);
  border-color: rgba(240,236,228,0.25);
  transform: translateY(-2px);
}

.btn-lg {
  padding: 1rem 2.25rem;
  font-size: 1rem;
}

/* Phone mock */
.hero-phone {
  flex-shrink: 0;
  perspective: 1200px;
}

.hero-device {
  width: 280px;
  border-radius: 28px;
  filter: drop-shadow(0 40px 80px rgba(0,0,0,0.5)) drop-shadow(0 0 100px rgba(94,234,212,0.08));
  animation: phoneFloat 6s ease-in-out infinite;
}

@keyframes phoneFloat {
  0%, 100% { transform: translateY(0) rotateY(-2deg); }
  50%      { transform: translateY(-14px) rotateY(2deg); }
}

/* Scroll hint */
.hero-scroll-hint {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.scroll-line {
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, var(--text-muted), transparent);
  animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
  0%, 100% { opacity: 0.3; transform: scaleY(1); }
  50%      { opacity: 1; transform: scaleY(1.3); }
}

/* ══════════════════════════════════════
   FEATURES
   ══════════════════════════════════════ */
#features {
  padding: var(--s-sec) 0;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin-top: 3rem;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid rgba(240,236,228,0.05);
  border-radius: var(--r-lg);
  padding: 2rem 1.75rem;
  transition: border-color 0.4s, transform 0.4s var(--ease), box-shadow 0.4s;
}

.feature-card:hover {
  border-color: rgba(94,234,212,0.15);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.3);
}

.feature-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-md);
  background: var(--accent-glow);
  color: var(--accent);
  margin-bottom: 1.25rem;
}

.feature-card h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

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

/* ══════════════════════════════════════
   SCREENSHOTS
   ══════════════════════════════════════ */
#screenshots {
  padding: var(--s-sec) 0;
}

.screenshots-track {
  display: flex;
  gap: 2rem;
  margin-top: 3rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 1.5rem;
  -webkit-overflow-scrolling: touch;
}

.screenshots-track::-webkit-scrollbar {
  height: 4px;
}
.screenshots-track::-webkit-scrollbar-track {
  background: var(--bg-surface);
  border-radius: 2px;
}
.screenshots-track::-webkit-scrollbar-thumb {
  background: var(--text-muted);
  border-radius: 2px;
}

.screenshot-card {
  flex-shrink: 0;
  scroll-snap-align: start;
  text-align: center;
}

.screenshot-img {
  width: 240px;
  border-radius: 20px;
  filter: drop-shadow(0 24px 48px rgba(0,0,0,0.4));
  transition: transform 0.5s var(--ease), filter 0.5s;
}

.screenshot-card:hover .screenshot-img {
  transform: translateY(-8px);
  filter: drop-shadow(0 32px 64px rgba(0,0,0,0.5)) drop-shadow(0 0 40px rgba(94,234,212,0.08));
}

.screenshot-caption {
  margin-top: 1rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* ══════════════════════════════════════
   PHILOSOPHY
   ══════════════════════════════════════ */
#philosophy {
  padding: var(--s-sec) 0;
}

.philosophy-inner {
  text-align: center;
  max-width: 640px;
  margin: 0 auto;
  padding: var(--s-sec) var(--s-page);
  border-top: 1px solid rgba(240,236,228,0.06);
  border-bottom: 1px solid rgba(240,236,228,0.06);
}

.philosophy-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 2rem;
  opacity: 0.7;
}

.philosophy-icon img {
  border-radius: 50%;
  width: 100%;
}

.philosophy-quote {
  font-family: 'DM Serif Display', serif;
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-style: italic;
  line-height: 1.4;
  color: var(--pebble-mid);
  margin-bottom: 1.5rem;
}

.philosophy-body {
  font-size: 0.95rem;
  line-height: 1.75;
  color: var(--text-secondary);
}

/* ══════════════════════════════════════
   DOWNLOAD CTA
   ══════════════════════════════════════ */
#download {
  padding: var(--s-sec) 0;
}

.download-inner {
  text-align: center;
}

.download-sub {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 2.5rem;
}

.download-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ══════════════════════════════════════
   FOOTER
   ══════════════════════════════════════ */
#footer {
  padding: 3rem var(--s-page);
  border-top: 1px solid rgba(240,236,228,0.06);
}

.footer-inner {
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 600;
  font-size: 1rem;
  color: var(--text-muted);
}

.footer-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  opacity: 0.5;
}

.footer-copy {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  gap: 1.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.footer-links a:hover {
  color: var(--text-secondary);
}

/* ══════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════ */
@media (max-width: 900px) {
  .hero-content {
    flex-direction: column;
    text-align: center;
  }

  .hero-subtitle {
    margin-left: auto;
    margin-right: auto;
  }

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

  .phone-frame {
    width: 220px;
  }

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

@media (max-width: 600px) {
  .nav-links a:not(.nav-cta) {
    display: none;
  }

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

  .hero-title {
    font-size: 2.2rem;
  }

  .phone-frame {
    width: 200px;
  }

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