/* ==========================================================================
   Gardener & Son — shared brand stylesheet
   findmyecologicalgarden.com
   Tokens + primitives only. No page-specific layout lives here.
   Link from every page as:  <link rel="stylesheet" href="/assets/brand.css">
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Fonts
   Abril Fatface — hero only, once per page, never below the fold.
   Fraunces      — editorial display (section heads, pull quotes, cards).
   IBM Plex Sans — body.
   IBM Plex Mono — labels, botanical names, numerals, codes.
   -------------------------------------------------------------------------- */
@import url('https://fonts.googleapis.com/css2?family=Abril+Fatface&family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,600;1,9..144,400&family=IBM+Plex+Mono:ital,wght@0,400;0,500;1,400&family=IBM+Plex+Sans:ital,wght@0,400;0,500;0,600;1,400&display=swap');

/* --------------------------------------------------------------------------
   2. Tokens
   -------------------------------------------------------------------------- */
:root {
  /* Core palette */
  --green:         #3d4535;   /* Gardener Green */
  --beige:         #fff0dc;   /* Nostalgic Beige */
  --beige-deep:    #f7e8cf;   /* deeper beige for the middle section band */
  --signal:        #7C9A52;   /* Signal Green — the accent role */
  --signal-hover:  #6A8544;
  --brass:         #B49A63;   /* Dry Grass Brass — dividers/accents on LIGHT backgrounds only */

  /* Derived text colours */
  --ink:           var(--green);
  --ink-muted:     rgba(61, 69, 53, 0.68);
  --ink-faint:     rgba(61, 69, 53, 0.42);
  --ink-invert:    var(--beige);
  --ink-invert-muted: rgba(255, 240, 220, 0.70);

  /* Hairlines */
  --rule:          rgba(61, 69, 53, 0.16);
  --rule-invert:   rgba(255, 240, 220, 0.20);
  --wash-invert:   rgba(255, 240, 220, 0.05);

  /* Type */
  --font-hero:     'Abril Fatface', Georgia, serif;
  --font-display:  'Fraunces', Georgia, serif;
  --font-body:     'IBM Plex Sans', system-ui, -apple-system, sans-serif;
  --font-mono:     'IBM Plex Mono', ui-monospace, monospace;

  /* Scale */
  --step--1: clamp(0.78rem, 0.76rem + 0.10vw, 0.84rem);
  --step-0:  clamp(1.00rem, 0.97rem + 0.15vw, 1.09rem);
  --step-1:  clamp(1.22rem, 1.15rem + 0.35vw, 1.45rem);
  --step-2:  clamp(1.55rem, 1.40rem + 0.75vw, 2.10rem);
  --step-3:  clamp(2.00rem, 1.70rem + 1.50vw, 3.10rem);
  --step-4:  clamp(2.60rem, 2.00rem + 3.00vw, 5.20rem);

  /* Space */
  --gap-xs: 0.5rem;
  --gap-s:  1rem;
  --gap-m:  2rem;
  --gap-l:  4rem;
  --gap-xl: 7rem;
  --measure: 62ch;
  --shell: 1180px;

  /* Structural */
  --radius: 0;
  --nav-h: 68px;
}

/* --------------------------------------------------------------------------
   3. Reset + base
   -------------------------------------------------------------------------- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; border-radius: var(--radius); }

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

body {
  background: var(--beige);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

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

/* --------------------------------------------------------------------------
   4. Type primitives
   -------------------------------------------------------------------------- */
.hero-title {
  font-family: var(--font-hero);
  font-size: var(--step-4);
  font-weight: 400;
  line-height: 0.98;
  letter-spacing: -0.01em;
  margin: 0;
}

h1, h2, h3, .display {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: -0.005em;
  margin: 0 0 var(--gap-s);
}

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

p { margin: 0 0 var(--gap-s); max-width: var(--measure); }

.lede { font-size: var(--step-1); line-height: 1.45; color: var(--ink-muted); }

em, .accent-italic {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--signal);
  font-weight: 400;
}

.ampersand { font-family: var(--font-display); font-style: italic; color: var(--signal); }

/* Labels, eyebrows, numerals, codes */
.label, .eyebrow, .numeral, .code {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.eyebrow { display: block; margin-bottom: var(--gap-s); }

/* Botanical names — the mono face earns its keep here.
   Genus + species always italic mono, never sentence-cased by CSS. */
.botanical {
  font-family: var(--font-mono);
  font-style: italic;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink-muted);
}

.common-name {
  font-family: var(--font-body);
  font-weight: 500;
  color: var(--ink);
}

/* --------------------------------------------------------------------------
   5. Section rhythm — light / beige-deep / dark sandwich
   Sections run edge to edge; .shell constrains the content.
   -------------------------------------------------------------------------- */
.section { padding: var(--gap-xl) var(--gap-m); position: relative; }

.section-light      { background: var(--beige); color: var(--ink); }
.section-beige-deep { background: var(--beige-deep); color: var(--ink); }

.section-dark {
  background: var(--green);
  color: var(--ink-invert);
}
.section-dark h1, .section-dark h2, .section-dark h3 { color: var(--ink-invert); }
.section-dark p { color: var(--ink-invert-muted); }
.section-dark .label,
.section-dark .eyebrow,
.section-dark .botanical { color: var(--ink-invert-muted); }
.section-dark hr, .section-dark .rule { background: var(--rule-invert); }

.shell { max-width: var(--shell); margin-inline: auto; }
.shell-narrow { max-width: 72ch; margin-inline: auto; }

/* Noise texture — applied to dark sections, sits under content */
.section-dark::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.055;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}
.section-dark > * { position: relative; z-index: 1; }

/* --------------------------------------------------------------------------
   6. Rules and dividers
   Brass is a divider on light backgrounds only. Never body or label text.
   -------------------------------------------------------------------------- */
hr, .rule {
  border: 0;
  height: 1px;
  background: var(--rule);
  margin: var(--gap-m) 0;
}

.rule-brass { height: 1px; background: var(--brass); border: 0; margin: var(--gap-m) 0; }
.section-dark .rule-brass { background: var(--rule-invert); }

/* --------------------------------------------------------------------------
   7. Buttons
   Primary = Signal Green filled. Secondary = ghost outline.
   -------------------------------------------------------------------------- */
.btn-primary-action,
.btn-secondary-action {
  display: inline-flex;
  align-items: center;
  gap: var(--gap-xs);
  font-family: var(--font-mono);
  font-size: var(--step--1);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.95rem 1.6rem;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
}

.btn-primary-action {
  background: var(--signal);
  color: var(--beige);
  border-color: var(--signal);
}
.btn-primary-action:hover { background: var(--signal-hover); border-color: var(--signal-hover); }

.btn-secondary-action {
  background: transparent;
  color: var(--ink);
  border-color: var(--rule);
}
.btn-secondary-action:hover { border-color: var(--signal); color: var(--signal); }

.section-dark .btn-secondary-action { color: var(--ink-invert); border-color: var(--rule-invert); }
.section-dark .btn-secondary-action:hover { color: var(--signal); border-color: var(--signal); }

/* --------------------------------------------------------------------------
   8. Cards — accent bar on the leading edge
   -------------------------------------------------------------------------- */
.card {
  background: transparent;
  border-top: 2px solid var(--signal);
  padding: var(--gap-m) 0 0;
}
.card + .card { margin-top: var(--gap-m); }

.card-grid {
  display: grid;
  gap: var(--gap-m);
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

/* --------------------------------------------------------------------------
   9. Forms — inputs, gate, pre-order
   -------------------------------------------------------------------------- */
input, select, textarea, button { font: inherit; border-radius: var(--radius); }

.field {
  width: 100%;
  padding: 0.9rem 1rem;
  background: transparent;
  border: 1px solid var(--rule);
  color: var(--ink);
  font-family: var(--font-body);
}
.field::placeholder { color: var(--ink-faint); }
.field:focus { border-color: var(--signal); outline: none; }

.section-dark .field { border-color: var(--rule-invert); color: var(--ink-invert); }
.section-dark .field::placeholder { color: rgba(255, 240, 220, 0.45); }

.field-label {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-muted);
  display: block;
  margin-bottom: var(--gap-xs);
}

.field-error {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  color: var(--green);
  border-left: 2px solid var(--brass);
  padding-left: var(--gap-xs);
  margin-top: var(--gap-xs);
}

/* --------------------------------------------------------------------------
   10. Nav — sticky with scrolled state
   -------------------------------------------------------------------------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--gap-m);
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background 200ms ease, border-color 200ms ease;
}

.nav.is-scrolled {
  background: var(--beige);
  border-bottom-color: var(--rule);
}

.nav a {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
}
.nav a:hover { color: var(--signal); }

/* --------------------------------------------------------------------------
   11. Scroll reveal
   Add .reveal in markup; JS adds .is-visible on intersection.
   -------------------------------------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 620ms ease, transform 620ms ease;
}
.reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; }
}

/* --------------------------------------------------------------------------
   12. Vendor escape hatch
   Third-party widgets (map controls, autocomplete dropdowns) may need their
   own radii. Wrap them in .vendor rather than loosening the global rule.
   -------------------------------------------------------------------------- */
.vendor, .vendor * { border-radius: revert; }

/* --------------------------------------------------------------------------
   13. Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 720px) {
  .section { padding: var(--gap-l) var(--gap-s); }
  .nav { padding: 0 var(--gap-s); }
}

/* --------------------------------------------------------------------------
   14. Components — shared rules extracted from page inline <style> blocks
   -------------------------------------------------------------------------- */

/* .container — text-width shell for static content pages (800px canonical).
   about.html overrides to 900px in its own block. */
.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 5rem 2rem 3rem;
}

/* .hero h1 — Abril Fatface scoped to .hero only.
   about.html, contact.html, privacy.html all have h1 inside .hero already.
   Bare h1 stays Fraunces per §4. explore.html and gate-test.html h1s
   are functional headings and correctly inherit Fraunces. */
.hero h1 {
  font-family: var(--font-hero);
  font-size: clamp(2.5rem, 8vw, 4.5rem);
  line-height: 1.1;
  letter-spacing: 0;
}

/* .subtitle — hero sub-copy on static pages. Not an alias of .lede. */
.subtitle {
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  color: var(--ink-muted);
  line-height: 1.8;
  max-width: 600px;
  margin: 0 auto 2rem;
}

/* .brand-badge — fixed bottom-right G&S wordmark. */
.brand-badge {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background-color: var(--green);
  color: var(--beige);
  padding: 10px 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  z-index: 9998;
  transition: all 0.3s ease;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.brand-badge:hover { transform: scale(1.05); box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3); }
.brand-badge::before { content: "⚘ "; margin-right: 5px; }

/* .hero — centred page intro block, static pages. */
.hero {
  text-align: center;
  margin-bottom: 4rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid var(--rule);
}

/* .back-button — fixed top-left nav return. */
.back-button {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 1000;
  width: 50px;
  height: 50px;
  background-color: var(--green);
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  text-decoration: none;
  color: var(--beige);
  font-size: 24px;
  font-weight: bold;
}
.back-button:hover { transform: scale(1.05); background-color: #2f3928; }

/* footer — verbatim from about.html (comment there: "matching evc-map page
   exactly"). index.html footer is identical. */
footer {
  margin-top: 0;
  padding: 50px 20px;
  background-color: var(--green);
  color: var(--beige);
  text-align: center;
}

footer .acknowledgement {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem;
  background-color: var(--wash-invert);
  text-align: left;
  line-height: 1.8;
}

footer .acknowledgement p { font-size: 13px; line-height: 1.8; margin-bottom: 30px; font-weight: 300; }
footer .acknowledgement p:last-child { margin-bottom: 0; }
footer > p { margin-top: 40px; font-size: 12px; opacity: 0.8; }
footer a { color: var(--beige); text-decoration: underline; transition: opacity 0.2s ease; }
footer a:hover { opacity: 0.8; }

@media (max-width: 768px) {
  .container { padding: 4rem 1.5rem 2rem; }
  footer { padding: 40px 15px; }
  footer .acknowledgement { padding: 1.5rem; margin: 0 auto; }
  footer .acknowledgement p { font-size: 14px; line-height: 1.7; margin-bottom: 20px; }
  footer > p { font-size: 13px; margin-top: 30px; padding: 0 10px; }
  .back-button { width: 45px; height: 45px; font-size: 20px; }
  .brand-badge { bottom: 15px; right: 15px; font-size: 0.7rem; padding: 8px 16px; }
}

@media (max-width: 480px) {
  .container { padding: 3.5rem 1rem 2rem; }
  footer .acknowledgement { padding: 1.2rem; }
  footer .acknowledgement p { font-size: 13px; margin-bottom: 15px; }
  footer > p { font-size: 12px; }
}

/* Keyframes shared across index.html and explore.html.
   bounce and fadeInUp are index-only — they stay in its inline block. */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { transform: translateY(50px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
