:root {
  --cream: #f7f3ea;
  --cream-alt: #efe7d4;
  --ink: #15150f;
  --olive: #4b4b2e;
  --olive-light: #a3a35c;
  --olive-dark: #2e2e1c;
  --white: #ffffff;
  --border: rgba(21, 21, 15, 0.14);
  --muted: #6b6a5c;
  --radius: 6px;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--cream);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

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

p { margin: 0 0 1em; }

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

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

.container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 24px;
}

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

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 24px;
  border-radius: var(--radius);
  font-family: var(--sans);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: opacity 0.15s ease;
}

.btn:hover { opacity: 0.85; }

.btn-dark {
  background: var(--ink);
  color: var(--white);
  transition: background 0.25s ease, transform 0.2s ease, box-shadow 0.25s ease;
}
.btn-dark:hover {
  background: var(--olive);
  transform: translateY(-3px);
  box-shadow: 0 10px 22px rgba(21, 21, 15, 0.25);
  opacity: 1;
}
@media (prefers-reduced-motion: reduce) {
  .btn-dark { transition: background 0.25s ease; }
  .btn-dark:hover { transform: none; }
}
.btn-outline {
  background: transparent;
  color: var(--ink);
  border-color: var(--border);
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease, transform 0.2s ease, box-shadow 0.25s ease;
}
.btn-outline:hover {
  background: var(--olive);
  color: var(--white);
  border-color: var(--olive);
  opacity: 1;
  transform: translateY(-3px);
  box-shadow: 0 10px 22px rgba(21, 21, 15, 0.2);
}
@media (prefers-reduced-motion: reduce) {
  .btn-outline { transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease; }
  .btn-outline:hover { transform: none; }
}
.btn-olive { background: var(--olive); color: var(--white); }

/* Header / Nav */

.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--cream);
  position: sticky;
  top: 0;
  z-index: 50;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  max-width: 1140px;
  margin: 0 auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 600;
}

.brand img { height: 56px; width: auto; }

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

.nav-links a {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ink);
}

.nav-links a.active { color: var(--olive); font-weight: 700; }

/* Animated underline on the main nav items (not the dropdown's own links,
   and not the mobile CTA button, which already has its own hover style). */
.nav-links > a:not(.nav-mobile-cta),
.nav-item-services > a {
  position: relative;
  transition: color 0.2s ease;
}
.nav-links > a:not(.nav-mobile-cta)::after,
.nav-item-services > a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 0;
  height: 2px;
  background: var(--olive);
  transition: width 0.25s ease;
}
.nav-links > a:not(.nav-mobile-cta):hover,
.nav-item-services > a:hover {
  color: var(--olive);
}
.nav-links > a:not(.nav-mobile-cta):hover::after,
.nav-item-services > a:hover::after,
.nav-links > a.active::after,
.nav-item-services > a.active::after {
  width: 100%;
}
@media (prefers-reduced-motion: reduce) {
  .nav-links > a:not(.nav-mobile-cta)::after,
  .nav-item-services > a::after {
    transition: none;
  }
}

.nav-item-services { position: relative; display: flex; align-items: center; gap: 2px; }

.dropdown-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 2px;
  line-height: 1;
  color: var(--muted);
  font-size: 0.7rem;
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 8px;
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 0;
  min-width: 210px;
  box-shadow: 0 12px 28px rgba(21, 21, 15, 0.1);
  z-index: 60;
}

.dropdown-menu a {
  display: block;
  padding: 10px 20px;
  font-size: 0.92rem;
  font-weight: 500;
  white-space: nowrap;
}

.dropdown-menu a:hover { background: var(--cream-alt); }

.nav-item-services:hover .dropdown-menu,
.nav-item-services.open .dropdown-menu {
  display: block;
}

.nav-mobile-cta { display: none; }
.nav-links a.nav-mobile-cta { color: var(--white); }

.nav-cta { display: flex; align-items: center; gap: 20px; }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
}

@media (max-width: 760px) {
  .nav-links { display: none; }
  .nav-toggle { display: block; }
  .nav-cta .btn { display: none; }
  .nav.open .nav-links {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--cream);
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    gap: 18px;
  }
  .nav-item-services {
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    gap: 0;
  }
  .nav-item-services > a { padding: 0; }
  .dropdown-toggle {
    position: absolute;
    right: 0;
    top: -2px;
    font-size: 1rem;
    padding: 6px 10px;
  }
  .dropdown-menu {
    display: none;
    position: static;
    box-shadow: none;
    border: none;
    background: none;
    padding: 10px 0 0 16px;
    margin-top: 10px;
    min-width: 0;
  }
  .nav-item-services:hover .dropdown-menu { display: none; }
  .nav-item-services.open .dropdown-menu { display: block; }
  .nav-mobile-cta {
    display: inline-flex;
    margin-top: 4px;
  }
}

/* Hero */

.hero {
  padding: 100px 0 80px;
  text-align: center;
}

.hero h1 {
  font-size: clamp(2.4rem, 5vw, 4rem);
  max-width: 820px;
  margin: 0 auto 0.5em;
}

.hero p.lead {
  max-width: 640px;
  margin: 0 auto 2em;
  color: var(--muted);
  font-size: 1.1rem;
}

.hero-ctas {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Sections */

section { padding: 80px 0; }
.section-alt { background: var(--cream-alt); }
.section-dark { background: var(--ink); color: var(--white); }

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 40px;
  margin-bottom: 48px;
  flex-wrap: wrap;
}

.section-head h2 { font-size: clamp(1.8rem, 3vw, 2.4rem); }
.section-head .sub { color: var(--muted); }
.section-head .sub.on-dark { color: rgba(255,255,255,0.7); }
.section-head p { max-width: 420px; color: var(--muted); margin: 0; }
.section-dark .section-head p { color: rgba(255,255,255,0.7); }

/* Grid of cards */

/* Flexbox rather than CSS Grid on purpose: an incomplete last row (an odd
   card count, or a narrow viewport that fits fewer per row) centers itself
   instead of leaving a gap that exposes the container background. */
.grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 24px;
  background: transparent;
  border: none;
}

.grid .card {
  background: var(--cream);
  padding: 32px;
  flex: 1 1 280px;
  max-width: calc(33.333% - 16px);
  border: 1px solid var(--border);
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

@media (max-width: 900px) {
  .grid .card { max-width: calc(50% - 12px); }
}
@media (max-width: 560px) {
  .grid .card { max-width: 100%; }
}

.card:hover:not(.card-dark) {
  transform: translateY(-4px);
  box-shadow: 0 14px 28px rgba(21, 21, 15, 0.08);
  background: var(--white);
  position: relative;
  z-index: 1;
}

.grid .card.card-dark { background: var(--ink); color: var(--white); border-color: rgba(255, 255, 255, 0.15); }
.card-dark p { color: rgba(255, 255, 255, 0.7); }
.card-dark:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.3);
  position: relative;
  z-index: 1;
}

/* Small icon badge used at the top of a card or before a heading. */
.card-icon {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: var(--cream-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-size: 1.1rem;
  color: var(--olive);
  margin-bottom: 6px;
  transition: transform 0.3s ease, background 0.3s ease, color 0.3s ease;
}
.card:hover .card-icon,
.service-block:hover .card-icon {
  transform: scale(1.08);
  background: var(--olive);
  color: var(--white);
}
.card-dark .card-icon { background: rgba(255, 255, 255, 0.12); color: var(--white); }
.card-dark:hover .card-icon { background: var(--white); color: var(--ink); }
@media (prefers-reduced-motion: reduce) {
  .card-icon { transition: none; }
}

.card h3 { font-size: 1.25rem; margin-bottom: 0.4em; }
.card p { color: var(--muted); margin-bottom: 0; font-size: 0.95rem; }

/* Scroll-reveal, used across the site. Works identically on mobile — the
   only opt-out is the OS-level "reduce motion" accessibility setting,
   never screen size. */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}
.reveal.is-visible { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
  .reveal { transition: none; opacity: 1; transform: none; }
}

/* .services-grid no longer needs its own rules — the base .grid class
   above now does the same centered-wrap layout for every card grid. */

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.tag {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 18px;
  font-size: 0.9rem;
  font-weight: 500;
  transition: border-color 0.2s ease, color 0.2s ease;
  cursor: default;
}
.tag:hover { border-color: var(--olive); color: var(--olive); }

/* CTA banner */

.cta-banner {
  text-align: center;
  background: var(--olive);
  color: var(--white);
  padding: 70px 24px;
}

.cta-banner h2 { font-size: clamp(1.8rem, 3vw, 2.4rem); margin-bottom: 0.6em; }

/* .btn-dark's usual hover color (olive) would blend into this banner's
   own olive background, so it inverts to white here instead. */
.cta-banner .btn-dark:hover {
  background: var(--white);
  color: var(--ink);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.25);
}

/* Footer */

.site-footer {
  background: var(--ink);
  color: rgba(255,255,255,0.8);
  padding: 60px 0 30px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

.footer-brand { display: flex; align-items: center; margin-bottom: 14px; }
.footer-brand img { height: 32px; width: auto; filter: invert(1); }
.footer-tagline { color: rgba(255,255,255,0.55); font-size: 0.95rem; }

.footer-col h4 {
  font-family: var(--sans);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
  margin-bottom: 16px;
}

.footer-col a, .footer-col p {
  display: block;
  color: rgba(255,255,255,0.8);
  font-size: 0.85rem;
  margin-bottom: 10px;
}

.footer-quick-links a {
  transition: transform 0.2s ease, color 0.2s ease;
}
.footer-quick-links a:hover {
  color: var(--white);
  transform: translateX(6px);
}
@media (prefers-reduced-motion: reduce) {
  .footer-quick-links a { transition: color 0.2s ease; }
  .footer-quick-links a:hover { transform: none; }
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.15);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.5);
}

@media (max-width: 760px) {
  .footer-grid { grid-template-columns: 1fr; }
}

/* Forms */

.form-field { margin-bottom: 20px; }
.form-field label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 8px;
}
.form-field input,
.form-field textarea {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--sans);
  font-size: 0.95rem;
  background: var(--white);
}
.form-field textarea { resize: vertical; min-height: 120px; }

.form-card {
  background: var(--white);
  border: 1px solid var(--border);
  padding: 40px;
  border-radius: var(--radius);
}

.form-note {
  font-size: 0.88rem;
  color: var(--muted);
  margin-top: 16px;
}

.form-status { font-size: 0.92rem; margin-top: 12px; }
.form-status.ok { color: #2e6b34; }
.form-status.error { color: #a33; }

.contact-detail { margin-bottom: 18px; }
.contact-detail h4 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 6px; }

/* Blog */

.post-list { display: flex; flex-direction: column; gap: 0; }
.post-row {
  display: block;
  padding: 28px 0;
  border-bottom: 1px solid var(--border);
}
.post-row h3 { margin-bottom: 6px; }
.post-row .post-date { font-size: 0.85rem; color: var(--muted); margin-bottom: 10px; }
.post-row p { color: var(--muted); margin-bottom: 0; }

.empty-state {
  padding: 60px 0;
  text-align: center;
  color: var(--muted);
}

.post-article h1 { font-size: clamp(2rem, 4vw, 2.8rem); margin-bottom: 0.3em; }
.post-article .post-date { color: var(--muted); margin-bottom: 2em; }
.post-article .post-content { font-size: 1.05rem; }
.post-article .post-content p { margin-bottom: 1.3em; }

/* Admin */

.admin-shell { min-height: 100vh; background: var(--cream-alt); }
.admin-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 24px;
  background: var(--ink);
  color: var(--white);
}
.admin-topbar .brand { color: var(--white); }
.admin-topbar .brand img { filter: invert(1); }
.admin-main { max-width: 960px; margin: 0 auto; padding: 40px 24px; }

.admin-tabs { display: flex; gap: 24px; margin-bottom: 32px; border-bottom: 1px solid var(--border); }
.admin-tab {
  padding: 10px 4px;
  font-weight: 600;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  cursor: pointer;
  background: none;
  border-top: none; border-left: none; border-right: none;
  font-family: var(--sans);
  font-size: 0.95rem;
}
.admin-tab.active { color: var(--ink); border-bottom-color: var(--olive); }

.admin-table { width: 100%; border-collapse: collapse; background: var(--white); border: 1px solid var(--border); }
.admin-table th, .admin-table td {
  text-align: left;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 0.92rem;
  vertical-align: top;
}
.admin-table th { background: var(--cream-alt); font-weight: 600; }
.admin-table tr:last-child td { border-bottom: none; }

.status-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
}
.status-pill.published { background: #e2ecd9; color: #2e6b34; }
.status-pill.draft { background: #eee; color: #777; }

.row-actions { display: flex; gap: 12px; }
.row-actions button, .row-actions a {
  background: none;
  border: none;
  color: var(--olive);
  font-weight: 600;
  cursor: pointer;
  font-size: 0.88rem;
  font-family: var(--sans);
}
.row-actions .danger { color: #a33; }

.login-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--cream-alt);
}
.login-card {
  background: var(--white);
  border: 1px solid var(--border);
  padding: 40px;
  border-radius: var(--radius);
  width: 100%;
  max-width: 380px;
}
.login-card h1 { font-size: 1.6rem; margin-bottom: 0.2em; }
.login-card p.sub { color: var(--muted); margin-bottom: 24px; font-size: 0.92rem; }

.checkbox-field { display: flex; align-items: center; gap: 8px; margin-bottom: 20px; }
.checkbox-field input { width: auto; }
.checkbox-field label { margin: 0; font-weight: 500; font-size: 0.92rem; }
