/* Shared site layer for Backwoods Development. Loaded after tokens.css and main.css;
   overrides their older defaults with the current palette, type, header, and layouts. */
:root {
  --bg-page: #0e1510;
  --bg-page-alt: #121b15;
  --bg-elev-1: #141e17;
  --bg-elev-2: #18231b;
  --bg-elev-3: #1c2a20;
  --surface: #141e17;
  --surface-strong: #18231b;
  --text: #ece8dc;
  --text-main: #ece8dc;
  --text-muted: #b8bbaa;
  --text-soft: #959b8b;
  --heading: #f5f1e6;
  --border: rgba(226, 232, 214, .16);
  --border-soft: rgba(226, 232, 214, .11);
  --border-strong: rgba(226, 232, 214, .28);
  --accent: #8fb573;
  --accent-strong: #a6c98a;
  --accent-soft: rgba(143, 181, 115, .14);
  --accent-warm: #d4c48e;
  --link: #b0d394;
  --button-ink: #142012;
  --font-heading: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  --font-body: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-xl: 10px;
  --radius-pill: 999px;
  --shadow-sm: none;
  --shadow-md: 0 10px 30px rgba(0, 0, 0, .25);
  --shadow-lg: 0 18px 50px rgba(0, 0, 0, .3);
  --container-max: 1080px;
  --header-height: 4rem;
  --surface-noise-opacity: 0;
}

:root[data-theme="light"] {
  --bg-page: #f4f1e7;
  --bg-page-alt: #ebe7da;
  --bg-elev-1: #fbf9f2;
  --bg-elev-2: #fffdf7;
  --bg-elev-3: #efece0;
  --surface: #fbf9f2;
  --surface-strong: #fffdf7;
  --text: #1d2519;
  --text-main: #1d2519;
  --text-muted: #46503f;
  --text-soft: #5d6656;
  --heading: #141b11;
  --border: rgba(29, 37, 25, .18);
  --border-soft: rgba(29, 37, 25, .12);
  --border-strong: rgba(29, 37, 25, .3);
  --accent: #46703a;
  --accent-strong: #36592c;
  --accent-soft: rgba(70, 112, 58, .12);
  --accent-warm: #8a6d22;
  --link: #2f5b26;
  --button-ink: #fbf9f2;
}

html { background: var(--bg-page); }
body {
  background: var(--bg-page);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
  overflow-wrap: break-word;
}
body::before { content: none; }

.main { min-height: 60vh; }
.container { width: min(var(--container-max), calc(100% - 2rem)); }
.section { padding-block: clamp(2.5rem, 6vw, 4rem); }

h1, h2, h3, h4 { font-family: var(--font-heading); color: var(--heading); letter-spacing: -.01em; line-height: 1.2; }
h1 { font-weight: 700; }
h2, h3 { font-weight: 600; }
p { line-height: 1.6; }
a { color: var(--link); text-underline-offset: .18em; }
a:hover { color: var(--accent-strong); }
code, pre, kbd { font-family: var(--font-mono); }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent-strong);
  outline-offset: 3px;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  min-height: var(--header-height);
  background: var(--bg-page);
  border-bottom: 1px solid var(--border-soft);
  backdrop-filter: none;
  box-shadow: none;
}
.header-row { min-height: var(--header-height); gap: .75rem; }
.brand {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  min-width: 0;
  color: var(--heading);
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -.01em;
  text-decoration: none;
  white-space: nowrap;
}
.brand:hover { color: var(--heading); }
.brand img, .brand-tree {
  display: block;
  flex: none;
  width: auto;
  height: 38px;
  border-radius: 0;
  box-shadow: none;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}
@supports (image-rendering: pixelated) {
  .brand img, .brand-tree { image-rendering: pixelated; }
}
.header-actions { gap: .4rem; flex: none; }
.theme-toggle, .nav-toggle {
  width: 2.5rem;
  height: 2.5rem;
  margin: 0;
  color: var(--text-main);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.theme-toggle:hover, .nav-toggle:hover { border-color: var(--accent); color: var(--accent-strong); }
.theme-toggle svg { width: 1.1rem; height: 1.1rem; }
.nav-toggle svg { width: 1.25rem; height: 1.25rem; }
.nav-toggle .icon-close { display: none; }
.nav-toggle[aria-expanded="true"] .icon-open { display: none; }
.nav-toggle[aria-expanded="true"] .icon-close { display: block; }

.nav-links a {
  display: block;
  color: var(--text-muted);
  font-size: .95rem;
  font-weight: 500;
  text-decoration: none;
  border-radius: 0;
  background: transparent;
}
.nav-links a:hover { color: var(--heading); background: transparent; }
.nav-links a[aria-current="page"] { color: var(--heading); background: transparent; }

@media (max-width: 759px) {
  .site-nav { position: static; }
  .nav-links,
  .nav-links[aria-hidden] {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    min-width: 0;
    margin: 0;
    padding: .5rem 1rem 1rem;
    list-style: none;
    background: var(--bg-page);
    border: 0;
    border-bottom: 1px solid var(--border);
    border-radius: 0;
    box-shadow: var(--shadow-md);
    animation: none;
  }
  .nav-toggle[aria-expanded="true"] + .nav-links { display: block; }
  .nav-links li + li { border-top: 1px solid var(--border-soft); }
  .nav-links a { padding: .85rem .25rem; font-size: 1.05rem; color: var(--text-main); }
  .nav-links a[aria-current="page"] { color: var(--accent-strong); font-weight: 600; }
}

@media (min-width: 760px) {
  .header-row { min-height: var(--header-height); }
  .brand img, .brand-tree { height: 40px; }
  .header-actions { flex-direction: row-reverse; gap: 1.25rem; }
  .nav-links, .nav-links[aria-hidden] { display: flex; gap: 1.4rem; padding: 0; }
  .nav-links a { padding: .35rem 0; }
  .nav-links a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--accent); }
}

/* Buttons */
.button, button.button, .btn, input[type="submit"] {
  border-radius: var(--radius-sm);
  box-shadow: none;
  font-size: .95rem;
  font-weight: 600;
  padding: .75rem 1.1rem;
  min-height: 2.75rem;
}
.button:hover { transform: none; }
.button-primary, .btn-primary, input[type="submit"] { background: var(--accent); color: var(--button-ink); border-color: var(--accent); }
.button-primary:hover, .btn-primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); color: var(--button-ink); box-shadow: none; }
.button-secondary, .btn-secondary { background: transparent; color: var(--heading); border-color: var(--border-strong); }
.button-secondary:hover, .btn-secondary:hover { border-color: var(--accent); color: var(--heading); background: var(--accent-soft); }
.hero-ctas { margin-top: 1.5rem; gap: .6rem; }

/* Simple page headings on inner pages */
.page-hero {
  padding: clamp(2.25rem, 6vw, 3.5rem) 0 clamp(1rem, 3vw, 1.5rem);
  background: none;
  border: 0;
}
.page-hero::after { content: none; }
.page-hero h1 { max-width: 30ch; margin: 0 0 .75rem; color: var(--heading); font-size: clamp(1.75rem, 1.35rem + 1.8vw, 2.5rem); line-height: 1.15; }
.page-hero p:not(.kicker) { max-width: 62ch; color: var(--text-muted); font-size: 1.05rem; }
.page-hero + .section { padding-top: 1rem; }
.kicker, .eyebrow {
  display: block;
  margin: 0 0 .5rem;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: var(--accent-strong);
  font-family: var(--font-mono);
  font-size: .85rem;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

/* Cards used by the projects grid, detail view, docs, and contact */
.panel, .content-card, .info-card, .contact-card, .contact-panel, .detail-card, .article-card, .product-card {
  background: var(--bg-elev-1);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  box-shadow: none;
}
.product-card:hover, .product-card:focus-within { transform: none; border-color: var(--border-strong); box-shadow: none; }

/* Homepage */
.home-intro { padding: clamp(2.5rem, 7vw, 4.5rem) 0 clamp(1.5rem, 4vw, 2.5rem); }
.home-intro h1 { max-width: 20ch; margin: 0; font-size: clamp(1.9rem, 1.4rem + 2.2vw, 2.9rem); line-height: 1.12; letter-spacing: -.02em; }
.home-intro p { max-width: 36rem; margin-top: 1rem; color: var(--text-muted); font-size: 1.1rem; }

.home-section { padding: clamp(1.5rem, 4vw, 2.5rem) 0; }
.home-section + .home-section { border-top: 1px solid var(--border-soft); }
.section-title { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .25rem 1rem; margin-bottom: 1.25rem; }
.section-title h2 { margin: 0; font-size: 1.4rem; }
.section-title a { font-weight: 500; }

.work-list { display: grid; gap: 0; list-style: none; margin: 0; padding: 0; }
.work-item { display: grid; grid-template-columns: 3rem minmax(0, 1fr); gap: 1rem; padding: 1.15rem 0; border-top: 1px solid var(--border-soft); }
.work-item:last-child { border-bottom: 1px solid var(--border-soft); }
.work-icon { width: 3rem; height: 3rem; border-radius: 10px; object-fit: cover; }
.work-icon-mono {
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-family: var(--font-mono);
  font-size: .95rem;
  font-weight: 500;
}
.work-item h3 { margin: 0; font-size: 1.15rem; }
.work-item h3 a { color: var(--heading); text-decoration: none; }
.work-item h3 a:hover { color: var(--accent-strong); text-decoration: underline; }
.work-meta { margin: .1rem 0 0; color: var(--text-soft); font-family: var(--font-mono); font-size: .82rem; }
.work-item p.work-desc { margin: .45rem 0 0; max-width: 62ch; color: var(--text-muted); }
.work-links { display: flex; flex-wrap: wrap; gap: .35rem 1.1rem; margin: .55rem 0 0; padding: 0; list-style: none; font-weight: 500; font-size: .95rem; }

.work-feature { display: grid; gap: 1.25rem; align-items: center; padding: 1.15rem 0 1.5rem; }
.work-feature .work-item { border: 0; padding: 0; }
.work-shot { display: block; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius-md); }
.work-shot img { display: block; width: 100%; height: auto; }

.home-more { display: grid; gap: 1.25rem; }
.home-more h2 { margin: 0 0 .4rem; font-size: 1.2rem; }
.home-more p { margin: 0; max-width: 46ch; color: var(--text-muted); }

@media (min-width: 760px) {
  .work-list-2col { grid-template-columns: 1fr 1fr; column-gap: 2.5rem; }
  .work-list-2col .work-item:nth-last-child(2):nth-child(odd) { border-bottom: 1px solid var(--border-soft); }
  .work-feature { grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 2.5rem; }
  .home-more { grid-template-columns: 1fr 1fr; gap: 2.5rem; }
}

/* Projects page */
.project-section + .project-section { margin-top: clamp(2rem, 5vw, 3rem); }
.project-section > h2 { margin: 0 0 .25rem; font-size: 1.3rem; }
.project-section > p { margin: 0 0 1rem; color: var(--text-muted); }
.project-grid { display: grid; gap: 0; background: none; border: 0; }
.project-grid .project-card {
  display: grid;
  grid-template-columns: 3rem minmax(0, 1fr);
  gap: .25rem 1rem;
  padding: 1.15rem 0;
  background: none;
  border: 0;
  border-top: 1px solid var(--border-soft);
  border-radius: 0;
  transition: none;
}
.project-grid .project-card:hover, .project-grid .project-card:focus-within { transform: none; box-shadow: none; border-color: var(--border-soft); }
.project-card .project-logo { grid-row: span 3; width: 3rem; height: 3rem; border: 0; border-radius: 10px; background: var(--accent-soft); color: var(--accent-strong); font-family: var(--font-mono); font-size: .95rem; font-weight: 500; }
.project-card h3 { margin: 0; font-size: 1.15rem; }
.project-card h3 a { color: var(--heading); text-decoration: none; }
.project-card h3 a:hover { color: var(--accent-strong); text-decoration: underline; }
.project-card .work-meta { margin: 0; }
.project-card .project-summary { margin: .3rem 0 0; color: var(--text-muted); max-width: 62ch; }
.project-card .work-links { grid-column: 2; }
@media (min-width: 760px) {
  .project-grid { grid-template-columns: 1fr 1fr; column-gap: 2.5rem; }
}
@media (min-width: 1080px) {
  .project-grid { grid-template-columns: 1fr 1fr; }
}

/* Project detail */
.detail-layout { gap: 1.25rem; }
.detail-card { padding: clamp(1.1rem, 3vw, 1.5rem); }
.detail-card h2 { margin: 0 0 .6rem; font-size: 1.15rem; }
.detail-card h2.space-top-6 { margin-top: 1.5rem; }
.detail-copy { gap: .9rem; }
.detail-list { margin: 0; padding-left: 1.2rem; }
.project-detail-meta { margin: 0; color: var(--text-soft); font-family: var(--font-mono); font-size: .88rem; }
.inline-links { gap: .4rem 1.1rem; }
.inline-links a { border-bottom: 0; padding: 0; font-size: 1rem; font-weight: 500; text-decoration: underline; }

/* About */
.prose { max-width: 40rem; }
.prose p { color: var(--text-muted); font-size: 1.05rem; }
.prose p + p { margin-top: 1rem; }
.prose h2 { margin: 2rem 0 .6rem; font-size: 1.25rem; }
.prose ul { margin: 0; padding-left: 1.2rem; color: var(--text-muted); display: grid; gap: .4rem; }

/* Contact */
.contact-layout { gap: 1.25rem; }
.contact-card, .contact-panel { padding: clamp(1.1rem, 3vw, 1.5rem); }
.contact-card h2, .contact-panel h2 { margin: 0 0 1rem; font-size: 1.2rem; }
.contact-list a { color: var(--link); text-decoration: underline; }
input, textarea { background: var(--bg-page); border-color: var(--border); border-radius: var(--radius-sm); font-size: 1rem; }
.form-note { font-size: .9rem; }

/* Footer */
.footer { margin-top: clamp(2.5rem, 6vw, 4rem); padding: 2rem 0 2.5rem; background: var(--bg-page-alt); border-top: 1px solid var(--border-soft); color: var(--text-muted); }
.forest-home .footer { margin-top: clamp(1.5rem, 4vw, 2.5rem); }
.footer-row { display: grid; gap: 1.25rem; }
.footer .brand { font-size: .95rem; }
.footer .brand img { height: 36px; }
.footer-links { gap: .5rem 1.25rem; }
.footer-links a, .footer-policies summary { color: var(--text-muted); font-size: .95rem; }
.footer-links a:hover, .footer-policies summary:hover { color: var(--heading); }
.footer-policies { font-size: .95rem; }
.footer-policies summary { font-weight: 500; }
.footer-copy { margin: 0; color: var(--text-soft); font-size: .9rem; }
@media (min-width: 760px) {
  .footer-row { grid-template-columns: auto 1fr; align-items: start; column-gap: 3rem; }
  .footer-row > .brand { grid-row: span 2; }
  .footer-copy { grid-column: 2; }
}

@media (prefers-reduced-motion: reduce) {
  .button, .btn, .project-card { transition: none !important; }
}

/* Long-form policy text */
.legal-content { max-width: 46rem; color: var(--text-muted); }
.legal-content h2 { margin: 2rem 0 .6rem; font-size: 1.2rem; }
.legal-content h3 { margin: 1.5rem 0 .5rem; font-size: 1.05rem; }
.legal-content p, .legal-content li { color: var(--text-muted); }
.legal-content p + p { margin-top: .75rem; }
.legal-content ul, .legal-content ol { margin: .5rem 0 1rem; padding-left: 1.3rem; display: grid; gap: .35rem; }
.legal-content strong { color: var(--text-main); }
.legal-content table { width: 100%; border-collapse: collapse; margin: 1rem 0; display: block; overflow-x: auto; }
.legal-content th, .legal-content td { padding: .5rem .6rem; border: 1px solid var(--border-soft); text-align: left; vertical-align: top; }

pre { max-width: 100%; overflow-x: auto; }
.docs-page { padding-block: clamp(2rem, 5vw, 3rem); }
.docs-page h1 { font-size: clamp(1.75rem, 1.35rem + 1.8vw, 2.5rem); }
.docs-page h2 { margin: 1.75rem 0 .5rem; font-size: 1.2rem; }
.docs-page p { max-width: 70ch; color: var(--text-muted); }
.docs-page p + p, .docs-page pre { margin-top: .75rem; }
.docs-page pre { padding: 1rem; background: var(--bg-elev-1); border: 1px solid var(--border-soft); border-radius: var(--radius-md); }

/* Agent Skills listing: keep a single card at card size instead of stretching across the page. */
.products-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 22rem), 1fr)); }
.main .badge { letter-spacing: 0; text-transform: none; font-family: var(--font-mono); font-weight: 500; }
.prose ul + p, .prose p + ul { margin-top: 1rem; }
