/* ============================================================
   Martin Chiropractic of Northern Colorado — spec preview
   Design system: deep navy + ivory + brass, serif display
   ============================================================ */

:root {
  /* Color */
  --navy-950: #040a18;
  --navy-900: #071021;
  --navy-800: #0c1830;
  --navy-700: #142544;
  --navy-line: rgba(233, 231, 223, 0.14);
  --ink: #1c2536;
  --ink-soft: #46506333;
  --paper: #f7f4ec;
  --paper-deep: #efeadd;
  --ivory: #f3f0e7;
  --silver: #c4cbd8;
  --brass: #c2a15f;
  --brass-deep: #7a5d2a;
  --line: rgba(28, 37, 54, 0.14);

  /* Type */
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --fs-hero: clamp(2.45rem, 1.4rem + 4.6vw, 4.6rem);
  --fs-h2: clamp(1.9rem, 1.25rem + 2.6vw, 3.1rem);
  --fs-h3: clamp(1.3rem, 1.1rem + 0.8vw, 1.7rem);
  --fs-lead: clamp(1.06rem, 1rem + 0.4vw, 1.25rem);
  --fs-body: clamp(1rem, 0.97rem + 0.15vw, 1.0625rem);
  --fs-small: 0.875rem;
  --fs-eyebrow: 0.8125rem;

  /* Space */
  --space-section: clamp(4.5rem, 3rem + 5vw, 7.5rem);
  --space-lg: clamp(2.5rem, 2rem + 2vw, 4rem);
  --space-md: clamp(1.5rem, 1.25rem + 1vw, 2.25rem);
  --space-sm: 1rem;
  --gutter: clamp(1.5rem, 4.5vw, 4.5rem);

  --radius: 6px;
  --ease: cubic-bezier(0.22, 0.61, 0.24, 1);
}

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

html { scroll-behavior: smooth; overflow-x: clip; }

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

section[id] { scroll-margin-top: 5.5rem; }

img { display: block; max-width: 100%; }

h1, h2, h3, h4 { margin: 0; font-weight: 600; }

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

a { color: inherit; }

a:focus-visible,
button:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ---------- Layout primitives ---------- */
.container {
  max-width: 1180px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

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

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0 0 1.25rem;
  font-size: var(--fs-eyebrow);
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--brass-deep);
}

.eyebrow::before {
  content: "";
  width: 2.25rem;
  height: 1px;
  background: currentColor;
  opacity: 0.8;
}

.on-dark .eyebrow, .eyebrow.on-dark { color: var(--brass); }

.display {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.14;
  letter-spacing: -0.01em;
}

h2.display {
  font-size: var(--fs-h2);
  max-width: 22ch;
  margin-bottom: var(--space-md);
  text-wrap: balance;
}

.lead {
  font-size: var(--fs-lead);
  line-height: 1.7;
  max-width: 58ch;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.95rem 1.7rem;
  font-family: var(--sans);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-decoration: none;
  border-radius: 999px;
  transition: transform 0.25s var(--ease), background-color 0.25s var(--ease),
    color 0.25s var(--ease), border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn-brass {
  background: var(--brass);
  color: var(--navy-950);
}
.btn-brass:hover {
  background: #d4b578;
  box-shadow: 0 10px 28px -12px rgba(194, 161, 95, 0.7);
}

.btn-ghost-light {
  color: var(--ivory);
  border: 1px solid rgba(243, 240, 231, 0.4);
}
.btn-ghost-light:hover { border-color: var(--ivory); background: rgba(243, 240, 231, 0.08); }

.btn-navy {
  background: var(--navy-900);
  color: var(--ivory);
}
.btn-navy:hover { background: var(--navy-700); box-shadow: 0 10px 28px -14px rgba(7, 16, 33, 0.8); }

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  padding-block: 1.1rem;
  background: transparent;
  transition: background-color 0.35s var(--ease), padding 0.35s var(--ease),
    box-shadow 0.35s var(--ease);
}

.site-header.scrolled {
  background: rgba(4, 10, 24, 0.92);
  padding-block: 0.7rem;
  box-shadow: 0 1px 0 var(--navy-line);
}

@supports (backdrop-filter: blur(8px)) {
  .site-header.scrolled { background: rgba(4, 10, 24, 0.78); backdrop-filter: blur(10px); }
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.wordmark {
  text-decoration: none;
  color: var(--ivory);
  font-family: var(--serif);
  line-height: 1.2;
}

.wordmark .wm-name {
  display: block;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.wordmark .wm-sub {
  display: block;
  font-size: 0.66rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--silver);
  margin-top: 0.2rem;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2.5vw, 2rem);
}

.site-nav a:not(.btn) {
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-decoration: none;
  color: var(--silver);
  padding-block: 0.25rem;
  background-image: linear-gradient(var(--brass), var(--brass));
  background-repeat: no-repeat;
  background-size: 0% 1.5px;
  background-position: left bottom;
  transition: color 0.25s var(--ease), background-size 0.3s var(--ease);
}

.site-nav a:not(.btn):hover {
  color: var(--ivory);
  background-size: 100% 1.5px;
}

.nav-phone { white-space: nowrap; }
.site-nav .btn { padding: 0.6rem 1.25rem; font-size: 0.85rem; }

@media (max-width: 860px) {
  .site-nav a.nav-link { display: none; }
}
@media (max-width: 560px) {
  .nav-phone { display: none !important; }
  .header-inner { gap: 0.75rem; }
  .wordmark .wm-name { font-size: 0.88rem; letter-spacing: 0.1em; }
  .wordmark .wm-sub { font-size: 0.55rem; letter-spacing: 0.2em; }
  .site-nav .btn { padding: 0.55rem 1rem; font-size: 0.78rem; letter-spacing: 0.03em; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  background:
    radial-gradient(90rem 50rem at 85% -20%, #17294d 0%, transparent 55%),
    radial-gradient(55rem 32rem at -12% 115%, rgba(194, 161, 95, 0.09) 0%, transparent 60%),
    var(--navy-900);
  color: var(--ivory);
  overflow: hidden;
}

.hero::after {
  /* faint horizon line texture */
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 1px;
  background: var(--navy-line);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.85fr);
  gap: clamp(2.5rem, 5vw, 5rem);
  align-items: center;
  padding-top: calc(var(--space-section) + 4.5rem);
  padding-bottom: var(--space-section);
  min-height: min(92vh, 47rem);
}

.hero h1 {
  font-size: var(--fs-hero);
  line-height: 1.08;
  max-width: 14ch;
  margin-bottom: var(--space-md);
  text-wrap: balance;
}

.hero .lead {
  color: var(--silver);
  margin-bottom: var(--space-lg);
}

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  margin-bottom: var(--space-lg);
}

.hero-meta {
  display: grid;
  grid-template-columns: repeat(3, auto);
  justify-content: start;
  gap: 1rem 3rem;
  padding-top: 1.6rem;
  border-top: 1px solid var(--navy-line);
  font-size: var(--fs-small);
  color: var(--silver);
}

.hero-meta p { margin: 0; }

.hero-meta strong {
  display: block;
  color: var(--brass);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 0.35rem;
}

@media (max-width: 700px) {
  .hero-meta { grid-template-columns: 1fr; gap: 1rem; }
}

.hero-photo {
  position: relative;
  align-self: stretch;
  min-height: 30rem;
}

.hero-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 22%;
  border-radius: var(--radius);
  position: relative;
  z-index: 1;
}

.hero-photo::before {
  /* brass offset frame */
  content: "";
  position: absolute;
  inset: 1.4rem -1.4rem -1.4rem 1.4rem;
  border: 1px solid rgba(194, 161, 95, 0.55);
  border-radius: var(--radius);
}

.hero-photo::after {
  /* navy scrim to seat the photo in the dark hero */
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: var(--radius);
  background: linear-gradient(200deg, rgba(7, 16, 33, 0) 55%, rgba(7, 16, 33, 0.5) 100%);
  pointer-events: none;
}

@media (max-width: 900px) {
  .hero-grid {
    grid-template-columns: 1fr;
    min-height: 0;
    padding-top: calc(var(--space-section) + 3.5rem);
  }
  .hero-photo { min-height: 0; }
  .hero-photo img { aspect-ratio: 4 / 4.6; height: auto; }
  .hero-photo::before { inset: 1rem -0.75rem -0.75rem 1rem; }
}

/* ---------- Trust bar ---------- */
.trustbar {
  background: var(--navy-950);
  color: var(--silver);
  border-top: 1px solid var(--navy-line);
}

.trustbar-inner {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem 2.5rem;
  padding-block: 1.7rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.trustbar-inner span {
  display: flex;
  align-items: baseline;
  gap: 0.65rem;
}

.trustbar-inner span::before {
  content: "";
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brass);
  transform: translateY(-1px);
}

@media (max-width: 760px) {
  .trustbar-inner { grid-template-columns: 1fr; gap: 0.85rem; }
}

/* ---------- About ---------- */
.about { background: var(--paper); }

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
  gap: clamp(2.5rem, 5vw, 5.5rem);
  align-items: center;
}

.about-photo {
  position: relative;
}

.about-photo img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  object-position: 50% 30%;
  border-radius: var(--radius);
}

.about-photo figcaption {
  position: absolute;
  left: 1.1rem;
  bottom: 1.1rem;
  z-index: 2;
  background: rgba(4, 10, 24, 0.82);
  color: var(--ivory);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.55rem 0.95rem;
  border-radius: 3px;
}

.about-photo::after {
  content: "";
  position: absolute;
  inset: -1.25rem 1.5rem auto auto;
  width: 38%;
  height: 45%;
  border: 1px solid rgba(122, 93, 42, 0.35);
  border-radius: var(--radius);
  z-index: -1;
  transform: translate(1.5rem, -0.25rem);
}

.about-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: var(--space-md);
}

.badge {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--navy-800);
  border: 1px solid var(--line);
  background: #fffdf7;
  border-radius: 999px;
  padding: 0.45rem 0.95rem;
}

@media (max-width: 860px) {
  .about-grid { grid-template-columns: 1fr; }
  .about-photo { order: -1; max-width: 34rem; }
}

/* ---------- Services ---------- */
.services {
  background: var(--navy-900);
  color: var(--ivory);
}

.services-head {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 1.5rem clamp(2rem, 5vw, 5rem);
  align-items: end;
  margin-bottom: var(--space-lg);
}

.services-head .lead { color: var(--silver); }

.services-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--navy-line);
}

.service {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.1rem;
  padding: clamp(1.5rem, 2.5vw, 2.25rem) clamp(0.25rem, 1.5vw, 1.5rem) clamp(1.5rem, 2.5vw, 2.25rem) 0;
  border-bottom: 1px solid var(--navy-line);
  transition: background-color 0.3s var(--ease);
}

.service:hover { background: rgba(243, 240, 231, 0.035); }

.service:nth-child(odd) { border-right: 1px solid var(--navy-line); padding-left: 0; padding-right: clamp(1.25rem, 3vw, 2.5rem); }
.service:nth-child(even) { padding-left: clamp(1.25rem, 3vw, 2.5rem); }

.service-num {
  font-family: var(--serif);
  font-size: 0.95rem;
  color: var(--brass);
  letter-spacing: 0.08em;
  padding-top: 0.3rem;
}

.service h3 {
  font-family: var(--serif);
  font-size: var(--fs-h3);
  line-height: 1.2;
  margin-bottom: 0.6rem;
  transition: color 0.3s var(--ease);
}

.service:hover h3 { color: #e8d9b4; }

.service p {
  color: var(--silver);
  font-size: var(--fs-small);
  line-height: 1.7;
  max-width: 44ch;
}

@media (max-width: 760px) {
  .services-head { grid-template-columns: 1fr; align-items: start; }
  .services-list { grid-template-columns: 1fr; }
  .service:nth-child(odd) { border-right: 0; padding-right: 0; }
  .service:nth-child(even) { padding-left: 0; }
}

/* ---------- Visit / in the room ---------- */
.visit { background: var(--paper-deep); overflow: hidden; }

.visit-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(2.5rem, 5vw, 5.5rem);
  align-items: center;
}

.visit-photos {
  position: relative;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-template-rows: repeat(10, minmax(0, 2.6rem));
}

.visit-photos .vp-main {
  grid-column: 1 / 10;
  grid-row: 1 / 9;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: 0 24px 48px -24px rgba(7, 16, 33, 0.45);
}

.visit-photos .vp-side {
  grid-column: 7 / 13;
  grid-row: 5 / 11;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 25%;
  border-radius: var(--radius);
  border: 6px solid var(--paper-deep);
  box-shadow: 0 24px 48px -24px rgba(7, 16, 33, 0.5);
  z-index: 2;
}

.steps {
  counter-reset: step;
  list-style: none;
  margin: var(--space-md) 0 0;
  padding: 0;
  display: grid;
  gap: 1.1rem;
}

.steps li {
  counter-increment: step;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem;
  align-items: baseline;
  padding: 1.1rem 1.25rem;
  background: #fffdf7;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.steps li:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px -18px rgba(7, 16, 33, 0.35);
}

.steps li::before {
  content: "0" counter(step);
  font-family: var(--serif);
  font-size: 0.9rem;
  color: var(--brass-deep);
  letter-spacing: 0.08em;
}

.steps strong { display: block; font-family: var(--serif); font-size: 1.1rem; margin-bottom: 0.2rem; }
.steps span { font-size: var(--fs-small); color: #4a5266; }

@media (max-width: 860px) {
  .visit-grid { grid-template-columns: 1fr; }
  .visit-photos { max-width: 30rem; grid-template-rows: repeat(10, minmax(0, 2.1rem)); }
}

/* ---------- FAQ ---------- */
.faq { background: var(--paper); }

.faq-grid {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 7fr);
  gap: var(--space-md) clamp(2rem, 5vw, 5rem);
  align-items: start;
}

.faq-list { border-top: 1px solid var(--line); }

.faq-item { border-bottom: 1px solid var(--line); }

.faq-item summary {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1.5rem;
  cursor: pointer;
  list-style: none;
  padding: 1.35rem 0.25rem;
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.35;
  transition: color 0.25s var(--ease);
}

.faq-item summary:hover { color: var(--brass-deep); }
.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary::after {
  content: "+";
  flex: none;
  font-family: var(--sans);
  font-size: 1.3rem;
  font-weight: 400;
  color: var(--brass-deep);
  transition: transform 0.3s var(--ease);
}

.faq-item[open] summary::after { transform: rotate(45deg); }

.faq-item .faq-a {
  padding: 0 0.25rem 1.5rem;
  max-width: 60ch;
  color: #3c465b;
}

@media (max-width: 860px) {
  .faq-grid { grid-template-columns: 1fr; }
}

/* ---------- Contact ---------- */
.contact {
  background:
    radial-gradient(70rem 40rem at 15% 120%, #16284b 0%, transparent 60%),
    var(--navy-900);
  color: var(--ivory);
}

.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: var(--space-lg) clamp(2.5rem, 6vw, 6rem);
  align-items: center;
}

.contact .lead { color: var(--silver); margin-bottom: var(--space-lg); }

.contact-phone {
  display: inline-block;
  font-family: var(--serif);
  font-size: clamp(1.8rem, 1.2rem + 2.6vw, 3rem);
  font-weight: 600;
  color: var(--ivory);
  text-decoration: none;
  border-bottom: 2px solid rgba(194, 161, 95, 0.5);
  padding-bottom: 0.2rem;
  margin-bottom: var(--space-md);
  transition: border-color 0.25s var(--ease), color 0.25s var(--ease);
}

.contact-phone:hover { border-color: var(--brass); color: #fffdf7; }

.contact-ctas { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: var(--space-sm); }

.info-card {
  background: rgba(243, 240, 231, 0.045);
  border: 1px solid var(--navy-line);
  border-radius: var(--radius);
  padding: clamp(1.75rem, 3vw, 2.5rem);
}

.info-card h3 {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--brass);
  margin-bottom: 1.25rem;
}

.hours {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-small);
  color: var(--silver);
}

.hours td {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--navy-line);
}

.hours tr:last-child td { border-bottom: 0; }
.hours td:first-child { font-weight: 600; color: var(--ivory); padding-right: 1.5rem; white-space: nowrap; }
.hours td:last-child { text-align: right; }

.info-card address {
  font-style: normal;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--navy-line);
  color: var(--silver);
  font-size: var(--fs-small);
  line-height: 1.7;
}

@media (max-width: 860px) {
  .contact-grid { grid-template-columns: 1fr; }
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--navy-950);
  color: var(--silver);
  padding-top: var(--space-lg);
  padding-bottom: var(--space-lg);
  border-top: 1px solid var(--navy-line);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem 2.5rem;
}

.footer-inner .wordmark .wm-sub { color: #6c7688; }

.footer-nav { display: flex; flex-wrap: wrap; gap: 1.5rem; }

.footer-nav a {
  font-size: var(--fs-small);
  text-decoration: none;
  color: var(--silver);
  transition: color 0.25s var(--ease);
}

.footer-nav a:hover { color: var(--ivory); }

.footer-meta {
  width: 100%;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--navy-line);
  font-size: 0.8rem;
  color: #6c7688;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 2rem;
  justify-content: space-between;
}

/* ---------- Spec footer (required) ---------- */
.spec-footer {
  background: #020610;
  color: #8b93a5;
  font-size: 0.8rem;
  text-align: center;
  padding: 1.25rem var(--gutter) 1.5rem;
  line-height: 1.6;
}

.spec-footer a { color: #b9c1d1; }

/* ---------- Motion ---------- */
/* Baseline: everything visible with no JS. The hero entrance is time-based
   (never scroll-gated) so the page can never render with hidden content. */

.js .hero-load {
  opacity: 0;
  transform: translateY(18px);
  animation: heroIn 0.9s var(--ease) forwards;
  animation-delay: var(--d, 0s);
}

@keyframes heroIn {
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .hero-load {
    opacity: 1;
    transform: none;
    animation: none;
  }
  .btn, .steps li { transition: none; }
}
