/* ============================================================
   Sanoralia — estilos
   Paleta:
   --ink     #16241F  (verde casi negro, texto/fondo oscuro)
   --paper   #F6F2EA  (marfil clínico, fondo principal)
   --sage    #2D6A5C  (verde salvia, acento primario)
   --terra   #C4623E  (terracota tenue, acento secundario)
   --mute    #8C8676  (gris cálido, texto secundario)
   ============================================================ */

:root{
  --ink: #16241F;
  --ink-soft: #24372F;
  --paper: #F6F2EA;
  --paper-soft: #EFE9DC;
  --sage: #2D6A5C;
  --sage-light: #5C9485;
  --terra: #C4623E;
  --mute: #8C8676;
  --line: rgba(22,36,31,0.12);

  --display: "Fraunces", serif;
  --body: "Inter", sans-serif;

  --maxw: 1180px;
}

*{ box-sizing: border-box; }
html{ scroll-behavior: smooth; }

body{
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3{
  font-family: var(--display);
  font-weight: 500;
  margin: 0;
  letter-spacing: -0.01em;
  color: var(--ink);
}

p{ margin: 0; color: var(--ink-soft); }

a{ color: inherit; text-decoration: none; }

.eyebrow{
  font-family: var(--body);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sage);
  margin: 0 0 0.9rem;
}

/* subtle grain overlay for warmth */
.noise{
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
  opacity: 0.025;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- focus ---------- */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible{
  outline: 2px solid var(--sage);
  outline-offset: 3px;
}

/* ---------- buttons ---------- */
.btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1.6rem;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
  white-space: nowrap;
}
.btn--primary{
  background: var(--ink);
  color: var(--paper);
}
.btn--primary:hover{
  background: var(--sage);
  transform: translateY(-1px);
}
.btn--ghost{
  background: transparent;
  border-color: var(--ink);
  color: var(--ink);
}
.btn--ghost:hover{
  border-color: var(--sage);
  color: var(--sage);
  transform: translateY(-1px);
}
.btn--wide{ width: 100%; margin-top: 0.4rem; }

/* ---------- nav ---------- */
.nav{
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.25rem clamp(1.25rem, 5vw, 4rem);
  background: rgba(246,242,234,0.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav__brand{
  display:flex;
  align-items:center;
  gap: 0.55rem;
  font-family: var(--display);
  font-size: 1.18rem;
  font-weight: 600;
  color: var(--ink);
}
.nav__mark{ color: var(--sage); display:flex; }
.nav__links{
  display: flex;
  gap: 2rem;
  font-size: 0.9rem;
  font-weight: 500;
}
.nav__links a{ color: var(--ink-soft); transition: color 0.15s ease; }
.nav__links a:hover{ color: var(--sage); }
.nav__cta{
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.65rem 1.3rem;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  transition: background 0.18s ease;
}
.nav__cta:hover{ background: var(--sage); }

/* ---------- hero ---------- */
.hero{
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(3rem, 8vw, 6rem) clamp(1.25rem, 5vw, 4rem) clamp(2.5rem, 6vw, 4rem);
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(2rem, 6vw, 4rem);
  align-items: center;
}
.hero__text h1{
  font-size: clamp(2.1rem, 4.4vw, 3.4rem);
  line-height: 1.08;
  margin-bottom: 1.3rem;
}
.hero__lede{
  max-width: 46ch;
  font-size: 1.05rem;
  color: var(--mute);
  margin-bottom: 2rem;
}
.hero__actions{ display: flex; gap: 0.9rem; flex-wrap: wrap; }

.hero__visual{
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.scanmap{ width: 100%; max-width: 360px; }
.scanmap__field{
  fill: rgba(45,106,92,0.06);
  stroke: var(--sage);
  stroke-width: 1.1;
}
.scanmap__field--pulse{
  fill: none;
  stroke: var(--terra);
  stroke-opacity: 0.45;
  animation: pulse 3.6s ease-in-out infinite;
}
@keyframes pulse{
  0%   { stroke-width: 1; opacity: 0.7; transform-origin: center; }
  50%  { stroke-width: 1; opacity: 0.1; transform: scale(1.07); }
  100% { stroke-width: 1; opacity: 0.7; transform: scale(1); }
}
.node{ fill: var(--terra); }
.node--c{ fill: var(--sage); }
.link{
  stroke: var(--sage-light);
  stroke-width: 1;
  stroke-dasharray: 3 3;
  opacity: 0.55;
}
.link--cross{ opacity: 0.3; }
.scanmap__caption{
  margin-top: 0.8rem;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--mute);
}

@media (prefers-reduced-motion: reduce){
  .scanmap__field--pulse{ animation: none; }
}

/* ---------- about ---------- */
.about{
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(2rem, 5vw, 3rem) clamp(1.25rem, 5vw, 4rem);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(1.5rem, 5vw, 3rem);
  border-top: 1px solid var(--line);
}
.about__col p:not(.eyebrow){
  font-size: 1rem;
  max-width: 38ch;
}

/* ---------- team ---------- */
.team{
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(3rem, 7vw, 4.5rem) clamp(1.25rem, 5vw, 4rem);
  border-top: 1px solid var(--line);
}
.team h2{
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  margin-bottom: 2.5rem;
}
.team__group{ margin-bottom: 2.6rem; }
.team__group:last-child{ margin-bottom: 0; }
.team__role{
  font-family: var(--body);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mute);
  margin-bottom: 1.1rem;
  padding-bottom: 0.7rem;
  border-bottom: 1px dashed var(--line);
}
.team__grid{ display: grid; gap: 1.5rem; }
.team__grid--solo{ grid-template-columns: minmax(160px, 220px); }
.team__grid--duo{ grid-template-columns: repeat(2, minmax(160px, 220px)); }
.team__grid--trio{ grid-template-columns: repeat(3, minmax(150px, 220px)); }

.member{ margin: 0; }
.member__photo{
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 14px;
  background: var(--paper-soft);
  border: 1px solid var(--line);
  overflow: hidden;
  margin-bottom: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.member__photo::before{
  content: attr(data-placeholder);
  position: absolute;
  font-family: var(--display);
  font-size: 1.6rem;
  color: var(--sage-light);
  letter-spacing: 0.04em;
}
.member__photo img{
  position: relative;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}
.member__photo img[src=""]{ display: none; }
.member figcaption{ display: flex; flex-direction: column; gap: 0.15rem; }
.member__name{ font-weight: 600; font-size: 0.95rem; color: var(--ink); }
.member__tag{ font-size: 0.82rem; color: var(--mute); }

/* ---------- clinics ---------- */
.clinics{
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(3rem, 7vw, 4.5rem) clamp(1.25rem, 5vw, 4rem);
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: clamp(2rem, 6vw, 3.5rem);
  align-items: start;
}
.clinics__text h2{
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  margin-bottom: 1rem;
}
.clinics__text p:not(.eyebrow){
  max-width: 40ch;
  margin-bottom: 1.6rem;
  color: var(--mute);
}
.clinics__list{
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}
.clinic-slot{
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 1.5rem 1rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--mute);
  background: var(--paper-soft);
}

/* ---------- contact ---------- */
.contact{
  background: var(--ink);
  color: var(--paper);
  padding: clamp(3.5rem, 8vw, 5.5rem) clamp(1.25rem, 5vw, 4rem);
}
.contact__inner{ max-width: 720px; margin: 0 auto; }
.contact .eyebrow{ color: var(--sage-light); }
.contact h2{
  color: var(--paper);
  font-size: clamp(1.7rem, 3.4vw, 2.3rem);
  margin-bottom: 1.1rem;
  line-height: 1.18;
}
.contact__lede{
  color: rgba(246,242,234,0.72);
  font-size: 1rem;
  max-width: 46ch;
  margin-bottom: 2.4rem;
}
.contact__lede strong{ color: var(--paper); }

.contact__options{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.1rem;
}
.contact__card{
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.6rem 1.5rem;
  border: 1px solid rgba(246,242,234,0.16);
  border-radius: 16px;
  background: var(--ink-soft);
  transition: border-color 0.18s ease, transform 0.18s ease, background 0.18s ease;
}
.contact__card:hover{
  border-color: var(--sage-light);
  background: rgba(45,106,92,0.16);
  transform: translateY(-2px);
}
.contact__card-title{
  font-family: var(--display);
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--paper);
}
.contact__card-desc{
  font-size: 0.88rem;
  color: rgba(246,242,234,0.62);
  line-height: 1.45;
}
.contact__card-arrow{
  margin-top: 0.6rem;
  color: var(--sage-light);
  font-size: 1.1rem;
}

/* ---------- footer ---------- */
.footer{
  text-align: center;
  padding: 2.4rem 1.25rem 2.6rem;
  color: var(--mute);
  font-size: 0.85rem;
}
.footer__brand{
  font-family: var(--display);
  font-size: 1.1rem;
  color: var(--ink);
  margin-bottom: 0.4rem;
}
.footer p{ margin: 0.15rem 0; color: var(--mute); }
.footer__fine{ opacity: 0.7; font-size: 0.78rem; margin-top: 0.6rem; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 920px){
  .nav__links{ display: none; }
  .hero{ grid-template-columns: 1fr; text-align: left; }
  .hero__visual{ order: -1; }
  .scanmap{ max-width: 280px; }
  .about{ grid-template-columns: 1fr; gap: 2rem; }
  .clinics{ grid-template-columns: 1fr; }
  .clinics__list{ grid-template-columns: repeat(2, 1fr); }
  .team__grid--duo, .team__grid--trio{ grid-template-columns: repeat(2, minmax(140px, 1fr)); }
  .contact__options{ grid-template-columns: 1fr; }
}

@media (max-width: 520px){
  .nav{ padding: 1rem 1.1rem; }
  .nav__cta{ font-size: 0.78rem; padding: 0.55rem 1rem; }
  .hero__actions{ flex-direction: column; align-items: stretch; }
  .team__grid--trio{ grid-template-columns: repeat(2, 1fr); }
  .clinics__list{ grid-template-columns: 1fr; }
}
