/* Evolutive Clinic — estilos
   Concepto: la barra calada del logotipo como elemento protagonista. */

:root {
  --slate: #51565b;      /* gris exacto del logotipo */
  --ink: #2b2f33;
  --stone: #8a9096;
  --mist: #e8eae9;
  --paper: #f6f7f6;
  --white: #ffffff;
  --olive: #5c6a2c;      /* acento: olivo mallorquín */
  --olive-soft: #e4e8d6;

  --font: "Jost", "Futura", "Century Gothic", "Avenir Next", system-ui, sans-serif;
  --step--1: clamp(0.84rem, 0.8rem + 0.15vw, 0.92rem);
  --step-0: clamp(1rem, 0.96rem + 0.2vw, 1.1rem);
  --step-1: clamp(1.25rem, 1.15rem + 0.45vw, 1.5rem);
  --step-2: clamp(1.6rem, 1.4rem + 0.9vw, 2.1rem);
  --step-3: clamp(2.1rem, 1.7rem + 1.8vw, 3.2rem);
  --step-4: clamp(2.6rem, 1.9rem + 3.2vw, 4.8rem);

  --wrap: 1180px;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --space: clamp(4rem, 9vw, 7.5rem);
}

*, *::before, *::after { box-sizing: border-box; }
html { overflow-x: clip; scroll-behavior: smooth; scroll-padding-top: 6rem; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); font-weight: 400; font-size: var(--step-0);
  line-height: 1.65; color: var(--ink); background: var(--paper);
  text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; background: var(--mist); }
a { color: var(--olive); text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { color: var(--ink); }
:focus-visible { outline: 2px solid var(--olive); outline-offset: 3px; border-radius: 2px; }
p { margin: 0 0 1em; max-width: 68ch; }
h1, h2, h3, h4 { font-weight: 400; line-height: 1.12; margin: 0 0 0.6em; letter-spacing: -0.01em; }
h3 { font-size: var(--step-1); font-weight: 500; }
ul { padding-left: 1.1em; }
li { margin-bottom: 0.35em; }
strong { font-weight: 500; }

.wrap { width: min(100% - 2 * var(--gutter), var(--wrap)); margin-inline: auto; }
.section { padding-block: var(--space); }
.section--mist { background: var(--mist); }
.section--white { background: var(--white); }
.lead { font-size: var(--step-1); font-weight: 300; line-height: 1.5; color: var(--slate); }
.muted { color: var(--stone); }
.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: #fff; padding: .6rem 1rem; z-index: 100; }
.skip:focus { left: 1rem; }

/* ---------- La barra (firma visual) ---------- */
.bar {
  position: relative; display: inline-block; background: var(--slate); color: var(--white);
  font-weight: 300; text-transform: lowercase; letter-spacing: 0.005em;
  padding: 0.12em 0.5em 0.2em 0; line-height: 1.08; margin: 0;
}
.bar::before { /* la barra nace del borde izquierdo de la pantalla */
  content: ""; position: absolute; top: 0; bottom: 0; right: 100%; width: 100vw; background: inherit;
}
h2.bar { font-size: var(--step-3); margin-bottom: 0.9em; }
.bar--olive { background: var(--olive); }
.bar--light { background: var(--white); color: var(--slate); }

/* ---------- Cabecera ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50; background: rgba(246, 247, 246, 0.94);
  backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid transparent; transition: border-color .3s;
}
.site-header.is-scrolled { border-bottom-color: var(--mist); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; min-height: 5rem; }
.brand img { width: 150px; background: none; }
.nav ul { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 0.2rem; }
.nav li { margin: 0; position: relative; }
.nav a, .nav button.sub-toggle {
  display: block; padding: 0.5rem 0.7rem; color: var(--ink); text-decoration: none; font: inherit;
  font-size: 0.98rem; background: none; border: 0; cursor: pointer;
}
.nav a:hover, .nav button.sub-toggle:hover { color: var(--olive); }
.nav a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--olive); }
.nav .sub { position: absolute; top: 100%; left: 0; min-width: 15rem; background: var(--white);
  flex-direction: column; align-items: stretch; padding: .5rem 0; box-shadow: 0 12px 30px -12px rgba(43,47,51,.35);
  display: none; }
.nav li:hover > .sub, .nav li:focus-within > .sub, .nav li.open > .sub { display: flex; }
.nav .sub a { padding: .55rem 1.1rem; }
.btn {
  display: inline-flex; align-items: center; gap: .55rem; padding: 0.85rem 1.4rem; border-radius: 999px;
  background: var(--olive); color: var(--white); text-decoration: none; font-weight: 500; border: 0;
  font-family: inherit; font-size: 1rem; cursor: pointer; transition: background .2s;
}
.btn:hover { background: var(--ink); color: var(--white); }
.btn--ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--slate); }
.btn--ghost:hover { background: var(--slate); color: var(--white); }
.btn svg { width: 1.15em; height: 1.15em; flex: none; }
.nav a.nav-cta { padding: .6rem 1.1rem; font-size: .95rem; margin-left: .6rem; color: var(--white); background: var(--olive); border-radius: 999px; display: inline-flex; }
.nav a.nav-cta:hover { background: var(--ink); color: var(--white); }
.menu-toggle { display: none; background: none; border: 0; padding: .5rem; cursor: pointer; color: var(--ink); }
.menu-toggle svg { width: 28px; height: 28px; }

@media (max-width: 1020px) {
  .menu-toggle { display: block; }
  .nav { position: fixed; inset: 5rem 0 0 0; background: var(--paper); padding: 1.5rem var(--gutter) 3rem;
    overflow-y: auto; opacity: 0; visibility: hidden; transform: translateY(-8px); transition: opacity .25s ease, transform .25s ease, visibility 0s .25s; }
  .nav.is-open { opacity: 1; visibility: visible; transform: none; transition: opacity .25s ease, transform .25s ease; }
  .nav ul { flex-direction: column; align-items: stretch; gap: 0; }
  .nav a, .nav button.sub-toggle { font-size: 1.35rem; font-weight: 300; padding: .7rem 0; border-bottom: 1px solid var(--mist); width: 100%; text-align: left; }
  .nav .sub { position: static; display: flex; box-shadow: none; background: none; padding: 0 0 0 1rem; }
  .nav .sub a { font-size: 1.1rem; padding: .55rem 0; }
  .nav .sub-toggle { pointer-events: none; color: var(--stone) !important; }
  .nav a.nav-cta { margin: 1.5rem 0 0; justify-content: center; width: 100%; }
  .nav .nav-cta { border-bottom: 0; font-size: 1.05rem; padding: .9rem 1.2rem; text-align: center; color: var(--white); }
}

/* ---------- Hero ---------- */
.hero { position: relative; padding-top: clamp(2rem, 5vw, 4rem); padding-bottom: var(--space); }
.hero-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 0 clamp(2rem, 5vw, 4rem); align-items: end; }
.hero-kicker { font-size: var(--step-1); font-weight: 300; color: var(--slate); margin-bottom: 1rem; }
.hero h1 { font-size: var(--step-4); margin: 0; position: relative; z-index: 2; }
.hero h1 .bar { padding-right: 0.45em; }
.hero h1 .line { display: block; width: max-content; max-width: 100%; }
.hero h1 .line + .line { margin-top: -1px; }
.hero-photo { position: relative; z-index: 1; }
.hero-photo img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.hero-body { margin-top: 2rem; }
.hero-body p { font-size: var(--step-1); font-weight: 300; line-height: 1.5; max-width: 34ch; color: var(--ink); }
.actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.8rem; }
.hero-facts { display: flex; flex-wrap: wrap; gap: 0.5rem 2.2rem; margin-top: 2.6rem; padding: 0; list-style: none; color: var(--slate); }
.hero-facts li { margin: 0; }
.hero-facts strong { display: block; font-size: var(--step-2); font-weight: 300; color: var(--ink); line-height: 1.1; }

/* orquestación de carga: la barra se dibuja desde la izquierda */
@media (prefers-reduced-motion: no-preference) {
  .hero h1 .bar { animation: barIn .9s cubic-bezier(.7,0,.2,1) both; transform-origin: left; }
  .hero h1 .line:nth-child(2) .bar { animation-delay: .12s; }
  .hero h1 .line:nth-child(3) .bar { animation-delay: .24s; }
  .hero h1 .bar > span { animation: textIn .6s ease both; animation-delay: .7s; }
  .hero h1 .line:nth-child(2) .bar > span { animation-delay: .82s; }
  .hero h1 .line:nth-child(3) .bar > span { animation-delay: .94s; }
  @keyframes barIn { from { clip-path: inset(0 100% 0 -100vw); } to { clip-path: inset(0 0 0 -100vw); } }
  @keyframes textIn { from { opacity: 0; transform: translateY(.15em); } to { opacity: 1; transform: none; } }
}

@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-photo { order: -1; margin-bottom: 1.5rem; margin-left: 18%; }
  .hero-photo img { aspect-ratio: 4 / 3.6; }
}

/* ---------- Cabecera de página interior ---------- */
.page-hero { padding-top: clamp(2.5rem, 6vw, 4.5rem); padding-bottom: clamp(2.5rem, 6vw, 4rem); }
.page-hero h1 { font-size: var(--step-4); margin-bottom: 1.4rem; }
.page-hero-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.page-hero-grid img { width: 100%; aspect-ratio: 5 / 4; object-fit: cover; }
.crumbs { font-size: var(--step--1); color: var(--stone); margin-bottom: 1.5rem; }
.crumbs a { color: var(--stone); }
.crumbs ol { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.crumbs li + li::before { content: "/"; margin-right: .4rem; }
@media (max-width: 860px) { .page-hero-grid { grid-template-columns: 1fr; } }

/* Bloque "en resumen" — respuesta directa para buscadores y motores de IA */
.summary { background: var(--white); border-left: 4px solid var(--olive); padding: 1.4rem 1.6rem; margin: 0; }
.summary h2 { font-size: var(--step-0); font-weight: 500; margin-bottom: .5rem; color: var(--olive); }
.summary p { margin: 0; }
.summary dl { display: grid; grid-template-columns: auto 1fr; gap: .3rem 1.2rem; margin: 1rem 0 0; font-size: var(--step--1); }
.summary dt { color: var(--stone); }
.summary dd { margin: 0; }

/* ---------- Prosa y columnas ---------- */
.cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(2rem, 5vw, 4.5rem); }
.cols--wide { grid-template-columns: 1.3fr 1fr; align-items: start; }
@media (max-width: 860px) { .cols, .cols--wide { grid-template-columns: 1fr; } }
.prose h3 { margin-top: 2rem; }
.prose h3:first-child { margin-top: 0; }
.figure img { width: 100%; object-fit: cover; aspect-ratio: 4 / 3; }
.figure figcaption { font-size: var(--step--1); color: var(--stone); margin-top: .6rem; }
.tags { display: flex; flex-wrap: wrap; gap: .5rem; padding: 0; list-style: none; margin: 1rem 0 0; }
.tags li { margin: 0; padding: .4rem .9rem; background: var(--white); border-radius: 999px; font-size: .95rem; box-shadow: inset 0 0 0 1px var(--mist); }
.section--white .tags li { background: var(--paper); }
.quote { font-size: var(--step-2); font-weight: 300; line-height: 1.3; margin: 0; max-width: 30ch; color: var(--slate); }
.quote cite { display: block; font-size: var(--step--1); font-style: normal; color: var(--stone); margin-top: 1rem; }

/* ---------- Escalera del método (secuencia real) ---------- */
.stairs { list-style: none; padding: 0; margin: 2rem 0 0; display: grid; grid-template-columns: repeat(4, 1fr); align-items: end; gap: 0; counter-reset: step; }
.stairs li { margin: 0; background: var(--slate); color: var(--white); padding: 1.6rem 1.4rem 1.8rem; counter-increment: step; display: flex; flex-direction: column; justify-content: flex-end; }
.stairs li:nth-child(1) { min-height: 15rem; background: #6b7075; }
.stairs li:nth-child(2) { min-height: 19rem; background: #60656a; }
.stairs li:nth-child(3) { min-height: 23rem; background: var(--slate); }
.stairs li:nth-child(4) { min-height: 27rem; background: var(--ink); }
.stairs li::before { content: counter(step); font-size: var(--step-3); font-weight: 300; line-height: 1; margin-bottom: auto; opacity: .55; }
.stairs h3 { font-size: var(--step-1); font-weight: 400; text-transform: lowercase; margin: 1rem 0 .4rem; }
.stairs p { font-size: .95rem; margin: 0; color: rgba(255,255,255,.82); }
@media (max-width: 860px) {
  .stairs { grid-template-columns: 1fr; }
  .stairs li { min-height: 0 !important; padding-left: calc(1.4rem + var(--i, 0) * 1.2rem); }
  .stairs li::before { margin-bottom: .4rem; font-size: var(--step-2); }
}

/* ---------- Índice de servicios ---------- */
.services { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--stone); }
.services li { margin: 0; border-bottom: 1px solid var(--stone); }
.services a { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr) auto; gap: 1.6rem; align-items: center; padding: 1.3rem 0; text-decoration: none; color: var(--ink); }
.services img { width: 7.5rem; aspect-ratio: 1; object-fit: cover; filter: grayscale(1); transition: filter .35s; }
.services a:hover img, .services a:focus-visible img { filter: none; }
.services .name { font-size: var(--step-2); font-weight: 300; text-transform: lowercase; line-height: 1.1; display: block; }
.services a:hover .name { color: var(--olive); }
.services .desc { display: block; color: var(--slate); margin-top: .35rem; max-width: 52ch; }
.services .price { text-align: right; font-size: var(--step-1); font-weight: 300; white-space: nowrap; }
.services .price small { display: block; font-size: var(--step--1); color: var(--stone); }
@media (max-width: 640px) {
  .services a { grid-template-columns: 4.5rem minmax(0, 1fr); gap: 1rem; }
  .services .name { font-size: var(--step-1); hyphens: auto; overflow-wrap: break-word; }
  .services img { width: 4.5rem; }
  .services .price { grid-column: 2; text-align: left; font-size: 1.05rem; }
  .services .price small { display: inline; margin-left: .4rem; }
}

/* ---------- Equipo ---------- */
.team { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(2rem, 5vw, 4rem); }
.person img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; margin-bottom: 1.4rem; }
.person h3 { font-size: var(--step-2); font-weight: 300; margin-bottom: .2rem; }
.person .role { color: var(--olive); margin-bottom: 1.2rem; }
.cv { list-style: none; padding: 0; margin: 0; font-size: .97rem; }
.cv li { display: grid; grid-template-columns: 6.5rem 1fr; gap: 1rem; padding: .55rem 0; border-top: 1px solid var(--mist); margin: 0; }
.cv time { color: var(--stone); }
@media (max-width: 760px) { .team { grid-template-columns: 1fr; } }

/* ---------- Tarifas ---------- */
.prices { width: 100%; border-collapse: collapse; font-size: var(--step-0); }
.prices th, .prices td { text-align: left; padding: .9rem 0; border-bottom: 1px solid rgba(255,255,255,.2); font-weight: 300; }
.prices td:last-child { text-align: right; white-space: nowrap; font-size: var(--step-1); }
.section--slate { background: var(--slate); color: var(--white); }
.section--slate a:not(.btn) { color: var(--white); }
.section--slate .muted { color: rgba(255,255,255,.65); }

/* ---------- FAQ ---------- */
.faq { border-top: 1px solid var(--stone); }
.faq details { border-bottom: 1px solid var(--stone); }
.faq summary { cursor: pointer; list-style: none; padding: 1.25rem 2.5rem 1.25rem 0; font-size: var(--step-1); font-weight: 400; position: relative; line-height: 1.35; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; position: absolute; right: .4rem; top: 50%; width: 14px; height: 14px; margin-top: -10px;
  border-right: 1.5px solid var(--slate); border-bottom: 1.5px solid var(--slate); transform: rotate(45deg); transition: transform .25s; }
.faq details[open] summary::after { transform: rotate(-135deg); margin-top: -3px; }
.faq .answer { padding: 0 0 1.4rem; color: var(--slate); }
.faq .answer p:last-child { margin-bottom: 0; }

/* ---------- Hitos (desarrollo psicomotor) ---------- */
.milestones { list-style: none; padding: 0; margin: 0; display: grid; gap: 0; }
.milestones li { display: grid; grid-template-columns: 8rem 1fr 1fr; gap: 1.5rem; padding: 1.4rem 0; border-top: 1px solid var(--stone); margin: 0; }
.milestones .age { font-size: var(--step-2); font-weight: 300; line-height: 1; color: var(--olive); }
.milestones h3 { font-size: var(--step-0); margin: 0 0 .3rem; }
.milestones p { margin: 0; font-size: .97rem; color: var(--slate); }
@media (max-width: 760px) { .milestones li { grid-template-columns: 1fr; gap: .6rem; } }

/* ---------- Talleres ---------- */
.workshops { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 2.5rem 2rem; }
.workshop img { width: 100%; aspect-ratio: 1; object-fit: cover; margin-bottom: 1.1rem; }
.workshop h3 { font-size: var(--step-1); font-weight: 400; text-transform: lowercase; }
.workshop p { color: var(--slate); }

/* ---------- Contacto / visita ---------- */
.visit { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 2rem; }
.visit h3 { font-size: var(--step-0); font-weight: 500; margin-bottom: .6rem; }
.visit p, .visit address { font-style: normal; margin: 0; }
.visit .big { font-size: var(--step-1); font-weight: 300; }
@media (max-width: 860px) { .visit { grid-template-columns: 1fr; } }
.map-link img { width: 100%; aspect-ratio: 16 / 7; object-fit: cover; margin-top: 2.5rem; filter: grayscale(.6); }

.form { display: grid; gap: 1rem; max-width: 36rem; }
.form label { display: grid; gap: .35rem; font-size: .95rem; color: var(--slate); }
.form input, .form select, .form textarea {
  font: inherit; color: var(--ink); background: var(--white); border: 1px solid var(--stone); border-radius: 4px; padding: .8rem .9rem; width: 100%;
}
.form textarea { min-height: 8rem; resize: vertical; }
.form .check { display: flex; gap: .6rem; align-items: flex-start; }
.form .check input { width: auto; margin-top: .35rem; }
.form-note { font-size: var(--step--1); color: var(--stone); }

/* ---------- CTA final ---------- */
.cta-band { background: var(--olive); color: var(--white); padding-block: clamp(3rem, 7vw, 5rem); }
.cta-band h2 { font-size: var(--step-3); font-weight: 300; text-transform: lowercase; max-width: 22ch; }
.cta-band .btn { background: var(--white); color: var(--olive); }
.cta-band .btn:hover { background: var(--ink); color: var(--white); }
.cta-band .btn--ghost { background: transparent; color: var(--white); box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.7); }

/* ---------- Pie ---------- */
.site-footer { background: var(--ink); color: rgba(255,255,255,.75); padding-top: clamp(3.5rem, 7vw, 5rem); font-size: .97rem; }
.site-footer a { color: rgba(255,255,255,.88); text-decoration: none; }
.site-footer a:hover { color: var(--white); text-decoration: underline; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 2.5rem; }
.footer-grid h2 { font-size: var(--step-0); font-weight: 500; color: var(--white); margin-bottom: .9rem; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-logo { width: 170px; background: none; margin-bottom: 1.2rem; }
.footer-bottom { margin-top: 3.5rem; padding-block: 1.5rem; border-top: 1px solid rgba(255,255,255,.12); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; font-size: var(--step--1); }
.kit-digital { background: var(--white); padding-block: 1rem; }
.kit-digital img { max-width: 720px; width: 100%; margin-inline: auto; background: none; }
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .footer-grid { grid-template-columns: 1fr; } }

/* Botón flotante de cita (móvil) */
.float-cta { position: fixed; right: 1rem; bottom: calc(1rem + env(safe-area-inset-bottom, 0px)); z-index: 40; display: none;
  box-shadow: 0 10px 30px -10px rgba(43,47,51,.6); }
@media (max-width: 1020px) { .float-cta { display: inline-flex; } }

.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }

/* líneas del h1 en cualquier página */
h1 .line { display: block; width: max-content; max-width: 100%; }
h1 .line + .line { margin-top: -1px; }
.float-cta { opacity: 0; pointer-events: none; transform: translateY(10px); transition: opacity .25s, transform .25s; }
body.show-float .float-cta { opacity: 1; pointer-events: auto; transform: none; }
