/* =========================================================
   J2 Labs design system — derived from the "We buy wonderful
   businesses" deck. Forest + lime + cream palette, Fixel type.
   ========================================================= */

/* ---------- Fixel font faces (display + text) ---------- */
@font-face { font-family: 'Fixel'; src: url('fonts/FixelDisplay/FixelDisplay-Regular.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Fixel'; src: url('fonts/FixelDisplay/FixelDisplay-Medium.woff2') format('woff2'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'Fixel'; src: url('fonts/FixelDisplay/FixelDisplay-SemiBold.woff2') format('woff2'); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: 'Fixel'; src: url('fonts/FixelDisplay/FixelDisplay-Bold.woff2') format('woff2'); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: 'Fixel'; src: url('fonts/FixelDisplay/FixelDisplay-RegularItalic.woff2') format('woff2'); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: 'Fixel'; src: url('fonts/FixelDisplay/FixelDisplay-BoldItalic.woff2') format('woff2'); font-weight: 700; font-style: italic; font-display: swap; }

/* ---------- Reset ---------- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
img { max-width: 100%; display: block; }
a { color: inherit; }

/* ---------- Tokens ---------- */
:root {
  /* Brand palette */
  --green-deep:    #2e4a1d;   /* forest, hero & dark blocks */
  --green-deep-2:  #3a5c25;   /* slightly lighter forest */
  --green-mid:     #8db82e;   /* lime, secondary */
  --green-leaf:    #a3c560;   /* leaf, mid */
  --green-soft:    #c9dd8a;   /* soft green */
  --cream:         #eef4d4;   /* cream bg */
  --cream-light:   #f5f9e4;   /* lighter cream */
  --highlight:     #cef060;   /* marker highlight */
  --tan:           #a89b6f;   /* khaki accent */

  /* Text */
  --text-dark:   var(--green-deep);
  --text-cream:  var(--cream);
  --text-muted-dark: #5a7842;
  --text-muted-light: #c9dd8a;

  /* Layout */
  --container: 1200px;
  --container-narrow: 920px;
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 10px;

  /* Type scale */
  --font: 'Fixel', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --t-hero: clamp(48px, 7vw, 96px);
  --t-h1:   clamp(40px, 5.5vw, 72px);
  --t-h2:   clamp(28px, 3.5vw, 44px);
  --t-h3:   clamp(20px, 2vw, 26px);
  --t-body-lg: clamp(17px, 1.4vw, 21px);
  --t-body:    clamp(15px, 1.15vw, 17px);
  --t-small:   14px;
}

/* ---------- Base ---------- */
body {
  font-family: var(--font);
  font-weight: 400;
  font-size: var(--t-body);
  line-height: 1.55;
  color: var(--text-dark);
  background: var(--cream-light);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---------- Layout primitives ---------- */
.container { max-width: var(--container); margin: 0 auto; padding: 0 28px; }
.container-narrow { max-width: var(--container-narrow); margin: 0 auto; padding: 0 28px; }

.section {
  padding: clamp(64px, 7vw, 104px) 0;
}
.section-tight { padding: clamp(40px, 5vw, 72px) 0; }

/* Background variants */
.bg-deep   { background: var(--green-deep);  color: var(--text-cream); }
.bg-mid    { background: var(--green-mid);   color: var(--text-cream); }
.bg-cream  { background: var(--cream);       color: var(--text-dark); }
.bg-cream-light { background: var(--cream-light); color: var(--text-dark); }
.bg-deep-grad {
  background: linear-gradient(160deg, var(--green-deep) 0%, var(--green-deep-2) 100%);
  color: var(--text-cream);
}

/* ---------- Typography ---------- */
h1, h2, h3, h4 { font-weight: 700; line-height: 1.05; letter-spacing: -0.02em; }
.t-hero { font-size: var(--t-hero); font-weight: 700; line-height: 1.02; letter-spacing: -0.025em; }
.t-h1   { font-size: var(--t-h1);   font-weight: 700; line-height: 1.05; letter-spacing: -0.02em; }
.t-h2   { font-size: var(--t-h2);   font-weight: 700; line-height: 1.1;  letter-spacing: -0.02em; }
.t-h3   { font-size: var(--t-h3);   font-weight: 600; line-height: 1.2; }
.t-lead { font-size: var(--t-body-lg); line-height: 1.55; font-weight: 400; }
.muted-on-deep { color: rgba(238, 244, 212, 0.78); }
.muted-on-cream { color: var(--text-muted-dark); }

/* Marker highlight (deck "Exceptional / Value / Forever" effect) */
.mark {
  background-image: linear-gradient(120deg, var(--highlight) 0%, var(--highlight) 100%);
  background-repeat: no-repeat;
  background-size: 100% 60%;
  background-position: 0 75%;
  padding: 0 .15em;
  color: var(--text-dark);
}
.bg-deep .mark, .bg-mid .mark, .bg-deep-grad .mark {
  /* On dark backgrounds use a deeper highlight that still pops */
  background-image: linear-gradient(120deg, rgba(0,0,0,0.18) 0%, rgba(0,0,0,0.18) 100%);
  color: var(--text-cream);
}
.italic-accent { font-style: italic; color: var(--green-mid); }

/* ---------- Top nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: var(--cream-light);
  border-bottom: 1px solid rgba(46, 74, 29, 0.08);
  backdrop-filter: saturate(140%) blur(10px);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 28px;
  max-width: var(--container);
  margin: 0 auto;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  text-decoration: none; color: var(--green-deep);
  font-weight: 700; font-size: 24px; letter-spacing: -0.02em;
}
.brand-text { display: inline-block; }
.brand-text .accent { color: var(--green-mid); }
.nav-links { display: flex; align-items: center; gap: 8px; }
.nav-link {
  text-decoration: none; color: var(--green-deep);
  font-weight: 500; font-size: 15px;
  padding: 10px 16px; border-radius: 999px;
  transition: background .2s ease, color .2s ease;
}
.nav-link:hover { background: rgba(46, 74, 29, 0.08); }
.nav-cta {
  text-decoration: none; color: var(--cream);
  background: var(--green-deep);
  padding: 12px 22px; border-radius: 999px;
  font-weight: 600; font-size: 15px;
  transition: transform .15s ease, background .2s ease;
}
.nav-cta:hover { background: var(--green-deep-2); transform: translateY(-1px); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 16px 28px; border-radius: 999px; border: none; cursor: pointer;
  font-family: var(--font); font-weight: 600; font-size: 16px;
  text-decoration: none; transition: transform .15s ease, background .2s ease, color .2s ease, border-color .2s ease;
}
.btn-primary { background: var(--green-mid); color: var(--green-deep); }
.btn-primary:hover { background: var(--highlight); transform: translateY(-1px); }
.btn-light { background: var(--cream); color: var(--green-deep); }
.btn-light:hover { background: #fff; transform: translateY(-1px); }
.btn-outline-cream { background: transparent; color: var(--cream); border: 2px solid var(--cream); }
.btn-outline-cream:hover { background: var(--cream); color: var(--green-deep); }

/* ---------- Cards ---------- */
.card {
  background: var(--cream); color: var(--text-dark);
  border-radius: var(--radius-lg);
  padding: 36px;
}
.card-deep { background: var(--green-deep); color: var(--cream); }
.card-mid  { background: var(--green-mid); color: var(--cream); }
.card-leaf { background: var(--green-leaf); color: var(--green-deep); }
.card-tan  { background: var(--tan); color: #fff; }
.card-outline {
  background: transparent;
  border: 2px solid var(--green-deep);
}

/* ---------- Lead form (Netlify) ---------- */
.lead-form {
  background: var(--cream);
  color: var(--green-deep);
  border-radius: var(--radius-lg);
  padding: 36px;
  display: flex; flex-direction: column; gap: 14px;
  box-shadow: 0 20px 60px -30px rgba(46, 74, 29, 0.4);
}
.bg-deep .lead-form, .bg-mid .lead-form { /* same look on dark */ }
.lead-form .form-help { font-size: 14px; color: var(--text-muted-dark); line-height: 1.55; }
.lead-form input[type=email] {
  background: #fff; color: var(--green-deep);
  border: 2px solid rgba(46, 74, 29, 0.15);
  border-radius: 12px;
  padding: 16px 20px; font-size: 16px; font-family: var(--font);
  transition: border-color .15s ease;
  width: 100%;
}
.lead-form input[type=email]:focus { outline: none; border-color: var(--green-mid); }
.lead-form input[type=email]::placeholder { color: rgba(46,74,29,0.4); }
.lead-form button {
  background: var(--green-deep); color: var(--cream);
  border: none; cursor: pointer;
  border-radius: 12px;
  padding: 16px 24px;
  font-family: var(--font); font-size: 16px; font-weight: 600;
  transition: background .2s ease, transform .15s ease;
}
.lead-form button:hover { background: var(--green-deep-2); transform: translateY(-1px); }

/* ---------- Footer ---------- */
.footer {
  background: var(--green-deep);
  color: var(--cream);
  padding: 56px 0 36px;
}
.footer-inner {
  display: flex; flex-wrap: wrap; gap: 24px; align-items: center; justify-content: space-between;
}
.footer-links { display: flex; gap: 24px; flex-wrap: wrap; }
.footer-links a { color: rgba(238,244,212,0.8); text-decoration: none; font-weight: 500; font-size: 15px; }
.footer-links a:hover { color: var(--cream); }
.footer-meta { color: rgba(238,244,212,0.5); font-size: 13px; }

/* ---------- Popup ---------- */
.popup-overlay {
  position: fixed; inset: 0;
  background: rgba(46,74,29,0.65);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden;
  transition: opacity .25s ease, visibility .25s ease;
  z-index: 1000; padding: 20px;
  backdrop-filter: blur(8px);
}
.popup-overlay.active { opacity: 1; visibility: visible; }
.popup {
  background: var(--cream);
  border-radius: var(--radius-lg);
  padding: 44px 36px;
  max-width: 460px; width: 100%;
  text-align: center;
  transform: translateY(16px);
  transition: transform .25s ease;
}
.popup-overlay.active .popup { transform: translateY(0); }
.popup h2 { font-size: 26px; margin-bottom: 12px; color: var(--green-deep); }
.popup p { font-size: 16px; line-height: 1.55; color: var(--text-muted-dark); margin-bottom: 24px; }
.popup-actions { display: flex; flex-direction: column; gap: 10px; }

/* ---------- Utility ---------- */
.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.flex { display: flex; }
.center { display: flex; align-items: center; justify-content: center; }
.text-center { text-align: center; }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mt-4 { margin-top: 32px; } .mt-5 { margin-top: 48px; }
.mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; } .mb-4 { margin-bottom: 32px; } .mb-5 { margin-bottom: 48px; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .grid-3, .grid-4 { grid-template-columns: 1fr 1fr; }
  .nav-links .nav-link { display: none; }
}
@media (max-width: 640px) {
  .container, .container-narrow, .nav-inner { padding-left: 20px; padding-right: 20px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .card { padding: 28px; }
  .lead-form { padding: 28px; }
}
