/* =============================================================================
   SAVANNAH LEDGER — AgriCircle design system
   A warm, editorial, paper-feeling interface built for low-end Android phones
   and desktop. Inspired by hand-kept VSLA ledger books.
   ============================================================================= */

:root {
  /* ── Palette ────────────────────────────────────────────────────────────── */
  --paper:        #F5EFE4;  /* warm cream background */
  --paper-deep:   #ECE3D2;  /* card / section tone */
  --paper-edge:   #D9CEB4;  /* hairline dividers */
  --ink:          #0F1915;  /* near-black with green undertone */
  --ink-soft:     #2B3A33;
  --ink-muted:    #5A6B61;
  --moss:         #3F6B3F;  /* primary action, logo */
  --moss-deep:    #284528;
  --moss-soft:    #6B8E6B;
  --clay:         #C2410C;  /* accents: warnings, highlights, marginalia */
  --clay-soft:    #E8896A;
  --gold:         #D97706;  /* currency, emphasis */
  --gold-soft:    #F5B971;
  --success:      #3F6B3F;
  --danger:       #B91C1C;

  /* ── Typography ─────────────────────────────────────────────────────────── */
  --font-display: 'Fraunces', 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --font-body:    'Public Sans', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
  --font-mono:    'JetBrains Mono', 'SF Mono', 'Consolas', monospace;

  /* ── Spacing (4px baseline) ─────────────────────────────────────────────── */
  --sp-1:  0.25rem;
  --sp-2:  0.5rem;
  --sp-3:  0.75rem;
  --sp-4:  1rem;
  --sp-5:  1.5rem;
  --sp-6:  2rem;
  --sp-7:  3rem;
  --sp-8:  4rem;
  --sp-9:  6rem;

  /* ── Edges & shadows ────────────────────────────────────────────────────── */
  --rule-fine:    1px solid var(--paper-edge);
  --rule-med:     2px solid var(--ink);
  --rule-thick:   3px solid var(--ink);
  --radius-sm:    4px;
  --radius:       10px;
  --radius-lg:    18px;
  --shadow-sm:    0 1px 0 rgba(15,25,21,0.04);
  --shadow:       0 8px 24px -16px rgba(15,25,21,0.22), 0 2px 4px rgba(15,25,21,0.06);
  --shadow-hi:    0 24px 48px -20px rgba(15,25,21,0.32);

  /* ── Motion ────────────────────────────────────────────────────────────── */
  --ease-smooth:  cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring:  cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* =============================================================================
   RESET + BASE
   ============================================================================= */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.55;
  font-variation-settings: 'wght' 400;

  /* Subtle film-grain / paper tooth — created with a single data-uri SVG */
  background-image:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.06   0 0 0 0 0.10   0 0 0 0 0.08   0 0 0 0.04 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.55'/></svg>");
  background-repeat: repeat;
  background-size: 220px 220px;
}

img, svg { max-width: 100%; display: block; }

a {
  color: var(--moss-deep);
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
  text-decoration-color: rgba(40, 69, 40, 0.35);
  transition: text-decoration-color .18s var(--ease-smooth), color .18s var(--ease-smooth);
}
a:hover { text-decoration-color: var(--moss-deep); }

/* =============================================================================
   TYPOGRAPHY
   ============================================================================= */
h1, h2, h3, h4, h5, .display, .display-sm {
  font-family: var(--font-display);
  color: var(--ink);
  font-weight: 450;
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0 0 var(--sp-4);
  font-variation-settings: 'opsz' 144, 'SOFT' 20;
}
h1 { font-size: clamp(2.25rem, 5.5vw + 0.75rem, 4.75rem); letter-spacing: -0.035em; }
h2 { font-size: clamp(1.75rem, 3vw + 0.75rem, 2.75rem); letter-spacing: -0.025em; }
h3 { font-size: clamp(1.4rem, 1.5vw + 0.9rem, 1.9rem); }
h4 { font-size: 1.25rem; letter-spacing: -0.01em; }
h5 { font-size: 1.05rem; font-weight: 520; }

.display     { font-size: clamp(3rem, 7.5vw + 1rem, 7rem); font-variation-settings: 'opsz' 144, 'SOFT' 30; }
.display-sm  { font-size: clamp(2rem, 4.5vw + 0.75rem, 3.25rem); }

.italic-serif { font-family: var(--font-display); font-style: italic; font-weight: 430; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-family: var(--font-body);
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--clay);
}
.eyebrow::before {
  content: "";
  width: 28px; height: 2px; background: var(--clay);
}

.lede {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.2rem, 1vw + 1rem, 1.6rem);
  line-height: 1.45;
  color: var(--ink-soft);
  max-width: 62ch;
}

.num, .figure, .tabular {
  font-family: var(--font-mono);
  font-feature-settings: 'tnum', 'ss01';
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

.figure-lg {
  font-family: var(--font-display);
  font-variation-settings: 'opsz' 144, 'SOFT' 10;
  font-weight: 520;
  font-size: clamp(2rem, 4vw + 0.5rem, 3.25rem);
  letter-spacing: -0.035em;
  font-feature-settings: 'tnum';
  line-height: 1;
}

.ampersand { font-family: var(--font-display); font-style: italic; font-weight: 430; }

/* =============================================================================
   LAYOUT PRIMITIVES
   ============================================================================= */
.wrap {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--sp-5);
}
.wrap-narrow { max-width: 860px; }
.stack > * + * { margin-top: var(--sp-5); }

.rule      { border: 0; border-top: var(--rule-med);  margin: var(--sp-6) 0; }
.rule-fine { border: 0; border-top: var(--rule-fine); margin: var(--sp-5) 0; }

/* =============================================================================
   HEADER (public + authed share the same shell)
   ============================================================================= */
.ac-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--paper);
  border-bottom: var(--rule-med);
}
.ac-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-5);
  height: 68px;
  padding: 0 var(--sp-5);
  max-width: 1280px;
  margin: 0 auto;
}
.ac-brand {
  display: inline-flex;
  align-items: baseline;
  gap: var(--sp-2);
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.6rem;
  letter-spacing: -0.03em;
  color: var(--ink);
  text-decoration: none;
  font-variation-settings: 'opsz' 144, 'SOFT' 25;
}
.ac-brand::after {
  content: "";
  width: 10px; height: 10px;
  background: var(--clay);
  border-radius: 50%;
  display: inline-block;
}
.ac-brand-mark { color: var(--moss-deep); }

.ac-nav {
  display: flex;
  align-items: center;
  gap: var(--sp-5);
}
.ac-nav a {
  color: var(--ink-soft);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.96rem;
  position: relative;
  padding: var(--sp-2) 0;
}
.ac-nav a.active,
.ac-nav a:hover {
  color: var(--ink);
}
.ac-nav a.active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 2px; background: var(--clay);
}

/* Hamburger (mobile only) */
.ac-burger {
  display: none;
  background: transparent;
  border: 2px solid var(--ink);
  width: 44px; height: 44px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  align-items: center;
  justify-content: center;
}
.ac-burger:focus-visible { outline: 2px solid var(--clay); outline-offset: 2px; }
.ac-burger span,
.ac-burger span::before,
.ac-burger span::after {
  display: block;
  width: 20px; height: 2px; background: var(--ink);
  position: relative;
  transition: transform .25s var(--ease-smooth);
}
.ac-burger span::before { content: ""; position: absolute; top: -6px; left: 0; }
.ac-burger span::after  { content: ""; position: absolute; top:  6px; left: 0; }

.ac-drawer {
  display: none;
  padding: var(--sp-5);
  border-top: var(--rule-fine);
  background: var(--paper);
}
.ac-drawer a {
  display: block;
  padding: var(--sp-3) 0;
  border-bottom: var(--rule-fine);
  color: var(--ink);
  text-decoration: none;
  font-size: 1.1rem;
}

/* =============================================================================
   BUTTONS
   ============================================================================= */
.btn, .ac-btn {
  --_bg: var(--ink);
  --_fg: var(--paper);
  --_bd: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.98rem;
  letter-spacing: 0.005em;
  text-decoration: none !important;
  padding: 0.85rem 1.4rem;
  min-height: 46px;
  border-radius: 999px;
  border: 2px solid var(--_bd);
  background: var(--_bg);
  color: var(--_fg);
  cursor: pointer;
  transition: transform .18s var(--ease-spring), background-color .18s var(--ease-smooth);
  line-height: 1;
}
.btn:hover, .ac-btn:hover { transform: translateY(-1px); }
.btn:active, .ac-btn:active { transform: translateY(0); }
.btn:focus-visible, .ac-btn:focus-visible { outline: 2px solid var(--clay); outline-offset: 3px; }

.btn-primary, .ac-btn--primary { --_bg: var(--moss-deep); --_bd: var(--moss-deep); --_fg: var(--paper); }
.btn-secondary, .ac-btn--ghost  { --_bg: transparent;    --_bd: var(--ink);        --_fg: var(--ink);   }
.btn-clay, .ac-btn--clay        { --_bg: var(--clay);    --_bd: var(--clay);       --_fg: #fff;         }
.ac-btn--sm { padding: 0.55rem 1rem; min-height: 40px; font-size: 0.9rem; }

.btn-outline-primary { --_bg: transparent; --_bd: var(--moss-deep); --_fg: var(--moss-deep); }
.btn-outline-primary:hover { background: var(--moss-deep); color: var(--paper); }

/* =============================================================================
   CARDS / LEDGER BLOCKS
   ============================================================================= */
.card, .ac-card {
  background: var(--paper-deep);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  padding: var(--sp-5);
  position: relative;
}
.card:hover, .ac-card:hover { /* none — too much noise on cards */ }
.ac-card--flush { background: var(--paper); }
.ac-card--ledger {
  background: var(--paper);
  border: 2px solid var(--ink);
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0 38px,
    rgba(15,25,21,0.06) 38px 39px
  );
}

.bootstrap-sink .card {
  /* when Bootstrap cards bleed through, keep them on-brand */
  box-shadow: none !important;
  background: var(--paper-deep);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
}

/* Stat block — used on dashboard */
.ac-stat {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  padding: var(--sp-5);
  background: var(--paper-deep);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
}
.ac-stat__label {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--ink-muted);
}
.ac-stat__value { font-family: var(--font-display); font-variation-settings: 'opsz' 144, 'SOFT' 5; font-weight: 500; font-size: clamp(2rem, 2vw + 1.5rem, 2.8rem); letter-spacing: -0.035em; line-height: 1; color: var(--ink); font-feature-settings: 'tnum'; }
.ac-stat__meta  { font-size: 0.88rem; color: var(--ink-muted); }
.ac-stat__corner {
  position: absolute;
  top: var(--sp-4); right: var(--sp-4);
  font-family: var(--font-display);
  font-style: italic;
  color: var(--clay);
  font-size: 1.5rem;
  opacity: 0.8;
}

/* =============================================================================
   HERO (landing)
   ============================================================================= */
.ac-hero {
  padding: var(--sp-8) 0 var(--sp-7);
  border-bottom: var(--rule-med);
  position: relative;
}
.ac-hero__grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: var(--sp-7);
  align-items: end;
}
.ac-hero__title {
  font-size: clamp(3rem, 8vw + 1rem, 7.5rem);
  line-height: 0.92;
  letter-spacing: -0.045em;
  font-variation-settings: 'opsz' 144, 'SOFT' 30;
  margin-bottom: var(--sp-5);
}
.ac-hero__title em {
  font-style: italic;
  color: var(--clay);
  font-variation-settings: 'opsz' 144, 'SOFT' 100;
}
.ac-hero__lede { max-width: 48ch; margin-bottom: var(--sp-6); }
.ac-hero__side {
  border-left: var(--rule-med);
  padding: var(--sp-5);
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.35rem;
  line-height: 1.35;
  color: var(--ink-soft);
}
.ac-hero__cta-row { display: flex; flex-wrap: wrap; gap: var(--sp-3); }

/* Feature cards row — loosely framed ledger panels */
.ac-features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-5);
  padding: var(--sp-8) 0;
}
.ac-feature {
  border-top: 3px solid var(--ink);
  padding-top: var(--sp-4);
  position: relative;
}
.ac-feature__num {
  font-family: var(--font-display);
  font-variation-settings: 'opsz' 144, 'SOFT' 10;
  font-weight: 500;
  color: var(--clay);
  font-size: 0.9rem;
  letter-spacing: 0.05em;
}
.ac-feature h3 { margin-top: var(--sp-2); margin-bottom: var(--sp-3); }
.ac-feature p { color: var(--ink-soft); margin: 0; max-width: 36ch; }

/* Section of numbers — figures as marketing content */
.ac-numbers {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border-top: var(--rule-med);
  border-bottom: var(--rule-med);
  margin: var(--sp-7) 0;
}
.ac-numbers > div {
  padding: var(--sp-6) var(--sp-4);
  border-right: var(--rule-fine);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}
.ac-numbers > div:last-child { border-right: 0; }
.ac-numbers__fig {
  font-family: var(--font-display);
  font-variation-settings: 'opsz' 144, 'SOFT' 10;
  font-weight: 500;
  font-size: clamp(2.25rem, 3vw + 1.5rem, 3.75rem);
  letter-spacing: -0.04em;
  line-height: 0.95;
}
.ac-numbers__label { font-size: 0.9rem; color: var(--ink-muted); }

/* =============================================================================
   ALERTS / MESSAGES
   ============================================================================= */
.ac-alert {
  display: flex;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border: 2px solid var(--ink);
  border-radius: var(--radius-sm);
  background: var(--paper-deep);
  margin-bottom: var(--sp-4);
  font-size: 0.96rem;
}
.ac-alert--success { border-color: var(--moss-deep); }
.ac-alert--error, .ac-alert--danger { border-color: var(--danger); }
.ac-alert--warning { border-color: var(--clay); }

/* =============================================================================
   DASHBOARD LAYOUT
   ============================================================================= */
.ac-shell { display: grid; grid-template-columns: 264px 1fr; min-height: 100vh; }
.ac-shell__side {
  border-right: var(--rule-med);
  padding: var(--sp-6) var(--sp-4) 120px;
  position: sticky; top: 68px; align-self: start;
  height: calc(100vh - 68px);
  overflow-y: auto;
  background: var(--paper);
}
.ac-shell__main { padding: var(--sp-6) var(--sp-6) var(--sp-9); min-width: 0; }
.ac-sidenav { display: flex; flex-direction: column; gap: var(--sp-1); }
.ac-sidenav a {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 0.98rem;
  font-weight: 500;
  border-left: 3px solid transparent;
}
.ac-sidenav a:hover { background: var(--paper-deep); color: var(--ink); }
.ac-sidenav a.active {
  background: var(--paper-deep);
  color: var(--ink);
  border-left-color: var(--clay);
}
.ac-sidenav__group-label {
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin: var(--sp-5) var(--sp-3) var(--sp-2);
  font-weight: 600;
}

/* Dashboard page header */
.ac-pagehead {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--sp-5);
  padding-bottom: var(--sp-5);
  border-bottom: var(--rule-med);
  margin-bottom: var(--sp-6);
}
.ac-pagehead h1 { margin: 0; font-size: clamp(2rem, 2vw + 1.25rem, 3rem); }
.ac-pagehead__meta { color: var(--ink-muted); font-family: var(--font-display); font-style: italic; font-size: 1.05rem; }

.ac-grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-5); }
.ac-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-5); }
.ac-grid-2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: var(--sp-5); }

/* Quick action pills */
.ac-pill-row {
  display: flex; flex-wrap: wrap; gap: var(--sp-3);
  padding: var(--sp-5);
  background: var(--paper-deep);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
}
.ac-pill-row__title {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.25rem;
  margin-right: var(--sp-3);
  align-self: center;
}

/* =============================================================================
   TABLES
   ============================================================================= */
.ac-table, .card .table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-body);
  font-size: 0.96rem;
}
.ac-table thead th, .card .table thead th {
  font-family: var(--font-body);
  font-weight: 700;
  text-align: left;
  padding: var(--sp-3);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-muted);
  border-bottom: 2px solid var(--ink);
}
.ac-table tbody td, .card .table tbody td {
  padding: var(--sp-4) var(--sp-3);
  border-bottom: var(--rule-fine);
  vertical-align: middle;
}
.ac-table tbody tr:hover, .card .table tbody tr:hover { background: var(--paper-deep); }

/* =============================================================================
   FORMS
   ============================================================================= */
.form-control, .form-select,
input[type="text"], input[type="email"], input[type="password"],
input[type="tel"], input[type="number"], input[type="search"],
textarea, select {
  width: 100%;
  font: inherit;
  font-size: 1rem;
  padding: 0.75rem 0.9rem;
  min-height: 46px;
  background: var(--paper);
  color: var(--ink);
  border: 2px solid var(--ink);
  border-radius: var(--radius-sm);
  transition: border-color .15s var(--ease-smooth), box-shadow .15s var(--ease-smooth);
}
.form-control:focus, .form-select:focus, input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--clay);
  box-shadow: 0 0 0 3px rgba(194, 65, 12, 0.18);
}
label { display: block; font-weight: 600; font-size: 0.88rem; letter-spacing: 0.02em; margin-bottom: var(--sp-2); }

/* =============================================================================
   FOOTER
   ============================================================================= */
.ac-footer {
  border-top: var(--rule-med);
  background: var(--paper);
  padding: var(--sp-6) 0;
  margin-top: var(--sp-9);
  font-size: 0.92rem;
  color: var(--ink-muted);
}
.ac-footer .wrap { display: flex; flex-wrap: wrap; gap: var(--sp-4); justify-content: space-between; }
.ac-footer .italic-serif { color: var(--ink-soft); }

/* =============================================================================
   MOBILE BOTTOM NAV (authenticated users, <= 880px)
   ============================================================================= */
.ac-bottom-nav {
  display: none;
  position: fixed;
  left: 0; right: 0; bottom: 0;
  background: var(--paper);
  border-top: var(--rule-med);
  z-index: 40;
  padding: var(--sp-2) var(--sp-3) calc(var(--sp-2) + env(safe-area-inset-bottom));
  justify-content: space-around;
}
.ac-bottom-nav a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: var(--sp-2);
  color: var(--ink-muted);
  text-decoration: none;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-radius: var(--radius-sm);
  position: relative;
}
.ac-bottom-nav a.active { color: var(--ink); }
.ac-bottom-nav a.active::before {
  content: "";
  position: absolute;
  top: 2px; left: 50%; transform: translateX(-50%);
  width: 20px; height: 3px;
  background: var(--clay);
  border-radius: 2px;
}
.ac-bottom-nav svg { width: 22px; height: 22px; stroke-width: 1.75; }

/* =============================================================================
   UTILITIES
   ============================================================================= */
.text-muted { color: var(--ink-muted) !important; }
.text-ink { color: var(--ink); }
.text-moss { color: var(--moss-deep); }
.text-clay { color: var(--clay); }
.text-gold { color: var(--gold); }

.badge, .ac-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 0.25rem 0.65rem;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: transparent;
  color: var(--ink);
}
.ac-badge--moss { background: var(--moss-deep); border-color: var(--moss-deep); color: var(--paper); }
.ac-badge--clay { background: var(--clay);      border-color: var(--clay);      color: #fff; }

/* =============================================================================
   ENTRANCE ANIMATION (staggered page-load reveal)
   ============================================================================= */
@keyframes ac-rise {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.reveal > * {
  opacity: 0;
  animation: ac-rise 0.7s var(--ease-smooth) forwards;
}
.reveal > *:nth-child(1) { animation-delay: 0.05s; }
.reveal > *:nth-child(2) { animation-delay: 0.15s; }
.reveal > *:nth-child(3) { animation-delay: 0.25s; }
.reveal > *:nth-child(4) { animation-delay: 0.35s; }
.reveal > *:nth-child(5) { animation-delay: 0.45s; }
.reveal > *:nth-child(6) { animation-delay: 0.55s; }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* =============================================================================
   RESPONSIVE BREAKPOINTS
   ============================================================================= */
@media (max-width: 1080px) {
  .ac-hero__grid { grid-template-columns: 1fr; gap: var(--sp-5); }
  .ac-hero__side { border-left: 0; border-top: var(--rule-fine); padding-left: 0; padding-top: var(--sp-5); }
  .ac-numbers    { grid-template-columns: repeat(2, 1fr); }
  .ac-numbers > div:nth-child(2) { border-right: 0; }
  .ac-numbers > div:nth-child(-n+2) { border-bottom: var(--rule-fine); }
  .ac-grid-4     { grid-template-columns: repeat(2, 1fr); }
  .ac-grid-2     { grid-template-columns: 1fr; }
  .ac-shell      { grid-template-columns: 1fr; }
  .ac-shell__side { display: none; }
  .ac-shell__main { padding: var(--sp-5) var(--sp-4) calc(var(--sp-8) + 72px); }
}

@media (max-width: 880px) {
  body { font-size: 16px; }
  .wrap { padding: 0 var(--sp-4); }
  .ac-header-inner { height: 60px; padding: 0 var(--sp-4); }
  .ac-brand { font-size: 1.4rem; }
  .ac-nav { display: none; }
  .ac-burger { display: inline-flex; }
  .ac-hero { padding: var(--sp-6) 0; }
  .ac-features { grid-template-columns: 1fr; gap: var(--sp-5); padding: var(--sp-6) 0; }
  .ac-pagehead { flex-direction: column; align-items: flex-start; gap: var(--sp-3); }
  .ac-grid-3, .ac-grid-4 { grid-template-columns: 1fr; }
  .ac-pill-row { padding: var(--sp-4); }
  /* Show bottom nav for authed users only (template adds .authed class to body) */
  body.authed .ac-bottom-nav { display: flex; }
  body.authed .ac-footer { margin-bottom: 72px; }
}

@media (max-width: 480px) {
  .ac-hero__title { font-size: clamp(2.5rem, 12vw, 4.5rem); }
  .ac-numbers { grid-template-columns: 1fr; }
  .ac-numbers > div { border-right: 0; border-bottom: var(--rule-fine); }
  .ac-numbers > div:last-child { border-bottom: 0; }
  .ac-footer .wrap { flex-direction: column; gap: var(--sp-2); text-align: left; }
}

/* =============================================================================
   BOOTSTRAP OVERRIDES — keeps the 30+ inner page templates aesthetically on-brand
   ============================================================================= */
.container, .container-fluid { max-width: 1280px; }
.navbar { background: transparent !important; border: 0 !important; box-shadow: none; }
.navbar-agricircle { display: none !important; } /* hide the old Bootstrap nav entirely */

.card { box-shadow: none !important; background: var(--paper-deep); border: 2px solid var(--ink) !important; border-radius: var(--radius) !important; }
.card-header { background: transparent !important; border-bottom: 2px solid var(--ink) !important; font-family: var(--font-display); font-size: 1.15rem; }
.shadow-sm { box-shadow: none !important; }

.btn { border-radius: 999px !important; font-weight: 600; padding: 0.75rem 1.3rem; border-width: 2px; }
.btn-primary { background: var(--moss-deep) !important; border-color: var(--moss-deep) !important; color: var(--paper) !important; }
.btn-outline-primary { background: transparent !important; border-color: var(--moss-deep) !important; color: var(--moss-deep) !important; }
.btn-outline-primary:hover { background: var(--moss-deep) !important; color: var(--paper) !important; }
.btn-outline-success { border-color: var(--ink) !important; color: var(--ink) !important; }
.btn-outline-info { border-color: var(--clay) !important; color: var(--clay) !important; }
.btn-sm { padding: 0.45rem 0.9rem; }

.display-4, .display-6 { font-family: var(--font-display) !important; font-weight: 500 !important; font-variation-settings: 'opsz' 144; }
.text-primary { color: var(--moss-deep) !important; }
.text-success { color: var(--moss-deep) !important; }
.text-info    { color: var(--clay) !important; }
.text-warning { color: var(--gold) !important; }
.alert { border-radius: var(--radius-sm) !important; border-width: 2px !important; }
.breadcrumb { background: transparent; padding: 0; font-family: var(--font-display); font-style: italic; font-size: 1rem; }
.breadcrumb a { color: var(--ink-soft); }
.table thead { background: transparent; }
.table-light { background: var(--paper-deep) !important; }
.table-responsive { border-radius: var(--radius); }
.form-label { font-weight: 600; }
