:root {
  --color-surface: #ffffff;
  --color-surface-alt: #f2f5f9;
  --color-surface-dark: #233452;
  --color-surface-deep: #00102e;

  --color-text: #000000;
  --color-muted: #666666;
  --color-border: #c3ccda;

  /* Valid only on --color-surface-dark; each fails 4.5:1 on a light surface. */
  --color-text-on-dark: #ffffff;
  --color-muted-on-dark: #c9d2e0;
  --color-accent-on-dark: #59d600;

  --color-link: #378500;
  --color-link-hover: #2a6600;
  --color-accent: #378500;

  --color-cta: #59d600;
  --color-cta-label: #233452;

  /* Must clear 3:1 on both --color-surface and --color-surface-dark. */
  --color-focus: #429e00;

  --color-danger: #b00020;

  --font-sans:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu,
    Cantarell, "Helvetica Neue", sans-serif;

  --step--1: 0.875rem;
  --step-0: 1rem;
  --step-1: clamp(1.25rem, 1.1rem + 0.5vw, 1.375rem);
  --step-2: clamp(1.5rem, 1.25rem + 1.25vw, 2rem);
  --step-3: clamp(1.75rem, 1.3rem + 2.25vw, 2.375rem);
  --step-4: clamp(2rem, 1.25rem + 3.75vw, 3rem);

  --leading-body: 1.68;
  --leading-tight: 1.2;

  --space-3xs: 0.25rem;
  --space-2xs: 0.5rem;
  --space-xs: 0.75rem;
  --space-s: 1rem;
  --space-m: 1.5rem;
  --space-l: 2rem;
  --space-xl: 3rem;
  --space-2xl: 4rem;
  --space-3xl: 6rem;

  --radius-s: 4px;
  --radius-m: 8px;
  --radius-l: 16px;

  --border-hairline: 1px solid var(--color-border);
  --border-control: 2px solid currentColor;
  --shadow-card: 0 1px 3px rgb(0 16 46 / 0.12), 0 8px 24px rgb(0 16 46 / 0.08);

  --width-prose: 68ch;
  --width-wide: 1250px;
  --gutter: 1rem;

  --z-base: 0;
  --z-raised: 10;
  --z-sticky: 100;
  --z-overlay: 1000;

  --motion-fast: 150ms;
  --motion-base: 200ms;
  --motion-slow: 300ms;
  --ease: cubic-bezier(0.2, 0, 0.2, 1);
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--color-surface);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: var(--step-0);
  line-height: var(--leading-body);
}

h1,
h2,
h3,
h4 {
  margin: 0 0 var(--space-s);
  font-weight: 600;
  line-height: var(--leading-tight);
  text-wrap: balance;
}

h1 {
  font-size: var(--step-4);
}
h2 {
  font-size: var(--step-3);
}
h3 {
  font-size: var(--step-2);
}
h4 {
  font-size: var(--step-1);
}

p,
ul,
ol {
  margin: 0 0 var(--space-m);
}

a {
  color: var(--color-link);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
}

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

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

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

.container {
  width: 100%;
  max-width: var(--width-wide);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

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

/* ---- shell ---------------------------------------------------------- */

body {
  background-image: url("/images/Clover-Weeds-Control-Darkest-Background-768.avif");
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  /* Deliberately `scroll` below 64rem. iOS Safari does not honour `fixed`
     here and substitutes its own behaviour, so pinning it makes small-screen
     rendering predictable rather than device-dependent. */
  background-attachment: scroll;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

@media (min-width: 64rem) {
  body {
    background-image: url("/images/Clover-Weeds-Control-Darkest-Background-1200.avif");
    background-attachment: fixed;
  }
}

.skip-link {
  position: absolute;
  left: -9999px;
  z-index: var(--z-overlay);
  padding: var(--space-2xs) var(--space-s);
  background: var(--color-surface-dark);
  color: var(--color-text-on-dark);
}

.skip-link:focus {
  left: var(--space-s);
  top: var(--space-s);
}

.site-header__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-s);
  padding-block: var(--space-s);
}

.site-header__brand {
  display: inline-block;
  line-height: 0;
}

.site-header__brand img {
  width: 200px;
  height: auto;
}

.site-nav {
  background: var(--color-surface-dark);
  border-block: 3px solid var(--color-accent-on-dark);
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav a {
  display: block;
  padding: var(--space-xs) var(--space-s);
  min-height: 44px;
  color: var(--color-text-on-dark);
  text-decoration: none;
  transition: color var(--motion-fast) var(--ease);
}

.site-nav a:hover {
  color: var(--color-accent-on-dark);
  text-decoration: underline;
}

/* The :not(.btn) is load-bearing. Without it this outranks .btn on equal
   specificity and repaints a filled button's label in the fill colour. */
.site-nav a[aria-current]:not(.btn) {
  color: var(--color-accent-on-dark);
  font-weight: 700;
  text-decoration: underline;
}

.site-main {
  flex: 1 0 auto;
  margin-block: var(--space-l) 0;
  padding-block: var(--space-l) var(--space-xl);
  background: var(--color-surface);
  border-radius: var(--radius-l) var(--radius-l) 0 0;
  box-shadow: var(--shadow-card);
}

.site-footer {
  background: var(--color-surface-dark);
  color: var(--color-text-on-dark);
  padding-block: var(--space-xl) var(--space-l);
}

.site-footer a {
  color: var(--color-accent-on-dark);
}

.site-footer a:hover {
  color: var(--color-text-on-dark);
}

.site-footer__grid {
  display: grid;
  gap: var(--space-l);
  grid-template-columns: 1fr;
}

@media (min-width: 40rem) {
  .site-footer__grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.site-footer h2 {
  font-size: var(--step-0);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-muted-on-dark);
}

.site-footer__legal {
  margin-top: var(--space-l);
  padding-top: var(--space-s);
  border-top: 1px solid rgb(255 255 255 / 0.2);
  font-size: var(--step--1);
  color: var(--color-muted-on-dark);
}

/* ---- components ------------------------------------------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2xs);
  min-height: 44px;
  min-width: 44px;
  padding: var(--space-xs) var(--space-l);
  border: 2px solid transparent;
  border-radius: var(--radius-l);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition:
    background-color var(--motion-fast) var(--ease),
    color var(--motion-fast) var(--ease);
}

.btn--cta {
  border-color: var(--color-cta-label);
  background: var(--color-cta);
  color: var(--color-cta-label);
}

.btn--cta:hover {
  background: var(--color-accent);
  color: var(--color-text-on-dark);
}

/* Over the header photograph the hover fill drops under 3:1; the on-dark
   border keeps the button's edge visible in every state. */
.site-header .btn--cta {
  border-color: var(--color-accent-on-dark);
}

.btn--ghost {
  border-color: currentColor;
  background: transparent;
  color: var(--color-link);
}

.btn[aria-disabled="true"],
.btn:disabled {
  opacity: 0.6;
  pointer-events: none;
}

.breadcrumb {
  margin-bottom: var(--space-m);
  font-size: var(--step--1);
}

.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2xs);
  margin: 0;
  padding: 0;
  list-style: none;
}

.breadcrumb li + li::before {
  content: "/";
  margin-right: var(--space-2xs);
  color: var(--color-muted);
}

.figure {
  margin: 0 0 var(--space-l);
}

.figure > .media-link > picture > img {
  border-radius: var(--radius-m);
}

.figure:not(.figure--native) > .media-link > picture > img {
  width: 100%;
}

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

.figure--native > .media-link {
  display: inline-block;
}

.figure--compact {
  max-width: 600px;
  margin-inline: auto;
}

.contact-grid + .figure {
  margin-top: var(--space-xl);
}

.figcaption {
  margin-top: var(--space-2xs);
  font-size: var(--step--1);
  color: var(--color-muted);
}
.byline {
  font-size: var(--step--1);
  color: var(--color-muted);
}

.media-link {
  display: block;
}

.card-grid {
  display: grid;
  gap: var(--space-l);
  grid-template-columns: 1fr;
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 40rem) {
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 64rem) {
  .card-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.card {
  display: flex;
  flex-direction: column;
  border: var(--border-hairline);
  border-radius: var(--radius-m);
  overflow: hidden;
  transition: transform var(--motion-fast) var(--ease);
}

.card:hover {
  transform: translateY(-2px);
}

.card__link {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: var(--space-2xs);
  padding: var(--space-s);
  color: var(--color-text);
  text-decoration: none;
}

/* Capped, never object-fit: each photo keeps its own ratio. */
.card__media {
  align-self: center;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 180px;
  border-radius: var(--radius-s);
}

.card__title {
  margin: var(--space-2xs) 0 0;
  font-size: var(--step-1);
  color: var(--color-link);
  text-decoration: underline;
}

.card__link:hover .card__title {
  color: var(--color-link-hover);
}

.card__body {
  margin: 0;
}

/* ---- contact form ------------------------------------------------------ */

.contact-grid {
  display: grid;
  gap: var(--space-xl);
  grid-template-columns: 1fr;
}

@media (min-width: 48rem) {
  .contact-grid {
    grid-template-columns: 1fr 1.3fr;
  }
}

.form-row {
  margin-bottom: var(--space-m);
}

.form-row label {
  display: block;
  margin-bottom: var(--space-3xs);
  font-weight: 600;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  min-height: 44px;
  padding: var(--space-2xs) var(--space-xs);
  border: var(--border-control);
  border-radius: var(--radius-s);
  font: inherit;
  color: var(--color-text);
  background: var(--color-surface);
}

.contact-form textarea {
  min-height: 8rem;
  resize: vertical;
}

.contact-form input:focus-visible,
.contact-form textarea:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 1px;
}

.contact-form [aria-invalid="true"] {
  border-color: var(--color-danger);
}

.field-error {
  margin: var(--space-3xs) 0 0;
  color: var(--color-danger);
  font-weight: 600;
}

.form-row--honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
