/* ============================================================
   Family Tree Studio — landing page
   The section/element visual styling is kept inline in index.html
   (faithful to the approved Claude design). This stylesheet owns the
   cross-cutting concerns: base reset, fonts, interaction, responsive
   behaviour, hover/focus polish and accessibility.
   ============================================================ */

/* ---------- Base ---------- */
* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  /* `clip` instead of `hidden` so the sticky nav keeps working */
  overflow-x: clip;
  background: #fbfdfe;
  color: #213f48;
  font-family: 'Manrope', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

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

/* ---------- Hover / focus polish (design has none — added tastefully) ---------- */

/* Pill buttons (anchors that carry their own radius + shadow) */
a[style*="border-radius"][style*="box-shadow"] {
  transition: transform .16s ease, box-shadow .16s ease, filter .16s ease;
}
a[style*="border-radius"][style*="box-shadow"]:hover {
  transform: translateY(-2px);
}

/* Button-like spans inside anchors (e.g. pricing tiles) */
a > span[style*="border-radius"] {
  transition: filter .16s ease, transform .16s ease;
}
a:hover > span[style*="border-radius"] {
  filter: brightness(1.04);
}

/* App-store buttons */
.store-btn { transition: transform .16s ease, box-shadow .16s ease; }
.store-btn:hover { transform: translateY(-2px); }

/* Nav text links */
.nav-links a { transition: color .16s ease; }
.nav-links a:hover { color: #12414c; }

/* Nav primary CTA */
.nav-cta { transition: transform .16s ease, background .16s ease, box-shadow .16s ease; }
.nav-cta:hover { transform: translateY(-2px); background: #0e3742; }

/* Footer links */
footer a { transition: color .16s ease; }
footer a:hover { color: #ffffff; }

/* Keyboard focus */
a:focus-visible,
button:focus-visible,
summary:focus-visible {
  outline: 2px solid #2e6675;
  outline-offset: 3px;
  border-radius: 6px;
}
.faq-q:focus-visible { outline-offset: -3px; }

/* ---------- FAQ accordion (native <details>, no JS needed) ---------- */
.faq-item { border-bottom: 1px solid rgba(28, 78, 90, .1); }

.faq-q {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 4px;
  font-family: 'Manrope', sans-serif;
  font-size: 19px;
  font-weight: 600;
  color: #10333d;
  -webkit-tap-highlight-color: transparent;
}
.faq-q::-webkit-details-marker { display: none; }
.faq-q::marker { content: ""; }

.faq-sign {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #eaf4f9;
  color: #2e6675;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 500;
  line-height: 1;
  transition: background .18s ease;
}
.faq-sign::before { content: "+"; }
.faq-item[open] .faq-sign { background: #dceef6; }
.faq-item[open] .faq-sign::before { content: "\2013"; } /* en dash */

.faq-a {
  padding: 0 46px 26px 4px;
  font-size: 16px;
  line-height: 1.65;
  color: #4d7480;
}
.faq-item[open] .faq-a { animation: faq-reveal .22s ease; }
@keyframes faq-reveal {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- Mobile nav ---------- */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px;
  height: 40px;
  padding: 0 9px;
  background: rgba(255, 255, 255, .6);
  border: 1px solid rgba(28, 78, 90, .12);
  border-radius: 11px;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  border-radius: 2px;
  background: #2e5560;
  transition: transform .2s ease, opacity .2s ease;
}
.site-nav.open .nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.site-nav.open .nav-toggle span:nth-child(2) { opacity: 0; }
.site-nav.open .nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 820px) {
  .nav-toggle { display: inline-flex; }

  /* !important overrides the design's inline flex styles on the links row */
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0 !important;
    padding: 6px 24px 16px !important;
    background: rgba(251, 253, 254, .97);
    backdrop-filter: blur(16px) saturate(140%);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    border-bottom: 1px solid rgba(28, 78, 90, .08);
    box-shadow: 0 24px 44px -26px rgba(16, 51, 61, .38);
  }
  .site-nav.open .nav-links { display: flex !important; }

  .nav-links a {
    padding: 13px 4px;
    font-size: 16px;
    border-bottom: 1px solid rgba(28, 78, 90, .06);
  }
  .nav-links a:last-child { border-bottom: none; }
}

/* ---------- Tighter side padding on small screens ---------- */
@media (max-width: 560px) {
  .site-nav > div { padding-left: 20px !important; padding-right: 20px !important; }
  section { padding-left: 22px !important; padding-right: 22px !important; }
  footer  { padding-left: 22px !important; padding-right: 22px !important; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}

/* ---------- Pricing: Pro is the wider, equal-height centre column ---------- */
.pricing-grid {
  display: grid;
  gap: 24px;
  align-items: stretch;              /* all three cards share a height, buttons align */
  grid-template-columns: 1fr 1.22fr 1fr;   /* middle (Pro) column is widest */
}
@media (max-width: 900px) {
  .pricing-grid { grid-template-columns: 1fr; }   /* stack on tablet/phone */
}

/* ============================================================
   Legal pages (privacy.html, terms.html)
   Shared, readable long-form styling in the site's calm palette.
   ============================================================ */
.legal-hero {
  background: linear-gradient(180deg, #fbfdfe, #f1f9fd);
  padding: clamp(56px, 6vw, 92px) 40px clamp(40px, 5vw, 60px);
  scroll-margin-top: 76px;
}
.legal-hero-inner { max-width: 760px; margin: 0 auto; }
.legal-eyebrow {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 12.5px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: #3a8fb0;
}
.legal-hero h1 {
  margin: 14px 0 0;
  font-family: 'Newsreader', serif;
  font-weight: 500;
  font-size: clamp(34px, 5vw, 52px);
  line-height: 1.08;
  letter-spacing: -.02em;
  color: #10333d;
}
.legal-meta {
  margin: 18px 0 0;
  font-size: 14.5px;
  color: #5c7d87;
}

.legal-body {
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(40px, 5vw, 64px) 40px clamp(64px, 8vw, 96px);
  font-size: 16.5px;
  line-height: 1.68;
  color: #34565f;
}
.legal-body h2 {
  margin: 46px 0 14px;
  font-family: 'Newsreader', serif;
  font-weight: 600;
  font-size: 25px;
  line-height: 1.2;
  letter-spacing: -.01em;
  color: #12414c;
  scroll-margin-top: 84px;
}
.legal-body h2:first-of-type { margin-top: 8px; }
.legal-body h3 {
  margin: 30px 0 10px;
  font-family: 'Manrope', sans-serif;
  font-weight: 700;
  font-size: 17.5px;
  color: #1c4e5a;
}
.legal-body p { margin: 0 0 16px; }
.legal-body ul { margin: 0 0 16px; padding-left: 22px; }
.legal-body li { margin: 0 0 8px; }
.legal-body a { color: #2e6675; text-decoration: underline; text-underline-offset: 2px; }
.legal-body a:hover { color: #12414c; }
.legal-body strong { color: #1c4e5a; font-weight: 700; }
.legal-body .lead {
  font-size: 18.5px;
  line-height: 1.6;
  color: #2e5560;
}
.legal-body .placeholder {
  background: #fff4d6;
  color: #7a5a12;
  padding: 1px 6px;
  border-radius: 5px;
  font-weight: 600;
  font-size: .95em;
}
.legal-toc {
  margin: 26px 0 4px;
  padding: 20px 24px;
  background: #f2f9fc;
  border: 1px solid rgba(28, 78, 90, .1);
  border-radius: 14px;
}
.legal-toc-title {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #4a6c76;
}
.legal-toc ol {
  margin: 12px 0 0;
  padding-left: 20px;
  columns: 2;
  column-gap: 32px;
  font-size: 15px;
}
.legal-toc li { margin: 0 0 7px; break-inside: avoid; }
.legal-toc a { color: #2e6675; text-decoration: none; }
.legal-toc a:hover { text-decoration: underline; }
@media (max-width: 560px) {
  .legal-hero, .legal-body { padding-left: 22px !important; padding-right: 22px !important; }
  .legal-toc ol { columns: 1; }
}
