/* ============================================
   Clínica — Design System
   Brand color: #165A4C (deep emerald)
   ============================================ */

:root {
  /* Color */
  --emerald-900: #0c3d33;
  --emerald-700: #165A4C;
  --emerald-500: #2d7a68;
  --emerald-300: #88b5a8;
  --emerald-100: #d6e6e0;
  --emerald-50:  #ecf2ee;

  --cream-50:    #faf6ef;
  --cream-100:   #f5efe6;
  --cream-200:   #ebe2d3;

  --clay-700:    #a86a52;
  --clay-500:    #c4856a;
  --clay-200:    #e6cdbe;

  --ink-900:     #1a201d;
  --ink-700:     #3a4441;
  --ink-500:     #6b7570;
  --ink-300:     #a4ada8;
  --ink-200:     #c8cfcb;
  --line:        #e3e0d6;

  --bg:          var(--cream-100);
  --bg-soft:     var(--cream-50);
  --fg:          var(--ink-900);
  --fg-muted:    var(--ink-500);

  /* Type */
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-display: "Fraunces", "Inter", Georgia, serif;

  /* Layout */
  --container: 1240px;
  --container-narrow: 880px;
  --gutter: clamp(20px, 4vw, 48px);
  --radius-sm: 6px;
  --radius:    14px;
  --radius-lg: 24px;

  /* Motion */
  --ease: cubic-bezier(.2,.7,.2,1);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a {
  color: var(--emerald-700);
  text-decoration: none;
  transition: color .2s var(--ease);
}
a:hover { color: var(--emerald-900); }

button { font-family: inherit; cursor: pointer; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: -0.015em;
  color: var(--ink-900);
  margin: 0 0 .4em;
  text-wrap: balance;
}
h1 { font-size: clamp(2.4rem, 5.5vw, 4.4rem); line-height: 1.04; }
h2 { font-size: clamp(1.8rem, 3.6vw, 2.8rem); line-height: 1.1; }
h3 { font-size: clamp(1.25rem, 2vw, 1.55rem); line-height: 1.2; }
h4 { font-size: 1.05rem; line-height: 1.3; font-family: var(--font-sans); font-weight: 500; letter-spacing: 0; }

p { margin: 0 0 1em; text-wrap: pretty; }

.eyebrow {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--emerald-700);
}
.eyebrow::before {
  content: "";
  display: inline-block;
  width: 24px;
  height: 1px;
  background: var(--emerald-700);
  vertical-align: middle;
  margin-right: 10px;
  margin-bottom: 3px;
}

/* ----- Layout ----- */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}
.container-narrow { max-width: var(--container-narrow); }

section { padding: clamp(56px, 9vw, 120px) 0; }

/* ----- Header ----- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in oklab, var(--cream-100) 92%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .25s var(--ease), background .25s var(--ease);
}
.site-header.is-scrolled {
  border-bottom-color: var(--line);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
  gap: 32px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink-900);
  font-family: var(--font-display);
  font-size: 1.1rem;
  letter-spacing: -0.01em;
  font-weight: 400;
}
.logo-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  color: var(--emerald-700);
}
.logo-mark svg { width: 100%; height: 100%; }
.logo-mark-img {
  width: 40px;
  height: 40px;
  display: block;
  object-fit: contain;
}
.nav-links {
  display: flex;
  gap: 36px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-links a {
  color: var(--ink-700);
  font-size: 14px;
  font-weight: 500;
  position: relative;
  padding: 6px 0;
}
.nav-links a:hover, .nav-links a[aria-current="page"] {
  color: var(--emerald-700);
}
.nav-links a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: var(--emerald-700);
}
.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* ----- Buttons ----- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0;
  border: 1px solid transparent;
  text-decoration: none;
  cursor: pointer;
  transition: transform .2s var(--ease), background .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease);
  white-space: nowrap;
}
.btn-primary {
  background: var(--emerald-700);
  color: var(--cream-50);
}
.btn-primary:hover {
  background: var(--emerald-900);
  color: var(--cream-50);
  transform: translateY(-1px);
}
.btn-ghost {
  background: transparent;
  color: var(--ink-900);
  border-color: var(--ink-200);
}
.btn-ghost:hover {
  border-color: var(--emerald-700);
  color: var(--emerald-700);
}
.btn-text {
  background: transparent;
  padding: 8px 0;
  color: var(--emerald-700);
  border-radius: 0;
}
.btn-text:hover {
  color: var(--emerald-900);
  gap: 14px;
}
.btn-text::after {
  content: "→";
  transition: transform .2s var(--ease);
}
.btn-text:hover::after { transform: translateX(3px); }

/* ----- Footer ----- */
.site-footer {
  background: var(--emerald-900);
  color: var(--cream-100);
  padding: 80px 0 40px;
  margin-top: 0;
}
.site-footer h4 {
  color: var(--cream-50);
  font-family: var(--font-sans);
  font-size: 12px;
  letter-spacing: .18em;
  text-transform: uppercase;
  font-weight: 500;
  opacity: .6;
  margin-bottom: 18px;
}
.site-footer a {
  color: var(--cream-100);
  opacity: .85;
}
.site-footer a:hover { opacity: 1; color: var(--cream-50); }
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 48px;
  padding-bottom: 56px;
  border-bottom: 1px solid color-mix(in oklab, var(--cream-50) 15%, transparent);
}
.footer-grid ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; font-size: 14px; }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 28px;
  font-size: 12px;
  opacity: .6;
}
.footer-brand p { font-size: 14px; opacity: .8; max-width: 320px; }

/* ----- Real photo helper ----- */
.photo {
  position: relative;
  background: var(--emerald-100);
  overflow: hidden;
  border-radius: var(--radius);
}
.photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.photo.portrait {
  background: linear-gradient(180deg, var(--emerald-50) 0%, var(--cream-200) 100%);
}
.photo.portrait img { object-fit: cover; object-position: top center; }

/* ----- Image placeholders ----- */
.placeholder {
  position: relative;
  background-color: var(--emerald-100);
  background-image:
    repeating-linear-gradient(
      135deg,
      transparent 0,
      transparent 14px,
      color-mix(in oklab, var(--emerald-700) 8%, transparent) 14px,
      color-mix(in oklab, var(--emerald-700) 8%, transparent) 15px
    );
  display: grid;
  place-items: center;
  color: var(--emerald-700);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 11px;
  letter-spacing: .05em;
  overflow: hidden;
  border-radius: var(--radius);
}
.placeholder span {
  background: var(--cream-50);
  padding: 4px 10px;
  border-radius: 4px;
  border: 1px solid var(--emerald-100);
}
.placeholder.clay {
  background-color: var(--clay-200);
  background-image:
    repeating-linear-gradient(
      135deg,
      transparent 0,
      transparent 14px,
      color-mix(in oklab, var(--clay-700) 12%, transparent) 14px,
      color-mix(in oklab, var(--clay-700) 12%, transparent) 15px
    );
  color: var(--clay-700);
}
.placeholder.clay span { border-color: var(--clay-200); }
.placeholder.cream {
  background-color: var(--cream-200);
  background-image:
    repeating-linear-gradient(
      135deg,
      transparent 0,
      transparent 14px,
      color-mix(in oklab, var(--ink-700) 6%, transparent) 14px,
      color-mix(in oklab, var(--ink-700) 6%, transparent) 15px
    );
  color: var(--ink-700);
}
.placeholder.cream span { border-color: var(--cream-200); }

/* ----- Cards ----- */
.card {
  background: var(--cream-50);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  transition: border-color .2s var(--ease), transform .2s var(--ease);
}
.card:hover {
  border-color: var(--emerald-300);
}

/* ----- Mobile menu (basic) ----- */
.menu-toggle {
  display: none;
  background: transparent;
  border: none;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
}
.menu-toggle span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--ink-900);
  transition: transform .3s var(--ease), opacity .2s var(--ease);
}

@media (max-width: 880px) {
  .nav-links { display: none; }
  .menu-toggle { display: inline-flex; }
  .nav { height: 64px; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  .footer-bottom { flex-direction: column; gap: 12px; align-items: flex-start; }

  /* Mobile menu open state: nav slides down below the header bar. */
  .site-header.is-menu-open .nav-links {
    display: flex;
    flex-direction: column;
    gap: 0;
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--bg);
    padding: 8px var(--gutter);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    z-index: 100;
  }
  .site-header.is-menu-open .nav-links li {
    border-bottom: 1px solid var(--line);
  }
  .site-header.is-menu-open .nav-links li:last-child {
    border-bottom: none;
  }
  .site-header.is-menu-open .nav-links a {
    display: block;
    padding: 16px 4px;
    font-size: 16px;
  }
  .site-header.is-menu-open .nav-links a[aria-current="page"]::after {
    display: none; /* underline doesn't read well in a vertical list */
  }

  /* Hamburger to X animation */
  .site-header.is-menu-open .menu-toggle span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
  .site-header.is-menu-open .menu-toggle span:nth-child(2) { opacity: 0; }
  .site-header.is-menu-open .menu-toggle span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }
}

/* ----- Utility ----- */
.muted { color: var(--fg-muted); }
.serif { font-family: var(--font-display); }
.lead { font-size: clamp(1.05rem, 1.6vw, 1.25rem); color: var(--ink-700); line-height: 1.55; }

/* ----- Reveal on scroll (subtle) ----- */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .8s var(--ease), transform .8s var(--ease);
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}
