/* ==================================================================
   Variables
   ================================================================== */

:root {
  /* Colors */
  --color-bg: #f8faf5; /* soft natural white */
  --color-bg-alt: #f1f4ea; /* subtle green-tinted background */
  --color-text: #253020; /* deep organic green-brown */
  --color-text-muted: #6d7762;

  --color-primary: #4c9a4a; /* leaf green */
  --color-primary-soft: #e3f3e2;
  --color-primary-strong: #2f7730;

  --color-success: #4c9a4a;
  --color-warning: #d89b3c; /* warm, natural amber */
  --color-danger: #c6533a; /* earthy terracotta red */

  --color-border-subtle: #dde3d5;
  --color-border-strong: #b7c1ac;

  --color-surface: #ffffff; /* cards, panels */
  --color-surface-alt: #f4efe8; /* earthy beige */

  /* Neutral grays (organic, slightly warm) */
  --gray-50: #f9faf7;
  --gray-100: #f1f3ec;
  --gray-200: #e1e5d9;
  --gray-300: #d0d8c6;
  --gray-400: #b7c1ac;
  --gray-500: #9aa48f;
  --gray-600: #7a846e;
  --gray-700: #5d6651;
  --gray-800: #404736;
  --gray-900: #23281c;

  /* Typography */
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji",
    "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
  --font-serif: "Georgia", "Times New Roman", serif;

  --font-size-xs: 0.75rem;   /* 12px */
  --font-size-sm: 0.875rem;  /* 14px */
  --font-size-md: 1rem;      /* 16px */
  --font-size-lg: 1.125rem;  /* 18px */
  --font-size-xl: 1.25rem;   /* 20px */
  --font-size-2xl: 1.5rem;   /* 24px */
  --font-size-3xl: 1.875rem; /* 30px */
  --font-size-4xl: 2.25rem;  /* 36px */

  --line-height-tight: 1.2;
  --line-height-snug: 1.35;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.7;

  /* Spacing scale (0–96px) */
  --space-0: 0;
  --space-1: 0.25rem;  /* 4px */
  --space-2: 0.5rem;   /* 8px */
  --space-3: 0.75rem;  /* 12px */
  --space-4: 1rem;     /* 16px */
  --space-5: 1.25rem;  /* 20px */
  --space-6: 1.5rem;   /* 24px */
  --space-8: 2rem;     /* 32px */
  --space-10: 2.5rem;  /* 40px */
  --space-12: 3rem;    /* 48px */
  --space-16: 4rem;    /* 64px */
  --space-20: 5rem;    /* 80px */
  --space-24: 6rem;    /* 96px */

  /* Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;
  --radius-pill: 999px;

  /* Shadows (soft, organic) */
  --shadow-xs: 0 1px 2px rgba(16, 24, 16, 0.06);
  --shadow-sm: 0 2px 6px rgba(16, 24, 16, 0.08);
  --shadow-md: 0 8px 20px rgba(16, 24, 16, 0.12);

  /* Transitions */
  --transition-fast: 120ms ease-out;
  --transition-base: 180ms ease-out;
  --transition-slow: 250ms ease-out;
}

/* ==================================================================
   Reset / Normalize
   ================================================================== */

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

html,
body,
div,
span,
applet,
object,
iframe,

h1,
h2,
h3,
h4,
h5,
h6,

p,
blockquote,
pre,

a,
abbr,
acronym,
address,
big,
cite,
code,
del,
dfn,
em,
img,
ins,
kbd,
q,
s,
samp,
small,
strike,
strong,
sub,
sup,
tt,
var,

b,
u,
i,
center,

dl,
dt,
dd,
ol,
ul,
li,

fieldset,
form,
label,
legend,

table,
caption,
tbody,
tfoot,
thead,
tr,
th,
td,

article,
aside,
canvas,
details,
embed,
figure,
figcaption,
footer,
header,
hgroup,
menu,
nav,
output,
ruby,
section,
summary,
time,
mark,
audio,
video {
  margin: 0;
  padding: 0;
  border: 0;
  font: inherit;
  vertical-align: baseline;
}

/* HTML5 display-role reset for older browsers */
article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
menu,
nav,
section {
  display: block;
}

body {
  line-height: 1;
}

ol,
ul {
  list-style: none;
}

blockquote,
q {
  quotes: none;
}

blockquote::before,
blockquote::after,
q::before,
q::after {
  content: "";
  content: none;
}

table {
  border-collapse: collapse;
  border-spacing: 0;
}

html {
  scroll-behavior: smooth;
}

img,
svg,
video,
canvas,
audio,
iframe,
embed,
object {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

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

button {
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
}

/* ==================================================================
   Base Styles
   ================================================================== */

body {
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: var(--font-size-md);
  line-height: var(--line-height-relaxed);
  background-color: var(--color-bg);
  color: var(--color-text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 600;
  color: var(--color-text);
  line-height: var(--line-height-snug);
}

h1 {
  font-size: var(--font-size-4xl);
  letter-spacing: -0.02em;
  margin-bottom: var(--space-4);
}

h2 {
  font-size: var(--font-size-3xl);
  letter-spacing: -0.01em;
  margin-bottom: var(--space-4);
}

h3 {
  font-size: var(--font-size-2xl);
  margin-bottom: var(--space-3);
}

h4 {
  font-size: var(--font-size-xl);
  margin-bottom: var(--space-2);
}

h5 {
  font-size: var(--font-size-lg);
  margin-bottom: var(--space-2);
}

h6 {
  font-size: var(--font-size-md);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-2);
}

p {
  margin-bottom: var(--space-4);
  color: var(--color-text);
}

p:last-child {
  margin-bottom: 0;
}

a {
  color: var(--color-primary-strong);
  text-decoration: none;
  transition: color var(--transition-base);
}

a:hover {
  color: var(--color-primary);
}

a:active {
  color: var(--color-primary-strong);
}

strong,
b {
  font-weight: 600;
}

small {
  font-size: var(--font-size-sm);
}

hr {
  border: none;
  border-top: 1px solid var(--color-border-subtle);
  margin: var(--space-8) 0;
}

/* ==================================================================
   Utilities
   ================================================================== */

/* Layout helpers */

.container {
  width: 100%;
  max-width: 1120px;
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-4);
  padding-right: var(--space-4);
}

@media (min-width: 1200px) {
  .container {
    max-width: 1200px;
  }
}

.flex {
  display: flex;
}

.inline-flex {
  display: inline-flex;
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.flex-col {
  display: flex;
  flex-direction: column;
}

.grid {
  display: grid;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-6);
}

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

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

.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

.mt-0 { margin-top: 0; }
.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }

.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }

.py-section {
  padding-top: var(--space-12);
  padding-bottom: var(--space-12);
}

@media (max-width: 768px) {
  .py-section {
    padding-top: var(--space-8);
    padding-bottom: var(--space-8);
  }
}

/* Screen-reader only */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
  white-space: nowrap;
}

.sr-only-focusable:active,
.sr-only-focusable:focus {
  position: static;
  width: auto;
  height: auto;
  margin: 0;
  overflow: visible;
  clip: auto;
  white-space: normal;
}

/* ==================================================================
   Components
   ================================================================== */

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0.7rem 1.4rem;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  font-size: var(--font-size-sm);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background-color: var(--color-primary);
  color: #ffffff!important;
  box-shadow: var(--shadow-sm);
  transition:
    background-color var(--transition-base),
    box-shadow var(--transition-base),
    transform var(--transition-fast),
    border-color var(--transition-base),
    color var(--transition-base);
}

.btn:hover {
  background-color: var(--color-primary-strong);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.btn:active {
  background-color: var(--color-primary-strong);
  box-shadow: var(--shadow-xs);
  transform: translateY(0);
}

.btn-secondary {
  background-color: var(--color-surface);
  color: var(--color-text)!important;
  border-color: var(--color-border-subtle);
  box-shadow: var(--shadow-xs);
}

.btn-secondary:hover {
  background-color: var(--color-bg-alt);
  border-color: var(--color-primary-soft);
  color: var(--color-text)!important;
}

.btn-ghost {
  background-color: transparent;
  color: var(--color-primary-strong)!important;
  border-color: transparent;
  box-shadow: none;
}

.btn-ghost:hover {
  background-color: var(--color-primary-soft);
  border-color: var(--color-primary-soft);
}

.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

/* Inputs */

.input,
select,
textarea {
  width: 100%;
  padding: 0.65rem 0.9rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border-subtle);
  background-color: var(--color-surface);
  color: var(--color-text);
  font-size: var(--font-size-sm);
  transition:
    border-color var(--transition-base),
    box-shadow var(--transition-base),
    background-color var(--transition-base);
}

.input::placeholder,
textarea::placeholder {
  color: var(--color-text-muted);
}

.input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 1px var(--color-primary-soft);
  background-color: #ffffff;
}

.input[disabled],
select[disabled],
textarea[disabled] {
  background-color: var(--gray-100);
  cursor: not-allowed;
  color: var(--gray-500);
}

label {
  display: block;
  margin-bottom: var(--space-2);
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--color-text);
}

/* Cards */

.card {
  background-color: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(183, 193, 172, 0.45);
}

.card-soft {
  background: linear-gradient(135deg, var(--color-surface) 0%, var(--color-bg-alt) 100%);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  box-shadow: var(--shadow-xs);
}

.card-header {
  margin-bottom: var(--space-4);
}

.card-title {
  font-size: var(--font-size-xl);
  font-weight: 600;
  margin-bottom: var(--space-1);
}

.card-subtitle {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

/* Badge (for eco labels, etc.) */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.6rem;
  border-radius: var(--radius-pill);
  font-size: var(--font-size-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background-color: var(--color-primary-soft);
  color: var(--color-primary-strong);
}

/* ==================================================================
   Accessibility & Motion
   ================================================================== */

:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

button:focus-visible,
.btn:focus-visible,
.input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
}

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

/* ==================================================================
   Responsive Typography Tweaks
   ================================================================== */

@media (max-width: 768px) {
  h1 {
    font-size: 1.9rem;
  }

  h2 {
    font-size: 1.6rem;
  }

  h3 {
    font-size: 1.35rem;
  }
}
