/* ==========================================================================
   Dr. Abbie Clinics — Design System
   Tokens, reset, typography, layout primitives, utilities.
   Governed by DESIGN.md. Component styles live in components.css.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. TOKENS
   -------------------------------------------------------------------------- */

:root{
  /* Brand — fixed by the developer brief, do not substitute */
  --azure:          #1188CF;
  --orange:         #F0682C;
  --deep-blue:      #0C2E47;
  --charcoal:       #232629;
  --pale-blue:      #DDF0FB;

  /* Accessibility-derived siblings (see DESIGN.md §2)
     White on --orange is 3.12:1 and fails AA at button-label size.
     --azure as link text on white is 3.86:1 and fails AA.
     These are the same hues darkened to clear 4.5:1. Not a rebrand. */
  --orange-deep:    #CB4C12;   /* 4.58:1 with white — CTA rest state */
  --azure-deep:     #0F78B5;   /* 4.80:1 on white — link + small text */

  /* Ink */
  --ink:            #232629;   /* body copy — never #000 */
  --ink-muted:      #555A5E;   /* metadata, captions — 7.0:1 on white */
  --ink-invert:     #FFFFFF;

  /* Surfaces */
  --surface:        #FFFFFF;
  --surface-alt:    var(--pale-blue);
  --surface-dark:   var(--deep-blue);
  --surface-footer: var(--charcoal);

  /* Lines & shadows — tinted to deep blue, never neutral black */
  --hairline:       rgba(12, 46, 71, 0.12);
  --hairline-soft:  rgba(12, 46, 71, 0.07);
  --hairline-invert:rgba(255, 255, 255, 0.14);
  --shadow-card:    0 2px 8px rgba(12, 46, 71, 0.06);
  --shadow-lift:    0 8px 24px rgba(12, 46, 71, 0.10);
  --shadow-header:  0 1px 0 rgba(12, 46, 71, 0.08);

  /* Type */
  --font-sans: "Poppins", "Segoe UI", system-ui, -apple-system, sans-serif;

  --fs-h1:      clamp(2.25rem, 5vw, 3.75rem);
  --fs-h2:      clamp(1.75rem, 3vw, 2.5rem);
  --fs-h3:      clamp(1.25rem, 2vw, 1.5rem);
  --fs-body-lg: clamp(1.125rem, 1.6vw, 1.3125rem);
  --fs-body:    1.125rem;    /* 18px — floor for clinical reading */
  --fs-small:   0.9375rem;   /* 15px */
  --fs-eyebrow: 0.8125rem;   /* 13px */

  /* Spacing — 8px base */
  --sp-1: 0.25rem;  --sp-2: 0.5rem;   --sp-3: 0.75rem;  --sp-4: 1rem;
  --sp-5: 1.5rem;   --sp-6: 2rem;     --sp-7: 2.5rem;   --sp-8: 3rem;
  --sp-9: 4rem;     --sp-10: 5rem;

  --section-y:  clamp(4rem, 9vw, 7rem);
  --gutter:     clamp(1.25rem, 5vw, 3rem);
  --container:  1240px;
  --measure:    68ch;

  /* Shape */
  --radius-card: 1rem;
  --radius-sm:   0.5rem;
  --radius-pill: 999px;

  /* Motion */
  --ease:      cubic-bezier(0.22, 1, 0.36, 1);
  --dur:       240ms;
  --dur-slow:  400ms;

  --header-h: 76px;
}

/* --------------------------------------------------------------------------
   2. RESET
   -------------------------------------------------------------------------- */

body *, body *::before, body *::after{ box-sizing: border-box; }

html{
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + var(--sp-4));
}

body{
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  font-weight: 400;
  line-height: 1.65;
  color: var(--ink);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body h1, body h2, body h3, body h4, body p, body figure, body blockquote, body ul, body ol, body dl{ margin: 0; }
body ul[class], body ol[class]{ list-style: none; padding: 0; }

body img, body picture, body svg, body video{
  display: block;
  max-width: 100%;
  height: auto;
}

body button, body input, body select, body textarea{ font: inherit; color: inherit; }
body button{ cursor: pointer; background: none; border: 0; padding: 0; }

body a{ color: var(--azure-deep); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
body a:hover{ color: var(--deep-blue); }

/* Focus — always visible, never removed */
body :focus-visible{
  outline: 3px solid var(--azure-deep);
  outline-offset: 3px;
  border-radius: 2px;
}
body :focus:not(:focus-visible){ outline: none; }

/* Screen-reader only, and the skip link that becomes visible on focus */
body .sr-only{
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
body .skip-link{
  position: absolute; top: var(--sp-2); left: var(--sp-2);
  z-index: 200;
  padding: var(--sp-3) var(--sp-5);
  background: var(--deep-blue); color: var(--ink-invert);
  border-radius: var(--radius-pill);
  font-weight: 600; text-decoration: none;
  transform: translateY(-200%);
  transition: transform var(--dur) var(--ease);
}
body .skip-link:focus{ transform: translateY(0); color: var(--ink-invert); }

/* --------------------------------------------------------------------------
   3. TYPOGRAPHY
   -------------------------------------------------------------------------- */

body .h1, body h1{
  font-size: var(--fs-h1);
  font-weight: 300;              /* light — the brand's signature */
  letter-spacing: -0.02em;
  line-height: 1.08;
}
/* The keyword run inside an H1. One per headline, never two. */
body .h1 strong, body h1 strong, body .h1 em, body h1 em{
  font-weight: 700;
  font-style: normal;
}

body .h2, body h2{
  font-size: var(--fs-h2);
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.15;
}

body .h3, body h3{
  font-size: var(--fs-h3);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

body .eyebrow{
  display: block;
  font-size: var(--fs-eyebrow);
  font-weight: 600;
  letter-spacing: 0.12em;
  line-height: 1.2;
  text-transform: uppercase;
  color: var(--azure-deep);
  margin-bottom: var(--sp-3);
}
body .eyebrow--invert{ color: #7FC4EC; }

body .lede{
  font-size: var(--fs-body-lg);
  line-height: 1.55;
  color: var(--ink-muted);
}
body .lede--invert{ color: rgba(255, 255, 255, 0.85); }

body .prose{ max-width: var(--measure); }
body .prose > * + *{ margin-top: var(--sp-4); }
body .prose h2{ margin-top: var(--sp-8); }
body .prose h3{ margin-top: var(--sp-6); }
body .prose ul, body .prose ol{ padding-left: 1.25em; }
body .prose li + li{ margin-top: var(--sp-2); }

body .text-muted{ color: var(--ink-muted); }
body .text-small{ font-size: var(--fs-small); }

/* --------------------------------------------------------------------------
   4. LAYOUT
   -------------------------------------------------------------------------- */

body .container{
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
body .container--narrow{ max-width: 860px; }

body .section{ padding-block: var(--section-y); }
body .section--tight{ padding-block: clamp(2.5rem, 6vw, 4rem); }
body .section--alt{ background: var(--surface-alt); }
body .section--dark{
  background: var(--surface-dark);
  color: var(--ink-invert);
  position: relative;
  overflow: hidden;
}
body .section--dark h2, body .section--dark h3{ color: var(--ink-invert); }

body .section-head{ max-width: var(--measure); margin-bottom: var(--sp-8); }
body .section-head p{ margin-top: var(--sp-4); }
body .section-head--center{ margin-inline: auto; text-align: center; }

/* Grid primitives ---------------------------------------------------------- */

/* Homogeneous peer sets: locations, services, conditions, staff.
   Uniform grid is correct information design here — see DESIGN.md §6. */
body .grid-auto{
  display: grid;
  gap: var(--sp-5);
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
body .grid-auto--sm{ grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
body .grid-auto--lg{ grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }

/* Narrative sections: about, NBA explainer, practitioner highlight. */
body .split{
  display: grid;
  gap: clamp(var(--sp-6), 5vw, var(--sp-9));
  align-items: center;
  grid-template-columns: 1fr;
}
@media (min-width: 900px) {
  body .split{ grid-template-columns: 7fr 5fr; }
  body .split--even{ grid-template-columns: 1fr 1fr; }
  body .split--reverse > :first-child{ order: 2; }
  body .split--wide-right{ grid-template-columns: 5fr 7fr; }
}

body .stack > * + *{ margin-top: var(--sp-4); }
body .stack-lg > * + *{ margin-top: var(--sp-6); }

body .cluster{
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  align-items: center;
}

/* --------------------------------------------------------------------------
   5. HEXAGON MOTIF
   Background texture only. Never a container, mask, frame or bullet.
   -------------------------------------------------------------------------- */

body .hex-texture{ position: relative; isolation: isolate; }
body .hex-texture::before{
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='64' viewBox='0 0 56 64'%3E%3Cpath d='M28 0l24 14v28L28 56 4 42V14z' fill='none' stroke='%23ffffff' stroke-width='1.5'/%3E%3C/svg%3E");
  background-size: 56px 64px;
  opacity: 0.07;
}
/* Light grounds: azure hexes at 3% */
body .hex-texture--light::before{
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='64' viewBox='0 0 56 64'%3E%3Cpath d='M28 0l24 14v28L28 56 4 42V14z' fill='none' stroke='%231188CF' stroke-width='1.5'/%3E%3C/svg%3E");
  opacity: 0.06;
}

/* --------------------------------------------------------------------------
   6. MOTION
   -------------------------------------------------------------------------- */

/* Scroll reveal — one-shot, transform + opacity only, never re-triggers */
body .reveal{
  opacity: 0;
  transform: translateY(12px);
  transition: opacity var(--dur-slow) var(--ease), transform var(--dur-slow) var(--ease);
}
body .reveal.is-visible{ opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html{ scroll-behavior: auto; }
  body *, body *::before, body *::after{
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  body .reveal{ opacity: 1; transform: none; }
}

/* --------------------------------------------------------------------------
   7. UTILITIES
   -------------------------------------------------------------------------- */

body .text-center{ text-align: center; }
body .mt-0{ margin-top: 0; }
body .mt-4{ margin-top: var(--sp-4); }
body .mt-6{ margin-top: var(--sp-6); }
body .mt-8{ margin-top: var(--sp-8); }
body .mb-6{ margin-bottom: var(--sp-6); }
body .full-bleed-guard{ overflow-x: clip; }

/* Placeholder marker — every unsupplied fact is visibly tagged, never invented */
body .placeholder{
  background: #FFF4E5;
  color: #8A4B00;
  border: 1px dashed #E0A55F;
  border-radius: var(--radius-sm);
  padding: 0.1em 0.45em;
  font-size: 0.92em;
  font-weight: 600;
  white-space: nowrap;
}
body .section--dark .placeholder, body .site-footer .placeholder{
  background: rgba(255, 255, 255, 0.12);
  color: #FFD9A8;
  border-color: rgba(255, 200, 140, 0.5);
}
