/* Chandler Physical Therapy — Organic Soft Movement
   Sage/stone + warm blue, organic flowing shapes, motion/mobility cues.
   Mobile-first (375px), AA contrast, >=44px taps, no horizontal scroll. */

:root {
  --sage:        #5e7d68;
  --sage-700:    #46604f;
  --sage-200:    #cdddd1;
  --sage-100:    #e7efe9;
  --blue:        #3f6b8e;
  --blue-200:    #c7d9e6;
  --stone-900:   #2c2a26;
  --stone-700:   #4b463f;
  --stone-500:   #6f6a61;
  --stone-200:   #e3ded6;
  --cream:       #faf7f1;
  --cream-2:     #f3efe7;
  --white:       #ffffff;

  --radius:      22px;
  --radius-lg:   34px;
  --shadow:      0 14px 40px -18px rgba(44, 42, 38, 0.28);
  --shadow-soft: 0 8px 24px -16px rgba(44, 42, 38, 0.22);
  --wrap:        1120px;
  --ease:        cubic-bezier(0.22, 1, 0.36, 1);

  --font-head: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--stone-900);
  background: var(--cream);
  line-height: 1.6;
  overflow-x: hidden;
}

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

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 600; line-height: 1.15; color: var(--stone-900); margin: 0 0 0.5em; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }

/* Accessibility */
.skip-link {
  position: absolute; left: 12px; top: -60px;
  background: var(--sage-700); color: var(--white);
  padding: 12px 18px; border-radius: 0 0 12px 12px;
  z-index: 1000; transition: top 0.2s ease;
}
.skip-link:focus { top: 0; text-decoration: none; }

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

/* Flowing background */
.bg-flow {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  opacity: 0.5;
}
.bg-flow svg { width: 100%; height: 100%; }
.blob-1 { fill: var(--sage-100); }
.blob-2 { fill: var(--blue-200); opacity: 0.6; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 12px 24px;
  font-family: var(--font-body); font-weight: 600; font-size: 1rem;
  border-radius: 999px; border: 2px solid transparent;
  cursor: pointer; transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s ease;
  text-decoration: none; line-height: 1.1;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn-primary { background: var(--sage-700); color: var(--cream); box-shadow: var(--shadow-soft); }
.btn-primary:hover { background: var(--sage); color: var(--white); }
.btn-ghost { background: transparent; color: var(--sage-700); border-color: var(--sage-200); }
.btn-ghost:hover { background: var(--sage-100); }
.btn-block { width: 100%; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(250, 247, 241, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(94, 125, 104, 0.14);
  transition: box-shadow 0.3s ease;
}
.site-header.scrolled { box-shadow: var(--shadow-soft); }
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 64px; }
.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--sage-700); }
.logo:hover { text-decoration: none; }
.logo-mark { display: inline-flex; color: var(--sage); }
.logo-text { font-family: var(--font-head); font-size: 1.05rem; color: var(--stone-900); font-weight: 400; }
.logo-text strong { font-weight: 600; color: var(--sage-700); }

.main-nav { display: none; align-items: center; gap: 22px; }
.main-nav a { color: var(--stone-700); font-weight: 500; font-size: 0.95rem; }
.main-nav a:hover { color: var(--sage-700); text-decoration: none; }
.main-nav .nav-cta {
  background: var(--sage-700); color: var(--cream);
  padding: 10px 20px; border-radius: 999px; min-height: 44px;
  display: inline-flex; align-items: center;
}
.main-nav .nav-cta:hover { background: var(--sage); color: var(--white); }

/* Sections */
.section { padding: 64px 0; position: relative; }
.section-soft { background: var(--cream-2); }
.eyebrow {
  text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.78rem;
  font-weight: 600; color: var(--sage-700); margin: 0 0 10px;
}
.eyebrow.center { text-align: center; }
.section-title { font-size: clamp(1.7rem, 6vw, 2.5rem); text-align: center; }
.section-intro { text-align: center; max-width: 60ch; margin: 0 auto 36px; color: var(--stone-700); }

/* Hero */
.hero { padding: 48px 0 56px; }
.hero-grid { display: grid; gap: 36px; align-items: center; }
.eyebrow + h1 { margin-top: 0; }
.hero h1 { font-size: clamp(2.1rem, 9vw, 3.4rem); }
.hero h1 em { font-style: italic; color: var(--sage-700); }
.lede { font-size: 1.12rem; color: var(--stone-700); max-width: 50ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 22px 0 24px; }
.hero-trust { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.hero-trust li { display: flex; align-items: center; gap: 10px; color: var(--stone-700); font-weight: 500; }
.hero-trust span { color: var(--sage); font-weight: 700; }

.hero-motion {
  margin: 0; background: var(--white); border-radius: var(--radius-lg);
  padding: 24px; box-shadow: var(--shadow); border: 1px solid rgba(94,125,104,0.1);
  max-width: 380px; justify-self: center;
}
.hero-motion svg { width: 100%; max-width: 280px; margin: 0 auto; }
.hero-motion figcaption { text-align: center; margin-top: 12px; color: var(--stone-500); font-size: 0.9rem; }

/* Signature motion: range-of-motion limb */
.rom-limb { transform-origin: 160px 160px; animation: rom 4.5s var(--ease) infinite; }
@keyframes rom {
  0%, 100% { transform: rotate(0deg); }
  45%      { transform: rotate(-95deg); }
  55%      { transform: rotate(-95deg); }
}
.rom-arc {
  stroke-dasharray: 160;
  stroke-dashoffset: 160;
  animation: arc-draw 4.5s var(--ease) infinite;
}
@keyframes arc-draw {
  0%, 100% { stroke-dashoffset: 160; }
  45%, 55% { stroke-dashoffset: 0; }
}

/* Cards (services) */
.cards { display: grid; gap: 18px; grid-template-columns: 1fr; }
.card {
  background: var(--white); border-radius: var(--radius); padding: 26px 22px;
  box-shadow: var(--shadow-soft); border: 1px solid rgba(94,125,104,0.1);
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.card-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 64px; height: 64px; border-radius: 20px;
  background: var(--sage-100); color: var(--sage-700); margin-bottom: 14px;
}
.card h3 { font-size: 1.22rem; }
.card p { margin: 0; color: var(--stone-700); }

/* Conditions */
.conditions {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 12px; grid-template-columns: 1fr 1fr;
}
.conditions li {
  background: var(--white); border-radius: 16px; padding: 14px 16px;
  border: 1px solid rgba(94,125,104,0.12); font-weight: 500; color: var(--stone-900);
  display: flex; align-items: center; min-height: 56px;
  box-shadow: var(--shadow-soft);
}
.conditions li::before {
  content: ""; flex: 0 0 auto; width: 10px; height: 10px; border-radius: 50%;
  background: var(--sage); margin-right: 12px;
}

/* About */
.about-grid { display: grid; gap: 32px; align-items: center; }
.about-media { justify-self: center; max-width: 360px; }
.about-illo { width: 100%; }
.about-copy h2 { font-size: clamp(1.7rem, 6vw, 2.4rem); }
.about-copy p { color: var(--stone-700); }
.about-signoff { font-family: var(--font-head); font-style: italic; color: var(--sage-700); font-size: 1.1rem; }
.about-copy .btn { margin-top: 8px; }

/* New patient steps */
.steps {
  list-style: none; margin: 0 0 28px; padding: 0;
  display: grid; gap: 18px; grid-template-columns: 1fr; counter-reset: step;
}
.steps li {
  background: var(--white); border-radius: var(--radius); padding: 24px;
  box-shadow: var(--shadow-soft); border: 1px solid rgba(94,125,104,0.1);
  position: relative;
}
.step-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--blue); color: var(--white); font-family: var(--font-head);
  font-size: 1.2rem; font-weight: 600; margin-bottom: 12px;
}
.steps h3 { font-size: 1.15rem; }
.steps p { margin: 0; color: var(--stone-700); }
.np-notes {
  background: var(--sage-100); border-radius: var(--radius); padding: 22px 24px;
  border: 1px solid var(--sage-200); max-width: 760px; margin: 0 auto;
}
.np-notes p { margin: 0; color: var(--stone-700); }

/* Reviews */
.reviews { display: grid; gap: 18px; grid-template-columns: 1fr; }
.review {
  background: var(--white); border-radius: var(--radius); padding: 24px;
  box-shadow: var(--shadow-soft); border: 1px solid rgba(94,125,104,0.1);
}
.stars { color: #d99a3a; letter-spacing: 2px; font-size: 1.1rem; margin-bottom: 10px; }
.review h3 { font-size: 1.12rem; }
.review p { margin: 0; color: var(--stone-700); }
.reviews-disclaimer { text-align: center; color: var(--stone-500); font-size: 0.85rem; margin-top: 24px; }

/* Location */
.location-grid { display: grid; gap: 28px; align-items: center; }
.nap { font-style: normal; margin: 16px 0; }
.nap-line { margin: 0 0 10px; color: var(--stone-700); }
.nap-line strong { color: var(--stone-900); }
.nap-note { color: var(--stone-500); font-size: 0.88rem; }
.location-map { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-soft); }
.map-illo { width: 100%; }

/* Contact */
.contact-grid { display: grid; gap: 32px; align-items: start; }
.contact-meta { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 10px; }
.contact-meta li { color: var(--stone-700); }
.contact-meta strong { color: var(--stone-900); }
.contact-form {
  background: var(--white); border-radius: var(--radius-lg); padding: 28px 24px;
  box-shadow: var(--shadow); border: 1px solid rgba(94,125,104,0.1);
}
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 600; margin-bottom: 6px; color: var(--stone-900); font-size: 0.95rem; }
.field input, .field textarea {
  width: 100%; padding: 13px 14px; min-height: 48px;
  border: 1.5px solid var(--stone-200); border-radius: 14px;
  font-family: var(--font-body); font-size: 1rem; color: var(--stone-900);
  background: var(--cream); transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.field textarea { resize: vertical; min-height: 110px; }
.field input:focus, .field textarea:focus {
  outline: none; border-color: var(--sage); box-shadow: 0 0 0 3px rgba(94,125,104,0.18);
}
.field input[aria-invalid="true"], .field textarea[aria-invalid="true"] { border-color: #b4452f; }
.form-status { margin: 12px 0 0; font-weight: 600; min-height: 1.2em; }
.form-status.ok { color: var(--sage-700); }
.form-status.err { color: #b4452f; }
.form-fineprint { font-size: 0.8rem; color: var(--stone-500); margin: 12px 0 0; }

/* Footer */
.site-footer { background: var(--stone-900); color: var(--cream-2); padding: 48px 0 24px; margin-top: 24px; }
.footer-inner { display: grid; gap: 28px; grid-template-columns: 1fr; }
.site-footer .logo-text { color: var(--cream); }
.site-footer .logo-text strong { color: var(--sage-200); }
.footer-brand p { color: rgba(243,239,231,0.7); max-width: 40ch; margin: 10px 0 0; }
.footer-col h4 { color: var(--cream); font-size: 1rem; margin-bottom: 12px; }
.footer-col a, .footer-col p { display: block; color: rgba(243,239,231,0.78); margin-bottom: 8px; }
.footer-col a:hover { color: var(--cream); }
.footer-bottom {
  display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center;
  margin-top: 32px; padding-top: 20px; border-top: 1px solid rgba(243,239,231,0.15);
  font-size: 0.85rem; color: rgba(243,239,231,0.65);
}
.footer-bottom a { color: var(--sage-200); }

/* Sticky mobile CTA */
.sticky-cta {
  position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 90;
  background: var(--sage-700); color: var(--cream);
  text-align: center; padding: 15px; min-height: 52px;
  border-radius: 999px; font-weight: 600; font-size: 1.05rem;
  box-shadow: 0 10px 30px -8px rgba(44,42,38,0.5);
  display: flex; align-items: center; justify-content: center;
}
.sticky-cta:hover { background: var(--sage); color: var(--white); text-decoration: none; }

/* Reveal animation */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity 0.6s var(--ease), transform 0.6s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }

/* Tablet */
@media (min-width: 640px) {
  .cards { grid-template-columns: 1fr 1fr; }
  .reviews { grid-template-columns: 1fr 1fr 1fr; }
  .conditions { grid-template-columns: 1fr 1fr 1fr; }
  .steps { grid-template-columns: 1fr 1fr 1fr; }
}

/* Desktop */
@media (min-width: 900px) {
  .section { padding: 88px 0; }
  .hero { padding: 64px 0 72px; }
  .main-nav { display: flex; }
  .sticky-cta { display: none; }
  .hero-grid { grid-template-columns: 1.05fr 0.95fr; }
  .hero-motion { justify-self: end; }
  .about-grid { grid-template-columns: 0.9fr 1.1fr; }
  .location-grid { grid-template-columns: 1fr 1fr; }
  .contact-grid { grid-template-columns: 1fr 1.05fr; }
  .footer-inner { grid-template-columns: 2fr 1fr 1fr; }
  .conditions { grid-template-columns: repeat(4, 1fr); }
}

/* Reduced motion */
@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;
  }
  .rom-limb { transform: rotate(-48deg); }
  .rom-arc { stroke-dashoffset: 0; }
  .reveal { opacity: 1; transform: none; }
}
