/* CertainCensus site styles. Brand: BRAND-GUIDE.md (navy / emerald / sand, Manrope, radial glow motif). */

:root {
  --navy: #13293D;
  --ink: #0E1620;
  --card: #16324A;
  --emerald: #1FA971;
  --emerald-strong: #17905F;
  --emerald-soft: rgba(31, 169, 113, 0.14);
  --sand: #F5EFE6;
  --paper: #FFFDF9;
  --slate: #56697A;
  --light: #CDD6DF;
  --amber: #E0A23C;
  --line-dark: rgba(205, 214, 223, 0.14);
  --line-light: #E7DFD3;

  --font: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-read: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 24px 60px -24px rgba(5, 12, 20, 0.55);
  --shadow-light: 0 18px 50px -28px rgba(19, 41, 61, 0.35);
  --gutter: clamp(16px, 4vw, 32px);
  --header-h: 72px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; animation: none !important; } }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  color: var(--light);
  background: var(--navy);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3 { font-weight: 800; line-height: 1.12; letter-spacing: -0.02em; color: #fff; margin: 0 0 0.5em; text-wrap: balance; }
p { margin: 0 0 1em; }

.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 var(--gutter); }
.container--narrow { max-width: 780px; }
.container--wide { max-width: 1040px; }
.center { text-align: center; }
.muted { color: var(--slate); font-size: 0.94rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 16px; top: -60px; z-index: 100; background: var(--emerald); color: var(--ink); padding: 10px 16px; border-radius: 8px; font-weight: 700; text-decoration: none; }
.skip-link:focus { top: 12px; }
:focus-visible { outline: 3px solid var(--emerald); outline-offset: 3px; border-radius: 6px; }

.eyebrow { display: inline-block; font-size: 0.78rem; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: var(--emerald); margin-bottom: 14px; }
.eyebrow--pill { padding: 7px 14px; border-radius: 999px; background: var(--emerald-soft); border: 1px solid rgba(31, 169, 113, 0.35); letter-spacing: 0.1em; }
.h3 { font-size: 1.3rem; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-family: var(--font); font-weight: 800; text-decoration: none; text-align: center;
  border-radius: 999px; border: 2px solid transparent; cursor: pointer;
  transition: transform 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease, color 0.18s ease;
}
.btn svg { flex: none; transition: transform 0.18s ease; }
.btn:hover svg { transform: translateX(3px); }
.btn--primary { background: var(--emerald); color: #04130C; box-shadow: 0 12px 30px -12px rgba(31, 169, 113, 0.8); }
.btn--primary:hover { background: #25BD7F; transform: translateY(-1px); }
.btn--ghost { border-color: rgba(205, 214, 223, 0.35); color: #fff; }
.btn--ghost:hover { border-color: var(--emerald); color: var(--emerald); }
.btn--sm { padding: 10px 18px; font-size: 0.92rem; }
.btn--lg { padding: 17px 28px; font-size: 1.04rem; }
@media (max-width: 420px) { .btn--lg { padding: 15px 20px; font-size: 0.95rem; } }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(14, 22, 32, 0.88);
  backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line-dark);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: var(--header-h); gap: 24px; }
.brand img { width: 190px; height: auto; }
.site-nav { display: flex; align-items: center; gap: 28px; }
.site-nav ul { display: flex; gap: 6px; list-style: none; margin: 0; padding: 0; }
.site-nav li a { display: block; padding: 8px 14px; border-radius: 999px; text-decoration: none; font-weight: 600; font-size: 0.96rem; color: var(--light); transition: color 0.15s, background-color 0.15s; }
.site-nav li a:hover { color: #fff; background: rgba(255, 255, 255, 0.06); }
.site-nav li a[aria-current="page"] { color: #fff; background: rgba(31, 169, 113, 0.16); }
.nav-toggle { display: none; }

@media (max-width: 960px) {
  .nav-cta { display: none; }
}
@media (max-width: 760px) {
  .brand img { width: 168px; }
  .nav-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line-dark); background: transparent; cursor: pointer;
  }
  .bars, .bars::before, .bars::after { display: block; width: 20px; height: 2px; background: #fff; border-radius: 2px; position: relative; transition: transform 0.2s, background-color 0.2s; }
  .bars::before, .bars::after { content: ''; position: absolute; left: 0; }
  .bars::before { top: -6px; } .bars::after { top: 6px; }
  .nav-toggle[aria-expanded="true"] .bars { background: transparent; }
  .nav-toggle[aria-expanded="true"] .bars::before { transform: translateY(6px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] .bars::after { transform: translateY(-6px) rotate(-45deg); }
  .site-nav {
    position: fixed; inset: var(--header-h) 0 auto 0; flex-direction: column; align-items: stretch; gap: 16px;
    padding: 16px var(--gutter) 28px; background: var(--ink); border-bottom: 1px solid var(--line-dark);
    transform: translateY(-8px); opacity: 0; visibility: hidden; transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
  }
  .site-nav.is-open { transform: none; opacity: 1; visibility: visible; }
  .site-nav ul { flex-direction: column; gap: 2px; }
  .site-nav li a { padding: 14px 12px; font-size: 1.05rem; border-radius: 12px; }
  .nav-cta { display: inline-flex; padding: 14px 18px; }
}

/* ---------- hero ---------- */
.hero {
  position: relative; overflow: hidden; isolation: isolate;
  background:
    radial-gradient(circle at 88% 30%, rgba(31, 169, 113, 0.5), rgba(19, 41, 61, 0) 58%),
    radial-gradient(circle at 8% 110%, rgba(31, 169, 113, 0.22), rgba(19, 41, 61, 0) 50%),
    var(--navy);
}
.hero::after {
  content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: linear-gradient(rgba(205, 214, 223, 0.05) 1px, transparent 1px), linear-gradient(90deg, rgba(205, 214, 223, 0.05) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse at 50% 40%, #000 20%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 40%, #000 20%, transparent 70%);
}
.hero-inner { padding: clamp(72px, 12vw, 140px) var(--gutter) clamp(64px, 10vw, 120px); text-align: center; }
.hero h1 { font-size: clamp(2.1rem, 5.6vw, 4.1rem); max-width: 17ch; margin: 0 auto 0.6em; }
.hero--home h1 { max-width: 23ch; hyphens: none; }
.hero--page .hero-inner { padding: clamp(56px, 9vw, 104px) var(--gutter) clamp(48px, 7vw, 84px); }
.hero--page h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); margin-bottom: 0.2em; }
.hero-sub { max-width: 46ch; margin: 0 auto; font-size: 1.12rem; color: var(--light); }
.hero-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 14px; margin-top: 10px; }
.hero-points { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; list-style: none; padding: 0; margin: 44px 0 0; }
.hero-points a {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 999px; text-decoration: none;
  font-size: 0.9rem; font-weight: 600; color: var(--light); border: 1px solid var(--line-dark); background: rgba(14, 22, 32, 0.35);
}
.hero-points a::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--emerald); }
.hero-points a:hover { color: #fff; border-color: rgba(31, 169, 113, 0.5); }

/* ---------- sections ---------- */
.section { padding: clamp(72px, 10vw, 120px) 0; }
.section-head { text-align: center; margin-bottom: clamp(40px, 6vw, 72px); }
.section-head h2 { font-size: clamp(1.9rem, 4vw, 2.8rem); }

.section--services {
  background:
    radial-gradient(circle at 0% 20%, rgba(31, 169, 113, 0.18), rgba(19, 41, 61, 0) 45%),
    radial-gradient(circle at 100% 85%, rgba(31, 169, 113, 0.16), rgba(19, 41, 61, 0) 45%),
    var(--ink);
}
.svc-list { display: grid; gap: clamp(28px, 4vw, 40px); margin-bottom: 56px; }
.svc {
  display: grid; grid-template-columns: 1fr 1.1fr; align-items: center; gap: clamp(24px, 5vw, 64px);
  padding: clamp(20px, 3vw, 28px); border-radius: calc(var(--radius) + 6px);
  background: linear-gradient(180deg, rgba(22, 50, 74, 0.7), rgba(22, 50, 74, 0.35));
  border: 1px solid var(--line-dark);
}
.svc:nth-child(even) .svc-media { order: 2; }
.svc-media { border-radius: var(--radius); overflow: hidden; background: #1F2129; aspect-ratio: 4 / 3; display: grid; place-items: center; }
.svc-media img { width: 100%; height: 100%; object-fit: contain; padding: 8%; }
.svc-body { padding: 8px clamp(4px, 2vw, 20px) 8px 0; }
.svc:nth-child(even) .svc-body { padding: 8px 0 8px clamp(4px, 2vw, 20px); }
.svc-num { display: inline-block; font-weight: 800; font-size: 0.85rem; color: var(--emerald); letter-spacing: 0.1em; margin-bottom: 10px; }
.svc h2 { font-size: clamp(1.45rem, 2.6vw, 2rem); }
.svc p { color: var(--light); }
.svc p:last-child { margin-bottom: 0; }
@media (max-width: 800px) {
  .svc { grid-template-columns: 1fr; }
  .svc:nth-child(even) .svc-media { order: 0; }
  .svc-body, .svc:nth-child(even) .svc-body { padding: 4px 6px 8px; }
}

.section--about { background: var(--sand); color: var(--slate); }
.section--about h2 { color: var(--ink); font-size: clamp(1.9rem, 4vw, 2.7rem); }
.about-card {
  display: grid; grid-template-columns: minmax(220px, 360px) 1fr; gap: clamp(32px, 6vw, 72px); align-items: center;
  background: var(--paper); border: 1px solid var(--line-light); border-radius: calc(var(--radius) + 10px);
  padding: clamp(28px, 5vw, 64px); box-shadow: var(--shadow-light);
}
.about-photo { position: relative; }
/* brand ring: emerald, open at top-left like the logo mark */
.about-photo::before { content: ''; position: absolute; inset: -12px; border-radius: 50%; border: 3px solid var(--emerald); border-top-color: transparent; transform: rotate(-25deg); }
.about-photo img { border-radius: 50%; aspect-ratio: 1; object-fit: cover; width: 100%; }
.lead { font-size: 1.14rem; line-height: 1.75; color: #3E5163; margin-bottom: 1.6em; }
@media (max-width: 760px) {
  .about-card { grid-template-columns: 1fr; text-align: center; }
  .about-photo { max-width: 240px; margin: 0 auto; }
}

/* ---------- contact ---------- */
.section--contact { background: var(--sand); color: var(--slate); padding-top: clamp(48px, 7vw, 88px); }
.contact-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: clamp(24px, 4vw, 40px); align-items: start; }
.form-card { background: #fff; border: 1px solid var(--line-light); border-radius: calc(var(--radius) + 6px); padding: clamp(20px, 4vw, 40px); box-shadow: var(--shadow-light); }
.form-card h2 { color: var(--ink); font-size: clamp(1.6rem, 3vw, 2.1rem); margin-bottom: 0.6em; }
.form-card iframe { min-height: 1040px; display: block; }
.contact-card { position: sticky; top: calc(var(--header-h) + 24px); background: var(--navy); color: var(--light); border-radius: calc(var(--radius) + 6px); padding: clamp(24px, 4vw, 36px); box-shadow: var(--shadow); background-image: radial-gradient(circle at 100% 0%, rgba(31, 169, 113, 0.35), rgba(19, 41, 61, 0) 60%); }
.contact-list { list-style: none; padding: 0; margin: 0 0 24px; display: grid; gap: 18px; }
.contact-list li { display: flex; gap: 14px; align-items: flex-start; }
.contact-list svg { flex: none; color: var(--emerald); margin-top: 3px; }
.contact-list a { color: #fff; text-decoration: none; font-weight: 600; }
.contact-list a:hover { color: var(--emerald); }
.contact-list strong { color: #fff; }
.contact-card .muted { color: var(--light); opacity: 0.8; margin: 0; }
.contact-card .muted a { color: #fff; }
@media (max-width: 900px) { .contact-grid { grid-template-columns: 1fr; } .contact-card { position: static; } }

.section--steps { background: var(--ink); background-image: radial-gradient(circle at 50% 0%, rgba(31, 169, 113, 0.22), rgba(19, 41, 61, 0) 55%); }
.section--steps .section-head h2 { font-size: clamp(1.7rem, 3.6vw, 2.4rem); }
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.steps li { background: linear-gradient(180deg, rgba(22, 50, 74, 0.8), rgba(22, 50, 74, 0.4)); border: 1px solid var(--line-dark); border-radius: calc(var(--radius) + 4px); padding: 28px; }
.steps h3 { font-size: 1.2rem; margin: 16px 0 8px; }
.steps p { margin: 0; color: var(--light); }
.steps a { color: #fff; font-weight: 700; }
.step-num { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--emerald); color: #04130C; font-weight: 800; }
@media (max-width: 860px) { .steps { grid-template-columns: 1fr; } }

/* ---------- prose (legal + articles) ---------- */
.legal-wrap { background: var(--sand); padding: clamp(40px, 7vw, 88px) 0 clamp(64px, 9vw, 112px); }
.legal {
  background: var(--paper); border: 1px solid var(--line-light); border-radius: calc(var(--radius) + 6px);
  padding: clamp(28px, 6vw, 64px); box-shadow: var(--shadow-light);
}
.prose { color: #3B4C5C; font-family: var(--font-read); font-size: 1.04rem; line-height: 1.75; overflow-wrap: anywhere; }
.prose h1, .prose h2, .prose h3 { color: var(--ink); font-family: var(--font); }
.prose h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); margin-bottom: 0.3em; }
.prose h2 { font-size: clamp(1.25rem, 2.4vw, 1.55rem); margin: 2em 0 0.6em; }
.prose h3 { font-size: 1.15rem; margin: 1.6em 0 0.5em; }
.prose p { margin: 0 0 0.85em; }
.prose a { color: var(--emerald-strong); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.prose a:hover { color: var(--navy); }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1.1em; }
.prose li { margin: 0.35em 0; }
.prose li::marker { color: var(--emerald); }
.prose blockquote { margin: 1.6em 0; padding: 18px 22px; border-left: 4px solid var(--emerald); background: rgba(31, 169, 113, 0.07); border-radius: 0 12px 12px 0; color: var(--navy); font-weight: 500; }
.prose blockquote p:last-child { margin: 0; }
.prose img, .prose figure img { border-radius: var(--radius-sm); }
.prose figure { margin: 1.8em 0; }
.prose figcaption { font-size: 0.88rem; color: var(--slate); margin-top: 8px; text-align: center; }
.prose table { width: 100%; border-collapse: collapse; margin: 1.4em 0; font-size: 0.96rem; display: block; overflow-x: auto; }
.prose th, .prose td { border-bottom: 1px solid var(--line-light); padding: 10px 12px; text-align: left; }
.prose th { color: var(--ink); font-family: var(--font); }
.prose code { background: #EFE8DC; padding: 2px 6px; border-radius: 6px; font-size: 0.9em; }
.prose hr { border: 0; border-top: 1px solid var(--line-light); margin: 2.4em 0; }
.legal h1 + p { color: var(--slate); font-size: 0.95rem; }
.legal h2 { padding-top: 1.4em; border-top: 1px solid var(--line-light); margin-top: 1.6em; }

/* ---------- blog ---------- */
.section--blog, .section--related { background: var(--sand); color: var(--slate); }
.section--related h2 { color: var(--ink); margin-bottom: 28px; }
.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 28px; }
.empty-state { text-align: center; background: var(--paper); border: 1px dashed var(--line-light); border-radius: calc(var(--radius) + 6px); padding: clamp(32px, 6vw, 64px); }
.empty-state h2 { color: var(--ink); }
.post-card {
  display: flex; flex-direction: column; background: var(--paper); border: 1px solid var(--line-light); border-radius: calc(var(--radius) + 4px);
  overflow: hidden; box-shadow: var(--shadow-light); transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.post-card:hover { transform: translateY(-3px); box-shadow: 0 26px 60px -30px rgba(19, 41, 61, 0.5); }
.post-card-media img { aspect-ratio: 1200 / 630; object-fit: cover; width: 100%; }
.post-card-body { padding: 24px 26px 28px; display: flex; flex-direction: column; flex: 1; }
.post-card h2 { font-size: 1.3rem; color: var(--ink); margin-bottom: 0.4em; }
.post-card h2 a { text-decoration: none; }
.post-card h2 a:hover { color: var(--emerald-strong); }
.post-card p { color: var(--slate); }
.post-card .text-link { margin-top: auto; }
.text-link { color: var(--emerald-strong); font-weight: 700; text-decoration: none; }
.text-link:hover { text-decoration: underline; }
.post-meta { font-size: 0.86rem; color: var(--slate); display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-bottom: 10px; }
.tag { display: inline-block; padding: 3px 10px; border-radius: 999px; background: var(--emerald-soft); color: var(--emerald-strong); font-weight: 700; font-size: 0.78rem; }
.draft { color: #B4541F; }

.page-article main { background: var(--sand); }
.article-hero { background: var(--sand); padding: clamp(36px, 6vw, 72px) 0 clamp(20px, 3vw, 32px); }
.article-hero h1 { color: var(--ink); font-size: clamp(2rem, 4.6vw, 3.1rem); margin: 0.2em 0 0.4em; }
.article-hero .eyebrow--pill { color: var(--emerald-strong); }
.article-hero .post-meta { margin-top: 18px; }
.article-dek { font-size: 1.2rem; line-height: 1.6; color: #3E5163; max-width: 60ch; }
.breadcrumbs { display: flex; gap: 8px; font-size: 0.88rem; color: var(--slate); margin-bottom: 22px; }
.breadcrumbs a { color: var(--slate); text-decoration: none; font-weight: 600; }
.breadcrumbs a:hover { color: var(--emerald-strong); }
.article-cover { margin: 8px auto 40px; }
.article-cover img { border-radius: calc(var(--radius) + 6px); box-shadow: var(--shadow-light); width: 100%; }
.article-body { background: var(--paper); border: 1px solid var(--line-light); border-radius: calc(var(--radius) + 6px); padding: clamp(24px, 5vw, 56px); box-shadow: var(--shadow-light); }
.article-body > :first-child { margin-top: 0; }
.faq { margin-top: 40px; }
.faq h2 { margin-top: 0; }
.faq details { background: var(--paper); border: 1px solid var(--line-light); border-radius: var(--radius-sm); padding: 4px 20px; margin-bottom: 12px; }
.faq summary { cursor: pointer; font-family: var(--font); font-weight: 700; color: var(--ink); padding: 14px 0; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; color: var(--emerald); font-size: 1.4rem; line-height: 1; }
.faq details[open] summary::after { content: '–'; }
.article-cta {
  display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
  margin: 48px 0 clamp(64px, 9vw, 104px); padding: clamp(24px, 4vw, 40px); border-radius: calc(var(--radius) + 6px);
  background: radial-gradient(circle at 95% 10%, rgba(31, 169, 113, 0.45), rgba(19, 41, 61, 0) 60%), var(--navy); color: var(--light);
}
.article-cta-title { font-size: 1.35rem; font-weight: 800; color: #fff; margin-bottom: 0.3em; }
.article-cta p:last-child { margin: 0; }

/* ---------- footer ---------- */
.site-footer { background: var(--ink); color: var(--light); padding: clamp(56px, 8vw, 88px) 0 0; border-top: 1px solid var(--line-dark); }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1.2fr 0.8fr 0.8fr; gap: 40px; }
.footer-brand img { width: 200px; margin-bottom: 18px; }
.footer-brand p { max-width: 34ch; font-size: 0.95rem; opacity: 0.85; margin-bottom: 20px; }
.footer-title { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.14em; color: #fff; margin-bottom: 18px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; font-size: 0.95rem; }
.site-footer ul a { text-decoration: none; opacity: 0.85; }
.site-footer ul a:hover { opacity: 1; color: var(--emerald); }
.footer-contact span { color: #fff; font-weight: 700; }
.footer-bottom { border-top: 1px solid var(--line-dark); margin-top: 56px; padding-top: 22px; padding-bottom: 28px; font-size: 0.88rem; opacity: 0.7; }
.footer-bottom p { margin: 0; }
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-brand { grid-column: 1 / -1; } }
@media (max-width: 520px) { .footer-grid { grid-template-columns: 1fr; } }
