/* ======================================================================
   Farm Site Styles — Monolithic styles.css
   Visual direction: rustic editorial, warm paper surfaces, muted greens/clays,
   high-contrast serif typography, light rule-lines, minimal gloss.
   ====================================================================== */

/* ----------------------------- 1) Reset ------------------------------ */

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

html, body { height: 100%; }

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

body { margin: 0; }

img, svg, video, canvas {
  display: block;
  max-width: 100%;
  height: auto;
}

input, button, textarea, select {
  font: inherit;
  color: inherit;
}

button { cursor: pointer; }

a { color: inherit; }

:focus-visible {
  outline: 2px solid rgba(120, 92, 70, 0.75);
  outline-offset: 3px;
}

/* ------------------------ 2) Design tokens -------------------------- */

:root {
  /* Neutrals (paper/ink) */
  --paper: #fbfafb;
  --paper-2: #f1f1f1;
  --oat: #dadcc9;
  --stone: #d8d7d5;
  --ash: #b6b4ad;

  --ink: #251713;
  --ink-2: #33383b;
  --coal: #121613;

  /* Farm palette (muted, earthy) */
  --sage: #455d50;
  --sage-2: #40483f;
  --sage-3: #384c41;

  --clay: #887a6a;
  --tan: #9f886a;
  --wood: #5b3f31;

  --terracotta: #da8246;
  --cider: #c87631;
  --orange: #f76f35;

  --wine: #822536;
  --wine-2: #7e2033;

  /* Rules & shadows (avoid "modern" floatiness) */
  --rule: rgba(37, 23, 19, 0.18);
  --rule-strong: rgba(37, 23, 19, 0.32);
  --shadow: 0 1px 0 rgba(18, 22, 19, 0.22);
  --shadow-soft: 0 2px 0 rgba(18, 22, 19, 0.16);

  /* Radius: small + squared-off */
  --r-1: 6px;
  --r-2: 10px;

  /* Spacing */
  --s-1: 6px;
  --s-2: 10px;
  --s-3: 14px;
  --s-4: 18px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 44px;
  --s-8: 64px;

  /* Typography */
  --serif: "Cormorant Garamond", Georgia, "Times New Roman", Times, serif;
  --sans: "Source Sans Pro", ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;

  --fs-0: 0.875rem; /* 14 */
  --fs-1: 1rem;     /* 16 */
  --fs-2: 1.125rem; /* 18 */
  --fs-3: 1.35rem;  /* ~22 */
  --fs-4: clamp(1.6rem, 1.2rem + 1.4vw, 2.4rem);
  --fs-5: clamp(2.2rem, 1.6rem + 2.3vw, 3.4rem);

  --lh-tight: 1.18;
  --lh: 1.55;

  /* Layout */
  --wrap: 1120px;
  --gutter: clamp(16px, 2.6vw, 32px);
}

/* Subtle paper texture without images (very low contrast) */
body {
  background:
    radial-gradient(1200px 700px at 20% 0%, rgba(136, 122, 106, 0.10), transparent 60%),
    radial-gradient(900px 600px at 90% 30%, rgba(69, 93, 80, 0.10), transparent 55%),
    repeating-linear-gradient(0deg, rgba(37, 23, 19, 0.015) 0, rgba(37, 23, 19, 0.015) 1px, transparent 1px, transparent 7px),
    linear-gradient(180deg, var(--paper), var(--paper-2));
  color: var(--ink);
  font-family: var(--serif);
  line-height: var(--lh);
}

/* ------------------------ 3) Typography ----------------------------- */

h1, h2, h3, h4 {
  margin: 0 0 var(--s-3) 0;
  line-height: var(--lh-tight);
  letter-spacing: -0.01em;
}

h1 { font-size: var(--fs-5); }
h2 { font-size: var(--fs-4); }
h3 { font-size: var(--fs-3); }
h4 { font-size: var(--fs-2); }

p { margin: 0 0 var(--s-4) 0; font-size: var(--fs-1); }

small, .small { font-size: var(--fs-0); }

.kicker, .eyebrow {
  font-family: var(--sans);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.78rem;
  color: rgba(37, 23, 19, 0.72);
}

.rule {
  height: 1px;
  background: var(--rule);
  border: 0;
  margin: var(--s-5) 0;
}

a {
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover { text-decoration-thickness: 2px; }

blockquote {
  margin: var(--s-5) 0;
  padding: var(--s-4) var(--s-5);
  border-left: 3px solid var(--rule-strong);
  background: rgba(218, 220, 201, 0.35);
  box-shadow: var(--shadow);
}

/* --------------------- 4) Layout primitives ------------------------- */

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

.section {
  padding: var(--s-8) 0;
}

.section--tight { padding: var(--s-7) 0; }

.stack > * + * { margin-top: var(--s-4); }

.grid {
  display: grid;
  gap: var(--s-6);
}

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

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

@media (max-width: 900px) {
  .grid--2, .grid--3 { grid-template-columns: 1fr; }
}

/* --------------------- 5) Surfaces / Panels ------------------------- */

.surface {
  background: rgba(251, 250, 251, 0.92);
  border: 1px solid var(--rule);
  border-radius: var(--r-1);
  box-shadow: var(--shadow);
}

.surface--oat { background: rgba(218, 220, 201, 0.55); }
.surface--sage { background: rgba(69, 93, 80, 0.12); }
.surface--clay { background: rgba(136, 122, 106, 0.18); }

.panel {
  padding: var(--s-6);
}

.panel--tight { padding: var(--s-5); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.55em;
  padding: 0.45em 0.8em;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: rgba(251, 250, 251, 0.75);
  font-family: var(--sans);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(37, 23, 19, 0.76);
}

/* --------------------- 6) Navigation / Header ----------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(251, 250, 251, 0.92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--rule);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-5);
  padding: var(--s-3) 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--s-3);
  text-decoration: none;
}

.brand__mark {
  width: 56px;
  height: 56px;
  flex: 0 0 auto;
  border-radius: 14px;
  border: 1px solid var(--rule);
  background: rgba(251, 250, 251, 0.96);
  box-shadow: var(--shadow);
  padding: 6px;
  overflow: hidden;
}

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

.brand__name {
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  line-height: 1.1;
}

.brand__sub {
  display: block;
  font-family: var(--sans);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(37, 23, 19, 0.62);
}

.nav {
  display: flex;
  gap: var(--s-4);
  align-items: center;
  flex-wrap: wrap;
  font-family: var(--sans);
}

.nav a {
  padding: 0.55em 0.75em;
  border-radius: var(--r-1);
  text-decoration: none;
  border: 1px solid transparent;
  color: rgba(37, 23, 19, 0.82);
}

.nav a:hover {
  background: rgba(218, 220, 201, 0.45);
  border-color: var(--rule);
}

.nav a[aria-current="page"] {
  background: rgba(69, 93, 80, 0.12);
  border-color: rgba(69, 93, 80, 0.28);
}

/* -------------------------- 7) Buttons ------------------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55em;
  padding: 0.75em 1.05em;
  border-radius: var(--r-1);
  border: 1px solid var(--rule);
  background: rgba(251, 250, 251, 0.75);
  box-shadow: var(--shadow);
  font-family: var(--sans);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.82rem;
  text-decoration: none;
}

.btn:hover { box-shadow: var(--shadow-soft); }

.btn:active { transform: translateY(1px); }

.btn--primary {
  background: linear-gradient(180deg, rgba(218, 130, 70, 0.92), rgba(200, 118, 49, 0.92));
  border-color: rgba(91, 63, 49, 0.35);
  color: var(--coal);
}

.btn--sage {
  background: linear-gradient(180deg, rgba(69, 93, 80, 0.92), rgba(56, 76, 65, 0.92));
  border-color: rgba(18, 22, 19, 0.35);
  color: var(--paper);
}

.btn--ghost {
  background: transparent;
  border-color: var(--rule);
}

.btn--small {
  padding: 0.55em 0.85em;
  font-size: 0.78rem;
}

/* --------------------------- 8) Hero -------------------------------- */

.hero {
  padding: calc(var(--s-8) + var(--s-4)) 0 var(--s-8) 0;
}

.hero__grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: var(--s-7);
  align-items: center;
}

@media (max-width: 900px) {
  .hero__grid { grid-template-columns: 1fr; }
}

.hero__title {
  margin-bottom: var(--s-3);
}

.hero__lead {
  font-size: var(--fs-2);
  color: rgba(37, 23, 19, 0.82);
  max-width: 58ch;
}

.hero__cta {
  display: flex;
  gap: var(--s-3);
  flex-wrap: wrap;
  margin-top: var(--s-5);
}

.hero__media {
  border-radius: var(--r-2);
  border: 1px solid var(--rule);
  background:
    linear-gradient(180deg, rgba(69, 93, 80, 0.24), rgba(136, 122, 106, 0.16));
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

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

.hero__media--framed {
  padding: var(--s-3);
  background:
    radial-gradient(600px 420px at 20% 0%, rgba(218, 130, 70, 0.20), transparent 60%),
    linear-gradient(180deg, rgba(251, 250, 251, 0.9), rgba(218, 220, 201, 0.55));
}

/* --------------------- 9) Cards / Tiles ----------------------------- */

.card {
  border: 1px solid var(--rule);
  border-radius: var(--r-1);
  background: rgba(251, 250, 251, 0.88);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card__inner { padding: var(--s-6); }

.card__title { margin-bottom: var(--s-2); }

.card__meta {
  margin-top: var(--s-4);
  display: flex;
  gap: var(--s-3);
  flex-wrap: wrap;
  font-family: var(--sans);
  font-size: 0.82rem;
  color: rgba(37, 23, 19, 0.70);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.tile-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--s-5);
}

@media (max-width: 980px) {
  .tile-grid { grid-template-columns: 1fr; }
}

/* Icon tiles (small PNGs like img-keleman_point-*) */
.icon-tile {
  display: grid;
  gap: var(--s-3);
}

.icon-tile__top {
  display: flex;
  align-items: center;
  gap: var(--s-3);
}

.icon-tile__img {
  width: 76px;
  height: 76px;
  object-fit: contain;
  flex: 0 0 auto;
  filter: drop-shadow(0 1px 0 rgba(18, 22, 19, 0.18));
}

.icon-tile__title {
  margin: 0;
}

/* -------------------- 10) Metrics / Feature rows -------------------- */

.metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--s-5);
  align-items: start;
}

@media (max-width: 980px) {
  .metrics { grid-template-columns: 1fr; }
}

.metric {
  padding: var(--s-5);
  border: 1px solid var(--rule);
  border-radius: var(--r-1);
  background: rgba(218, 220, 201, 0.35);
  box-shadow: var(--shadow);
}

.metric__label {
  font-family: var(--sans);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.76rem;
  color: rgba(37, 23, 19, 0.70);
  margin-bottom: var(--s-2);
}

.metric__value {
  font-size: 1.25rem;
  margin: 0;
}

.metric__desc {
  margin: var(--s-2) 0 0 0;
  color: rgba(37, 23, 19, 0.82);
}

/* ---------------------- 11) Accordion (details) --------------------- */
/* Use semantic <details> <summary> for a sturdy, non-JS accordion. */

.accordion {
  display: grid;
  gap: var(--s-4);
}

details.accordion__item {
  border: 1px solid var(--rule);
  border-radius: var(--r-1);
  background: rgba(251, 250, 251, 0.88);
  box-shadow: var(--shadow);
  overflow: hidden;
}

details.accordion__item[open] {
  border-color: var(--rule-strong);
}

.accordion__summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  padding: var(--s-5) var(--s-6);
  font-family: var(--sans);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.85rem;
  cursor: pointer;
}

.accordion__summary::-webkit-details-marker { display: none; }

.accordion__chev {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 1px solid var(--rule);
  display: grid;
  place-items: center;
  background: rgba(218, 220, 201, 0.35);
  box-shadow: var(--shadow);
  flex: 0 0 auto;
}

details[open] .accordion__chev { transform: rotate(180deg); }

.accordion__body {
  border-top: 1px solid var(--rule);
  padding: var(--s-5) var(--s-6);
}

.accordion__body ul {
  margin: 0;
  padding-left: 1.25rem;
}

.accordion__body li + li { margin-top: 0.35rem; }

/* -------------------------- 12) Forms ------------------------------- */

.form {
  display: grid;
  gap: var(--s-4);
}

.label {
  font-family: var(--sans);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.78rem;
  color: rgba(37, 23, 19, 0.72);
}

.input, textarea, select {
  width: 100%;
  padding: 0.75em 0.9em;
  border: 1px solid var(--rule);
  border-radius: var(--r-1);
  background: rgba(251, 250, 251, 0.78);
  box-shadow: inset 0 1px 0 rgba(18, 22, 19, 0.08);
}

textarea { min-height: 140px; resize: vertical; }

.help {
  font-size: var(--fs-0);
  color: rgba(37, 23, 19, 0.66);
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-4);
}

@media (max-width: 760px) {
  .field-row { grid-template-columns: 1fr; }
}

/* --------------------------- 13) Tables ----------------------------- */

.table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--rule);
  background: rgba(251, 250, 251, 0.88);
  box-shadow: var(--shadow);
  border-radius: var(--r-1);
  overflow: hidden;
}

.table th, .table td {
  padding: 0.9em 1em;
  border-bottom: 1px solid var(--rule);
  text-align: left;
  vertical-align: top;
}

.table th {
  font-family: var(--sans);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.78rem;
  background: rgba(218, 220, 201, 0.45);
}

.table tr:last-child td { border-bottom: 0; }

/* ------------------------- 14) Media blocks ------------------------- */

.figure {
  margin: 0;
}

.figure__frame {
  border: 1px solid var(--rule);
  border-radius: var(--r-2);
  background: rgba(218, 220, 201, 0.25);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.figure__frame--padded {
  padding: var(--s-4);
  background:
    radial-gradient(600px 420px at 20% 0%, rgba(218, 130, 70, 0.14), transparent 60%),
    linear-gradient(180deg, rgba(251, 250, 251, 0.92), rgba(218, 220, 201, 0.45));
}

.figure__caption {
  margin-top: var(--s-3);
  font-family: var(--sans);
  font-size: 0.82rem;
  color: rgba(37, 23, 19, 0.70);
}

/* --------------------------- 15) Footer ----------------------------- */

.site-footer {
  border-top: 1px solid var(--rule);
  background:
    radial-gradient(800px 500px at 20% 0%, rgba(130, 37, 54, 0.10), transparent 60%),
    linear-gradient(180deg, rgba(218, 220, 201, 0.35), rgba(251, 250, 251, 0.9));
  padding: var(--s-7) 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: var(--s-7);
}

@media (max-width: 900px) {
  .footer-grid { grid-template-columns: 1fr; }
}

.footer-links {
  display: grid;
  gap: var(--s-2);
  font-family: var(--sans);
}

.footer-links a {
  text-decoration: none;
  border-bottom: 1px solid transparent;
  width: fit-content;
  padding-bottom: 2px;
}

.footer-links a:hover { border-bottom-color: var(--rule-strong); }

/* -------------------------- 16) Utilities --------------------------- */

.bg-sage {
  background:
    radial-gradient(900px 560px at 10% 0%, rgba(251, 250, 251, 0.12), transparent 60%),
    linear-gradient(180deg, rgba(69, 93, 80, 0.92), rgba(56, 76, 65, 0.92));
  color: var(--paper);
}

.bg-clay {
  background:
    radial-gradient(900px 560px at 10% 0%, rgba(251, 250, 251, 0.18), transparent 62%),
    linear-gradient(180deg, rgba(136, 122, 106, 0.90), rgba(120, 92, 70, 0.90));
  color: var(--paper);
}

.bg-wine {
  background:
    radial-gradient(900px 560px at 10% 0%, rgba(251, 250, 251, 0.10), transparent 60%),
    linear-gradient(180deg, rgba(130, 37, 54, 0.92), rgba(94, 35, 49, 0.92));
  color: var(--paper);
}

.muted { color: rgba(37, 23, 19, 0.72); }

.center { text-align: center; }

.max-60ch { max-width: 60ch; }

.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;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
  details[open] .accordion__chev { transform: none; }
}

/* ----------------------- 17) Default content ------------------------ */

main :where(ul, ol) { padding-left: 1.25rem; }

main :where(li) { margin: 0.15rem 0; }

main :where(hr) {
  border: 0;
  height: 1px;
  background: var(--rule);
  margin: var(--s-6) 0;
}

main :where(code) {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.95em;
  background: rgba(218, 220, 201, 0.45);
  padding: 0.15em 0.35em;
  border-radius: 4px;
  border: 1px solid rgba(37, 23, 19, 0.14);
}

main :where(pre) {
  padding: var(--s-5);
  background: rgba(37, 23, 19, 0.92);
  color: var(--paper);
  border-radius: var(--r-1);
  overflow: auto;
  box-shadow: var(--shadow);
  border: 1px solid rgba(251, 250, 251, 0.16);
}

main :where(pre code) {
  background: transparent;
  border: 0;
  padding: 0;
  color: inherit;
}

/* ======================================================================
   End styles.css
   ====================================================================== */
