/* ==========================================================================
   Pain5.ca — Design System
   Physician-Led Pain Management
   ========================================================================== */

:root {
  /* Brand colour tokens, drawn from the Pain5.ca logo */
  --navy-900: #0A1A3C;   /* deep medical navy — primary brand colour */
  --navy-700: #16295B;   /* mid navy — gradients, secondary surfaces */
  --navy-600: #223873;
  --orange-500: #F0590A; /* warm orange, drawn from the "5" in the logo */
  --orange-600: #D64B04; /* hover / active */
  --orange-50:  #FDECE1;

  --cream: #FBF8F2;      /* warm white */
  --ivory: #F5F1E9;      /* soft ivory */
  --paper: #FFFFFF;
  --mist:  #EEF2F6;      /* pale blue-grey */
  --slate-600: #566072;  /* supporting text */
  --slate-400: #8993A4;
  --border: #E3E7ED;
  --border-strong: #D3D9E1;

  --text: #142238;       /* dark navy text */
  --text-muted: #55617A;

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;

  --shadow-sm: 0 1px 2px rgba(10, 26, 60, 0.06);
  --shadow-md: 0 8px 30px rgba(10, 26, 60, 0.08);
  --shadow-lg: 0 20px 60px rgba(10, 26, 60, 0.12);

  --font-display: "Manrope", "Segoe UI", sans-serif;
  --font-body: "Source Sans 3", "Segoe UI", sans-serif;

  --container: 1180px;
  --container-narrow: 760px;

  --nav-height: 84px;
}

/* ---------------------------------- 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.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

body, h1, h2, h3, h4, p, figure, blockquote, dl, dd, ul, ol {
  margin: 0;
}
ul, ol { padding: 0; list-style: none; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
input, textarea, select { font: inherit; }

body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
  font-size: 17px;
}

/* Skip link */
.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;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--navy-900);
  color: #fff;
  padding: 12px 20px;
  z-index: 1000;
  border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus {
  left: 0;
}

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

/* ---------------------------------- Type ---------------------------------- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--navy-900);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(2.1rem, 4.4vw, 3.4rem); }
h2 { font-size: clamp(1.65rem, 3vw, 2.35rem); }
h3 { font-size: 1.28rem; font-weight: 700; }
h4 { font-size: 1.05rem; font-weight: 700; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--orange-600);
}
.eyebrow::before {
  content: "";
  width: 20px;
  height: 2px;
  background: var(--orange-500);
  border-radius: 2px;
}

.lede {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 62ch;
}
p + p { margin-top: 1em; }
.muted { color: var(--text-muted); }
.small { font-size: 0.92rem; }

/* ---------------------------------- Layout ---------------------------------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 24px;
}
.container-narrow {
  width: 100%;
  max-width: var(--container-narrow);
  margin-inline: auto;
  padding-inline: 24px;
}
.section {
  padding-block: clamp(56px, 8vw, 108px);
}
.section-tight { padding-block: clamp(40px, 6vw, 72px); }
.section-header {
  max-width: 640px;
  margin-bottom: 44px;
}
.section-header.center { margin-inline: auto; text-align: center; }
.section-header > .eyebrow { margin-bottom: 14px; }
.section-header > h2 { margin-bottom: 16px; }

.bg-ivory { background: var(--ivory); }
.bg-mist { background: var(--mist); }
.bg-navy {
  background: linear-gradient(165deg, var(--navy-900), var(--navy-700) 65%, var(--navy-600));
  color: #EAF0FA;
}
.bg-navy h2, .bg-navy h3, .bg-navy h4 { color: #fff; }
.bg-navy .muted { color: #B9C6E0; }

.grid {
  display: grid;
  gap: 28px;
}
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 880px) {
  .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
}

/* Divider — signature wave, echoes the underline swoosh beneath the logo */
.pulse-divider {
  width: 100%;
  height: 28px;
  margin-block: 8px;
  overflow: hidden;
}
.pulse-divider svg { width: 100%; height: 100%; display: block; }
.pulse-divider path {
  fill: none;
  stroke: var(--orange-500);
  stroke-width: 2.5;
  stroke-linecap: round;
  opacity: 0.55;
}

/* ---------------------------------- Buttons ---------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.98rem;
  padding: 14px 26px;
  min-height: 48px;
  border-radius: 999px;
  border: 2px solid transparent;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, color 0.18s ease, border-color .18s ease;
  white-space: nowrap;
}
.btn-primary {
  background: var(--orange-500);
  color: #fff;
  box-shadow: 0 10px 24px rgba(240, 89, 10, 0.28);
}
.btn-primary:hover { background: var(--orange-600); transform: translateY(-1px); }
.btn-secondary {
  background: transparent;
  border-color: var(--navy-900);
  color: var(--navy-900);
}
.btn-secondary:hover { background: var(--navy-900); color: #fff; }
.btn-on-navy {
  background: transparent;
  border-color: rgba(255,255,255,0.55);
  color: #fff;
}
.btn-on-navy:hover { background: rgba(255,255,255,0.12); border-color: #fff; }
.btn-block { width: 100%; }
.cta-row { display: flex; gap: 14px; flex-wrap: wrap; }

/* ---------------------------------- Header ---------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 500;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--nav-height);
  gap: 20px;
}
.brand-logo {
  height: 40px;
  width: auto;
  flex-shrink: 0;
}
.brand-link { display: flex; align-items: center; }

.main-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}
.main-nav a {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--navy-900);
  padding: 10px 14px;
  border-radius: 999px;
  transition: background 0.15s ease, color .15s ease;
}
.main-nav a:hover { background: var(--mist); }
.main-nav a[aria-current="page"] {
  color: var(--orange-600);
  background: var(--orange-50);
}

.nav-right { display: flex; align-items: center; gap: 14px; }
.nav-cta { display: none; }
@media (min-width: 720px) { .nav-cta { display: inline-flex; } }

.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid var(--border-strong);
}
.nav-toggle svg { width: 22px; height: 22px; }
@media (min-width: 980px) { .nav-toggle { display: none; } }
.main-nav-wrap { display: none; }
@media (min-width: 980px) { .main-nav-wrap { display: flex; } }

.mobile-nav {
  display: none;
  border-top: 1px solid var(--border);
  background: #fff;
}
.mobile-nav.open { display: block; }
.mobile-nav .container { padding-block: 14px; display: flex; flex-direction: column; gap: 2px; }
.mobile-nav a {
  padding: 14px 8px;
  font-family: var(--font-display);
  font-weight: 600;
  border-bottom: 1px solid var(--border);
}
.mobile-nav .btn { margin-top: 12px; }
@media (min-width: 980px) { .mobile-nav { display: none !important; } }

/* ---------------------------------- Hero ---------------------------------- */
.hero {
  padding-block: clamp(56px, 9vw, 100px) clamp(48px, 7vw, 84px);
  background:
    radial-gradient(1200px 480px at 82% -10%, var(--orange-50), transparent 60%),
    linear-gradient(180deg, var(--cream), #fff 70%);
  overflow: hidden;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.85fr;
  gap: 56px;
  align-items: center;
}
@media (max-width: 940px) {
  .hero-grid { grid-template-columns: 1fr; }
}
.hero-logo {
  max-width: 380px;
  width: 70%;
  margin-bottom: 28px;
}
.hero h1 { margin-bottom: 18px; }
.hero .lede { font-size: 1.2rem; margin-bottom: 28px; }
.trust-line {
  margin-top: 26px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  color: var(--navy-700);
}
.trust-line span { display: inline-flex; align-items: center; gap: 8px; }
.trust-line span::before {
  content: "";
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--orange-500);
}

.hero-visual {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 4 / 5;
  background: var(--navy-900);
  box-shadow: var(--shadow-lg);
}
.hero-visual img { width: 100%; height: 100%; object-fit: cover; }
.hero-visual figcaption {
  position: absolute;
  left: 20px; bottom: 18px; right: 20px;
  color: #fff;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.85rem;
  text-shadow: 0 2px 12px rgba(0,0,0,0.45);
}

/* Ambient pulse-line, signature element */
.ambient-pulse {
  position: absolute;
  inset: auto 0 0 0;
  height: 60px;
  pointer-events: none;
}
.ambient-pulse svg { width: 100%; height: 100%; }
.ambient-pulse path {
  fill: none;
  stroke: rgba(240, 89, 10, 0.35);
  stroke-width: 2;
}
.pulse-anim {
  stroke-dasharray: 600;
  stroke-dashoffset: 600;
  animation: draw 5.5s ease-in-out infinite;
}
@keyframes draw {
  0% { stroke-dashoffset: 600; }
  45% { stroke-dashoffset: 0; }
  55% { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: -600; }
}

/* ---------------------------------- Cards ---------------------------------- */
.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 30px 28px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .2s ease, transform .2s ease;
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.card .icon-badge { margin-bottom: 16px; }
.card h3 { margin-bottom: 10px; }
.card p { color: var(--text-muted); }

.icon-badge {
  width: 46px; height: 46px;
  border-radius: 12px;
  background: var(--orange-50);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.icon-badge svg { width: 22px; height: 22px; stroke: var(--orange-600); }

/* Step list */
.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  counter-reset: step;
}
@media (max-width: 880px) { .steps { grid-template-columns: 1fr; } }
.step { position: relative; padding-top: 8px; }
.step .step-num {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.85rem;
  color: var(--orange-600);
  background: var(--orange-50);
  width: 34px; height: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}
.step h3 { margin-bottom: 8px; font-size: 1.08rem; }
.step p { color: var(--text-muted); font-size: 0.98rem; }
.steps-connector {
  display: none;
}
@media (min-width: 881px) {
  .steps { position: relative; }
}

/* Two-column list section */
.pain-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 32px;
}
@media (max-width: 640px) { .pain-list { grid-template-columns: 1fr; } }
.pain-list li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  color: var(--navy-900);
}
.pain-list li svg { flex-shrink: 0; width: 20px; height: 20px; stroke: var(--orange-500); margin-top: 2px; }

.notice {
  border-left: 3px solid var(--orange-500);
  background: var(--orange-50);
  padding: 18px 22px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-top: 24px;
}
.notice p { color: var(--navy-900); font-weight: 600; }
.notice.calm {
  border-left-color: var(--navy-600);
  background: var(--mist);
}
.notice.emergency {
  border-left-color: #B4271A;
  background: #FCEEEC;
}
.notice.emergency p { color: #7A1B10; }

/* ---------------------------------- FAQ Accordion ---------------------------------- */
.faq-list { border-top: 1px solid var(--border); }
.faq-item { border-bottom: 1px solid var(--border); }
.faq-question {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  text-align: left;
  background: none;
  border: none;
  padding: 22px 4px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.02rem;
  color: var(--navy-900);
}
.faq-question .plus {
  flex-shrink: 0;
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 1.5px solid var(--border-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: transform 0.25s ease, background .2s ease, border-color .2s ease;
}
.faq-question .plus::before, .faq-question .plus::after {
  content: "";
  position: absolute;
  background: var(--navy-900);
  transition: transform .25s ease, opacity .2s ease;
}
.faq-question .plus::before { width: 12px; height: 2px; }
.faq-question .plus::after { width: 2px; height: 12px; }
.faq-question[aria-expanded="true"] .plus {
  background: var(--orange-500);
  border-color: var(--orange-500);
}
.faq-question[aria-expanded="true"] .plus::before,
.faq-question[aria-expanded="true"] .plus::after { background: #fff; }
.faq-question[aria-expanded="true"] .plus::after { transform: rotate(90deg); opacity: 0; }

.faq-answer {
  overflow: hidden;
  height: 0;
  transition: height 0.25s ease;
}
.faq-answer > div { padding: 0 4px 24px; color: var(--text-muted); max-width: 68ch; }

/* ---------------------------------- Forms ---------------------------------- */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }
.field { display: flex; flex-direction: column; gap: 8px; }
.field.full { grid-column: 1 / -1; }
label {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--navy-900);
}
input[type=text], input[type=email], input[type=tel], select, textarea {
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 13px 14px;
  background: #fff;
  color: var(--text);
  min-height: 48px;
}
textarea { min-height: 120px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--orange-500); }
.checkbox-row { display: flex; align-items: flex-start; gap: 12px; }
.checkbox-row input { margin-top: 4px; width: 18px; height: 18px; flex-shrink: 0; }
.checkbox-row label { font-weight: 600; font-size: 0.95rem; }
.form-note {
  font-size: 0.88rem;
  color: var(--text-muted);
}
.form-status {
  margin-top: 16px;
  font-weight: 700;
  font-family: var(--font-display);
}
.form-status[data-state="success"] { color: #1D7A4C; }

/* ---------------------------------- Contact info blocks ---------------------------------- */
.info-card {
  background: var(--mist);
  border-radius: var(--radius-md);
  padding: 28px;
}
.info-card dt {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--slate-600);
  margin-top: 20px;
}
.info-card dt:first-child { margin-top: 0; }
.info-card dd {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--navy-900);
  margin-top: 4px;
}
.info-card dd a:hover { color: var(--orange-600); }
.placeholder-tag {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--slate-600);
  background: #fff;
  border: 1px dashed var(--border-strong);
  padding: 3px 10px;
  border-radius: 6px;
}

/* ---------------------------------- Footer ---------------------------------- */
.site-footer {
  background: var(--navy-900);
  color: #C6D1E8;
  padding-block: 64px 28px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 44px;
  border-bottom: 1px solid rgba(255,255,255,0.12);
}
@media (max-width: 880px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .footer-grid { grid-template-columns: 1fr; }
}
.footer-logo { height: 32px; margin-bottom: 16px; filter: brightness(0) invert(1); }
.footer-tag { font-weight: 700; color: #fff; font-family: var(--font-display); font-size: 0.95rem; }
.footer-powered { margin-top: 10px; font-size: 0.88rem; color: #91A1C4; }
.footer-col h4 {
  color: #fff;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 16px;
}
.footer-col ul { display: flex; flex-direction: column; gap: 11px; }
.footer-col a { color: #C6D1E8; font-size: 0.95rem; transition: color .15s ease; }
.footer-col a:hover { color: var(--orange-500); }
.footer-bottom {
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.85rem;
  color: #8797B8;
}
.footer-emergency {
  font-weight: 700;
  color: #F3B7AC;
}

/* ---------------------------------- Page hero (interior pages) ---------------------------------- */
.page-hero {
  padding-block: 56px 40px;
  background: linear-gradient(180deg, var(--cream), #fff);
  border-bottom: 1px solid var(--border);
}
.breadcrumb {
  font-size: 0.85rem;
  color: var(--slate-600);
  margin-bottom: 18px;
  font-family: var(--font-display);
  font-weight: 600;
}
.breadcrumb a:hover { color: var(--orange-600); }
.page-hero h1 { margin-bottom: 14px; }

/* ---------------------------------- Misc ---------------------------------- */
.badge-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 999px;
  background: var(--mist);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--navy-900);
}

.network-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}
.network-card {
  flex: 1 1 200px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 22px;
  transition: box-shadow .2s ease, transform .2s ease;
}
.network-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.network-card .name { font-family: var(--font-display); font-weight: 800; color: var(--navy-900); display:block; margin-bottom: 6px; }
.network-card .desc { font-size: 0.92rem; color: var(--text-muted); }

.toc {
  background: var(--mist);
  border-radius: var(--radius-md);
  padding: 24px 26px;
  margin-bottom: 40px;
}
.toc h2 { font-size: 1rem; margin-bottom: 12px; }
.toc ol { display: flex; flex-direction: column; gap: 8px; padding-left: 0; counter-reset: toc; }
.toc li { counter-increment: toc; font-size: 0.95rem; }
.toc li a { font-weight: 600; }
.toc li a:hover { color: var(--orange-600); }

.legal h2 { margin-top: 44px; margin-bottom: 14px; font-size: 1.35rem; }
.legal h2:first-of-type { margin-top: 0; }
.legal p, .legal li { color: var(--text-muted); }
.legal ul { list-style: disc; padding-left: 22px; margin-top: 10px; }
.legal li { padding: 3px 0; }
.legal strong { color: var(--navy-900); }
.updated-tag {
  display: inline-block;
  margin-top: 8px;
  font-size: 0.88rem;
  color: var(--slate-600);
  font-family: var(--font-display);
  font-weight: 600;
}

.not-found {
  min-height: 55vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding-block: 80px;
}
.not-found .mark { font-family: var(--font-display); font-weight: 800; color: var(--orange-500); font-size: 4rem; }
