/* ==========================================================================
   /sobre-mi/ : hero con foto, historia en capítulos (bloque fijado, pin.css), frase + cifras,
   reglas de trabajo, CTA con foto. Solo transform/opacity animados.
   Sin JS o con reduced-motion todo queda visible (la historia como lista normal).
   ========================================================================== */
.hero--sm, .story, .sm-how { --ease: cubic-bezier(0.23, 1, 0.32, 1); }

/* ---------- Hero ---------- */
.hero--sm { position: relative; overflow: hidden; isolation: isolate; }
.hero--sm .container { position: relative; z-index: 1; }

/* Fondo: piezas que pasan del caos al orden (muy sutil, se pausa fuera de pantalla) */
.sm-bg { position: absolute; inset: 0; z-index: 0; pointer-events: none; opacity: .7; -webkit-mask-image: radial-gradient(ellipse 55% 75% at 25% 50%, rgba(0, 0, 0, .1), rgba(0, 0, 0, .5) 55%, #000 95%); mask-image: radial-gradient(ellipse 55% 75% at 25% 50%, rgba(0, 0, 0, .1), rgba(0, 0, 0, .5) 55%, #000 95%); }
/* piezas HTML (no SVG) para que cada una se anime en la GPU sin repintar la máscara */
.sm-bg__p { position: absolute; width: 46px; height: 30px; border-radius: 8px; background: rgba(255, 255, 255, .035); border: 1px solid rgba(255, 255, 255, .17); will-change: transform; animation: sm-order 14s var(--ease) infinite; }
.sm-bg__p--hl { background: rgba(19, 242, 242, .1); border-color: rgba(19, 242, 242, .6); }
@keyframes sm-order { 0%, 6% { transform: translate(var(--x), var(--y)) rotate(var(--r)); } 38%, 62% { transform: none; } 94%, 100% { transform: translate(var(--x), var(--y)) rotate(var(--r)); } }
@media (max-width: 700px) { .sm-bg { opacity: .4; } }
.hero--sm .container { max-width: var(--max); text-align: left; display: grid; gap: var(--s-7); grid-template-columns: 1fr; align-items: center; }
.hero--sm .lead { margin-inline: 0; }
.hero--sm .btn-row { justify-content: flex-start; }
.hero--sm h1 { font-size: clamp(1.8rem, 1.2rem + 2.2vw, 2.8rem); }
@media (min-width: 960px) { .hero--sm .container { grid-template-columns: 1fr 1.05fr; gap: var(--s-7); } }

.sm-photo { position: relative; margin: 0; border-radius: 24px; overflow: hidden; border: 1px solid var(--c-line); background: #07090b; box-shadow: 0 0 70px rgba(19, 242, 242, .14), 0 30px 70px rgba(0, 0, 0, .5); }
.sm-photo img { display: block; width: 100%; height: auto; transform-origin: 60% 40%; animation: sm-settle 1.6s var(--ease) both; }
.sm-photo::after { content: ""; position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06), inset 0 -60px 80px -40px rgba(29, 29, 27, .7); }
/* Barrido de escáner muy sutil */
.sm-photo__scan { position: absolute; left: 0; right: 0; top: -100%; height: 300%; pointer-events: none; background: linear-gradient(180deg, transparent 46%, rgba(19, 242, 242, .16) 50%, transparent 54%); animation: sm-scan 7s linear infinite; }
@keyframes sm-settle { from { transform: scale(1.06); } to { transform: none; } }
@keyframes sm-scan { from { transform: translateY(-20%); } to { transform: translateY(20%); } }

/* ---------- Historia ---------- */
.story__grid { display: grid; gap: var(--s-7); grid-template-columns: 1fr; }
.story__head h2 { margin-bottom: 0; }
.story__list { list-style: none; margin: 0; padding: 0; }
.chapter { padding: var(--s-5) 0; border-top: 1px solid var(--c-line); }
.chapter:last-child { border-bottom: 1px solid var(--c-line); }
.chapter__n { display: block; margin-bottom: var(--s-2); font-size: var(--fs-xs); letter-spacing: .14em; text-transform: uppercase; color: var(--c-cyan); }
.chapter h3 { margin: 0 0 var(--s-2); font: 600 clamp(1.15rem, 1rem + .7vw, 1.5rem)/1.2 var(--font-display); color: var(--c-white); }
.chapter p { margin: 0; max-width: 56ch; color: var(--c-text); font-size: var(--fs-sm); line-height: 1.6; }
.chapter__m { display: block; width: 100%; max-width: 420px; height: auto; margin-top: var(--s-4); border-radius: 16px; border: 1px solid var(--c-line); }
.story__visual { display: none; }
.story__dots { display: none; }
.story__num { display: none; }
.story__main { position: relative; }
.story__list { position: relative; z-index: 1; }

@media (min-width: 960px) {
	.story__grid { grid-template-columns: .9fr 1.1fr; gap: var(--s-8); align-items: center; }
	.story.is-pin .chapter__m { display: none; }
	/* Fijado: se ve un solo capítulo cada vez (los cinco apilados no cabrían en pantalla) */
	.story.is-pin .story__list { display: grid; }
	.story.is-pin .chapter { grid-area: 1 / 1; align-self: center; padding: 0; border: 0; }
	.story.is-pin .chapter h3 { font-size: clamp(1.5rem, 1.1rem + 1.4vw, 2.1rem); margin-bottom: var(--s-3); }
	.story.is-pin .chapter p { font-size: var(--fs-md); }
	.story.is-pin.is-anim .chapter, .story.is-pin.is-anim .chapter:not(.is-on), .story.is-pin.is-anim .chapter.is-on:not(.is-now) { opacity: 0; transform: translateY(16px); pointer-events: none; transition: opacity .45s var(--ease), transform .6s var(--ease); }
	.story.is-pin.is-anim .chapter.is-on:not(.is-now) { transform: translateY(-16px); }
	.story.is-pin.is-anim .chapter.is-now { opacity: 1; transform: none; pointer-events: auto; }
	.story.is-pin .story__visual { display: block; position: relative; height: 300px; margin-top: var(--s-6); border: 1px solid var(--c-line); border-radius: 20px; overflow: hidden; background: radial-gradient(circle at 1px 1px, rgba(255, 255, 255, .07) 1px, transparent 1.5px) 0 0 / 20px 20px, var(--c-bg); }
}

@media (min-width: 960px) {
	.story.is-pin .story__dots { display: flex; gap: 8px; margin-bottom: var(--s-5); }
	.story__dots i { width: 38px; height: 3px; border-radius: 2px; background: var(--c-line); transition: background .35s; }
	.story[data-active="1"] .story__dots i:nth-child(-n+1), .story[data-active="2"] .story__dots i:nth-child(-n+2), .story[data-active="3"] .story__dots i:nth-child(-n+3), .story[data-active="4"] .story__dots i:nth-child(-n+4), .story[data-active="5"] .story__dots i:nth-child(-n+5) { background: var(--c-cyan); }
}

/* Fondo minimalista: el número del capítulo, gigante y solo contorno, detrás del texto */
@media (min-width: 960px) {
	.story.is-pin .story__num { display: block; position: absolute; right: -1%; top: 50%; width: 60%; height: 0; pointer-events: none; }
	.story__num span { position: absolute; right: 0; top: 0; transform: translateY(-46%) translateX(40px); font: 700 clamp(11rem, 20vw, 20rem)/1 var(--font-display); color: transparent; -webkit-text-stroke: 1px rgba(19, 242, 242, .16); opacity: 0; transition: opacity .6s var(--ease), transform .9s var(--ease); }
	.story[data-active="1"] .story__num span:nth-child(1), .story[data-active="2"] .story__num span:nth-child(2), .story[data-active="3"] .story__num span:nth-child(3), .story[data-active="4"] .story__num span:nth-child(4), .story[data-active="5"] .story__num span:nth-child(5) { opacity: 1; transform: translateY(-46%); }
}

/* Visuales: uno por capítulo, cambian con data-active (lo escribe pin.js) */
.ch-art { position: absolute; inset: 0; display: grid; place-items: center; opacity: 0; transform: scale(.97); transition: opacity .5s var(--ease), transform .7s var(--ease); pointer-events: none; }
.story:not([data-active]) .ch-art--1, .story[data-active="1"] .ch-art--1, .story[data-active="2"] .ch-art--2, .story[data-active="3"] .ch-art--3, .story[data-active="4"] .ch-art--4, .story[data-active="5"] .ch-art--5 { opacity: 1; transform: none; }
.ch-art em { position: absolute; left: 0; right: 0; bottom: var(--s-4); text-align: center; font-style: normal; font-size: var(--fs-xs); letter-spacing: .14em; text-transform: uppercase; color: var(--c-muted); }
.ch-art img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* 1 · Lo antiguo: tarjetas desordenadas */
.ch-art--1 { grid-template-columns: repeat(2, auto); gap: var(--s-4) var(--s-6); align-content: center; justify-content: center; }
.ch-art--1 span { padding: .55rem 1.1rem; border: 1px dashed var(--c-border-ui); border-radius: 10px; color: var(--c-muted); background: rgba(255, 255, 255, .03); transform: translate(var(--x), var(--y)) rotate(var(--r)); }
.story[data-active="1"] .ch-art--1 span { animation: sm-wob 4s ease-in-out infinite alternate; }
@keyframes sm-wob { to { transform: translate(calc(var(--x) * -1), calc(var(--y) * -1)) rotate(calc(var(--r) * -1)); } }

/* 2 · Internet: una búsqueda y tu web sube al primer puesto */
.ch-art--2 { align-content: center; justify-items: center; gap: var(--s-4); }
.ch-search { width: 78%; display: flex; align-items: center; gap: var(--s-2); padding: .7rem 1.1rem; border: 1px solid var(--c-cyan); border-radius: 999px; color: var(--c-white); font-size: var(--fs-sm); }
.ch-search svg { color: var(--c-cyan); }
.ch-res { width: 78%; display: grid; gap: 8px; }
.ch-res i { display: flex; align-items: center; gap: 10px; padding: .55rem .9rem; border: 1px solid var(--c-line); border-radius: 10px; font-style: normal; font-size: var(--fs-sm); color: var(--c-muted); background: var(--c-surface); }
.ch-res b { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: var(--fs-xs); background: var(--c-line); color: var(--c-white); }
.ch-res i:first-child { border-color: var(--c-cyan); color: var(--c-white); background: rgba(19, 242, 242, .1); }
.ch-res i:first-child b { background: var(--c-cyan); color: var(--c-ink); }
.story[data-active="2"] .ch-res i:first-child { animation: sm-rise 1.1s var(--ease) .5s both; }
.story[data-active="2"] .ch-res i:not(:first-child) { animation: sm-sink 1.1s var(--ease) .5s both; }
@keyframes sm-rise { from { transform: translateY(116px); } to { transform: none; } }
@keyframes sm-sink { from { transform: translateY(-58px); } to { transform: none; } }

/* 3 · SEO: barras que suben */
.ch-bars { display: flex; align-items: flex-end; gap: 10px; width: 62%; height: 58%; margin-bottom: var(--s-4); }
.ch-bars i { flex: 1; height: var(--h); border-radius: 6px 6px 0 0; background: var(--grad); transform-origin: bottom; transform: scaleY(.08); transition: transform .9s var(--ease); transition-delay: calc(var(--i) * 90ms); }
.story[data-active="3"] .ch-bars i, .story:not([data-active]) .ch-bars i { transform: none; }

/* ---------- Frase + cifras ---------- */
.sm-quote .container { text-align: center; }
.quote { margin: 0 0 var(--s-8); }
.quote p { margin: 0; font: 700 clamp(1.8rem, 1.1rem + 3.2vw, 3.4rem)/1.15 var(--font-display); color: var(--c-white); }
.sm-quote .note { margin-top: var(--s-6); }

/* ---------- Cómo trabajo ---------- */
.sm-how { display: grid; gap: var(--s-7); grid-template-columns: 1fr; align-items: center; }
.sm-how__photo { margin: 0; justify-self: center; width: min(100%, 320px); border-radius: 24px; overflow: hidden; border: 1px solid var(--c-line); box-shadow: 0 0 60px rgba(19, 242, 242, .12); }
.sm-how__photo img { display: block; width: 100%; height: auto; }
@media (min-width: 960px) { .sm-how { grid-template-columns: 380px 1fr; gap: var(--s-8); } .sm-how__photo { width: 100%; } }

/* ---------- CTA final ---------- */
.sm-cta .container { display: grid; gap: var(--s-7); grid-template-columns: 1fr; align-items: center; }
.sm-cta .lead { margin-inline: 0; }
.sm-cta__photo { margin: 0; justify-self: start; width: min(70vw, 300px); border-radius: 24px; overflow: hidden; border: 1px solid var(--c-line); box-shadow: 0 0 60px rgba(255, 10, 192, .12); }
.sm-cta__photo img { display: block; width: 100%; height: auto; }
@media (min-width: 960px) { .sm-cta .container { grid-template-columns: 1fr 340px; gap: var(--s-8); } .sm-cta__photo { justify-self: end; width: 100%; } }

@media (prefers-reduced-motion: reduce) {
	.sm-photo img, .sm-photo__scan, .ch-art--1 span, .sm-bg__p { animation: none !important; }
	.ch-art, .ch-bars i, .story__num span { transition: none; }
	.ch-art--2 i { animation: none !important; }
}
