/* =========================================================
   The Compass Care — Social Care Network
   Design tokens mirror the source brand system exactly.
   ========================================================= */

:root {
  --font-sans: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-serif: "Playfair Display", Georgia, serif;

  --background: 0 0% 99%;
  --foreground: 220 20% 20%;
  --card: 0 0% 100%;
  --primary: 191 40% 49%;
  --primary-foreground: 0 0% 100%;
  --secondary: 90 40% 50%;
  --secondary-foreground: 0 0% 100%;
  --muted: 200 10% 96%;
  --muted-foreground: 220 10% 46%;
  --accent: 191 40% 95%;
  --border: 200 10% 90%;

  --max: 80rem;      /* max-w-7xl */
  --nav-h: 5rem;     /* h-20 */
}

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

html { scroll-behavior: smooth; scroll-padding-top: var(--nav-h); -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }
h1, h2, h3, h4, blockquote, p, figure { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 1.5rem; }
@media (min-width: 768px) { .wrap { padding: 0 4rem; } }

.serif { font-family: var(--font-serif); }
.eyebrow {
  font-size: .875rem; font-weight: 600; letter-spacing: .1em;
  text-transform: uppercase; color: hsl(var(--primary));
}
.section { padding: 6rem 0; }
@media (min-width: 768px) { .section { padding: 8rem 0; } }
.section-muted { background: hsl(var(--muted)); }

.section-head { max-width: 42rem; margin-bottom: 4rem; }
.section-head .eyebrow { margin-bottom: 1rem; display: block; }
.section-head h2 {
  font-family: var(--font-serif); font-size: 1.875rem; font-weight: 700;
  line-height: 1.2; margin-bottom: 1.5rem;
}
@media (min-width: 768px) { .section-head h2 { font-size: 2.25rem; } }
.section-head p { color: hsl(var(--muted-foreground)); font-size: 1.125rem; line-height: 1.7; }

/* ---------------- Buttons ---------------- */
.btn {
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  white-space: nowrap; height: 3rem; padding: 0 1.5rem;
  font-size: .875rem; font-weight: 600; letter-spacing: .025em; text-transform: uppercase;
  transition: color .3s ease, background-color .3s ease, border-color .3s ease;
}
.btn > * { position: relative; z-index: 1; }
.btn::before {
  content: ""; position: absolute; inset: 0; z-index: 0;
  transform: scaleX(0); transform-origin: left;
  transition: transform .4s cubic-bezier(.4, 0, .2, 1);
}
.btn:hover::before { transform: scaleX(1); }

.btn-green { background: hsl(var(--secondary)); color: hsl(var(--secondary-foreground)); box-shadow: 0 1px 2px rgb(0 0 0 / .08); }
.btn-green::before { background: hsl(var(--secondary) / .82); }

.btn-outline { border: 2px solid hsl(var(--foreground)); color: hsl(var(--foreground)); background: transparent; }
.btn-outline::before { background: hsl(var(--foreground)); }
.btn-outline:hover { color: hsl(var(--background)); }

.btn-white { background: #fff; color: hsl(var(--foreground)); border: 2px solid #fff; }
.btn-white::before { background: hsl(var(--primary)); }
.btn-white:hover { color: #fff; }

.btn-sm { height: 2.75rem; }
.btn-lg { height: 3.5rem; padding: 0 2.5rem; font-size: 1rem; }
.btn-wide { padding: 0 2rem; }
.btn svg { width: 1rem; height: 1rem; flex-shrink: 0; }

/* ---------------- Nav ---------------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  background: hsl(0 0% 100% / .95);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  border-bottom: 1px solid hsl(var(--border));
  transition: transform .3s ease;
}
.nav.is-hidden { transform: translateY(-100%); }
.nav-inner {
  max-width: var(--max); margin: 0 auto; padding: 0 1.5rem;
  height: var(--nav-h); display: flex; align-items: center; justify-content: space-between;
}
.nav-links { display: none; align-items: center; gap: 2rem; }
@media (min-width: 900px) { .nav-links { display: flex; } }

.nav-link {
  position: relative; font-size: .875rem; font-weight: 500;
  letter-spacing: .025em; text-transform: uppercase; color: hsl(var(--foreground));
}
.nav-link::after {
  content: ""; position: absolute; bottom: -2px; left: 0; width: 0; height: 2px;
  background: hsl(var(--primary)); transition: width .3s cubic-bezier(.4, 0, .2, 1);
}
.nav-link:hover::after { width: 100%; }

.lang-btn {
  font-size: .75rem; font-weight: 700; letter-spacing: .1em;
  border: 2px solid hsl(var(--border)); padding: .375rem .75rem;
  transition: border-color .3s ease;
}
.lang-btn:hover { border-color: hsl(var(--primary)); }

.nav-toggle { display: flex; flex-direction: column; gap: .375rem; padding: .5rem; }
@media (min-width: 900px) { .nav-toggle { display: none; } }
.nav-toggle span { display: block; width: 1.5rem; height: 2px; background: hsl(var(--foreground)); transition: transform .3s ease, opacity .3s ease; }
.nav-toggle.is-open span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.nav-toggle.is-open span:nth-child(2) { opacity: 0; }
.nav-toggle.is-open span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

.nav-mobile {
  display: none; flex-direction: column; gap: .25rem;
  padding: 1rem 1.5rem 1.5rem; border-top: 1px solid hsl(var(--border)); background: #fff;
}
.nav-mobile.is-open { display: flex; }
@media (min-width: 900px) { .nav-mobile.is-open { display: none; } }
.nav-mobile button, .nav-mobile a {
  text-align: left; padding: .75rem 0; font-size: .875rem; font-weight: 500;
  letter-spacing: .025em; text-transform: uppercase;
}
.nav-mobile .btn { margin-top: .5rem; }

/* ---------------- Logo ---------------- */
.logo { display: inline-flex; align-items: center; gap: .5rem; }
.logo-mark { width: 1.9rem; height: 1.9rem; flex-shrink: 0; }
.logo-name {
  display: block; font-size: 1.35rem; font-weight: 500;
  letter-spacing: -.01em; line-height: 1.05; white-space: nowrap;
}
.logo-name .lt-dark { color: #4d5759; }
.logo-name .lt-green { color: #7db142; }
.logo-sub {
  display: block; font-size: .38rem; letter-spacing: .01em;
  color: #9aa2ad; margin-top: .12rem; white-space: nowrap;
}
@media (min-width: 768px) {
  .logo-mark { width: 2.1rem; height: 2.1rem; }
  .logo-name { font-size: 1.5rem; }
  .logo-sub { font-size: .42rem; }
}
/* white variant (footer) */
.logo-inv .lt-dark { color: #fff; }
.logo-inv .lt-green { color: #fff; }
.logo-inv .logo-sub { color: hsl(0 0% 100% / .55); }
.logo-inv .logo-mark { color: #fff; }

/* ---------------- Hero ---------------- */
.hero { padding-top: var(--nav-h); }
.hero-grid { display: grid; grid-template-columns: 1fr; min-height: 90vh; }
@media (min-width: 1024px) { .hero-grid { grid-template-columns: 1fr 1fr; } }

.hero-copy { display: flex; flex-direction: column; justify-content: center; padding: 4rem 1.5rem; }
@media (min-width: 768px) { .hero-copy { padding: 4rem; } }
@media (min-width: 1024px) { .hero-copy { padding: 6rem 5rem; } }

.hero-copy .eyebrow { display: block; margin-bottom: 1.5rem; }
.hero h1 {
  font-family: var(--font-serif); font-size: 2.25rem; font-weight: 700;
  line-height: 1.15; margin-bottom: 1.5rem;
}
@media (min-width: 768px) { .hero h1 { font-size: 3rem; } }
@media (min-width: 1024px) { .hero h1 { font-size: 3.75rem; } }
.hero-lead {
  font-size: 1.125rem; color: hsl(var(--muted-foreground));
  line-height: 1.7; margin-bottom: 2.5rem; max-width: 32rem;
}
@media (min-width: 768px) { .hero-lead { font-size: 1.25rem; } }

.hero-actions { display: flex; flex-direction: column; gap: 1rem; }
@media (min-width: 640px) { .hero-actions { flex-direction: row; } }

.hero-media { position: relative; min-height: 400px; }
@media (min-width: 1024px) { .hero-media { min-height: 0; } }
.hero-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* ---------------- Who we serve ---------------- */
.serve-grid { display: grid; grid-template-columns: 1fr; }
@media (min-width: 768px) { .serve-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .serve-grid { grid-template-columns: repeat(4, 1fr); } }

.serve-card {
  position: relative; overflow: hidden;
  background: hsl(var(--card)); border: 1px solid hsl(var(--border));
  padding: 2rem; display: flex; flex-direction: column;
}
.serve-card::before {
  content: ""; position: absolute; inset: 0; background: hsl(var(--primary));
  transform: translateY(100%); transition: transform .5s cubic-bezier(.4, 0, .2, 1);
}
.serve-card:hover::before { transform: translateY(0); }
.serve-card > .serve-body { position: relative; z-index: 1; display: flex; flex-direction: column; flex: 1; }
.serve-num {
  font-family: var(--font-serif); font-size: 3rem; font-weight: 700; line-height: 1.1;
  color: hsl(var(--primary) / .2); margin-bottom: 1rem; transition: color .4s ease;
}
.serve-card h3 { font-size: 1.25rem; font-weight: 600; margin-bottom: .75rem; transition: color .4s ease; }
.serve-card p { font-size: .875rem; line-height: 1.7; color: hsl(var(--muted-foreground)); flex: 1; transition: color .4s ease; }
.serve-bar { margin-top: 1.5rem; width: 2rem; height: 2px; background: #fff; transition: background-color .4s ease; }
.serve-card:hover .serve-num { color: hsl(0 0% 100% / .35); }
.serve-card:hover h3 { color: #fff; }
.serve-card:hover p { color: hsl(0 0% 100% / .85); }

/* ---------------- Services ---------------- */
.svc-grid-2 { display: grid; grid-template-columns: 1fr; }
@media (min-width: 768px) { .svc-grid-2 { grid-template-columns: repeat(2, 1fr); } }

.svc-card { position: relative; overflow: hidden; border: 1px solid hsl(var(--border)); }
.svc-card .svc-img { aspect-ratio: 4 / 3; overflow: hidden; }
.svc-card .svc-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .7s cubic-bezier(.4, 0, .2, 1); }
.svc-card:hover .svc-img img { transform: scale(1.05); }
.svc-body { padding: 2rem; background: hsl(var(--card)); }
@media (min-width: 768px) { .svc-body { padding: 2.5rem; } }
.svc-body h3 { font-family: var(--font-serif); font-size: 1.5rem; font-weight: 700; margin-bottom: .75rem; }
.svc-body p { color: hsl(var(--muted-foreground)); line-height: 1.7; }

.svc-row { border: 1px solid hsl(var(--border)); background: hsl(var(--card)); display: flex; flex-direction: column; }
@media (min-width: 640px) { .svc-row { flex-direction: row; } }
.svc-row-img { overflow: hidden; flex-shrink: 0; }
@media (min-width: 640px) { .svc-row-img { width: 12rem; } }
@media (min-width: 768px) { .svc-row-img { width: 14rem; } }
.svc-row-img img { width: 100%; height: 12rem; object-fit: cover; }
@media (min-width: 640px) { .svc-row-img img { height: 100%; } }
.svc-row-body { padding: 2rem; display: flex; flex-direction: column; justify-content: center; }
.svc-row-body h3 { font-family: var(--font-serif); font-size: 1.25rem; font-weight: 700; margin-bottom: .5rem; }
.svc-row-body p { color: hsl(var(--muted-foreground)); line-height: 1.7; font-size: .875rem; }

/* ---------------- How it works ---------------- */
.dark-section { background: hsl(var(--foreground)); color: hsl(var(--background)); }
.how-grid { display: grid; grid-template-columns: 1fr; gap: 4rem; align-items: start; }
@media (min-width: 1024px) { .how-grid { grid-template-columns: repeat(2, 1fr); } }
.how-grid h2 { font-family: var(--font-serif); font-size: 1.875rem; font-weight: 700; line-height: 1.2; margin-bottom: 1.5rem; }
@media (min-width: 768px) { .how-grid h2 { font-size: 2.25rem; } }
.how-lead { color: hsl(var(--background) / .7); font-size: 1.125rem; line-height: 1.7; margin-bottom: 2.5rem; }
.how-grid .eyebrow { display: block; margin-bottom: 1rem; }

.steps { display: flex; flex-direction: column; }
.step {
  position: relative; overflow: hidden;
  border: 1px solid hsl(var(--background) / .2); padding: 2rem;
}
.step::before {
  content: ""; position: absolute; inset: 0; background: hsl(var(--primary) / .15);
  opacity: 0; transition: opacity .4s ease;
}
.step::after {
  content: ""; position: absolute; left: 0; top: 0; width: 2px; height: 0;
  background: hsl(var(--primary)); transition: height .4s ease;
}
.step:hover::before { opacity: 1; }
.step:hover::after { height: 100%; }
.step-body { position: relative; z-index: 1; display: flex; gap: 1.5rem; }
.step-num { font-family: var(--font-serif); font-size: 2.25rem; font-weight: 700; flex-shrink: 0; line-height: 1.2; }
.step h3 { font-size: 1.25rem; font-weight: 600; margin-bottom: .5rem; }
.step p { font-size: .875rem; line-height: 1.7; color: hsl(var(--background) / .6); }

/* ---------------- Apply band ---------------- */
.apply-grid { display: grid; grid-template-columns: 1fr; min-height: 500px; }
@media (min-width: 1024px) { .apply-grid { grid-template-columns: 1fr 1fr; } }
.apply-media { position: relative; min-height: 300px; }
.apply-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.apply-copy {
  background: hsl(var(--primary)); color: hsl(var(--primary-foreground));
  display: flex; flex-direction: column; justify-content: center; padding: 5rem 1.5rem;
}
@media (min-width: 768px) { .apply-copy { padding: 5rem 4rem; } }
@media (min-width: 1024px) { .apply-copy { padding: 5rem; } }
.apply-copy h2 { font-family: var(--font-serif); font-size: 1.875rem; font-weight: 700; line-height: 1.2; margin-bottom: 1.5rem; }
@media (min-width: 768px) { .apply-copy h2 { font-size: 2.25rem; } }
.apply-copy p { color: hsl(var(--primary-foreground) / .8); font-size: 1.125rem; line-height: 1.7; margin-bottom: 2.5rem; max-width: 32rem; }
.apply-copy .btn { align-self: flex-start; }

/* ---------------- Contact ---------------- */
.contact-grid { display: grid; grid-template-columns: 1fr; gap: 4rem; align-items: center; }
@media (min-width: 1024px) { .contact-grid { grid-template-columns: repeat(2, 1fr); } }
.contact-media { position: relative; }
.contact-media img { width: 100%; height: 420px; object-fit: cover; }
.contact-media::after {
  content: ""; position: absolute; bottom: -1.5rem; right: -1.5rem;
  width: 8rem; height: 8rem; background: hsl(var(--primary) / .15); z-index: -1; display: none;
}
@media (min-width: 1024px) { .contact-media::after { display: block; } }
.contact-copy .eyebrow { display: block; margin-bottom: 1rem; }
.contact-copy h2 { font-family: var(--font-serif); font-size: 1.875rem; font-weight: 700; line-height: 1.2; margin-bottom: 1.5rem; }
@media (min-width: 768px) { .contact-copy h2 { font-size: 2.25rem; } }
.contact-copy > p { color: hsl(var(--muted-foreground)); font-size: 1.125rem; line-height: 1.7; margin-bottom: 2.5rem; }
.contact-actions { display: flex; flex-direction: column; gap: 1rem; flex-wrap: wrap; }
@media (min-width: 640px) { .contact-actions { flex-direction: row; } }
.contact-actions .btn { width: 100%; }
@media (min-width: 640px) { .contact-actions .btn { width: auto; } }

/* ---------------- Mission ---------------- */
.mission { max-width: 56rem; margin: 0 auto; padding: 0 1.5rem; text-align: center; }
@media (min-width: 768px) { .mission { padding: 0 4rem; } }
.mission .eyebrow { display: block; margin-bottom: 2rem; }
.mission blockquote {
  font-family: var(--font-serif); font-size: 1.5rem; font-weight: 500;
  line-height: 1.35; margin-bottom: 2rem;
}
@media (min-width: 768px) { .mission blockquote { font-size: 1.875rem; } }
@media (min-width: 1024px) { .mission blockquote { font-size: 2.25rem; } }
.mission-rule { width: 4rem; height: 2px; background: hsl(var(--primary)); margin: 0 auto 1.5rem; }
.mission p { color: hsl(var(--muted-foreground)); }
.mission p + p { font-size: .875rem; margin-top: .25rem; }

/* ---------------- Footer ---------------- */
.footer { background: hsl(var(--foreground)); color: hsl(var(--background)); padding: 4rem 0; }
.footer-grid { display: grid; grid-template-columns: 1fr; gap: 3rem; margin-bottom: 3rem; }
@media (min-width: 768px) { .footer-grid { grid-template-columns: repeat(3, 1fr); } }
.footer .logo { margin-bottom: 1.5rem; }
.footer-about { color: hsl(var(--background) / .6); font-size: .875rem; line-height: 1.7; }
.footer h4 { font-size: .875rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 1.5rem; }
.footer-links { display: flex; flex-direction: column; gap: .75rem; align-items: flex-start; }
.footer-link { position: relative; display: inline-block; font-size: .875rem; color: hsl(var(--background) / .7); transition: color .3s ease; }
.footer-link::before {
  content: ""; position: absolute; bottom: 0; left: 0; width: 0; height: 1px;
  background: hsl(var(--primary)); transition: width .3s cubic-bezier(.4, 0, .2, 1);
}
.footer-link:hover { color: hsl(var(--primary)); }
.footer-link:hover::before { width: 100%; }
.footer-contact { display: flex; flex-direction: column; gap: .75rem; align-items: flex-start; }
.footer-bottom {
  border-top: 1px solid hsl(var(--background) / .1); padding-top: 2rem;
  display: flex; flex-direction: column; align-items: center; gap: 1rem;
}
@media (min-width: 768px) { .footer-bottom { flex-direction: row; justify-content: space-between; } }
.footer-bottom p, .footer-bottom a { font-size: .75rem; color: hsl(var(--background) / .4); }
.footer-legal { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; justify-content: center; }

/* ---------------- Enroll page ---------------- */
.enroll-main { padding-top: var(--nav-h); }
.enroll-frame { width: 100%; height: 100vh; border: 0; background: hsl(var(--background)); display: block; }

/* ---------------- Privacy page ---------------- */
.legal { padding-top: calc(var(--nav-h) + 4rem); padding-bottom: 6rem; }
.legal-inner { max-width: 48rem; margin: 0 auto; padding: 0 1.5rem; }
.legal h1 { font-family: var(--font-serif); font-size: 2.25rem; font-weight: 700; margin-bottom: 2rem; }
@media (min-width: 768px) { .legal h1 { font-size: 3rem; } }
.legal h2 { font-family: var(--font-serif); font-size: 1.5rem; font-weight: 700; margin-bottom: 1.5rem; }
.legal p { color: hsl(var(--muted-foreground)); line-height: 1.8; margin-bottom: 1.5rem; }

/* ---------------- Reveal on scroll ----------------
   The hidden state is scoped to html.js, which is set by an inline
   script in <head>. If JS is disabled or fails, every .reveal block
   stays plainly visible instead of vanishing. */
html.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s cubic-bezier(.4, 0, .2, 1); }
html.js .reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  html.js .reveal { opacity: 1; transform: none; transition: none; }
  * { animation: none !important; }
}
