/* ========================================
   TerraShare — Design System & Styles
   ======================================== */

/* --- Tokens --- */
:root {
  --color-earth:     #2d5016;
  --color-earth-d:   #1a3a08;
  --color-sage:      #5a7a3a;
  --color-sage-l:    #8aad5c;
  --color-sand:      #f5f0e8;
  --color-sand-d:    #e8dfd0;
  --color-cream:     #faf8f4;
  --color-bark:      #3d2e1e;
  --color-bark-l:    #6b5a48;
  --color-text:      #1c1c1c;
  --color-text-m:    #555;
  --color-text-l:    #888;
  --color-white:     #fff;
  --color-accent:    #c47d2e;
  --color-accent-l:  #e8a84c;

  --font-display: 'DM Serif Display', Georgia, serif;
  --font-body:    'Inter', -apple-system, sans-serif;

  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 3rem;
  --space-xl: 5rem;
  --space-2xl: 8rem;

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-full: 999px;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.08);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.12);

  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

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

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-md);
}

/* --- Typography --- */
h1, h2, h3 { font-family: var(--font-display); font-weight: 400; line-height: 1.15; }
h1 { font-size: clamp(2.8rem, 6vw, 5rem); }
h2 { font-size: clamp(2rem, 4vw, 3.2rem); }
h3 { font-size: clamp(1.4rem, 2.5vw, 1.8rem); }
h4 { font-family: var(--font-body); font-weight: 600; font-size: 1.1rem; }
h5 { font-family: var(--font-body); font-weight: 600; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--color-text-l); }

/* --- Components --- */

/* Badge */
.badge {
  display: inline-block;
  padding: 0.4rem 1rem;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  margin-bottom: var(--space-md);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.5rem;
  border-radius: var(--radius-full);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  border: 2px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.btn-sm { padding: 0.5rem 1.2rem; font-size: 0.85rem; }
.btn-lg { padding: 0.9rem 2rem; font-size: 1rem; }

.btn-primary {
  background: var(--color-earth);
  color: var(--color-white);
  border-color: var(--color-earth);
}
.btn-primary:hover {
  background: var(--color-earth-d);
  border-color: var(--color-earth-d);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(45,80,22,0.3);
}

.btn-outline {
  background: transparent;
  border-color: currentColor;
}
.btn-outline:hover {
  background: rgba(255,255,255,0.15);
  transform: translateY(-1px);
}

/* Section Shared */
.section {
  padding: var(--space-2xl) 0;
}

.section-label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-sage);
  margin-bottom: var(--space-sm);
}

.section-title {
  margin-bottom: var(--space-md);
}

.section-sub {
  font-size: 1.15rem;
  color: var(--color-text-m);
  max-width: 600px;
  margin-bottom: var(--space-xl);
}

/* ========================================
   Navigation
   ======================================== */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: var(--space-sm) 0;
  transition: var(--transition);
}

.nav.scrolled {
  background: rgba(250,248,244,0.92);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-sm);
}

.nav.scrolled .logo,
.nav.scrolled .nav-links a {
  color: var(--color-text);
}

.nav.scrolled .btn-sm {
  background: var(--color-earth);
  color: var(--color-white);
}

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

.logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--color-white);
  transition: var(--transition);
}

.logo-icon {
  width: 32px;
  height: 32px;
}

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

.nav-links a {
  font-size: 0.9rem;
  font-weight: 500;
  color: rgba(255,255,255,0.85);
  transition: var(--transition);
}

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

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-white);
  transition: var(--transition);
}

.nav.scrolled .nav-toggle span {
  background: var(--color-text);
}

/* ========================================
   Hero
   ======================================== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  color: var(--color-white);
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(165deg, var(--color-earth-d) 0%, var(--color-earth) 30%, var(--color-sage) 70%, var(--color-sage-l) 100%);
  z-index: -2;
}

.hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 20% 80%, rgba(0,0,0,0.2), transparent),
    radial-gradient(ellipse 60% 40% at 80% 20%, rgba(255,255,255,0.08), transparent);
}

.hero-content {
  padding-top: 120px;
  padding-bottom: var(--space-2xl);
}

.hero-sub {
  font-size: 1.25rem;
  opacity: 0.9;
  max-width: 560px;
  margin-bottom: var(--space-lg);
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
  margin-bottom: var(--space-xl);
}

.hero-stats {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  flex-wrap: wrap;
}

.stat strong {
  display: block;
  font-size: 1.6rem;
  font-family: var(--font-display);
}

.stat span {
  font-size: 0.85rem;
  opacity: 0.75;
}

.stat-divider {
  width: 1px;
  height: 40px;
  background: rgba(255,255,255,0.25);
}

.hero-scroll {
  position: absolute;
  bottom: var(--space-lg);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.6);
}

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

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

/* ========================================
   Problem / Opportunity
   ======================================== */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xl);
  align-items: center;
}

.split-text h2 {
  margin-bottom: var(--space-md);
}

.split-text p {
  font-size: 1.1rem;
  color: var(--color-text-m);
  line-height: 1.8;
}

.split-visual {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.visual-card {
  flex: 1;
  background: var(--color-white);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  box-shadow: var(--shadow-md);
  text-align: center;
  transition: var(--transition);
}

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

.visual-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto var(--space-sm);
  color: var(--color-earth);
}

.visual-card p {
  font-size: 0.85rem;
  color: var(--color-text-m);
}

.visual-connector {
  width: 60px;
  flex-shrink: 0;
  color: var(--color-sage-l);
}

/* ========================================
   How It Works
   ======================================== */
.section-how {
  background: var(--color-white);
}

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

.step {
  position: relative;
}

.step-num {
  font-family: var(--font-display);
  font-size: 3rem;
  color: var(--color-sand-d);
  line-height: 1;
  margin-bottom: var(--space-sm);
}

.step-icon {
  width: 64px;
  height: 64px;
  color: var(--color-sage);
  margin-bottom: var(--space-sm);
}

.step h3 {
  margin-bottom: var(--space-xs);
}

.step p {
  color: var(--color-text-m);
  line-height: 1.7;
}

/* ========================================
   For Whom
   ======================================== */
.columns-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
}

.card {
  border-radius: var(--radius-lg);
  padding: var(--space-xl) var(--space-lg);
}

.card-host {
  background: var(--color-sand);
}

.card-farmer-cta {
  background: var(--color-earth);
  color: var(--color-white);
}

.card-farmer-cta .card-label { color: var(--color-sage-l); }
.card-farmer-cta .check-list li::before { color: var(--color-sage-l); }
.card-farmer-cta .btn-primary {
  background: var(--color-white);
  color: var(--color-earth);
  border-color: var(--color-white);
}
.card-farmer-cta .btn-primary:hover {
  background: var(--color-sand);
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

.card-label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-sage);
  margin-bottom: var(--space-sm);
}

.card h3 {
  margin-bottom: var(--space-md);
}

.check-list {
  margin-bottom: var(--space-lg);
}

.check-list li {
  padding: 0.5rem 0;
  padding-left: 1.6rem;
  position: relative;
  line-height: 1.5;
}

.check-list li::before {
  content: '\2713';
  position: absolute;
  left: 0;
  color: var(--color-earth);
  font-weight: 700;
}

/* ========================================
   Community
   ======================================== */
.section-community {
  background: var(--color-sand);
}

.community-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-md);
}

.community-card {
  background: var(--color-white);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  transition: var(--transition);
}

.community-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.community-icon {
  width: 40px;
  height: 40px;
  color: var(--color-sage);
  margin-bottom: var(--space-sm);
}

.community-card h4 {
  margin-bottom: var(--space-xs);
}

.community-card p {
  font-size: 0.9rem;
  color: var(--color-text-m);
  line-height: 1.6;
}

/* ========================================
   Mission
   ======================================== */
.mission-block {
  max-width: 800px;
}

.mission-block h2 {
  margin-bottom: var(--space-lg);
}

.mission-text {
  margin-bottom: var(--space-xl);
}

.mission-text p {
  font-size: 1.1rem;
  color: var(--color-text-m);
  line-height: 1.8;
  margin-bottom: var(--space-md);
}

.mission-values {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
}

.value {
  padding: var(--space-md);
  background: var(--color-sand);
  border-radius: var(--radius-md);
}

.value strong {
  display: block;
  font-size: 1.05rem;
  margin-bottom: 0.25rem;
  color: var(--color-earth);
}

.value span {
  font-size: 0.9rem;
  color: var(--color-text-m);
}

/* ========================================
   Testimonials
   ======================================== */
.section-proof {
  background: var(--color-white);
}

.testimonials {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
  margin-top: var(--space-lg);
}

.testimonial {
  background: var(--color-sand);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.testimonial p {
  font-size: 1.05rem;
  line-height: 1.7;
  margin-bottom: var(--space-md);
  font-style: italic;
}

.testimonial cite {
  font-style: normal;
}

.testimonial cite strong {
  display: block;
}

.testimonial cite span {
  font-size: 0.85rem;
  color: var(--color-text-l);
}

/* ========================================
   CTA / Waitlist
   ======================================== */
.section-cta {
  background:
    linear-gradient(165deg, var(--color-earth-d) 0%, var(--color-earth) 50%, var(--color-sage) 100%);
  color: var(--color-white);
}

.cta-block {
  max-width: 680px;
  margin: 0 auto;
  text-align: center;
}

.cta-block h2 {
  margin-bottom: var(--space-sm);
}

.cta-block > p {
  font-size: 1.15rem;
  opacity: 0.9;
  margin-bottom: var(--space-lg);
}

.waitlist-form .form-row {
  display: flex;
  gap: 0.75rem;
  margin-bottom: var(--space-sm);
  flex-wrap: wrap;
}

.waitlist-form input,
.waitlist-form select {
  flex: 1;
  min-width: 180px;
  padding: 0.85rem 1.2rem;
  border: 2px solid rgba(255,255,255,0.3);
  border-radius: var(--radius-full);
  background: rgba(255,255,255,0.12);
  color: var(--color-white);
  font-family: var(--font-body);
  font-size: 0.95rem;
  outline: none;
  transition: var(--transition);
}

.waitlist-form input::placeholder {
  color: rgba(255,255,255,0.6);
}

.waitlist-form select {
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.waitlist-form select option {
  color: var(--color-text);
  background: var(--color-white);
}

.waitlist-form input:focus,
.waitlist-form select:focus {
  border-color: rgba(255,255,255,0.7);
  background: rgba(255,255,255,0.18);
}

.waitlist-form .btn-primary {
  background: var(--color-white);
  color: var(--color-earth);
  border-color: var(--color-white);
  flex-shrink: 0;
}

.waitlist-form .btn-primary:hover {
  background: var(--color-sand);
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

.form-note {
  font-size: 0.8rem;
  opacity: 0.6;
}

.waitlist-success {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
}

.waitlist-success svg {
  width: 48px;
  height: 48px;
  color: var(--color-sage-l);
}

.waitlist-success p {
  font-size: 1.1rem;
}

/* ========================================
   Footer
   ======================================== */
.footer {
  background: var(--color-bark);
  color: rgba(255,255,255,0.7);
  padding: var(--space-xl) 0 var(--space-md);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: var(--space-xl);
  margin-bottom: var(--space-xl);
}

.footer-brand {
  max-width: 300px;
}

.footer-brand .logo {
  color: var(--color-white);
  margin-bottom: var(--space-sm);
}

.footer-brand p {
  font-size: 0.9rem;
  line-height: 1.6;
}

.footer-links {
  display: flex;
  gap: var(--space-xl);
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.footer-col h5 {
  color: rgba(255,255,255,0.4);
  margin-bottom: 0.3rem;
}

.footer-col a {
  font-size: 0.9rem;
  transition: var(--transition);
}

.footer-col a:hover {
  color: var(--color-white);
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: var(--space-md);
}

.footer-bottom p {
  font-size: 0.8rem;
  opacity: 0.5;
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 900px) {
  .split {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }

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

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

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

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

  .mission-values {
    grid-template-columns: 1fr;
  }

  .hero-stats {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-sm);
  }

  .stat-divider {
    display: none;
  }

  .footer-inner {
    flex-direction: column;
    gap: var(--space-lg);
  }

  .footer-links {
    flex-wrap: wrap;
    gap: var(--space-lg);
  }
}

@media (max-width: 640px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--color-cream);
    padding: var(--space-md);
    box-shadow: var(--shadow-md);
    gap: var(--space-xs);
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links a {
    color: var(--color-text) !important;
    padding: 0.5rem 0;
  }

  .nav-toggle {
    display: flex;
  }

  .hero-content {
    padding-top: 100px;
  }

  .hero-actions {
    flex-direction: column;
  }

  .hero-actions .btn {
    width: 100%;
  }

  .split-visual {
    flex-direction: column;
  }

  .visual-connector {
    transform: rotate(90deg);
  }

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

  .waitlist-form .form-row {
    flex-direction: column;
  }
}

/* ========================================
   Animations (on scroll)
   ======================================== */
.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

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