/* ============================================================
   VIRAJ ORGANICS — Design System
   Premium Agricultural Corporate Identity
   ============================================================ */

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

:root {
  /* === Color Palette === */
  --color-forest:        #1B3A2D;
  --color-forest-deep:   #0F2119;
  --color-forest-light:  #2A5A43;
  --color-forest-muted:  #3D7A5C;
  --color-ivory:         #F7F3ED;
  --color-ivory-warm:    #F0EBE3;
  --color-ivory-light:   #FDFCF9;
  --color-brown:         #6B4A30;
  --color-brown-light:   #8B6A4A;
  --color-gold:          #C9A85C;
  --color-gold-light:    #E8D5A8;
  --color-gold-dark:     #A8893E;
  --color-text:          #1C1F1D;
  --color-text-muted:    #5A6358;
  --color-text-light:    #8A8E88;
  --color-white:         #FFFFFF;
  --color-black:         #000000;
  --color-overlay:       rgba(15, 33, 25, 0.7);
  --color-overlay-light: rgba(15, 33, 25, 0.4);
  --color-glass:         rgba(247, 243, 237, 0.85);
  --color-glass-dark:    rgba(27, 58, 45, 0.9);

  /* === Typography === */
  --font-display: 'Outfit', sans-serif;
  --font-body:    'Inter', sans-serif;

  --text-hero:    clamp(3rem, 8vw, 7rem);
  --text-display: clamp(2.25rem, 5vw, 4.5rem);
  --text-heading: clamp(1.75rem, 3.5vw, 3rem);
  --text-subhead: clamp(1.25rem, 2vw, 1.75rem);
  --text-body-lg: clamp(1.05rem, 1.3vw, 1.25rem);
  --text-body:    clamp(0.95rem, 1.1vw, 1.0625rem);
  --text-small:   0.875rem;
  --text-caption:  0.75rem;
  --text-label:   0.6875rem;

  --weight-light:    300;
  --weight-regular:  400;
  --weight-medium:   500;
  --weight-semibold: 600;
  --weight-bold:     700;
  --weight-black:    800;

  --leading-tight:   1.1;
  --leading-snug:    1.25;
  --leading-normal:  1.5;
  --leading-relaxed: 1.7;

  --tracking-tight:   -0.03em;
  --tracking-normal:  0;
  --tracking-wide:    0.05em;
  --tracking-wider:   0.1em;
  --tracking-widest:  0.15em;

  /* === Spacing Scale === */
  --space-2xs:  0.25rem;
  --space-xs:   0.5rem;
  --space-sm:   1rem;
  --space-md:   1.5rem;
  --space-lg:   2rem;
  --space-xl:   3rem;
  --space-2xl:  4rem;
  --space-3xl:  6rem;
  --space-4xl:  8rem;
  --space-5xl:  10rem;
  --space-6xl:  12rem;

  /* Section padding */
  --section-pad-y: clamp(5rem, 10vw, 10rem);
  --section-pad-x: clamp(1.25rem, 5vw, 4rem);

  /* === Layout === */
  --container-max:   1440px;
  --container-narrow: 960px;
  --container-text:  720px;
  --grid-gap:        clamp(1rem, 2vw, 2.5rem);
  --header-height:   5rem;

  /* === Borders & Radius === */
  --radius-sm:  0.375rem;
  --radius-md:  0.75rem;
  --radius-lg:  1.25rem;
  --radius-xl:  2rem;
  --radius-full: 9999px;
  --border-thin: 1px solid rgba(27, 58, 45, 0.1);
  --border-gold: 1px solid rgba(201, 168, 92, 0.3);

  /* === Shadows === */
  --shadow-sm:   0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md:   0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg:   0 12px 40px rgba(0,0,0,0.12);
  --shadow-xl:   0 20px 60px rgba(0,0,0,0.15);
  --shadow-glow: 0 0 40px rgba(201, 168, 92, 0.15);

  /* === Transitions === */
  --ease-out:    cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --duration-fast:   0.2s;
  --duration-normal: 0.4s;
  --duration-slow:   0.7s;
  --duration-slower: 1s;

  /* === Z-Index Scale === */
  --z-base:     1;
  --z-dropdown: 100;
  --z-sticky:   200;
  --z-overlay:  300;
  --z-modal:    400;
  --z-nav:      500;
  --z-loader:   900;
  --z-max:      999;
}

/* === Dark sections override === */
[data-theme="dark"] {
  --color-text: var(--color-ivory);
  --color-text-muted: rgba(247, 243, 237, 0.7);
  --border-thin: 1px solid rgba(247, 243, 237, 0.1);
}

/* === Base HTML === */
html {
  font-size: 16px;
  scroll-behavior: auto; /* Lenis handles smooth scroll */
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-body);
  font-weight: var(--weight-regular);
  line-height: var(--leading-normal);
  color: var(--color-text);
  background-color: var(--color-ivory);
  overflow-x: hidden;
  min-height: 100vh;
}

/* Smooth wrapper for Lenis */
#smooth-wrapper {
  overflow: hidden;
}

/* === Typography === */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--color-text);
}

h1, .text-hero {
  font-size: var(--text-hero);
  font-weight: var(--weight-black);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

h2, .text-display {
  font-size: var(--text-display);
  font-weight: var(--weight-bold);
}

h3, .text-heading {
  font-size: var(--text-heading);
  font-weight: var(--weight-semibold);
}

h4, .text-subhead {
  font-size: var(--text-subhead);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-snug);
}

.text-body-lg {
  font-size: var(--text-body-lg);
  line-height: var(--leading-relaxed);
}

p {
  max-width: 65ch;
  line-height: var(--leading-relaxed);
}

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

strong { font-weight: var(--weight-semibold); }

/* Label / Tag text */
.label {
  font-family: var(--font-body);
  font-size: var(--text-label);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-widest);
  color: var(--color-gold);
}

.section-label {
  font-family: var(--font-body);
  font-size: var(--text-small);
  font-weight: var(--weight-medium);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  color: var(--color-gold);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}

.section-label::before {
  content: '';
  width: 2rem;
  height: 1px;
  background: var(--color-gold);
}

/* === Layout Utilities === */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding-left: var(--section-pad-x);
  padding-right: var(--section-pad-x);
}

.container--narrow {
  max-width: var(--container-narrow);
}

.container--text {
  max-width: var(--container-text);
}

/* Section */
.section {
  padding-top: var(--section-pad-y);
  padding-bottom: var(--section-pad-y);
  position: relative;
}

.section--dark {
  background-color: var(--color-forest-deep);
  color: var(--color-ivory);
}

.section--dark h1,
.section--dark h2,
.section--dark h3,
.section--dark h4 {
  color: var(--color-ivory);
}

.section--dark .section-label {
  color: var(--color-gold-light);
}

.section--dark .section-label::before {
  background: var(--color-gold-light);
}

.section--forest {
  background-color: var(--color-forest);
  color: var(--color-ivory);
}

.section--forest h1,
.section--forest h2,
.section--forest h3,
.section--forest h4 {
  color: var(--color-ivory);
}

.section--warm {
  background-color: var(--color-ivory-warm);
}

/* === Grid System === */
.grid {
  display: grid;
  gap: var(--grid-gap);
}

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

.grid--asymmetric {
  grid-template-columns: 5fr 7fr;
}

.grid--asymmetric-reverse {
  grid-template-columns: 7fr 5fr;
}

/* === Flex Utilities === */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-xs { gap: var(--space-xs); }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }
.gap-xl { gap: var(--space-xl); }

/* === Spacing Utilities === */
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }

/* === Text Utilities === */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.text-muted { color: var(--color-text-muted); }
.text-gold { color: var(--color-gold); }
.text-forest { color: var(--color-forest); }
.text-white { color: var(--color-white); }
.text-ivory { color: var(--color-ivory); }
.text-balance { text-wrap: balance; }
.mx-auto { margin-left: auto; margin-right: auto; }

/* === Image Utilities === */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

.img-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.img-contain {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* === Dividers === */
.divider {
  width: 100%;
  height: 1px;
  background: var(--border-thin);
  border: none;
}

.divider--gold {
  background: linear-gradient(90deg, transparent, var(--color-gold), transparent);
  height: 1px;
}

/* === Accessibility === */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

:focus-visible {
  outline: 2px solid var(--color-gold);
  outline-offset: 3px;
}

/* === Selection === */
::selection {
  background: var(--color-forest);
  color: var(--color-ivory);
}

/* === Scrollbar === */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--color-ivory);
}

::-webkit-scrollbar-thumb {
  background: var(--color-forest-muted);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-forest);
}

/* === Responsive === */
@media (max-width: 1024px) {
  .grid--2, .grid--3, .grid--4 {
    grid-template-columns: repeat(2, 1fr);
  }
  .grid--asymmetric,
  .grid--asymmetric-reverse {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  :root {
    --header-height: 4rem;
  }
  .grid--2, .grid--3, .grid--4 {
    grid-template-columns: 1fr;
  }
  .section {
    padding-top: clamp(3rem, 8vw, 5rem);
    padding-bottom: clamp(3rem, 8vw, 5rem);
  }
  .hide-mobile { display: none !important; }
}

@media (min-width: 769px) {
  .hide-desktop { display: none !important; }
}
