/* Altamedix — modernized redesign
   Warm earth tones, editorial type, healthcare-trustworthy */

:root {
  /* Warm earth palette — Altamedix brand */
  --bone:       #FAF6EE;
  --sand:       #F1E8D6;
  --sand-deep:  #E8DCC2;
  --terracotta: #1F7A3D;          /* Altamedix green (primary) */
  --terracotta-deep: #155A2D;
  --sage:       #6B8268;
  --sage-deep:  #4F6650;
  --accent:     #E8852C;          /* Altamedix orange leaf accent */
  --ink:        #1B2620;
  --ink-soft:   #3A4A40;
  --muted:      #7A857F;
  --rule:       #D9CDB7;

  /* Type */
  --serif: "Instrument Serif", "Newsreader", Georgia, serif;
  --sans:  "Geist", "Manrope", -apple-system, system-ui, sans-serif;
  --mono:  "JetBrains Mono", ui-monospace, monospace;

  /* Type scale */
  --fs-xs: 12px;
  --fs-sm: 14px;
  --fs-base: 16px;
  --fs-md: 18px;
  --fs-lg: 22px;
  --fs-xl: 32px;
  --fs-2xl: 48px;
  --fs-3xl: 72px;
  --fs-4xl: 104px;

  /* Layout */
  --gutter: 24px;
  --max-w: 1280px;
  --radius-sm: 6px;
  --radius: 12px;
  --radius-lg: 24px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--bone);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--fs-base);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, video, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
input, select, textarea { font: inherit; color: inherit; }

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.05;
  color: var(--ink);
  text-wrap: balance;
}

.serif { font-family: var(--serif); font-weight: 400; }
.sans  { font-family: var(--sans); }

.eyebrow {
  font-family: var(--sans);
  font-size: var(--fs-xs);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--terracotta-deep);
  font-weight: 500;
}

.muted { color: var(--muted); }

.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.rule { height: 1px; background: var(--rule); border: 0; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.005em;
  transition: transform .12s ease, background .15s ease, color .15s ease, border-color .15s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--terracotta);
  color: var(--bone);
}
.btn-primary:hover { background: var(--terracotta-deep); }

.btn-secondary {
  background: var(--ink);
  color: var(--bone);
}
.btn-secondary:hover { background: #000; }

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--ink);
}
.btn-ghost:hover { background: var(--ink); color: var(--bone); }

.btn-outline {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--rule);
}
.btn-outline:hover { border-color: var(--ink); }

.btn-sm { padding: 9px 16px; font-size: 13px; }
.btn-lg { padding: 18px 28px; font-size: 16px; }

/* Header */
.utility-bar {
  background: var(--ink);
  color: var(--bone);
  font-size: 13px;
  padding: 8px 0;
}
.utility-bar .container {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  flex-wrap: nowrap;
}
.utility-bar a { display: inline-flex; align-items: center; gap: 8px; opacity: .85; white-space: nowrap; }
.utility-bar a:hover { opacity: 1; }
.utility-bar .left { display: flex; gap: 18px; align-items: center; min-width: 0; flex-wrap: wrap; }
.utility-bar .right { display: flex; gap: 16px; align-items: center; flex-shrink: 0; }

.header {
  background: var(--bone);
  border-bottom: 1px solid var(--rule);
  position: sticky; top: 0; z-index: 50;
}
.header .container {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 16px; padding-bottom: 16px;
  gap: 16px;
}
.brand {
  display: flex; align-items: center; gap: 12px;
  flex-shrink: 0;
}
.brand-logo {
  display: flex; align-items: center;
}
.brand-img {
  height: 44px;
  width: auto;
  display: block;
}
.brand-mark {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--terracotta);
  display: grid; place-items: center;
  color: var(--bone); font-family: var(--serif); font-size: 22px;
}

.nav {
  display: flex; gap: 2px; align-items: center;
  flex-wrap: nowrap;
}
.nav a {
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 14px;
  color: var(--ink-soft);
  font-weight: 500;
  position: relative;
  white-space: nowrap;
}
.nav a:hover { color: var(--ink); background: var(--sand); }
.nav a.active { color: var(--ink); }
.nav a.active::after {
  content: ""; position: absolute; left: 10px; right: 10px; bottom: 4px;
  height: 2px; background: var(--terracotta);
}
.nav .has-menu {
  position: relative;
}
.nav .menu {
  position: absolute; top: 100%; left: 0;
  background: var(--bone);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 12px;
  min-width: 280px;
  box-shadow: 0 20px 50px -20px rgba(42,32,26,.25);
  display: none;
  z-index: 60;
}
.nav .has-menu:hover .menu { display: block; }
.nav .menu a {
  display: block;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
}
.nav .menu a small {
  display: block; color: var(--muted); font-size: 12px; margin-top: 2px;
  font-weight: 400;
}

.header-cta {
  display: flex; gap: 8px; align-items: center;
  flex-shrink: 0;
}
.header-cta .btn { padding: 9px 14px; font-size: 13px; }

/* Footer */
.footer {
  background: var(--ink);
  color: var(--bone);
  padding: 80px 0 40px;
  margin-top: 120px;
}
.footer h3 { color: var(--bone); font-size: 64px; margin-bottom: 32px; }
.footer .grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
  padding-bottom: 60px;
  border-bottom: 1px solid rgba(250,246,238,.1);
}
.footer .col h5 {
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--sand-deep);
  margin-bottom: 18px;
  font-weight: 500;
}
.footer .col a {
  display: block;
  padding: 6px 0;
  color: rgba(250,246,238,.75);
  font-size: 14px;
}
.footer .col a:hover { color: var(--bone); }
.footer .legal {
  padding-top: 32px;
  display: flex; justify-content: space-between;
  font-size: 13px; color: rgba(250,246,238,.5);
}

/* Sticky CTA cluster (mobile + secondary) */
.sticky-cta {
  position: fixed;
  right: 24px;
  bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 40;
}
.sticky-cta .btn {
  box-shadow: 0 10px 30px -10px rgba(42,32,26,.4);
}

/* Sections */
.section { padding: 100px 0; }
.section-sm { padding: 60px 0; }
.section-lg { padding: 140px 0; }

.section-head {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 60px;
  align-items: end;
  margin-bottom: 60px;
}
.section-head .label { padding-top: 8px; }
.section-head h2 {
  font-size: var(--fs-3xl);
  letter-spacing: -0.03em;
}

/* Forms */
.field {
  display: flex; flex-direction: column;
  gap: 6px;
}
.field label {
  font-size: 13px; color: var(--ink-soft); font-weight: 500;
}
.field input, .field select, .field textarea {
  padding: 14px 16px;
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: var(--bone);
  font-size: 15px;
  transition: border-color .15s ease;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--ink);
}
.field-row {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.field-row-3 {
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
}

.chip-group {
  display: flex; flex-wrap: wrap; gap: 8px;
}
.chip {
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid var(--rule);
  background: var(--bone);
  font-size: 14px;
  cursor: pointer;
  transition: all .15s ease;
}
.chip:hover { border-color: var(--ink); }
.chip.active {
  background: var(--ink);
  color: var(--bone);
  border-color: var(--ink);
}

/* Cards */
.card {
  background: var(--bone);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 32px;
}

.tag {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--sand);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
}

/* Utility */
.flex { display: flex; }
.col { display: flex; flex-direction: column; }
.gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; } .gap-6 { gap: 24px; } .gap-8 { gap: 32px; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.text-center { text-align: center; }
.w-full { width: 100%; }

/* ---- Motion: scroll reveal ---------------------------------------------
   Elements opt in via `data-reveal`. The shared IntersectionObserver
   (motion.jsx) flips `data-revealed` on entry. Stagger via inline
   `style="--reveal-delay: 80ms"` on siblings. Reduced-motion users get
   instant reveal courtesy of the guard injected in motion.jsx. */

[data-reveal] {
  opacity: 0;
  transform: translateY(14px);
  transition:
    opacity 700ms cubic-bezier(.2,.7,.2,1),
    transform 700ms cubic-bezier(.2,.7,.2,1);
  transition-delay: var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}
[data-reveal][data-revealed] {
  opacity: 1;
  transform: none;
}
[data-reveal="fade"] { transform: none; }

/* ---- Hero video (right column) -----------------------------------------
   Replaces the old 2x2 stat grid. Aspect 4:5 portrait, soft ring border.
   The placeholder treatment underneath shows when no source is available
   so the layout stays honest until real footage lands. */

.hero-visual {
  position: relative;
  aspect-ratio: 4 / 5;
  width: 100%;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background:
    radial-gradient(120% 80% at 30% 20%, rgba(31,122,61,.18), transparent 60%),
    radial-gradient(120% 80% at 80% 90%, rgba(232,133,44,.15), transparent 60%),
    linear-gradient(135deg, var(--ink) 0%, #2A3530 100%);
  box-shadow:
    0 1px 0 rgba(255,255,255,.04) inset,
    0 30px 60px -30px rgba(27,38,32,.45);
  isolation: isolate;
}
.hero-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 1px solid rgba(250,246,238,.08);
  pointer-events: none;
  z-index: 3;
}
.hero-visual > video,
.hero-visual > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 2;
}
/* Bottom-left caption layered on top of the hero photo/video. Subtle
   gradient under it so the type stays legible on any photo. */
.hero-visual-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: end;
  padding: 28px;
  z-index: 3;
  background: linear-gradient(to top, rgba(27,38,32,.55) 0%, transparent 35%);
  pointer-events: none;
}
.hero-visual .hv-caption {
  color: var(--bone);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.hero-visual .hv-caption strong {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 20px;
  letter-spacing: 0;
  text-transform: none;
  color: var(--bone);
  display: block;
  margin-bottom: 4px;
}

/* ---- Hero headline stagger -------------------------------------------- */

.hero-headline { display: block; }
.hero-headline > span {
  display: block;
  opacity: 0;
  transform: translateY(18px);
  animation: hero-line-in 800ms cubic-bezier(.2,.7,.2,1) forwards;
}
.hero-headline > span:nth-child(1) { animation-delay:  60ms; }
.hero-headline > span:nth-child(2) { animation-delay: 180ms; }
.hero-headline > span:nth-child(3) { animation-delay: 300ms; }

@keyframes hero-line-in {
  to { opacity: 1; transform: none; }
}

/* ---- Hero credentialing strip ----------------------------------------- */

.creds-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin-top: 28px;
  border-top: 1px solid var(--rule);
  padding-top: 20px;
}
.creds-strip > .cred {
  flex: 1 1 0;
  min-width: 110px;
  padding: 0 20px;
  border-left: 1px solid var(--rule);
}
.creds-strip > .cred:first-child { padding-left: 0; border-left: 0; }
.creds-strip .cred-num {
  font-family: var(--serif);
  font-size: 32px;
  letter-spacing: -0.02em;
  color: var(--ink);
  line-height: 1;
  font-feature-settings: "tnum" 1;
}
.creds-strip .cred-num em {
  font-style: italic;
  color: var(--terracotta);
}
.creds-strip .cred-label {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}

/* ---- Decorative arc draw-in ------------------------------------------- */

.hero-arc { color: var(--terracotta); opacity: .9; margin-top: 60px; }
.hero-arc path {
  stroke-dasharray: 2200;
  stroke-dashoffset: 2200;
  transition: stroke-dashoffset 1400ms cubic-bezier(.2,.7,.2,1);
}
.hero-arc[data-revealed] path { stroke-dashoffset: 0; }

/* ---- Testimonial dots with auto-advance progress fill ---------------- */

.testimonial-dot {
  position: relative;
  width: 32px;
  height: 4px;
  border-radius: 2px;
  background: var(--rule);
  cursor: pointer;
  overflow: hidden;
  padding: 0;
  border: 0;
  transition: background 200ms ease;
}
.testimonial-dot[data-active] {
  background: rgba(27,38,32,.18); /* track for the fill to slide over */
}
.testimonial-dot-fill {
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  background: var(--ink);
  transform-origin: left center;
  animation-name: testimonial-fill;
  animation-timing-function: linear;
  animation-fill-mode: forwards;
}
@keyframes testimonial-fill {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}

/* ---- View Transitions cross-fade between routes ----------------------
   App.jsx wraps route changes in document.startViewTransition when the
   browser supports it. We just lengthen the default cross-fade slightly
   for a bit more presence — no new pseudo-elements needed. */

@supports (view-transition-name: x) {
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation-duration: 240ms;
    animation-timing-function: cubic-bezier(.2,.7,.2,1);
  }
}

/* ---- Mission section (editorial photo + copy) ------------------------ */

.mission-grid {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 80px;
  align-items: center;
}
.mission-photo {
  margin: 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bone);
  aspect-ratio: 4 / 5;
  box-shadow: 0 30px 60px -30px rgba(27,38,32,.25);
}
.mission-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ---- Insurance band (quiet trust strip) ------------------------------- */

.insurance-band {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 48px;
  align-items: center;
  padding: 32px 40px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--bone);
}
.insurance-band .ib-label {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.insurance-band .ib-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  padding: 0;
  margin: 0;
}
.insurance-band .ib-list li {
  font-family: var(--serif);
  font-size: 22px;
  letter-spacing: -0.01em;
  color: var(--ink);
  padding: 0 22px;
  border-left: 1px solid var(--rule);
  line-height: 1.2;
}
.insurance-band .ib-list li:first-child { padding-left: 0; border-left: 0; }

/* ---- Day-at-Altamedix photo strip ------------------------------------- */

.day-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.day-strip figure { margin: 0; }
.day-strip-photo {
  aspect-ratio: 4 / 5;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--sand);
  margin-bottom: 12px;
}
.day-strip-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 600ms cubic-bezier(.2,.7,.2,1);
}
.day-strip figure:hover .day-strip-photo img { transform: scale(1.04); }
.day-strip figcaption {
  font-size: 13px;
  color: var(--ink-soft);
  letter-spacing: -0.005em;
}

/* ---- Journal cards ---------------------------------------------------- */

.journal-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}
.journal-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  transition: transform 220ms cubic-bezier(.2,.7,.2,1);
}
.journal-card:hover { transform: translateY(-4px); }
.journal-cover {
  aspect-ratio: 16 / 10;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--sand);
  margin-bottom: 20px;
}
.journal-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 600ms cubic-bezier(.2,.7,.2,1);
}
.journal-card:hover .journal-cover img { transform: scale(1.04); }
.journal-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.journal-link {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--terracotta-deep);
}

/* ---- Leadership strip ------------------------------------------------- */

.leadership-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  margin-bottom: 40px;
  gap: 24px;
}
.leadership-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}
.leader-card { display: flex; flex-direction: column; }
.leader-portrait {
  aspect-ratio: 3 / 4;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  color: var(--bone);
  font-family: var(--serif);
  font-size: 56px;
  letter-spacing: -0.03em;
  user-select: none;
}

/* ---- Service card hover lift ------------------------------------------ */

.service-card {
  transition: transform 180ms ease, box-shadow 220ms ease;
}
.service-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 40px -24px rgba(27,38,32,.25);
}
.service-card:hover .service-icon {
  background: var(--terracotta);
  color: var(--bone);
}
.service-icon { transition: background 180ms ease, color 180ms ease; }

/* Responsive */
@media (max-width: 1180px) {
  .nav a { padding: 8px 8px; font-size: 13.5px; }
  .utility-bar { font-size: 12px; }
}
@media (max-width: 1040px) {
  .nav { display: none; }
  .utility-bar .left a:nth-child(3) { display: none; }
}
@media (max-width: 900px) {
  :root { --fs-3xl: 56px; --fs-2xl: 36px; --fs-xl: 26px; }
  .section-head { grid-template-columns: 1fr; gap: 16px; }
  .footer .grid { grid-template-columns: 1fr 1fr; }
  .field-row, .field-row-3 { grid-template-columns: 1fr; }
  .utility-bar .left > span { display: none; }
  .hero-grid { grid-template-columns: 1fr !important; }
  .hero-visual { aspect-ratio: 4 / 3; max-width: 100%; }
  .creds-strip > .cred { padding: 0 14px; min-width: 90px; }
  .creds-strip .cred-num { font-size: 26px; }
  .mission-grid { grid-template-columns: 1fr; gap: 40px; }
  .mission-photo { aspect-ratio: 16 / 11; }
  .insurance-band { grid-template-columns: 1fr; gap: 20px; padding: 24px; }
  .insurance-band .ib-list { gap: 6px 18px; }
  .insurance-band .ib-list li {
    font-size: 18px;
    padding: 0;
    border-left: 0;
  }
  .day-strip { grid-template-columns: repeat(2, 1fr); }
  .journal-grid { grid-template-columns: 1fr; gap: 40px; }
  .leadership-head { flex-direction: column; align-items: start; }
  .leadership-grid { grid-template-columns: repeat(2, 1fr); }
}
