/* Developed by Jady Pamella | jadypamella.com */

:root {
  --green: #1F4D3A;
  --green-light: #EAF2EC;
  --orange: #C2601E; /* 4.2:1 on white: large text and decoration only */
  --ink: #1B2A22;
  --ink-soft: #3E4F45;
  --white: #FFFFFF;
  --line: #CFDDD3;
  --header-bg: rgba(255, 255, 255, 0.96);
  --field-border: #6B7D72;
  --error: #A23B12;

  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius: 10px;
  --space: 1.5rem;
  --max: 68rem;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.125rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--white);
  -webkit-text-size-adjust: 100%;
}

img { max-width: 100%; display: block; }

h1, h2, h3 {
  line-height: 1.2;
  font-weight: 700;
  color: var(--green);
  margin: 0 0 1rem;
}
h1 { font-size: clamp(2.1rem, 6vw, 3.5rem); letter-spacing: -0.02em; max-width: 20ch; }
h2 { font-size: clamp(1.6rem, 4vw, 2.25rem); letter-spacing: -0.01em; max-width: 24ch; }
h3 { font-size: 1.25rem; }

p { margin: 0 0 1rem; max-width: 62ch; }

a { color: var(--green); text-underline-offset: 0.2em; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible {
  outline: 3px solid var(--orange);
  outline-offset: 3px;
  border-radius: 4px;
}

.container {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1.25rem;
}
.narrow > * { max-width: 40rem; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; margin: -1px; padding: 0; border: 0;
}

.skip-link {
  position: absolute;
  left: 1rem; top: -4rem;
  background: var(--green);
  color: var(--white);
  padding: 0.6rem 1rem;
  border-radius: var(--radius);
  z-index: 20;
}
.skip-link:focus { top: 1rem; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--header-bg);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 4rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--green);
  text-decoration: none;
}
.brand img { width: 48px; height: 48px; }

.lang-switch {
  display: inline-flex;
  border: 1px solid var(--green);
  border-radius: 999px;
  overflow: hidden;
}
.lang-switch button {
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  min-width: 3rem;
  min-height: 2.5rem;
  padding: 0 0.9rem;
  border: 0;
  background: transparent;
  color: var(--green);
  cursor: pointer;
}
.lang-switch button[aria-pressed="true"] {
  background: var(--green);
  color: var(--white);
}

/* Sections */
.hero { padding: 4rem 0 4.5rem; }
.section { padding: 4rem 0; }
.section-tint { background: var(--green-light); }

.eyebrow {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 0.75rem;
}
.lead { font-size: 1.25rem; color: var(--ink-soft); }

.hero-inner {
  display: flex;
  flex-direction: column-reverse;
  gap: 1.5rem;
}
.hero-mascot {
  width: 6.5rem;
  height: auto;
}
.hint {
  font-size: 0.95rem;
  color: var(--ink-soft);
  margin-top: 0.9rem;
}
.survey-pending {
  color: var(--green);
  font-weight: 600;
}

/* Buttons */
.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0.75rem 1.4rem;
  border-radius: var(--radius);
  border: 2px solid var(--green);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.button-primary { background: var(--green); color: var(--white); }
.button-primary:hover { background: var(--ink); border-color: var(--ink); }
.button-secondary { background: var(--white); color: var(--green); }
.button-secondary:hover { background: var(--green-light); }

/* Problem */
.facts,
.steps,
.team,
.checks { list-style: none; margin: 0; padding: 0; }

.facts {
  display: grid;
  gap: var(--space);
  margin: 2rem 0;
}
.fact {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.fact p { margin: 0; }
.fact-figure {
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--orange);
  margin-bottom: 0.5rem !important;
}
.fact sup { line-height: 0; }
.fact sup a { padding: 0 0.15em; }
.problem-close { font-size: 1.2rem; }

.notes {
  margin-top: 2rem;
  border-top: 1px solid var(--line);
  padding-top: 1rem;
  font-size: 0.9rem;
  color: var(--ink-soft);
}
.notes ol { margin: 0; padding-left: 1.25rem; }
.notes li:target { background: var(--white); }

/* Steps */
.steps {
  display: grid;
  gap: var(--space);
  margin-top: 2rem;
}
.step {
  border-top: 3px solid var(--green);
  padding-top: 1.25rem;
}
.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem; height: 2.5rem;
  border-radius: 50%;
  background: var(--green-light);
  color: var(--green);
  font-weight: 700;
  margin-bottom: 0.75rem;
}

/* Farmers and members */
.split {
  display: grid;
  gap: 2rem;
}
.checks { margin-bottom: 1.5rem; }
.checks li {
  position: relative;
  padding-left: 1.75rem;
  margin-bottom: 0.75rem;
}
.checks li::before {
  content: "";
  position: absolute;
  left: 0; top: 0.55em;
  width: 0.7rem; height: 0.7rem;
  border-radius: 50%;
  background: var(--orange);
}
.note-line { color: var(--ink-soft); font-style: italic; }

/* Team */
.team {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(6rem, 1fr));
  gap: 2rem 1rem;
  margin-top: 2rem;
  max-width: 44rem;
}
.member { text-align: center; }
.member p { margin: 0 auto; }
.member-name { font-weight: 700; color: var(--green); margin-top: 0.9rem !important; }
.member-role { font-size: 1rem; color: var(--ink-soft); }

.avatar {
  position: relative;
  width: 100%;
  max-width: 8.5rem;
  aspect-ratio: 1;
  margin: 0 auto;
  border-radius: 50%;
  overflow: hidden;
  background: var(--green-light);
  border: 2px solid var(--green);
}
.avatar::before {
  content: attr(data-initials);
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--green);
}
.avatar img {
  position: relative;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1);
}

/* Form */
form { margin-top: 2rem; }
.field { margin: 0 0 1.25rem; padding: 0; border: 0; }
fieldset.field { min-width: 0; }
label,
legend {
  display: block;
  font-weight: 600;
  margin-bottom: 0.4rem;
}
legend { padding: 0; }
.optional { font-weight: 400; color: var(--ink-soft); }

input[type="text"],
input[type="email"],
textarea {
  width: 100%;
  font: inherit;
  color: var(--ink);
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--field-border);
  border-radius: var(--radius);
  background: var(--white);
}
textarea { resize: vertical; }
input[aria-invalid="true"],
textarea[aria-invalid="true"] { border-color: var(--error); border-width: 2px; }

.choice,
.consent {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
}
.choice { margin-bottom: 0.4rem; }
.choice label,
.consent label { font-weight: 400; margin: 0; }
.choice input,
.consent input {
  width: 1.25rem; height: 1.25rem;
  margin: 0.2rem 0 0;
  flex-shrink: 0;
  accent-color: var(--green);
}

.form-error {
  color: var(--error);
  font-weight: 600;
}

.thanks {
  margin-top: 2rem;
  padding: 1.5rem;
  border-radius: var(--radius);
  background: var(--green-light);
  border-left: 4px solid var(--green);
}
.thanks p { margin: 0; }

/* Footer */
.site-footer {
  background: var(--green);
  color: var(--white);
  padding: 2.5rem 0;
  font-size: 1rem;
}
.site-footer p { margin: 0 0 0.5rem; }
.site-footer a { color: var(--white); }
.site-footer .small { font-size: 0.9rem; opacity: 0.9; }

/* Wider screens */
@media (min-width: 48rem) {
  .hero { padding: 6rem 0 6.5rem; }
  .section { padding: 5.5rem 0; }
  .facts { grid-template-columns: repeat(2, 1fr); max-width: 46rem; }
  .steps { grid-template-columns: repeat(3, 1fr); }
  .hero-inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 3rem;
  }
  .hero-mascot { width: 13rem; flex-shrink: 0; }
  .split { grid-template-columns: 1fr 1fr; gap: 4rem; align-items: start; }
}

/* Dark theme: the brand green as background, white as text.
   Variables swap, so every rule that paints green on white now paints white on green. */
:root[data-theme="dark"] {
  --green: #FFFFFF;
  --white: #1F4D3A;
  --green-light: #173A2C;
  --ink: #F3F7F4;
  --ink-soft: #D5E2D9;
  --line: #3D6653;
  --orange: #F2A36B;
  --header-bg: rgba(31, 77, 58, 0.96);
  --field-border: #9DB8A8;
  --error: #FFC2A8;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --green: #FFFFFF;
    --white: #1F4D3A;
    --green-light: #173A2C;
    --ink: #F3F7F4;
    --ink-soft: #D5E2D9;
    --line: #3D6653;
    --orange: #F2A36B;
    --header-bg: rgba(31, 77, 58, 0.96);
    --field-border: #9DB8A8;
    --error: #FFC2A8;
  }
}

/* Logo per theme */
.logo-dark { display: none; }
:root[data-theme="dark"] .logo-light { display: none; }
:root[data-theme="dark"] .logo-dark { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .logo-light { display: none; }
  :root:not([data-theme="light"]) .logo-dark { display: block; }
}

/* Theme button */
.header-tools { display: flex; align-items: center; gap: 0.75rem; }
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid var(--green);
  border-radius: 999px;
  background: transparent;
  color: var(--green);
  cursor: pointer;
}
.theme-toggle[aria-pressed="true"] { background: var(--green); color: var(--white); }
