/* ==========================================================================
   Clearwave Hearing and Audiology
   Shared stylesheet
   Palette: calm blues, soft teal, warm gray, white
   Accessibility: 18px base, 1.7 line-height, WCAG AA contrast targets
   ========================================================================== */

/* --- 1. Tokens --------------------------------------------------------- */
:root {
  /* Color */
  --navy-900: #0a2540;
  --navy-800: #0d3155;
  --navy-700: #123f6b;
  --blue-600: #175a90;
  --blue-500: #1d6fae;
  --blue-100: #dceaf5;
  --blue-050: #f4f8fb;

  --teal-600: #006064;
  --teal-500: #006064;
  --teal-100: #e0f2f1;
  --teal-050: #f0f7f7;

  --warm-100: #faf9f7;
  --warm-200: #f2f0ed;
  --warm-300: #e2ddd6;

  --ink: #17232e;
  --ink-soft: #4a5d68;
  --line: #edeae6;
  --white: #ffffff;

  --focus: #b8570f;

  /* Type */
  --font-display: "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-body: "Inter", "Helvetica Neue", Arial, sans-serif;

  --text-sm: 0.9375rem;
  --text-base: 1.125rem;     /* 18px */
  --text-lg: 1.35rem;
  --text-xl: 1.625rem;
  --text-2xl: 2rem;
  --text-3xl: 2.5rem;
  --text-4xl: 3.25rem;
  --text-hero: clamp(2.75rem, 6vw, 4.5rem);

  /* Space */
  --s-1: 0.25rem;
  --s-2: 0.5rem;
  --s-3: 0.75rem;
  --s-4: 1rem;
  --s-5: 1.5rem;
  --s-6: 2rem;
  --s-7: 4rem;
  --s-8: 6rem;
  --s-9: 9rem;

  /* Other */
  --radius: 20px;
  --radius-sm: 8px;
  --radius-lg: 32px;
  --shadow-sm: 0 2px 4px rgba(10, 37, 64, 0.04), 0 4px 12px rgba(10, 37, 64, 0.03);
  --shadow-md: 0 10px 25px -5px rgba(10, 37, 64, 0.1), 0 8px 10px -6px rgba(10, 37, 64, 0.1);
  --wrap: 1240px;
  --wrap-narrow: 800px;
  
  --transition: 0.3s cubic-bezier(0.2, 0, 0, 1);
}

/* --- 2. Reset and base ------------------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.8;
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
}

img, svg, video { max-width: 100%; height: auto; border-radius: var(--radius-sm); }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--navy-900);
  line-height: 1.15;
  letter-spacing: -0.025em;
  margin: 0 0 var(--s-5);
  font-weight: 600;
}

h1 { font-size: var(--text-hero); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-xl); }
h4 { font-size: var(--text-lg); }

p { margin: 0 0 var(--s-5); max-width: 70ch; }

a { color: var(--teal-600); text-decoration-thickness: 1px; text-underline-offset: 3px; transition: var(--transition); }
a:hover { color: var(--navy-800); }

strong { font-weight: 650; color: var(--navy-900); }

ul, ol { margin: 0 0 var(--s-5); padding-left: 1.35em; }
li { margin-bottom: var(--s-2); }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--navy-900);
  color: var(--white);
  padding: var(--s-3) var(--s-5);
  z-index: 200;
}
.skip-link:focus { left: var(--s-4); top: var(--s-4); }

.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;
}

/* --- 3. Layout helpers ------------------------------------------------- */
.wrap {
  width: 92%;
  max-width: var(--wrap);
  margin-inline: auto;
}
.wrap-narrow { max-width: var(--wrap-narrow); }

.section { padding-block: var(--s-8); }
.section-lg { padding-block: var(--s-9); }
.section-warm { background: var(--warm-100); }
.section-blue { background: var(--blue-050); }
.section-navy {
  background: var(--navy-900);
  color: var(--blue-100);
}
.section-navy h2, .section-navy h3 { color: var(--white); }
.section-navy a { color: var(--white); }

.eyebrow {
  display: block;
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--teal-600);
  margin-bottom: var(--s-4);
}
.section-navy .eyebrow { color: var(--teal-100); opacity: 0.9; }

.lead {
  font-size: var(--text-lg);
  color: var(--ink-soft);
  line-height: 1.6;
}
.section-navy .lead { color: var(--blue-100); }

.center { text-align: center; }
.center p { margin-inline: auto; }

.grid { display: grid; gap: var(--s-6); }
.grid-2 { grid-template-columns: 1fr; }
.grid-3 { grid-template-columns: 1fr; }
.grid-4 { grid-template-columns: 1fr; }

.divider { height: 1px; background: var(--line); border: 0; margin: 0; }

/* --- 4. Buttons -------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1;
  padding: 1.15rem 2.2rem;
  border-radius: 999px;
  border: 1.5px solid transparent;
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition);
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn:active { transform: translateY(0); }

.btn-primary { background: var(--navy-900); color: var(--white); }
.btn-primary:hover { background: var(--teal-600); color: var(--white); }

.btn-teal { background: var(--teal-600); color: var(--white); }
.btn-teal:hover { background: var(--navy-900); color: var(--white); }

.btn-ghost {
  background: transparent;
  color: var(--navy-800);
  border-color: var(--navy-700);
}
.btn-ghost:hover { background: var(--navy-900); color: var(--white); }

.btn-light {
  background: var(--white);
  color: var(--navy-900);
}
.btn-light:hover { background: var(--navy-900); color: var(--white); }

.btn-outline-light {
  background: transparent;
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.4);
}
.btn-outline-light:hover { border-color: var(--white); background: rgba(255, 255, 255, 0.05); }

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-4);
  margin-bottom: var(--s-5);
}
.btn-row.center { justify-content: center; }

/* --- 5. Header --------------------------------------------------------- */
.topbar {
  background: var(--navy-900);
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.85rem;
  letter-spacing: 0.02em;
}
.topbar .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2) var(--s-6);
  align-items: center;
  justify-content: flex-end;
  padding-block: 0.65rem;
}
.topbar a { color: var(--white); text-decoration: none; }
.topbar a:hover { opacity: 0.8; }
.topbar-item { display: inline-flex; align-items: center; gap: var(--s-2); }
.topbar svg { flex: none; opacity: 0.7; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-5);
  padding-block: 1.25rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--s-4);
  text-decoration: none;
  color: var(--navy-900);
}
.brand-mark { color: var(--teal-600); flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1; }
.brand-name {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}
.brand-tag {
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 600;
  margin-top: 0.2rem;
}

.nav-toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  background: var(--warm-100);
  border: 1px solid var(--line);
  color: var(--navy-800);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  border-radius: 999px;
  padding: 0.6rem 1.2rem;
  cursor: pointer;
}

.site-nav { display: none; }
.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.site-nav a {
  display: block;
  padding: var(--s-4);
  color: var(--navy-900);
  font-weight: 600;
  text-decoration: none;
  font-size: 1.05rem;
}
.site-nav a:hover { color: var(--teal-600); }
.site-nav a[aria-current="page"] { color: var(--teal-600); }
.site-nav .nav-cta { margin-top: var(--s-4); }
.site-nav .nav-cta a {
  background: var(--navy-900);
  color: var(--white);
  border-radius: 999px;
  text-align: center;
  padding: 1rem 2rem;
}

.site-nav.is-open {
  display: block;
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  background: var(--white);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow-md);
  padding: var(--s-4) 4% var(--s-6);
}

/* --- 6. Hero ----------------------------------------------------------- */
.hero {
  position: relative;
  overflow: hidden;
  background: #faf9f7;
  padding-block: var(--s-9);
}
.hero::before {
  content: "";
  position: absolute;
  top: 0; right: 0;
  width: 60%; height: 100%;
  background: radial-gradient(circle at 70% 30%, rgba(0, 96, 100, 0.08) 0%, transparent 70%);
  pointer-events: none;
}
.hero > * { position: relative; z-index: 1; }
.hero h1 { margin-bottom: var(--s-6); max-width: 15ch; }
.hero p.hero-lead { font-size: 1.45rem; line-height: 1.5; color: var(--ink-soft); max-width: 50ch; margin-bottom: var(--s-7); }

.hero-inner { display: grid; gap: var(--s-8); align-items: center; }

.hero-card {
  background: var(--white);
  color: var(--ink);
  border-radius: var(--radius-lg);
  padding: var(--s-7);
  box-shadow: 0 30px 60px -12px rgba(10, 37, 64, 0.12), 0 18px 36px -18px rgba(10, 37, 64, 0.1);
  border: 1px solid var(--line);
}
.hero-card h2 { font-size: var(--text-xl); margin-bottom: var(--s-5); border-bottom: 1px solid var(--line); padding-bottom: var(--s-4); }
.hero-card dl { margin: 0 0 var(--s-6); }
.hero-card dt {
  font-weight: 700;
  color: var(--teal-600);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 0.25rem;
}
.hero-card dd { margin: 0 0 var(--s-5); color: var(--ink); font-weight: 500; }
.hero-card dd:last-child { margin-bottom: 0; }

.page-hero {
  background: var(--navy-900);
  color: var(--blue-100);
  padding-block: var(--s-8);
  position: relative;
  overflow: hidden;
}
.page-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 90% 10%, rgba(0, 96, 100, 0.3) 0%, transparent 50%);
  opacity: 0.5;
}
.page-hero .wrap { position: relative; z-index: 1; }
.page-hero h1 { color: var(--white); margin-bottom: var(--s-4); }
.page-hero p { font-size: 1.25rem; opacity: 0.9; }

.crumbs {
  font-size: var(--text-sm);
  color: var(--ink-soft);
  padding-block: var(--s-4);
  background: var(--warm-100);
  border-bottom: 1px solid var(--line);
}
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: var(--s-2); margin: 0; padding: 0; }
.crumbs li::after { content: "›"; margin-left: var(--s-2); color: var(--warm-300); font-size: 1.2em; line-height: 1; }
.crumbs li:last-child::after { content: ""; }

/* --- 7. Cards and content blocks -------------------------------------- */
.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--s-7);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}
.card h3 { margin-bottom: var(--s-4); }
.card p:last-child { margin-bottom: 0; }
.card-link:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); border-color: var(--teal-100); }

.card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: var(--teal-050);
  color: var(--teal-600);
  margin-bottom: var(--s-5);
}

.more-link {
  display: inline-flex;
  align-items: center;
  gap: var(--s-3);
  font-weight: 700;
  text-decoration: none;
  color: var(--teal-600);
  font-size: 1.05rem;
}
.more-link svg { transition: transform 0.2s ease; }
.more-link:hover svg { transform: translateX(5px); }

.trustbar { background: var(--white); border-bottom: 1px solid var(--line); padding-block: var(--s-7); }
.trustbar ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--s-6);
}
.trustbar li {
  display: flex;
  gap: var(--s-4);
  align-items: center;
  margin: 0;
  font-weight: 600;
  color: var(--navy-800);
  font-size: 0.95rem;
}
.trustbar svg { flex: none; color: var(--teal-600); width: 24px; height: 24px; }

.media-block {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  position: relative;
  background: var(--warm-200);
}
.media-block img { 
  display: block; 
  width: 100%; 
  height: 100%; 
  object-fit: cover; 
  border-radius: 0; 
  transition: transform 0.6s cubic-bezier(0.2, 0, 0, 1);
}
.media-block:hover img { transform: scale(1.03); }
.media-caption {
  position: absolute;
  bottom: var(--s-5);
  left: var(--s-5);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(4px);
  padding: 0.5rem 1rem;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 4px;
  color: var(--navy-900);
}

.checklist { list-style: none; padding: 0; }
.checklist li {
  display: flex;
  gap: var(--s-4);
  align-items: flex-start;
  margin-bottom: var(--s-4);
  font-weight: 500;
}
.checklist svg { flex: none; color: var(--teal-600); margin-top: 4px; width: 22px; height: 22px; }

.step-card {
  padding: var(--s-6);
  border-left: 1px solid var(--line);
  position: relative;
}
.step-num {
  display: block;
  font-family: var(--font-display);
  font-size: 3rem;
  line-height: 1;
  font-weight: 700;
  color: var(--teal-050);
  position: absolute;
  top: var(--s-5);
  left: var(--s-6);
  z-index: 0;
  user-select: none;
}
.step-card h3, .step-card p { position: relative; z-index: 1; }
.step-card h3 { font-size: 1.4rem; margin-top: 1.5rem; }

/* --- 8. FAQ ------------------------------------------------------------ */
.faq { display: grid; gap: var(--s-4); }
.faq details {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: var(--transition);
}
.faq summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--s-4);
  padding: var(--s-6);
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--navy-900);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  font-family: var(--font-body);
  font-size: 1.5rem;
  color: var(--teal-600);
  transition: transform 0.3s ease;
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq .faq-body { padding: 0 var(--s-6) var(--s-6); border-top: 0; }

/* --- 12. CTA band ------------------------------------------------------ */
.cta-band {
  background: var(--navy-900);
  color: var(--white);
  padding-block: var(--s-9);
  position: relative;
  overflow: hidden;
}
.cta-band::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, rgba(0, 96, 100, 0.2) 0%, transparent 70%);
}
.cta-band .wrap { position: relative; z-index: 1; }
.cta-band h2 { color: var(--white); font-size: var(--text-4xl); margin-bottom: var(--s-6); }
.cta-band p { color: var(--blue-100); font-size: 1.4rem; margin-inline: auto; margin-bottom: var(--s-7); }

/* --- 13. Footer -------------------------------------------------------- */
.site-footer {
  background: #051422;
  color: rgba(255, 255, 255, 0.65);
  padding-block: var(--s-8) var(--s-6);
  font-size: 0.95rem;
}
.site-footer h3 {
  color: var(--white);
  font-size: 1.15rem;
  margin-bottom: var(--s-5);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-family: var(--font-body);
  font-weight: 700;
}
.site-footer a { color: rgba(255, 255, 255, 0.8); text-decoration: none; }
.site-footer a:hover { color: var(--white); text-decoration: underline; }
.footer-grid { display: grid; gap: var(--s-7); }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: var(--s-3); }
.site-footer .brand-name { color: var(--white); }
.site-footer .brand-tag { color: rgba(255, 255, 255, 0.5); }
.footer-note {
  margin-top: var(--s-8);
  padding-top: var(--s-6);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-5);
  justify-content: space-between;
  font-size: 0.85rem;
}

/* --- 14. Responsive ---------------------------------------------------- */
@media (max-width: 639px) {
  .hero { padding-block: var(--s-7); }
  h1 { font-size: 2.75rem; }
  .btn { width: 100%; justify-content: center; }
  .section { padding-block: var(--s-7); }
}

@media (min-width: 640px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .trustbar ul { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 900px) {
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
  .trustbar ul { grid-template-columns: repeat(4, 1fr); }
  .hero-inner { grid-template-columns: 1.2fr 0.8fr; gap: var(--s-9); }
  .split { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-9); align-items: center; }
  .split-wide { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: var(--s-9); align-items: start; }
  .footer-grid { grid-template-columns: 1.5fr 1fr 1fr 1fr; }

  .nav-toggle { display: none; }
  .site-nav { display: block; }
  .site-nav ul { flex-direction: row; align-items: center; gap: var(--s-2); }
  .site-nav a { padding: 0.5rem 1rem; font-size: 0.95rem; }
  .site-nav .nav-cta { margin-top: 0; margin-left: var(--s-4); }
  .site-nav .nav-cta a {
    padding: 0.8rem 1.75rem;
    font-size: 1.15rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}