/* ══════════════════════════════════════════
   Pup Personality — Landing Page Styles
   Design tokens from the iOS app
   ══════════════════════════════════════════ */

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

:root {
  /* Primary */
  --terracotta:          #C8703C;

  /* Text */
  --text-primary:        #3D2B1F;
  --text-emphasis:       #644733;
  --text-secondary:      #8B6347;
  --text-body:           #6B4C35;
  --text-muted:          #A0887A;

  /* Backgrounds */
  --bg:                  #FFF8F0;
  --bg-tint:             #FFF3E8;
  --white:               #FFFFFF;

  /* Borders */
  --border-light:        #E8D5C8;
  --divider:             #F0E8E0;

  /* Shadows */
  --shadow-card:         0 2px 8px rgba(0,0,0,0.06);
  --shadow-card-md:      0 2px 8px rgba(0,0,0,0.07);

  /* Radii */
  --r-xl:  24px;
  --r-lg:  18px;
  --r-sm:  10px;
}

html {
  height: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  height: 100%;
  margin: 0;
  overflow: hidden;
}

.scroll-wrapper {
  height: 100%;
  overflow-y: scroll;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: y mandatory;
  position: relative;
  z-index: 1;
}

/* ── Layout ── */
.section-inner,
.hero-inner {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Background archetype grid ── */
.bg-grid {
  position: sticky;
  top: 0;
  height: 100vh;
  margin-bottom: -100vh;
  z-index: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(4, 1fr);
  gap: 24px;
  padding: 24px;
  opacity: 0.04;
  pointer-events: none;
}

/* Boost grid opacity on touch/mobile devices (iOS renders fainter) */
@media (hover: none) and (pointer: coarse) {
  .bg-grid {
    opacity: 0.15;
  }
}

.bg-grid img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 16px;
}

/* Ensure all content sits above the background grid */
main, footer {
  position: relative;
}

/* ── Hero ── */
.hero {
  text-align: center;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 40px 0;
  position: relative;
  background: rgba(255,248,240,0.3);
}

.app-icon {
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-card-md);
  margin-bottom: 16px;
}

h1 {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.3px;
  margin-bottom: 6px;
}

.tagline {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.description {
  font-size: 1rem;
  font-weight: 400;
  color: var(--text-body);
  line-height: 1.65;
  max-width: 400px;
  margin: 0 auto 24px;
}

.description strong {
  color: var(--text-emphasis);
  font-weight: 600;
}

/* ── Scroll snap ── */
.snap-section {
  scroll-snap-align: start;
}

/* ── Scroll hint ── */
.scroll-hint {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--terracotta);
  opacity: 0.75;
  animation: bounce 1.8s ease-in-out infinite;
}

.scroll-hint span {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
}

@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%      { transform: translateX(-50%) translateY(8px); }
}

/* ── App Store badge ── */
.store-badge-link {
  display: inline-block;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.store-badge-link:hover {
  opacity: 0.85;
  transform: translateY(-1px);
}

.store-badge-link:active {
  opacity: 0.75;
  transform: translateY(0);
}

.app-store-badge {
  display: block;
}

/* ── Buttons ── */
.store-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 12px;
}

/* gap fallback for older Safari */
@supports not (gap: 12px) {
  .store-buttons > * { margin: 6px; }
}

/* ── Section layout ── */
.section {
  padding: 48px 0 64px;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
}

.section-tinted {
  background: rgba(255,243,232,0.55);
}

.section-label {
  display: block;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--terracotta);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  margin-bottom: 6px;
}

.section h2 {
  text-align: center;
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.2px;
  margin-bottom: 28px;
}

/* ── Archetype cards ── */
.archetype-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  justify-items: center;
}

.archetype-card {
  text-align: center;
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: var(--r-lg);
  padding: 16px 12px 14px;
  box-shadow: var(--shadow-card);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.archetype-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.09);
}

.archetype-card img {
  border-radius: 12px;
  margin-bottom: 10px;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.archetype-name {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-emphasis);
  line-height: 1.3;
}

.archetype-code {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 1.5px;
  margin-top: 4px;
}

.archetype-hint {
  text-align: center;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  margin-top: 20px;
  font-style: italic;
}

/* ── Feature cards (list style) ── */
.feature-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* gap fallback for older Safari */
@supports not (gap: 12px) {
  .feature-grid > * + * { margin-top: 12px; }
}

.feature-card {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  background: var(--white);
  border: 1px solid var(--border-light);
  border-left: 4px solid var(--terracotta);
  border-radius: var(--r-lg);
  padding: 18px;
  box-shadow: var(--shadow-card);
}

img.feature-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  object-fit: contain;
  border-radius: var(--r-sm);
  background: var(--bg-tint);
  padding: 4px;
}

.feature-content h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.feature-content p {
  font-size: 14px;
  font-weight: 400;
  color: var(--text-body);
  line-height: 1.55;
}

/* ── CTA section ── */
.cta-section {
  padding: 52px 0;
  background: rgba(255,243,232,0.45);
}

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

.cta-inner h2 {
  font-size: 1.3rem;
  margin-bottom: 24px;
}

.store-badge-placeholder {
  display: inline-block;
  cursor: default;
  border-radius: 8px;
  opacity: 0.8;
}

/* ── Footer ── */
footer {
  scroll-snap-align: start;
  text-align: center;
  padding: 28px 24px;
  border-top: 1px solid var(--divider);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
}

/* ── Animations ── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.hero-inner { animation: fadeInUp 0.5s ease-out; }

/* ── Responsive ── */
@media (max-width: 600px) {
  .hero { padding: 40px 0 36px; min-height: 100vh; min-height: 100dvh; }
  h1 { font-size: 1.65rem; }
  .tagline { font-size: 1rem; }

  .archetype-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .archetype-card { padding: 8px 6px; }
  .archetype-card img { border-radius: 8px; margin-bottom: 6px; }
  .archetype-name { font-size: 11px; }
  .archetype-code { font-size: 10px; margin-top: 2px; }
  .section h2 { font-size: 1.15rem; margin-bottom: 12px; }
  .section-label { font-size: 11px; margin-bottom: 4px; }
  .archetype-hint { font-size: 12px; margin-top: 8px; }

  .feature-card { padding: 14px; gap: 12px; }
  .feature-content h3 { font-size: 14px; }
  .feature-content p { font-size: 13px; }

  .hero-store-buttons {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 2;
  }

  .hero-store-buttons .app-store-badge {
    height: 36px;
  }
}

/* Hide last feature card when viewport is too short */
@media (max-height: 700px) {
  .feature-card:nth-child(4) {
    display: none;
  }
}
