:root {
  --bg: #F7F6FB;
  --surface: #FFFFFF;
  --ink: #1F2028;
  --muted: #5B5D6B;
  --accent: #4F46E5;
  --accent-deep: #4338CA;
  --accent-soft: rgba(79, 70, 229, 0.10);
  --line: rgba(31, 32, 40, 0.10);
  --dark: #0E0E16;
  --dark-ink: #E9E9F2;
  --dark-muted: #A0A1B4;
  --radius-card: 20px;
  --radius-field: 12px;
  --radius-pill: 999px;
  --sans: "Avenir Next", Avenir, "Segoe UI Variable Display", ui-sans-serif,
          -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --dot: radial-gradient(circle, rgba(31, 32, 40, 0.055) 1px, transparent 1px);
  --dot-light: radial-gradient(circle, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.05rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2 {
  font-weight: 300;
  letter-spacing: -0.02em;
  margin: 0;
}

h3 {
  font-size: 1.12rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  margin: 0 0 10px;
}

p { margin: 0 0 16px; }
p:last-child { margin-bottom: 0; }

.wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

.wrap.narrow { max-width: 680px; }

.eyebrow {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 14px;
}

/* ---------- floating pill nav ---------- */

.nav {
  position: fixed;
  top: 14px;
  left: 14px;
  right: 14px;
  z-index: 50;
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 12px 10px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  box-shadow: 0 8px 30px rgba(31, 32, 40, 0.08);
}

.nav .wordmark {
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}

/* ---------- wordmark treatments ----------

   Three system-font typographic treatments for the "Fathom" wordmark.
   No web fonts by design — the page makes zero external network requests,
   so Google Fonts is deliberately not used here.

   Option 1 is ACTIVE. To swap: change the class on the <a class="wordmark ...">
   in index.html and thanks.html, then uncomment the matching block below.

   ── Option 1 — Tight weight contrast (ACTIVE) ──────────────────────
   Heavier and more tightly tracked than body text, with a small indigo
   period. Reads as a mark, not a link. Closest to the site's existing feel.

     <a class="wordmark wordmark-option-1" href="#top">Fathom<span
        class="wordmark-dot" aria-hidden="true">.</span></a>

   ── Option 2 — Spaced caps ─────────────────────────────────────────
   Uppercase, small, widely tracked. Quietest and most editorial; echoes
   the .eyebrow treatment used above every h2.

     <a class="wordmark wordmark-option-2" href="#top">Fathom</a>

     .nav .wordmark-option-2 {
       font-size: 0.78rem;
       font-weight: 600;
       letter-spacing: 0.18em;
       text-transform: uppercase;
     }

   ── Option 3 — Serif contrast ──────────────────────────────────────
   System serif against the sans body. Most distinct of the three;
   slightly more traditional / advisory in tone.

     <a class="wordmark wordmark-option-3" href="#top">Fathom</a>

     .nav .wordmark-option-3 {
       font-family: ui-serif, Georgia, "Iowan Old Style", "Times New Roman", serif;
       font-size: 1.2rem;
       font-weight: 400;
       letter-spacing: -0.01em;
     }

   ------------------------------------------------------------------ */

.nav .wordmark-option-1 {
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -0.025em;
}

.nav .wordmark-option-1 .wordmark-dot {
  color: var(--accent);
  margin-left: 1px;
}

.nav .btn { padding: 9px 20px; font-size: 0.9rem; }

/* ---------- nav section links ---------- */

.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  white-space: nowrap;
  transition: color 0.15s ease;
}

.nav-links a:hover,
.nav-links a:focus-visible {
  color: var(--ink);
}

/* ---------- buttons ---------- */

.btn {
  display: inline-block;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  padding: 14px 30px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease,
              border-color 0.15s ease, color 0.15s ease;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 6px 18px rgba(79, 70, 229, 0.25);
}

.btn-primary:hover {
  background: var(--accent-deep);
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(79, 70, 229, 0.30);
}

.btn-ghost {
  background: transparent;
  color: var(--accent);
  border-color: rgba(79, 70, 229, 0.35);
}

.btn-ghost:hover {
  background: var(--accent-soft);
  transform: translateY(-1px);
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- hero ---------- */

.hero {
  position: relative;
  padding: 168px 0 104px;
  text-align: center;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--dot);
  background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(ellipse at 50% 30%, #000 0%, transparent 72%);
  mask-image: radial-gradient(ellipse at 50% 30%, #000 0%, transparent 72%);
  pointer-events: none;
  z-index: 0;
}

.hero::after {
  content: "";
  position: absolute;
  top: -12%;
  left: 50%;
  transform: translateX(-50%);
  width: 900px;
  max-width: 130%;
  height: 620px;
  background: radial-gradient(ellipse at 50% 40%, var(--accent-soft), transparent 65%);
  pointer-events: none;
  z-index: 0;
}

.hero h1 {
  font-weight: 400;
  font-size: clamp(2.6rem, 6.5vw, 4.4rem);
  line-height: 1.05;
  margin-bottom: 24px;
}

.hero-desc {
  font-size: 1.15rem;
  color: var(--muted);
  max-width: 560px;
  margin: 0 auto 34px;
}

/* ---------- sections ---------- */

.section { padding: 72px 0; }

.section h2 {
  font-size: clamp(1.7rem, 3.2vw, 2.3rem);
  line-height: 1.2;
  margin-bottom: 18px;
}

.section-title { margin-bottom: 12px; }

.section-lede {
  color: var(--muted);
  max-width: 620px;
  margin-bottom: 36px;
}

/* the Services intro runs the full container width */
#services .section-lede { max-width: none; }

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

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 36px;
  box-shadow: 0 2px 10px rgba(31, 32, 40, 0.04);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 32px rgba(31, 32, 40, 0.08);
}

.card h2 { font-size: clamp(1.4rem, 2.4vw, 1.75rem); }

.card p { color: var(--muted); }
.card p:first-of-type { color: var(--ink); }
.card .eyebrow { color: var(--accent); }

.icon-box {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.icon-box svg { display: block; }

/* ---------- about ---------- */

.about-card {
  display: flex;
  align-items: flex-start;
  gap: 28px;
}

.about-body { min-width: 0; }

.avatar {
  flex: 0 0 auto;
  width: 132px;
  height: 132px;
  border-radius: 18px;
  object-fit: cover;
  display: block;
}

.avatar-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  border: 1px dashed rgba(79, 70, 229, 0.30);
  color: var(--accent);
}

/* ---------- services ---------- */

.service-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.service {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 24px 22px;
  box-shadow: 0 2px 10px rgba(31, 32, 40, 0.04);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.service .icon-box {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  margin-bottom: 16px;
}

.service:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 32px rgba(31, 32, 40, 0.08);
}

.service p { color: var(--muted); font-size: 1rem; }

.service-note {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  width: 100%;
  margin: 28px 0 0;
  padding: 2px 0 2px 18px;
  border-left: 2px solid rgba(79, 70, 229, 0.30);
}

.service-note p {
  margin: 0;
  font-size: 0.98rem;
  color: var(--muted);
}

.service-note-icon {
  flex: 0 0 auto;
  color: var(--accent);
  line-height: 0;
  padding-top: 4px;
}

.service-note-icon svg { display: block; }

/* ---------- faq ---------- */

.faq {
  border-top: 1px solid var(--line);
}

.faq details {
  border-bottom: 1px solid var(--line);
}

.faq summary {
  list-style: none;
  cursor: pointer;
  padding: 20px 40px 20px 0;
  position: relative;
  font-size: 1.02rem;
  font-weight: 500;
  color: var(--ink);
}

.faq summary::-webkit-details-marker { display: none; }

.faq summary::after {
  content: "";
  position: absolute;
  right: 8px;
  top: 50%;
  width: 9px;
  height: 9px;
  border-right: 1.5px solid var(--accent);
  border-bottom: 1.5px solid var(--accent);
  transform: translateY(-70%) rotate(45deg);
  transition: transform 0.2s ease;
}

.faq details[open] summary::after {
  transform: translateY(-30%) rotate(225deg);
}

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

.faq details p {
  color: var(--muted);
  padding: 0 40px 22px 0;
  margin: 0;
}

/* ---------- footer ---------- */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 28px 0;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 18px;
}

.footer-copy {
  margin: 0;
  /* pushes the footer links into a group on the right, so a second link
     (Privacy) does not land in the middle under space-between */
  margin-right: auto;
  font-size: 0.9rem;
  color: var(--muted);
}

.footer-link {
  font-size: 0.9rem;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  padding-bottom: 1px;
}

.footer-link:hover { color: var(--accent); border-bottom-color: var(--accent); }

/* ---------- dark inset panel ---------- */

.panel-dark {
  position: relative;
  background: var(--dark);
  color: var(--dark-ink);
  padding: 88px 0;
  overflow: hidden;
}

.panel-dark::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--dot-light);
  background-size: 22px 22px;
  pointer-events: none;
  z-index: 0;
}

.panel-dark::after {
  content: "";
  position: absolute;
  top: -30%;
  left: 50%;
  transform: translateX(-50%);
  width: 820px;
  max-width: 140%;
  height: 560px;
  background: radial-gradient(ellipse at 50% 50%, rgba(79, 70, 229, 0.30), transparent 65%);
  pointer-events: none;
  z-index: 0;
}

.panel-dark .eyebrow { color: #A5A0F5; }
.panel-dark h2 { color: #fff; }
.panel-dark p { color: var(--dark-muted); }

.steps {
  list-style: none;
  margin: 34px 0 30px;
  padding: 0;
  display: grid;
  gap: 20px;
}

.steps li {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.steps .icon-box {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.10);
  color: #A5A0F5;
  margin-bottom: 0;
  flex: 0 0 44px;
}

.steps strong {
  display: block;
  font-weight: 500;
  color: #fff;
  margin-bottom: 2px;
}

.steps span { color: var(--dark-muted); }

.panel-note {
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  color: #fff;
  border-top: 1px solid rgba(255, 255, 255, 0.10);
  padding-top: 24px;
}

/* ---------- contact ---------- */

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

.contact::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 900px;
  max-width: 140%;
  height: 520px;
  background: radial-gradient(ellipse at 50% 30%, var(--accent-soft), transparent 65%);
  pointer-events: none;
  z-index: 0;
}

.contact h2 { margin-bottom: 12px; }
.contact .lede { color: var(--muted); margin-bottom: 32px; }

form {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 32px;
  box-shadow: 0 2px 10px rgba(31, 32, 40, 0.04);
}

.field { margin-bottom: 20px; }

.field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 7px;
}

.field input,
.field textarea {
  width: 100%;
  font-family: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-field);
  padding: 13px 15px;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.field input:hover,
.field textarea:hover { border-color: rgba(31, 32, 40, 0.20); }

.field input:focus,
.field textarea:focus {
  background: var(--surface);
  border-color: var(--accent);
}

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

.form-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
  margin-top: 4px;
}

.book-link {
  color: var(--accent);
  font-size: 0.95rem;
  text-decoration: none;
  border-bottom: 1px solid rgba(79, 70, 229, 0.30);
  padding-bottom: 1px;
}

.book-link:hover { color: var(--accent-deep); border-bottom-color: var(--accent-deep); }

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

/* ---------- reveal ---------- */

.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.reveal.in {
  opacity: 1;
  transform: none;
}

/* ---------- sticky mobile CTA ---------- */

.sticky-cta { display: none; }

@media (max-width: 940px) {
  .service-list { grid-template-columns: repeat(2, 1fr); }
  .nav-links { gap: 18px; }
  .nav-links a { font-size: 0.85rem; }
}

/* the pill nav has no room for section links on narrow screens */
@media (max-width: 820px) {
  .nav-links { display: none; }
}

@media (max-width: 560px) {
  .service-list { grid-template-columns: 1fr; }

  .about-card {
    flex-direction: column;
    gap: 20px;
  }
}

@media (max-width: 720px) {
  .hero { padding: 132px 0 76px; }
  .section { padding: 52px 0; }
  .panel-dark { padding: 64px 0; }
  .card, form { padding: 26px; }
  .card-grid { grid-template-columns: 1fr; gap: 18px; }

  .nav { padding: 8px 10px 8px 18px; }
  .nav .btn { padding: 8px 16px; font-size: 0.85rem; }

  .service { padding: 22px 24px; }
  .contact { padding: 64px 0 72px; }
  .site-footer { padding: 24px 0 calc(96px + env(safe-area-inset-bottom)); }

  .btn-row { flex-direction: column; align-items: stretch; }
  .btn-row .btn { text-align: center; }

  .sticky-cta {
    display: block;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 40;
    background: rgba(247, 246, 251, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--line);
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  }

  .sticky-cta .btn { display: block; text-align: center; }
}

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

  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }

  .reveal { opacity: 1; transform: none; }
}

/* ---------- backdrop-filter fallback ----------
   Without backdrop-filter support, .nav and .sticky-cta are translucent
   bars with no blur, so page content scrolls visibly through them and the
   wordmark loses legibility against the dot grid. Both are fixed-position,
   so this persists for the whole session rather than a moment.
   Placed last so it outranks the .sticky-cta rule inside the 720px query. */

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .nav { background: rgba(255, 255, 255, 0.94); }
  .sticky-cta { background: rgba(247, 246, 251, 0.97); }
}
