/* ==========================================================================
   PRC — shared foundation
   Tokens come straight from the Figma variables (PRC-Website file).
   ========================================================================== */

:root {
  /* Colour tokens (Figma variables) */
  --forest-950: #0f1f10;
  --forest-900: #18361a;
  --forest-600: #407844;
  --lime-300: #c6f19d;
  --lime-200: #d5eebc;
  --neutral-50: #f5f4f2;
  --neutral-100: #f0f0e9;
  --neutral-400: #a1a69f;
  --neutral-500: #777c75;
  --neutral-600: #5b5f58;
  --base-white: #ffffff;
  --color-bg-highlight: var(--lime-300);
  --color-text-on-highlight: var(--forest-950);

  /* Type */
  --font-sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --font-serif: "Instrument Serif", Georgia, serif;

  /* Layout: 1280 content column inside a 1440 frame (80px gutters), 16px on phones */
  --content: 1280px;
  --gutter: clamp(16px, 5.5556vw, 80px);

  /* Motion — easings used throughout the Figma motion walkthroughs */
  --ease-expo: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-text: cubic-bezier(0, 0, 0.58, 1);
  --ease-pop: cubic-bezier(0.45, 1.45, 0.8, 1);
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--base-white);
  color: var(--forest-950);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 24px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
body.menu-open { overflow: hidden; }

img, svg, video { display: block; max-width: 100%; }
video[data-ambient] { width: 100%; height: 100%; object-fit: cover; background: var(--forest-950); }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
h1, h2, h3, h4, p { margin: 0; font-weight: inherit; }
ul, ol { margin: 0; padding: 0; list-style: none; }

:focus-visible { outline: 2px solid var(--lime-300); outline-offset: 3px; border-radius: 6px; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 200;
  background: var(--lime-300); color: var(--forest-950);
  padding: 10px 16px; border-radius: 999px; font-weight: 500; font-size: 14px;
  transition: top 0.2s;
}
.skip-link:focus { top: 16px; }

.container {
  width: min(var(--content), 100% - 2 * var(--gutter));
  margin-inline: auto;
}

/* --------------------------------------------------------------------------
   Type styles (Figma text styles)
   -------------------------------------------------------------------------- */
.eyebrow { /* Label/Eyebrow */
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 12px;
  line-height: 16px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.label-md { font-weight: 500; font-size: 14px; line-height: 20px; }   /* Label/Medium */
.label-lg { font-weight: 500; font-size: 16px; line-height: 24px; }   /* Label/Large */
.body-md { font-size: 16px; line-height: 24px; }                      /* Body/Medium */
.body-sm { font-size: 14px; line-height: 20px; }                      /* Body/Small */
.caption { font-size: 12px; line-height: 16px; }                      /* Caption */

/* Two-tone display heading used by every section ("What we do. / Four lines…") */
.display {
  font-weight: 600;
  font-size: clamp(40px, 4.4444vw, 64px);
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--forest-950);
}
.display .muted { color: var(--neutral-500); display: block; }
.display .line { display: block; }
.on-dark .display, .display.on-dark { color: var(--base-white); }
.on-dark .display .muted, .display.on-dark .muted { color: rgba(255, 255, 255, 0.45); }

/* --------------------------------------------------------------------------
   Buttons & links
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 6px 6px 6px 20px;
  border-radius: 999px;
  font-weight: 500;
  font-size: 14px;
  line-height: 20px;
  white-space: nowrap;
  border: 0; /* Figma pills are 44px tall; only the outlined variants carry a 1px border (46px) */
  transition: transform 0.35s var(--ease-expo), box-shadow 0.35s var(--ease-expo), background-color 0.25s;
}
.btn img { width: 32px; height: 32px; flex: none; transition: transform 0.45s var(--ease-expo); }
.btn:hover img { transform: translateX(2px) rotate(-45deg); }
.btn:active { transform: scale(0.98); }
.btn--white { background: var(--base-white); color: var(--forest-950); }
.btn--lime { background: var(--lime-300); color: var(--forest-950); }
.btn--dark { background: var(--forest-950); color: var(--base-white); }
.btn--outline-lime { background: var(--base-white); color: var(--forest-950); border: 1px solid var(--lime-300); }
.btn--bordered { border: 1px solid currentColor; }
.btn--white.btn--bordered { border-color: var(--base-white); }
.btn--lg { padding-left: 24px; }
.btn--lg img { width: 34px; height: 34px; }

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 500;
  font-size: 14px;
  line-height: 20px;
  white-space: nowrap;
}
.link-arrow img { width: 28px; height: 28px; flex: none; transition: transform 0.45s var(--ease-expo); }
.link-arrow:hover img { transform: translateX(4px); }

/* Logo lockup — lime disc + sprout + Instrument Serif wordmark */
.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--base-white); }
.logo__mark {
  display: grid; place-items: center;
  width: 38px; height: 38px; padding: 8px;
  border-radius: 999px; background: var(--color-bg-highlight);
}
.logo__mark img { width: 22px; height: 22px; }
.logo__word {
  font-family: var(--font-serif);
  font-size: 34px;
  line-height: 28px;
  letter-spacing: -0.04em;
}
.logo--dark { color: var(--forest-950); }

/* --------------------------------------------------------------------------
   Navigation
   .site-nav sits over the page hero (dark, transparent).
   .nav-light is the sticky bar that slides in when the visitor scrolls up
   (Figma: "Nav — light (on scroll up)", translateY -110 → 0, 0.45s ease-expo).
   -------------------------------------------------------------------------- */
.site-nav {
  position: absolute; inset: 24px 0 auto; z-index: 50;
}
.site-nav__inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 56px;
}
.site-nav__links { display: flex; gap: 36px; color: var(--base-white); }
.site-nav__links a { position: relative; font-weight: 500; font-size: 14px; line-height: 20px; white-space: nowrap; }
.site-nav__links a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 1px;
  background: currentColor; transform: scaleX(0); transform-origin: left;
  transition: transform 0.4s var(--ease-expo);
}
.site-nav__links a:hover::after,
.site-nav__links a[aria-current="page"]::after { transform: scaleX(1); }
.site-nav__menu-btn { display: none; }

/* Nav entrance on page load: translateY(-90px) → 0 over 0.7s ease-expo */
.site-nav--enter { animation: nav-drop 0.7s var(--ease-expo) both; }
@keyframes nav-drop { from { transform: translateY(-90px); } to { transform: translateY(0); } }

/* Pages with a light hero use a dark-on-light nav */
.site-nav--on-light .site-nav__links { color: var(--forest-950); }
.site-nav--on-light .logo { color: var(--forest-950); }

.nav-light {
  position: fixed; inset: 0 0 auto; z-index: 60;
  height: 104px;
  background: rgba(240, 240, 233, 0.86);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(15, 31, 16, 0.08);
  transform: translateY(-110px);
  transition: transform 0.45s var(--ease-expo);
  visibility: hidden;
}
.nav-light.is-visible { transform: translateY(0); visibility: visible; }
.nav-light:not(.is-visible) { transition: transform 0.45s var(--ease-expo), visibility 0s linear 0.45s; }
.nav-light .site-nav__inner { position: relative; top: 24px; }
.nav-light .logo { color: var(--forest-950); }
/* Figma draws these links white-on-cream (unreadable); forest keeps the same layout legibly. */
.nav-light .site-nav__links { color: var(--forest-950); }

.menu-btn {
  display: none;
  position: relative;
  width: 44px; height: 44px; border-radius: 22px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.25);
}
.menu-btn span {
  position: absolute; left: 13px; width: 18px; height: 1.6px; background: var(--base-white);
  transition: transform 0.4s var(--ease-expo), top 0.4s var(--ease-expo);
}
.menu-btn span { border-radius: 1px; }
/* Figma "Menu button" (296:64): 18px bar over a shorter 12px bar */
.menu-btn span:nth-child(1) { top: 17.9px; }
.menu-btn span:nth-child(2) { top: 24.5px; left: 16px; width: 12px; }
.nav-light .menu-btn { background: rgba(15, 31, 16, 0.06); border-color: rgba(15, 31, 16, 0.14); }
.nav-light .menu-btn span { background: var(--forest-950); }
.site-nav--on-light .menu-btn { background: rgba(15, 31, 16, 0.06); border-color: rgba(15, 31, 16, 0.14); }
.site-nav--on-light .menu-btn span { background: var(--forest-950); }

/* Mobile menu overlay (Figma 303:415) */
.mobile-menu {
  position: fixed; inset: 0; z-index: 100;
  background: var(--forest-950);
  color: var(--base-white);
  padding: 16px;
  display: flex; flex-direction: column;
  opacity: 0; visibility: hidden;
  transition: opacity 0.35s var(--ease-expo), visibility 0s linear 0.35s;
  overflow-y: auto;
}
.mobile-menu.is-open { opacity: 1; visibility: visible; transition: opacity 0.35s var(--ease-expo); }
.mobile-menu__top { display: flex; align-items: center; justify-content: space-between; height: 44px; }
.mobile-menu .logo { gap: 8.5px; }
.mobile-menu .logo__mark { width: 32.3px; height: 32.3px; padding: 6.8px; }
.mobile-menu .logo__mark img { width: 18.7px; height: 18.7px; }
.mobile-menu .logo__word { font-size: 28.9px; line-height: 23.8px; }
.mobile-menu__close { position: relative; }
.mobile-menu__close span:nth-child(1) { top: 21px; transform: rotate(45deg); }
.mobile-menu__close span:nth-child(2) { top: 21px; left: 13px; width: 18px; transform: rotate(-45deg); }
.mobile-menu__links { margin-top: 60px; }
.mobile-menu__links a {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  font-weight: 500; font-size: 20px; line-height: normal; letter-spacing: -0.02em;
  opacity: 0; transform: translateY(16px);
  transition: opacity 0.5s var(--ease-expo), transform 0.5s var(--ease-expo);
}
.mobile-menu__links a img { width: 12.5px; height: 10.5px; }
.mobile-menu.is-open .mobile-menu__links a { opacity: 1; transform: none; }
.mobile-menu.is-open .mobile-menu__links a:nth-child(2) { transition-delay: 0.04s; }
.mobile-menu.is-open .mobile-menu__links a:nth-child(3) { transition-delay: 0.08s; }
.mobile-menu.is-open .mobile-menu__links a:nth-child(4) { transition-delay: 0.12s; }
.mobile-menu.is-open .mobile-menu__links a:nth-child(5) { transition-delay: 0.16s; }
.mobile-menu__bottom { margin-top: 44px; display: flex; flex-direction: column; align-items: flex-start; gap: 16px; }
.mobile-menu__bottom .btn { gap: 12px; padding: 5px 5px 5px 20px; }
.mobile-menu__bottom p { font-size: 13px; line-height: normal; color: rgba(255, 255, 255, 0.65); }

/* --------------------------------------------------------------------------
   Footer (Figma "09 Footer") — CTA row, tractor photo, nav, legal row
   -------------------------------------------------------------------------- */
.site-footer {
  position: relative;
  background: var(--lime-200);
  overflow: hidden;
}
.site-footer__cta {
  display: flex; align-items: center; justify-content: space-between; gap: 32px;
  padding-top: 110px;
  position: relative; z-index: 2;
}
.site-footer__cta .display .line { display: block; }
.site-footer__actions { display: flex; gap: 12px; flex-wrap: wrap; }
.site-footer__media {
  position: relative;
  height: 600px;
  margin-top: 62px;
}
.site-footer__media img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
}
.site-footer__media::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, #d5eebc 0%, rgba(213, 238, 188, 0) 28%, rgba(15, 31, 16, 0.25) 55%, rgba(15, 31, 16, 0.95) 100%);
}
.site-footer__nav {
  position: absolute; left: 0; right: 0; bottom: 48px; z-index: 2;
  display: flex; flex-direction: column; gap: 24px;
  color: var(--base-white);
}
.site-footer__top { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.site-footer__links { display: flex; gap: 28px; flex-wrap: wrap; }
.site-footer__links a { font-weight: 500; font-size: 14px; line-height: 20px; white-space: nowrap; transition: opacity 0.2s; }
.site-footer__links a:hover { opacity: 0.7; }
.site-footer__divider { height: 1px; background: rgba(255, 255, 255, 0.3); }
.site-footer__bottom {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  font-size: 12px; line-height: 16px; white-space: nowrap;
}
.site-footer__contact { display: flex; gap: 24px; }

/* --------------------------------------------------------------------------
   Motion runtime hooks (driven by js/site.js)
   [data-reveal]: rise + fade on scroll into view. Per-element overrides:
     --ry (start offset), --rdur (duration), --rdelay (delay)
   -------------------------------------------------------------------------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(var(--ry, 24px));
  transition:
    opacity var(--rdur, 0.8s) var(--ease-expo) var(--rdelay, 0s),
    transform var(--rdur, 0.8s) var(--ease-expo) var(--rdelay, 0s);
}
[data-reveal].is-in { opacity: var(--rto, 1); transform: none; }

/* Split text: each character is wrapped by site.js */
.split-char {
  display: inline-block;
  opacity: 0;
  transform: translateY(var(--cy, 0px));
  transition:
    opacity var(--cdur, 0.073s) var(--ease-text) var(--cdelay, 0s),
    transform var(--cdur, 0.073s) var(--ease-text) var(--cdelay, 0s);
  will-change: opacity, transform;
}
.split-word { display: inline-block; white-space: nowrap; }
[data-split].is-in .split-char { opacity: 1; transform: none; }

/* No JS / reduced motion: show everything in its resting state */
.no-js [data-reveal], .no-js .split-char { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
  }
  [data-reveal], .split-char { opacity: 1 !important; transform: none !important; }
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1100px) {
  .site-nav__links { gap: 24px; }
  .site-footer__cta { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 900px) {
  .site-nav { inset: 16px 0 auto; }
  .site-nav__inner { height: 44px; }
  .site-nav__links, .site-nav .site-nav__cta, .nav-light .site-nav__links, .nav-light .site-nav__cta { display: none; }
  .menu-btn { display: block; }
  .nav-light { height: 76px; }
  .nav-light .site-nav__inner { top: 16px; height: 44px; }
  .site-nav .logo, .nav-light .logo { gap: 8.5px; }
  .site-nav .logo__mark, .nav-light .logo__mark { width: 32.3px; height: 32.3px; padding: 6.8px; }
  .site-nav .logo__mark img, .nav-light .logo__mark img { width: 18.7px; height: 18.7px; }
  .site-nav .logo__word, .nav-light .logo__word { font-size: 28.9px; line-height: 23.8px; }

  /* Mobile footer (Figma 340:2792): CTA spacing, 2-column link grid, contact above legal */
  .site-footer__cta { padding-top: 64px; gap: 24px; }
  .site-footer__actions { gap: 8px; }
  .site-footer__actions .btn { gap: 10px; padding: 5px 5px 5px 16px; }
  .site-footer__actions .btn img { width: 30px; height: 30px; }
  .site-footer__actions .btn--outline-lime { background: transparent; border-color: rgba(15, 31, 16, 0.3); }
  .site-footer__media { height: 620px; margin-top: 64px; }
  .site-footer__media::after {
    background: linear-gradient(180deg, #d5eebc 0%, rgba(213, 238, 188, 0) 22%, rgba(15, 31, 16, 0.35) 45%, rgba(15, 31, 16, 0.96) 100%);
  }
  .site-footer__nav { gap: 20px; bottom: 40px; }
  .site-footer__top { flex-direction: column; gap: 20px; align-items: stretch; }
  .site-footer__links { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: repeat(3, auto); grid-auto-flow: column; gap: 12px 24px; }
  .site-footer__links a { line-height: normal; }
  .site-footer__divider { background: rgba(255, 255, 255, 0.25); }
  .site-footer__bottom { flex-direction: column; align-items: flex-start; gap: 20px; white-space: normal; }
  .site-footer__bottom > p { order: 2; font-size: 11px; line-height: 1.6; color: rgba(255, 255, 255, 0.6); }
  .site-footer__bottom > p:last-child { margin-top: -20px; }
  .site-footer__contact { order: 1; flex-direction: column; gap: 6px; line-height: normal; color: rgba(255, 255, 255, 0.75); }
}

/* Figma phone frames use a 16px gutter */
@media (max-width: 600px) {
  :root { --gutter: 16px; }
}
