/* ==========================================================================
   Sleep & Airway Medicine — Design System
   Concept: "Nocturne to Dawn" — deep night blues transitioning to warm dawn
   gold, with a recurring "breath line" motif that gently pulses like
   inhale/exhale. Built for calm, trust, and a subject-specific identity
   rather than generic medical-site defaults.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,300;0,9..144,400;0,9..144,500;0,9..144,600;0,9..144,700;1,9..144,400;1,9..144,500&family=Public+Sans:wght@400;500;600;700&display=swap');

:root {
  /* Color */
  --nocturne: #1B2A4A;
  --nocturne-deep: #101a30;
  --indigo: #33447A;
  --dawn: #E0A458;
  --dawn-deep: #C98A3A;
  --mist: #F5F7FB;
  --mist-dim: #E8ECF4;
  --ink: #17223B;
  --ink-soft: #4B5670;
  --sage: #5C8577;
  --sage-light: #E7F0EC;
  --white: #FFFFFF;

  /* Type */
  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Public Sans', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Shape */
  --radius-sm: 10px;
  --radius-md: 20px;
  --radius-lg: 34px;

  /* Elevation */
  --shadow-card: 0 4px 24px rgba(23, 34, 59, 0.08);
  --shadow-lift: 0 20px 56px rgba(16, 26, 48, 0.18);

  --container: 1180px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--white);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }
button { font-family: inherit; cursor: pointer; }
h1, h2, h3, h4 { font-family: var(--font-display); color: var(--nocturne); margin: 0 0 0.5em; line-height: 1.15; font-weight: 600; }
p { margin: 0 0 1em; color: var(--ink-soft); }
:focus-visible { outline: 3px solid var(--dawn); outline-offset: 3px; }

.container { max-width: var(--container); margin-inline: auto; padding-inline: clamp(1.25rem, 5vw, 3rem); }

h1 { font-size: clamp(2.5rem, 2rem + 2.4vw, 4.1rem); letter-spacing: -0.01em; }
h2 { font-size: clamp(1.9rem, 1.6rem + 1.4vw, 2.7rem); letter-spacing: -0.01em; }
h3 { font-size: clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem); }
.lede { font-size: clamp(1.05rem, 1rem + 0.3vw, 1.2rem); color: var(--ink-soft); max-width: 60ch; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 0.6em;
  font-family: var(--font-body); font-weight: 600; font-size: 0.78rem;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--dawn-deep);
  margin-bottom: 0.9em;
}
.eyebrow::before { content: ""; width: 22px; height: 1.5px; background: var(--dawn-deep); display: inline-block; }
.on-dark .eyebrow { color: var(--dawn); }
.on-dark .eyebrow::before { background: var(--dawn); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5em;
  padding: 0.9rem 1.7rem; border-radius: var(--radius-sm);
  font-weight: 600; font-size: 0.98rem; border: 1.5px solid transparent;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
  white-space: nowrap;
}
.btn-primary { background: var(--dawn); color: var(--nocturne-deep); }
.btn-primary:hover { background: var(--dawn-deep); transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.btn-outline { border-color: rgba(255,255,255,0.55); color: var(--white); }
.btn-outline:hover { background: rgba(255,255,255,0.1); border-color: var(--white); }
.btn-quiet { border-color: var(--indigo); color: var(--nocturne); }
.btn-quiet:hover { background: var(--nocturne); color: var(--white); border-color: var(--nocturne); }
.btn-sm { padding: 0.6rem 1.1rem; font-size: 0.88rem; }
.btn-block { width: 100%; }

.text-link { font-weight: 600; color: var(--nocturne); border-bottom: 1.5px solid var(--dawn); padding-bottom: 2px; display: inline-flex; align-items: center; gap: 0.4em; transition: gap 0.2s ease; }
.text-link:hover { gap: 0.7em; }

/* ---------- Breath line signature ---------- */
.breath-line { width: 100%; line-height: 0; }
.breath-line svg { width: 100%; height: auto; display: block; }
.breath-path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.breath-anim { transform-origin: 50% 50%; }
@media (prefers-reduced-motion: no-preference) {
  .breath-anim { animation: breathe 5.5s ease-in-out infinite; }
}
@keyframes breathe {
  0%, 100% { transform: scaleY(1) translateY(0); opacity: 0.7; }
  50% { transform: scaleY(1.5) translateY(-4px); opacity: 1; }
}

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--nocturne-deep);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; padding-block: 0.9rem; }
.logo { display: flex; flex-direction: column; line-height: 1.1; }
.logo-main { font-family: var(--font-display); font-weight: 600; font-size: 1.28rem; color: var(--white); }
.logo-sub { font-size: 0.68rem; letter-spacing: 0.06em; color: rgba(232,236,244,0.6); margin-top: 3px; }
.nav-links { display: flex; align-items: center; gap: 2.1rem; }
.nav-links a { font-size: 0.95rem; font-weight: 500; color: rgba(245,247,251,0.85); padding: 0.4rem 0; border-bottom: 2px solid transparent; transition: color 0.2s, border-color 0.2s; }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--white); border-color: var(--dawn); }
.header-actions { display: flex; align-items: center; gap: 1rem; }
.call-pill { display: none; }
.nav-toggle { display: none; background: none; border: none; padding: 0.4rem; }
.nav-toggle svg { stroke: var(--white); }

@media (min-width: 640px) {
  .call-pill { display: inline-flex; }
}

@media (max-width: 900px) {
  .nav-links { position: fixed; inset: 64px 0 auto 0; background: var(--nocturne-deep); flex-direction: column; align-items: flex-start; gap: 0; padding: 0.5rem 1.25rem 1.5rem; transform: translateY(-8px); opacity: 0; pointer-events: none; transition: opacity 0.2s ease, transform 0.2s ease; border-bottom: 1px solid rgba(255,255,255,0.08); }
  .nav-links a { width: 100%; padding: 0.85rem 0; border-bottom: 1px solid rgba(255,255,255,0.08); }
  .site-header.nav-open .nav-links { opacity: 1; transform: translateY(0); pointer-events: auto; }
  .nav-toggle { display: inline-flex; }
}

/* ---------- Hero (home) ---------- */
.hero {
  position: relative; overflow: hidden; isolation: isolate;
  background: linear-gradient(155deg, var(--nocturne-deep) 0%, var(--nocturne) 55%, var(--indigo) 100%);
  padding-block: clamp(4.5rem, 8vw, 8rem) clamp(5rem, 10vw, 9rem);
}
.hero .breath-line { position: absolute; inset: auto 0 8% 0; z-index: -1; opacity: 0.35; }
.hero-content { max-width: 46rem; }
.hero h1 { color: var(--white); }
.hero .lede { color: rgba(245,247,251,0.82); margin-bottom: 2rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 1rem; }

/* ---------- Page hero (interior pages) ---------- */
.page-hero { background: var(--nocturne-deep); padding-block: clamp(3.2rem, 6vw, 5rem); position: relative; overflow: hidden; }
.page-hero .breath-line { position: absolute; inset: auto 0 0 0; opacity: 0.22; }
.page-hero h1 { color: var(--white); margin-bottom: 0.3em; }
.page-hero .lede { color: rgba(245,247,251,0.78); margin-bottom: 0; }

/* ---------- Sections ---------- */
.section { padding-block: clamp(3.5rem, 7vw, 6.5rem); }
.section-mist { background: var(--mist); }
.section-sage { background: var(--sage-light); }
.section-header { max-width: 42rem; margin-bottom: clamp(2rem, 4vw, 3rem); }
.section-header.center { margin-inline: auto; text-align: center; }
.divider-breath { max-width: 220px; margin: 0 auto; opacity: 0.5; }

/* ---------- Signs grid ---------- */
.signs-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1.25rem; }
.sign-card { background: var(--white); border-radius: var(--radius-md); padding: 1.75rem; box-shadow: var(--shadow-card); }
.sign-icon { width: 48px; height: 48px; border-radius: 50%; background: var(--mist); display: flex; align-items: center; justify-content: center; margin-bottom: 1.1rem; }
.sign-icon svg { width: 24px; height: 24px; color: var(--nocturne); }
.sign-card h3 { font-size: 1.08rem; margin-bottom: 0.35em; }
.sign-card p { font-size: 0.95rem; margin-bottom: 0; }

/* ---------- Approach split ---------- */
.split { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.split-panel { background: linear-gradient(160deg, var(--nocturne) 0%, var(--indigo) 100%); border-radius: var(--radius-lg); padding: clamp(2rem, 4vw, 3rem); min-height: 320px; display: flex; flex-direction: column; justify-content: center; gap: 1.5rem; position: relative; overflow: hidden; }
.split-panel .breath-line { opacity: 0.55; }
.split-panel-label { font-family: var(--font-display); font-style: italic; color: var(--white); font-size: 1.3rem; text-align: center; }
.compare-list { display: flex; flex-direction: column; gap: 0.85rem; margin-top: 1.5rem; }
.compare-row { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 0.75rem; font-size: 0.92rem; padding-block: 0.6rem; border-bottom: 1px solid var(--mist-dim); }
.compare-row.head { font-weight: 700; color: var(--nocturne); font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.06em; }
.compare-row span:first-child { color: var(--ink); font-weight: 600; }

@media (max-width: 860px) {
  .split { grid-template-columns: 1fr; }
  .split-panel { order: -1; }
}

/* ---------- Doctor teaser / bio ---------- */
.doctor-block { display: grid; grid-template-columns: auto 1fr; gap: clamp(1.5rem, 4vw, 3rem); align-items: center; }
.avatar { border-radius: 50%; box-shadow: var(--shadow-lift); }
.avatar-sm { width: 120px; height: 120px; }
.avatar-lg { width: 200px; height: 200px; }
.avatar-initials { font-family: var(--font-display); font-weight: 600; fill: var(--white); }
.doctor-copy p:last-of-type { margin-bottom: 1.3rem; }
.replace-note { font-size: 0.78rem; color: var(--sage); font-style: italic; }

@media (max-width: 640px) {
  .doctor-block { grid-template-columns: 1fr; text-align: center; }
  .doctor-block .avatar { margin-inline: auto; }
}

/* ---------- Process ---------- */
.process-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; position: relative; }
.process-step { position: relative; padding-top: 0.5rem; }
.process-num { font-family: var(--font-display); font-size: 2.4rem; color: var(--dawn); font-weight: 600; line-height: 1; margin-bottom: 0.5rem; }
.process-step h3 { margin-bottom: 0.4em; }
.process-step p { font-size: 0.93rem; margin-bottom: 0; }
@media (max-width: 860px) {
  .process-grid { grid-template-columns: 1fr; gap: 2rem; }
}

/* ---------- Location cards ---------- */
.locations-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.5rem; }
.location-card { background: var(--white); border-radius: var(--radius-md); padding: 2rem; box-shadow: var(--shadow-card); border-top: 3px solid var(--dawn); }
.location-card h3 { margin-bottom: 0.75rem; }
.location-card .field { font-size: 0.93rem; color: var(--ink-soft); margin-bottom: 0.3rem; }
.location-card .field strong { color: var(--ink); }
.location-actions { display: flex; gap: 0.75rem; margin-top: 1.4rem; flex-wrap: wrap; }

/* ---------- CTA band ---------- */
.cta-band { background: var(--nocturne-deep); text-align: center; position: relative; overflow: hidden; }
.cta-band .breath-line { position: absolute; inset: 0; opacity: 0.15; }
.cta-band h2 { color: var(--white); margin-bottom: 0.6em; }
.cta-band .lede { color: rgba(245,247,251,0.8); margin-inline: auto; margin-bottom: 1.8rem; }
.cta-band-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* ---------- Footer ---------- */
.site-footer { background: var(--nocturne-deep); color: rgba(245,247,251,0.75); padding-block: 3.5rem 1.75rem; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2.5rem; margin-bottom: 2.5rem; }
.footer-col h4 { color: var(--white); font-family: var(--font-body); font-size: 0.85rem; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 1rem; }
.footer-col p, .footer-col a { font-size: 0.92rem; color: rgba(245,247,251,0.72); }
.footer-col ul { display: flex; flex-direction: column; gap: 0.6rem; }
.footer-col a:hover { color: var(--dawn); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.12); padding-top: 1.5rem; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.75rem; font-size: 0.82rem; color: rgba(245,247,251,0.5); }
@media (max-width: 720px) {
  .footer-grid { grid-template-columns: 1fr; gap: 2rem; }
}

/* ---------- FAQ ---------- */
.faq-item { border-bottom: 1px solid var(--mist-dim); }
.faq-q { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.4rem 0; background: none; border: none; text-align: left; font-family: var(--font-display); font-size: 1.08rem; color: var(--nocturne); font-weight: 600; }
.faq-icon { flex: none; width: 22px; height: 22px; position: relative; }
.faq-icon::before, .faq-icon::after { content: ""; position: absolute; background: var(--dawn-deep); border-radius: 2px; top: 50%; left: 50%; transform: translate(-50%, -50%); }
.faq-icon::before { width: 14px; height: 2px; }
.faq-icon::after { width: 2px; height: 14px; transition: transform 0.25s ease; }
.faq-item.open .faq-icon::after { transform: translate(-50%, -50%) rotate(90deg) scale(0); }
.faq-a { max-height: 0; overflow: hidden; transition: max-height 0.3s ease; }
.faq-a p { padding-bottom: 1.4rem; margin-bottom: 0; font-size: 0.96rem; }

/* ---------- Table ---------- */
.compare-table-wrap { overflow-x: auto; border-radius: var(--radius-md); box-shadow: var(--shadow-card); }
table.compare-table { width: 100%; border-collapse: collapse; min-width: 480px; background: var(--white); }
.compare-table th, .compare-table td { padding: 1rem 1.25rem; text-align: left; font-size: 0.93rem; border-bottom: 1px solid var(--mist-dim); }
.compare-table th { background: var(--nocturne); color: var(--white); font-weight: 600; font-size: 0.82rem; letter-spacing: 0.04em; text-transform: uppercase; }
.compare-table tr:last-child td { border-bottom: none; }
.compare-table tr:nth-child(even) td { background: var(--mist); }

/* ---------- Forms ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.form-field { display: flex; flex-direction: column; gap: 0.4rem; }
.form-field.full { grid-column: 1 / -1; }
.form-field label { font-size: 0.86rem; font-weight: 600; color: var(--nocturne); }
.form-field input, .form-field select, .form-field textarea {
  font-family: var(--font-body); font-size: 0.98rem; padding: 0.85rem 1rem;
  border: 1.5px solid var(--mist-dim); border-radius: var(--radius-sm); background: var(--white); color: var(--ink);
}
.form-field input:focus, .form-field select:focus, .form-field textarea:focus { border-color: var(--dawn); outline: none; }
.form-note { font-size: 0.82rem; color: var(--ink-soft); margin-top: 0.75rem; }
.form-success { display: none; background: var(--sage-light); border-radius: var(--radius-md); padding: 2rem; text-align: center; }
.form-success h3 { margin-bottom: 0.4em; }
.form-success p { margin-bottom: 0; }
@media (max-width: 640px) {
  .form-grid { grid-template-columns: 1fr; }
}

/* ---------- Focus areas list (about page) ---------- */
.focus-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; }
.focus-chip { background: var(--white); border: 1.5px solid var(--mist-dim); border-radius: var(--radius-sm); padding: 1rem 1.25rem; font-weight: 600; font-size: 0.95rem; color: var(--nocturne); display: flex; align-items: center; gap: 0.6rem; }
.focus-chip::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--dawn); flex: none; }

/* ---------- Credentials list ---------- */
.credentials-list { display: flex; flex-direction: column; gap: 0.9rem; }
.credentials-list li { display: flex; gap: 0.85rem; align-items: flex-start; font-size: 0.97rem; color: var(--ink-soft); }
.credentials-list li::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--sage); margin-top: 0.55em; flex: none; }
.placeholder-note { background: var(--sage-light); border-left: 3px solid var(--sage); padding: 1rem 1.25rem; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; font-size: 0.88rem; color: var(--ink); }

/* ---------- Utility ---------- */
.mt-lg { margin-top: clamp(2rem, 4vw, 3rem); }
.text-center { text-align: center; }
.reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.in { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; }
}
