/* ===== Tipografías (autoalojadas, licencia OFL) ===== */
@font-face { font-family: "Raleway"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("../fonts/raleway-latin-wght-normal.woff2") format("woff2"); }
@font-face { font-family: "Nunito"; font-style: normal; font-weight: 200 1000; font-display: swap; src: url("../fonts/nunito-latin-wght-normal.woff2") format("woff2"); }
@font-face { font-family: "Playfair Display"; font-style: normal; font-weight: 400 900; font-display: swap; src: url("../fonts/playfair-display-latin-wght-normal.woff2") format("woff2"); }
@font-face { font-family: "Playfair Display"; font-style: italic; font-weight: 400 900; font-display: swap; src: url("../fonts/playfair-display-latin-wght-italic.woff2") format("woff2"); }
@font-face { font-family: "Caveat"; font-style: normal; font-weight: 400 700; font-display: swap; src: url("../fonts/caveat-latin-wght-normal.woff2") format("woff2"); }

/* ===== Variables ===== */
:root {
  /* Paleta: crema, rosas, verdes, beige y gris claro */
  --cream: #FDFBFA;
  --rose-pastel: #F7D7E0;
  --rose: #E78FB6;
  --sage: #A7B89F;
  --olive: #6B7F6B;
  --beige: #E8DCCF;
  --rose-earth: #D9B8B3;
  --gray-light: #EDE9E4;
  --bg: var(--cream);
  --surface: #ffffff;
  --text: #3A2A31;
  --muted: #6A5660;
  --primary: var(--rose);
  --primary-hover: #D97AA8;
  --primary-dark: #A23F6B; /* rosa profundo: texto y enlaces legibles */
  --on-primary: #3A2530; /* texto sobre rosa */
  --accent: var(--beige);
  --border: var(--gray-light);
  --ink: #4A2F3B; /* ciruela suave, derivado del rosa tierra */
  --radius: 14px;
  --shadow: 0 6px 24px rgba(167, 100, 130, 0.18);
  --font: "Raleway", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-display: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-serif: "Playfair Display", Georgia, "Times New Roman", serif;
  --font-hand: "Caveat", "Segoe Script", "Bradley Hand", cursive;
  --max: 1080px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
  font-size: 1rem;
}
img { max-width: 100%; display: block; }
a { color: var(--primary-dark); }
a:hover { color: #8A3358; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.12; letter-spacing: -0.015em; color: var(--ink); margin: 0 0 .6em; text-wrap: balance; }
h1 { font-size: clamp(2.2rem, 5.5vw, 3.4rem); }
h2 { font-size: clamp(1.75rem, 4vw, 3rem); line-height: 1.05; }
h3 { font-size: 1.25rem; line-height: 1.4; }
p { margin: 0 0 1em; }

.container { width: min(100% - 2rem, var(--max)); margin-inline: auto; }
.section { padding: 4rem 0; }
.section--alt { background: var(--accent); }
.section__head { max-width: 640px; margin-bottom: 2rem; }
.eyebrow { text-transform: uppercase; letter-spacing: .28em; font-size: .78rem; line-height: 1.6; color: var(--primary-dark); font-weight: 600; margin-bottom: .8rem; }

.skip-link { position: absolute; left: -999px; top: 0; background: var(--primary-dark); color: #fff; padding: .6rem 1rem; z-index: 100; }
.skip-link:focus { left: 0; }
:focus-visible { outline: 3px solid var(--rose); outline-offset: 2px; }

/* ===== Header ===== */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(253, 251, 250, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
.nav { display: flex; align-items: center; justify-content: space-between; min-height: 68px; }
.brand { font-family: var(--font-display); font-size: 1.2rem; font-weight: 800; text-decoration: none; color: var(--ink); }
.brand span { color: var(--primary-dark); }
.nav__links { display: flex; gap: 1.4rem; list-style: none; margin: 0; padding: 0; align-items: center; }
.nav__links a { text-decoration: none; color: var(--text); font-size: .9rem; font-weight: 500; padding: .3rem 0; border-bottom: 2px solid transparent; }
.nav__links a:hover, .nav__links a[aria-current="page"] { border-color: var(--primary); }
.nav__toggle { display: none; background: none; border: 1px solid var(--border); border-radius: 8px; padding: .45rem .7rem; font-size: 1rem; cursor: pointer; color: var(--text); }

/* ===== Botones ===== */
.btn { display: inline-block; padding: .85rem 1.5rem; border-radius: 999px; background: var(--primary); color: var(--on-primary); text-decoration: none; font-weight: 500; border: 2px solid var(--primary); cursor: pointer; font-size: 1rem; font-family: inherit; transition: background .2s, transform .2s; }
.btn:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: var(--on-primary); transform: translateY(-1px); }
.btn--ghost { background: transparent; color: var(--primary-dark); }
.btn--ghost:hover { background: var(--primary); color: var(--on-primary); }
.btn-row { display: flex; gap: .8rem; flex-wrap: wrap; margin-top: 1.5rem; }

/* ===== Hero ===== */
.hero { padding: 3.5rem 0 4rem; }
.hero__grid { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 3rem; align-items: center; }
.hero > .container { width: min(100% - 3rem, 1440px); }
.hero__lead { font-family: var(--font); font-size: clamp(1.15rem, 2.2vw, 1.45rem); font-weight: 400; letter-spacing: 0; line-height: 1.45; color: var(--muted); max-width: 540px; }
.hero__img { aspect-ratio: 4/5; border-radius: 200px 200px var(--radius) var(--radius); background: linear-gradient(160deg, var(--rose-pastel), var(--beige)); display: grid; place-items: center; color: var(--primary-dark); font-size: .95rem; text-align: center; padding: 1rem; box-shadow: var(--shadow); }
.hero__img img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }

/* ===== Cards ===== */
.grid { display: grid; gap: 1.5rem; }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.6rem; box-shadow: var(--shadow); }
.card h3 { margin-bottom: .4em; }
.card p:last-child { margin-bottom: 0; }
.icon { width: 46px; height: 46px; border-radius: 12px; background: var(--accent); display: grid; place-items: center; font-size: 1.4rem; margin-bottom: 1rem; }
.price { font-family: var(--font-display); font-weight: 800; letter-spacing: 0; color: var(--primary-dark); }

/* ===== Lista de pasos ===== */
.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; display: grid; gap: 1rem; }
.steps li { counter-increment: s; padding-left: 3.2rem; position: relative; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 2.2rem; height: 2.2rem; border-radius: 50%; background: var(--rose-pastel); color: var(--primary-dark); border: 2px solid var(--rose); display: grid; place-items: center; font-weight: 700; }

/* ===== FAQ ===== */
details { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 1rem 1.2rem; margin-bottom: .8rem; }
summary { cursor: pointer; font-weight: 600; }
details[open] summary { margin-bottom: .6rem; }

/* ===== Blog ===== */
.blog-tools { display: flex; gap: 1rem; flex-wrap: wrap; align-items: center; margin-bottom: 2rem; }
.blog-tools input[type="search"] { flex: 1 1 240px; }
.chips { display: flex; gap: .5rem; flex-wrap: wrap; }
.chip { border: 1px solid var(--border); background: var(--surface); border-radius: 999px; padding: .4rem 1rem; cursor: pointer; font-family: inherit; font-size: .92rem; color: var(--text); }
.chip[aria-pressed="true"] { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.post-card { display: flex; flex-direction: column; }
.post-card__meta { font-size: .85rem; color: var(--muted); margin-bottom: .6rem; }
.tag { display: inline-block; background: var(--rose-pastel); color: var(--primary-dark); padding: .1rem .7rem; border-radius: 999px; font-size: .8rem; margin-right: .4rem; }
.post-card a.more { margin-top: auto; font-weight: 600; text-decoration: none; }
.empty { display: none; color: var(--muted); }

.article { max-width: 720px; margin-inline: auto; }
.article h1 { margin-bottom: .3em; }
.article__meta { color: var(--muted); font-size: .92rem; margin-bottom: 2rem; }
.article h2 { margin-top: 1.8em; font-size: 1.5rem; }
.article ul { padding-left: 1.2rem; }
.callout { background: var(--rose-pastel); border-left: 4px solid var(--rose); padding: 1rem 1.2rem; border-radius: 8px; margin: 1.8rem 0; font-size: .98rem; }

/* ===== Formulario ===== */
.form { display: grid; gap: 1rem; }
label { font-weight: 600; font-size: .95rem; display: block; margin-bottom: .3rem; }
input, select, textarea { width: 100%; padding: .8rem 1rem; border: 1px solid var(--rose-earth); border-radius: 10px; font: inherit; background: #fff; color: var(--text); }
textarea { min-height: 140px; resize: vertical; }
.checkbox { display: flex; gap: .6rem; align-items: flex-start; font-size: .92rem; font-weight: 400; }
.checkbox input { width: auto; margin-top: .35rem; }
.hp { position: absolute; left: -9999px; height: 0; overflow: hidden; }
.form-msg { padding: .8rem 1rem; border-radius: 10px; display: none; }
.form-msg.ok { display: block; background: #E6EDE2; color: #3F5A43; }
.form-msg.err { display: block; background: var(--rose-pastel); color: #8a2a1f; }
.note { font-size: .88rem; color: var(--muted); }
.crisis { background: var(--beige); border: 1px solid var(--rose-earth); padding: 1rem 1.2rem; border-radius: 12px; font-size: .95rem; }

/* ===== Footer ===== */
.site-footer { background: var(--rose-earth); color: var(--on-primary); padding: 3rem 0 2rem; margin-top: 2rem; }
.site-footer a { color: var(--on-primary); }
.footer__grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2rem; }
.site-footer h3 { color: var(--on-primary); font-size: 1.05rem; font-family: var(--font); }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: .4rem; }
.footer__bottom { border-top: 1px solid rgba(58, 37, 48, .22); margin-top: 2rem; padding-top: 1.2rem; font-size: .85rem; color: #4E3743; }

.wa-float { position: fixed; right: 1rem; bottom: 1rem; background: #25a35a; color: #fff; text-decoration: none; padding: .8rem 1.1rem; border-radius: 999px; font-weight: 600; box-shadow: var(--shadow); z-index: 60; font-size: .95rem; }
.wa-float:hover { background: #1d8a4a; color: #fff; }

/* ===== Responsive ===== */
@media (max-width: 820px) {
  .hero__grid, .grid--3, .grid--2, .footer__grid { grid-template-columns: 1fr; }
  .hero__img { max-width: 100%; order: -1; }
  .nav__toggle { display: block; }
  .nav__links { display: none; position: absolute; top: 68px; left: 0; right: 0; background: var(--bg); flex-direction: column; padding: 1rem; border-bottom: 1px solid var(--border); gap: 1rem; align-items: flex-start; }
  .nav__links.open { display: flex; }
  .section { padding: 3rem 0; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }

/* ===== Utilidades (sin estilos en línea, por el CSP) ===== */
.container--narrow { max-width: 760px; }
.post-card h2, .post-card h3 { font-size: 1.35rem; }
.post-card h2 a, .post-card h3 a { text-decoration: none; color: inherit; }
.footer__bottom--plain { border: 0; margin: 0; padding: 0; }

/* ===== Acentos tipográficos ===== */
h1 em, h2 em { font-family: var(--font-serif); font-style: italic; font-weight: 500; letter-spacing: 0; color: var(--primary-dark); }
.hand { font-family: var(--font-hand); font-weight: 700; font-size: clamp(1.9rem, 4.2vw, 2.7rem); line-height: 1.1; color: var(--primary-dark); margin: 1.2rem 0 0; }
.callout { font-family: var(--font-serif); font-style: italic; font-size: 1.12rem; line-height: 1.55; }
.article__meta, .post-card__meta, .note { letter-spacing: .01em; }

/* Botón del menú: mantiene texto claro (la regla .nav__links a lo oscurecía) */
.nav__links a.btn { color: var(--on-primary); padding: .55rem 1.2rem; border: 2px solid var(--primary); }
.nav__links a.btn:hover { border-color: var(--primary-hover); color: var(--on-primary); }

/* ===== Fotos y contenido dinámico ===== */
.hero__img:has(img) { aspect-ratio: auto; padding: 0; background: none; border-radius: var(--radius); display: block; }
.hero__img img { display: block; width: 100%; height: auto; object-fit: contain; border-radius: var(--radius); }
.about-photo { display: block; width: auto; max-width: 100%; height: auto; max-height: 500px; margin-inline: auto; object-fit: contain; border-radius: var(--radius); margin-bottom: 1.2rem; box-shadow: var(--shadow); }
.post-card__cover { display: block; margin: -1.6rem -1.6rem 1.2rem; overflow: hidden; border-radius: var(--radius) var(--radius) 0 0; }
.post-card__cover img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.article__cover { margin: 0 0 2rem; }
.article__cover img, .article figure img { width: 100%; height: auto; border-radius: var(--radius); }
.article figure { margin: 1.8rem 0; }
.article figcaption { font-size: .88rem; color: var(--muted); margin-top: .5rem; }
.article hr { border: 0; border-top: 1px solid var(--border); margin: 2rem 0; }
.article code { background: var(--accent); padding: .1em .4em; border-radius: 6px; font-size: .92em; }
.article ol { padding-left: 1.3rem; }

/* ===== Mariposas de bienvenida ===== */
.bf-layer { position: absolute; left: 0; top: 0; width: 100%; overflow: hidden; pointer-events: none; z-index: 90; }
.bf { position: absolute; left: 0; top: 0; pointer-events: none; will-change: transform, opacity; filter: drop-shadow(0 3px 4px rgba(40, 30, 40, .28)); }
.bf svg { display: block; width: 100%; height: 100%; overflow: visible; }
.bf__wings { transform-origin: 50px 42px; animation: bf-flap .28s ease-in-out infinite; }
@keyframes bf-flap { 0%, 100% { transform: scaleX(1); } 50% { transform: scaleX(.2); } }
@media (prefers-reduced-motion: reduce) { .bf { display: none; } }

.h1-kicker { display: block; font-family: var(--font); font-size: .8rem; font-weight: 700; letter-spacing: .28em; text-transform: uppercase; line-height: 1.6; color: var(--primary-dark); margin-bottom: .9rem; }
.vh { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ===== Animaciones y dinamismo ===== */
.section { overflow-x: clip; }
.reveal.reveal { opacity: 0; transition: opacity .7s ease, transform .8s cubic-bezier(.2, .7, .2, 1); will-change: opacity, transform; }
.reveal--up { transform: translateY(28px); }
.reveal--left { transform: translateX(-28px); }
.reveal--right { transform: translateX(28px) scale(.97); }
.reveal.is-in { opacity: 1; transform: none; }

.site-header { transition: box-shadow .3s ease, background .3s ease; }
.site-header.is-scrolled { box-shadow: 0 6px 20px rgba(167, 100, 130, .14); }

.card { transition: transform .3s ease, box-shadow .3s ease; }
.grid .card:hover { transform: translateY(-4px); box-shadow: 0 12px 32px rgba(167, 100, 130, .22); }
.about-photo, .article__cover img { transition: transform .5s ease, box-shadow .5s ease; }
.about-photo:hover { transform: scale(1.02); }
.post-card__cover img { transition: transform .6s ease; }
.post-card:hover .post-card__cover img { transform: scale(1.05); }
.btn { transition: transform .2s ease, background .2s ease, border-color .2s ease, box-shadow .2s ease; }
.btn:hover { box-shadow: 0 8px 20px rgba(231, 143, 182, .45); }

@media (prefers-reduced-motion: no-preference) {
  /* Entrada de la portada */
  .hero__grid > div:first-child > * { animation: rise .8s cubic-bezier(.2, .7, .2, 1) both; }
  .hero__grid > div:first-child > :nth-child(2) { animation-delay: .08s; }
  .hero__grid > div:first-child > :nth-child(3) { animation-delay: .16s; }
  .hero__grid > div:first-child > :nth-child(4) { animation-delay: .26s; }
  .hero__grid > div:first-child > :nth-child(5) { animation-delay: .36s; }
  .hero__grid > div:first-child > :nth-child(6) { animation-delay: .46s; }
  .hero__img { animation: rise-zoom 1s .2s cubic-bezier(.2, .7, .2, 1) both; }
  .hand { background: linear-gradient(90deg, var(--primary-dark), var(--rose), var(--primary-dark)); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; animation: rise .8s .3s both, shimmer 6s 1.2s linear infinite; }
}
@keyframes rise { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@keyframes rise-zoom { from { opacity: 0; transform: translateY(20px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } .grid .card:hover, .about-photo:hover { transform: none; } }

/* ===== Formación ===== */
.section--soft { background: rgba(247, 215, 224, .35); }
.formation { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.1rem; }
.formation li { position: relative; background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--rose); border-radius: var(--radius); padding: 1.2rem 1.3rem; box-shadow: var(--shadow); transition: transform .3s ease, box-shadow .3s ease; }
.formation li:hover { transform: translateY(-4px); box-shadow: 0 12px 32px rgba(167, 100, 130, .22); }
.formation h3 { font-size: 1.12rem; margin: 0 0 .35rem; }
.formation p { margin: 0; color: var(--muted); font-size: .95rem; }
.formation__year { display: inline-block; background: var(--rose-pastel); color: var(--primary-dark); font-weight: 700; font-size: .78rem; letter-spacing: .06em; border-radius: 999px; padding: .1rem .7rem; margin-bottom: .6rem; }

.hero { position: relative; overflow: hidden; }
.hero__grid { position: relative; z-index: 1; }

/* ===== Título con palabra que se escribe ===== */
h1 em.is-typing::after { content: ""; display: inline-block; width: 2px; height: .85em; margin-left: 3px; vertical-align: -.05em; background: var(--primary-dark); animation: caret 1s steps(1) infinite; }
@keyframes caret { 50% { opacity: 0; } }

/* ===== Preguntas frecuentes ===== */
summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
summary::-webkit-details-marker { display: none; }
summary::after { content: ""; flex: none; width: .55rem; height: .55rem; border-right: 2px solid var(--primary-dark); border-bottom: 2px solid var(--primary-dark); transform: rotate(45deg); transition: transform .35s ease; margin-top: -.2rem; }
details[open]:not(.is-closing) summary::after { transform: rotate(225deg); margin-top: .2rem; }
details:hover { border-color: var(--rose); }

/* Portada web: foto grande y con presencia */
@media (min-width: 821px) {
  .hero__img:has(img) { border-radius: 22px; box-shadow: 0 24px 60px -18px rgba(120, 60, 85, .35); }
  .hero__img:has(img) img { border-radius: 22px; }
}

/* Sobre mí: foto centrada verticalmente y proporcional al texto */
@media (min-width: 821px) {
  #sobre-mi .grid--2 { align-items: center; }
  #sobre-mi .about-photo { max-height: 640px; margin-bottom: 0; }
}

/* ===== Ventana para programar una reunión ===== */
.steps-cta { margin-top: 2rem; }
.meeting { border: 0; padding: 0; border-radius: 18px; width: min(560px, calc(100% - 2rem)); max-height: calc(100vh - 2rem); background: var(--surface); color: var(--text); box-shadow: 0 30px 80px -20px rgba(58, 37, 48, .45); }
.meeting::backdrop { background: rgba(58, 37, 48, .5); backdrop-filter: blur(3px); }
.meeting .form { padding: 1.6rem; }
.meeting__head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.meeting__head h2 { margin: 0; font-size: 1.5rem; }
.meeting__close { background: none; border: 0; font-size: 2rem; line-height: 1; cursor: pointer; color: var(--ink); padding: 0 .3rem; }
.meeting .note { margin: 0; }
.meeting textarea { min-height: 110px; }
