/* Shared public-site design system for 404.html, blog/index.html,
   blog/post.html. Filename is version-suffixed for long-term caching. */
:root { --emerald: #126F4A; --forest: #0F2F24; --ink: #151A17; --soft-ink: #3E4742; --ivory: #F7F5EF; --fern: #E8F1EA; --sage: #5A725E; --stone: #D8D6CE; --line: rgba(15,47,36,.15); --shadow: 0 22px 70px rgba(15,47,36,.14); --max: 1180px; }
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--ivory); color: var(--ink); font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica Neue, sans-serif; line-height: 1.65; overflow-x: hidden; }
img { max-width: 100%; display: block; height: auto; }
a { color: inherit; text-decoration: none; }
h1,h2,h3 { margin: 0; color: var(--forest); }
h1 { font-family: "Cormorant Garamond", Georgia, serif; font-size: clamp(2.4rem, 5vw, 4.6rem); line-height: .97; letter-spacing: -.05em; }
h2 { font-family: "Cormorant Garamond", Georgia, serif; font-size: clamp(1.7rem, 3.2vw, 2.6rem); letter-spacing: -.03em; line-height: 1.05; }
h3 { font-size: 1rem; line-height: 1.3; letter-spacing: -.01em; }
.container { width: min(var(--max), calc(100% - 40px)); margin-inline: auto; }
section { padding: 60px 0; }
section + section { padding-top: 0; }
.card { background: rgba(255,255,255,.78); border: 1px solid rgba(216,214,206,.9); border-radius: 22px; box-shadow: var(--shadow); }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; margin-bottom: 16px; color: var(--emerald); font-family: "IBM Plex Mono", monospace; font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.eyebrow::before { content: ""; width: 34px; height: 2px; background: var(--emerald); }
.mono-label { font-family: "IBM Plex Mono", monospace; font-size: .78rem; font-weight: 700; color: var(--emerald); text-transform: uppercase; letter-spacing: .07em; margin-bottom: 14px; }

.skip-link { position: absolute; left: -999px; top: 12px; background: var(--forest); color: #fff; padding: 10px 14px; border-radius: 999px; z-index: 200; font-weight: 700; }
.skip-link:focus { left: 12px; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible { outline: 3px solid var(--emerald); outline-offset: 3px; border-radius: 4px; }

.btn { display: inline-flex; align-items: center; gap: 10px; min-height: 46px; padding: 12px 22px; border-radius: 999px; font-weight: 900; letter-spacing: .018em; border: 1px solid transparent; transition: transform .18s ease, background .18s ease; cursor: pointer; white-space: nowrap; }
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--emerald); color: #fff; box-shadow: 0 14px 30px rgba(18,111,74,.24); }
.btn-primary:hover { background: var(--forest); }
.btn-secondary { background: rgba(255,255,255,.5); color: var(--forest); border-color: rgba(15,47,36,.20); }
.btn-secondary:hover { border-color: var(--emerald); color: var(--emerald); background: #fff; }

/* Nav */
.nav { position: sticky; top: 0; z-index: 50; backdrop-filter: blur(18px); background: rgba(247,245,239,.86); border-bottom: 1px solid rgba(216,214,206,.78); }
.nav-inner { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.nav-logo img { width: 180px; height: auto; }
.nav-links { display: flex; align-items: center; gap: 22px; font-size: .82rem; font-weight: 800; letter-spacing: .065em; text-transform: uppercase; color: var(--soft-ink); }
.nav-links a:hover { color: var(--emerald); }
.nav-links .nav-cta { background: var(--emerald); color: #fff; padding: 9px 16px; border-radius: 999px; }
.nav-links .nav-cta:hover { background: var(--forest); }
.mobile-toggle { display: none; width: 46px; height: 46px; border-radius: 999px; border: 1px solid rgba(15,47,36,.18); background: rgba(255,255,255,.65); color: var(--forest); align-items: center; justify-content: center; cursor: pointer; z-index: 55; }
.mobile-toggle span, .mobile-toggle span::before, .mobile-toggle span::after { display: block; width: 19px; height: 2px; background: currentColor; position: relative; transition: transform .18s ease, opacity .18s ease; }
.mobile-toggle span::before, .mobile-toggle span::after { content: ""; position: absolute; left: 0; }
.mobile-toggle span::before { top: -7px; }
.mobile-toggle span::after { top: 7px; }
.mobile-toggle[aria-expanded="true"] span { background: transparent; }
.mobile-toggle[aria-expanded="true"] span::before { transform: translateY(7px) rotate(45deg); background: var(--forest); }
.mobile-toggle[aria-expanded="true"] span::after { transform: translateY(-7px) rotate(-45deg); background: var(--forest); }
.nav-item-services { position: relative; display: flex; align-items: center; }
.nav-item-services > button.nav-services-label { font: inherit; background: none; border: none; padding: 0; color: inherit; text-transform: inherit; letter-spacing: inherit; cursor: pointer; display: inline-flex; align-items: center; }
.nav-item-services > button.nav-services-label:hover { color: var(--emerald); }
.nav-services-caret { font-size: .65em; margin-left: 3px; opacity: .7; }
.nav-services-menu { display: none; position: absolute; top: 100%; left: 50%; transform: translateX(-50%); background: #fff; border: 1px solid rgba(216,214,206,.92); border-radius: 16px; padding: 8px; min-width: 240px; box-shadow: 0 16px 44px rgba(15,47,36,.14); z-index: 100; }
/* A real <button> triggers .is-open on click; native button semantics
   already fire that same click on Enter/Space for keyboard users, so no
   :focus-within is needed (and one would fight Escape-to-close: closing
   returns focus to the trigger button, which would immediately reopen
   the menu via :focus-within right after JS closed it). */
.nav-services-menu.is-open { display: block; }
.nav-services-menu a { display: block; padding: 10px 14px; border-radius: 10px; font-size: .8rem; font-weight: 700; color: var(--soft-ink); text-transform: none; letter-spacing: .02em; white-space: nowrap; }
.nav-services-menu a:hover { background: var(--fern); color: var(--emerald); }
.nav-services-menu .nav-services-overview { color: var(--emerald); border-bottom: 1px solid var(--stone); border-radius: 10px 10px 0 0; margin-bottom: 4px; padding-bottom: 12px; }

/* Footer */
footer { padding: 36px 0; color: var(--soft-ink); font-size: .9rem; border-top: 1px solid var(--stone); }
.footer-inner { display: flex; justify-content: space-between; gap: 18px; flex-wrap: wrap; align-items: center; }
.footer-inner a { color: var(--emerald); font-weight: 800; }
.footer-link-btn { background: none; border: none; padding: 0; margin: 0; font: inherit; color: var(--emerald); font-weight: 800; cursor: pointer; }
.footer-link-btn:hover { text-decoration: underline; }
.footer-socials { display: flex; gap: 14px; align-items: center; }
.footer-socials a { color: var(--sage); transition: color .15s; display: flex; align-items: center; min-width: 24px; min-height: 24px; justify-content: center; }
.footer-socials a:hover { color: var(--emerald); }

/* Page sections (404, related-grid) */
.page-hero { padding: 64px 0 52px; text-align: center; }
.page-hero .container { display: flex; flex-direction: column; align-items: center; }
.hero-sub { margin: 20px 0 32px; color: var(--soft-ink); font-size: 1.08rem; max-width: 560px; line-height: 1.6; }
.divider { border: none; border-top: 1px solid var(--line); margin: 0; }
.related-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-top: 24px; }
.related-card { padding: 22px; display: block; transition: transform .18s ease, box-shadow .18s ease; }
.related-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.related-card .svc-label { font-family: "IBM Plex Mono", monospace; font-size: .7rem; font-weight: 800; color: var(--emerald); text-transform: uppercase; letter-spacing: .07em; margin-bottom: 8px; }
.related-card h3 { font-size: .97rem; font-weight: 800; color: var(--forest); margin: 0 0 6px; line-height: 1.25; }
.related-card p { margin: 0; color: var(--soft-ink); font-size: .88rem; }

/* Blog index */
.blog-hero { padding: 56px 0 36px; }
.filter-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 8px; }
.filter-label { font-family: "IBM Plex Mono", monospace; font-size: .75rem; font-weight: 800; color: var(--soft-ink); text-transform: uppercase; letter-spacing: .06em; margin-right: 6px; }
.filter-btn { padding: 8px 16px; min-height: 24px; border-radius: 999px; border: 1px solid var(--stone); background: #fff; color: var(--soft-ink); font-size: .82rem; font-weight: 700; }
.filter-btn:hover { border-color: var(--emerald); color: var(--emerald); }
.filter-btn.active { background: var(--emerald); border-color: var(--emerald); color: #fff; }
.posts-section { padding: 52px 0 80px; }
.posts-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 32px; }
.post-card {
  background: rgba(255,255,255,.82); border: 1px solid rgba(216,214,206,.9); border-radius: 22px;
  overflow: hidden; display: flex; flex-direction: column; transition: transform .18s ease, box-shadow .18s ease;
}
.post-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
/* Scoped under .post-card (blog-index cards only) so these never leak onto
   blog/post.html's unrelated .post-body (the article prose block) — that
   page loads this stylesheet too, and class names collide otherwise. */
.post-card .post-img { aspect-ratio: 16/9; background: linear-gradient(135deg, var(--fern), rgba(18,111,74,.15)); overflow: hidden; }
.post-card .post-img picture, .post-card .post-img img { display: block; width: 100%; height: 100%; object-fit: cover; }
.post-card .post-body { padding: 22px; flex: 1; display: flex; flex-direction: column; }
.post-card .post-cat {
  display: inline-flex; padding: 5px 10px; border-radius: 999px; background: var(--fern); color: var(--emerald);
  font-family: "IBM Plex Mono", monospace; font-size: .7rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: .07em; align-self: flex-start; margin-bottom: 12px;
}
.post-card .post-body h2 { margin: 0 0 10px; font-family: "Cormorant Garamond", Georgia, serif; font-size: 1.45rem; line-height: 1.1; letter-spacing: -.02em; color: var(--forest); }
.post-card .post-body p { margin: 0 0 16px; color: var(--soft-ink); font-size: .93rem; flex: 1; }
.post-card .post-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); }
.post-card .post-date { font-family: "IBM Plex Mono", monospace; font-size: .72rem; color: var(--sage); font-weight: 600; }
.post-card .post-link { font-size: .82rem; font-weight: 800; color: var(--emerald); }
.post-card .post-link:hover { color: var(--forest); }

@media(max-width: 860px) {
  /* The sticky header was full desktop size (72px min-height, 180px-wide
     logo) all the way down to phone widths, eating a disproportionate
     slice of the viewport while reading since it's pinned during scroll.
     First pass (58px) was too subtle to register as a real fix — cutting
     harder this time. */
  .nav-inner { min-height: 48px; }
  .nav-logo img { width: 108px; }
  .mobile-toggle { display: inline-flex; width: 34px; height: 34px; }
  .nav-links { position: fixed; inset: 0 0 auto 0; min-height: 100vh; padding: 76px 28px 34px; display: grid; align-content: start; gap: 0; background: rgba(247,245,239,.98); transform: translateY(-105%); transition: transform .22s ease; border-bottom: 1px solid var(--stone); z-index: 50; }
  .nav-links.is-open { transform: translateY(0); }
  .nav-links a { padding: 18px 0; border-bottom: 1px solid rgba(15,47,36,.10); font-size: 1.05rem; }
  .nav-links .nav-cta { background: none; color: var(--soft-ink); padding: 18px 0; border-radius: 0; }
  .nav-item-services { flex-direction: column; align-items: flex-start; width: 100%; border-bottom: 1px solid rgba(15,47,36,.10); }
  .nav-item-services > button.nav-services-label { padding: 18px 0; border-bottom: none; font-size: 1.05rem; width: 100%; justify-content: space-between; }
  .nav-services-menu, .nav-services-menu.is-open { display: block; position: static; transform: none; box-shadow: none; border: none; border-radius: 0; padding: 0 0 8px 16px; min-width: auto; background: transparent; width: 100%; }
  .nav-services-menu a { padding: 11px 0; border-bottom: 1px solid rgba(15,47,36,.07); font-size: .92rem; color: var(--sage); white-space: normal; text-transform: none; }
  body.nav-open { overflow: hidden; }
  .posts-grid { grid-template-columns: repeat(2, 1fr); }
}
@media(max-width: 580px) {
  section { padding: 44px 0; }
  h1 { font-size: clamp(2.1rem, 10vw, 3rem); }
  .posts-grid { grid-template-columns: 1fr; }
}
