/* ==========================================================================
   Agrivencia — design tokens
   Farm-derived, deliberately bright, and built so a single body class
   (agv-module--{slug}) repaints the entire page from the module registry.
   ========================================================================== */

:root {
	color-scheme: light dark;

	/* --- Ground: warm, earthy neutrals rather than cold greys --------- */
	--agv-ink:        #14170f;
	--agv-ink-2:      #2b3122;
	--agv-ink-3:      #4b5340;
	--agv-ink-4:      #6f7863;
	--agv-mute:       #8d967f;
	--agv-line:       #dfe2d4;
	--agv-line-2:     #ecefe3;
	--agv-surface:    #ffffff;
	--agv-surface-2:  #f8f9f2;
	--agv-surface-3:  #f1f3e7;
	--agv-canvas:     #fbfcf6;

	/* --- Brand: the house green, used where no module owns the page --- */
	--agv-brand:      #2f7d32;
	--agv-brand-deep: #12331c;
	--agv-brand-dark: #0b2213;
	--agv-brand-lite: #4aa74e;
	--agv-brand-glow: #7fd07f;
	--agv-brand-tint: #e9f5e6;

	/* --- Signals ------------------------------------------------------ */
	--agv-good:       #2e7d32;
	--agv-good-tint:  #e6f4e6;
	--agv-warn:       #c8730a;
	--agv-warn-tint:  #fdf0dc;
	--agv-bad:        #b3261e;
	--agv-bad-tint:   #fbe9e7;
	--agv-info:       #1565a0;
	--agv-info-tint:  #e3f0fa;

	/* --- Harvest accents used across charts and instruments ---------- */
	--agv-corn:       #e8b93a;
	--agv-clay:       #c0692e;
	--agv-sky:        #3f9fd0;
	--agv-plum:       #7a3f9d;
	--agv-slate:      #46586b;

	/* --- Module colours: defaults, overwritten by the generated
	       stylesheet on every page that belongs to a module ---------- */
	--agv-mod-base:     var(--agv-brand);
	--agv-mod-deep:     var(--agv-brand-deep);
	--agv-mod-shade:    #24631f;
	--agv-mod-bright:   var(--agv-brand-lite);
	--agv-mod-glow:     var(--agv-brand-glow);
	--agv-mod-tint:     var(--agv-brand-tint);
	--agv-mod-tint2:    #d6ead2;
	--agv-mod-wash:     #f4faf3;
	--agv-mod-ink:      #10250f;
	--agv-mod-on:       #ffffff;
	--agv-mod-ring:     rgba(47,125,50,.35);
	--agv-mod-contrast: #a02f7d;

	/* --- Type --------------------------------------------------------- */
	--agv-font: "Inter", "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
	--agv-display: "Fraunces", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
	--agv-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

	--agv-t-xs:   0.6875rem;  /* 11 */
	--agv-t-sm:   0.8125rem;  /* 13 */
	--agv-t-base: 1rem;       /* 16 */
	--agv-t-md:   1.125rem;   /* 18 */
	--agv-t-lg:   1.375rem;   /* 22 */
	--agv-t-xl:   1.75rem;    /* 28 */
	--agv-t-2xl:  2.25rem;    /* 36 */
	--agv-t-3xl:  3rem;       /* 48 */
	--agv-t-4xl:  4rem;       /* 64 */

	--agv-lh-tight: 1.08;
	--agv-lh-snug:  1.28;
	--agv-lh-base:  1.62;

	--agv-track-tight: -0.022em;
	--agv-track-wide:  0.09em;

	/* --- Space -------------------------------------------------------- */
	--agv-s1: .25rem;  --agv-s2: .5rem;   --agv-s3: .75rem;
	--agv-s4: 1rem;    --agv-s5: 1.5rem;  --agv-s6: 2rem;
	--agv-s7: 3rem;    --agv-s8: 4rem;    --agv-s9: 6rem;
	--agv-s10: 8rem;

	--agv-section-y: clamp(3.25rem, 6vw, 6.5rem);

	/* --- Shape -------------------------------------------------------- */
	--agv-r-xs: 4px;
	--agv-r-sm: 8px;
	--agv-r:    12px;
	--agv-r-lg: 18px;
	--agv-r-xl: 26px;
	--agv-r-pill: 999px;

	/* --- Depth: soft and warm, never a grey drop shadow --------------- */
	--agv-sh-1: 0 1px 2px rgba(20,23,15,.06), 0 1px 1px rgba(20,23,15,.04);
	--agv-sh-2: 0 4px 12px rgba(20,23,15,.07), 0 2px 4px rgba(20,23,15,.04);
	--agv-sh-3: 0 12px 32px rgba(20,23,15,.10), 0 4px 10px rgba(20,23,15,.05);
	--agv-sh-4: 0 24px 64px rgba(20,23,15,.14), 0 8px 20px rgba(20,23,15,.07);
	--agv-sh-inset: inset 0 1px 0 rgba(255,255,255,.5);

	/* --- Layout ------------------------------------------------------- */
	--agv-wrap: 1240px;
	--agv-wrap-narrow: 760px;
	--agv-gutter: clamp(1rem, 4vw, 2.5rem);

	/* Reference height only. The header is not pinned, so nothing offsets
	   itself by this; it remains for the mobile breakpoint's own use. */
	--agv-cockpit-h: 156px;

	/* --- Motion ------------------------------------------------------- */
	--agv-ease: cubic-bezier(.4, 0, .2, 1);
	--agv-ease-out: cubic-bezier(.16, 1, .3, 1);
	--agv-ease-spring: cubic-bezier(.34, 1.4, .64, 1);
	--agv-fast: 140ms;
	--agv-base: 240ms;
	--agv-slow: 420ms;

	--agv-z-header: 100;
	--agv-z-panel: 120;
	--agv-z-float: 90;
	--agv-z-drawer: 140;
	--agv-z-modal: 160;
}

/* --- Dark ----------------------------------------------------------- */
:root[data-agv-theme="dark"],
:root[data-agv-theme="auto"] .agv-dark-probe { display: none; }

@media (prefers-color-scheme: dark) {
	:root:not([data-agv-theme="light"]) {
		--agv-ink:       #eef1e6;
		--agv-ink-2:     #d5dbc8;
		--agv-ink-3:     #b3bca4;
		--agv-ink-4:     #8d967f;
		--agv-mute:      #737c66;
		--agv-line:      #2c3324;
		--agv-line-2:    #222819;
		--agv-surface:   #171c11;
		--agv-surface-2: #1d2317;
		--agv-surface-3: #232a1c;
		--agv-canvas:    #10140c;
		--agv-brand-tint:#1c2b1a;
		--agv-mod-tint:  #1c2b1a;
		--agv-mod-tint2: #223421;
		--agv-mod-wash:  #141a10;
		--agv-sh-1: 0 1px 2px rgba(0,0,0,.4);
		--agv-sh-2: 0 4px 12px rgba(0,0,0,.45);
		--agv-sh-3: 0 12px 32px rgba(0,0,0,.5);
		--agv-sh-4: 0 24px 64px rgba(0,0,0,.6);
		--agv-sh-inset: inset 0 1px 0 rgba(255,255,255,.06);
	}
}

:root[data-agv-theme="dark"] {
	--agv-ink:       #eef1e6;
	--agv-ink-2:     #d5dbc8;
	--agv-ink-3:     #b3bca4;
	--agv-ink-4:     #8d967f;
	--agv-mute:      #737c66;
	--agv-line:      #2c3324;
	--agv-line-2:    #222819;
	--agv-surface:   #171c11;
	--agv-surface-2: #1d2317;
	--agv-surface-3: #232a1c;
	--agv-canvas:    #10140c;
	--agv-brand-tint:#1c2b1a;
	--agv-mod-tint:  #1c2b1a;
	--agv-mod-tint2: #223421;
	--agv-mod-wash:  #141a10;
	--agv-sh-1: 0 1px 2px rgba(0,0,0,.4);
	--agv-sh-2: 0 4px 12px rgba(0,0,0,.45);
	--agv-sh-3: 0 12px 32px rgba(0,0,0,.5);
	--agv-sh-4: 0 24px 64px rgba(0,0,0,.6);
}

/* --- High contrast --------------------------------------------------- */
:root[data-agv-contrast="high"] {
	--agv-ink: #000;
	--agv-line: #000;
	--agv-mute: #333;
	--agv-surface: #fff;
	--agv-surface-2: #fff;
	--agv-sh-1: 0 0 0 1px #000;
	--agv-sh-2: 0 0 0 2px #000;
	--agv-sh-3: 0 0 0 2px #000;
}
:root[data-agv-contrast="high"] * { text-shadow: none !important; }

/* --- Text size preference -------------------------------------------- */
:root[data-agv-text="lg"]  { font-size: 112.5%; }
:root[data-agv-text="xl"]  { font-size: 125%; }
