/* ==========================================================================
   Nature and Nurture Farm
   Theme layered over Pico CSS v2. Palette sampled from designs.pdf.
   ========================================================================== */

:root {
  /* Brand palette */
  --nf-cream: #f4f8ec;
  --nf-white: #ffffff;
  --nf-green-dark: #2c5226;
  --nf-green-mid: #5c8a3a;
  --nf-green-lite: #7fb04f;
  --nf-yellow: #f4c430;
  --nf-ink: #33402f;
  --nf-ink-soft: #4a5a45;

  --nf-serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --nf-sans: "Lato", system-ui, -apple-system, "Segoe UI", sans-serif;

  --nf-shell: 1240px;
  --nf-gutter: clamp(1.25rem, 5vw, 4rem);
  --nf-section-y: clamp(3.5rem, 8vw, 6.5rem);
  --nf-radius: 10px;
  --nf-shadow:
    0 2px 4px rgba(44, 82, 38, 0.06), 0 10px 26px rgba(44, 82, 38, 0.1);

  /* Pico overrides */
  --pico-font-family: var(--nf-sans);
  --pico-line-height: 1.6;
  --pico-border-radius: var(--nf-radius);
  --pico-primary: var(--nf-green-dark);
  --pico-primary-hover: #1f3c1a;
  --pico-primary-focus: rgba(92, 138, 58, 0.35);
  --pico-spacing: 1rem;
}

/* Single light brand theme (see data-theme="light" on <html>). */
:root {
  color-scheme: light;
}

body {
  background: var(--nf-cream);
  color: var(--nf-ink);
  font-family: var(--nf-sans);
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.125rem);
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  font-family: var(--nf-serif);
  font-weight: 700;
  color: var(--nf-green-dark);
  line-height: 1.12;
  letter-spacing: -0.01em;
  margin-block: 0 0.6em;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.75rem, 1.6rem + 5vw, 5rem);
}
h2 {
  font-size: clamp(1.9rem, 1.2rem + 2.6vw, 3rem);
}
h3 {
  font-size: clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem);
}

p {
  margin-block: 0 1em;
}
p:last-child {
  margin-bottom: 0;
}

/* Pico mutes a paragraph that directly follows a heading, which drops body copy
   well below an accessible contrast ratio. State the colour explicitly. */
main p,
main li {
  color: var(--nf-ink-soft);
}

a {
  color: var(--nf-green-mid);
  text-underline-offset: 0.18em;
}
a:hover {
  color: var(--nf-green-dark);
}

:focus-visible {
  outline: 3px solid var(--nf-green-mid);
  outline-offset: 3px;
  border-radius: 4px;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

/* --------------------------------------------------------------- Layout -- */

.shell {
  width: 100%;
  /* max-width: var(--nf-shell); */
  margin-inline: auto;
  padding-inline: var(--nf-gutter);
}

.shell--narrow {
  max-width: 42rem;
}

.section {
  padding-block: var(--nf-section-y);
}
.section--flush {
  padding-block: 0;
}

/* Pico gives every <section> a bottom margin. Between two cream sections you
   can't see it, but below a full-bleed one it shows as a cream stripe. Each
   section here sets its own vertical rhythm via padding. */
section {
  margin-bottom: 0;
}

/* Cancels Pico's `body > footer, body > header, body > main { padding-block }`.
   The hero needs to sit flush under the header; the header, footer and each
   section set their own vertical space. Matches Pico's selector so it wins on
   source order rather than a specificity bump. */
body > header,
body > main,
body > footer {
  padding-block: 0;
}

.section--dark {
  background: var(--nf-green-dark);
  color: #e6efdf;
}
/* Scoped to the section's own headings — card headings sit on white and must
   stay dark green. */
.section--dark > .shell > h2 {
  color: var(--nf-white);
}
.section--dark .lead {
  color: #cfdfc4;
}

.centred {
  text-align: center;
}

.lead {
  font-size: 1.0625em;
  color: var(--nf-ink-soft);
  max-width: 46rem;
  margin-block: -0.25em 2.5rem;
}

/* ------------------------------------------------------------- Skip link -- */

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--nf-yellow);
  color: var(--nf-green-dark);
  font-weight: 700;
  padding: 0.75rem 1.25rem;
  border-radius: 0 0 var(--nf-radius) 0;
}
.skip-link:focus {
  left: 0;
}

/* ----------------------------------------------------------- Site header -- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(244, 248, 236, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(44, 82, 38, 0.12);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4rem;
}

.site-header__brand {
  font-family: var(--nf-serif);
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--nf-green-dark);
  text-decoration: none;
}
.site-header__brand span {
  font-style: italic;
  font-weight: 600;
}

/* ---------------------------------------------------------------- Badges -- */

.badge {
  display: inline-block;
  background: var(--nf-yellow);
  color: var(--nf-green-dark);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.7em 1.6em;
  border-radius: 999px;
  margin-bottom: 1.75rem;
}

.eyebrow {
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--nf-green-mid);
  margin-bottom: 0.9rem;
}
.eyebrow--yellow {
  color: var(--nf-yellow);
}

/* --------------------------------------------------------------- Buttons -- */

.btn {
  display: inline-block;
  background: var(--nf-yellow);
  color: var(--nf-green-dark);
  font-family: var(--nf-sans);
  font-weight: 700;
  font-size: 1rem;
  line-height: 1;
  text-decoration: none;
  text-align: center;
  padding: 1.05em 2.2em;
  border: 2px solid var(--nf-yellow);
  border-radius: 999px;
  cursor: pointer;
  transition:
    background-color 0.18s ease,
    border-color 0.18s ease,
    transform 0.18s ease;
}
.btn:hover,
.btn:focus-visible {
  background: #e3b117;
  border-color: #e3b117;
  color: var(--nf-green-dark);
  transform: translateY(-1px);
}
.btn--sm {
  padding: 0.7em 1.4em;
  font-size: 0.9375rem;
}
.btn--lg {
  font-size: 1.0625rem;
  padding: 1.15em 2.6em;
}

/* ------------------------------------------------------------------ Hero -- */

.hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: stretch;
  border-left: 12px solid var(--nf-green-dark);
  background: var(--nf-cream);
}

.hero__text {
  display: flex;
  align-items: center;
  padding: clamp(3rem, 7vw, 6rem) var(--nf-gutter);
}

.hero__text-inner {
  max-width: 34rem;
  margin-left: auto;
  width: 100%;
}

.hero__lead {
  font-size: 1.0625em;
  color: var(--nf-ink-soft);
  max-width: 32rem;
  margin-top: 1.75rem;
}

.hero__strap {
  font-family: var(--nf-serif);
  font-style: italic;
  font-weight: 700;
  color: var(--nf-green-mid);
  font-size: 1.0625rem;
  margin-top: clamp(2rem, 6vw, 4.5rem);
}

.hero__media {
  position: relative;
  min-height: clamp(18rem, 42vw, 40rem);
}
.hero__media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* --------------------------------------------------- Split text / media -- */

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}

.split--full {
  gap: 0;
  max-width: none;
  padding-inline: 0;
}

.split--media-first .split__media {
  order: -1;
}

.split__text {
  max-width: 36rem;
}

.split__text--padded {
  padding: clamp(3rem, 7vw, 6rem) var(--nf-gutter);
  justify-self: center;
  max-width: calc(var(--nf-shell) / 2);
  width: 100%;
}

.split__media img {
  width: 100%;
  border-radius: 4px;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.split__media--bleed {
  position: relative;
  min-height: clamp(16rem, 40vw, 38rem);
}
.split__media--bleed img {
  position: absolute;
  inset: 0;
  height: 100%;
  border-radius: 0;
  aspect-ratio: auto;
}

/* ----------------------------------------------------------------- Quote -- */

.quote {
  background: var(--nf-green-dark);
  color: var(--nf-yellow);
  font-family: var(--nf-serif);
  font-style: italic;
  font-weight: 700;
  font-size: clamp(1.125rem, 1rem + 0.6vw, 1.5rem);
  line-height: 1.35;
  border: 0;
  border-radius: var(--nf-radius);
  padding: 1.5rem 1.85rem;
  margin: 2.5rem 0 0;
}

/* ----------------------------------------------------------------- Cards -- */

.cards {
  display: grid;
  gap: clamp(1rem, 2.2vw, 1.75rem);
  padding: 0;
  margin: 0;
}

/* Pico sets list-style on the <li>, so clearing it on the <ul> alone leaves a
   stray marker next to every custom bullet. */
.cards,
.cards > li,
.ticks,
.ticks > li {
  list-style: none;
}
.cards > li::marker,
.ticks > li::marker {
  content: "";
}
.cards--4 {
  grid-template-columns: repeat(4, 1fr);
}
.cards--3 {
  grid-template-columns: repeat(3, 1fr);
}

.card {
  background: var(--nf-white);
  color: var(--nf-ink);
  border-radius: var(--nf-radius);
  box-shadow: var(--nf-shadow);
  padding: clamp(1.25rem, 2vw, 1.75rem);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.card h3 {
  margin-bottom: 0.35rem;
}
.card p {
  color: var(--nf-ink-soft);
}

.card--centred {
  text-align: center;
  align-items: center;
}

/* Numbered circle tokens */
.token {
  display: grid;
  place-items: center;
  width: 5.25rem;
  height: 5.25rem;
  border-radius: 50%;
  font-family: var(--nf-serif);
  font-weight: 700;
  font-size: 1.75rem;
  line-height: 1;
  margin: 0.25rem 0 1.5rem;
  flex: none;
}
.token--sm {
  width: 3.75rem;
  height: 3.75rem;
  font-size: 1.375rem;
  margin-bottom: 1.25rem;
}
/* Doubled class so these beat `.card p`, which the tokens sit inside. */
.token.token--dark {
  background: var(--nf-green-dark);
  color: var(--nf-cream);
}
.token.token--mid {
  background: var(--nf-green-mid);
  color: var(--nf-white);
}
.token.token--light {
  background: var(--nf-green-lite);
  color: var(--nf-white);
}
.token.token--yellow {
  background: var(--nf-yellow);
  color: var(--nf-green-dark);
}

/* ------------------------------------------------------------ Tick lists -- */

.ticks {
  list-style: none;
  padding: 0;
  margin: 2rem 0 0;
  display: grid;
  gap: 1.1rem;
  max-width: 34rem;
}

.ticks li {
  position: relative;
  padding-left: 1.85rem;
  color: var(--nf-ink-soft);
}

.ticks li::before {
  content: "";
  position: absolute;
  left: 0.35rem;
  top: 0.58em;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--nf-green-mid);
}

.ticks--light li {
  color: #e8f0e1;
}
.ticks--light li::before {
  background: var(--nf-yellow);
}

/* ----------------------------------------------------------- Environment -- */

.environment {
  position: relative;
  isolation: isolate;
  background: var(--nf-green-dark);
  padding-block: clamp(2.5rem, 6vw, 4.5rem);
}

.environment__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -2;
}

/* Keeps the panel text legible wherever the photo is bright. */
.environment::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(20, 42, 16, 0.35),
    rgba(20, 42, 16, 0.1)
  );
  z-index: -1;
}

/* The panel sits close to the viewport edge, as in the design. */
.environment__shell {
  max-width: none;
  padding-inline: 0 0;
  padding-left: clamp(0px, 1.5vw, 24px);
}

.environment__panel {
  background: rgba(30, 58, 24, 0.93);
  color: var(--nf-white);
  padding: clamp(2.25rem, 5vw, 3.5rem) clamp(1.5rem, 4vw, 3.5rem);
  width: min(100%, 56%);
  border-radius: 0 var(--nf-radius) var(--nf-radius) 0;
}
.environment__panel h2 {
  color: var(--nf-white);
}
.environment__panel .ticks {
  max-width: none;
}

/* ------------------------------------------------------------ Strapline -- */

.strapline {
  font-family: var(--nf-serif);
  font-style: italic;
  font-weight: 700;
  color: var(--nf-yellow);
  font-size: clamp(1.25rem, 0.95rem + 1.4vw, 2rem);
  text-align: center;
  text-wrap: balance;
  margin: clamp(2.5rem, 6vw, 4rem) auto clamp(2rem, 4vw, 2.75rem);
  max-width: 44rem;
}

/* ------------------------------------------------------------------ Form -- */

.form {
  margin-top: 2.5rem;
}

/* Web3Forms honeypot — off-screen rather than display:none, which bots skip. */
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.form label {
  font-weight: 700;
  color: var(--nf-green-dark);
  display: block;
}

.form .optional {
  font-weight: 400;
  color: var(--nf-ink-soft);
}

.form input,
.form select,
.form textarea {
  font-family: var(--nf-sans);
  font-weight: 400;
  color: var(--nf-ink);
  background: var(--nf-white);
  border: 2px solid rgba(44, 82, 38, 0.22);
  border-radius: var(--nf-radius);
  margin-top: 0.45rem;
}

.form input:focus,
.form select:focus,
.form textarea:focus {
  border-color: var(--nf-green-mid);
  box-shadow: none;
}

.form__note {
  margin-top: 1.25rem;
  color: var(--nf-ink-soft);
  font-size: 0.9375rem;
}

.form__error {
  background: #fdf0f0;
  border-left: 4px solid #9c2b2b;
  color: #7a2121;
  padding: 0.9rem 1.1rem;
  border-radius: 4px;
  margin-bottom: 1.5rem;
}

.form__error[hidden] {
  display: none;
}

/* HTMX in-flight state */
.htmx-request .btn {
  opacity: 0.65;
  pointer-events: none;
}

.thanks {
  background: var(--nf-white);
  border-radius: var(--nf-radius);
  box-shadow: var(--nf-shadow);
  padding: clamp(1.75rem, 4vw, 2.75rem);
  margin-top: 2.5rem;
}
.thanks h3 {
  margin-bottom: 0.5rem;
}

/* ----------------------------------------------------------- Site footer -- */

.site-footer {
  background: var(--nf-green-dark);
  color: #cfdfc4;
  padding-block: clamp(2.5rem, 5vw, 3.5rem);
  border-top: 8px solid var(--nf-yellow);
}
.site-footer a {
  color: var(--nf-yellow);
}
.site-footer__brand {
  font-family: var(--nf-serif);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--nf-white);
}
.site-footer__meta {
  color: #eaf3e3;
}
.site-footer__small {
  font-style: italic;
  color: #a9c39b;
  margin-top: 1rem;
}

/* ----------------------------------------------------------- Responsive -- */

@media (max-width: 1000px) {
  .cards--4 {
    grid-template-columns: repeat(2, 1fr);
  }
  .environment__panel {
    width: min(100%, 78%);
  }
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    border-left-width: 8px;
  }
  .hero__media {
    min-height: clamp(15rem, 55vw, 24rem);
    order: -1;
  }
  .hero__text-inner {
    margin-left: 0;
    max-width: none;
  }

  .split {
    grid-template-columns: 1fr;
  }
  .split--media-first .split__media {
    order: 0;
  }
  .split__text {
    max-width: none;
  }
  .split__text--padded {
    max-width: none;
    padding-block: clamp(2.5rem, 8vw, 4rem);
  }
  .split__media--bleed {
    min-height: clamp(14rem, 55vw, 22rem);
  }
  .split__media img {
    aspect-ratio: 4 / 3;
  }

  .cards--3 {
    grid-template-columns: 1fr;
  }

  .environment__shell {
    padding-inline: var(--nf-gutter);
  }
  .environment__panel {
    width: 100%;
    border-radius: var(--nf-radius);
  }

  .ticks {
    max-width: none;
  }
}

@media (max-width: 560px) {
  .cards--4 {
    grid-template-columns: 1fr;
  }
  .site-header__brand {
    font-size: 0.75rem;
  }
  /* The header button's padding is em-based, so shrinking the label shrinks the
     pill with it. min-height holds it at the height it had at the larger font
     size, so it stays a comfortable thing to tap. */
  .site-header .btn--sm {
    font-size: 0.75rem;
    min-height: 2.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .btn {
    width: 100%;
  }
  .btn--sm {
    width: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .btn:hover {
    transform: none;
  }
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

html {
  scroll-padding-top: 5rem;
}
