/* ============ RESET & VARIABLES ============ */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --terracotta: #E07A5F;
  --terracotta-light: #F2A391;
  --gold: #C9A87C;
  --sienna: #B08968;
  --charcoal: #2D2A26;
  --cream: #FDF8F3;
  --warm-gray: #9B9489;
  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'DM Sans', Arial, sans-serif;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  background-color: var(--charcoal);
  color: var(--cream);
  line-height: 1.6;
  overflow-x: hidden;
}

a {
  color: var(--terracotta-light);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--terracotta);
}

/* ============ LAYOUT ============ */
.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 max(24px, env(safe-area-inset-left));
  padding-right: max(24px, env(safe-area-inset-right));
}

.section {
  padding: 100px 0;
}

@media (max-width: 640px) {
  .section {
    padding: 72px 0;
  }
}

.section-heading {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  text-align: center;
  margin-bottom: 48px;
  line-height: 1.3;
}

/* ============ HERO ============ */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, var(--charcoal) 0%, #3a2a24 40%, var(--charcoal) 100%);
  animation: gradientPulse 8s ease-in-out infinite alternate;
  z-index: 0;
}

@keyframes gradientPulse {
  0% {
    background: linear-gradient(160deg, var(--charcoal) 0%, #3a2a24 40%, var(--charcoal) 100%);
  }
  100% {
    background: linear-gradient(160deg, var(--charcoal) 0%, #2a1f1a 50%, #3a2a24 100%);
  }
}

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

.hero-logo {
  display: block;
  margin: 0 auto 16px;
  width: clamp(220px, 50vw, 320px);
  height: auto;
}

.logo {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(3rem, 10vw, 6rem);
  letter-spacing: -0.02em;
  color: var(--cream);
  margin-bottom: 16px;
}

.tagline {
  font-family: var(--font-display);
  font-weight: 300;
  font-style: italic;
  font-size: clamp(1.125rem, 3vw, 1.5rem);
  color: var(--warm-gray);
  margin-bottom: 48px;
}

.cta-button {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 1rem;
  color: var(--cream);
  background-color: var(--terracotta);
  padding: 16px 40px;
  border-radius: 40px;
  border: none;
  cursor: pointer;
  transition: background-color 0.3s, transform 0.2s;
  text-decoration: none;
  min-height: 48px;
  -webkit-tap-highlight-color: transparent;
}

.cta-button:hover {
  background-color: var(--terracotta-light);
  color: var(--charcoal);
  transform: translateY(-2px);
}

/* ============ STORY ============ */
.story {
  background-color: var(--charcoal);
}

.story-hook {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  text-align: center;
  color: var(--terracotta-light);
  margin-bottom: 40px;
  line-height: 1.3;
}

.story-body {
  max-width: 640px;
  margin: 0 auto;
  text-align: center;
}

.story-body p {
  font-size: clamp(1rem, 2vw, 1.125rem);
  color: var(--warm-gray);
  margin-bottom: 24px;
  line-height: 1.8;
}

.story-body p:last-child {
  margin-bottom: 0;
}

/* ============ IDEA ============ */
.idea {
  background-color: #1e1b18;
}

.steps {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 16px;
}

@media (max-width: 640px) {
  .steps {
    flex-direction: column;
    align-items: center;
    gap: 32px;
  }

  .step-connector {
    display: none;
  }
}

.step {
  text-align: center;
  flex: 0 0 180px;
}

.step-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  color: var(--terracotta);
}

.step-icon svg {
  width: 100%;
  height: 100%;
}

.step-label {
  display: block;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.25rem;
  margin-bottom: 8px;
  color: var(--cream);
}

.step-desc {
  font-size: 0.9rem;
  color: var(--warm-gray);
}

.step-connector {
  color: var(--warm-gray);
  font-size: 1.5rem;
  padding-top: 24px;
  opacity: 0.4;
}

/* ============ STORIES ============ */
.stories {
  background-color: var(--charcoal);
}

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

@media (max-width: 768px) {
  .story-grid {
    grid-template-columns: 1fr;
    max-width: 480px;
    margin: 0 auto;
  }
}

.story-card {
  background: linear-gradient(160deg, #1e1b18 0%, #2a2520 60%, #32261f 100%);
  border-radius: 16px;
  border: 1px solid rgba(253, 248, 243, 0.06);
  padding: 36px 28px 32px;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.4s, transform 0.3s, box-shadow 0.4s, background 0.4s;
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-family: var(--font-body);
  color: var(--cream);
  -webkit-tap-highlight-color: transparent;
  min-height: 48px;
  position: relative;
  overflow: hidden;
}

.story-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--terracotta), var(--gold));
  opacity: 0;
  transition: opacity 0.3s;
}

.story-card:hover::before {
  opacity: 1;
}

.story-card:hover {
  border-color: rgba(224, 122, 95, 0.3);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(224, 122, 95, 0.12), 0 4px 12px rgba(0, 0, 0, 0.3);
  background: linear-gradient(160deg, #231e1a 0%, #2e2520 60%, #382a22 100%);
}

.story-card-number {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 0.8rem;
  color: var(--terracotta);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.story-card-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.35rem;
  color: var(--cream);
  margin: 0;
  line-height: 1.3;
}

.story-card-teaser {
  font-size: 0.95rem;
  color: var(--warm-gray);
  line-height: 1.7;
  margin: 0;
  flex: 1;
}

.story-card-cta {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--terracotta-light);
  transition: color 0.2s, letter-spacing 0.3s;
  letter-spacing: 0;
}

.story-card:hover .story-card-cta {
  color: var(--terracotta);
  letter-spacing: 0.05em;
}

/* ============ STORY OVERLAY ============ */
.story-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 24px;
}

.story-overlay.active {
  opacity: 1;
  visibility: visible;
}

.story-overlay-content {
  background: linear-gradient(180deg, #1e1b18 0%, #231f1b 100%);
  border: 1px solid rgba(253, 248, 243, 0.08);
  border-radius: 16px;
  max-width: 600px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  padding: 48px 40px;
  position: relative;
  transform: translateY(20px);
  transition: transform 0.3s ease;
  -webkit-overflow-scrolling: touch;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
}

.story-overlay.active .story-overlay-content {
  transform: translateY(0);
}

@media (max-width: 640px) {
  .story-overlay {
    padding: 0;
    align-items: flex-end;
  }

  .story-overlay-content {
    max-height: 90vh;
    border-radius: 16px 16px 0 0;
    padding: 36px 24px;
    padding-bottom: max(36px, env(safe-area-inset-bottom));
    transform: translateY(100%);
  }

  .story-overlay.active .story-overlay-content {
    transform: translateY(0);
  }
}

.story-overlay-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  color: var(--warm-gray);
  font-size: 1.75rem;
  cursor: pointer;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: color 0.2s, background-color 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.story-overlay-close:hover {
  color: var(--cream);
  background-color: rgba(253, 248, 243, 0.06);
}

.story-overlay-number {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 0.85rem;
  color: var(--terracotta);
  letter-spacing: 0.05em;
  display: block;
  margin-bottom: 8px;
}

.story-overlay-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.5rem;
  color: var(--cream);
  margin: 0 0 24px;
}

.story-overlay-body p {
  font-size: 1.05rem;
  color: var(--warm-gray);
  line-height: 1.85;
  margin-bottom: 20px;
}

.story-overlay-body p:last-child {
  margin-bottom: 0;
}

/* Pull-quote style for testimonial quotes */
.story-overlay-body .story-overlay-quote {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.1rem;
  color: var(--cream);
  line-height: 1.8;
  border-left: 3px solid var(--terracotta);
  padding-left: 20px;
  margin: 20px 0;
}

.story-overlay-label {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.125rem;
  color: var(--cream) !important;
  margin-bottom: 8px !important;
  letter-spacing: -0.01em;
}

.story-overlay-attribution {
  font-style: italic;
  font-size: 0.9rem !important;
  color: var(--terracotta-light) !important;
  margin-bottom: 0 !important;
  margin-top: 8px !important;
}

.story-overlay-divider {
  border: none;
  border-top: 1px solid rgba(253, 248, 243, 0.08);
  margin: 32px 0;
}

/* Highlight last line of story overlays */
.story-overlay-body .story-overlay-closer {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.15rem;
  color: var(--cream);
  line-height: 1.6;
  margin-top: 28px;
}

/* ============ TRUST ============ */
.trust {
  background-color: #1e1b18;
}

.trust-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

@media (max-width: 768px) {
  .trust-cards {
    grid-template-columns: 1fr;
  }
}

.trust-card {
  padding: 32px;
  background: rgba(253, 248, 243, 0.03);
  border-radius: 12px;
  border: 1px solid rgba(253, 248, 243, 0.06);
}

.trust-card h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.125rem;
  margin-bottom: 12px;
  color: var(--cream);
}

.trust-card p {
  font-size: 0.9rem;
  color: var(--warm-gray);
  line-height: 1.7;
}

/* ============ WAITLIST ============ */
.waitlist {
  background-color: var(--charcoal);
  text-align: center;
}

.waitlist-sub {
  font-size: 1rem;
  color: var(--warm-gray);
  margin-bottom: 32px;
}

.waitlist-form {
  max-width: 480px;
  margin: 0 auto;
}

.form-row {
  display: flex;
  gap: 12px;
}

@media (max-width: 480px) {
  .form-row {
    flex-direction: column;
  }
}

#email-input {
  flex: 1;
  padding: 14px 20px;
  font-family: var(--font-body);
  font-size: 16px; /* prevents iOS zoom on focus */
  background: rgba(253, 248, 243, 0.06);
  border: 1px solid rgba(253, 248, 243, 0.15);
  border-radius: 40px;
  color: var(--cream);
  outline: none;
  transition: border-color 0.3s;
  min-height: 48px;
  -webkit-appearance: none;
}

#email-input::placeholder {
  color: var(--warm-gray);
}

#email-input:focus {
  border-color: var(--terracotta);
}

#submit-btn {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1rem;
  color: var(--cream);
  background-color: var(--terracotta);
  padding: 14px 32px;
  border-radius: 40px;
  border: none;
  cursor: pointer;
  transition: background-color 0.3s, transform 0.2s;
  white-space: nowrap;
  min-height: 48px;
  -webkit-tap-highlight-color: transparent;
}

#submit-btn:hover {
  background-color: var(--terracotta-light);
  color: var(--charcoal);
}

#submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.form-message {
  margin-top: 16px;
  font-size: 0.9rem;
  min-height: 1.4em;
}

.form-message.success {
  color: var(--gold);
}

.form-message.error {
  color: var(--terracotta-light);
}

/* ============ DOWNLOAD / GET THE APP ============ */
.download {
  background-color: #1e1b18;
  text-align: center;
}

.download-sub {
  font-size: 1rem;
  color: var(--warm-gray);
  margin-bottom: 32px;
}

.download-badges {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.store-badge {
  display: inline-block;
  color: var(--cream);
  transition: opacity 0.3s, transform 0.2s;
  min-height: 44px;
}

.store-badge svg {
  height: 44px;
  width: auto;
}

.store-badge:hover {
  color: var(--cream);
  transform: translateY(-2px);
}

.store-badge--disabled {
  pointer-events: none;
  opacity: 0.4;
}

@media (max-width: 480px) {
  .download-badges {
    flex-direction: column;
    align-items: center;
  }

  .store-badge svg {
    height: 48px;
  }
}

/* ============ FOOTER ============ */
.footer {
  padding: 48px 0;
  padding-bottom: max(48px, env(safe-area-inset-bottom));
  text-align: center;
  border-top: 1px solid rgba(253, 248, 243, 0.06);
}

.footer-icon {
  display: block;
  margin: 0 auto 12px;
  width: 40px;
  height: 40px;
}

.footer-logo {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 1.5rem;
  color: var(--cream);
  display: block;
  margin-bottom: 16px;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 16px;
}

.footer-links a {
  font-size: 0.85rem;
  color: var(--warm-gray);
  padding: 8px 4px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

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

.footer-tagline {
  font-size: 0.8rem;
  color: var(--warm-gray);
  opacity: 0.6;
}

/* ============ ANIMATIONS ============ */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}
