/* ========================================
   AffirmMe Landing Page Styles
   ======================================== */

/* ========== CSS Custom Properties ========== */
:root {
  /* Colors - from Theme.swift */
  --bg-primary: #FFFDF7;
  --bg-secondary: #FBF8F1;
  --bg-tertiary: #F5F1E8;
  
  --text-primary: #1A1612;
  --text-secondary: #5C5347;
  --text-tertiary: #8A8279;
  
  --accent-light: #E8DCC8;
  --accent-medium: #C9B896;
  --accent-dark: #A69573;
  
  --gold-light: #F5E6C8;
  --gold-medium: #D4AF37;
  --gold-dark: #B8962E;
  
  /* Typography */
  --font-serif: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  
  /* Spacing */
  --section-padding: 6rem 0;
  --container-max: 1200px;
  --container-padding: 1.5rem;
  
  /* Transitions */
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.5s ease;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(26, 22, 18, 0.05);
  --shadow-md: 0 4px 6px rgba(26, 22, 18, 0.07);
  --shadow-lg: 0 10px 25px rgba(26, 22, 18, 0.1);
  --shadow-xl: 0 20px 40px rgba(26, 22, 18, 0.12);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  scroll-padding-top: 80px;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Selection styling */
::selection {
  background: var(--accent-light);
  color: var(--text-primary);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  text-decoration: none;
  color: inherit;
  transition: color var(--transition-fast);
}

/* ========== Typography ========== */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: 1.2;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.5rem, 6vw, 4rem);
}

h2 {
  font-size: clamp(2rem, 4vw, 3rem);
}

h3 {
  font-size: clamp(1.5rem, 3vw, 2rem);
}

p {
  color: var(--text-secondary);
  line-height: 1.75;
  letter-spacing: 0.01em;
}

.text-lg {
  font-size: 1.125rem;
}

/* Subtitle styling */
.section__subtitle {
  font-family: var(--font-serif);
  font-size: clamp(1.1rem, 2.5vw, 1.35rem);
  font-weight: 500;
  color: var(--text-secondary);
  line-height: 1.6;
  letter-spacing: 0.01em;
  max-width: 600px;
  margin: 0 auto;
}

/* Overline label styling */
.overline {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-dark);
  background: var(--accent-light);
  padding: 0.35rem 0.85rem;
  border-radius: 2rem;
  margin-bottom: 1rem;
}

/* ========== Layout ========== */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-padding);
}

.section {
  padding: var(--section-padding);
}

.section--alt {
  background-color: var(--bg-secondary);
}

/* ========== Header / Navigation ========== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(255, 253, 247, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid transparent;
  transition: all var(--transition-normal);
}

.header--scrolled {
  background: rgba(255, 253, 247, 0.98);
  border-bottom: 1px solid var(--accent-light);
  box-shadow: 0 4px 30px rgba(26, 22, 18, 0.04);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.nav__logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
}

.nav__logo-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav__link {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  position: relative;
  padding: 0.5rem 0;
}

.nav__link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent-dark);
  transition: width var(--transition-normal);
}

.nav__link:hover {
  color: var(--text-primary);
}

.nav__link:hover::after {
  width: 100%;
}

.nav__cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  background: var(--text-primary);
  color: var(--bg-primary);
  border-radius: 50px;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all var(--transition-fast);
}

.nav__cta:hover {
  background: var(--text-secondary);
  transform: translateY(-1px);
}

.nav__cta .btn__icon {
  width: 16px;
  height: 16px;
}

.nav__toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.nav__toggle span {
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  transition: all var(--transition-fast);
}

/* ========== Hero Section ========== */
.hero {
  padding-top: 140px;
  padding-bottom: 6rem;
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
}

/* Subtle gradient overlay */
.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(ellipse at 30% 20%, rgba(232, 220, 200, 0.3) 0%, transparent 50%),
              radial-gradient(ellipse at 70% 80%, rgba(245, 230, 200, 0.2) 0%, transparent 40%);
  pointer-events: none;
  z-index: 0;
}

.hero > * {
  position: relative;
  z-index: 1;
}

.hero__container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.hero__content {
  max-width: 700px;
}

.hero__title {
  margin-bottom: 1.5rem;
  font-size: clamp(2.8rem, 6vw, 4.5rem);
  line-height: 1.1;
}

.hero__title-main {
  display: block;
  font-size: clamp(2.8rem, 6vw, 4.5rem);
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.hero__title-sub {
  display: block;
  font-size: clamp(2.8rem, 6vw, 4.5rem);
  font-weight: 600;
  color: var(--accent-dark);
}

.hero__subtitle {
  font-family: var(--font-serif);
  font-size: clamp(1.1rem, 2vw, 1.25rem);
  color: var(--text-secondary);
  margin-bottom: 2rem;
  line-height: 1.6;
}

.hero__mockup {
  position: relative;
}

.hero__mockup img {
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
  filter: drop-shadow(var(--shadow-xl));
}

/* Store Buttons */
.store-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2rem;
}

.store-buttons--centered {
  justify-content: center;
}

.store-badge {
  height: 58px;
  width: auto;
  transition: all var(--transition-normal);
  filter: drop-shadow(0 4px 15px rgba(0, 0, 0, 0.1));
}

.store-badge:hover {
  transform: translateY(-3px) scale(1.02);
  filter: drop-shadow(0 8px 25px rgba(0, 0, 0, 0.15));
}

/* ========== How It Works Section ========== */
.how-it-works {
  text-align: center;
}

.how-it-works__header {
  margin-bottom: 4rem;
}

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

.step {
  text-align: center;
  padding: 2.5rem 2rem;
  border-radius: 20px;
  transition: all var(--transition-normal);
  opacity: 0;
  transform: translateY(30px);
}

.step.animate-fade-in-up {
  opacity: 1;
  transform: translateY(0);
}

.step:hover {
  background: rgba(255, 255, 255, 0.5);
  transform: translateY(-5px);
}

.step__number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 70px;
  height: 70px;
  background: linear-gradient(135deg, var(--gold-light) 0%, var(--accent-light) 100%);
  color: var(--gold-dark);
  border-radius: 50%;
  font-family: var(--font-serif);
  font-size: 1.75rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  box-shadow: 0 8px 25px rgba(212, 175, 55, 0.15);
  transition: all var(--transition-normal);
}

.step:hover .step__number {
  transform: scale(1.1);
  box-shadow: 0 12px 35px rgba(212, 175, 55, 0.25);
}

.step__title {
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
}

.step__desc {
  font-size: 0.9375rem;
  color: var(--text-tertiary);
  line-height: 1.7;
}

/* ========== Features Section ========== */
.features {
  text-align: center;
}

.features__header {
  margin-bottom: 4rem;
}

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

.feature-card {
  background: var(--bg-primary);
  border: 1px solid var(--accent-light);
  border-radius: 20px;
  padding: 2.25rem;
  text-align: left;
  transition: all var(--transition-normal);
  opacity: 0;
  transform: translateY(30px);
  position: relative;
  overflow: hidden;
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--gold-light), var(--gold-medium), var(--accent-dark));
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.feature-card.animate-fade-in-up {
  opacity: 1;
  transform: translateY(0);
}

.feature-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 50px rgba(26, 22, 18, 0.12);
  border-color: var(--accent-medium);
}

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

.feature-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  background: var(--gold-light);
  border-radius: 12px;
  margin-bottom: 1.25rem;
  font-size: 1.5rem;
}

.feature-card__title {
  font-size: 1.125rem;
  margin-bottom: 0.5rem;
}

.feature-card__desc {
  font-size: 0.875rem;
  color: var(--text-tertiary);
  line-height: 1.6;
}

/* ========== Science/Benefits Section ========== */
.benefits {
  background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
}

.benefits__container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.benefits__content {
  max-width: 500px;
}

.benefits__title {
  margin-bottom: 1.5rem;
}

.benefits__list {
  list-style: none;
  margin-top: 2rem;
}

.benefits__item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.benefits__check {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  background: var(--gold-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold-dark);
  font-size: 0.875rem;
}

.benefits__mockup img {
  width: 100%;
  max-width: 450px;
  margin: 0 auto;
  filter: drop-shadow(var(--shadow-xl));
}

/* ========== Testimonials Section ========== */
.testimonials {
  text-align: center;
}

.testimonials__header {
  margin-bottom: 4rem;
}

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

.testimonial-card {
  background: var(--bg-primary);
  border: 1px solid var(--accent-light);
  border-radius: 20px;
  padding: 2.25rem;
  text-align: left;
  transition: all var(--transition-normal);
  opacity: 0;
  transform: translateY(30px);
}

.testimonial-card.animate-fade-in-up {
  opacity: 1;
  transform: translateY(0);
}

.testimonial-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.testimonial-card__stars {
  color: var(--gold-medium);
  font-size: 1rem;
  margin-bottom: 1rem;
  letter-spacing: 0.1em;
}

.testimonial-card__text {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 1.5rem;
  font-style: italic;
}

.testimonial-card__author {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.testimonial-card__avatar {
  width: 40px;
  height: 40px;
  background: var(--accent-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-weight: 600;
  color: var(--accent-dark);
}

.testimonial-card__name {
  font-weight: 600;
  font-size: 0.875rem;
}

.testimonial-card__handle {
  font-size: 0.75rem;
  color: var(--text-tertiary);
}

/* ========== CTA Section ========== */
.cta {
  text-align: center;
  background: linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
  position: relative;
  overflow: hidden;
}

.cta::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(ellipse at center, rgba(212, 175, 55, 0.05) 0%, transparent 50%);
  animation: pulse 8s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 0.5; }
  50% { transform: scale(1.1); opacity: 1; }
}

.cta__content {
  max-width: 650px;
  margin: 0 auto;
  text-align: center;
  position: relative;
  z-index: 1;
}

.cta__title {
  margin-bottom: 1rem;
}

.cta__content .store-buttons {
  justify-content: center;
}

/* ========== Footer ========== */
.footer {
  background: linear-gradient(180deg, #1A1612 0%, #0f0d0a 100%);
  color: var(--bg-primary);
  padding: 5rem 0 2rem;
  position: relative;
}

.footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-dark), transparent);
}

.footer__content {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer__brand {
  max-width: 300px;
}

.footer__logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--bg-primary);
  margin-bottom: 1rem;
}

.footer__logo-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
}

.footer__tagline {
  font-size: 0.875rem;
  color: var(--text-tertiary);
  line-height: 1.6;
  opacity: 0.8;
}

.footer__section-title {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-medium);
  margin-bottom: 1.25rem;
}

.footer__links {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer__link {
  font-size: 0.875rem;
  color: var(--bg-tertiary);
  opacity: 0.7;
  transition: all var(--transition-fast);
  position: relative;
}

.footer__link:hover {
  opacity: 1;
  color: var(--gold-light);
  transform: translateX(3px);
}

.footer__bottom {
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
}

.footer__copyright {
  font-size: 0.8125rem;
  color: var(--text-tertiary);
  opacity: 0.6;
}

/* ========== Legal Pages ========== */
.legal {
  padding-top: 120px;
}

.legal__content {
  max-width: 800px;
  margin: 0 auto;
  background: var(--bg-primary);
  border: 1px solid var(--accent-light);
  border-radius: 16px;
  padding: 2rem 1.5rem;
}

@media (min-width: 768px) {
  .legal__content {
    padding: 4rem 4rem;
  }
}

@media (min-width: 1024px) {
  .legal__content {
    padding: 4rem 5rem;
  }
}

.legal__title {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  border-bottom: none;
}

.legal__updated {
  font-size: 0.875rem;
  color: var(--text-tertiary);
  margin-bottom: 2rem;
}

.legal__section {
  margin-bottom: 2rem;
}

.legal__section h2 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.legal__section h3 {
  font-size: 1.1rem;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

.legal__section p {
  margin-bottom: 1rem;
  font-size: 0.9375rem;
  line-height: 1.7;
}

.legal__section ul,
.legal__section ol {
  margin-left: 1.5rem;
  margin-bottom: 1rem;
}

.legal__section li {
  margin-bottom: 0.5rem;
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.legal__section a {
  color: var(--accent-dark);
  text-decoration: underline;
}

.legal__section a:hover {
  color: var(--gold-dark);
}

/* Legal placeholder */
.legal__placeholder {
  background: var(--bg-secondary);
  border: 2px dashed var(--accent-light);
  border-radius: 12px;
  padding: 3rem 2rem;
  text-align: center;
}

.legal__placeholder p {
  color: var(--text-tertiary);
  font-style: italic;
}

/* ========== Responsive Design ========== */
@media (max-width: 1024px) {
  .hero__container {
    grid-template-columns: 1fr;
    text-align: center;
  }
  
  .hero__content {
    max-width: 100%;
  }
  
  .hero__mockup {
    order: -1;
  }
  
  .hero__mockup img {
    max-width: 350px;
  }
  
  .store-buttons {
    justify-content: center;
  }
  
  .steps {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .features__grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .benefits__container {
    grid-template-columns: 1fr;
    text-align: center;
  }
  
  .benefits__content {
    max-width: 100%;
  }
  
  .benefits__mockup {
    order: -1;
  }
  
  .testimonials__grid {
    grid-template-columns: 1fr;
  }
  
  .footer__content {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }
}

@media (max-width: 768px) {
  :root {
    --section-padding: 4rem 0;
  }
  
  .nav__links {
    display: none;
  }
  
  .nav__toggle {
    display: flex;
  }
  
  .hero {
    padding-top: 100px;
    min-height: auto;
  }
  
  .hero__title {
    font-size: clamp(2rem, 8vw, 3rem);
  }
  
  .hero__title-main,
  .hero__title-sub {
    font-size: clamp(2rem, 8vw, 3rem);
  }
  
  .features__grid {
    grid-template-columns: 1fr;
  }
  
  .footer__content {
    grid-template-columns: 1fr;
    text-align: center;
  }
  
  .footer__brand {
    max-width: 100%;
  }
  
  .footer__links {
    align-items: center;
  }
  
  .store-badge {
    height: 48px;
  }
}

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

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.animate-fade-in-up {
  animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Staggered animation delays */
.step:nth-child(1), .feature-card:nth-child(1), .testimonial-card:nth-child(1) { transition-delay: 0s; }
.step:nth-child(2), .feature-card:nth-child(2), .testimonial-card:nth-child(2) { transition-delay: 0.1s; }
.step:nth-child(3), .feature-card:nth-child(3), .testimonial-card:nth-child(3) { transition-delay: 0.2s; }
.feature-card:nth-child(4) { transition-delay: 0.3s; }
.feature-card:nth-child(5) { transition-delay: 0.4s; }
.feature-card:nth-child(6) { transition-delay: 0.5s; }

/* Hero entrance animations */
.hero__title-main {
  animation: slideInLeft 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.hero__title-sub {
  animation: slideInLeft 1s cubic-bezier(0.16, 1, 0.3, 1) 0.15s forwards;
  opacity: 0;
}

.hero .store-buttons {
  animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.4s forwards;
  opacity: 0;
}

.hero__mockup {
  animation: slideInRight 1s cubic-bezier(0.16, 1, 0.3, 1) 0.3s forwards;
  opacity: 0;
}

/* Section header animations */
.how-it-works__header,
.features__header,
.testimonials__header,
.cta__content {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.how-it-works__header.section--visible,
.features__header.section--visible,
.testimonials__header.section--visible,
.cta__content.section--visible {
  opacity: 1;
  transform: translateY(0);
}

/* Benefits section enhancements */
.benefits__item {
  opacity: 0;
  transform: translateX(-20px);
  transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.benefits__item.animate-fade-in-up {
  opacity: 1;
  transform: translateX(0);
}

.benefits__item:nth-child(1) { transition-delay: 0s; }
.benefits__item:nth-child(2) { transition-delay: 0.1s; }
.benefits__item:nth-child(3) { transition-delay: 0.2s; }
.benefits__item:nth-child(4) { transition-delay: 0.3s; }

/* Loading state */
body:not(.loaded) .hero__title-main,
body:not(.loaded) .hero__title-sub,
body:not(.loaded) .hero .store-buttons,
body:not(.loaded) .hero__mockup {
  animation-play-state: paused;
}

/* ========== Utility Classes ========== */
.text-center {
  text-align: center;
}

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
