:root {
  --bg: #f5f3ef;
  --bg-alt: #ebe8e2;
  --text: #2a2a2a;
  --text-muted: #5c5c5c;
  --pine: #2d4a3e;
  --pine-dark: #1e3329;
  --copper: #c17f59;
  --copper-light: #d4a088;
  --white: #ffffff;
  --grid: rgba(45, 74, 62, 0.08);
  --shadow: 0 4px 20px rgba(42, 42, 42, 0.08);
  --radius: 4px;
  --font-body: 'IBM Plex Sans', system-ui, sans-serif;
  --font-heading: 'Space Grotesk', system-ui, sans-serif;
  --max-width: 72rem;
  --section-gap: 5rem;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 48px 48px;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--pine);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--copper);
}

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.2;
  color: var(--text);
}

h1 { font-size: clamp(2rem, 5vw, 3rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-size: 1.25rem; }

p { margin: 0 0 1rem; }

.container {
  width: min(100% - 2rem, var(--max-width));
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  background: var(--pine);
  color: var(--white);
  padding: 0.5rem 1rem;
  z-index: 9999;
}

.skip-link:focus {
  top: 1rem;
}

/* Header */
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--grid);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
  gap: 1rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  text-decoration: none;
  color: var(--text);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.125rem;
}

.logo-mark {
  width: 28px;
  height: 28px;
  background: var(--pine);
  border-radius: var(--radius);
  position: relative;
}

.logo-mark::after {
  content: '';
  position: absolute;
  bottom: 6px;
  left: 4px;
  right: 4px;
  height: 2px;
  background: var(--copper);
  transform: skewY(-12deg);
}

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.site-nav a {
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text);
}

.site-nav a:hover {
  color: var(--pine);
  text-decoration: underline;
  text-decoration-color: var(--copper);
}

.nav-cta {
  padding: 0.5rem 1rem;
  background: var(--pine);
  color: var(--white) !important;
  border-radius: var(--radius);
  transition: transform 0.2s, box-shadow 0.2s;
}

.nav-cta:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  text-decoration: none !important;
  color: var(--white) !important;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  transition: transform 0.2s;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 600;
  border-radius: var(--radius);
  border: 2px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}

.btn-primary {
  background: var(--pine);
  color: var(--white);
  border-color: var(--pine);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  color: var(--white);
  text-decoration: none;
}

.btn-secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--text);
}

.btn-secondary:hover {
  background: var(--text);
  color: var(--white);
  text-decoration: none;
}

.btn-copper {
  background: var(--copper);
  color: var(--white);
  border-color: var(--copper);
}

.btn-copper:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  color: var(--white);
  text-decoration: none;
}

/* Hero */
.hero {
  padding: var(--section-gap) 0;
}

.hero-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}

.hero-eyebrow {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--copper);
  margin-bottom: 1rem;
}

.hero-lead {
  font-size: 1.2rem;
  color: var(--text-muted);
  max-width: 34ch;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2rem;
}

.hero-image {
  position: relative;
  border: 1px solid var(--grid);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.hero-image img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
}

.hero-image::before {
  content: '';
  position: absolute;
  top: 1rem;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  border: 1px solid rgba(255,255,255,0.4);
  pointer-events: none;
  z-index: 1;
}

/* Sections */
.section {
  padding: var(--section-gap) 0;
}

.section-alt {
  background: var(--white);
  border-block: 1px solid var(--grid);
}

.section-header {
  margin-bottom: 2.5rem;
  max-width: 42rem;
}

.section-header h2 {
  position: relative;
  display: inline-block;
}

.section-header h2::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 3rem;
  height: 3px;
  background: var(--copper);
}

.section-intro {
  color: var(--text-muted);
  margin-top: 1rem;
}

/* Cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.card {
  background: var(--white);
  border: 1px solid var(--grid);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.25s, box-shadow 0.25s;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.card-image img {
  width: 100%;
  aspect-ratio: 16/10;
  object-fit: cover;
}

.card-body {
  padding: 1.5rem;
}

.card-meta {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.card-title {
  margin: 0 0 0.75rem;
  font-size: 1.125rem;
}

.card-title a {
  text-decoration: none;
  color: var(--text);
}

.card-title a:hover {
  color: var(--pine);
}

.card-link {
  font-weight: 600;
  font-size: 0.875rem;
  text-decoration: none;
}

/* Page header */
.page-header {
  padding: 3rem 0 2rem;
  border-bottom: 1px solid var(--grid);
  background: var(--white);
}

.page-header h1 {
  margin: 0 0 0.75rem;
}

.page-header .lead {
  color: var(--text-muted);
  font-size: 1.125rem;
  max-width: 50ch;
  margin: 0;
}

/* Content prose */
.prose {
  max-width: 42rem;
}

.prose-wide {
  max-width: 52rem;
}

.prose h2 {
  margin-top: 2.5rem;
  margin-bottom: 1rem;
}

.prose ul, .prose ol {
  padding-left: 1.25rem;
  margin-bottom: 1rem;
}

.prose li {
  margin-bottom: 0.5rem;
}

/* Testimonials */
.testimonial-grid {
  display: grid;
  gap: 1.5rem;
}

.testimonial {
  background: var(--white);
  border-left: 3px solid var(--copper);
  padding: 1.5rem 1.5rem 1.5rem 2rem;
  border-radius: 0 var(--radius) var(--radius) 0;
}

.testimonial blockquote {
  margin: 0 0 1rem;
  font-style: italic;
}

.testimonial cite {
  font-style: normal;
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* Pricing */
.rate-table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  background: var(--white);
  border: 1px solid var(--grid);
}

.rate-table th,
.rate-table td {
  padding: 1rem 1.25rem;
  text-align: left;
  border-bottom: 1px solid var(--grid);
}

.rate-table th {
  font-family: var(--font-heading);
  background: var(--bg-alt);
}

.rate-table tr:last-child td {
  border-bottom: none;
}

.price-note {
  background: var(--bg-alt);
  padding: 1.5rem;
  border-radius: var(--radius);
  border-left: 3px solid var(--pine);
  margin-top: 2rem;
}

/* Forms */
.form-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.375rem;
  font-size: 0.9375rem;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  font-family: var(--font-body);
  font-size: 1rem;
  border: 1px solid var(--grid);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--text);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: 2px solid var(--pine);
  outline-offset: 2px;
}

.form-error {
  color: #8b3a3a;
  font-size: 0.8125rem;
  margin-top: 0.25rem;
  display: none;
}

.form-group.is-invalid .form-error {
  display: block;
}

.form-group.is-invalid input,
.form-group.is-invalid select,
.form-group.is-invalid textarea {
  border-color: #8b3a3a;
}

.form-success {
  background: var(--pine);
  color: var(--white);
  padding: 1.5rem;
  border-radius: var(--radius);
  display: none;
}

.form-success.is-visible {
  display: block;
}

.form-failure {
  background: #8b3a3a;
  color: var(--white);
  padding: 1.5rem;
  border-radius: var(--radius);
  display: none;
}

.form-failure.is-visible {
  display: block;
}

.contact-block {
  background: var(--white);
  border: 1px solid var(--grid);
  padding: 2rem;
  border-radius: var(--radius);
}

.contact-block h2 {
  font-size: 1.125rem;
  margin-top: 0;
}

/* Blog */
.post-meta {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.post-cover {
  margin-bottom: 2rem;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--grid);
}

.post-cover img {
  width: 100%;
  aspect-ratio: 21/9;
  object-fit: cover;
}

/* Chart lab */
.lab-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.lab-panel {
  background: var(--white);
  border: 1px solid var(--grid);
  padding: 2rem;
  border-radius: var(--radius);
  position: relative;
}

.lab-panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--pine), var(--copper));
}

.lab-number {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 700;
  color: var(--grid);
  line-height: 1;
  margin-bottom: 0.5rem;
}

/* Service detail */
.service-hero {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 2.5rem;
  align-items: start;
}

.service-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin: 1.5rem 0;
  padding: 1rem 0;
  border-top: 1px solid var(--grid);
  border-bottom: 1px solid var(--grid);
}

.service-detail-meta dt {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.service-detail-meta dd {
  margin: 0;
  font-weight: 600;
}

/* Footer */
.site-footer {
  background: var(--pine-dark);
  color: rgba(255,255,255,0.85);
  padding: 3rem 0 0;
  margin-top: var(--section-gap);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  padding-bottom: 2rem;
}

.footer-name {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.125rem;
  color: var(--white);
  margin: 0 0 0.5rem;
}

.footer-tagline {
  font-size: 0.875rem;
  opacity: 0.8;
  margin: 0;
}

.footer-contact p {
  margin: 0 0 0.5rem;
  font-size: 0.9375rem;
}

.footer-contact a {
  color: rgba(255,255,255,0.85);
}

.footer-contact a:hover {
  color: var(--copper-light);
}

.footer-links ul,
.footer-legal ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-links li,
.footer-legal li {
  margin-bottom: 0.5rem;
}

.footer-links a,
.footer-legal a {
  color: rgba(255,255,255,0.75);
  text-decoration: none;
  font-size: 0.9375rem;
}

.footer-links a:hover,
.footer-legal a:hover {
  color: var(--white);
  text-decoration: underline;
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding: 1.25rem 0;
}

.footer-bottom p {
  margin: 0;
  font-size: 0.8125rem;
  opacity: 0.7;
}

/* Cookie banner */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--white);
  border-top: 1px solid var(--grid);
  box-shadow: 0 -4px 24px rgba(0,0,0,0.1);
  padding: 1.5rem;
  z-index: 1000;
}

.cookie-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.cookie-title {
  font-family: var(--font-heading);
  font-weight: 600;
  margin: 0 0 0.5rem;
}

.cookie-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.cookie-error {
  color: #8b3a3a;
  font-size: 0.875rem;
  margin-top: 0.75rem;
}

/* 404 */
.error-page {
  text-align: center;
  padding: 6rem 0;
}

.error-code {
  font-family: var(--font-heading);
  font-size: 6rem;
  font-weight: 700;
  color: var(--grid);
  line-height: 1;
  margin-bottom: 1rem;
}

/* Animations */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  animation: reveal 0.6s ease forwards;
}

.reveal-delay-1 { animation-delay: 0.1s; }
.reveal-delay-2 { animation-delay: 0.2s; }
.reveal-delay-3 { animation-delay: 0.3s; }

@keyframes reveal {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Legal pages */
.legal-content h2 {
  font-size: 1.25rem;
  margin-top: 2rem;
}

.legal-content h3 {
  font-size: 1.0625rem;
  margin-top: 1.5rem;
}

.cookie-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.9375rem;
}

.cookie-table th,
.cookie-table td {
  border: 1px solid var(--grid);
  padding: 0.75rem 1rem;
  text-align: left;
}

.cookie-table th {
  background: var(--bg-alt);
}

/* Responsive */
@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }

  .site-nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: min(80vw, 320px);
    height: 100vh;
    background: var(--white);
    padding: 5rem 2rem 2rem;
    box-shadow: -4px 0 24px rgba(0,0,0,0.1);
    transition: right 0.3s;
  }

  .site-nav.is-open {
    right: 0;
  }

  .site-nav ul {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.25rem;
  }

  .hero-split,
  .form-section,
  .service-hero {
    grid-template-columns: 1fr;
  }

  :root {
    --section-gap: 3.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    animation: none;
  }

  html {
    scroll-behavior: auto;
  }
}
