:root {
  --bg: #f6f1e6;
  --bg-soft: #eee5d3;
  --paper: #fcf8ef;
  --ink: #23231f;
  --muted: #4e524a;
  --line: #c8bea9;
  --accent: #314b43;
  --accent-soft: #445f57;
  --cta: #3e5661;
  --cta-hover: #324750;
  --radius: 14px;
  --shadow: 0 16px 40px rgba(34, 35, 28, 0.12);
  --serif: "Libre Baskerville", Garamond, Baskerville, "Times New Roman", serif;
  --sans: "Source Sans 3", "Segoe UI", Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

*:focus-visible {
  outline: 3px solid #2f5750;
  outline-offset: 2px;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 20%, rgba(255, 255, 255, 0.45), transparent 45%),
    radial-gradient(circle at 85% 5%, rgba(80, 92, 80, 0.09), transparent 35%),
    repeating-linear-gradient(
      0deg,
      rgba(116, 104, 78, 0.05),
      rgba(116, 104, 78, 0.05) 1px,
      transparent 1px,
      transparent 20px
    ),
    var(--bg);
  line-height: 1.68;
}

h1,
h2,
h3 {
  font-family: var(--serif);
  line-height: 1.2;
  letter-spacing: 0.2px;
  margin-top: 0;
}

h1 {
  font-size: clamp(1.95rem, 3.5vw, 3.25rem);
  margin-bottom: 1rem;
}

h2 {
  font-size: clamp(1.55rem, 2.4vw, 2.2rem);
  margin-bottom: 1rem;
}

h3 {
  font-size: 1.35rem;
  margin-bottom: 0.7rem;
}

p {
  margin: 0 0 1rem;
}

a {
  color: inherit;
}

.email-visual {
  display: inline-flex;
  align-items: center;
}

.email-image {
  display: block;
  width: auto !important;
  height: 1.06rem !important;
  max-width: 100%;
  object-fit: contain;
}

.container {
  width: min(1120px, 92%);
  margin: 0 auto;
}

.narrow {
  width: min(860px, 92%);
}

.skip-link {
  position: absolute;
  top: -42px;
  left: 16px;
  background: var(--cta);
  color: #fff;
  padding: 0.55rem 0.8rem;
  border-radius: 8px;
  z-index: 1000;
}

.skip-link:focus {
  top: 14px;
}

.site-header {
  border-bottom: 1px solid var(--line);
  background: rgba(250, 246, 236, 0.84);
  backdrop-filter: blur(5px);
  position: sticky;
  top: 0;
  z-index: 25;
  transition: background-color 0.22s ease, box-shadow 0.22s ease;
}

.header-inner {
  min-height: 86px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  transition: min-height 0.22s ease;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.brand-logo {
  display: inline-flex;
  align-items: center;
}

.brand-logo img {
  display: block;
  width: auto;
  height: 52px;
  transition: height 0.22s ease;
}

body.is-scrolled .site-header {
  background: rgba(249, 244, 233, 0.95);
  box-shadow: 0 8px 20px rgba(34, 35, 28, 0.08);
}

body.is-scrolled .header-inner {
  min-height: 74px;
}

body.is-scrolled .brand-logo img {
  height: 46px;
}

.header-contact {
  display: flex;
  gap: 1.3rem;
  align-items: center;
}

.nav-toggle {
  display: none;
  appearance: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.75);
  color: #243a33;
  font: inherit;
  font-weight: 700;
  padding: 0.45rem 0.9rem;
  cursor: pointer;
}

.site-nav {
  margin-left: auto;
}

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

.nav-list a,
.nav-link {
  color: #274139;
  text-decoration: none;
  font-weight: 700;
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 0.42rem 0.72rem;
  background: transparent;
  font: inherit;
  cursor: pointer;
}

.nav-list a:hover,
.nav-list a:focus-visible,
.nav-link:hover,
.nav-link:focus-visible,
.nav-list a.is-active,
.nav-link.is-active {
  border-color: rgba(49, 75, 67, 0.3);
  background: rgba(50, 84, 73, 0.1);
  color: #22362f;
}

.has-dropdown {
  position: relative;
}

.nav-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  width: min(460px, 92vw);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.45rem;
  margin: 0;
  box-shadow: 0 12px 26px rgba(21, 24, 19, 0.15);
  list-style: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
  z-index: 35;
}

.nav-dropdown li {
  margin: 0;
}

.nav-dropdown a {
  display: block;
  border-radius: 8px;
  padding: 0.52rem 0.62rem;
}

.has-dropdown.is-open .nav-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.header-contact a {
  text-decoration: none;
  color: #2f4a42;
  font-weight: 600;
  border-bottom: 1px solid transparent;
}

.header-contact a:hover,
.header-contact a:focus-visible {
  color: var(--accent);
  border-color: var(--accent);
}

.hero {
  padding: clamp(3.2rem, 6vw, 5rem) 0 3.2rem;
}

.hero-archive {
  background:
    linear-gradient(110deg, rgba(17, 24, 27, 0.8), rgba(34, 42, 45, 0.56) 55%, rgba(21, 28, 33, 0.7)),
    url("assets/genealogy/one.webp") center / cover no-repeat;
  border-bottom: 1px solid rgba(245, 237, 220, 0.2);
}

.hero-archive .hero-copy {
  color: #f5efe2;
}

.hero-archive .hero-copy h1,
.hero-archive .hero-copy p {
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

.hero-archive .eyebrow {
  color: #d9d5c8;
}

.hero-archive .btn-secondary {
  color: #f4eee1;
  border-color: #f4eee1;
  background: rgba(9, 15, 19, 0.26);
}

.hero-archive .btn-secondary:hover,
.hero-archive .btn-secondary:focus-visible {
  background: rgba(244, 238, 225, 0.18);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 2rem;
  align-items: start;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.11em;
  font-size: 0.78rem;
  color: var(--accent-soft);
  font-weight: 700;
  margin-bottom: 0.65rem;
}

.hero-text {
  max-width: 64ch;
  font-size: 1.08rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 1.7rem;
}

.btn {
  display: inline-block;
  text-decoration: none;
  padding: 0.75rem 1.2rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 600;
  transition: transform 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.btn:hover,
.btn:focus-visible {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--cta);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.16);
}

.btn-primary:hover,
.btn-primary:focus-visible {
  background: var(--cta-hover);
}

.btn-secondary {
  color: #2d4740;
  border-color: #2d4740;
  background: rgba(255, 255, 255, 0.68);
}

.btn-secondary:hover,
.btn-secondary:focus-visible {
  background: rgba(71, 96, 89, 0.09);
}

.hero-card {
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.8), rgba(246, 239, 225, 0.96));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.3rem 1.3rem 1.2rem;
}

.author-figure {
  margin: 0 0 1rem;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(46, 74, 67, 0.26);
  box-shadow: 0 8px 20px rgba(29, 30, 24, 0.15);
}

.author-figure img {
  width: 100%;
  max-height: 380px;
  object-fit: cover;
  object-position: center top;
  display: block;
}

.author-meta {
  color: var(--accent-soft);
  font-weight: 600;
  margin-bottom: 0.7rem;
}

.hero-card h2 {
  margin-bottom: 0.65rem;
  font-size: 1.45rem;
}

.hero-card ul {
  margin: 1rem 0 0;
  padding-left: 1.2rem;
}

.section {
  padding: 4rem 0;
}

.section-alt {
  background: linear-gradient(to bottom, rgba(207, 196, 169, 0.24), rgba(207, 196, 169, 0.1));
  border-block: 1px solid var(--line);
}

.service-grid {
  margin-top: 1.7rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.service-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.1rem 0.8rem;
}

.service-card-link {
  margin-bottom: 0.2rem;
}

.service-card-link a {
  color: var(--accent);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.service-card-link a:hover,
.service-card-link a:focus-visible {
  color: #253b34;
}

.service-hero {
  padding: clamp(2.8rem, 5vw, 4.2rem) 0;
  background:
    linear-gradient(112deg, rgba(17, 24, 27, 0.8), rgba(28, 38, 43, 0.64) 58%, rgba(24, 33, 39, 0.7)),
    url("assets/genealogy/one.webp") center / cover no-repeat;
  border-bottom: 1px solid rgba(245, 237, 220, 0.2);
  color: #f5efe2;
}

.service-hero h1,
.service-hero p {
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

.breadcrumb {
  margin-bottom: 1rem;
  font-size: 0.9rem;
  color: #d9d5c8;
}

.breadcrumb a {
  color: #f5efe2;
}

.service-hero .eyebrow {
  color: #d9d5c8;
}

.service-highlights {
  margin: 1.2rem 0 0;
  padding-left: 1.2rem;
}

.service-layout {
  display: grid;
  grid-template-columns: 1.5fr 0.85fr;
  gap: 1rem;
}

.service-panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.service-panel h2 {
  margin-bottom: 0.7rem;
}

.service-list {
  margin: 0;
  padding-left: 1.2rem;
}

.service-list li {
  margin-bottom: 0.45rem;
}

.service-aside {
  display: grid;
  gap: 1rem;
  align-content: start;
}

.service-aside-media {
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.8), rgba(246, 239, 225, 0.96));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 0.75rem;
}

.service-aside-figure {
  margin: 0;
}

.service-aside-figure img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 10px;
  border: 1px solid rgba(46, 74, 67, 0.22);
  box-shadow: 0 8px 20px rgba(29, 30, 24, 0.14);
  background: #e8dfcb;
}

.service-aside-figure figcaption {
  margin-top: 0.65rem;
  font-size: 0.92rem;
  line-height: 1.45;
  color: var(--muted);
}

.service-aside .hero-card {
  position: sticky;
  top: 94px;
}

.related-services {
  display: grid;
  gap: 0.55rem;
}

.related-services a {
  color: var(--accent);
  font-weight: 600;
}

.service-final-cta {
  margin-top: 0.2rem;
}

.process-grid,
.deliverables-grid {
  margin-top: 1.5rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.process-card,
.deliverable-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1rem;
}

.step {
  font-family: var(--serif);
  color: var(--accent);
  font-size: 0.94rem;
  margin-bottom: 0.35rem;
}

.process-visual {
  margin: 1.25rem 0 0;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: 0 10px 24px rgba(23, 22, 17, 0.12);
}

.process-visual img {
  width: 100%;
  max-height: 320px;
  object-fit: cover;
  display: block;
}

.section-cta {
  margin: 1.5rem 0 0;
}

.section-intro {
  color: var(--muted);
  max-width: 64ch;
}

.books-grid {
  margin-top: 1.6rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.book-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 10px 26px rgba(31, 30, 24, 0.1);
  overflow: hidden;
}

.book-thumb {
  width: 100%;
  aspect-ratio: 1 / 1;
  padding: 0;
  border: 0;
  display: block;
  background: #e8dfcb;
  cursor: zoom-in;
  overflow: hidden;
  position: relative;
}

.book-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #e8dfcb;
}

.book-card h3 {
  font-size: 1.08rem;
  padding: 0.9rem 0.9rem 0.4rem;
  margin: 0;
}

.book-card p {
  margin: 0;
  padding: 0 0.9rem 1rem;
  color: #454940;
  font-size: 0.95rem;
}

.faq-list {
  display: grid;
  gap: 0.7rem;
  margin-top: 1.2rem;
}

.faq-list details {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  padding: 0.75rem 0.9rem;
}

.faq-list summary {
  cursor: pointer;
  font-weight: 700;
}

.faq-list summary::marker {
  color: var(--accent);
}

.faq-list details p {
  margin: 0.7rem 0 0;
}

.book-modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  z-index: 50;
}

.book-modal.is-open {
  visibility: visible;
  opacity: 1;
}

.book-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(18, 25, 30, 0.74);
}

.book-modal__content {
  position: relative;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  width: min(860px, 92vw);
  max-height: 92vh;
  overflow: auto;
  padding: 0.9rem;
  box-shadow: 0 16px 40px rgba(8, 12, 14, 0.35);
}

.book-modal__close {
  appearance: none;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  cursor: pointer;
  margin-left: auto;
  display: block;
}

.book-modal__figure {
  margin: 0.7rem 0 0;
}

.book-modal__figure img {
  width: 100%;
  max-height: 76vh;
  object-fit: contain;
  background: #efe7d4;
  border-radius: 8px;
}

.book-modal__figure figcaption {
  margin-top: 0.7rem;
  color: var(--ink);
  font-weight: 600;
}

body.modal-open {
  overflow: hidden;
}

.contact {
  padding-top: 4.2rem;
}

.contact-box {
  background: linear-gradient(145deg, rgba(49, 75, 67, 0.97), rgba(58, 84, 95, 0.97));
  color: #f7f5ef;
  border-radius: var(--radius);
  padding: 2rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
  align-items: start;
  box-shadow: var(--shadow);
}

.contact .eyebrow {
  color: #d7dfd8;
}

.contact-intro {
  display: grid;
  gap: 0.2rem;
}

address {
  font-style: normal;
  background: rgba(245, 239, 226, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 12px;
  padding: 1rem;
}

address p {
  margin-bottom: 0.65rem;
}

address span {
  display: inline-block;
  min-width: 6rem;
  font-weight: 700;
}

address a {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 2px;
}

address .email-image {
  vertical-align: middle;
  height: 1rem;
}

.contact-btn {
  margin-top: 0.75rem;
  background: #f3ecdd;
  color: #25353a;
}

.contact-btn:hover,
.contact-btn:focus-visible {
  background: #fff;
}

.contact-form {
  background: rgba(244, 239, 227, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 12px;
  padding: 1rem;
  display: grid;
  gap: 0.65rem;
  position: relative;
}

.contact-form label {
  font-weight: 700;
  font-size: 0.94rem;
  color: #f3f6f4;
}

.contact-form input,
.contact-form select,
.contact-form textarea {
  width: 100%;
  font: inherit;
  color: #1f2a2e;
  border: 1px solid rgba(40, 52, 58, 0.4);
  border-radius: 8px;
  padding: 0.6rem 0.65rem;
  background: #f8f3ea;
}

.contact-form textarea {
  resize: vertical;
  min-height: 120px;
}

.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.contact-form .cf-turnstile {
  margin-top: 0.2rem;
}

.contact-form .btn {
  justify-self: start;
}

.contact-form .btn:disabled {
  opacity: 0.72;
  cursor: wait;
}

.form-note {
  margin: -0.1rem 0 0;
  font-size: 0.88rem;
  color: #e8f0eb;
}

.form-note a {
  color: #f6f0e2;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.form-feedback {
  margin: 0;
  font-size: 0.92rem;
  color: #e8f2ed;
  min-height: 1.3rem;
}

.form-feedback.is-success {
  color: #d9f4e8;
}

.form-feedback.is-error {
  color: #ffd8d8;
}

.site-footer {
  border-top: 1px solid var(--line);
  margin-top: 3.8rem;
  padding: 1.4rem 0 1.9rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.site-footer a {
  color: #2f4a42;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.footer-branding {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0;
}

.footer-branding img {
  display: block;
  width: auto;
  height: 34px;
}

.footer-branding span {
  color: var(--muted);
}

.site-credit {
  width: 100%;
  margin: 0;
  padding-top: 0.25rem;
  font-size: 0.86rem;
  color: var(--muted);
}

.site-credit a {
  color: #2f4a42;
}

.legal-links {
  width: 100%;
  margin: 0;
  font-size: 0.9rem;
}

.legal-page {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: clamp(1.1rem, 2.5vw, 2rem);
}

.legal-page h1 {
  margin-bottom: 1rem;
}

.legal-page h2 {
  font-size: 1.25rem;
  margin: 1.2rem 0 0.55rem;
}

@media (max-width: 940px) {
  .hero-grid,
  .contact-box {
    grid-template-columns: 1fr;
  }

  .service-layout {
    grid-template-columns: 1fr;
  }

  .service-aside .hero-card {
    position: static;
  }

  .books-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .header-inner {
    min-height: auto;
    flex-wrap: wrap;
    justify-content: space-between;
    padding: 0.72rem 0;
    row-gap: 0.65rem;
  }

  .brand-logo img {
    height: 54px;
  }

  body.is-scrolled .brand-logo img {
    height: 50px;
  }

  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .site-nav {
    order: 3;
    width: 100%;
    margin-left: 0;
  }

  .site-nav .nav-list {
    display: none;
  }

  .site-nav.is-open .nav-list {
    display: grid;
    gap: 0.3rem;
    align-items: stretch;
    margin-top: 0.2rem;
    padding: 0.6rem;
    background: rgba(252, 248, 239, 0.98);
    border: 1px solid var(--line);
    border-radius: 12px;
  }

  .nav-list a,
  .nav-link {
    width: 100%;
    text-align: left;
  }

  .has-dropdown {
    position: static;
  }

  .nav-dropdown {
    position: static;
    width: 100%;
    opacity: 1;
    visibility: visible;
    transform: none;
    pointer-events: auto;
    box-shadow: none;
    display: none;
    margin-top: 0.35rem;
  }

  .has-dropdown.is-open .nav-dropdown {
    display: block;
  }

  .header-contact {
    margin-left: auto;
    gap: 0.62rem;
    flex-direction: row;
    flex-wrap: wrap;
    line-height: 1.25;
    justify-content: flex-end;
    font-size: 0.95rem;
  }

  .email-image {
    height: 1rem;
  }

  .section {
    padding: 3.3rem 0;
  }

  .contact-box {
    padding: 1.3rem;
  }

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

  .hero-actions .btn,
  .contact-form .btn {
    width: 100%;
    text-align: center;
  }

  .contact-form {
    padding: 0.9rem;
  }

  .book-modal__close {
    padding-inline: 0.6rem;
  }

  .footer-branding {
    width: 100%;
    justify-content: center;
  }

  .footer-branding span {
    text-align: center;
  }

  .site-credit {
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  * {
    transition: none !important;
    animation: none !important;
  }
}
