/* ==========================================================================
   JUNIPER VITALITY — MASTER STYLESHEET
   --------------------------------------------------------------------------
   For the freelancer:
   This file is the single source of truth for all design tokens and shared
   component styles. The aesthetic direction is "refined natural elegance"
   — premium medical/wellness, calm, considered, never spa-y or generic.

   Color palette is extracted directly from the brand logo:
   - Deep juniper green (primary, from "JUNIPER" wordmark)
   - Mid juniper green (from logo circle and foliage)
   - Sage (from softer foliage tones)
   - Slate blue (from "VITALITY" wordmark)
   - Warm linen (background)

   Typography pairs Cormorant Garamond (display, matches logo serifs)
   with Inter Tight (body, clean modern sans).
   ========================================================================== */

/* === FONT IMPORTS ======================================================= */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;1,300;1,400&family=Inter+Tight:wght@300;400;500;600;700&display=swap');

/* === DESIGN TOKENS ====================================================== */
:root {
  /* Colors — Brand (extracted from logo) */
  --juniper-deep:     #2D4B1E;   /* Deep juniper — primary brand */
  --juniper-mid:      #5A784B;   /* Mid juniper — secondary */
  --juniper-soft:     #69784B;   /* Soft olive juniper */
  --sage:             #96A587;   /* Sage — soft accents */
  --sage-pale:        #C3D2C3;   /* Pale sage */
  --sage-mist:        #D2E1D2;   /* Mist green — backgrounds */

  --slate-blue:       #4B6978;   /* Slate blue from "VITALITY" */
  --slate-blue-deep:  #3C5A6B;
  --berry:            #2D4B4B;   /* Juniper berry blue-black */

  /* Colors — Neutrals */
  --linen:            #F8F5EE;   /* Warm off-white — main bg */
  --linen-deep:       #EFEAE0;
  --paper:            #FAF8F3;   /* Slightly warmer paper tone */
  --pearl:            #FFFFFF;
  --slate-deep:       #2A2E2C;   /* Body text */
  --slate-mid:        #5A615D;   /* Secondary text */
  --slate-light:      #8C928E;   /* Tertiary, captions */

  /* Colors — Accent */
  --gold:             #B89968;   /* Subtle gold for emphasis */
  --gold-pale:        #E8DCC4;
  --berry-blue:       #4B6978;   /* Berry accent (matches slate-blue) */

  /* Typography */
  --font-display: 'Cormorant Garamond', 'Playfair Display', Georgia, serif;
  --font-body: 'Inter Tight', 'Helvetica Neue', system-ui, sans-serif;

  /* Type scale */
  --text-xs:    0.75rem;
  --text-sm:    0.875rem;
  --text-base:  1rem;
  --text-md:    1.125rem;
  --text-lg:    1.375rem;
  --text-xl:    1.75rem;
  --text-2xl:   2.25rem;
  --text-3xl:   3rem;
  --text-4xl:   4rem;
  --text-5xl:   5.5rem;
  --text-6xl:   7rem;

  /* Spacing */
  --space-1:    0.25rem;
  --space-2:    0.5rem;
  --space-3:    0.75rem;
  --space-4:    1rem;
  --space-5:    1.5rem;
  --space-6:    2rem;
  --space-7:    3rem;
  --space-8:    4rem;
  --space-9:    6rem;
  --space-10:   8rem;
  --space-11:   12rem;

  /* Layout */
  --container-narrow: 720px;
  --container-mid:    1080px;
  --container-wide:   1320px;
  --container-full:   1480px;

  /* Effects */
  --radius-sm:  4px;
  --radius-md:  8px;
  --radius-lg:  16px;
  --radius-xl:  24px;
  --radius-pill: 999px;

  --shadow-sm: 0 1px 3px rgba(45, 75, 30, 0.06);
  --shadow-md: 0 4px 16px rgba(45, 75, 30, 0.08);
  --shadow-lg: 0 12px 40px rgba(45, 75, 30, 0.10);
  --shadow-xl: 0 24px 64px rgba(45, 75, 30, 0.14);

  --transition-fast: 0.2s ease;
  --transition-mid:  0.4s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.8s cubic-bezier(0.4, 0, 0.2, 1);

  --header-height: 88px;
}

/* === RESET / BASE ======================================================= */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 400;
  line-height: 1.65;
  color: var(--slate-deep);
  background: var(--linen);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

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

a {
  color: var(--juniper-deep);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover { color: var(--juniper-mid); }

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

ul, ol { list-style: none; }

/* === TYPOGRAPHY ========================================================= */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: -0.015em;
  color: var(--juniper-deep);
}

h1 {
  font-size: clamp(2.75rem, 6vw, 5.5rem);
  font-weight: 300;
  letter-spacing: -0.025em;
}
h2 {
  font-size: clamp(2.25rem, 4.5vw, 3.5rem);
  font-weight: 400;
}
h3 {
  font-size: clamp(1.625rem, 2.8vw, 2.25rem);
  font-weight: 400;
}
h4 {
  font-size: var(--text-xl);
  font-weight: 500;
  font-family: var(--font-display);
}
h5 {
  font-size: var(--text-lg);
  font-weight: 500;
  font-family: var(--font-body);
  letter-spacing: -0.01em;
}

p {
  margin-bottom: var(--space-4);
  max-width: 65ch;
}

.lead {
  font-size: var(--text-md);
  line-height: 1.6;
  color: var(--slate-mid);
  max-width: 60ch;
  font-weight: 400;
}

/* Eyebrow — small spaced-cap label, mirrors the "INTEGRATIVE MEDICINE"
   treatment in the logo */
.eyebrow {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--juniper-mid);
  margin-bottom: var(--space-4);
  display: inline-block;
}

.eyebrow--gold { color: var(--gold); }
.eyebrow--slate { color: var(--slate-blue); }

/* Italic serif tagline treatment — mirrors logo's "Live well. Heal well." */
.tagline-style {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  color: var(--juniper-deep);
}

/* Decorative divider with center ornament — echoes the leaf flourish in logo */
.divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  margin: var(--space-6) auto;
  max-width: 240px;
}

.divider::before,
.divider::after {
  content: '';
  height: 1px;
  flex: 1;
  background: var(--juniper-mid);
  opacity: 0.4;
}

.divider__ornament {
  width: 24px;
  height: 24px;
  color: var(--juniper-mid);
  opacity: 0.6;
}

/* === LAYOUT ============================================================= */
.container {
  width: 100%;
  max-width: var(--container-wide);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.container--narrow { max-width: var(--container-narrow); }
.container--mid    { max-width: var(--container-mid); }
.container--full   { max-width: var(--container-full); }

.section {
  padding: var(--space-10) 0;
}

.section--sm   { padding: var(--space-8) 0; }
.section--lg   { padding: var(--space-11) 0; }

.section--linen { background: var(--linen); }
.section--paper { background: var(--paper); }
.section--mist  { background: var(--sage-mist); }
.section--deep  { background: var(--juniper-deep); color: var(--linen); }
.section--deep h1, .section--deep h2, .section--deep h3,
.section--deep h4, .section--deep h5, .section--deep h6 {
  color: var(--linen);
}

/* Section header — eyebrow + heading + lead, used at top of most sections */
.section-header {
  margin-bottom: var(--space-8);
  max-width: 720px;
}

.section-header--center {
  text-align: center;
  margin-left: auto;
  margin-right: auto;
}

.section-header__heading {
  margin-bottom: var(--space-5);
}

/* === BUTTONS ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  padding: 0.95rem 2rem;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all var(--transition-mid);
  border: 1px solid transparent;
  white-space: nowrap;
  text-align: center;
}

.btn--primary {
  background: var(--juniper-deep);
  color: var(--linen);
}
.btn--primary:hover {
  background: var(--juniper-mid);
  color: var(--linen);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn--secondary {
  background: transparent;
  color: var(--juniper-deep);
  border-color: var(--juniper-deep);
}
.btn--secondary:hover {
  background: var(--juniper-deep);
  color: var(--linen);
  transform: translateY(-1px);
}

.btn--ghost {
  background: transparent;
  color: var(--juniper-deep);
  padding: 0.5rem 0;
}
.btn--ghost:hover {
  color: var(--juniper-mid);
}

.btn--gold {
  background: var(--gold);
  color: var(--pearl);
}
.btn--gold:hover { background: var(--juniper-deep); }

.btn--lg {
  padding: 1.1rem 2.5rem;
  font-size: var(--text-sm);
}

.btn--block { width: 100%; }

/* Button arrow icon */
.btn__arrow {
  width: 14px;
  height: 14px;
  transition: transform var(--transition-fast);
}

.btn:hover .btn__arrow {
  transform: translateX(3px);
}

/* === HEADER / NAVIGATION ================================================ */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(248, 245, 238, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(45, 75, 30, 0.08);
  transition: all var(--transition-mid);
}

.site-header__inner {
  max-width: var(--container-full);
  margin: 0 auto;
  padding: 0 var(--space-6);
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
}

.site-header__logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-shrink: 0;
}

.site-header__logo img {
  height: 56px;
  width: auto;
}

.site-header__logo-text {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  color: var(--juniper-deep);
  letter-spacing: 0.02em;
  line-height: 1;
}

.site-header__logo-text span {
  display: block;
  font-size: var(--text-xs);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--slate-blue);
  margin-top: 2px;
  font-family: var(--font-body);
  font-weight: 500;
}

/* Nav */
.site-nav {
  display: flex;
  align-items: center;
  gap: var(--space-7);
}

.site-nav__list {
  display: flex;
  align-items: center;
  gap: var(--space-7);
}

.site-nav__link {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--slate-deep);
  letter-spacing: 0.02em;
  position: relative;
  padding: 8px 0;
}

.site-nav__link:hover {
  color: var(--juniper-deep);
}

.site-nav__link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--juniper-deep);
  transition: width var(--transition-mid);
}

.site-nav__link:hover::after,
.site-nav__link.is-active::after { width: 100%; }

.site-nav__link.is-active { color: var(--juniper-deep); }

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  width: 28px;
  height: 28px;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  z-index: 101;
}

.nav-toggle__line {
  width: 100%;
  height: 1.5px;
  background: var(--juniper-deep);
  transition: all var(--transition-mid);
}

/* === HERO / DECORATIVE ELEMENTS ========================================= */

/* Botanical decorative SVG that appears as a watermark on hero sections.
   Echoes the juniper sprig in the logo without being literal. */
.botanical-mark {
  position: absolute;
  pointer-events: none;
  opacity: 0.08;
  color: var(--juniper-mid);
}

/* === CARDS ============================================================== */
.card {
  background: var(--pearl);
  border-radius: var(--radius-lg);
  padding: var(--space-7);
  transition: all var(--transition-mid);
  border: 1px solid rgba(45, 75, 30, 0.06);
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(45, 75, 30, 0.12);
}

.card--paper {
  background: var(--paper);
}

.card--bordered {
  background: transparent;
  border: 1px solid var(--juniper-mid);
}

/* Service card */
.service-card {
  background: var(--pearl);
  border-radius: var(--radius-lg);
  padding: var(--space-7);
  position: relative;
  overflow: hidden;
  transition: all var(--transition-mid);
  border: 1px solid rgba(45, 75, 30, 0.06);
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.service-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--sage);
}

.service-card__icon {
  width: 48px;
  height: 48px;
  color: var(--juniper-mid);
}

.service-card__title {
  font-size: var(--text-xl);
  margin-bottom: var(--space-3);
  color: var(--juniper-deep);
}

.service-card__description {
  color: var(--slate-mid);
  font-size: var(--text-base);
  margin-bottom: 0;
  flex-grow: 1;
}

.service-card__link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-5);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--juniper-deep);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.service-card__link svg { transition: transform var(--transition-fast); }
.service-card:hover .service-card__link svg { transform: translateX(4px); }

/* Coming-soon ribbon for Phase 2 services */
.service-card--coming-soon {
  position: relative;
}

.service-card--coming-soon::before {
  content: 'Opening Fall 2026';
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  background: var(--gold-pale);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
}

/* === FOOTER ============================================================= */
.site-footer {
  background: var(--juniper-deep);
  color: var(--linen);
  padding: var(--space-10) 0 var(--space-7);
  position: relative;
  overflow: hidden;
}

.site-footer__inner {
  max-width: var(--container-full);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.site-footer__grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: var(--space-8);
  margin-bottom: var(--space-8);
}

.site-footer h5 {
  color: var(--linen);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: var(--space-5);
  font-family: var(--font-body);
  opacity: 0.8;
}

.site-footer__brand-text {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  color: var(--linen);
  letter-spacing: 0.02em;
  margin-bottom: var(--space-3);
  font-weight: 300;
}

.site-footer__tagline {
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--text-md);
  color: var(--sage-pale);
  margin-bottom: var(--space-5);
}

.site-footer__description {
  font-size: var(--text-sm);
  color: rgba(248, 245, 238, 0.75);
  line-height: 1.6;
}

.site-footer__list { display: flex; flex-direction: column; gap: var(--space-3); }
.site-footer__list a {
  color: rgba(248, 245, 238, 0.75);
  font-size: var(--text-sm);
  transition: color var(--transition-fast);
}
.site-footer__list a:hover { color: var(--linen); }

.site-footer__social {
  display: flex;
  gap: var(--space-4);
  margin-top: var(--space-4);
}

.site-footer__social a {
  width: 40px;
  height: 40px;
  border: 1px solid rgba(248, 245, 238, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(248, 245, 238, 0.75);
  transition: all var(--transition-fast);
}
.site-footer__social a:hover {
  background: var(--linen);
  color: var(--juniper-deep);
  border-color: var(--linen);
}

.site-footer__bottom {
  border-top: 1px solid rgba(248, 245, 238, 0.12);
  padding-top: var(--space-6);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-4);
}

.site-footer__copyright {
  font-size: var(--text-xs);
  color: rgba(248, 245, 238, 0.6);
  letter-spacing: 0.04em;
}

.site-footer__legal {
  display: flex;
  gap: var(--space-5);
}

.site-footer__legal a {
  font-size: var(--text-xs);
  color: rgba(248, 245, 238, 0.6);
  letter-spacing: 0.04em;
}

/* === UTILITY CLASSES ==================================================== */
.text-center { text-align: center; }
.text-left   { text-align: left; }

.mt-0 { margin-top: 0 !important; }
.mt-4 { margin-top: var(--space-4); }
.mt-5 { margin-top: var(--space-5); }
.mt-6 { margin-top: var(--space-6); }
.mt-7 { margin-top: var(--space-7); }
.mt-8 { margin-top: var(--space-8); }

.mb-0 { margin-bottom: 0 !important; }
.mb-4 { margin-bottom: var(--space-4); }
.mb-5 { margin-bottom: var(--space-5); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-7 { margin-bottom: var(--space-7); }
.mb-8 { margin-bottom: var(--space-8); }

/* === RESPONSIVE ========================================================= */
@media (max-width: 980px) {
  :root {
    --header-height: 72px;
    --space-10: 5rem;
    --space-11: 7rem;
  }

  .site-header__logo img { height: 44px; }

  .nav-toggle { display: flex; }

  .site-nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 80%;
    max-width: 380px;
    height: 100vh;
    background: var(--linen);
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    padding: calc(var(--header-height) + var(--space-6)) var(--space-6);
    transition: right var(--transition-mid);
    box-shadow: var(--shadow-xl);
  }

  .site-nav.is-open { right: 0; }

  .site-nav__list {
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    gap: var(--space-5);
  }

  .site-nav__link { font-size: var(--text-md); }

  .site-footer__grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-7);
  }
}

@media (max-width: 640px) {
  .site-header__inner { padding: 0 var(--space-5); }
  .site-header__logo-text { display: none; }
  .container { padding: 0 var(--space-5); }
  .section { padding: var(--space-9) 0; }
  .section--lg { padding: var(--space-10) 0; }
  .site-footer__grid { grid-template-columns: 1fr; }
  .site-footer__bottom {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* === ANIMATIONS =========================================================
   IMPORTANT: Animations use 'forwards' fill mode so they end at opacity:1.
   They are PROGRESSIVE ENHANCEMENT — if JS or animations don't run for
   any reason, content remains fully visible. This is the right pattern
   for accessibility and reliable rendering. */

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.95); }
  to   { opacity: 1; transform: scale(1); }
}

/* All entrance animations use 'forwards' so the resting state is visible.
   Only apply opacity:0 starting state when @media (prefers-reduced-motion: no-preference). */
@media (prefers-reduced-motion: no-preference) {
  .animate-fade-up   { animation: fadeUp 0.9s cubic-bezier(0.4, 0, 0.2, 1) forwards; }
  .animate-fade-in   { animation: fadeIn 1s ease forwards; }
  .animate-scale-in  { animation: scaleIn 0.7s cubic-bezier(0.4, 0, 0.2, 1) forwards; }

  .delay-1 { animation-delay: 0.1s; }
  .delay-2 { animation-delay: 0.25s; }
  .delay-3 { animation-delay: 0.4s; }
  .delay-4 { animation-delay: 0.55s; }
  .delay-5 { animation-delay: 0.7s; }
}

/* Reduced-motion users see no animations at all */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Scroll-triggered subtle entrance. Content is ALWAYS visible —
   the animation just adds a gentle slide-up when it enters viewport.
   If JS doesn't load, content is unchanged (still visible).
   This prevents broken-looking pages and respects accessibility. */
@media (prefers-reduced-motion: no-preference) {
  html.js-loaded .fade-on-scroll {
    transform: translateY(16px);
    opacity: 0.4;
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  }
  html.js-loaded .fade-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0);
  }
}


/* === Patient Login link in header ======================================= */
.site-nav__divider {
  width: 1px;
  height: 22px;
  background: rgba(45, 75, 30, 0.15);
  margin: 0 var(--space-2);
}

.site-nav__login {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--juniper-mid);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-pill);
  transition: color var(--transition-fast), background-color var(--transition-fast);
}

.site-nav__login svg {
  flex-shrink: 0;
  opacity: 0.85;
}

.site-nav__login:hover {
  color: var(--juniper-deep);
  background: var(--juniper-mist);
}

/* On mobile nav, hide the divider since we stack vertically */
@media (max-width: 960px) {
  .site-nav__divider {
    display: none;
  }
  .site-nav__login {
    width: 100%;
    justify-content: flex-start;
    padding: var(--space-3) var(--space-4);
    font-size: var(--text-base);
  }
}
