/* ==========================================================================
   KrishikOS — public website
   Design tokens mirror mobile/src/ui/theme.ts exactly, so the site reads as the
   same product family as the app. No framework, no build step: one stylesheet
   served statically by Caddy.
   ========================================================================== */

:root {
  /* Brand — from theme.ts color.* */
  --green: #18863A;
  --green-dark: #136E30;
  --green-tint: #E8F5EA;
  --white: #FFFFFF;
  --canvas: #F6F8F7;
  --surface-muted: #F1F5F9;
  --ink: #0F172A;
  --ink-muted: #64748B;
  --ink-faint: #94A3B8;
  --card-border: #EAEFEC;
  --divider: #F1F5F9;

  /* Category tints — theme.ts category.* */
  --farm-bg: #E8F5EA;      --farm-fg: #136E30;
  --income-bg: #E6F1FB;    --income-fg: #0C447C;
  --labour-bg: #FAEEDA;    --labour-fg: #854F0B;
  --livestock-bg: #E1F5EE; --livestock-fg: #0F6E56;

  /* Radii — theme.ts radius.* */
  --r-control: 10px;
  --r-card: 16px;
  --r-chip: 20px;
  --r-pill: 999px;

  /* One soft elevation, like the app */
  --shadow: 0 3px 12px rgba(15, 23, 42, 0.05);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.10);

  --maxw: 1140px;
  --header-h: 68px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}

body {
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: var(--green-dark); }

/* Visible focus for keyboard users everywhere. */
a:focus-visible, button:focus-visible {
  outline: 3px solid var(--green);
  outline-offset: 2px;
  border-radius: 4px;
}

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--green); color: #fff; padding: 12px 18px; z-index: 200;
  border-radius: 0 0 var(--r-control) 0; font-weight: 700;
}
.skip-link:focus { left: 0; }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--divider);
}
.header-inner {
  height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand img { width: 34px; height: 34px; border-radius: 9px; }
.brand-name { font-size: 20px; font-weight: 800; letter-spacing: -0.2px; color: var(--green-dark); }

.nav { display: flex; align-items: center; gap: 6px; }
.nav a {
  text-decoration: none; color: var(--ink-muted); font-size: 15px; font-weight: 600;
  padding: 9px 12px; border-radius: var(--r-control);
}
.nav a:hover { color: var(--green-dark); background: var(--green-tint); }
/* The CTA inside the nav list exists for the mobile drawer only; on desktop the
   standalone .header-cta is used, so hide this one to avoid two identical buttons. */
.nav > .btn { display: none; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px; border-radius: var(--r-control);
  font-size: 16px; font-weight: 700; text-decoration: none; cursor: pointer;
  border: 1px solid transparent; transition: background .15s ease, border-color .15s ease, transform .15s ease;
}
.btn-primary { background: var(--green); color: #fff; }
.btn-primary:hover { background: var(--green-dark); }
.btn-ghost { background: #fff; color: var(--green-dark); border-color: var(--card-border); }
.btn-ghost:hover { background: var(--green-tint); border-color: var(--green-tint); }
.btn-on-green { background: #fff; color: var(--green-dark); }
.btn-on-green:hover { background: var(--green-tint); }
.btn-outline-light { background: transparent; color: #fff; border-color: rgba(255,255,255,.65); }
.btn-outline-light:hover { background: rgba(255,255,255,.12); }
.btn-sm { min-height: 42px; padding: 0 18px; font-size: 15px; }

.nav-toggle {
  display: none; background: #fff; border: 1px solid var(--card-border);
  border-radius: var(--r-control); width: 48px; height: 48px; cursor: pointer;
  align-items: center; justify-content: center;
}
.nav-toggle span { display: block; width: 20px; height: 2px; background: var(--ink); position: relative; }
.nav-toggle span::before, .nav-toggle span::after {
  content: ""; position: absolute; left: 0; width: 20px; height: 2px; background: var(--ink);
}
.nav-toggle span::before { top: -6px; } .nav-toggle span::after { top: 6px; }

/* ---------- Section scaffolding ---------- */
section { padding: 84px 0; }
.section-tint { background: var(--canvas); }
.eyebrow {
  display: inline-block; font-size: 13px; font-weight: 800; letter-spacing: .08em;
  text-transform: uppercase; color: var(--green-dark);
  background: var(--green-tint); padding: 6px 14px; border-radius: var(--r-pill); margin-bottom: 16px;
}
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.5px; margin: 0 0 16px; }
h1 { font-size: clamp(34px, 5.2vw, 54px); font-weight: 800; }
h2 { font-size: clamp(28px, 3.6vw, 40px); font-weight: 800; }
h3 { font-size: 20px; font-weight: 700; letter-spacing: -0.2px; }
.lede { font-size: clamp(17px, 2vw, 20px); color: var(--ink-muted); margin: 0 0 28px; }
.section-head { max-width: 720px; margin: 0 auto 48px; text-align: center; }
.section-head .lede { margin-bottom: 0; }

/* ---------- Hero ---------- */
.hero { padding: 72px 0 84px; background: linear-gradient(180deg, var(--green-tint) 0%, #fff 62%); }
.hero-grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 56px; align-items: center; }
.hero h1 { color: var(--ink); }
.hero h1 .accent { color: var(--green-dark); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 26px; }
.hero-points { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px 22px; }
.hero-points li { font-size: 15px; color: var(--ink-muted); display: flex; align-items: center; gap: 8px; }
.tick { width: 20px; height: 20px; border-radius: 50%; background: var(--green-tint); color: var(--green-dark);
        display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; flex: none; }

/* Stylised app illustration (NOT a screenshot) */
.phone {
  width: 300px; margin: 0 auto; background: #fff; border: 1px solid var(--card-border);
  border-radius: 34px; padding: 12px; box-shadow: var(--shadow-lg);
}
.phone-screen { background: var(--canvas); border-radius: 24px; overflow: hidden; }
.phone-top { background: var(--green); color: #fff; padding: 14px 16px; display: flex; align-items: center; gap: 9px; }
.phone-top img { width: 22px; height: 22px; border-radius: 6px; }
.phone-top .t { font-weight: 800; font-size: 15px; }
.phone-body { padding: 14px; display: grid; gap: 10px; }
.p-greet { font-size: 13px; color: var(--ink-muted); }
.p-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.p-stat { background: #fff; border: 1px solid var(--card-border); border-radius: 12px; padding: 10px 12px; }
.p-stat b { display: block; font-size: 19px; color: var(--ink); line-height: 1.2; }
.p-stat span { font-size: 11px; color: var(--ink-muted); }
.p-card { background: #fff; border: 1px solid var(--card-border); border-radius: 12px; padding: 11px 12px; display: flex; align-items: center; gap: 10px; }
.p-chip { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-size: 15px; flex: none; }
.p-card .l { font-size: 13px; font-weight: 700; color: var(--ink); }
.p-card .s { font-size: 11px; color: var(--ink-muted); }
.phone-caption { text-align: center; font-size: 13px; color: var(--ink-faint); margin-top: 14px; }

/* ---------- Cards / grids ---------- */
.grid { display: grid; gap: 20px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: #fff; border: 1px solid var(--card-border); border-radius: var(--r-card);
  padding: 26px; box-shadow: var(--shadow); transition: transform .16s ease, box-shadow .16s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.card h3 { margin-bottom: 8px; }
.card p { margin: 0; color: var(--ink-muted); font-size: 15.5px; }

.icon-chip {
  width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center;
  font-size: 22px; margin-bottom: 16px; background: var(--green-tint); color: var(--green-dark);
}
.chip-farm { background: var(--farm-bg); color: var(--farm-fg); }
.chip-income { background: var(--income-bg); color: var(--income-fg); }
.chip-labour { background: var(--labour-bg); color: var(--labour-fg); }
.chip-livestock { background: var(--livestock-bg); color: var(--livestock-fg); }

/* ---------- Why (problem → solution) ---------- */
.why-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
.why-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.why-list li { display: flex; gap: 14px; align-items: flex-start; }
.why-list .n {
  width: 30px; height: 30px; border-radius: 50%; background: var(--green-tint); color: var(--green-dark);
  display: grid; place-items: center; font-weight: 800; font-size: 14px; flex: none; margin-top: 2px;
}
.why-list b { display: block; font-size: 16px; }
.why-list span { color: var(--ink-muted); font-size: 15.5px; }

/* ---------- Steps ---------- */
.steps { counter-reset: step; display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.step { background: #fff; border: 1px solid var(--card-border); border-radius: var(--r-card); padding: 26px; box-shadow: var(--shadow); }
.step .num {
  width: 40px; height: 40px; border-radius: 50%; background: var(--green); color: #fff;
  display: grid; place-items: center; font-weight: 800; font-size: 17px; margin-bottom: 16px;
}
.step h3 { font-size: 18px; margin-bottom: 6px; }
.step p { margin: 0; color: var(--ink-muted); font-size: 15px; }

/* ---------- Split feature bands ---------- */
.band { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
.band-list { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 12px; }
.band-list li { display: flex; gap: 12px; align-items: flex-start; color: var(--ink-muted); font-size: 16px; }
.pill-note {
  display: inline-block; background: var(--green-tint); color: var(--green-dark);
  border-radius: var(--r-chip); padding: 12px 18px; font-size: 15px; font-weight: 600; margin-top: 22px;
}

/* ---------- CTA ---------- */
.cta { background: var(--green); color: #fff; text-align: center; }
.cta h2 { color: #fff; }
.cta p { color: rgba(255,255,255,.9); font-size: 19px; max-width: 620px; margin: 0 auto 30px; }
.cta-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ---------- Contact ---------- */
.contact-card {
  background: #fff; border: 1px solid var(--card-border); border-radius: var(--r-card);
  padding: 34px; box-shadow: var(--shadow); text-align: center; max-width: 620px; margin: 0 auto;
}
.contact-card .who { font-size: 19px; font-weight: 800; margin-bottom: 6px; }
.contact-card address { font-style: normal; color: var(--ink-muted); margin-bottom: 22px; }
.contact-email { font-size: 19px; font-weight: 700; color: var(--green-dark); text-decoration: none; }
.contact-email:hover { text-decoration: underline; }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: #CBD5E1; padding: 60px 0 28px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; }
.site-footer .brand-name { color: #fff; }
.site-footer p { color: #94A3B8; font-size: 15px; max-width: 320px; }
.site-footer h4 { color: #fff; font-size: 15px; margin: 0 0 14px; letter-spacing: .02em; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.site-footer a { color: #CBD5E1; text-decoration: none; font-size: 15px; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.footer-bottom {
  border-top: 1px solid #1E293B; margin-top: 40px; padding-top: 22px;
  display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; font-size: 14px; color: #94A3B8;
}

/* ---------- Legal pages ---------- */
.legal { padding: 56px 0 84px; }
.legal-inner { max-width: 800px; margin: 0 auto; }
.legal h1 { font-size: clamp(30px, 4vw, 40px); }
.legal h2 { font-size: 22px; margin: 40px 0 12px; }
.legal p, .legal li { color: #334155; font-size: 16.5px; }
.legal ul { padding-left: 22px; display: grid; gap: 8px; }
.legal .updated { color: var(--ink-muted); font-size: 15px; margin-bottom: 8px; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .hero-grid, .why-grid, .band { grid-template-columns: 1fr; gap: 40px; }
  .band-reverse .band-visual { order: -1; }
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 760px) {
  body { font-size: 16px; }
  section { padding: 60px 0; }
  .hero { padding: 48px 0 60px; }

  .nav-toggle { display: inline-flex; }
  .header-cta { display: none; }
  .nav {
    position: fixed; inset: var(--header-h) 0 auto 0;
    background: #fff; border-bottom: 1px solid var(--divider);
    flex-direction: column; align-items: stretch; gap: 0;
    padding: 10px 20px 20px; box-shadow: var(--shadow-lg);
    display: none;
  }
  .nav.open { display: flex; }
  .nav a { padding: 15px 8px; font-size: 17px; border-bottom: 1px solid var(--divider); border-radius: 0; }
  .nav a:last-of-type { border-bottom: none; }
  .nav > .btn { display: inline-flex; margin-top: 14px; border-bottom: none; }

  .grid-3, .grid-4, .grid-2, .steps { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 30px; }
  .site-footer p { max-width: none; }
  .hero-actions .btn { flex: 1 1 100%; }
  .phone { width: min(300px, 88vw); }
}
