/* Accessibility-first base */
:root {
  --brand-brown-800: #7c3f00;
  --brand-orange-800: #9a3412;
  --brand-orange-700: #b45309;
  --brand-orange-600: #d97706;
  --brand-orange-500: #f59e0b;
  --brand-orange-100: #fed7aa;
  --brand-gold-500: #e9b949;
  --brand-gold-400: #f3c969;
  --text-900: #111827; /* darker for contrast */
  --text-700: #1f2937;
  --text-500: #374151;
  --bg: #ffffff;
  --bg-alt: #fffaf3;
  --border: #ecdcc6;
  --focus: #fde68a;
  --shadow-subtle: 0 6px 22px rgba(124, 63, 0, 0.08);
}

* { box-sizing: border-box; }
html, body { padding: 0; margin: 0; }

html { font-size: 18px; } /* larger base for readability */
body {
  font-family: "Open Sans", "Lato", system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  color: var(--text-900);
  background: var(--bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Large text mode */
body.large-text { line-height: 1.8; }
body.large-text html, body.large-text { font-size: 20px; }

.container { width: 100%; max-width: 960px; margin: 0 auto; padding: 0 20px; }

.site-header { position: sticky; top: 0; z-index: 50; background: rgba(255, 255, 255, 0.92); backdrop-filter: saturate(180%) blur(8px); box-shadow: 0 2px 10px rgba(124, 63, 0, 0.06); }
.nav-container { display: flex; align-items: center; justify-content: space-between; min-height: 68px; }

.brand { display: flex; align-items: center; gap: 10px; color: var(--brand-brown-800); text-decoration: none; }
.brand:hover, .brand:focus { color: var(--brand-brown-800); }
.brand-logo { height: 40px; width: auto; }
.brand-text { font-weight: 800; }

.main-nav { display: flex; gap: 8px; align-items: center; }
.nav-link { color: var(--text-700); text-decoration: none; font-weight: 700; padding: 8px 6px; border-radius: 6px; font-size: 0.85rem; }
.text-toggle { border: 2px solid var(--border); background: #fff; cursor: pointer; }
.nav-link:hover, .nav-link:focus { color: var(--brand-orange-700); text-decoration: underline; outline: none; }
.cta-link { color: white; background: var(--brand-orange-600); padding: 8px 10px; border-radius: 8px; }
.cta-link:hover, .cta-link:focus { background: var(--brand-orange-700); }

/* Mobile navigation adjustments */
@media (max-width: 480px) {
  .nav-container { min-height: 56px; padding: 0 12px; }
  .brand-logo { height: 32px; }
  .brand-text { display: none; }
  .main-nav { gap: 4px; }
  .nav-link { padding: 6px 8px; font-size: 0.8rem; }
  .cta-link { padding: 6px 10px; }
  .text-toggle { padding: 6px 8px; }
}

@media (min-width: 481px) and (max-width: 719px) {
  .nav-container { padding: 0 16px; }
  .brand-logo { height: 36px; }
  .brand-text { font-size: 0.9rem; }
  .main-nav { gap: 6px; }
  .nav-link { padding: 8px 8px; font-size: 0.85rem; }
}

@media (min-width: 720px) {
  .main-nav { gap: 12px; }
  .nav-link { padding: 10px 10px; font-size: 1rem; }
  .cta-link { padding: 10px 14px; }
}

.hero { position: relative; padding: 110px 0 54px; background: radial-gradient(1000px 400px at 50% -10%, #fff3d1 0%, #fff7e6 40%, #fff 70%), linear-gradient(180deg, #fffaf3 0%, #fff 100%); overflow: hidden; }
.hero h1 { font-size: 2.4rem; line-height: 1.15; margin: 0 0 10px; color: var(--brand-brown-800); letter-spacing: -0.5px; }
.hero .subtitle { margin: 0 0 18px; color: var(--text-700); font-size: 1.15rem; max-width: 50ch; }
.hero-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

/* Hero meta elements */
.hero-meta { margin-bottom: 16px; }
.pill-tag { display: inline-block; background: var(--brand-orange-100); color: var(--brand-orange-800); padding: 6px 12px; border-radius: 20px; font-size: 0.9rem; font-weight: 600; }

.hero-decoration { position: absolute; right: 20px; bottom: 20px; width: 180px; height: auto; opacity: 0.15; }

.section { padding: 60px 0; border-top: 1px solid var(--border); }
.section:first-of-type { border-top: none; }
.section.alt { background: var(--bg-alt); }
.section h2 { margin: 0 0 12px; color: var(--brand-brown-800); font-size: 1.4rem; letter-spacing: -0.2px; }
.section p { color: var(--text-700); }

/* Content Grids */
.content-grid { display: grid; gap: 24px; margin-top: 24px; }
.content-item { background: white; padding: 24px; border-radius: 12px; border: 1px solid var(--border); box-shadow: var(--shadow-subtle); }
.content-item h3 { margin: 0 0 8px; color: var(--brand-brown-800); font-size: 1.2rem; }
.content-item p { margin: 0; color: var(--text-700); }

/* Content Lists */
.content-list { margin-top: 24px; }
.content-list p { margin-bottom: 16px; }
.content-list p:last-child { margin-bottom: 0; }

/* Info Note */
.info-note { background: #fff7e6; border: 1px solid #ffe6b8; border-radius: 12px; padding: 20px; margin-top: 24px; }
.info-note p { margin: 0; color: var(--text-700); }

/* FAQ List */
.faq-list { margin-top: 24px; }
.faq-item { background: white; padding: 24px; border-radius: 12px; border: 1px solid var(--border); box-shadow: var(--shadow-subtle); margin-bottom: 16px; }
.faq-item:last-child { margin-bottom: 0; }
.faq-item h3 { margin: 0 0 8px; color: var(--brand-brown-800); font-size: 1.1rem; }
.faq-item p { margin: 0; color: var(--text-700); }

/* Support at Home CTA */
.support-cta { background: linear-gradient(135deg, #fff3d1 0%, #fff7e6 100%); border-top: 3px solid var(--brand-orange-500); }
.cta-content { text-align: center; max-width: 800px; margin: 0 auto; }
.cta-content h2 { font-size: 1.6rem; margin-bottom: 16px; color: var(--brand-brown-800); }
.cta-subtitle { font-size: 1.1rem; margin-bottom: 24px; color: var(--text-700); line-height: 1.6; }
.cta-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-bottom: 16px; }
.cta-meta { display: flex; justify-content: center; }

/* Services Grid */
.services-grid { display: grid; gap: 24px; margin-top: 24px; }
.service-card { background: white; padding: 24px; border-radius: 12px; border: 1px solid var(--border); box-shadow: var(--shadow-subtle); }
.service-card h3 { margin: 0 0 8px; color: var(--brand-brown-800); font-size: 1.1rem; }
.service-card p { margin: 0; color: var(--text-700); }

/* About Section */
.about-intro { font-size: 1.1rem; margin-bottom: 32px; }
.values-grid { display: grid; gap: 20px; margin-top: 24px; }
.value-item { text-align: center; }
.value-item h3 { margin: 0 0 8px; color: var(--brand-brown-800); font-size: 1.1rem; }
.value-item p { margin: 0; color: var(--text-700); }

/* Coordinator Details */
.coordinator-details { background: white; padding: 24px; border-radius: 12px; border: 1px solid var(--border); box-shadow: var(--shadow-subtle); margin-bottom: 24px; }
.coordinator-details h3 { margin: 0 0 16px; color: var(--brand-brown-800); font-size: 1.2rem; }
.contact-links { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.contact-link { color: var(--brand-orange-700); text-decoration: none; font-weight: 600; }
.contact-link:hover, .contact-link:focus { text-decoration: underline; }
.contact-buttons { display: flex; gap: 12px; flex-wrap: wrap; }

.contact-blurb { margin-bottom: 12px; }

.contact-form { margin-top: 8px; padding: 18px; background: white; border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-subtle); }
.form-row { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
label { font-weight: 700; color: var(--text-700); }
input[type="text"], input[type="tel"], input[type="email"], textarea, select { width: 100%; padding: 14px 16px; border: 1px solid var(--border); border-radius: 10px; font-size: 1rem; color: var(--text-900); background: #fff; }
textarea { resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: var(--brand-orange-600); outline: 3px solid var(--focus); }
.form-actions { margin-top: 10px; }

/* Consent Note */
.consent-note { background: #f8f9fa; border: 1px solid var(--border); border-radius: 8px; padding: 16px; margin-bottom: 16px; }
.consent-note p { margin: 0; color: var(--text-700); font-size: 0.95rem; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 18px; border-radius: 12px; border: none; cursor: pointer; text-decoration: none; font-weight: 800; letter-spacing: 0.2px; transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease; }
.btn-primary { color: white; background: linear-gradient(135deg, var(--brand-orange-600), var(--brand-gold-500)); box-shadow: 0 8px 20px rgba(245, 158, 11, 0.25); }
.btn-primary:hover, .btn-primary:focus { transform: translateY(-1px); box-shadow: 0 12px 26px rgba(245, 158, 11, 0.35); }
.btn-secondary { color: var(--brand-orange-800); background: #fff; border: 2px solid var(--brand-orange-600); }
.btn-secondary:hover, .btn-secondary:focus { background: #fff8eb; }

.alert { border-radius: 12px; padding: 12px 14px; margin: 12px 0 16px; font-weight: 800; }
.alert.success { background: #fff7e6; color: #7a3b00; border: 1px solid #ffe6b8; }
.alert.error { background: #fff4f3; color: #8a1f11; border: 1px solid #ffd9d4; }

.site-footer { padding: 28px 0; text-align: center; color: var(--text-500); border-top: 1px solid var(--border); }
.footer-links { font-size: 0.9rem; margin-top: 8px; }
.footer-links a { color: var(--text-500); text-decoration: none; }
.footer-links a:hover { color: var(--brand-brown-800); text-decoration: underline; }
.footer-plinth { font-size: 0.8rem; margin-top: 12px; opacity: 0.7; }
.footer-plinth a { color: var(--text-500); text-decoration: none; }
.footer-plinth a:hover { color: var(--brand-brown-800); }
.last-updated { font-size: 0.9rem; margin-top: 8px; }

@media (min-width: 720px) {
  .hero h1 { font-size: 2.8rem; }
  .section { padding: 70px 0; }
  .services-grid { grid-template-columns: repeat(3, 1fr); }
  .values-grid { grid-template-columns: repeat(3, 1fr); }
  .content-grid { grid-template-columns: repeat(2, 1fr); }
  .contact-links { flex-direction: row; gap: 16px; }
}

/* Centered layout toggle */
body.centered .hero .container,
body.centered .section .container,
body.centered .site-footer .container { text-align: center; }
body.centered .hero .subtitle,
body.centered .about-intro,
body.centered .contact-blurb { margin-left: auto; margin-right: auto; }
body.centered .section p,
body.centered .about-intro,
body.centered .contact-blurb { text-align: center; }
body.centered .hero-actions { justify-content: center; }
body.centered .contact-form { margin-left: auto; margin-right: auto; max-width: 700px; }
body.centered .form-actions { text-align: center; }

/* Modal overlay */
.modal-overlay[hidden] { display: none !important; }
.modal-overlay { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.45); display: grid; place-items: center; padding: 20px; z-index: 1000; }
.modal { width: 100%; max-width: 520px; background: #fff; border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-subtle); padding: 22px; text-align: center; }
.modal h3 { margin: 0 0 8px; color: var(--brand-brown-800); }
.modal p { margin: 0 0 14px; color: var(--text-700); }
.modal-actions { display: flex; justify-content: center; }

/* ==========================================================================
   SCROLL ANIMATIONS
   ========================================================================== */

.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.animate-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.animate-fade {
  opacity: 0;
  transition: opacity 0.5s ease-out;
}

.animate-fade.is-visible {
  opacity: 1;
}

/* Stagger animation delays for grid children */
.animate-stagger > .animate-on-scroll:nth-child(1) { transition-delay: 0s; }
.animate-stagger > .animate-on-scroll:nth-child(2) { transition-delay: 0.1s; }
.animate-stagger > .animate-on-scroll:nth-child(3) { transition-delay: 0.2s; }
.animate-stagger > .animate-on-scroll:nth-child(4) { transition-delay: 0.3s; }
.animate-stagger > .animate-on-scroll:nth-child(5) { transition-delay: 0.4s; }
.animate-stagger > .animate-on-scroll:nth-child(6) { transition-delay: 0.5s; }

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  .animate-on-scroll,
  .animate-fade {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ==========================================================================
   TESTIMONIALS
   ========================================================================== */

.testimonials-grid {
  display: grid;
  gap: 24px;
  margin-top: 24px;
}

.testimonial-card {
  background: white;
  padding: 28px;
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-subtle);
  margin: 0;
  position: relative;
}

.testimonial-card::before {
  content: '\201C';
  position: absolute;
  top: 12px;
  left: 20px;
  font-size: 4rem;
  color: var(--brand-orange-100);
  font-family: Georgia, serif;
  line-height: 1;
}

.testimonial-text {
  margin: 0 0 16px;
  color: var(--text-700);
  font-style: italic;
  position: relative;
  z-index: 1;
}

.testimonial-author {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.author-name {
  font-weight: 700;
  color: var(--brand-brown-800);
}

.author-location {
  font-size: 0.9rem;
  color: var(--text-500);
}

/* ==========================================================================
   CASE STUDIES
   ========================================================================== */

.section-intro {
  max-width: 60ch;
  margin: 0 auto 32px;
}

.case-studies-grid {
  display: grid;
  gap: 24px;
  margin-top: 24px;
}

.case-study-card {
  background: white;
  padding: 28px;
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-subtle);
  border-left: 4px solid var(--brand-orange-500);
  text-align: left;
}

.case-tag {
  display: inline-block;
  background: var(--brand-orange-100);
  color: var(--brand-orange-800);
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.case-study-card h3 {
  margin: 0 0 12px;
  color: var(--brand-brown-800);
  font-size: 1.15rem;
}

.case-study-card p {
  margin: 0 0 16px;
  color: var(--text-700);
  text-align: left;
}

.case-outcome {
  background: var(--bg-alt);
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 0.95rem;
  color: var(--text-700);
  text-align: left;
}

/* ==========================================================================
   TEAM BIO
   ========================================================================== */

.team-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  background: white;
  padding: 32px;
  border-radius: 16px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-subtle);
  max-width: 700px;
  margin: 24px auto 0;
}

.team-photo img {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--brand-orange-100);
  background: var(--bg-alt);
}

.team-info {
  text-align: center;
}

.team-info h3 {
  margin: 0 0 4px;
  color: var(--brand-brown-800);
  font-size: 1.4rem;
}

.team-role {
  color: var(--brand-orange-700);
  font-weight: 600;
  margin: 0 0 16px;
}

.team-bio {
  margin: 0 0 20px;
  max-width: 50ch;
}

.team-contact {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ==========================================================================
   TRUST BADGES
   ========================================================================== */

.trust-badges {
  padding: 40px 0;
  background: var(--bg-alt);
}

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

.badge-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}

.badge-icon {
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
  border-radius: 50%;
  border: 2px solid var(--brand-orange-100);
}

.badge-text {
  font-weight: 700;
  color: var(--brand-brown-800);
  font-size: 0.95rem;
}

/* Visually hidden for screen readers */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ==========================================================================
   FREE CONSULTATION INFO
   ========================================================================== */

.consultation-info {
  background: linear-gradient(135deg, #fff7e6 0%, #fff 100%);
  border: 2px solid var(--brand-orange-500);
  border-radius: 16px;
  padding: 28px;
  margin-bottom: 32px;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

.consultation-highlight {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 20px;
}

.highlight-icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
  border-radius: 12px;
}

.highlight-content h3 {
  margin: 0 0 4px;
  color: var(--brand-brown-800);
  font-size: 1.25rem;
}

.highlight-content p {
  margin: 0;
  color: var(--text-700);
  text-align: left;
}

.consultation-includes {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px 16px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.consultation-includes li {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-700);
  font-size: 0.95rem;
}

.consultation-includes li::before {
  content: '';
  width: 16px;
  height: 16px;
  background: var(--brand-orange-500);
  border-radius: 50%;
  flex-shrink: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3'%3E%3Cpath d='M20 6L9 17l-5-5'/%3E%3C/svg%3E");
  background-size: 10px;
  background-position: center;
  background-repeat: no-repeat;
}

body.centered .consultation-info {
  text-align: left;
}

/* ==========================================================================
   HERO ENHANCEMENTS
   ========================================================================== */

.hero-tagline {
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--brand-orange-700);
  margin-bottom: 12px;
}

.hero-trust {
  margin-top: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 0.9rem;
  color: var(--text-500);
}

.trust-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.trust-divider {
  color: var(--border);
}

.btn-icon {
  flex-shrink: 0;
}

/* ==========================================================================
   MOBILE STICKY CTA
   ========================================================================== */

.mobile-cta-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: white;
  padding: 12px 16px;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
  z-index: 100;
  gap: 12px;
  transition: transform 0.3s ease;
}

.mobile-cta-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 16px;
  border-radius: 10px;
  font-weight: 800;
  text-decoration: none;
  font-size: 0.95rem;
}

.mobile-cta-btn.phone {
  background: var(--brand-orange-600);
  color: white;
}

.mobile-cta-btn.form {
  background: white;
  color: var(--brand-orange-700);
  border: 2px solid var(--brand-orange-600);
}

@media (max-width: 719px) {
  .mobile-cta-bar {
    display: flex;
  }

  .site-footer {
    padding-bottom: 100px;
  }
}

@media (min-width: 720px) {
  .testimonials-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .case-studies-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .team-card {
    flex-direction: row;
    text-align: left;
    align-items: flex-start;
  }

  .team-info {
    text-align: left;
  }

  .team-contact {
    justify-content: flex-start;
  }

  .badges-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}