/* =========================================================
   MCH · MedConnect Health
   Base: tokens, reset, typography, layout, header, footer
   ========================================================= */

:root {
  --ink: #0b1f2a;
  --ink-soft: #122f36;
  --teal: #0e3b3a;
  --teal-2: #14504c;
  --ivory: #f7f3ec;
  --paper: #fbf9f5;
  --white: #ffffff;
  --sand: #e8dfd1;
  --copper: #b98555;
  --copper-2: #d8b08a;
  --sage: #8ba39d;
  --muted: #5f6f6e;
  --line: rgba(11, 31, 42, 0.12);
  --line-light: rgba(247, 243, 236, 0.14);
  --shadow: 0 24px 70px rgba(11, 31, 42, 0.09);
  --shadow-sm: 0 10px 30px rgba(11, 31, 42, 0.06);
  --radius: 18px;
  --radius-lg: 28px;
  --container: 1240px;
  --display: "Fraunces", Georgia, "Times New Roman", serif;
  --body: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* ---------- Reset ---------- */

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.menu-open {
  overflow: hidden;
}

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

svg {
  display: block;
}

a {
  color: inherit;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

h1,
h2,
h3,
h4,
p,
figure,
blockquote {
  margin: 0;
}

ul,
ol {
  margin: 0;
  padding: 0;
}

::selection {
  background: var(--copper-2);
  color: var(--ink);
}

:focus-visible {
  outline: 2px solid var(--copper);
  outline-offset: 4px;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 500;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--ivory);
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
  transform: translateY(-160%);
  transition: transform 0.2s var(--ease);
}

.skip-link:focus {
  transform: none;
}

/* ---------- Layout ---------- */

.container {
  width: min(calc(100% - 48px), var(--container));
  margin-inline: auto;
}

.section {
  padding: clamp(72px, 9vw, 128px) 0;
}

.section--tight {
  padding: clamp(52px, 6vw, 84px) 0;
}

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

.section--ivory {
  background: var(--ivory);
}

.section--white {
  background: var(--white);
}

.section--dark {
  background: var(--teal);
  color: var(--ivory);
}

.section--ink {
  background: var(--ink);
  color: var(--ivory);
}

/* ---------- Typography ---------- */

.display,
.h2,
.h3 {
  font-family: var(--display);
  font-weight: 400;
  letter-spacing: -0.03em;
}

.h2 {
  font-size: clamp(2.2rem, 4.4vw, 4.2rem);
  line-height: 1.02;
}

.h3 {
  font-size: clamp(1.35rem, 2vw, 1.8rem);
  line-height: 1.15;
  letter-spacing: -0.015em;
}

.lead {
  font-size: clamp(1.02rem, 1.35vw, 1.16rem);
  line-height: 1.75;
  color: var(--muted);
}

.section--dark .lead,
.section--ink .lead {
  color: rgba(247, 243, 236, 0.72);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--copper);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 24px;
  height: 1px;
  background: currentColor;
  opacity: 0.65;
}

.section--dark .eyebrow,
.section--ink .eyebrow {
  color: var(--copper-2);
}

.fineprint {
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.65;
}

.section--dark .fineprint,
.section--ink .fineprint {
  color: rgba(247, 243, 236, 0.5);
}

/* ---------- Section headings ---------- */

.section-head {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(24px, 5vw, 80px);
  align-items: end;
  margin-bottom: clamp(36px, 5vw, 64px);
}

.section-head .h2 {
  margin-top: 14px;
}

.section-head .lead {
  max-width: 620px;
}

.section-head--center {
  display: block;
  max-width: 780px;
  margin-inline: auto;
  text-align: center;
  margin-bottom: clamp(36px, 5vw, 64px);
}

.section-head--center .lead {
  margin: 20px auto 0;
}

.section-head--center .eyebrow {
  justify-content: center;
}

/* ---------- Buttons & links ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 13px 24px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-family: var(--body);
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.25s var(--ease), color 0.25s var(--ease),
    border-color 0.25s var(--ease), transform 0.25s var(--ease);
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--copper-2);
  color: var(--ink);
}

.btn-primary:hover {
  background: #e5c4a2;
}

.btn-dark {
  background: var(--teal);
  color: var(--ivory);
}

.btn-dark:hover {
  background: var(--ink);
}

.btn-outline {
  border-color: rgba(247, 243, 236, 0.45);
  background: transparent;
  color: var(--ivory);
}

.btn-outline:hover {
  border-color: var(--ivory);
  background: rgba(247, 243, 236, 0.08);
}

.btn-outline-dark {
  border-color: var(--line);
  background: transparent;
  color: var(--ink);
}

.btn-outline-dark:hover {
  border-color: var(--ink);
  background: rgba(11, 31, 42, 0.04);
}

.btn-sm {
  min-height: 40px;
  padding: 9px 18px;
  font-size: 0.78rem;
}

.btn .icon,
.btn svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--teal);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-decoration: none;
  transition: gap 0.25s var(--ease), color 0.25s var(--ease);
}

.text-link:hover {
  gap: 12px;
  color: var(--copper);
}

.section--dark .text-link,
.section--ink .text-link {
  color: var(--copper-2);
}

.text-link svg {
  width: 15px;
  height: 15px;
}

/* ---------- Header ---------- */

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 100;
  padding: 18px 0;
  color: var(--ivory);
  transition: background 0.35s var(--ease), box-shadow 0.35s var(--ease),
    padding 0.35s var(--ease);
}

.site-header.is-scrolled {
  padding: 11px 0;
  background: rgba(247, 243, 236, 0.94);
  box-shadow: 0 1px 0 var(--line);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  color: var(--ink);
}

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

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
}

.brand-mark svg {
  width: 100%;
  height: 100%;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.brand-text strong {
  font-family: var(--display);
  font-size: 1.32rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.brand-text span {
  margin-top: 5px;
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0.68;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: clamp(18px, 2.4vw, 32px);
}

.main-nav a {
  position: relative;
  padding: 8px 0;
  color: rgba(247, 243, 236, 0.82);
  font-size: 0.84rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
  transition: color 0.2s var(--ease);
}

.main-nav a::after {
  content: "";
  position: absolute;
  right: 100%;
  bottom: 0;
  left: 0;
  height: 1px;
  background: var(--copper-2);
  transition: right 0.3s var(--ease);
}

.main-nav a:hover,
.main-nav a[aria-current="page"] {
  color: var(--ivory);
}

.main-nav a:hover::after,
.main-nav a[aria-current="page"]::after {
  right: 0;
}

.site-header.is-scrolled .brand,
.site-header.is-scrolled .main-nav a {
  color: var(--ink);
}

.site-header.is-scrolled .main-nav a {
  color: rgba(11, 31, 42, 0.72);
}

.site-header.is-scrolled .main-nav a:hover,
.site-header.is-scrolled .main-nav a[aria-current="page"] {
  color: var(--ink);
}

.site-header.is-scrolled .brand-text span {
  color: var(--muted);
  opacity: 1;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.header-cta {
  white-space: nowrap;
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(247, 243, 236, 0.28);
  border-radius: 50%;
  background: transparent;
  color: inherit;
}

.site-header.is-scrolled .nav-toggle {
  border-color: var(--line);
  color: var(--ink);
}

.nav-toggle-lines {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-toggle-lines span {
  display: block;
  width: 17px;
  height: 1.5px;
  background: currentColor;
}

/* Pages without a dark hero: solid header from the start */
body.no-hero .site-header {
  background: rgba(247, 243, 236, 0.95);
  box-shadow: 0 1px 0 var(--line);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  color: var(--ink);
}

body.no-hero .site-header .brand,
body.no-hero .main-nav a {
  color: var(--ink);
}

body.no-hero .main-nav a {
  color: rgba(11, 31, 42, 0.72);
}

body.no-hero .main-nav a:hover,
body.no-hero .main-nav a[aria-current="page"] {
  color: var(--ink);
}

body.no-hero .site-header .brand-text span {
  color: var(--muted);
  opacity: 1;
}

body.no-hero .nav-toggle {
  border-color: var(--line);
  color: var(--ink);
}

/* ---------- Mobile menu ---------- */

.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: none;
  overflow-y: auto;
  padding: 22px;
  background: var(--ivory);
  color: var(--ink);
  transform: translateY(-102%);
  transition: transform 0.45s var(--ease);
}

.mobile-menu.is-open {
  transform: none;
}

.mobile-menu-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 48px;
}

.mobile-menu .brand {
  color: var(--ink);
}

.mobile-close {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
}

.mobile-close svg {
  width: 18px;
  height: 18px;
}

.mobile-menu nav {
  display: flex;
  flex-direction: column;
}

.mobile-menu nav a {
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-family: var(--display);
  font-size: clamp(1.9rem, 8vw, 2.8rem);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.1;
  text-decoration: none;
}

.mobile-menu nav a:hover {
  color: var(--copper);
}

.mobile-menu .btn {
  width: 100%;
  margin-top: 30px;
}

.mobile-menu-contact {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 28px;
  color: var(--muted);
  font-size: 0.88rem;
}

.mobile-menu-contact a {
  color: var(--teal);
  text-decoration: none;
}

/* ---------- Footer ---------- */

.site-footer {
  padding: 72px 0 28px;
  background: #081b22;
  color: rgba(247, 243, 236, 0.7);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 0.8fr 0.8fr 1fr;
  gap: 40px;
}

.footer-brand .brand {
  margin-bottom: 18px;
  color: var(--ivory);
}

.footer-brand .brand-text span {
  color: rgba(247, 243, 236, 0.55);
  opacity: 1;
}

.footer-brand p {
  max-width: 330px;
  font-size: 0.86rem;
  line-height: 1.75;
}

.footer-col h3 {
  margin-bottom: 18px;
  color: rgba(247, 243, 236, 0.45);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.footer-col a,
.footer-col p {
  display: block;
  margin: 0;
  color: rgba(247, 243, 236, 0.72);
  font-size: 0.86rem;
  line-height: 1.9;
  text-decoration: none;
}

.footer-col a:hover {
  color: var(--copper-2);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px solid rgba(247, 243, 236, 0.1);
  color: rgba(247, 243, 236, 0.45);
  font-size: 0.72rem;
}

.footer-bottom a {
  color: inherit;
  text-decoration: none;
}

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

.footer-disclaimer {
  max-width: 1000px;
  margin-top: 18px;
  color: rgba(247, 243, 236, 0.35);
  font-size: 0.66rem;
  line-height: 1.7;
}

/* ---------- Utilities ---------- */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.mt-14 {
  margin-top: 14px;
}

.mt-24 {
  margin-top: 24px;
}

.mt-28 {
  margin-top: 28px;
}

.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

.reveal-delay-1 {
  transition-delay: 0.08s;
}

.reveal-delay-2 {
  transition-delay: 0.16s;
}

.reveal-delay-3 {
  transition-delay: 0.24s;
}

.reveal-delay-4 {
  transition-delay: 0.32s;
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}
