/* ============================================================
   Agro BigGrow - base layer
   Design tokens, reset, shared typography, buttons, motion
   utilities. Loaded on every page.
   Design system: warm cream base, deep pine ink, brand green,
   amber + terracotta accents. Fraunces display / Inter UI /
   JetBrains Mono data.
   ============================================================ */

:root {
  /* palette */
  --cream: #faf7ef;
  --cream-2: #f3eee1;
  --paper: #fffdf6;
  --ink: #14261a;
  --ink-2: #3d4f43;
  --ink-3: #6b7c70;
  --pine: #0e2417;
  --pine-2: #153320;
  --green: #4bad3b;
  --green-2: #6ed45a;
  --green-deep: #2e6a24;
  --green-pastel: #e9f5e4;
  --amber: #f59e0b;
  --amber-pastel: #fdf0d7;
  --terra: #a75f4a;
  --terra-pastel: #f5eae6;
  --line: rgba(20, 38, 26, 0.1);
  --line-strong: rgba(20, 38, 26, 0.16);

  /* type */
  --font-display: "Fraunces", Georgia, serif;
  --font-ui: "Inter", -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  /* rhythm */
  --radius: 20px;
  --radius-lg: 28px;
  --section-pad: clamp(5rem, 10vw, 8.5rem);
  --nav-h: 76px;

  /* shadows */
  --shadow-sm: 0 1px 2px rgba(14, 36, 23, 0.05), 0 4px 14px rgba(14, 36, 23, 0.06);
  --shadow-md: 0 2px 6px rgba(14, 36, 23, 0.06), 0 18px 44px -12px rgba(14, 36, 23, 0.16);
  --shadow-lg: 0 6px 16px rgba(14, 36, 23, 0.08), 0 40px 90px -20px rgba(14, 36, 23, 0.28);
  --shadow-green: 0 8px 24px -6px rgba(75, 173, 59, 0.45);

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ---------- reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-ui);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* film grain */
body::after {
  content: "";
  position: fixed;
  inset: -50%;
  z-index: 2000;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.035;
  animation: grain 9s steps(6) infinite;
}
@keyframes grain {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-2%, 2%); }
  40% { transform: translate(2%, -1%); }
  60% { transform: translate(-1%, -2%); }
  80% { transform: translate(1%, 2%); }
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul, ol { padding: 0; list-style: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
em { font-style: italic; }

::selection { background: var(--green); color: #fff; }

:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 3px;
  border-radius: 4px;
}

.container {
  width: min(1180px, 100% - 3rem);
  margin-inline: auto;
}
.container--narrow { width: min(820px, 100% - 3rem); }

section { scroll-margin-top: calc(var(--nav-h) + 12px); }

/* ---------- shared type ---------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--green-deep);
}
.eyebrow::before {
  content: "";
  flex: none;
  width: 2.2rem;
  height: 2px;
  background: var(--green);
  vertical-align: middle;
}
.eyebrow--light { color: var(--green-2); }
.eyebrow--light::before { background: var(--green-2); }

.section { padding-block: var(--section-pad); position: relative; }
.section--tinted { background: var(--cream-2); }

.section-head {
  position: relative;
  max-width: 720px;
  margin-bottom: clamp(2.75rem, 6vw, 4.5rem);
}
.section-head .eyebrow { margin-bottom: 1.4rem; }

.section-title {
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 4.6vw, 3.4rem);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -0.015em;
}
.section-title em { color: var(--green); font-weight: 500; }
.section--dark .section-title em { color: var(--green-2); }

.section-sub {
  margin-top: 1.15rem;
  font-size: 1.13rem;
  color: var(--ink-2);
  max-width: 60ch;
}
.section--dark .section-sub { color: rgba(250, 247, 239, 0.72); }

/* ---------- buttons ---------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  font-weight: 600;
  font-size: 0.98rem;
  line-height: 1;
  padding: 0.95rem 1.7rem;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: transform 0.35s var(--ease-spring), box-shadow 0.35s var(--ease-out),
    background 0.25s, color 0.25s, border-color 0.25s;
  will-change: transform;
  overflow: hidden;
  white-space: nowrap;
}
.btn .i { width: 18px; height: 18px; transition: transform 0.3s var(--ease-out); }
.btn:hover .i { transform: translateX(3px); }

.btn--primary {
  background: var(--green);
  color: #fff;
  box-shadow: var(--shadow-green);
}
.btn--primary::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.35) 50%, transparent 70%);
  transform: translateX(-120%);
  transition: transform 0.7s var(--ease-out);
}
.btn--primary:hover { background: var(--green-deep); transform: translateY(-2px); }
.btn--primary:hover::before { transform: translateX(120%); }

.btn--ghost {
  border-color: var(--line-strong);
  color: var(--ink);
  background: transparent;
}
.btn--ghost:hover { background: var(--paper); border-color: var(--ink); transform: translate(-2px, -2px); box-shadow: 4px 4px 0 var(--ink); }

.btn--light { background: var(--cream); color: var(--pine); }
.btn--light:hover { background: #fff; transform: translateY(-2px); box-shadow: 0 14px 34px -10px rgba(0, 0, 0, 0.35); }

.btn--outline-light { border-color: rgba(250, 247, 239, 0.4); color: var(--cream); }
.btn--outline-light:hover { border-color: var(--cream); background: rgba(250, 247, 239, 0.08); transform: translateY(-2px); }

.btn--lg { padding: 1.1rem 2rem; font-size: 1.02rem; }
.btn--sm { padding: 0.68rem 1.25rem; font-size: 0.9rem; }

/* handwritten accent type (shared) */
.hand { font-family: "Caveat", "Segoe Script", cursive; font-weight: 600; }

/* ---------- ambient blobs (shared by home + inner pages) ---------- */
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.55;
  will-change: transform;
}
@keyframes drift {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(40px, -34px) scale(1.12); }
}

/* ---------- reveal on scroll ----------
   Only hidden when JS is active (html.js): without JS the
   content must stay visible. */
html.js [data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.85s var(--ease-out), transform 0.85s var(--ease-out);
  transition-delay: var(--d, 0s);
}
html.js [data-reveal].is-inview { opacity: 1; transform: none; }

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html.js [data-reveal], .h-anim { opacity: 1; transform: none; }
  .ticker__track { animation: none; }
  body::after { animation: none; }
}
