/* ==========================================================================
   Global: reset, base typography, layout primitives, header, footer.
   Mobile-first: these are the small-screen styles. Larger-screen refinements
   live in responsive.css, which loads last.
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* Anchor jumps should not hide headings under the sticky header. */
  scroll-padding-top: calc(var(--nav-row-h) + 1rem);
}

body {
  margin: 0;
  min-width: 320px;
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: 1.7;
  color: var(--text);
  background: var(--surface);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, p, ul, ol, dl, dd, figure, blockquote {
  margin: 0;
}

ul, ol {
  padding: 0;
  list-style: none;
}

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

a {
  color: inherit;
  text-decoration: none;
}

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

table {
  border-collapse: collapse;
  width: 100%;
}

/* ---- Accessibility helpers ---- */
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: var(--space-4);
  top: -4rem;
  z-index: 1000;
  padding: var(--space-3) var(--space-4);
  background: var(--green-700);
  color: var(--white);
  font-weight: 700;
  border-radius: var(--radius);
}
.skip-link:focus {
  top: var(--space-3);
}

/* Visible keyboard focus everywhere. Light ring on dark areas is set below. */
:focus-visible {
  outline: 3px solid var(--green-600);
  outline-offset: 3px;
  border-radius: 2px;
}
.on-dark :focus-visible,
.site-footer :focus-visible,
.hero :focus-visible,
.page-hero :focus-visible,
.cta-band :focus-visible {
  outline-color: var(--gold-300);
}

/* ---- Layout primitives ---- */
.container {
  width: min(var(--container), 100% - 2 * var(--gutter));
  margin-inline: auto;
}
.container--narrow {
  width: min(var(--container-narrow), 100% - 2 * var(--gutter));
  margin-inline: auto;
}

.section {
  padding-block: var(--section-y);
}
.section--white { background: var(--white); }
.section--tint { background: var(--surface-alt); }
.section--dark {
  background: linear-gradient(135deg, var(--green-900), var(--green-700));
  color: var(--on-dark);
}

/* A section heading block: eyebrow + h2 + optional lead. */
.section-head {
  max-width: 760px;
  margin: 0 auto var(--space-7);
  text-align: center;
}
.section-head--left {
  margin-inline: 0;
  text-align: left;
}

/* ---- Headings ---- */
h1, h2, h3, h4 {
  font-family: var(--font-serif);
  line-height: 1.2;
  color: var(--green-700);
}
h2 {
  font-size: var(--fs-h2);
  font-weight: 700;
}
h3 {
  font-size: var(--fs-h3);
  font-weight: 700;
  line-height: 1.3;
}
h4 {
  font-size: var(--fs-h4);
  font-weight: 700;
  line-height: 1.35;
}
/* Emphasised phrase inside a heading: the brand's italic accent. */
h1 em, h2 em, h3 em {
  font-style: italic;
  font-weight: 300;
}
h2 em { color: var(--green-accent); }

.on-dark h2, .section--dark h2,
.on-dark h3, .section--dark h3,
.on-dark h4, .section--dark h4 {
  color: var(--white);
}
.on-dark h2 em, .section--dark h2 em { color: var(--gold-200); }

.lead {
  max-width: 62ch;
  font-size: var(--fs-md);
  line-height: 1.8;
  color: var(--text-muted);
}
.section-head .lead { margin: var(--space-4) auto 0; }
.section-head--left .lead { margin-left: 0; }
.on-dark .lead, .section--dark .lead { color: var(--on-dark-muted); }

/* Section label — mono, tracked, flanked by short rules (original style). */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: var(--space-3);
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-text);
}
.eyebrow::before,
.eyebrow::after {
  content: "";
  width: 1.5rem;
  height: 1px;
  background: currentColor;
}
.section-head--left .eyebrow::before { display: none; }
.on-dark .eyebrow, .section--dark .eyebrow, .hero .eyebrow, .page-hero .eyebrow, .cta-band .eyebrow {
  color: var(--gold-300);
}

/* Prose blocks keep a readable line length. */
.prose > * + * { margin-top: var(--space-4); }
.prose p { max-width: 68ch; }
.prose a, .text-link {
  color: var(--green-600);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
.prose a:hover, .text-link:hover { color: var(--green-700); text-decoration-thickness: 2px; }
.on-dark .text-link, .section--dark .text-link, .cta-band .text-link { color: var(--gold-200); }

/* ==========================================================================
   Header
   Two rows on desktop (brand + nav), one compact row on mobile.
   On desktop only the nav row stays pinned while scrolling (the brand row
   slides away), via a negative sticky offset — no JavaScript involved.
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 500;
  background: var(--white);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 2px 16px rgba(13, 33, 18, 0.05);
}

.site-header__brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  min-height: 68px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  min-width: 0;
}
.logo__mark {
  width: 48px;
  height: 48px;
  flex: none;
  object-fit: contain;
}
.logo__text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.logo__name {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--green-700);
}
.logo__name b { font-weight: 900; }
/* The tagline is artwork cut from the company logo, so its lettering is the
   same on every device. */
.logo__tag { display: block; margin-top: 0.2rem; }
.logo__tag img { width: 100%; max-width: 140px; height: auto; }

.header-cta { display: none; }

/* Mobile menu button (hidden on desktop and when JS is off — see no-js.css) */
.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  flex: none;
  padding: 0;
  background: var(--white);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  cursor: pointer;
}
.nav-toggle__bars,
.nav-toggle__bars::before,
.nav-toggle__bars::after {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--green-700);
  transition: transform var(--dur) var(--ease), opacity var(--dur);
}
.nav-toggle__bars { position: relative; }
.nav-toggle__bars::before,
.nav-toggle__bars::after {
  content: "";
  position: absolute;
  left: 0;
}
.nav-toggle__bars::before { top: -6px; }
.nav-toggle__bars::after { top: 6px; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars::after { transform: translateY(-6px) rotate(-45deg); }

.site-nav {
  display: none;
  border-top: 1px solid var(--line);
  background: var(--white);
}
.site-nav.is-open { display: block; }

.site-nav__list {
  display: flex;
  flex-direction: column;
  padding-block: var(--space-2);
}
.site-nav a {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 0 var(--space-3);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--green-700);
  border-left: 3px solid transparent;
  transition: color var(--dur), background var(--dur), border-color var(--dur);
}
.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--green-600);
  background: rgba(232, 245, 233, 0.6);
  border-left-color: var(--gold-500);
}

/* Announcement strip under the header (home page) */
.brand-message {
  padding: 0.75rem var(--gutter);
  text-align: center;
  background: var(--green-700);
  color: var(--white);
  font-size: var(--fs-sm);
}
.brand-message strong { font-family: var(--font-serif); font-weight: 700; }
.brand-message em {
  font-style: italic;
  font-weight: 300;
  color: var(--gold-200);
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  background: var(--green-900);
  color: #a0a8a2;
  padding-top: var(--space-8);
  font-size: var(--fs-sm);
}
.site-footer__grid {
  display: grid;
  gap: var(--space-7);
}
.site-footer__name {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--white);
}
.site-footer__name b { font-weight: 900; }
.site-footer__tag { margin-top: 0.4rem; }
.site-footer__tag img, .site-footer__script img { width: 210px; max-width: 100%; height: auto; }
.site-footer__about {
  margin-top: var(--space-4);
  max-width: 44ch;
  line-height: 1.8;
}
.site-footer h2 {
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold-300);
}
.site-footer__links li + li { margin-top: 0.15rem; }
.site-footer a {
  display: inline-block;
  padding-block: 0.2rem;
  color: #c3cac5;
  transition: color var(--dur);
}
.site-footer a:hover { color: var(--gold-200); }
.site-footer address { font-style: normal; line-height: 1.8; }
.site-footer address > * + * { margin-top: 0.6rem; }
.site-footer__bottom {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-top: var(--space-8);
  padding-block: var(--space-5);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: var(--fs-xs);
}

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