/* Rocky Mountain Rehab — editorial law-firm layout */

:root {
  --bg: #f7f5f0;
  --surface: #fffcf8;
  --text: #161616;
  --text-muted: #5a5855;
  --border: #e8e4dc;
  --header-bg: #0a1628;
  --header-text: #f0ebe3;
  --accent: #1e4a5f;
  --accent-hover: #163a4c;
  --accent-soft: rgba(30, 74, 95, 0.08);
  --rule: #b8a07e;
  --focus: #2563eb;
  --radius: 2px;
  --shadow: 0 1px 2px rgba(10, 22, 40, 0.04);
  --shadow-elevated: 0 12px 40px rgba(10, 22, 40, 0.07);
  --font-sans: "DM Sans", system-ui, -apple-system, sans-serif;
  --font-display: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --step--1: clamp(0.875rem, 0.85rem + 0.08vw, 0.9375rem);
  --step-0: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  --step-1: clamp(1.15rem, 1.05rem + 0.4vw, 1.3rem);
  --step-2: clamp(1.85rem, 1.45rem + 1.2vw, 2.35rem);
  --step-3: clamp(2.35rem, 1.75rem + 2.2vw, 3.15rem);
  --measure: 62ch;
  --space: clamp(1.35rem, 4.5vw, 2.75rem);
  --content-max: 1180px;
}

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

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--step-0);
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

/* Fixed header: keep in-page anchors from sitting under the bar */
main section[id] {
  scroll-margin-top: calc(5.25rem + env(safe-area-inset-top, 0px));
}

.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space);
  z-index: 110;
  padding: 0.5rem 1rem;
  background: var(--surface);
  color: var(--accent);
  font-weight: 600;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.skip-link:focus {
  top: 0.75rem;
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  background: rgba(10, 22, 40, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--header-text);
  z-index: 100;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
  transition:
    background 0.35s ease,
    border-color 0.35s ease,
    box-shadow 0.35s ease,
    backdrop-filter 0.35s ease,
    -webkit-backdrop-filter 0.35s ease;
}

/* Over hero: bar fades to clear so the image shows through; links stay on top */
.site-header.site-header--at-top {
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-bottom-color: transparent;
  box-shadow: none;
}

.header-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 1rem var(--space);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  text-decoration: none;
  line-height: 0;
}

.brand-logo {
  height: 46px;
  width: auto;
  max-width: 200px;
  object-fit: contain;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 2rem;
}

.nav a {
  color: rgba(240, 235, 227, 0.88);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0.4rem 0;
  border-bottom: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.nav a:hover {
  color: #fff;
  border-bottom-color: var(--rule);
}

.nav a:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 4px;
  border-radius: 2px;
}

.wrap {
  max-width: var(--content-max);
  margin: 0 auto;
  padding-left: var(--space);
  padding-right: var(--space);
}

.wrap.narrow {
  max-width: 720px;
}

/* —— Hero: first paint is full-viewport image; body sections appear on scroll —— */

.hero {
  position: relative;
  display: flex;
  align-items: center;
  /* Fill the viewport; dvh accounts for mobile browser chrome */
  min-height: 100vh;
  min-height: 100dvh;
  padding-top: max(5.75rem, calc(4.5rem + env(safe-area-inset-top, 0px)));
  padding-bottom: clamp(2.5rem, 10vh, 5.5rem);
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 38%;
  z-index: 0;
}

.hero-scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  /* No fade to page bg here — cream sections only appear below the fold */
  background: linear-gradient(
    105deg,
    rgba(10, 22, 40, 0.92) 0%,
    rgba(10, 22, 40, 0.55) 48%,
    rgba(10, 22, 40, 0.25) 100%
  );
}

.hero-inner {
  position: relative;
  z-index: 2;
  max-width: 40rem;
}

.hero-kicker {
  margin: 0 0 0.85rem;
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(240, 235, 227, 0.72);
}

.hero h1 {
  font-family: var(--font-display);
  font-size: var(--step-3);
  font-weight: 500;
  line-height: 1.08;
  margin: 0 0 1.35rem;
  color: #fff;
  letter-spacing: -0.01em;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.35);
}

.hero-lead {
  margin: 0;
  max-width: var(--measure);
  font-size: var(--step-1);
  font-weight: 400;
  color: rgba(245, 241, 235, 0.92);
  line-height: 1.65;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.25);
}

.hero-lead strong {
  font-weight: 700;
  color: #fff;
}

.scroll-hint {
  position: absolute;
  left: 50%;
  bottom: clamp(1.25rem, 4vh, 2.25rem);
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: rgba(240, 235, 227, 0.85);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.35);
  transition: color 0.2s ease, opacity 0.2s ease;
}

.scroll-hint:hover,
.scroll-hint:focus-visible {
  color: #fff;
}

.scroll-hint:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.85);
  outline-offset: 6px;
  border-radius: 2px;
}

.scroll-hint__chev {
  display: block;
  width: 0.55rem;
  height: 0.55rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  margin-top: -0.2rem;
  opacity: 0.9;
}

@media (prefers-reduced-motion: no-preference) {
  .scroll-hint__chev {
    animation: scroll-hint-nudge 2.2s ease-in-out infinite;
  }
}

@keyframes scroll-hint-nudge {
  0%,
  100% {
    transform: rotate(45deg) translateY(0);
    opacity: 0.85;
  }
  50% {
    transform: rotate(45deg) translateY(0.35rem);
    opacity: 1;
  }
}

/* —— Sections —— */

.section {
  padding: clamp(3rem, 7vw, 4.75rem) 0;
}

.section-alt {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-contact {
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.section-head {
  margin: 0 0 1.75rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}

.section-label {
  margin: 0 0 0.4rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.section-head h2 {
  position: relative;
  margin: 0;
  padding-bottom: 0.65rem;
}

.section-head h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 3rem;
  height: 2px;
  background: var(--rule);
}

.section h2 {
  font-family: var(--font-display);
  font-size: var(--step-2);
  font-weight: 500;
  color: var(--header-bg);
  letter-spacing: -0.02em;
}

.section-intro {
  margin: -0.35rem 0 2rem;
  color: var(--text-muted);
  max-width: var(--measure);
  font-size: var(--step-1);
}

.wrap.narrow p {
  margin: 0 0 1.15rem;
  max-width: var(--measure);
  color: var(--text);
}

.wrap.narrow p:last-child {
  margin-bottom: 0;
}

/* —— Services accordion —— */

.accordion {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.accordion-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.accordion-item[open] {
  box-shadow: var(--shadow-elevated);
  border-color: rgba(184, 160, 126, 0.45);
}

.accordion-item summary {
  cursor: pointer;
  list-style: none;
  padding: 1.15rem 1.25rem 1.15rem 3.15rem;
  font-weight: 600;
  font-size: var(--step-1);
  font-family: var(--font-display);
  color: var(--header-bg);
  position: relative;
  user-select: none;
  transition: background 0.15s ease;
}

.accordion-item summary::-webkit-details-marker {
  display: none;
}

.accordion-item summary::before {
  content: "";
  position: absolute;
  left: 1.2rem;
  top: 50%;
  width: 0.45rem;
  height: 0.45rem;
  border-right: 1.5px solid var(--accent);
  border-bottom: 1.5px solid var(--accent);
  transform: translateY(-60%) rotate(-45deg);
  transition: transform 0.2s ease;
  opacity: 0.85;
}

.accordion-item[open] summary::before {
  transform: translateY(-25%) rotate(45deg);
}

.accordion-item summary:hover {
  background: var(--accent-soft);
}

.accordion-item summary:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: -2px;
}

.accordion-body {
  padding: 0 1.35rem 1.35rem 3.15rem;
  border-top: 1px solid var(--border);
  background: #faf8f5;
}

.accordion-body p {
  margin: 0 0 1rem;
  color: var(--text);
  max-width: 68ch;
}

.accordion-body p:last-child {
  margin-bottom: 0;
}

.accordion-body h3 {
  font-family: var(--font-sans);
  font-size: var(--step--1);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 1.35rem 0 0.5rem;
  color: var(--accent);
}

.accordion-body h3:first-child {
  margin-top: 0;
}

/* —— Contact —— */

.contact-block {
  font-style: normal;
  margin: 0;
}

.contact-block p {
  margin: 0 0 1.35rem;
}

.contact-block p:last-child {
  margin-bottom: 0;
}

.contact-block .label {
  display: inline-block;
  min-width: 4.75rem;
  color: var(--text-muted);
  font-size: var(--step--1);
  font-weight: 500;
  letter-spacing: 0.04em;
}

.contact-block a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.contact-block a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.contact-block a:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: 2px;
}

.email-link {
  font-size: var(--step-1);
}

/* —— Footer —— */

.site-footer {
  padding: 1.75rem 0 2.25rem;
  text-align: center;
  background: var(--header-bg);
  color: rgba(240, 235, 227, 0.55);
  font-size: var(--step--1);
  letter-spacing: 0.02em;
}

.site-footer p {
  margin: 0;
}
