/* ============================================================
   AgroAI — site shell (content pages)
   Minimalist dark layout: sticky nav, hero, sections, cards,
   footer. Shares tokens.css. Deliberately restrained — whitespace
   and type do the work; accent green is used sparingly.
   ============================================================ */

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font-body); line-height: 1.65;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
a { color: inherit; }
img { max-width: 100%; display: block; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.container { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 24px; }
.muted { color: var(--muted); }

/* ---- Sticky nav ---- */
.site-nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255, 255, 255, 0.82);
  -webkit-backdrop-filter: blur(14px) saturate(1.1); backdrop-filter: blur(14px) saturate(1.1);
  border-bottom: 1px solid var(--border);
}
.site-nav .inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.nav-logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.nav-logo .mark {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
}
.nav-logo .mark img { width: 100%; height: 100%; object-fit: contain; display: block; }
.nav-logo .name { font-family: var(--font-head); font-weight: 600; font-size: 17px; letter-spacing: -0.01em; }
.nav-logo .name b { color: var(--accent); }
.nav-links { display: flex; align-items: center; gap: 28px; }
.nav-links a { font-size: 14px; color: var(--muted); text-decoration: none; transition: color 0.15s var(--ease); }
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.nav-links .nav-cta {
  display: inline-flex; align-items: center; gap: 7px; padding: 9px 16px; border-radius: var(--r-md);
  background: var(--accent-grad); color: var(--accent-ink); font-weight: 600;
  box-shadow: var(--glass-edge), var(--shadow-glow); transition: transform 0.15s var(--ease), box-shadow 0.2s var(--ease);
}
.nav-links .nav-cta:hover { transform: translateY(-1px); box-shadow: var(--glass-edge), var(--shadow-glow-lg); color: var(--accent-ink); }
.nav-links .nav-cta svg { width: 15px; height: 15px; }
.nav-toggle {
  display: none; width: 40px; height: 40px; border: 1px solid var(--border-strong); border-radius: var(--r-md);
  background: var(--surface-2); color: var(--text); cursor: pointer; align-items: center; justify-content: center;
}
.nav-toggle svg { width: 20px; height: 20px; }

/* ---- Buttons ---- */
.site-btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 13px 22px; border-radius: var(--r-md);
  font-family: var(--font-body); font-weight: 600; font-size: 15px; text-decoration: none;
  border: 1px solid transparent; cursor: pointer;
  transition: transform 0.15s var(--ease), box-shadow 0.2s var(--ease), background 0.15s var(--ease), border-color 0.15s var(--ease);
}
.site-btn svg { width: 17px; height: 17px; }
.site-btn-primary { background: var(--accent-grad); color: var(--accent-ink); box-shadow: var(--glass-edge), var(--shadow-glow); }
.site-btn-primary:hover { transform: translateY(-2px); box-shadow: var(--glass-edge), var(--shadow-glow-lg); }
.site-btn-ghost { border-color: var(--border-strong); color: var(--text); }
.site-btn-ghost:hover { border-color: var(--accent-line); background: var(--surface-2); transform: translateY(-2px); }

/* ---- Hero ---- */
.hero { position: relative; overflow: hidden; padding: clamp(64px, 12vw, 120px) 0 clamp(48px, 8vw, 88px); text-align: center; }
.hero::before {
  content: ""; position: absolute; left: 50%; top: -10%; width: 760px; height: 520px; transform: translateX(-50%);
  background: radial-gradient(50% 50% at 50% 0, rgba(46, 125, 50, 0.10), transparent 72%); pointer-events: none;
}
.eyebrow { font-size: 12px; text-transform: uppercase; letter-spacing: 0.16em; color: var(--accent); font-weight: 600; }
.hero h1 {
  font-family: var(--font-head); font-weight: 600; font-size: clamp(36px, 6.4vw, 66px); line-height: 1.04;
  letter-spacing: -0.025em; margin: 18px auto; max-width: 14ch; color: var(--text);
}
.hero .lead { font-size: clamp(16px, 2.3vw, 20px); color: var(--muted); max-width: 600px; margin: 0 auto 34px; }
/* Hero subtitle under the wordmark — deliberately a step smaller than the h1. */
.hero .hero-powered { font-family: var(--font-head); font-weight: 600; font-size: clamp(20px, 3.4vw, 32px); letter-spacing: -0.02em; color: var(--muted); margin: 10px auto 30px; }
.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ---- Inner page hero (how / about / weather) ---- */
.page-hero { padding: clamp(48px, 8vw, 80px) 0 clamp(24px, 4vw, 40px); }
.page-hero h1 { font-family: var(--font-head); font-weight: 600; font-size: clamp(30px, 5vw, 46px); letter-spacing: -0.02em; margin: 14px 0 14px; }
.page-hero .lead { font-size: clamp(16px, 2.2vw, 19px); color: var(--muted); max-width: 640px; margin: 0; }

/* ---- Sections ---- */
.section { padding: clamp(48px, 8vw, 84px) 0; border-top: 1px solid var(--border); }
.section-head { max-width: 640px; margin: 0 auto clamp(32px, 5vw, 56px); text-align: center; }
.section-head h2 { font-family: var(--font-head); font-weight: 600; font-size: clamp(26px, 4vw, 38px); letter-spacing: -0.015em; margin: 0 0 12px; }
.section-head p { color: var(--muted); margin: 0; font-size: 16px; }

/* ---- Cards ---- */
.grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(248px, 1fr)); }
.card {
  background: var(--surface-sheen), var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 28px; box-shadow: var(--glass-edge);
  transition: transform 0.25s var(--ease), border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.card:hover { transform: translateY(-4px); border-color: var(--border-strong); box-shadow: var(--glass-edge), var(--shadow-chrome); }
.card .ic {
  width: 46px; height: 46px; border-radius: 13px; background: var(--accent-weak); color: var(--accent);
  display: flex; align-items: center; justify-content: center; margin-bottom: 18px; box-shadow: var(--glass-edge);
}
.card.water .ic { background: var(--water-weak); color: var(--water); }
.card.wheat .ic { background: var(--wheat-weak); color: var(--wheat); }
.card .ic svg { width: 22px; height: 22px; }
.card h3 { font-family: var(--font-head); font-weight: 600; font-size: 18px; margin: 0 0 8px; }
.card p { color: var(--muted); margin: 0; font-size: 14.5px; line-height: 1.6; }
.card .more { display: inline-flex; align-items: center; gap: 5px; margin-top: 16px; font-size: 13.5px; font-weight: 600; color: var(--accent); text-decoration: none; }
.card .more svg { width: 14px; height: 14px; transition: transform 0.15s var(--ease); }
.card:hover .more svg { transform: translateX(3px); }

/* ---- Numbered flow (how it works) ---- */
.flow { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(248px, 1fr)); }
.flow-step { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 28px 24px; box-shadow: var(--glass-edge); }
.flow-step .n { font-family: var(--font-head); font-size: 13px; font-weight: 600; color: var(--accent-ink); background: var(--accent-grad); width: 30px; height: 30px; border-radius: 9px; display: flex; align-items: center; justify-content: center; box-shadow: var(--glass-edge), var(--shadow-glow); margin-bottom: 16px; }
.flow-step h3 { font-family: var(--font-head); font-weight: 600; font-size: 17px; margin: 0 0 8px; }
.flow-step p { color: var(--muted); margin: 0; font-size: 14.5px; }

/* ---- Irrigation colour legend (green / yellow / red) ---- */
.irr-legend { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.irr-row { display: flex; align-items: center; gap: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 16px 18px; box-shadow: var(--glass-edge); }
.irr-dot { width: 30px; height: 30px; border-radius: 9px; flex: none; display: flex; align-items: center; justify-content: center; box-shadow: var(--glass-edge); }
.irr-dot svg { width: 17px; height: 17px; }
.irr-row b { font-family: var(--font-head); font-weight: 600; font-size: 15px; display: block; }
.irr-row span { color: var(--muted); font-size: 13.5px; }

/* ---- Prose (about) ---- */
.prose { max-width: 720px; margin: 0 auto; }
.prose h2 { font-family: var(--font-head); font-weight: 600; font-size: clamp(22px, 3.2vw, 28px); letter-spacing: -0.01em; margin: 40px 0 14px; }
.prose p { color: var(--muted); font-size: 16px; line-height: 1.75; margin: 0 0 16px; }
.prose strong { color: var(--text); font-weight: 600; }

/* ---- Badge ---- */
.badge { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; padding: 6px 13px; border-radius: var(--r-pill); background: var(--accent-weak); color: var(--accent); border: 1px solid var(--accent-line); }
.badge svg { width: 13px; height: 13px; }

/* ---- CTA band ---- */
.cta-band { text-align: center; }
.cta-band h2 { font-family: var(--font-head); font-weight: 600; font-size: clamp(26px, 4.4vw, 40px); letter-spacing: -0.02em; margin: 0 0 14px; }
.cta-band p { color: var(--muted); margin: 0 auto 28px; max-width: 520px; }

/* ---- Footer ---- */
.site-foot { border-top: 1px solid var(--border); padding: 44px 0; }
.site-foot .inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.site-foot .brand { display: flex; align-items: center; gap: 9px; font-family: var(--font-head); font-weight: 600; }
.site-foot .brand b { color: var(--accent); }
.foot-links a { color: var(--muted); text-decoration: none; margin-left: 22px; font-size: 14px; transition: color 0.15s var(--ease); }
.foot-links a:first-child { margin-left: 0; }
.foot-links a:hover { color: var(--text); }
.site-foot .copy { width: 100%; color: var(--muted-2); font-size: 12.5px; margin-top: 8px; }

/* ---- Scroll reveal (progressive enhancement) ----
   Elements only hide once JS adds `.reveals-armed` to <html>, so if the script
   never runs the content is fully visible — it can never get stuck blank. */
.reveal { transition: opacity 0.6s var(--ease), transform 0.6s var(--ease); }
html.reveals-armed .reveal { opacity: 0; transform: translateY(18px); }
html.reveals-armed .reveal.in { opacity: 1; transform: none; }

/* ---- Responsive ---- */
@media (max-width: 760px) {
  .nav-toggle { display: flex; }
  .nav-links {
    position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 4px;
    background: rgba(255, 255, 255, 0.95); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border); padding: 12px 24px 18px;
    transform: translateY(-8px); opacity: 0; pointer-events: none; transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
  }
  .site-nav.open .nav-links { transform: none; opacity: 1; pointer-events: auto; }
  .nav-links a { padding: 12px 4px; font-size: 16px; border-bottom: 1px solid var(--border); }
  .nav-links .nav-cta { justify-content: center; margin-top: 8px; border-bottom: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
  html.reveals-armed .reveal { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}
