/* Shared sizing and touch improvements for the home and legal pages. */
html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 6rem;
}

body { overflow-wrap: anywhere; }
img { max-width: 100%; }
.topbar-brand, .topbar nav, .service, .contact-info .row > * { min-width: 0; }
.topbar nav a, footer a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}
a:focus-visible, button:focus-visible {
  outline: 3px solid var(--accent-color);
  outline-offset: 4px;
}

/* Keep the visual dots small but give each one a finger-sized hit area. */
.slider-dots { gap: 0; bottom: 1rem; }
.slider-dots button,
.slider-dots button.active {
  position: relative;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.slider-dots button::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 9px;
  height: 9px;
  border: 1.5px solid var(--primary-color);
  border-radius: 50%;
}
.slider-dots button.active::after {
  width: 22px;
  border-radius: 5px;
  background: var(--primary-color);
}

@media (max-width: 1000px) {
  /* An in-flow header accommodates wrapping and enlarged phone text. */
  .topbar, .topbar.scrolled {
    position: relative;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.25rem 1.5rem;
    padding: 0.75rem 1.25rem;
    background: var(--card-color);
    box-shadow: 0 2px 12px rgba(26, 54, 93, 0.08);
  }
  .topbar .topbar-brand, .topbar.scrolled .topbar-brand {
    color: var(--primary-color);
    text-shadow: none;
  }
  .topbar .topbar-brand .highlight { color: var(--accent-color); }
  .topbar nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0 1.25rem;
  }
  .topbar nav a, .topbar.scrolled nav a {
    margin: 0;
    color: var(--primary-color);
    text-shadow: none;
  }
  html { scroll-padding-top: 1rem; }
  .service-list { grid-template-columns: 1fr; gap: 1.25rem; }
  .service { padding: 2rem; }
}

@media (max-width: 600px) {
  .topbar .topbar-brand { font-size: 1.35rem; }
  .topbar nav { width: 100%; gap: 0 1rem; }
  .topbar nav a { font-size: 0.95rem; }
  .hero {
    height: auto;
    min-height: 480px;
    max-height: none;
  }
  .hero .slider { position: absolute; inset: 0; }
  .hero-content {
    position: relative;
    top: auto;
    left: auto;
    transform: none;
    width: 100%;
    padding: 3rem 1.25rem 10rem;
  }
  .hero-content h1 { font-size: clamp(2.2rem, 9vw, 3.2rem); line-height: 1.2; }
  .hero-content p { font-size: 1.05rem; margin-bottom: 1.5rem; }
  .hero-eyebrow { font-size: 0.72rem; letter-spacing: 0.04em; }
  .hero-eyebrow::before, .hero-eyebrow::after { width: 16px; flex-shrink: 0; }
  .hero-wave { height: 45px; }
  .slider-nav {
    top: auto;
    bottom: 4rem;
    transform: none;
    justify-content: center;
    gap: 1rem;
  }
  .slider-dots { bottom: 0; }
  section { padding: 2.75rem 1.25rem; }
  section h2 { font-size: 1.85rem; line-height: 1.3; }
  .intro p { font-size: 1rem; }
  .service-list { margin-top: 1.75rem; }
  .service { padding: 1.5rem; }
  .service-icon { margin-bottom: 1rem; }
  .contact-info { padding: 1.25rem; margin-top: 1.5rem; }
  .contact-info .row { flex-direction: column; align-items: stretch; gap: 0.15rem; }
  .contact-info .label { min-width: 0; }
  .contact-info a { display: flex; align-items: center; min-height: 44px; }
  main { padding: 2.5rem 1.25rem 3rem; }
  main h1 { font-size: 1.85rem; line-height: 1.3; }
  .box { padding: 1.25rem; margin-bottom: 1.25rem; }
  footer { padding: 1.75rem 1.25rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
  .service { animation: none; opacity: 1; transform: none; }
}
