/* ============================================
   IHYA V2 — Design System
   Brand: The Sacred Sage
   Primary: Seed (science/tradition) + Graza (world-building)
   ============================================ */

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

/* --- TOKENS --- */
:root {
  /* Backgrounds */
  --bg: #0F0D0B;
  --bg-raised: #151210;
  --bg-raised-hover: #1A1714;
  --bg-warm: #120F0C;
  --bg-section: #0D0B09;
  --bg-card: #161310;

  /* Text */
  --cream: #EDE8DF;
  --cream-dim: #D4CFC5;
  --sand: #A09889;
  --stone: #6B6155;
  --stone-dim: #4A4139;

  /* Accents */
  --ember: #C2703E;
  --ember-light: #D4884F;
  --ember-glow: rgba(194, 112, 62, 0.12);
  --ember-deep: #A85D33;
  --sage: #7A8C6E;
  --sage-dim: rgba(122, 140, 110, 0.15);
  --gold: #D4A855;

  /* Borders */
  --border: rgba(160, 152, 137, 0.08);
  --border-hover: rgba(160, 152, 137, 0.16);
  --border-card: rgba(160, 152, 137, 0.06);

  /* Typography */
  --font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --arabic: 'Amiri', serif;
  --serif: 'Playfair Display', Georgia, serif;

  /* Spacing */
  --section-gap: clamp(100px, 12vw, 160px);
  --container-max: 1140px;
  --container-wide: 1280px;
}

/* --- BASE --- */
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--cream);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
::selection { background: var(--ember); color: var(--bg); }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

/* --- LAYOUT --- */
.container { max-width: var(--container-max); margin: 0 auto; padding: 0 24px; }
.container-wide { max-width: var(--container-wide); margin: 0 auto; padding: 0 24px; }
.section { padding: var(--section-gap) 0; }
.section-alt { background: var(--bg-section); }

/* --- TYPOGRAPHY --- */
.eyebrow {
  font-size: 11px;
  font-weight: 700;
  color: var(--ember);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 16px;
}
.section-title {
  font-size: clamp(32px, 4.5vw, 52px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.025em;
  color: var(--cream);
  margin-bottom: 20px;
}
.section-subtitle {
  font-size: clamp(16px, 2vw, 19px);
  color: var(--sand);
  line-height: 1.7;
  max-width: 560px;
  font-weight: 400;
}
.arabic-text {
  font-family: var(--arabic);
  direction: rtl;
}
.hadith-citation {
  font-family: var(--arabic);
  font-style: italic;
  color: var(--sand);
  font-size: clamp(15px, 1.8vw, 18px);
  line-height: 1.8;
}
.citation-ref {
  font-size: 10px;
  color: var(--stone);
  vertical-align: super;
  margin-left: 2px;
}

/* --- NAV --- */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 20px 0;
  transition: all 0.4s cubic-bezier(0.4,0,0.2,1);
}
nav.scrolled {
  background: rgba(15,13,11,0.92);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--border);
  padding: 14px 0;
}
nav .container { display: flex; justify-content: space-between; align-items: center; }
.nav-brand { display: flex; align-items: center; }
.nav-brand svg { height: 36px; width: auto; }
.nav-links { display: flex; align-items: center; gap: 32px; }
.nav-links a {
  font-size: 13px;
  font-weight: 500;
  color: var(--sand);
  letter-spacing: 0.02em;
  transition: color 0.3s;
}
.nav-links a:hover { color: var(--cream); }
.nav-cta {
  font-size: 13px;
  font-weight: 600;
  color: var(--bg);
  background: var(--cream);
  padding: 10px 24px;
  border-radius: 100px;
  transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
}
.nav-cta:hover {
  background: var(--ember);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 20px var(--ember-glow);
}
@media (max-width: 640px) {
  .nav-links a:not(.nav-cta) { display: none; }
}

/* --- HERO --- */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 120px 24px 80px;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: 15%; left: 50%;
  transform: translateX(-50%);
  width: 900px; height: 600px;
  background: radial-gradient(ellipse, rgba(194,112,62,0.14) 0%, rgba(194,112,62,0.05) 40%, transparent 70%);
  pointer-events: none;
  animation: heroGlow 8s ease-in-out infinite alternate;
}
.hero-grain {
  position: absolute; inset: 0;
  opacity: 0.03;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px;
}
.hero-mandala {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 700px; height: 700px;
  opacity: 0.04;
  animation: mandalaRotate 120s linear infinite;
}
.hero-content {
  position: relative; z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.hero-logo {
  width: clamp(140px, 26vw, 240px);
  height: auto;
  margin-bottom: 24px;
  filter: drop-shadow(0 0 80px rgba(194,112,62,0.12));
  animation: fadeInScale 1.1s cubic-bezier(0.16,1,0.3,1) 0.3s both;
}
.hero h1 {
  font-size: clamp(20px, 3vw, 28px);
  font-weight: 300;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--cream-dim);
  margin-bottom: 24px;
  animation: fadeInUp 0.8s cubic-bezier(0.16,1,0.3,1) 0.5s both;
}
.hero-tagline {
  font-size: clamp(16px, 2.2vw, 20px);
  color: var(--sand);
  max-width: 480px;
  line-height: 1.7;
  font-weight: 400;
  margin-bottom: 12px;
  animation: fadeInUp 0.8s cubic-bezier(0.16,1,0.3,1) 0.65s both;
}
.hero-arabic-tagline {
  font-family: var(--arabic);
  font-size: clamp(18px, 2.4vw, 24px);
  color: var(--stone);
  margin-bottom: 40px;
  direction: rtl;
  animation: fadeInUp 0.8s cubic-bezier(0.16,1,0.3,1) 0.75s both;
}
.hero-stats {
  display: flex;
  gap: 40px;
  margin-bottom: 48px;
  animation: fadeInUp 0.8s cubic-bezier(0.16,1,0.3,1) 0.85s both;
}
.hero-stat { text-align: center; }
.hero-stat-val {
  font-size: clamp(22px, 3vw, 32px);
  font-weight: 700;
  color: var(--cream);
  letter-spacing: -0.02em;
}
.hero-stat-val .unit { font-size: 0.6em; color: var(--sand); font-weight: 500; }
.hero-stat-label {
  font-size: 11px;
  color: var(--stone);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 4px;
}
.hero-stat + .hero-stat {
  padding-left: 40px;
  border-left: 1px solid var(--border);
}
.hero-cta-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  animation: fadeInUp 0.8s cubic-bezier(0.16,1,0.3,1) 0.95s both;
}

/* --- BUTTONS --- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  background: var(--ember);
  padding: 16px 40px;
  border-radius: 100px;
  border: none;
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
  box-shadow: 0 0 40px rgba(194,112,62,0.15);
}
.btn-primary:hover {
  background: var(--ember-light);
  transform: translateY(-2px);
  box-shadow: 0 8px 40px rgba(194,112,62,0.35);
}
.btn-ghost {
  font-size: 13px;
  font-weight: 500;
  color: var(--sand);
  padding: 10px 24px;
  border: 1px solid var(--border);
  border-radius: 100px;
  transition: all 0.3s;
}
.btn-ghost:hover {
  color: var(--cream);
  border-color: var(--border-hover);
}
.hero-note {
  font-size: 12px;
  color: var(--stone);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* --- PROOF BAR --- */
.proof-bar {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
  overflow: hidden;
}
.proof-track {
  display: flex;
  gap: 48px;
  animation: marquee 30s linear infinite;
  width: max-content;
}
.proof-item {
  font-size: 12px;
  font-weight: 600;
  color: var(--stone);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 10px;
}
.proof-dot {
  width: 4px; height: 4px;
  background: var(--ember);
  border-radius: 50%;
}

/* --- PROBLEM SECTION --- */
.problem-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 48px;
}
.problem-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 16px;
  padding: 40px 32px;
  transition: all 0.3s;
}
.problem-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
}
.problem-icon {
  width: 48px; height: 48px;
  margin-bottom: 24px;
  color: var(--ember);
}
.problem-card h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--cream);
}
.problem-card p {
  font-size: 14px;
  color: var(--sand);
  line-height: 1.7;
}

/* --- INGREDIENT STORY --- */
.ingredient-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-top: 48px;
}
.ingredient-card {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  aspect-ratio: 4/3;
  cursor: pointer;
  border: 1px solid var(--border-card);
}
.ingredient-card img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.4,0,0.2,1);
}
.ingredient-card:hover img { transform: scale(1.05); }
.ingredient-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(15,13,11,0.95) 0%, rgba(15,13,11,0.4) 50%, transparent 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 32px;
}
.ingredient-name {
  font-size: clamp(20px, 2.5vw, 26px);
  font-weight: 700;
  color: var(--cream);
  margin-bottom: 4px;
}
.ingredient-amount {
  font-size: 13px;
  font-weight: 600;
  color: var(--ember);
  letter-spacing: 0.06em;
  margin-bottom: 12px;
}
.ingredient-hadith {
  font-family: var(--arabic);
  font-size: 14px;
  color: var(--sand);
  font-style: italic;
  line-height: 1.6;
}

/* --- PRODUCT HERO --- */
.product-hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}
.product-image-wrapper {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}
.product-image-wrapper::before {
  content: '';
  position: absolute;
  width: 400px; height: 400px;
  background: radial-gradient(circle, var(--ember-glow), transparent 70%);
  border-radius: 50%;
}
.product-image-wrapper img {
  position: relative;
  max-height: 480px;
  width: auto;
  filter: drop-shadow(0 20px 60px rgba(0,0,0,0.4));
}
.product-info { max-width: 480px; }
.product-flavor-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ember);
  background: rgba(194,112,62,0.08);
  padding: 6px 16px;
  border-radius: 100px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 20px;
  border: 1px solid rgba(194,112,62,0.12);
}
.product-info h2 {
  font-size: clamp(28px, 3.5vw, 42px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}
.product-info .tagline {
  font-size: 16px;
  color: var(--sand);
  margin-bottom: 32px;
  line-height: 1.7;
}
.nutrition-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}
.nutrition-item {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.nutrition-val {
  font-size: 24px;
  font-weight: 700;
  color: var(--cream);
}
.nutrition-label {
  font-size: 13px;
  color: var(--sand);
}

/* --- SCIENCE SECTION --- */
.science-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  margin-top: 48px;
}
.science-col {
  background: var(--bg);
  padding: 32px;
}
.science-col-header {
  font-size: 11px;
  font-weight: 700;
  color: var(--ember);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.science-row {
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}
.science-row:last-child { border-bottom: none; }
.science-row h4 {
  font-size: 15px;
  font-weight: 600;
  color: var(--cream);
  margin-bottom: 4px;
}
.science-row p {
  font-size: 13px;
  color: var(--sand);
  line-height: 1.6;
}

/* --- 786 SECTION --- */
.seven-eight-six {
  text-align: center;
  padding: var(--section-gap) 0;
}
.big-number {
  font-size: clamp(100px, 20vw, 280px);
  font-weight: 800;
  color: var(--ember);
  letter-spacing: -0.04em;
  line-height: 0.85;
  opacity: 0.15;
  margin-bottom: -40px;
  position: relative;
}
.seven-eight-six h2 {
  font-size: clamp(24px, 3.5vw, 40px);
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 20px;
  position: relative;
}
.seven-eight-six .arabic-bismillah {
  font-family: var(--arabic);
  font-size: clamp(28px, 4vw, 48px);
  color: var(--ember);
  margin-bottom: 24px;
  display: block;
  direction: rtl;
}
.seven-eight-six p {
  font-size: clamp(15px, 1.8vw, 17px);
  color: var(--sand);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.8;
}

/* --- WAITLIST SECTION --- */
.waitlist-section {
  text-align: center;
  padding: var(--section-gap) 0;
}
.waitlist-form {
  display: flex;
  gap: 12px;
  max-width: 480px;
  margin: 32px auto 0;
}
.waitlist-form input {
  flex: 1;
  font-family: var(--font);
  font-size: 15px;
  padding: 16px 24px;
  border: 1px solid var(--border);
  border-radius: 100px;
  background: var(--bg-raised);
  color: var(--cream);
  outline: none;
  transition: border-color 0.3s;
}
.waitlist-form input::placeholder { color: var(--stone); }
.waitlist-form input:focus { border-color: var(--ember); }
.waitlist-form button {
  white-space: nowrap;
}
.form-success {
  display: none;
  font-size: 15px;
  color: var(--sage);
  margin-top: 16px;
}

/* --- FOOTER --- */
footer {
  border-top: 1px solid var(--border);
  padding: 60px 0;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.footer-brand svg { height: 32px; width: auto; opacity: 0.6; }
.footer-tagline {
  font-size: 13px;
  color: var(--stone);
  margin-top: 12px;
}
.footer-links {
  display: flex;
  gap: 24px;
}
.footer-links a {
  font-size: 13px;
  color: var(--stone);
  transition: color 0.3s;
}
.footer-links a:hover { color: var(--cream); }
.footer-social {
  display: flex;
  gap: 16px;
}
.footer-social a {
  color: var(--stone);
  transition: color 0.3s;
}
.footer-social a:hover { color: var(--cream); }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--stone-dim);
}

/* --- ANIMATIONS --- */
@keyframes heroGlow {
  0% { opacity: 0.6; transform: translateX(-50%) scale(1); }
  100% { opacity: 1; transform: translateX(-50%) scale(1.08); }
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(28px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInScale {
  from { opacity: 0; transform: scale(0.92) translateY(20px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes mandalaRotate {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to { transform: translate(-50%, -50%) rotate(360deg); }
}
@keyframes marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* --- REVEAL ANIMATION --- */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.8s cubic-bezier(0.16,1,0.3,1), transform 0.8s cubic-bezier(0.16,1,0.3,1);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
.stagger:nth-child(1) { transition-delay: 0s; }
.stagger:nth-child(2) { transition-delay: 0.1s; }
.stagger:nth-child(3) { transition-delay: 0.2s; }
.stagger:nth-child(4) { transition-delay: 0.3s; }

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
  .hero-stats { gap: 24px; }
  .hero-stat + .hero-stat { padding-left: 24px; }
  .problem-grid { grid-template-columns: 1fr; }
  .ingredient-grid { grid-template-columns: 1fr; }
  .product-hero { grid-template-columns: 1fr; text-align: center; }
  .product-info { margin: 0 auto; }
  .science-grid { grid-template-columns: 1fr; }
  .waitlist-form { flex-direction: column; }
  .footer-inner { flex-direction: column; gap: 32px; text-align: center; }
  .footer-bottom { flex-direction: column; gap: 12px; }
}
@media (max-width: 480px) {
  .hero-stats { flex-direction: column; gap: 16px; }
  .hero-stat + .hero-stat { padding-left: 0; border-left: none; padding-top: 16px; border-top: 1px solid var(--border); }
  .nutrition-grid { grid-template-columns: 1fr; }
}
