:root {
  --ink: #16211b;
  --ink-soft: #3f4a44;
  --paper: #faf8f3;
  --paper-alt: #f1ede3;
  --line: #e3ddcd;
  --brand: #1f4d3d;
  --brand-light: #2f6b54;
  --accent: #b98a3d;
  --white: #ffffff;
  --radius: 14px;
  --font-serif: 'Lora', Georgia, serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --max-width: 1160px;
  --shadow-soft: 0 12px 32px -18px rgba(22, 33, 27, 0.28);
  --shadow-contact: 0 1px 2px rgba(22, 33, 27, 0.07);
  --shadow-card: 0 1px 2px rgba(22, 33, 27, 0.06), 0 20px 40px -24px rgba(22, 33, 27, 0.22);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 0.5em;
  color: var(--ink);
}

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

a { color: inherit; text-decoration: none; }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 248, 243, 0.9);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line);
}

.site-header::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 2px;
  background: linear-gradient(90deg, var(--brand) 0%, var(--accent) 55%, transparent 100%);
  opacity: 0.55;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
}

.logo {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  display: inline-flex;
}

.logo-lex { color: var(--brand); }
.logo-pand { color: var(--accent); }

.main-nav {
  display: flex;
  align-items: center;
  gap: 32px;
}

.main-nav a {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ink-soft);
  transition: color 0.2s ease;
}

.main-nav a:hover { color: var(--brand); }

.main-nav .nav-cta {
  background: var(--brand);
  color: var(--white);
  padding: 10px 20px;
  border-radius: 999px;
  font-weight: 600;
}

.main-nav .nav-cta:hover {
  background: var(--brand-light);
  color: var(--white);
}

/* Persistent mobile CTA: `.main-nav` collapses into a hidden slide-down
   panel below 760px (see the max-width: 760px block), taking its `.nav-cta`
   button out of view until the hamburger is opened. Since mobile is the
   majority of traffic for a firm like this, the primary CTA needs its own
   always-visible copy that lives outside `.main-nav` entirely, so it's
   never hidden by that collapse. Hidden on desktop, where `.nav-cta` inside
   `.main-nav` already covers this. */
.header-cta-mobile {
  display: none;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.nav-toggle span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--ink);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

/* ---------- Hero ---------- */

.hero {
  padding: 96px 0 88px;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 85% 0%, rgba(185, 138, 61, 0.12), transparent 45%),
    radial-gradient(circle at 0% 100%, rgba(31, 77, 61, 0.10), transparent 45%);
}

/* Faint grain layer — pure CSS, no image asset, sits behind hero content only. */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 0.035;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 160px 160px;
}

.hero-inner {
  max-width: 760px;
  position: relative;
  z-index: 1;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--brand);
  margin-bottom: 20px;
}

.hero h1 {
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  margin-bottom: 24px;
}

.hero-lead {
  font-size: 1.15rem;
  color: var(--ink-soft);
  max-width: 620px;
  margin-bottom: 36px;
}

.hero-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 28px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.98rem;
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
  border: 1px solid transparent;
  cursor: pointer;
}

.btn-primary {
  background: var(--brand);
  color: var(--white);
  box-shadow: var(--shadow-soft);
}

.btn-primary:hover {
  background: var(--brand-light);
  transform: translateY(-1px);
}

.btn-primary::after,
.nav-cta::after {
  content: "\2192";
  display: inline-block;
  margin-left: 8px;
  transition: transform 0.2s var(--ease);
}

.btn-primary:hover::after,
.nav-cta:hover::after {
  transform: translateX(4px);
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}

.btn-ghost:hover {
  border-color: var(--brand);
  color: var(--brand);
}

/* ---------- Sections ---------- */

.section {
  padding: 88px 0;
  position: relative;
  overflow: hidden;
}

.section-alt { background: var(--paper-alt); }

.section-alt::before {
  content: "";
  position: absolute;
  top: -10%;
  right: -8%;
  width: 480px;
  height: 480px;
  background: radial-gradient(circle, rgba(31, 77, 61, 0.08), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

#how-we-bill::before {
  content: "";
  position: absolute;
  bottom: -20%;
  left: -10%;
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, rgba(185, 138, 61, 0.10), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.section > .container {
  position: relative;
  z-index: 1;
}

.kicker {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 14px;
}

.kicker.center { text-align: center; }

/* Small index numerals that pair with a section kicker — the same system
   language as the 01-04 service card numbers, extended to other sections. */
.section-eyebrow {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 14px;
}

.section-eyebrow .kicker { margin-bottom: 0; }
.section-eyebrow.center { justify-content: center; }

.section-index {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.85rem;
  color: var(--line);
  letter-spacing: 0.02em;
}

.section-title { font-size: clamp(1.7rem, 3vw, 2.3rem); }
.section-title.center { text-align: center; max-width: 640px; margin: 0 auto 56px; }

/* Light-touch inline CTA: a single line of text rather than a button, for
   sections (like Services) that are already visually dense with cards and
   don't need another full-weight button competing for attention. */
.section-inline-cta {
  text-align: center;
  margin: 48px 0 0;
  font-size: 0.98rem;
  color: var(--ink-soft);
}

.section-inline-cta a {
  color: var(--brand);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 600;
}

.section-inline-cta a:hover { color: var(--brand-light); }

.section-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: start;
}

.section-head h2 {
  font-size: clamp(1.6rem, 3vw, 2.1rem);
}

.section-body p {
  color: var(--ink-soft);
  font-size: 1.02rem;
}

/* ---------- How we bill (asymmetric layout) ---------- */

.billing-top {
  max-width: 640px;
  margin-bottom: 48px;
}

.billing-heading {
  font-size: clamp(1.7rem, 3.2vw, 2.3rem);
}

.billing-columns {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 56px;
  align-items: start;
}

.billing-copy p {
  color: var(--ink-soft);
  font-size: 1.02rem;
}

.billing-pullquote {
  margin: 64px 0 0;
  padding: 4px 0 4px 28px;
  border-left: 3px solid var(--accent);
}

.billing-pullquote p {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(1.3rem, 2.4vw, 1.6rem);
  color: var(--ink);
  line-height: 1.35;
}

/* ---------- Services ---------- */

.services-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
}

.service-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 36px;
  box-shadow: var(--shadow-card), inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.service-number {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.05em;
  margin-bottom: 14px;
}

.service-card h3 {
  font-size: 1.35rem;
  margin-bottom: 10px;
}

.service-tagline {
  font-weight: 600;
  color: var(--brand);
  margin-bottom: 16px;
  font-size: 0.98rem;
}

.service-card p:not(.service-tagline) {
  color: var(--ink-soft);
  font-size: 0.98rem;
}

/* ---------- Contact ---------- */

.section-contact {
  background: var(--brand);
  color: var(--white);
}

.section-contact .kicker { color: #d9c48f; }
.section-contact h2 { color: var(--white); }
.section-contact .section-index { color: rgba(255, 255, 255, 0.35); }

.contact-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 64px;
  align-items: start;
}

.contact-intro h2 {
  font-size: clamp(1.6rem, 3vw, 2.1rem);
}

.contact-alt {
  margin-top: 20px;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.75);
}

.contact-alt a {
  color: #d9c48f;
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 600;
}

.contact-alt a:hover { color: var(--white); }

.contact-form {
  background: var(--white);
  border-radius: var(--radius);
  padding: 40px;
  color: var(--ink);
  box-shadow: var(--shadow-card);
  position: relative;
  top: -28px;
}

.form-row {
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-row label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.form-row input,
.form-row textarea {
  font-family: var(--font-sans);
  font-size: 1rem;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  resize: vertical;
}

.form-row input:focus,
.form-row textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(31, 77, 61, 0.12);
}

.form-consent { margin-bottom: 24px; }

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--ink-soft);
  font-weight: 400;
}

.checkbox-label input {
  appearance: none;
  -webkit-appearance: none;
  margin-top: 2px;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--line);
  border-radius: 5px;
  background: var(--paper);
  cursor: pointer;
  position: relative;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.checkbox-label input:checked {
  background: var(--brand);
  border-color: var(--brand);
}

.checkbox-label input:checked::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 1px;
  width: 5px;
  height: 9px;
  border: solid var(--white);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.checkbox-label input:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(31, 77, 61, 0.18);
}

.checkbox-label a {
  color: var(--brand);
  text-decoration: underline;
}

.btn-submit { width: 100%; }

.form-reassurance {
  margin-top: 12px;
  font-size: 0.85rem;
  color: var(--ink-soft);
  text-align: center;
}

.form-status {
  margin-top: 14px;
  font-size: 0.9rem;
  min-height: 1.2em;
}

.form-status.success { color: var(--brand); }
.form-status.error { color: #b3432b; }

/* ---------- Footer ---------- */

.site-footer {
  background: var(--ink);
  color: #cdd6ce;
  padding: 56px 0 32px;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

.footer-logo .logo-lex { color: #ffffff; }
.footer-logo .logo-pand { color: var(--accent); }

.footer-note { color: #9aa79b; margin-bottom: 8px; }

.footer-email { margin-bottom: 20px; }

.footer-email a {
  color: var(--accent);
  font-weight: 600;
  font-size: 0.95rem;
}

.footer-email a:hover { color: #d9c48f; }

.footer-links {
  margin-bottom: 24px;
}

.footer-links a {
  color: #cdd6ce;
  text-decoration: underline;
  font-size: 0.9rem;
}

.footer-copyright {
  font-size: 0.82rem;
  color: #74806f;
}

/* ---------- DPDA page ---------- */

.legal-page {
  padding: 64px 0 96px;
  max-width: 800px;
  margin: 0 auto;
}

.legal-page h1 {
  font-size: 2rem;
  margin-bottom: 8px;
}

.legal-page .updated {
  color: var(--ink-soft);
  font-size: 0.9rem;
  margin-bottom: 40px;
}

.legal-page h2 {
  font-size: 1.25rem;
  margin-top: 40px;
}

.legal-page p, .legal-page li {
  color: var(--ink-soft);
  font-size: 0.98rem;
}

.legal-page ul {
  padding-left: 20px;
}

.back-link {
  display: inline-block;
  margin-bottom: 32px;
  font-weight: 600;
  color: var(--brand);
}

/* ---------- Careers page ---------- */

.careers-page > p {
  color: var(--ink-soft);
  font-size: 1rem;
  max-width: 640px;
}

.job-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card), inset 0 1px 0 rgba(255, 255, 255, 0.7);
  padding: 36px;
  margin-top: 40px;
}

.job-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.job-card-header h2 {
  font-size: 1.4rem;
  margin-bottom: 6px;
}

.job-meta {
  font-weight: 600;
  color: var(--brand);
  font-size: 0.92rem;
}

.job-date {
  font-size: 0.85rem;
  color: var(--ink-soft);
  white-space: nowrap;
}

.job-card h3 {
  font-size: 1.05rem;
  margin-top: 28px;
  margin-bottom: 10px;
  color: var(--ink);
}

.job-card p, .job-card li {
  color: var(--ink-soft);
  font-size: 0.98rem;
}

.job-card ul {
  padding-left: 20px;
}

.job-card a {
  color: var(--brand);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 600;
}

.job-card a:hover { color: var(--brand-light); }

/* ---------- Scroll reveal ---------- */
/* Content is visible by default (no rules here affect opacity unless the
   `js-reveal` class is present on <html>). main.js only adds that class,
   and arms individual elements, once it has confirmed the reveal can run
   end-to-end — so a JS error or blocked script never hides content. */

html.js-reveal .reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

html.js-reveal .reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}

html.js-reveal .reveal-stagger .reveal-item {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}

html.js-reveal .reveal-stagger.in-view .reveal-item {
  opacity: 1;
  transform: translateY(0);
}

html.js-reveal .reveal-stagger.in-view .reveal-item:nth-child(1) { transition-delay: 0ms; }
html.js-reveal .reveal-stagger.in-view .reveal-item:nth-child(2) { transition-delay: 90ms; }
html.js-reveal .reveal-stagger.in-view .reveal-item:nth-child(3) { transition-delay: 180ms; }
html.js-reveal .reveal-stagger.in-view .reveal-item:nth-child(4) { transition-delay: 270ms; }

@media (prefers-reduced-motion: reduce) {
  html.js-reveal .reveal,
  html.js-reveal .reveal-item {
    opacity: 1;
    transform: none;
  }
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .section-grid,
  .contact-grid,
  .billing-columns {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .services-grid {
    grid-template-columns: 1fr;
  }

  .billing-pullquote {
    margin-top: 8px;
  }
}

@media (max-width: 760px) {
  .main-nav {
    position: fixed;
    top: 76px;
    left: 0;
    right: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px 24px 20px;
    transform: translateY(-150%);
    opacity: 0;
    box-shadow: 0 16px 24px -16px rgba(22, 33, 27, 0.25);
    transition: transform 0.25s ease, opacity 0.25s ease;
  }

  .main-nav.open {
    transform: translateY(0);
    opacity: 1;
  }

  .main-nav a {
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
  }

  .main-nav .nav-cta {
    text-align: center;
    margin-top: 12px;
    border-bottom: none;
  }

  .nav-toggle { display: flex; }

  .header-cta-mobile {
    display: inline-flex;
    align-items: center;
    background: var(--brand);
    color: var(--white);
    padding: 8px 16px;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-left: auto;
    margin-right: 12px;
  }

  .header-cta-mobile:hover { background: var(--brand-light); }

  .hero { padding: 64px 0 56px; }
  .section { padding: 64px 0; }

  .contact-form { padding: 28px; }
}

@media (max-width: 480px) {
  .header-inner { height: 68px; }
  .main-nav { top: 68px; }
  .logo { font-size: 1.35rem; }
}
