/* =========================================================
   ServeFirst Legal LLC — Design System
   Palette sampled from brand logo:
   charcoal navy #2A303C · gold #CCA230 · evergreen #18482A
   ========================================================= */

:root,
[data-theme='light'] {
  /* Brand — from logo artwork */
  --navy-900: #1B1F27;
  --navy-800: #22272F;
  --navy-700: #2A303C;
  --navy-600: #3A4150;
  --navy-500: #4C5566;

  --gold-600: #8A6914;
  --gold-500: #B8901F;
  --gold-400: #CCA230;
  --gold-300: #DDBB5E;

  --green-700: #18482A;
  --green-500: #256B3E;

  --slate-900: #1E232B;
  --slate-700: #3F4652;
  --slate-500: #64748B;
  --slate-400: #94A3B8;
  --slate-300: #CBD5E1;
  --slate-200: #E2E8F0;
  --slate-100: #F1F5F9;

  --white: #ffffff;

  /* Semantic */
  --color-bg: var(--white);
  --color-surface: var(--white);
  --color-surface-offset: var(--slate-100);
  --color-section-dark: var(--navy-700);

  --color-text: var(--slate-900);
  --color-text-muted: var(--slate-500);
  --color-text-on-dark: #EEF1F5;
  --color-text-on-dark-muted: #B9C0CC;

  --color-border: var(--slate-200);
  --color-border-dark: rgba(255, 255, 255, 0.14);

  --color-primary: var(--navy-700);
  --color-primary-hover: var(--navy-600);
  --color-accent: var(--gold-400);
  --color-accent-text: var(--gold-600);

  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1.25rem;
  --radius-full: 999px;

  --shadow-sm: 0 1px 2px rgba(27, 31, 39, 0.06);
  --shadow-md: 0 6px 20px rgba(27, 31, 39, 0.10);
  --shadow-lg: 0 20px 48px rgba(27, 31, 39, 0.18);

  --transition-interactive: 180ms cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme='dark'] {
  --color-bg: #14181F;
  --color-surface: #1B2029;
  --color-surface-offset: #181D25;
  --color-section-dark: #10141A;

  --color-text: #E8ECF2;
  --color-text-muted: #9AA4B2;
  --color-text-on-dark: #E8ECF2;
  --color-text-on-dark-muted: #9AA4B2;

  --color-border: rgba(255, 255, 255, 0.10);
  --color-border-dark: rgba(255, 255, 255, 0.10);

  --color-primary: var(--gold-400);
  --color-primary-hover: var(--gold-300);
  --color-accent-text: var(--gold-300);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 6px 20px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 20px 48px rgba(0, 0, 0, 0.6);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --font-display: 'Libre Caslon Text', Georgia, serif;
  --font-body: 'Inter', 'Helvetica Neue', Arial, sans-serif;

  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm: clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1rem + 0.7vw, 1.4rem);
  --text-xl: clamp(1.5rem, 1.2rem + 1.25vw, 2.25rem);
  --text-2xl: clamp(2rem, 1.2rem + 2.5vw, 3.25rem);
  --text-hero: clamp(2.5rem, 1.2rem + 4.2vw, 4.75rem);

  --space-1: 0.25rem;  --space-2: 0.5rem;   --space-3: 0.75rem;
  --space-4: 1rem;     --space-5: 1.25rem;  --space-6: 1.5rem;
  --space-8: 2rem;     --space-10: 2.5rem;  --space-12: 3rem;
  --space-16: 4rem;    --space-20: 5rem;    --space-24: 6rem;
}

html {
  -webkit-text-size-adjust: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
  scroll-padding-top: 6rem;
}

body {
  min-height: 100dvh;
  line-height: 1.6;
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-text);
  background: var(--color-bg);
}

img, svg { display: block; max-width: 100%; height: auto; }
ul, ol { list-style: none; }
input, button, textarea, select { font: inherit; color: inherit; }

h1, h2, h3, h4 {
  text-wrap: balance;
  line-height: 1.12;
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.015em;
}
p, li { text-wrap: pretty; max-width: 68ch; }

a { color: var(--color-primary); text-decoration: none; transition: color var(--transition-interactive); }
a:hover { color: var(--color-primary-hover); }

::selection { background: rgba(204, 162, 48, 0.3); }
:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 3px; border-radius: var(--radius-sm); }
button { cursor: pointer; background: none; border: none; }

a, button, input, textarea, select {
  transition: color var(--transition-interactive), background var(--transition-interactive),
              border-color var(--transition-interactive), box-shadow var(--transition-interactive),
              transform var(--transition-interactive);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important;
  }
}

.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;
}

/* ---------- Layout ---------- */
.container { width: 100%; max-width: 1140px; margin-inline: auto; padding-inline: clamp(var(--space-5), 4vw, var(--space-10)); }
.section { padding-block: clamp(var(--space-12), 6vw, var(--space-20)); }
.section--tight { padding-block: clamp(var(--space-10), 4.5vw, var(--space-16)); }
.section--dark { background: var(--color-section-dark); color: var(--color-text-on-dark); }
.section--dark h2, .section--dark h3 { color: #fff; }
.section--offset { background: var(--color-surface-offset); }

.eyebrow {
  display: inline-flex; align-items: center; gap: var(--space-2);
  font-family: var(--font-body); font-size: var(--text-xs); font-weight: 700;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--color-accent-text);
}
.eyebrow::before { content: ''; width: 1.75rem; height: 2px; background: var(--color-accent); }
.section--dark .eyebrow { color: var(--gold-400); }

.section-title { font-size: var(--text-xl); margin-top: var(--space-3); max-width: 20ch; }
.section-lede { margin-top: var(--space-3); color: var(--color-text-muted); max-width: 58ch; }
.section--dark .section-lede { color: var(--color-text-on-dark-muted); }
.center { text-align: center; }
.center .section-title, .center .section-lede { margin-inline: auto; }
.center p { margin-inline: auto; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in oklab, var(--color-bg) 90%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: var(--space-6); height: 5.25rem; }

.brand { display: inline-flex; align-items: center; gap: var(--space-3); color: var(--color-text); }
.brand:hover { color: var(--color-text); }
.brand-mark { width: auto; height: 46px; flex: none; }
.brand-name {
  font-family: var(--font-body); font-weight: 800; font-size: 1.22rem;
  letter-spacing: -0.015em; line-height: 1; text-transform: uppercase; white-space: nowrap;
}
.brand-name span {
  display: block; font-size: 0.62rem; font-weight: 600; letter-spacing: 0.3em;
  color: var(--color-accent-text); margin-top: 5px;
}
.site-footer .brand-mark { height: 56px; }
.site-footer .brand-name { font-size: 1.35rem; color: #fff; }
@media (max-width: 640px) {
  .brand-mark { height: 38px; }
  .brand-name { font-size: 1.02rem; }
  .site-footer .brand-mark { height: 48px; }
}

.main-nav { display: flex; align-items: center; gap: var(--space-8); }
.main-nav a { font-size: var(--text-sm); font-weight: 500; color: var(--color-text); position: relative; }
.main-nav a:hover { color: var(--color-accent-text); }
.main-nav a.active::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -6px; height: 2px; background: var(--color-accent);
}

.header-actions { display: flex; align-items: center; gap: var(--space-3); }
.theme-toggle {
  width: 40px; height: 40px; display: grid; place-items: center;
  border-radius: var(--radius-full); color: var(--color-text-muted); border: 1px solid var(--color-border);
}
.theme-toggle:hover { color: var(--color-text); border-color: var(--color-accent); }
.nav-toggle { display: none; width: 40px; height: 40px; place-items: center; border-radius: var(--radius-sm); color: var(--color-text); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  font-size: var(--text-sm); font-weight: 700; letter-spacing: 0.01em;
  padding: 0.9rem 1.6rem; border-radius: var(--radius-sm); border: 1px solid transparent; cursor: pointer; white-space: nowrap;
}
.btn svg { width: 1.05em; height: 1.05em; }

/* gold = primary CTA, charcoal text for contrast */
.btn--primary { background: var(--color-accent); color: #22272F; box-shadow: var(--shadow-sm); }
.btn--primary:hover { background: var(--gold-300); color: #1B1F27; transform: translateY(-1px); box-shadow: var(--shadow-md); }

.btn--dark { background: var(--navy-700); color: #fff; }
.btn--dark:hover { background: var(--navy-600); color: #fff; transform: translateY(-1px); }

.btn--ghost { background: transparent; color: var(--color-text); border-color: var(--color-border); }
.btn--ghost:hover { border-color: var(--color-accent); color: var(--color-accent-text); }

.btn--outline-light { background: transparent; color: #fff; border-color: rgba(255,255,255,0.35); }
.btn--outline-light:hover { border-color: #fff; background: rgba(255,255,255,0.08); color: #fff; }

.btn--lg { padding: 1.05rem 2rem; font-size: var(--text-base); }

/* ---------- Hero (centered, no map) ---------- */
.hero {
  position: relative; background: var(--navy-700); color: var(--color-text-on-dark);
  overflow: hidden; padding-block: clamp(var(--space-16), 8vw, var(--space-24));
  text-align: center;
}
.hero::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(900px 480px at 50% 0%, rgba(204, 162, 48, 0.16), transparent 62%),
    radial-gradient(700px 420px at 85% 100%, rgba(24, 72, 42, 0.30), transparent 60%);
}
.hero .container { position: relative; }
.hero h1 {
  font-size: var(--text-hero); font-weight: 700; color: #fff;
  margin-top: var(--space-5); margin-inline: auto; max-width: 16ch; letter-spacing: -0.03em;
}
.hero .lede {
  margin: var(--space-6) auto 0; color: var(--color-text-on-dark-muted);
  font-size: var(--text-lg); max-width: 60ch;
}
.hero .sub {
  margin: var(--space-4) auto 0; color: var(--color-text-on-dark-muted);
  font-size: var(--text-sm); max-width: 66ch; opacity: 0.9;
}
.hero-actions { margin-top: var(--space-8); display: flex; flex-wrap: wrap; gap: var(--space-3); justify-content: center; }
.hero-badge {
  display: inline-flex; align-items: center; gap: var(--space-2);
  font-size: var(--text-xs); font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--gold-400); border: 1px solid rgba(204,162,48,0.35);
  padding: 0.4rem 0.9rem; border-radius: var(--radius-full);
}
.hero-proof {
  margin-top: var(--space-10); display: inline-flex; align-items: baseline; gap: var(--space-3);
  color: var(--color-text-on-dark-muted); font-size: var(--text-sm);
}
.hero-proof strong { font-family: var(--font-display); font-size: var(--text-xl); color: #fff; }

/* ---------- Trust bar (3 items) ---------- */
.trust-bar { border-bottom: 1px solid var(--color-border); background: var(--color-surface); }
.trust-bar .container { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-8); }
.trust-item { display: flex; gap: var(--space-4); align-items: flex-start; padding-block: var(--space-8); }
.trust-item .ico {
  width: 40px; height: 40px; flex: none; border-radius: var(--radius-md);
  display: grid; place-items: center; background: rgba(204,162,48,0.14); color: var(--color-accent-text);
}
.trust-item .ico svg { width: 20px; height: 20px; }
.trust-item h3 { font-family: var(--font-body); font-size: var(--text-base); font-weight: 700; letter-spacing: -0.01em; }
.trust-item p { font-size: var(--text-sm); color: var(--color-text-muted); margin-top: var(--space-1); }

/* ---------- Value cards ---------- */
.value-grid { margin-top: var(--space-10); display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-6); }
.value-grid--4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1024px) { .value-grid--4 { grid-template-columns: repeat(2, 1fr); } }
.value-card {
  border: 1px solid var(--color-border); border-radius: var(--radius-lg);
  padding: var(--space-8); background: var(--color-surface);
}
.value-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--color-accent); }
.value-card .icon {
  width: 44px; height: 44px; border-radius: var(--radius-md); display: grid; place-items: center;
  background: var(--navy-700); color: var(--gold-400); margin-bottom: var(--space-5);
}
.value-card .icon svg { width: 22px; height: 22px; }
.value-card h3 { font-size: var(--text-lg); }
.value-card p { margin-top: var(--space-2); color: var(--color-text-muted); font-size: var(--text-sm); }

/* ---------- Testimonials ---------- */
.testimonial-grid { margin-top: var(--space-10); display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-6); }
.testimonial {
  background: rgba(255,255,255,0.05); border: 1px solid var(--color-border-dark);
  border-radius: var(--radius-lg); padding: var(--space-6); display: flex; flex-direction: column; gap: var(--space-4);
}
.testimonial .quote { font-family: var(--font-display); font-style: italic; font-size: var(--text-base); line-height: 1.5; color: #fff; }
.testimonial .who { display: flex; align-items: center; gap: var(--space-3); margin-top: auto; }
.testimonial .avatar {
  width: 38px; height: 38px; border-radius: 50%; background: var(--gold-400); color: #22272F;
  display: grid; place-items: center; font-size: var(--text-sm); font-weight: 700; flex: none;
}
.testimonial .name { font-size: var(--text-sm); font-weight: 600; color: #fff; }
.testimonial .role { font-size: var(--text-xs); color: var(--color-text-on-dark-muted); }
.placeholder-tag {
  font-size: 0.65rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--slate-400);
  border: 1px dashed rgba(255,255,255,0.25); padding: 0.15rem 0.5rem; border-radius: var(--radius-full); align-self: flex-start;
}

/* ---------- CTA band ---------- */
.cta-band { background: var(--navy-800); color: var(--color-text-on-dark); position: relative; overflow: hidden; }
.cta-band::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(600px 300px at 80% 20%, rgba(204,162,48,0.18), transparent 60%);
}
.cta-band .inner { position: relative; display: flex; align-items: center; justify-content: space-between; gap: var(--space-8); flex-wrap: wrap; }
.cta-band h2 { font-size: var(--text-xl); color: #fff; max-width: 20ch; }
.cta-band p { margin-top: var(--space-2); color: var(--color-text-on-dark-muted); max-width: 46ch; }

/* ---------- Footer ---------- */
.site-footer { background: var(--navy-900); color: var(--color-text-on-dark-muted); padding-block: var(--space-16) var(--space-8); }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: var(--space-10); }
.footer-brand p { margin-top: var(--space-4); font-size: var(--text-sm); max-width: 40ch; }
.footer-col h4 {
  font-family: var(--font-body); font-size: var(--text-xs); letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--gold-400); margin-bottom: var(--space-4);
}
.footer-col ul li { margin-bottom: var(--space-3); }
.footer-col a, .footer-col li { color: var(--slate-300); font-size: var(--text-sm); }
.footer-col a:hover { color: #fff; }
.footer-bottom {
  margin-top: var(--space-12); padding-top: var(--space-6); border-top: 1px solid var(--color-border-dark);
  display: flex; justify-content: space-between; gap: var(--space-4); flex-wrap: wrap; font-size: var(--text-xs); color: var(--slate-500);
}
.seo-line { margin-top: var(--space-4); font-size: var(--text-xs); color: var(--slate-500); max-width: none; line-height: 1.7; }

/* ---------- Page hero (page 2) ---------- */
.page-hero { background: var(--navy-700); color: var(--color-text-on-dark); padding-block: clamp(var(--space-12), 6vw, var(--space-20)); position: relative; overflow: hidden; }
.page-hero::before { content: ''; position: absolute; inset: 0; background: radial-gradient(800px 400px at 85% 0%, rgba(204,162,48,0.14), transparent 60%); }
.page-hero .container { position: relative; }
.page-hero h1 { font-size: var(--text-2xl); color: #fff; margin-top: var(--space-3); max-width: 18ch; }
.page-hero p { margin-top: var(--space-4); color: var(--color-text-on-dark-muted); font-size: var(--text-lg); max-width: 54ch; }

/* ---------- Service tiers ---------- */
.service-grid { margin-top: var(--space-10); display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-6); align-items: start; }
.service-card {
  border: 1px solid var(--color-border); border-radius: var(--radius-lg); overflow: hidden;
  background: var(--color-surface); display: flex; flex-direction: column; position: relative;
}
.service-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--color-accent); }
.service-card.featured { border-color: var(--color-accent); border-width: 2px; }
.service-card .tier-head { padding: var(--space-6); border-bottom: 1px solid var(--color-border); }
.service-card .tier { font-size: var(--text-xs); font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--color-accent-text); }
.service-card h3 { font-size: var(--text-lg); margin-top: var(--space-2); }
.service-card .turnaround { margin-top: var(--space-2); font-size: var(--text-sm); color: var(--color-text-muted); }
.service-card .turnaround strong { color: var(--color-text); }
.service-card .turnaround-note { margin-top: var(--space-1); font-size: var(--text-xs); font-style: italic; color: var(--color-text-muted); opacity: 0.85; }
.service-card .body { padding: var(--space-6); flex: 1; }
.service-card .body ul { display: grid; gap: var(--space-3); }
.service-card .body li { display: flex; gap: var(--space-3); font-size: var(--text-sm); }
.service-card .body li svg { width: 17px; height: 17px; color: var(--color-accent-text); flex: none; margin-top: 3px; }
.service-card .cta { padding: 0 var(--space-6) var(--space-6); }
.service-card .price { font-family: var(--font-display); font-size: var(--text-xl); margin-bottom: var(--space-4); }
.service-card .price span { font-family: var(--font-body); font-size: var(--text-xs); color: var(--color-text-muted); font-weight: 400; }
.service-card .btn { width: 100%; }

/* ---------- Contact ---------- */
.contact-grid { margin-top: var(--space-10); display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-12); align-items: center; }
.contact-detail { margin-top: var(--space-8); display: grid; gap: var(--space-5); }
.contact-detail .row { display: flex; gap: var(--space-3); align-items: flex-start; }
.contact-detail .row svg { width: 20px; height: 20px; color: var(--color-accent-text); flex: none; margin-top: 3px; }
.contact-detail .lbl { font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.1em; color: var(--color-text-muted); }
.contact-detail .val { font-size: var(--text-sm); font-weight: 600; }

.form-panel {
  background: var(--navy-700); color: var(--color-text-on-dark);
  border-radius: var(--radius-xl); padding: clamp(var(--space-8), 4vw, var(--space-12));
  box-shadow: var(--shadow-lg); text-align: center; position: relative; overflow: hidden;
}
.form-panel::before { content: ''; position: absolute; inset: 0; background: radial-gradient(500px 260px at 50% 0%, rgba(204,162,48,0.18), transparent 65%); }
.form-panel > * { position: relative; }
.form-panel h3 { color: #fff; font-size: var(--text-xl); }
.form-panel p { color: var(--color-text-on-dark-muted); margin: var(--space-3) auto var(--space-8); font-size: var(--text-sm); max-width: 40ch; }
.form-panel .btn { width: 100%; }
.form-panel .note { margin-top: var(--space-5); margin-bottom: 0; font-size: var(--text-xs); }
.form-steps { display: grid; gap: var(--space-3); margin: var(--space-6) 0 var(--space-8); text-align: left; }
.form-steps li { display: flex; gap: var(--space-3); font-size: var(--text-sm); color: var(--color-text-on-dark-muted); }
.form-steps li svg { width: 17px; height: 17px; color: var(--gold-400); flex: none; margin-top: 3px; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .value-grid, .testimonial-grid, .service-grid, .contact-grid { grid-template-columns: 1fr; }
  .trust-bar .container { grid-template-columns: 1fr; gap: 0; }
  .trust-item { padding-block: var(--space-5); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .cta-band .inner { flex-direction: column; align-items: flex-start; }
  .contact-grid { gap: var(--space-8); }
}

@media (max-width: 640px) {
  .main-nav, .header-actions .btn { display: none; }
  .nav-toggle { display: grid; }
  .footer-grid { grid-template-columns: 1fr; }
  .hero-actions .btn { width: 100%; }
  .main-nav.open {
    display: flex; position: absolute; top: 5.25rem; left: 0; right: 0;
    flex-direction: column; align-items: flex-start; background: var(--color-bg);
    border-bottom: 1px solid var(--color-border); padding: var(--space-6); gap: var(--space-4); box-shadow: var(--shadow-md);
  }
  .main-nav.open a { font-size: var(--text-base); }
}
