:root {
  /* Pulled from the logo: leaf lime + dark green lettering */
  --leaf: #b5d22a;
  --leaf-dark: #8fae1c;
  --green-deep: #2b3f2b;
  --green-mid: #4d7a3a;
  --green-pale: #eef5dc;
  --sunset: #e08a3c;
  --ink: #1f2a1f;
  --muted: #5f6b5f;
  --paper: #fbfcf7;
  --white: #ffffff;
  --radius: 10px;
  --shadow: 0 6px 24px rgba(31, 42, 31, 0.10);
  --max: 1100px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
}

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

a { color: var(--green-mid); }

h1, h2, h3 { line-height: 1.15; margin: 0 0 0.5em; color: var(--green-deep); }
h1 { font-size: clamp(2rem, 5vw, 3.4rem); font-weight: 800; }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); font-weight: 700; }
h3 { font-size: 1.15rem; font-weight: 700; }

.container { width: min(var(--max), 100% - 32px); margin-inline: auto; }

.section { padding: 72px 0; }
.section-alt { background: var(--white); }
.section-head { max-width: 640px; margin-bottom: 36px; }
.section-head p { color: var(--muted); font-size: 1.05rem; }

.eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--leaf-dark);
  margin-bottom: 8px;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid rgba(43, 63, 43, 0.08);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 68px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; white-space: nowrap; }
.brand img { width: 48px; height: 48px; border-radius: 50%; flex: none; }
.brand span { font-weight: 800; color: var(--green-deep); font-size: 1.1rem; }
/* spec 026: the app shell's brand text has two spans (styles.css is loaded
   on both the public site and the app; only src/views/pages.js's layout()
   renders `.brand-short`, so the public site's single-span brand — left
   untouched — is unaffected by this rule). Below 1100px, where the grouped
   nav bar gets tight, show the short wordmark instead of wrapping. */
.brand-short { display: none; }
@media (max-width: 1100px) {
  .brand-full { display: none; }
  .brand-short { display: inline; }
}

.nav { display: flex; gap: 22px; align-items: center; }
.nav a { text-decoration: none; color: var(--green-deep); font-weight: 600; font-size: 0.95rem; }
.nav a:hover { color: var(--leaf-dark); }
.nav a[aria-current="page"] { color: var(--leaf-dark); }
.nav-toggle { display: none; background: none; border: 0; font-size: 1.6rem; color: var(--green-deep); cursor: pointer; }

/* Grouped app nav (spec 026 Part A) — `.app-nav` is the internal /app shell
   only (src/views/pages.js#appNav); the public marketing nav and its
   hamburger (public/index.html, public/site.js) are untouched and never
   carry this class. Groups are plain `<details class="nav-group">` with no
   JavaScript: a click/tap or keyboard focus+Enter on `<summary>` is native
   disclosure-widget behaviour the browser already provides. */
.app-nav { position: relative; }
.nav-group { position: relative; }
.nav-group > summary {
  cursor: pointer;
  list-style: none;
  color: var(--green-deep);
  font-weight: 600;
  font-size: 0.95rem;
}
.nav-group > summary::-webkit-details-marker { display: none; }
.nav-group > summary::after { content: " \25BE"; font-size: 0.75em; }
.nav-group > summary:hover,
.nav-group > summary.active { color: var(--leaf-dark); }
/* The open panel: absolutely positioned under the summary so it never
   pushes the rest of the bar around. Closed `<details>` already hides its
   non-summary children natively — no rule needed for that state. */
.nav-group[open] > .nav-menu {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 8px;
  width: 220px;
  background: var(--white);
  border: 1px solid rgba(43, 63, 43, 0.15);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  padding: 6px 0;
  z-index: 20;
}
.nav-account > .nav-menu { left: auto; right: 0; }
.nav-group .nav-menu a,
.nav-group .nav-menu form { padding: 10px 14px; margin: 0; }
.nav-group .nav-menu a { display: block; }
.nav-group .nav-menu a:hover { background: var(--leaf-pale, var(--green-pale)); }
.nav-group .nav-menu form.inline { display: block; }

/* Buttons */
.btn {
  display: inline-block;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.15s ease, background 0.15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--leaf); color: var(--green-deep); }
.btn-primary:hover { background: var(--leaf-dark); color: var(--white); }
.btn-ghost { border: 2px solid var(--white); color: var(--white); }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.15); }
.btn-outline { border: 2px solid var(--green-mid); color: var(--green-mid); }
.btn-outline:hover { background: var(--green-mid); color: var(--white); }

/* Hero */
.hero {
  position: relative;
  min-height: 78vh;
  display: grid;
  place-items: center;
  color: var(--white);
  background: url("assets/cover-1024.jpg") center 60% / cover no-repeat;
  isolation: isolate;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(20, 30, 20, 0.55) 0%, rgba(20, 30, 20, 0.35) 50%, rgba(20, 30, 20, 0.7) 100%);
  z-index: -1;
}
.hero-inner { text-align: center; max-width: 780px; padding: 80px 0; }
.hero h1 { color: var(--white); text-shadow: 0 2px 12px rgba(0, 0, 0, 0.35); }
.hero p { font-size: clamp(1.05rem, 2vw, 1.3rem); max-width: 620px; margin: 0 auto 28px; opacity: 0.95; }
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(181, 210, 42, 0.18);
  border: 1px solid rgba(181, 210, 42, 0.6);
  color: var(--white);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  margin-bottom: 20px;
}
.badge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--leaf); }

/* Services */
.grid { display: grid; gap: 22px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 28px 24px;
  box-shadow: var(--shadow);
  border-top: 4px solid var(--leaf);
}
.section-alt .card { background: var(--paper); }
.card .icon {
  width: 46px; height: 46px;
  border-radius: 12px;
  background: var(--green-pale);
  display: grid; place-items: center;
  margin-bottom: 16px;
  color: var(--green-mid);
}
.card .icon svg { width: 26px; height: 26px; }
.card p { color: var(--muted); margin: 0; }

/* About */
.about { display: grid; gap: 40px; grid-template-columns: 1.1fr 0.9fr; align-items: center; }
.about-photo { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.about-photo img { aspect-ratio: 4 / 3; object-fit: cover; width: 100%; }
.about ul { padding-left: 0; list-style: none; margin: 20px 0 0; display: grid; gap: 10px; }
.about li { display: flex; gap: 12px; align-items: flex-start; }
.about li::before {
  content: "";
  flex: none;
  width: 22px; height: 22px;
  margin-top: 2px;
  border-radius: 50%;
  background: var(--leaf) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232b3f2b' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5L20 7'/%3E%3C/svg%3E") center / 14px no-repeat;
}

/* Contact */
.contact { display: grid; gap: 28px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.contact-card { background: var(--white); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); }
.contact-card h3 { display: flex; align-items: center; gap: 10px; }
.contact-card h3 svg { width: 22px; height: 22px; color: var(--leaf-dark); }
.contact-card p { margin: 0 0 10px; color: var(--muted); }
.contact-card a.big { display: block; font-size: 1.25rem; font-weight: 700; text-decoration: none; color: var(--green-deep); }
.contact-card a.big + a.big { margin-top: 4px; }
.contact-card a.big:hover { color: var(--leaf-dark); }

.cta-band {
  background: var(--green-deep);
  color: var(--white);
  padding: 56px 0;
  text-align: center;
}
.cta-band h2 { color: var(--white); }
.cta-band p { opacity: 0.85; max-width: 560px; margin: 0 auto 24px; }

/* Footer */
.site-footer { background: #1d2b1d; color: #b9c4b9; padding: 32px 0; font-size: 0.9rem; }
.site-footer .container { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.site-footer a { color: var(--leaf); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.social { display: inline-flex; align-items: center; gap: 8px; }
.social svg { width: 20px; height: 20px; }

/* Responsive */
@media (max-width: 800px) {
  .about { grid-template-columns: 1fr; }
  .about-photo { order: -1; }
  .section { padding: 56px 0; }
}
@media (max-width: 640px) {
  .nav-toggle { display: block; }
  .nav {
    display: none;
    position: absolute;
    left: 0; right: 0; top: 68px;
    flex-direction: column;
    align-items: stretch;
    background: var(--white);
    padding: 12px 16px 18px;
    border-bottom: 1px solid rgba(43, 63, 43, 0.1);
    box-shadow: var(--shadow);
  }
  .nav.open { display: flex; }
  .nav a { padding: 10px 0; }
  .hero { min-height: 70vh; }

  /* The internal /app shell has no hamburger button or toggle script (no
     JavaScript at all, per spec 026) — so unlike the public nav above, it
     is never hidden behind `.nav.open`. It always renders the full stacked
     list; `.nav-group > summary` becomes a plain section heading (its
     native disclosure triangle removed) and its `.nav-menu` is forced
     visible regardless of the `<details>` element's own `open` state,
     since there is no way to set the `open` HTML attribute from CSS alone.
     Unlike the public nav's dropdown (an absolutely positioned overlay that
     never affects `.site-header`'s own box), this stacked list is in normal
     flow, so `.site-header .container`'s fixed 68px height (set for the
     one-line desktop bar) has to give way here or the nav spills over the
     page content beneath the sticky header. `.app-header-row` is the
     `.container` inside `.site-header` only on a signed-in (app/portal)
     page — see src/views/pages.js#layout — never the public marketing
     header, which keeps its fixed height. */
  .site-header .app-header-row {
    height: auto;
    flex-direction: column;
    align-items: stretch;
    padding: 14px 0;
  }
  /* A sticky header taller than the viewport traps scrolling — the app nav
     stacked open is easily that tall, so the app header stops being sticky
     at this breakpoint (the desktop 68px bar stays sticky as before). */
  .site-header:has(.app-header-row) { position: static; }
  .app-nav {
    display: flex !important;
    position: static !important;
    flex-direction: column;
    align-items: stretch;
    background: none;
    box-shadow: none;
    border-bottom: 0;
    padding: 8px 0 0;
  }
  .app-nav .nav-group { position: static; }
  .app-nav .nav-group > summary {
    cursor: default;
    pointer-events: none;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 0.8rem;
    color: var(--muted);
    margin-top: 12px;
    padding: 10px 0 0;
  }
  .app-nav .nav-group > summary::after { content: ""; }
  /* Current Chromium renders a closed <details>'s non-summary content
     through an internal `::details-content` box (its own reveal-animation
     machinery — content-visibility plus a block-size transition), not a
     plain author-overridable `display: none` on the child. Overriding the
     child's own `display` (below) is necessary but not sufficient; this
     pseudo-element also has to be told to stay laid out and shown. */
  .app-nav .nav-group:not([open])::details-content {
    content-visibility: visible !important;
    block-size: auto !important;
    overflow: visible !important;
  }
  .app-nav .nav-group > .nav-menu {
    display: flex !important;
    content-visibility: visible !important;
    position: static;
    flex-direction: column;
    width: auto;
    background: none;
    border: 0;
    box-shadow: none;
    padding: 0;
  }
  .app-nav .nav-menu a, .app-nav .nav-menu form { padding: 8px 0; }
  .app-nav .nav-account > summary { text-transform: none; letter-spacing: normal; font-size: 0.95rem; color: var(--green-deep); font-weight: 700; }
}

/* Full-resolution hero on larger screens */
@media (min-width: 900px) {
  .hero { background-image: url("assets/cover.jpg"); }
}

/* Error pages (404, etc.) */
.error-page { min-height: 100vh; display: grid; place-items: center; text-align: center; }
.error-logo { width: 120px; margin: 0 auto 20px; border-radius: 50%; }
.muted { color: var(--muted); }
