/* ============================================================
   Houpham — Design System
   Corporate Modern: deep forest green + warm cream, Manrope
   ============================================================ */

:root {
  /* Core palette (per design system) */
  --primary: #1e3a34;          /* Forest green */
  --primary-deep: #06241f;
  --primary-hover: #16302a;
  --on-primary: #ffffff;
  --primary-container: #cae9e0;
  --on-primary-container: #06241f;

  --cream: #f4f1e9;            /* Warm cream base */
  --cream-dark: #ebe7db;
  --surface: #f9f9f7;
  --surface-container: #ffffff;
  --surface-alt: #f0efe8;

  --sage: #d1e3d3;            /* Sage mint */
  --sage-soft: #e3efe4;

  --on-surface: #151c27;
  --neutral: #6b7280;         /* Slate gray body text */
  --neutral-soft: #8b909a;
  --outline: #d9d5c8;
  --outline-soft: #e7e3d7;

  --error: #ba1a1a;
  --error-bg: #ffdad6;
  --success: #1e7d5a;
  --warning: #b7791f;

  /* Typography */
  --font: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  /* Radii */
  --r-sm: 0.25rem;
  --r: 0.5rem;
  --r-md: 0.75rem;
  --r-lg: 1rem;
  --r-xl: 1.5rem;
  --r-pill: 9999px;

  /* Spacing */
  --container: 1280px;
  --gutter: 24px;
  --section-pad: 120px;
  --card-pad: 40px;

  --shadow-hover: 0 4px 20px rgba(0, 0, 0, 0.05);
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 12px 40px rgba(6, 36, 31, 0.12);
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--on-surface);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

/* ---------- Layout ---------- */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.section { padding: var(--section-pad) 0; }
.section-sm { padding: 72px 0; }

.grid { display: grid; gap: var(--gutter); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-sm { gap: 8px; }
.gap-md { gap: 16px; }
.gap-lg { gap: 32px; }
.wrap { flex-wrap: wrap; }

/* ---------- Typography ---------- */
.display-lg { font-size: 56px; font-weight: 600; line-height: 1.1; letter-spacing: -0.02em; }
.display-md { font-size: 40px; font-weight: 600; line-height: 1.2; letter-spacing: -0.01em; }
.headline-lg { font-size: 32px; font-weight: 600; line-height: 1.3; letter-spacing: -0.01em; }
.headline-md { font-size: 24px; font-weight: 600; line-height: 1.4; }
.body-lg { font-size: 18px; line-height: 1.6; }
.body-md { font-size: 16px; line-height: 1.6; }
.label { font-size: 13px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
h1,h2,h3,h4 { font-weight: 600; color: var(--primary); margin: 0 0 0.4em; letter-spacing: -0.01em; }
p { margin: 0 0 1em; }
.muted { color: var(--neutral); }
.text-primary { color: var(--primary); }
.text-white { color: #fff; }
.center { text-align: center; }
.mx-auto { margin-left: auto; margin-right: auto; }
.maxw-680 { max-width: 680px; }
.maxw-760 { max-width: 760px; }
.mt-0{margin-top:0}.mt-sm{margin-top:8px}.mt-md{margin-top:16px}.mt-lg{margin-top:32px}.mt-xl{margin-top:48px}
.mb-0{margin-bottom:0}.mb-sm{margin-bottom:8px}.mb-md{margin-bottom:16px}.mb-lg{margin-bottom:32px}

/* Editorial emphasis */
.emphasis { color: var(--primary-deep); font-style: italic; }
.highlight { background: var(--sage); padding: 0 0.2em; border-radius: 4px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font); font-size: 15px; font-weight: 600;
  padding: 14px 28px; border-radius: var(--r-pill);
  border: 1.5px solid transparent; cursor: pointer;
  transition: background .18s ease, color .18s ease, border-color .18s ease, transform .12s ease;
  white-space: nowrap; text-decoration: none; line-height: 1;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn-secondary:hover { background: var(--primary); color: #fff; }
.btn-light { background: #fff; color: var(--primary); }
.btn-light:hover { background: var(--sage-soft); }
.btn-ghost { background: transparent; color: var(--primary); }
.btn-ghost:hover { background: var(--sage-soft); }
.btn-sm { padding: 9px 18px; font-size: 14px; }
.btn-lg { padding: 17px 36px; font-size: 16px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* ---------- Cards ---------- */
.card {
  background: var(--surface-container);
  border: 1px solid var(--outline-soft);
  border-radius: var(--r-lg);
  padding: var(--card-pad);
  transition: box-shadow .2s ease, transform .2s ease, border-color .2s ease;
}
.card-hover:hover { box-shadow: var(--shadow-hover); transform: translateY(-3px); border-color: var(--outline); }
.card-dark { background: var(--primary); color: rgba(255,255,255,.86); border: none; }
.card-dark h1,.card-dark h2,.card-dark h3,.card-dark h4 { color: #fff; }
.card-sage { background: var(--sage-soft); border-color: var(--sage); }
.card-pad-sm { padding: 28px; }

/* Chips */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 600; padding: 6px 14px;
  border-radius: var(--r-pill); background: var(--sage); color: var(--primary-deep);
}
.chip-outline { background: transparent; border: 1px solid var(--outline); color: var(--neutral); }
.chip-dark { background: rgba(255,255,255,.12); color: #fff; }

.icon-tile {
  width: 56px; height: 56px; border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  background: var(--sage-soft); color: var(--primary); font-size: 22px; flex-shrink: 0;
}
.icon-tile.dark { background: rgba(255,255,255,.1); color: var(--sage); }

/* ---------- Forms ---------- */
.field { margin-bottom: 20px; }
.field label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 8px; color: var(--on-surface); }
.field .hint { font-size: 13px; color: var(--neutral); margin-top: 6px; }
.input, .textarea, .select {
  width: 100%; font-family: var(--font); font-size: 16px;
  padding: 13px 16px; border: 1.5px solid var(--outline); border-radius: var(--r);
  background: #fff; color: var(--on-surface); transition: border-color .15s ease, box-shadow .15s ease;
}
.input:focus, .textarea:focus, .select:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(30,58,52,.12);
}
.textarea { min-height: 130px; resize: vertical; }
.field.error .input, .field.error .textarea, .field.error .select { border-color: var(--error); }
.field .err-msg { color: var(--error); font-size: 13px; margin-top: 6px; display: none; }
.field.error .err-msg { display: block; }

.option-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.option-card {
  border: 1.5px solid var(--outline); border-radius: var(--r-md); padding: 18px;
  cursor: pointer; transition: all .15s ease; background: #fff; display: flex; gap: 12px; align-items: flex-start;
}
.option-card:hover { border-color: var(--primary); }
.option-card.selected { border-color: var(--primary); background: var(--sage-soft); box-shadow: 0 0 0 1px var(--primary) inset; }
.option-card input { margin-top: 3px; }
.option-card .oc-title { font-weight: 600; font-size: 15px; }
.option-card .oc-desc { font-size: 13px; color: var(--neutral); }

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(244,241,233,.85); backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--outline-soft);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 74px; }
.nav-logo img { height: 30px; width: auto; }
.nav-links { display: flex; align-items: center; gap: 28px; }
.nav-links a { font-size: 15px; font-weight: 500; color: var(--on-surface); transition: color .15s; }
.nav-links a:hover, .nav-links a.active { color: var(--primary); }
.nav-cta { display: flex; align-items: center; gap: 14px; }
.nav-toggle { display: none; background: none; border: none; font-size: 22px; color: var(--primary); cursor: pointer; }
/* CTAs that live inside the collapsible nav are for the mobile menu only */
.nav-mobile-cta { display: none; }

.has-dropdown { position: relative; }
.dropdown {
  position: absolute; top: 130%; left: 0; min-width: 240px;
  background: #fff; border: 1px solid var(--outline-soft); border-radius: var(--r-md);
  box-shadow: var(--shadow-lg); padding: 10px; opacity: 0; visibility: hidden;
  transform: translateY(8px); transition: all .18s ease;
}
.has-dropdown:hover .dropdown { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown a { display: block; padding: 10px 14px; border-radius: var(--r); font-size: 14px; }
.dropdown a:hover { background: var(--sage-soft); }

/* ---------- Footer ---------- */
.site-footer { background: var(--primary-deep); color: rgba(255,255,255,.72); padding: 72px 0 32px; }
.site-footer h4 { color: #fff; font-size: 15px; margin-bottom: 18px; }
.site-footer a { color: rgba(255,255,255,.72); font-size: 14px; line-height: 2; transition: color .15s; }
.site-footer a:hover { color: #fff; }
.footer-logo img { height: 30px; margin-bottom: 18px; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.12); margin-top: 48px; padding-top: 24px; font-size: 13px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }

/* ---------- Hero ---------- */
.hero { padding: 88px 0 96px; position: relative; overflow: hidden; }
.hero-eyebrow { color: var(--primary); margin-bottom: 20px; }
.hero p.lead { font-size: 19px; color: var(--neutral); max-width: 560px; }
.hero-actions { display: flex; gap: 14px; margin-top: 32px; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 40px; margin-top: 56px; flex-wrap: wrap; }
.hero-stats .stat .n { font-size: 34px; font-weight: 700; color: var(--primary); }
.hero-stats .stat .l { font-size: 14px; color: var(--neutral); }

/* Pill list */
.pill-row { display: flex; flex-wrap: wrap; gap: 10px; }

/* Alerts */
.alert { padding: 14px 18px; border-radius: var(--r); font-size: 14px; margin-bottom: 20px; }
.alert-success { background: var(--sage-soft); color: var(--primary-deep); border: 1px solid var(--sage); }
.alert-error { background: var(--error-bg); color: #93000a; border: 1px solid #f5b5b0; }
.alert-info { background: #eef2fb; color: #1e3a5f; border: 1px solid #d5e0f5; }

/* Meter / progress */
.meter { height: 12px; border-radius: var(--r-pill); background: var(--outline-soft); overflow: hidden; }
.meter > span { display: block; height: 100%; background: var(--primary); border-radius: inherit; transition: width .6s ease; }

/* Badges for lead stages / scores */
.badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: var(--r-pill); font-size: 12px; font-weight: 600; }
.badge-hot { background: #fdecec; color: #b3261e; }
.badge-warm { background: #fdf4e3; color: #9a6a00; }
.badge-cold { background: #eef2fb; color: #3a5a8f; }

/* Demo content ribbon */
.demo-flag { display: inline-block; font-size: 11px; font-weight: 600; letter-spacing: .04em; color: var(--warning); background: #fdf4e3; padding: 2px 8px; border-radius: var(--r-sm); }

/* Divider */
.divider { height: 1px; background: var(--outline-soft); border: none; margin: 0; }

/* Logo strip */
.logo-strip { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 48px; opacity: .7; }
.logo-strip .lg { font-weight: 700; font-size: 18px; color: var(--neutral); letter-spacing: -.01em; }

/* Breadcrumb */
.crumbs { font-size: 13px; color: var(--neutral); margin-bottom: 16px; }
.crumbs a:hover { color: var(--primary); }

/* Prose (article content) */
.prose { max-width: 760px; }
.prose h2 { font-size: 28px; margin-top: 1.6em; }
.prose h3 { font-size: 22px; margin-top: 1.4em; }
.prose p, .prose li { color: #33383f; font-size: 17px; }
.prose ul { padding-left: 22px; }
.prose blockquote { border-left: 3px solid var(--sage); padding-left: 20px; color: var(--neutral); font-style: italic; margin: 1.5em 0; }

/* Utility */
.hidden { display: none !important; }
.relative { position: relative; }
.full-w { width: 100%; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  :root { --section-pad: 72px; --card-pad: 28px; }
  .display-lg { font-size: 40px; }
  .display-md { font-size: 30px; }
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .nav-links, .nav-cta .btn { display: none; }
  .nav-toggle { display: block; }
  .nav-links.open {
    display: flex; flex-direction: column; position: absolute; top: 74px; left: 0; right: 0;
    background: var(--cream); padding: 20px var(--gutter); gap: 8px; border-bottom: 1px solid var(--outline-soft);
  }
  .nav-links.open a { padding: 10px 0; width: 100%; }
  .nav-links.open .nav-mobile-cta { display: inline-flex; }
  .hero-stats { gap: 28px; }
}
@media (max-width: 640px) {
  :root { --gutter: 20px; }
  .display-lg { font-size: 32px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .hero-actions .btn { width: 100%; }
  .footer-bottom { flex-direction: column; }
}
