/* ============================================
   ENHANCEMENTS — animations, mobile menu, refinements
   Loaded AFTER styles.css and pages.css so these win.
   ============================================ */

/* ─── Scroll-driven reveal animations ─────────────────────────── */
.section-reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.9s cubic-bezier(.2,.7,.2,1), transform 0.9s cubic-bezier(.2,.7,.2,1);
}
.section-reveal.in {
  opacity: 1;
  transform: translateY(0);
}
[data-reveal] {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
[data-reveal].in {
  opacity: 1;
  transform: translateY(0);
}
[data-reveal-stagger] {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
[data-reveal-stagger].in {
  opacity: 1;
  transform: translateY(0);
}
/* Don't animate hero — too jarring on first paint */
.hero.section-reveal,
.page-hero.section-reveal {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  .section-reveal, [data-reveal], [data-reveal-stagger] {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

/* ─── Subtle grain texture on cream sections ──────────────────── */
.values, .process, .testimonials, .gallery, .credentials, .itin-explain,
.itin-reqs, .faq-section, .guide-sections, .downloads-section,
.beliefs, .about-story, .booking-section, .calc-section, .press,
.idx-carousel-section, .valuation {
  position: relative;
}
.values::after, .process::after, .testimonials::after, .gallery::after,
.itin-explain::after, .itin-reqs::after, .faq-section::after,
.guide-sections::after, .downloads-section::after, .beliefs::after,
.about-story::after, .booking-section::after, .calc-section::after,
.idx-carousel-section::after, .valuation::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.45;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.04 0 0 0 0 0.12 0 0 0 0 0.24 0 0 0 0.6 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.6'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}
/* Make sure content sits above the texture */
.values > *, .process > *, .testimonials > *, .gallery > *, .itin-explain > *,
.itin-reqs > *, .faq-section > *, .guide-sections > *, .downloads-section > *,
.beliefs > *, .about-story > *, .booking-section > *, .calc-section > *,
.idx-carousel-section > *, .valuation > * { position: relative; z-index: 1; }

/* ─── Section transition: small decorative dot motif ─────────── */
.values, .process, .testimonials, .gallery, .credentials,
.itin-explain, .itin-reqs, .faq-section, .guide-sections,
.downloads-section, .beliefs, .about-story, .booking-section,
.calc-section, .idx-carousel-section, .valuation {
  /* Subtle top-center separator dot */
}
.values::before, .process::before, .gallery::before, .credentials::before,
.beliefs::before, .booking-section::before, .calc-section::before,
.downloads-section::before, .itin-reqs::before, .faq-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.4;
  z-index: 2;
}

/* ─── Nav: smoother transition & better scrolled state ────────── */
.nav {
  transition: all 0.4s cubic-bezier(.2,.7,.2,1);
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-bottom-color: var(--line);
  box-shadow:
    0 1px 0 rgba(10, 31, 61, 0.04),
    0 12px 32px -16px rgba(10, 31, 61, 0.16);
}
.nav.scrolled .nav-mark {
  transform: scale(0.92);
}
.nav-mark { transition: transform 0.3s ease; }

/* Burger animation — turns into X when open */
.nav-burger {
  position: relative;
  z-index: 110;
  width: 32px;
  height: 32px;
  justify-content: center;
}
.nav-burger span {
  transition: all 0.3s cubic-bezier(.2,.7,.2,1);
  transform-origin: center;
}
.nav-burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-burger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ─── Full-screen mobile menu overlay ────────────────────────── */
.nav-overlay {
  position: fixed;
  inset: 0;
  z-index: 105;
  background: rgba(10, 31, 61, 0.0);
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
  pointer-events: none;
  transition: background 0.5s ease, backdrop-filter 0.5s ease;
}
.nav-overlay.open {
  background: rgba(10, 31, 61, 0.85);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  pointer-events: auto;
}
.nav-overlay-inner {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: min(440px, 100%);
  background: var(--cream);
  display: flex;
  flex-direction: column;
  padding: 28px 28px 32px;
  transform: translateX(100%);
  transition: transform 0.5s cubic-bezier(.2,.7,.2,1);
  box-shadow: 0 0 80px -20px rgba(10, 31, 61, 0.4);
}
.nav-overlay.open .nav-overlay-inner {
  transform: translateX(0);
}
.nav-overlay-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: 24px;
}
.nav-overlay-close {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--cream-warm);
  display: flex; align-items: center; justify-content: center;
  color: var(--navy);
  transition: background 0.2s, transform 0.2s;
}
.nav-overlay-close:hover { background: var(--navy); color: var(--cream); transform: rotate(90deg); }
.nav-overlay-links {
  display: flex;
  flex-direction: column;
  flex: 1;
}
.nav-overlay-link {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 4px;
  border-bottom: 1px solid var(--line-soft);
  font-family: 'Playfair Display', serif;
  font-size: 24px;
  color: var(--navy);
  letter-spacing: -0.01em;
  transition: padding-left 0.2s, color 0.2s;
  opacity: 0;
  transform: translateX(20px);
}
.nav-overlay.open .nav-overlay-link {
  opacity: 1;
  transform: translateX(0);
  transition: opacity 0.5s ease, transform 0.5s ease, padding-left 0.2s, color 0.2s;
}
.nav-overlay-link:hover { padding-left: 12px; color: var(--accent); }
.nav-overlay-link.active { color: var(--accent); }
.nav-overlay-link.active .nav-overlay-link-num { color: var(--accent); }
.nav-overlay-link-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--ink-soft);
  font-style: normal;
  letter-spacing: 0.1em;
  width: 28px;
}
.nav-overlay-link-label { flex: 1; }
.nav-overlay-link-arrow {
  opacity: 0.3;
  transition: opacity 0.2s, transform 0.2s;
}
.nav-overlay-link:hover .nav-overlay-link-arrow { opacity: 1; transform: translateX(4px); }
.nav-overlay-foot {
  padding-top: 24px;
  border-top: 1px solid var(--line-soft);
  margin-top: 12px;
}
.nav-overlay-foot .lang-toggle {
  display: inline-flex;
  background: var(--cream-warm);
}
.nav-overlay-foot .nav-cta {
  display: flex;
  width: 100%;
  justify-content: center;
  padding: 18px 24px;
}
.nav-overlay-contact {
  margin-top: 24px;
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 13px;
  color: var(--ink-soft);
  flex-wrap: wrap;
}
.nav-overlay-contact a {
  color: var(--navy);
  font-weight: 500;
  transition: color 0.2s;
}
.nav-overlay-contact a:hover { color: var(--accent); }

/* Hide old mobile dropdown */
.nav-mobile { display: none !important; }

/* ─── Hero refinements for mobile ─────────────────────────────── */
@media (max-width: 1024px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 32px;
    padding: 96px 24px 48px;
    min-height: auto;
  }
  .hero-content { max-width: 100%; }
  .hero-title {
    font-size: clamp(40px, 9vw, 64px) !important;
    text-wrap: balance;
    margin-bottom: 24px;
  }
  .hero-subtitle {
    font-size: 17px;
    margin-bottom: 32px;
  }
  .hero-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .hero-actions .btn-primary,
  .hero-actions .btn-ghost {
    width: 100%;
    justify-content: center;
    text-align: center;
  }
  .hero-actions .btn-ghost {
    border-bottom: none;
    background: var(--cream-warm);
    border-radius: 999px;
    padding: 16px 24px;
  }
  .hero-stats {
    margin-top: 40px;
    padding-top: 24px;
    gap: 28px;
    justify-content: space-between;
  }
  .hero-stat-num { font-size: 28px; }
  .hero-stat-label { font-size: 10px; }

  .hero-portrait {
    height: auto;
    aspect-ratio: 4/5;
    max-width: 380px;
    margin: 0 auto;
    width: 100%;
  }
  .hero-portrait-frame {
    border-radius: 200px 200px 16px 16px;
  }
  .hero-portrait-tag {
    bottom: 16px;
    left: 16px;
    padding: 12px 16px;
    border-radius: 12px;
  }
  .hero-tag-mark { width: 36px; height: 36px; font-size: 16px; }
  .hero-tag-name { font-size: 14px; }
  .hero-tag-text { font-size: 11px; }
  .hero-floating-card {
    display: flex !important;
    top: 16px;
    right: 16px;
    padding: 10px 14px;
    border-radius: 12px;
  }
  .hero-floating-icon { width: 28px; height: 28px; border-radius: 8px; }
  .hero-floating-label { font-size: 9px; }
  .hero-floating-value { font-size: 14px; }
  .hero-bg-text {
    font-size: 160px;
    bottom: 20px;
    right: -20px;
  }
}
@media (max-width: 600px) {
  .hero { padding: 92px 20px 40px; }
  .hero-title { font-size: clamp(38px, 11vw, 56px) !important; }
  .hero-eyebrow { font-size: 10px; margin-bottom: 20px; }
  .hero-eyebrow::before { width: 20px; }
  .hero-stats {
    flex-wrap: wrap;
    gap: 20px;
  }
  .hero-stats > div { min-width: 30%; }
  .hero-portrait { max-width: 320px; }
}

/* ─── Typography refinements across all pages ─────────────────── */
h1, h2, h3, .section-title, .page-hero-title {
  text-wrap: balance;
}
p, .hero-subtitle, .section-desc, .about-body, .lm-desc, .belief-desc,
.guide-section-desc, .download-desc, .itin-req-desc, .itin-explain-text p,
.about-story-body p {
  text-wrap: pretty;
}
.section-title { line-height: 1.04; }
.hero-title { line-height: 0.94; }
.page-hero-title { line-height: 0.96; }
.section-desc, .hero-subtitle { line-height: 1.62; }

/* Slight letter-spacing tighter for large display type */
.serif, .hero-title, .section-title, .page-hero-title,
.about-story-title, .beliefs-title, .credentials-title,
.faq-title, .contact-title, .valuation-title, .itin-ready-title {
  letter-spacing: -0.022em;
}
/* Better script accent rendering */
.script-accent, .script {
  letter-spacing: 0;
  font-weight: 500;
}

/* ─── Better button hovers across the site ────────────────────── */
.btn-primary, .nav-cta, .form-submit, .download-btn {
  position: relative;
  overflow: hidden;
}
.btn-primary::before, .nav-cta::before, .form-submit::before, .download-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.12), transparent 50%);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.btn-primary:hover::before, .nav-cta:hover::before,
.form-submit:hover::before, .download-btn:hover::before { opacity: 1; }

/* ─── Smooth focus rings (accessibility) ──────────────────────── */
*:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}
button:focus-visible, a:focus-visible {
  outline-offset: 4px;
}
.form-input:focus-visible, .form-select:focus-visible,
.form-textarea:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 1px 0 0 var(--accent);
}

/* ─── Smooth scroll for anchor links ──────────────────────────── */
html { scroll-padding-top: 90px; }

/* ─── Marquee divider polish ──────────────────────────────────── */
.marquee {
  border-top: 1px solid rgba(255,255,255,0.05);
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.marquee-item { font-size: clamp(20px, 2.4vw, 32px); }
@media (max-width: 600px) {
  .marquee { padding: 20px 0; }
  .marquee-item { gap: 40px; }
  .marquee-track { gap: 40px; }
}

/* ─── Nav: fit 7 links comfortably ────────────────────────────── */
.nav-links { gap: 26px; }
@media (max-width: 1180px) and (min-width: 1025px) {
  .nav-links { gap: 18px; }
  .nav-link { font-size: 12px; letter-spacing: 0.05em; }
}

/* ═══ NEIGHBORHOOD PAGES ═══════════════════════════════════════ */

/* Town hero — full-bleed image with scrim */
.nb-hero {
  position: relative;
  min-height: 72vh;
  display: flex;
  align-items: flex-end;
  padding: 0 48px 64px;
  overflow: hidden;
  background: var(--navy);
}
.nb-hero-media { position: absolute; inset: 0; z-index: 0; }
.nb-hero-media img { width: 100%; height: 100%; object-fit: cover; }
.nb-hero-media image-slot { width: 100%; height: 100%; display: block; }
.nb-hub-media image-slot { width: 100%; height: 100%; display: block; }
.nb-hero-scrim {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(10,31,61,0.35) 0%, rgba(10,31,61,0.55) 55%, rgba(10,31,61,0.88) 100%);
}
.nb-hero-inner {
  position: relative; z-index: 1;
  max-width: 1400px; margin: 0 auto; width: 100%;
  color: var(--cream);
}
.nb-back {
  display: inline-block;
  font-size: 13px; letter-spacing: 0.04em;
  color: rgba(250,248,245,0.85);
  margin-bottom: 28px;
  transition: color 0.2s;
}
.nb-back:hover { color: #fff; }
.nb-hero-county {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}
.nb-hero-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(52px, 8vw, 104px);
  line-height: 0.95; letter-spacing: -0.02em;
  margin-bottom: 18px;
}
.nb-hero-tagline {
  font-size: clamp(17px, 2vw, 22px);
  line-height: 1.5; max-width: 60ch;
  color: rgba(250,248,245,0.92);
}
.nb-hero-credit {
  margin-top: 18px;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: rgba(250,248,245,0.6);
}

/* Overview + highlights */
.nb-overview { padding: 100px 48px; background: var(--cream); }
.nb-overview-inner {
  max-width: 1400px; margin: 0 auto;
  display: grid; grid-template-columns: 1.4fr 1fr; gap: 72px; align-items: start;
}
.nb-overview-text .section-eyebrow { margin-bottom: 20px; }
.nb-overview-text p {
  font-size: 18px; line-height: 1.7; color: var(--ink); margin-bottom: 20px;
}
.nb-overview-text p:last-child { margin-bottom: 0; }
.nb-highlights {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
}
.nb-highlight {
  background: #fff; border: 1px solid var(--line-soft);
  border-radius: 16px; padding: 22px 20px;
  transition: border-color 0.25s, transform 0.25s;
}
.nb-highlight:hover { border-color: var(--accent); transform: translateY(-3px); }
.nb-highlight-label {
  font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--accent); font-weight: 700; margin-bottom: 8px;
}
.nb-highlight-value {
  font-family: 'Playfair Display', serif; font-size: 17px;
  color: var(--navy); line-height: 1.3;
}

/* Kellen's note */
.nb-note-section { padding: 0 48px 100px; background: var(--cream); }
.nb-note {
  max-width: 1000px; margin: 0 auto;
  background: var(--navy); color: var(--cream);
  border-radius: 24px; padding: 56px 56px 48px; position: relative;
}
.nb-note-mark {
  font-family: 'Playfair Display', serif; font-size: 90px;
  color: var(--accent); line-height: 0.6; height: 36px;
}
.nb-note-text {
  font-family: 'Playfair Display', serif;
  font-size: clamp(20px, 2.4vw, 28px); line-height: 1.45;
  color: var(--cream); margin-bottom: 28px; font-style: italic;
}
.nb-note-author { display: flex; flex-direction: column; gap: 2px; }
.nb-note-name { font-family: 'Caveat', cursive; font-size: 30px; color: var(--accent); }
.nb-note-role { font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: rgba(250,248,245,0.6); }

/* CTA row override (two buttons) */
.nb-cta-row { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; align-items: center; }

/* "Explore more areas" */
.nb-more { padding: 100px 48px; background: var(--cream-warm); }
.nb-more-inner { max-width: 1400px; margin: 0 auto; }
.nb-more-inner .section-eyebrow { margin-bottom: 28px; }
.nb-more-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.nb-more-card {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: #fff; border: 1px solid var(--line-soft); border-radius: 14px;
  padding: 20px 22px; color: var(--navy);
  font-family: 'Playfair Display', serif; font-size: 18px;
  transition: all 0.25s;
}
.nb-more-card:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-3px); }
.nb-more-card svg { color: var(--accent); flex-shrink: 0; }

/* Hub page grid */
.nb-hub { padding: 20px 48px 120px; background: var(--cream); }
.nb-hub-grid {
  max-width: 1400px; margin: 0 auto;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px;
}
.nb-hub-card {
  background: #fff; border: 1px solid var(--line-soft);
  border-radius: 20px; overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform 0.35s, box-shadow 0.35s, border-color 0.35s;
}
.nb-hub-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 40px 80px -34px rgba(10,31,61,0.28);
  border-color: var(--accent);
}
.nb-hub-media { position: relative; aspect-ratio: 3/2; overflow: hidden; }
.nb-hub-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s; }
.nb-hub-card:hover .nb-hub-media img { transform: scale(1.05); }
.nb-hub-county {
  position: absolute; top: 14px; left: 14px;
  background: rgba(250,248,245,0.92); color: var(--navy);
  font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 600;
  padding: 6px 12px; border-radius: 999px;
}
.nb-hub-body { padding: 26px 26px 28px; display: flex; flex-direction: column; flex: 1; }
.nb-hub-name { font-family: 'Playfair Display', serif; font-size: 28px; color: var(--navy); margin-bottom: 10px; letter-spacing: -0.01em; }
.nb-hub-tagline { font-size: 14.5px; line-height: 1.55; color: var(--ink-soft); margin-bottom: 20px; flex: 1; }
.nb-hub-link {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 600;
  color: var(--accent);
}

@media (max-width: 1024px) {
  .nb-hero { padding: 0 24px 48px; min-height: 60vh; }
  .nb-overview, .nb-note-section, .nb-more, .nb-hub { padding-left: 24px; padding-right: 24px; }
  .nb-overview-inner { grid-template-columns: 1fr; gap: 40px; }
  .nb-note { padding: 40px 32px 36px; }
  .nb-more-grid { grid-template-columns: repeat(2, 1fr); }
  .nb-hub-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .nb-highlights { grid-template-columns: 1fr 1fr; }
  .nb-more-grid { grid-template-columns: 1fr; }
  .nb-hub-grid { grid-template-columns: 1fr; }
}

/* ─── TCPA / SMS consent checkbox on lead forms ───────────────── */
.form-consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 18px;
  cursor: pointer;
}
.form-consent-box {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  accent-color: var(--accent);
  cursor: pointer;
}
.form-consent-text {
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink-soft);
}
.form-consent:hover .form-consent-text { color: var(--ink); }

/* ─── Footer EHO logo + brokerage line ────────────────────────── */
.footer-bottom-left { display: flex; align-items: center; gap: 16px; }
.footer-eho-logo { height: 26px; width: auto; opacity: 0.9; flex-shrink: 0; }
.footer-brokerage { font-size: 12px; color: rgba(250,248,245,0.5); letter-spacing: 0.03em; }
.footer-brokerage a { color: inherit; transition: color 0.2s; }
.footer-brokerage a:hover { color: var(--accent); }
@media (max-width: 760px) {
  .footer-bottom-left { flex-direction: column; gap: 10px; }
  .footer-brokerage { text-align: center; }
}
