/* Edgewood Software — "Deep Forest" design system.
   Mobile-first. Breakpoints (keep in sync with assets/js/nav.js):
     @custom-media --sm (min-width: 600px);
     @custom-media --md (min-width: 900px);
     @custom-media --lg (min-width: 1200px);  content is capped at --max, so no lg rules are needed */

@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/inter-var.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* Arial scaled to Inter's metrics, used until Inter loads. Without it, the swap from the
   system font to Inter reflows the text and shifts the page (Lighthouse CLS on slow networks). */
@font-face {
  font-family: "Inter Fallback";
  src: local("Arial");
  ascent-override: 90.44%;
  descent-override: 22.52%;
  line-gap-override: 0%;
  size-adjust: 107.12%;
}

:root {
  --bg: #0f1a10;
  --surface: #172617;
  --border: #243a22;
  --border-strong: #3d5e33;
  --text: #e8efe4;
  --muted: #aebca6;
  --accent: #8fc764;
  --accent-hover: #a3d67c;
  --accent-ink: #0f1a10;
  --brand: #61943a;
  --danger: #ff9b8a;
  --radius: 14px;
  --radius-sm: 10px;
  --max: 1120px;
  --gutter: 16px;
  --section: clamp(48px, 8vw, 96px);
  --font: "Inter", "Inter Fallback", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}
@media (min-width: 600px) { :root { --gutter: 24px; } }
@media (min-width: 900px) { :root { --gutter: 32px; } }

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 88px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  overflow-wrap: break-word;
}
@media (min-width: 900px) { body { font-size: 17px; } }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

img, svg, picture { display: block; max-width: 100%; height: auto; }
a { color: var(--accent); text-underline-offset: 3px; }
h1, h2, h3 { margin: 0 0 0.5em; font-weight: 800; line-height: 1.1; letter-spacing: -0.025em; }
h1 { font-size: clamp(2.5rem, 6vw + 1rem, 4.5rem); letter-spacing: -0.035em; }
h2 { font-size: clamp(1.5rem, 2.5vw + 1rem, 2.25rem); }
h3 { font-size: 1.125rem; letter-spacing: -0.01em; }
p { margin: 0 0 1em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

/* Layout */
.container {
  width: 100%;
  max-width: calc(var(--max) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: max(var(--gutter), env(safe-area-inset-left)) max(var(--gutter), env(safe-area-inset-right));
}
.section { padding-block: var(--section); }
.section-head { margin-bottom: 28px; }
.section-head-row { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 16px; }
.grid { display: grid; grid-template-columns: 1fr; gap: 16px; margin: 0; padding: 0; list-style: none; }
@media (min-width: 600px) { .grid-sm-2 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 600px) and (max-width: 899.98px) {
  .grid-sm-2 > :last-child:nth-child(odd) { grid-column: 1 / -1; }
}
@media (min-width: 900px) {
  .grid-md-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-md-4 { grid-template-columns: repeat(4, 1fr); }
}
.split { display: grid; gap: 24px; }
@media (min-width: 900px) {
  .split { grid-template-columns: 1fr 1.3fr; gap: 48px; align-items: start; }
  .split-wide { grid-template-columns: 1.4fr 1fr; align-items: center; }
}

/* Text helpers */
.eyebrow { margin: 0 0 0.75rem; color: var(--accent); font-size: 0.75rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; }
.lead { max-width: 36rem; color: var(--muted); font-size: 1.125rem; }
.muted { color: var(--muted); }
.accent { color: var(--accent); }
.tag { display: inline-block; padding: 2px 10px; border: 1px solid var(--border-strong); border-radius: 999px; color: var(--muted); font-size: 0.8rem; }
.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; top: -60px; left: 8px; z-index: 100; padding: 10px 16px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-weight: 700; }
.skip-link:focus { top: 8px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4em;
  min-height: 44px; padding: 10px 20px; border: 1px solid transparent; border-radius: 999px;
  font: inherit; font-size: 0.95rem; font-weight: 700; text-decoration: none; cursor: pointer;
}
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-outline { border-color: var(--accent); background: transparent; color: var(--accent); }
.btn-ghost { border-color: var(--border-strong); background: transparent; color: var(--text); }
.btn:disabled { opacity: 0.6; cursor: progress; }

/* Header + nav */
.site-header {
  position: sticky; top: 0; z-index: 50;
  padding-top: env(safe-area-inset-top);
  border-bottom: 1px solid var(--border);
  background: rgba(15, 26, 16, 0.92);
  backdrop-filter: blur(8px);
}
.header-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; min-height: 64px; }
.wordmark { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; color: var(--text); font-size: 1.05rem; font-weight: 800; letter-spacing: -0.01em; text-decoration: none; }
.wordmark-mark { color: var(--accent); }
.site-nav ul { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; margin: 0; padding: 0; list-style: none; }
.site-nav a:not(.btn) { display: inline-flex; align-items: center; min-height: 44px; color: var(--muted); font-size: 0.95rem; text-decoration: none; }
.nav-toggle {
  display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: transparent; color: var(--text); cursor: pointer;
}
.nav-toggle-bar, .nav-toggle-bar::before, .nav-toggle-bar::after {
  position: relative; display: block; width: 18px; height: 2px; border-radius: 2px; background: currentColor; content: "";
}
.nav-toggle-bar::before { position: absolute; top: -6px; }
.nav-toggle-bar::after { position: absolute; top: 6px; }
/* nav.js adds .js-nav: below md the nav becomes a full-width dropdown panel */
.js-nav .site-nav { flex-basis: 100%; padding-bottom: 16px; }
.js-nav .site-nav ul { flex-direction: column; align-items: stretch; gap: 4px; }
.js-nav .site-nav a:not(.btn) { width: 100%; padding-inline: 4px; font-size: 1.05rem; }
.js-nav .site-nav .btn { width: 100%; margin-top: 8px; }
@media (min-width: 900px) {
  .nav-toggle { display: none; }
  .js-nav .site-nav { flex-basis: auto; padding-bottom: 0; }
  .js-nav .site-nav ul { flex-direction: row; align-items: center; gap: 24px; }
  .js-nav .site-nav a:not(.btn) { width: auto; padding-inline: 0; font-size: 0.95rem; }
  .js-nav .site-nav .btn { width: auto; margin-top: 0; }
}

/* Hero */
.hero {
  position: relative; overflow: hidden;
  padding-block: clamp(56px, 10vw, 128px) clamp(48px, 8vw, 96px);
  background: radial-gradient(ellipse 80% 55% at 100% 0%, rgba(97, 148, 58, 0.45), transparent 70%);
}
.hero .lead { margin-bottom: 28px; }
.hero-actions { display: flex; flex-direction: column; gap: 12px; }
@media (min-width: 600px) { .hero-actions { flex-direction: row; } }
@media (min-width: 900px) {
  .hero { background: radial-gradient(ellipse 55% 70% at 85% 0%, rgba(97, 148, 58, 0.45), transparent 70%); }
  .hero .lead { font-size: 1.25rem; }
}

/* Cards */
.card { height: 100%; padding: 20px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.card p { margin: 0; color: var(--muted); font-size: 0.95rem; }
.card-icon { display: grid; place-items: center; width: 40px; height: 40px; margin-bottom: 14px; border-radius: var(--radius-sm); background: rgba(143, 199, 100, 0.12); color: var(--accent); }
.card-icon svg { width: 22px; height: 22px; }
.offer { padding: 28px; background: linear-gradient(160deg, var(--surface), var(--bg)); }
.offer h3 { font-size: 1.4rem; }
.offer p { margin-bottom: 16px; }

/* Cash to Close */
.ctc {
  padding: clamp(24px, 4vw, 40px);
  border: 1px solid var(--border-strong); border-radius: 20px;
  background: linear-gradient(120deg, rgba(143, 199, 100, 0.18), rgba(143, 199, 100, 0.04));
}
.ctc-panel { padding: 16px 18px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg); color: var(--muted); font-size: 0.95rem; }
.ctc-row { display: flex; justify-content: space-between; gap: 12px; padding-block: 6px; }
.ctc-row strong { color: var(--text); font-variant-numeric: tabular-nums; }
.ctc-total { margin-top: 6px; padding-top: 10px; border-top: 1px solid var(--border); }
.ctc-total strong { color: var(--accent); }

/* Testimonials */
.quote { display: flex; flex-direction: column; justify-content: space-between; gap: 16px; margin: 0; }
.quote blockquote { margin: 0; color: var(--text); font-size: 0.98rem; }
.quote figcaption { color: var(--accent); font-weight: 700; }

/* Post cards + lists */
.post-card { display: flex; flex-direction: column; height: 100%; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); text-decoration: none; }
.post-card img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.post-card-body { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px 20px; }
.post-card h3 { margin: 0; font-size: 1.05rem; line-height: 1.3; }
.post-card time { color: var(--muted); font-size: 0.85rem; }

/* Contact */
.contact-panel { padding: clamp(20px, 4vw, 40px); border: 1px solid var(--border); border-radius: 20px; background: var(--surface); }
.form { display: grid; gap: 14px; }
.form-row { display: grid; gap: 14px; }
@media (min-width: 600px) { .form-row { grid-template-columns: 1fr 1fr; } }
.field { display: grid; gap: 6px; }
.field label { font-size: 0.9rem; font-weight: 600; }
.field input, .field textarea {
  width: 100%; min-height: 44px; padding: 10px 12px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--bg); color: var(--text); font: inherit; font-size: 16px;
}
.field textarea { min-height: 140px; resize: vertical; }
.field input:focus, .field textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px rgba(143, 199, 100, 0.25); }
.field [aria-invalid="true"] { border-color: var(--danger); }
.field-error { margin: 0; color: var(--danger); font-size: 0.85rem; }
.field-error:empty { display: none; }
/* Reserve the compact Turnstile widget's height so nothing shifts when it loads on first focus. */
.cf-turnstile { min-height: 140px; }
.hp-field { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form-footer { display: flex; flex-direction: column; align-items: stretch; gap: 12px; }
@media (min-width: 600px) { .form-footer { flex-direction: row; align-items: center; justify-content: space-between; } }
.form-status { margin: 0; color: var(--muted); font-size: 0.95rem; }
.form-success { margin: 0; color: var(--accent); font-size: 1.1rem; font-weight: 600; }

/* Pages + articles */
.page-header { padding-block: clamp(40px, 7vw, 88px) 24px; }
.article { padding-block: clamp(32px, 6vw, 72px) var(--section); }
.article-inner { max-width: calc(68ch + 2 * var(--gutter)); }
.article-image { margin: 0 0 28px; }
.article-image img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: var(--radius); }
.article-title { font-size: clamp(2rem, 4vw + 1rem, 3rem); }
.article-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 28px; color: var(--muted); font-size: 0.9rem; }
.prose { font-size: 1.05rem; }
.prose h2, .prose h3 { margin-top: 1.8em; }
.prose h3 { font-size: 1.35rem; }
.prose a { overflow-wrap: anywhere; }
.prose ul, .prose ol { padding-left: 1.25em; }
.prose li { margin-bottom: 0.4em; }
.article-cta { margin-top: 40px; padding: 20px; border: 1px solid var(--border-strong); border-radius: var(--radius); }

/* Footer */
.site-footer { padding-block: 28px calc(28px + env(safe-area-inset-bottom)); border-top: 1px solid var(--border); color: var(--muted); font-size: 0.9rem; }
.footer-inner { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.footer-copy { margin: 0; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 20px; margin: 0; padding: 0; list-style: none; }
.footer-links a { display: inline-flex; align-items: center; min-height: 44px; color: var(--muted); }
@media (min-width: 600px) { .footer-inner { flex-direction: row; justify-content: space-between; text-align: left; } }

/* Hover only on devices that can hover (no sticky hover on touch) */
@media (hover: hover) {
  .site-nav a:not(.btn):hover { color: var(--text); }
  .btn-primary:hover { background: var(--accent-hover); }
  .btn-outline:hover, .btn-ghost:hover { background: rgba(143, 199, 100, 0.1); }
  .post-card:hover { border-color: var(--border-strong); }
  .post-card:hover h3 { color: var(--accent); }
}
