/* ==========================================================================
   DotCom Agri-Life — Design System
   Palette drawn from Ethiopian farmland: turned soil, young leaf, ripe
   wheat. Cards borrow the perforated-stub language of a field service
   ticket, since the whole site revolves around booking/registering for
   services. Type pairs a warm serif (headings) with a humanist sans
   (body) that stays legible at small sizes on low-end phones.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,600;9..144,700;9..144,900&family=Work+Sans:wght@400;500;600;700&family=JetBrains+Mono:wght@500;600&display=swap');

:root {
  /* Color */
  --color-forest: #1F3D24;
  --color-forest-dark: #14281A;
  --color-leaf: #4C7A3D;
  --color-leaf-light: #6FA35C;
  --color-wheat: #E4A93B;
  --color-wheat-light: #F3CE84;
  --color-soil: #7A4B2B;
  --color-soil-light: #A87A52;
  --color-cream: #FAF6EC;
  --color-cream-dark: #F1E9D6;
  --color-ink: #20261E;
  --color-ink-soft: #4A5147;
  --color-white: #FFFFFF;
  --color-danger: #B3402A;
  --color-success: #3B7A3E;
  --color-border: #E1D8C2;

  /* Type */
  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Work Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;

  /* Scale */
  --step--1: clamp(0.83rem, 0.8rem + 0.15vw, 0.9rem);
  --step-0: clamp(1rem, 0.95rem + 0.2vw, 1.125rem);
  --step-1: clamp(1.2rem, 1.1rem + 0.4vw, 1.4rem);
  --step-2: clamp(1.5rem, 1.3rem + 0.8vw, 1.9rem);
  --step-3: clamp(1.9rem, 1.6rem + 1.4vw, 2.6rem);
  --step-4: clamp(2.4rem, 1.9rem + 2.2vw, 3.6rem);
  --step-5: clamp(3rem, 2.2rem + 3.6vw, 5rem);

  /* Layout */
  --container-max: 1200px;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 22px;
  --shadow-sm: 0 2px 8px rgba(20, 40, 26, 0.08);
  --shadow-md: 0 8px 24px rgba(20, 40, 26, 0.12);
  --shadow-lg: 0 20px 48px rgba(20, 40, 26, 0.18);
  --transition: 220ms cubic-bezier(.4,0,.2,1);
  --header-height: 76px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--color-ink);
  background: var(--color-cream);
  font-size: var(--step-0);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4 { font-family: var(--font-display); color: var(--color-forest-dark); margin: 0 0 0.5em; line-height: 1.15; font-weight: 700; }
h1 { font-size: var(--step-5); }
h2 { font-size: var(--step-4); }
h3 { font-size: var(--step-2); }
h4 { font-size: var(--step-1); }
p { margin: 0 0 1em; color: var(--color-ink-soft); }
button, input, select, textarea { font-family: inherit; font-size: inherit; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

/* Visible keyboard focus everywhere */
a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid var(--color-wheat);
  outline-offset: 2px;
  border-radius: 4px;
}

.container { max-width: var(--container-max); margin: 0 auto; padding: 0 24px; }
.section { padding: 88px 0; }
.section-tight { padding: 56px 0; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: var(--step--1); font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--color-leaf);
  margin-bottom: 14px;
}
.eyebrow::before { content: ''; width: 22px; height: 2px; background: var(--color-wheat); display: inline-block; }
.section-head { max-width: 640px; margin-bottom: 48px; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.lead { font-size: var(--step-1); color: var(--color-ink-soft); }

/* ---------- Buttons ---------- */
.btn {
  position: relative;
  overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 28px;
  border-radius: 999px;
  font-weight: 600;
  font-size: var(--step--1);
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition), color var(--transition);
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--color-leaf); color: var(--color-white); box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--color-forest); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.btn-secondary { background: transparent; color: var(--color-forest); border-color: var(--color-forest); }
.btn-secondary:hover { background: var(--color-forest); color: var(--color-white); transform: translateY(-2px); }
.btn-wheat { background: var(--color-wheat); color: var(--color-forest-dark); box-shadow: var(--shadow-sm); }
.btn-wheat:hover { background: var(--color-wheat-light); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.6; cursor: not-allowed; transform: none !important; }

/* Ripple effect */
.btn .ripple {
  position: absolute; border-radius: 50%; transform: scale(0);
  animation: ripple-anim 600ms linear; background: rgba(255,255,255,0.5); pointer-events: none;
}
@keyframes ripple-anim { to { transform: scale(3.2); opacity: 0; } }

/* ---------- Loading overlay ---------- */
#page-loader {
  position: fixed; inset: 0; z-index: 9999; background: var(--color-cream);
  display: flex; align-items: center; justify-content: center;
  transition: opacity 420ms ease, visibility 420ms ease;
}
#page-loader.loaded { opacity: 0; visibility: hidden; pointer-events: none; }
.loader-mark {
  width: 64px; height: 64px; border-radius: 50%;
  border: 4px solid var(--color-cream-dark);
  border-top-color: var(--color-leaf);
  animation: spin 900ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 500;
  background: rgba(250, 246, 236, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-border);
  transition: box-shadow var(--transition), background var(--transition);
}
.site-header.scrolled { box-shadow: var(--shadow-sm); }
.topbar {
  background: var(--color-forest-dark); color: var(--color-cream);
  font-size: var(--step--1); font-family: var(--font-mono);
}
.topbar .container { display: flex; justify-content: space-between; align-items: center; padding-top: 8px; padding-bottom: 8px; flex-wrap: wrap; gap: 8px; }
.topbar a { color: var(--color-wheat-light); font-weight: 600; }
.topbar .call-number { display: inline-flex; align-items: center; gap: 6px; }

.navbar { height: var(--header-height); display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 700; font-size: var(--step-1); color: var(--color-forest-dark); }
.brand-mark {
  width: 42px; height: 42px; border-radius: 50%; background: var(--color-leaf);
  display: flex; align-items: center; justify-content: center; color: var(--color-cream); font-size: 1.2rem;
  flex-shrink: 0;
}
.brand small { display: block; font-family: var(--font-body); font-weight: 500; font-size: 0.6rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--color-leaf); }

.nav-links { display: flex; align-items: center; gap: 6px; }
.nav-links a {
  padding: 10px 16px; border-radius: 999px; font-weight: 600; font-size: var(--step--1);
  color: var(--color-ink-soft); transition: background var(--transition), color var(--transition);
  position: relative;
}
.nav-links a:hover, .nav-links a.active { background: var(--color-forest); color: var(--color-white); }
.nav-cta { margin-left: 8px; }

.menu-toggle {
  display: none; flex-direction: column; justify-content: center; gap: 5px;
  width: 44px; height: 44px; border: none; background: var(--color-cream-dark); border-radius: var(--radius-sm);
  cursor: pointer;
}
.menu-toggle span { display: block; width: 20px; height: 2px; background: var(--color-forest-dark); margin: 0 auto; transition: transform var(--transition), opacity var(--transition); }
.menu-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle.open span:nth-child(2) { opacity: 0; }
.menu-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* The mobile drawer must stay off-canvas at EVERY viewport width by
   default — it only becomes visible when .open is toggled by JS inside
   the small-screen media query in responsive.css. Without this base
   rule, the drawer (with its own logo, nav links, and close button)
   renders as a normal in-flow block on desktop/laptop widths, which
   looks like a duplicated header sitting above the page content. */
.mobile-drawer {
  position: fixed; top: 0; right: 0; height: 100vh; width: min(320px, 84vw);
  background: var(--color-white); z-index: 600; box-shadow: var(--shadow-lg);
  transform: translateX(100%); transition: transform 320ms cubic-bezier(.4,0,.2,1);
  padding: 24px; overflow-y: auto;
}
.drawer-overlay {
  position: fixed; inset: 0; background: rgba(20,40,26,0.5); z-index: 550;
  opacity: 0; visibility: hidden; transition: opacity var(--transition), visibility var(--transition);
}

/* ---------- Breadcrumb ---------- */
.breadcrumb-bar { background: var(--color-cream-dark); border-bottom: 1px solid var(--color-border); }
.breadcrumb { display: flex; align-items: center; gap: 8px; padding: 14px 0; font-size: var(--step--1); color: var(--color-ink-soft); flex-wrap: wrap; }
.breadcrumb a { color: var(--color-leaf); font-weight: 600; }
.breadcrumb .sep { color: var(--color-soil-light); }
.breadcrumb .current { color: var(--color-forest-dark); font-weight: 600; }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  background: linear-gradient(160deg, var(--color-forest-dark) 0%, var(--color-forest) 62%, var(--color-leaf) 100%);
  color: var(--color-cream);
  padding: 72px 0 120px;
}
.hero::after {
  content: ''; position: absolute; right: -8%; bottom: -30%; width: 620px; height: 620px;
  background: radial-gradient(circle, rgba(228,169,59,0.24) 0%, transparent 70%);
  pointer-events: none;
}
.hero-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 56px; align-items: center; position: relative; z-index: 1; }
.hero-eyebrow { color: var(--color-wheat-light); }
.hero-eyebrow::before { background: var(--color-wheat); }
.hero h1 { color: var(--color-white); }
.hero h1 .accent { color: var(--color-wheat); }
.hero-lead { color: rgba(250,246,236,0.85); font-size: var(--step-1); max-width: 46ch; }
.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 32px; }
.hero-call {
  margin-top: 32px; display: inline-flex; align-items: center; gap: 14px;
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.18);
  padding: 14px 22px; border-radius: var(--radius-lg);
}
.hero-call .num { font-family: var(--font-mono); font-size: var(--step-2); font-weight: 600; color: var(--color-wheat); }
.hero-call .label { font-size: var(--step--1); color: rgba(250,246,236,0.75); }

.hero-visual {
  position: relative; border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-lg);
  aspect-ratio: 4/5;
}
.hero-visual img { width: 100%; height: 100%; object-fit: cover; }
.hero-stat-card {
  position: absolute; left: -20px; bottom: -20px; background: var(--color-white); color: var(--color-ink);
  border-radius: var(--radius-md); padding: 18px 22px; box-shadow: var(--shadow-lg);
  display: flex; align-items: center; gap: 14px;
}
.hero-stat-card .num { font-family: var(--font-mono); font-size: var(--step-3); font-weight: 700; color: var(--color-leaf); }
.hero-stat-card .txt { font-size: var(--step--1); color: var(--color-ink-soft); max-width: 14ch; }

/* ---------- Field-ticket cards (signature element) ---------- */
.ticket-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 28px; }
.ticket-card {
  position: relative;
  background: var(--color-white);
  border-radius: var(--radius-md);
  padding: 32px 26px 26px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
  transition: transform var(--transition), box-shadow var(--transition);
  overflow: hidden;
}
.ticket-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); }
.ticket-card::before {
  /* perforation strip like a torn ticket stub */
  content: ''; position: absolute; top: 0; right: 0; bottom: 0; width: 10px;
  background-image: radial-gradient(circle, var(--color-cream) 3px, transparent 3.5px);
  background-size: 10px 16px; background-repeat: repeat-y; background-position: center;
  border-left: 1px dashed var(--color-border);
}
.ticket-icon {
  width: 54px; height: 54px; border-radius: var(--radius-sm); background: var(--color-cream-dark);
  display: flex; align-items: center; justify-content: center; font-size: 1.5rem; margin-bottom: 18px; color: var(--color-leaf);
}
.ticket-card h3 { font-size: var(--step-1); margin-bottom: 8px; }
.ticket-card p { font-size: var(--step--1); margin-bottom: 0; }
.ticket-tag {
  position: absolute; top: 18px; right: 22px; font-family: var(--font-mono); font-size: 0.68rem;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--color-soil-light);
}

/* ---------- Why choose us ---------- */
.feature-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 32px; }
.feature-item { display: flex; gap: 16px; align-items: flex-start; }
.feature-item .ico {
  width: 46px; height: 46px; border-radius: 50%; background: var(--color-leaf); color: var(--color-white);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 1.2rem;
}
.feature-item h4 { margin-bottom: 4px; }
.feature-item p { font-size: var(--step--1); margin: 0; }

/* ---------- CTA banner ---------- */
.cta-banner {
  background: linear-gradient(120deg, var(--color-wheat) 0%, var(--color-wheat-light) 100%);
  border-radius: var(--radius-lg); padding: 56px; display: flex; justify-content: space-between; align-items: center; gap: 32px; flex-wrap: wrap;
  color: var(--color-forest-dark);
}
.cta-banner h2 { margin-bottom: 8px; }
.cta-banner p { color: var(--color-forest-dark); opacity: 0.85; margin-bottom: 0; }

/* ---------- Cards: news / gallery ---------- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 28px; }
.media-card { background: var(--color-white); border-radius: var(--radius-md); overflow: hidden; box-shadow: var(--shadow-sm); border: 1px solid var(--color-border); transition: transform var(--transition), box-shadow var(--transition); }
.media-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); }
.media-card .thumb { aspect-ratio: 16/10; overflow: hidden; }
.media-card .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 500ms ease; }
.media-card:hover .thumb img { transform: scale(1.06); }
.media-card .body { padding: 22px; }
.media-card .date { font-family: var(--font-mono); font-size: 0.75rem; color: var(--color-leaf); text-transform: uppercase; letter-spacing: 0.05em; }
.media-card h3 { font-size: var(--step-1); margin: 8px 0; }
.media-card .read-more { font-weight: 600; color: var(--color-forest); font-size: var(--step--1); }

/* ---------- Gallery preview / masonry-ish ---------- */
.gallery-grid { display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: 160px; gap: 14px; }
.gallery-grid a { border-radius: var(--radius-sm); overflow: hidden; position: relative; }
.gallery-grid img { width: 100%; height: 100%; object-fit: cover; transition: transform 500ms ease; }
.gallery-grid a:hover img { transform: scale(1.08); }
.gallery-grid .tall { grid-row: span 2; }
.gallery-grid .wide { grid-column: span 2; }

/* ---------- Footer ---------- */
.site-footer { background: var(--color-forest-dark); color: rgba(250,246,236,0.82); padding-top: 72px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 40px; padding-bottom: 48px; border-bottom: 1px solid rgba(250,246,236,0.12); }
.footer-brand p { color: rgba(250,246,236,0.7); font-size: var(--step--1); max-width: 32ch; }
.footer-col h4 { color: var(--color-wheat-light); font-size: var(--step-0); margin-bottom: 16px; }
.footer-col a { display: block; padding: 6px 0; font-size: var(--step--1); color: rgba(250,246,236,0.78); transition: color var(--transition); }
.footer-col a:hover { color: var(--color-wheat); }
.footer-social { display: flex; gap: 10px; margin-top: 18px; }
.footer-social a { width: 38px; height: 38px; border-radius: 50%; background: rgba(250,246,236,0.1); display: flex; align-items: center; justify-content: center; }
.footer-social a:hover { background: var(--color-wheat); color: var(--color-forest-dark); }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; padding: 24px 0; font-size: 0.82rem; color: rgba(250,246,236,0.6); flex-wrap: wrap; gap: 8px; }

/* ---------- Scroll to top ---------- */
#scroll-top {
  position: fixed; right: 24px; bottom: 24px; width: 48px; height: 48px; border-radius: 50%;
  background: var(--color-leaf); color: var(--color-white); border: none; box-shadow: var(--shadow-md);
  display: flex; align-items: center; justify-content: center; font-size: 1.3rem; cursor: pointer;
  opacity: 0; visibility: hidden; transform: translateY(12px);
  transition: opacity var(--transition), transform var(--transition), visibility var(--transition), background var(--transition);
  z-index: 400;
}
#scroll-top.show { opacity: 1; visibility: visible; transform: translateY(0); }
#scroll-top:hover { background: var(--color-forest); }

/* ---------- Fade-in on scroll ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 700ms ease, transform 700ms ease; }
.reveal.in-view { opacity: 1; transform: translateY(0); }

/* ---------- Utility ---------- */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mt-40 { margin-top: 40px; }
.mb-0 { margin-bottom: 0; }
.mb-32 { margin-bottom: 32px; }
.mb-20 { margin-bottom: 20px; }
.mb-6 { margin-bottom: 6px; }
.mt-12 { margin-top: 12px; }
.link-leaf { color: var(--color-leaf); font-weight: 700; }
/* Narrow centered column for long-form legal/text pages (Privacy, Terms) */
.prose-narrow { max-width: 840px; margin: 0 auto; }
.pt-0 { padding-top: 0; }
/* Alternate section background, used to break up long pages of the same tone */
.section-alt { background: var(--color-cream-dark); }
/* Centers a flex .eyebrow (default alignment is left-aligned, flush with content) */
.eyebrow-center { justify-content: center; }
/* Rounded, shadowed feature photography (about/story sections) */
.img-feature { border-radius: var(--radius-lg); box-shadow: var(--shadow-md); }
/* A shorter hero band for interior pages (About, Services) vs. the full home hero */
.hero-compact { padding: 64px 0 88px; }
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 999px;
  background: var(--color-cream-dark); color: var(--color-forest); font-size: 0.78rem; font-weight: 600;
}
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
.divider { height: 1px; background: var(--color-border); margin: 64px 0; border: none; }

/* Skip link for accessibility */
.skip-link {
  position: absolute; left: -999px; top: 0; background: var(--color-forest); color: var(--color-white);
  padding: 12px 20px; z-index: 10000; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }
