/**
 * HOMEPAGE STYLES - Phase 2
 * Three-layer system applied to homepage components
 */

/* ============================================
   HERO SECTION - All Three Layers
   ============================================ */
.hero {
  position: relative;
  min-height: 80vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding: var(--space-4xl) 0;
}

.hero__background {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 0;

  /* Layer 2: Aspirational background image */
  background-image: url('/images/hero-homestead.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;

  /* Fallback gradient if image not loaded */
  background-color: var(--color-ceramic-cream);
  background-image: linear-gradient(
    135deg,
    var(--color-ceramic-cream) 0%,
    var(--color-wheat-linen) 50%,
    var(--color-sage-green) 100%
  );

  /* Subtle overlay for text readability */
}

.hero__background::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.85) 0%,
    rgba(247, 245, 240, 0.7) 100%
  );
}

.hero__content {
  position: relative;
  z-index: 1;
  width: 100%;
}

.hero__inner {
  max-width: 800px;
}

/* Layer 3: Mythic badge */
.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-lg);
  background: rgba(27, 56, 40, 0.1); /* Deep Cedar with transparency */
  border-radius: var(--radius-full);
  margin-bottom: var(--space-xl);
  font-family: var(--font-mythic);
  font-size: var(--text-small);
  letter-spacing: 0.05em;
  color: var(--color-deep-cedar);
  backdrop-filter: blur(8px);
}

.hero__badge-icon {
  font-size: 1.25rem;
}

/* Layer 1: Pragmatic headline */
.hero__headline {
  font-family: var(--font-sans);
  font-size: var(--text-hero);
  font-weight: var(--font-weight-bold);
  color: var(--color-graphite);
  line-height: var(--line-height-tight);
  margin-bottom: var(--space-lg);
}

.hero__highlight {
  color: var(--color-sage-green);
  position: relative;

  /* Subtle underline effect */
}

.hero__highlight::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 4px;
  background: var(--color-mustard-gold);
  opacity: 0.3;
}

/* Layer 2: Aspirational subhead */
.hero__subhead {
  font-family: var(--font-body);
  font-size: var(--text-body-lg);
  line-height: var(--line-height-relaxed);
  color: var(--color-text-primary);
  margin-bottom: var(--space-md);
  max-width: 700px;
}

.hero__disclaimer {
  font-family: var(--font-body);
  font-size: var(--text-small);
  line-height: var(--line-height-relaxed);
  color: var(--color-text-secondary);
  font-style: italic;
  margin: 0 0 var(--space-2xl);
  max-width: 700px;
}

/* Layer 1: CTAs */
.hero__actions {
  display: flex;
  gap: var(--space-lg);
  margin-bottom: var(--space-3xl);
  flex-wrap: wrap;
}

.btn-lg {
  padding: var(--space-lg) var(--space-2xl);
  font-size: var(--text-body-lg);
}

.btn-arrow {
  margin-left: var(--space-sm);
  transition: transform var(--transition-base);
}

.btn:hover .btn-arrow {
  transform: translateX(4px);
}

/* Secondary hero links: deliberately quieter than the one primary CTA */
.hero__secondary {
  font-family: var(--font-sans);
  font-size: var(--text-small);
  color: var(--color-text-secondary);
  margin: calc(-1 * var(--space-2xl)) 0 var(--space-3xl);
}

.hero__secondary a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Layer 1: Trust metrics */
.hero__metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--space-xl);
  padding: var(--space-xl);
  background: rgba(255, 255, 255, 0.6);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(12px);
  border: var(--border-width-thin) solid rgba(168, 184, 154, 0.2);
}

.metric {
  text-align: center;
}

.metric__value {
  font-family: var(--font-mono);
  font-size: var(--text-h2);
  font-weight: var(--font-weight-bold);
  color: var(--color-sky-blue);
  line-height: 1;
  margin-bottom: var(--space-sm);
}

.metric__label {
  font-family: var(--font-sans);
  font-size: var(--text-small);
  color: var(--color-text-secondary);
  line-height: var(--line-height-normal);
}

/* Responsive hero */
@media (max-width: 768px) {
  .hero {
    min-height: 70vh;
    padding: var(--space-3xl) 0;
  }

  .hero__actions {
    flex-direction: column;
  }

  .btn-lg {
    width: 100%;
    text-align: center;
  }

  .hero__metrics {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }
}

/* ============================================
   VALUE PROPS SECTION
   ============================================ */
.value-props {
  padding: var(--space-4xl) 0;
  background: var(--color-background-primary);
}

.section-intro {
  text-align: center;
  margin-bottom: var(--space-3xl);
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.section-title {
  font-family: var(--font-serif);
  font-size: var(--text-h2);
  color: var(--color-deep-cedar);
  margin-bottom: var(--space-md);
}

.section-description {
  font-family: var(--font-body);
  font-size: var(--text-body-lg);
  color: var(--color-text-secondary);
  line-height: var(--line-height-relaxed);
}

.value-props__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-2xl);
  margin-top: var(--space-3xl);
}

.value-prop {
  padding: var(--space-2xl);
  border-radius: var(--radius-lg);
  transition: all var(--transition-base);
  border: var(--border-width-thin) solid transparent;
}

.value-prop:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

/* Layer-specific value prop styling */
.value-prop--layer-1 {
  background: linear-gradient(135deg, var(--color-soft-white) 0%, #FFFFFF 100%);
  border-color: var(--color-sky-blue);
}

.value-prop--layer-1:hover {
  border-color: var(--color-sky-blue);
  background: linear-gradient(135deg, #FFFFFF 0%, var(--color-soft-white) 100%);
}

.value-prop--layer-2 {
  background: linear-gradient(135deg, var(--color-ceramic-cream) 0%, var(--color-wheat-linen) 100%);
  border-color: var(--color-sage-green);
}

.value-prop--layer-2:hover {
  border-color: var(--color-sage-green);
  background: linear-gradient(135deg, var(--color-wheat-linen) 0%, var(--color-ceramic-cream) 100%);
}

.value-prop__icon {
  font-size: 3rem;
  margin-bottom: var(--space-lg);
  display: block;
}

.icon-large {
  display: inline-block;
}

.value-prop__title {
  font-family: var(--font-sans);
  font-size: var(--text-h3);
  font-weight: var(--font-weight-semibold);
  color: var(--color-graphite);
  margin-bottom: var(--space-md);
}

.value-prop__description {
  font-family: var(--font-body);
  font-size: var(--text-body);
  line-height: var(--line-height-relaxed);
  color: var(--color-text-primary);
  margin-bottom: var(--space-lg);
}

.value-prop__link {
  font-family: var(--font-sans);
  font-size: var(--text-body);
  font-weight: var(--font-weight-medium);
  color: var(--color-sage-green);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  transition: all var(--transition-base);
}

.value-prop__link:hover {
  color: var(--color-mustard-gold);
  gap: var(--space-md);
}

/* ============================================
   PRODUCT SECTION & GRID
   ============================================ */
.product-section {
  padding: var(--space-3xl) 0;
  border-top: var(--border-width-thin) solid var(--color-border-light);
}

.section-header {
  margin-bottom: var(--space-2xl);
  text-align: center;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-2xl);
}

/* Product card styling (enhanced from base) */
.product-card {
  background: var(--color-background-primary);
  border: var(--border-width-thin) solid var(--color-border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition-base);
  display: flex;
  flex-direction: column;
}

.product-card:hover {
  border-color: var(--color-sage-green);
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}

.product-card a {
  color: inherit;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.product-card img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  background: var(--color-ceramic-cream);
}

.product-card h3 {
  font-family: var(--font-serif);
  font-size: var(--text-h4);
  color: var(--color-deep-cedar);
  margin: var(--space-lg);
  margin-bottom: var(--space-sm);
}

.product-card > a > p {
  font-family: var(--font-body);
  font-size: var(--text-body);
  color: var(--color-text-secondary);
  line-height: var(--line-height-relaxed);
  margin: 0 var(--space-lg);
  margin-bottom: var(--space-md);
  flex: 1;
}

.product-card ul {
  list-style: none;
  padding: 0;
  margin: 0 var(--space-lg) var(--space-md);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.product-card li {
  font-size: var(--text-xs);
  padding: var(--space-xs) var(--space-md);
  background: var(--color-sky-blue);
  color: white;
  border-radius: var(--radius-full);
  font-weight: var(--font-weight-medium);
  margin: 0;
}

.product-card > a > p:last-of-type {
  margin: 0 var(--space-lg) var(--space-lg);
  padding-top: var(--space-md);
  border-top: var(--border-width-thin) solid var(--color-border-light);
  font-family: var(--font-sans);
  font-size: var(--text-body);
  font-weight: var(--font-weight-semibold);
  color: var(--color-sage-green);
}

.empty-state {
  text-align: center;
  padding: var(--space-4xl) var(--space-lg);
}

/* ============================================
   FEATURED PRODUCTS (No Profile State)
   ============================================ */
.featured-products {
  padding: var(--space-4xl) 0;
  background: var(--color-background-secondary);
}

.featured-products .section-intro {
  text-align: center;
  margin-bottom: var(--space-2xl);
}

.featured-products .section-title {
  font-family: var(--font-serif);
  font-size: var(--text-h2);
  color: var(--color-deep-cedar);
  margin-bottom: var(--space-md);
}

.featured-products .section-description {
  font-family: var(--font-body);
  font-size: var(--text-body-lg);
  color: var(--color-text-secondary);
  max-width: 700px;
  margin: 0 auto;
  line-height: var(--line-height-relaxed);
}

.featured-products .section-actions {
  text-align: center;
  margin-top: var(--space-2xl);
}

.featured-products .product-link {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.featured-products .product-image {
  width: 100%;
  height: 220px;
  background: var(--color-ceramic-cream);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.featured-products .product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.featured-products .product-placeholder {
  font-size: 3rem;
  color: var(--color-border-medium);
}

.featured-products .product-content {
  padding: var(--space-lg);
  flex: 1;
  display: flex;
  flex-direction: column;
}

.featured-products .product-title {
  font-family: var(--font-serif);
  font-size: var(--text-h4);
  color: var(--color-deep-cedar);
  margin: 0 0 var(--space-md) 0;
  line-height: 1.4;
}

.featured-products .product-price {
  font-size: var(--text-h5);
  font-weight: var(--font-weight-bold);
  color: var(--color-sage-green);
  margin-bottom: var(--space-md);
}

.featured-products .product-cta {
  margin-top: auto;
  padding-top: var(--space-md);
  border-top: var(--border-width-thin) solid var(--color-border-light);
}

.featured-products .cta-text {
  color: var(--color-sage-green);
  font-weight: var(--font-weight-semibold);
  font-size: var(--text-body);
  display: inline-block;
  transition: color var(--transition-base);
}

.featured-products .product-card:hover .cta-text {
  color: var(--color-deep-cedar);
}

/* ============================================
   ONBOARDING PROMPT (No Profile State)
   ============================================ */
.onboarding-prompt {
  padding: var(--space-4xl) 0;
  background: linear-gradient(135deg, var(--color-soft-white) 0%, var(--color-ceramic-cream) 100%);
}

.onboarding-prompt__inner {
  text-align: center;
  max-width: 700px;
  margin: 0 auto;
  padding: var(--space-3xl);
  background: white;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
}

.onboarding-prompt__icon {
  font-size: 4rem;
  margin-bottom: var(--space-lg);
}

.onboarding-prompt__title {
  font-family: var(--font-serif);
  font-size: var(--text-h2);
  color: var(--color-deep-cedar);
  margin-bottom: var(--space-md);
}

.onboarding-prompt__description {
  font-family: var(--font-body);
  font-size: var(--text-body-lg);
  line-height: var(--line-height-relaxed);
  color: var(--color-text-primary);
  margin-bottom: var(--space-2xl);
}

.onboarding-prompt__actions {
  margin-bottom: var(--space-lg);
}

.onboarding-prompt__subtext {
  font-size: var(--text-small);
  color: var(--color-text-secondary);
}

.onboarding-prompt__subtext a {
  color: var(--color-sage-green);
  text-decoration: underline;
}

/* ============================================
   HOW IT WORKS
   ============================================ */
.how-it-works {
  padding: var(--space-4xl) 0;
  background: var(--color-background-primary);
}

.how-it-works__steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--space-3xl);
  margin-top: var(--space-3xl);
}

.step {
  text-align: center;
  position: relative;
}

.step__number {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--color-sage-green);
  color: white;
  font-family: var(--font-sans);
  font-size: var(--text-h3);
  font-weight: var(--font-weight-bold);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-md);
}

.step__icon {
  font-size: 2.5rem;
  margin-bottom: var(--space-lg);
}

.step__title {
  font-family: var(--font-sans);
  font-size: var(--text-h4);
  font-weight: var(--font-weight-semibold);
  color: var(--color-graphite);
  margin-bottom: var(--space-md);
}

.step__description {
  font-family: var(--font-body);
  font-size: var(--text-body);
  line-height: var(--line-height-relaxed);
  color: var(--color-text-secondary);
}

/* ============================================
   PHILOSOPHY TEASER (Layer 3)
   ============================================ */
.philosophy-teaser {
  position: relative;
  padding: var(--space-5xl) 0;
  overflow: hidden;
  color: var(--color-ceramic-cream);
}

.philosophy-teaser__background {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    135deg,
    var(--color-deep-cedar) 0%,
    var(--color-moss-shadow) 50%,
    var(--color-matte-charcoal) 100%
  );
  z-index: 0;

  /* Optional: Add subtle pattern overlay */
}

.philosophy-teaser__background::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: radial-gradient(circle, rgba(224, 168, 91, 0.05) 1px, transparent 1px);
  background-size: 40px 40px;
  opacity: 0.3;
}

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

.philosophy-teaser__badge {
  font-size: 3rem;
  margin-bottom: var(--space-lg);
}

.philosophy-teaser__title {
  font-family: var(--font-mythic);
  font-size: var(--text-h1);
  font-weight: var(--font-weight-regular);
  color: var(--color-ember-gold);
  letter-spacing: 0.02em;
  margin-bottom: var(--space-xl);
  line-height: var(--line-height-tight);
}

.philosophy-teaser__description {
  font-family: var(--font-serif);
  font-size: var(--text-body-lg);
  font-style: italic;
  line-height: var(--line-height-relaxed);
  color: var(--color-ceramic-cream);
  margin-bottom: var(--space-2xl);
}

.philosophy-teaser__link {
  font-family: var(--font-sans);
  font-size: var(--text-body);
  font-weight: var(--font-weight-medium);
  color: var(--color-ember-gold);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  transition: all var(--transition-base);
  padding: var(--space-sm) var(--space-lg);
  border: var(--border-width-medium) solid var(--color-ember-gold);
  border-radius: var(--radius-md);
}

.philosophy-teaser__link:hover {
  background: var(--color-ember-gold);
  color: var(--color-deep-cedar);
  gap: var(--space-md);
}

/* ============================================
   SOCIAL PROOF / TESTIMONIALS
   ============================================ */
.social-proof {
  padding: var(--space-4xl) 0;
  background: var(--color-soft-white);
}

.testimonial-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-2xl);
  margin-top: var(--space-3xl);
}

.testimonial {
  background: white;
  padding: var(--space-2xl);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  transition: all var(--transition-base);
}

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

.testimonial__quote {
  font-family: var(--font-body);
  font-size: var(--text-body);
  line-height: var(--line-height-relaxed);
  color: var(--color-text-primary);
  font-style: italic;
  margin-bottom: var(--space-lg);
  border-left: 4px solid var(--color-sage-green);
  padding-left: var(--space-lg);
}

.testimonial__author {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.testimonial__avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--color-sage-green);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.testimonial__name {
  font-family: var(--font-sans);
  font-size: var(--text-body);
  font-weight: var(--font-weight-semibold);
  color: var(--color-graphite);
  margin-bottom: var(--space-xs);
}

.testimonial__location {
  font-family: var(--font-sans);
  font-size: var(--text-small);
  color: var(--color-text-secondary);
}

/* ============================================
   FINAL CTA
   ============================================ */
.final-cta {
  padding: var(--space-4xl) 0;
  background: linear-gradient(
    135deg,
    var(--color-sage-green) 0%,
    var(--color-moss-grey) 100%
  );
}

.final-cta__inner {
  text-align: center;
  max-width: 700px;
  margin: 0 auto;
}

.final-cta__title {
  font-family: var(--font-serif);
  font-size: var(--text-h1);
  color: white;
  margin-bottom: var(--space-md);
}

.final-cta__description {
  font-family: var(--font-body);
  font-size: var(--text-body-lg);
  line-height: var(--line-height-relaxed);
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: var(--space-2xl);
}

.final-cta__link {
  font-family: var(--font-sans);
  font-size: var(--text-body-lg);
  color: white;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.final-cta__link:hover {
  color: var(--color-ceramic-cream);
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */
@media (max-width: 768px) {
  .value-props__grid,
  .product-grid,
  .how-it-works__steps,
  .testimonial-grid {
    grid-template-columns: 1fr;
  }

  .section-intro {
    text-align: left;
  }

  .how-it-works__steps {
    gap: var(--space-2xl);
  }

  .philosophy-teaser {
    padding: var(--space-4xl) 0;
  }
}
