/* ===================================================
   OneFlesh Home — Landing Page Styles
   Design System: Sage Sanctuary
   =================================================== */

/* ---------- TOKENS ---------- */
:root {
  --sage: #7A8E6B;
  --sage-light: #a3b396;
  --sage-dark: #5c6d50;
  --cream: #FDFCF9;
  --dark: #1B1C1A;
  --muted: #76786B;
  --radius-pill: 999px;
  --radius-card: 20px;
  --font-serif: 'Newsreader', Georgia, serif;
  --font-sans: 'Manrope', system-ui, sans-serif;
  --max-w: 1120px;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
}

/* ---------- RESET ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-sans);
  color: var(--dark);
  background: var(--cream);
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; border: none; outline: none; }

/* ---------- GRAIN OVERLAY ---------- */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 180px;
}

/* ---------- AMBIENT BLOBS ---------- */
.blob {
  position: fixed;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.12;
  pointer-events: none;
  z-index: 0;
}
.blob-1 {
  width: 500px; height: 500px;
  background: var(--sage);
  top: -120px; right: -100px;
}
.blob-2 {
  width: 400px; height: 400px;
  background: #b8c7a8;
  bottom: 20%; left: -140px;
}
.blob-3 {
  width: 350px; height: 350px;
  background: var(--sage-dark);
  bottom: -80px; right: 10%;
}

/* ---------- UTILITIES ---------- */
.section-title {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  text-align: center;
  margin-bottom: 3rem;
  position: relative;
  z-index: 1;
}

/* ---------- NAV ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem var(--gutter);
  max-width: var(--max-w);
  margin: 0 auto;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: rgba(253, 252, 249, 0.75);
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 600;
  font-size: 1.15rem;
}
.nav-icon { width: 32px; height: 32px; }

/* ---------- BUTTONS ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--sage);
  color: var(--cream);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.75rem 1.75rem;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: background 0.25s, transform 0.2s;
  white-space: nowrap;
}
.btn:hover { background: var(--sage-dark); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-sm { padding: 0.5rem 1.25rem; font-size: 0.85rem; }

/* ---------- HERO ---------- */
.hero {
  min-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6rem var(--gutter) 4rem;
  position: relative;
  z-index: 1;
}
.hero-inner {
  max-width: 640px;
  animation: fadeUp 0.8s ease-out both;
}
.hero-icon-wrap { margin-bottom: 2rem; }
.hero-icon {
  width: 96px;
  height: 96px;
  margin: 0 auto;
  border-radius: 24px;
  box-shadow: 0 8px 32px rgba(122, 142, 107, 0.18);
}
.hero-title {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 600;
  font-size: clamp(2.5rem, 7vw, 4rem);
  line-height: 1.15;
  margin-bottom: 0.75rem;
}
.hero-tagline {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(1.05rem, 2.5vw, 1.35rem);
  color: var(--muted);
  margin-bottom: 0.25rem;
}
.hero-sub {
  font-size: clamp(1.1rem, 2.5vw, 1.4rem);
  font-weight: 500;
  color: var(--sage-dark);
  margin-bottom: 2.5rem;
}

/* ---------- SIGNUP FORM ---------- */
.signup-form {
  display: flex;
  gap: 0.75rem;
  max-width: 460px;
  margin: 0 auto;
}
.signup-input {
  flex: 1;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-pill);
  border: 1.5px solid #d4d6cb;
  background: #fff;
  font-size: 0.95rem;
  color: var(--dark);
  transition: border-color 0.25s;
}
.signup-input::placeholder { color: #a8a99e; }
.signup-input:focus { border-color: var(--sage); }

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

/* ---------- FEATURES ---------- */
.features {
  padding: 5rem var(--gutter);
  max-width: var(--max-w);
  margin: 0 auto;
  position: relative;
  z-index: 1;
}
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}
.feature-card {
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(122, 142, 107, 0.12);
  border-radius: var(--radius-card);
  padding: 2rem 1.75rem;
  transition: transform 0.3s, box-shadow 0.3s;
  /* scroll animation */
  opacity: 0;
  transform: translateY(24px);
  animation: fadeUp 0.6s ease-out forwards;
}
.feature-card:nth-child(1) { animation-delay: 0.05s; }
.feature-card:nth-child(2) { animation-delay: 0.1s; }
.feature-card:nth-child(3) { animation-delay: 0.15s; }
.feature-card:nth-child(4) { animation-delay: 0.2s; }
.feature-card:nth-child(5) { animation-delay: 0.25s; }
.feature-card:nth-child(6) { animation-delay: 0.3s; }

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(122, 142, 107, 0.10);
}
.feature-icon {
  width: 48px;
  height: 48px;
  margin-bottom: 1rem;
}
.feature-card h3 {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}
.feature-card p {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

@media (max-width: 768px) {
  .features-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .features-grid { grid-template-columns: 1fr; }
}

/* ---------- PREVIEW ---------- */
.preview {
  padding: 5rem var(--gutter);
  max-width: var(--max-w);
  margin: 0 auto;
  position: relative;
  z-index: 1;
}
.preview-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  align-items: end;
}
.preview-card {
  animation: fadeUp 0.7s ease-out both;
}
.preview-card:nth-child(1) { animation-delay: 0.1s; }
.preview-card:nth-child(2) { animation-delay: 0.2s; }
.preview-card:nth-child(3) { animation-delay: 0.3s; }

.preview-img {
  width: 100%;
  max-height: 520px;
  object-fit: contain;
  border-radius: var(--radius-card);
  box-shadow: 0 20px 60px rgba(27,28,26,0.08);
  border: 1px solid rgba(198,200,184,0.2);
}
.preview-card-center .preview-img {
  max-height: 560px;
}

@media (max-width: 640px) {
  .preview-grid {
    grid-template-columns: 1fr;
    max-width: 280px;
    margin: 0 auto;
  }
}

/* ---------- CTA ---------- */
.cta {
  padding: 5rem var(--gutter);
  position: relative;
  z-index: 1;
}
.cta-inner {
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
  background: rgba(122, 142, 107, 0.06);
  border: 1px solid rgba(122, 142, 107, 0.12);
  border-radius: 28px;
  padding: 3.5rem 2.5rem;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.cta-title {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  margin-bottom: 0.75rem;
}
.cta-sub {
  color: var(--muted);
  font-size: 1rem;
  margin-bottom: 2rem;
  line-height: 1.6;
}

/* ---------- FOOTER ---------- */
.footer {
  padding: 2.5rem var(--gutter);
  text-align: center;
  position: relative;
  z-index: 1;
  border-top: 1px solid rgba(122, 142, 107, 0.1);
}
.footer-copy {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
}
.footer-links {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
}
.footer-links a {
  font-size: 0.85rem;
  color: var(--muted);
  transition: color 0.2s;
}
.footer-links a:hover { color: var(--sage-dark); }

/* ---------- ANIMATIONS ---------- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Scroll-triggered fade (pure CSS using animation-timeline where supported) */
@supports (animation-timeline: view()) {
  .feature-card,
  .preview-card {
    animation: fadeUp linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 40%;
  }
}
