/* Estilos compartidos: index.html (español) y en/index.html (inglés) */
:root {
  --bg: #F8F6FC; --surface: #FFFFFF; --ink: #1A1326; --muted: #5E5770; --line: #E6E0F0;
  --accent: #6A3DE8; --accent-ink: #4B23B8; --accent-soft: #EFE8FD; --lilac: #B79CFF;
  --night: #1E1035; --on-night: #F3EEFF; --on-night-muted: #C4B6E6;
  --display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --sans: "Geist", "Segoe UI", system-ui, sans-serif; --mono: "Geist Mono", ui-monospace, Consolas, monospace;
  --gutter: clamp(16px, 4vw, 64px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --bg: #120B1E; --surface: #1B1229; --ink: #EFEAF8; --muted: #ABA2BF; --line: #2F2443; --accent: #A98BFF; --accent-ink: #C7B4FF; --accent-soft: #261A3D; color-scheme: dark; }
}
:root[data-theme="dark"] { --bg: #120B1E; --surface: #1B1229; --ink: #EFEAF8; --muted: #ABA2BF; --line: #2F2443; --accent: #A98BFF; --accent-ink: #C7B4FF; --accent-soft: #261A3D; color-scheme: dark; }
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 17px/1.6 var(--sans); -webkit-font-smoothing: antialiased; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--lilac); outline-offset: 3px; }
h1, h2, h3 { margin: 0; font-family: var(--display); letter-spacing: -0.02em; font-weight: 700; }
.mono { font-family: var(--mono); font-size: 13px; letter-spacing: .02em; color: var(--muted); }
.btn { display: inline-flex; align-items: center; gap: 8px; font: 500 15px/1 var(--sans); text-decoration: none; padding: 12px 18px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); }
.btn:hover { border-color: var(--accent); }

/* ---------- Dos columnas: perfil fijo a la izquierda, contenido a la derecha ---------- */
.layout { display: grid; grid-template-columns: minmax(340px, 34%) 1fr; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; gap: 22px; padding: clamp(28px, 4vh, 56px) clamp(24px, 3vw, 56px); color: var(--on-night);
  background: radial-gradient(700px 500px at 100% 0%, #5B2FC9 0%, transparent 60%), radial-gradient(600px 400px at 0% 100%, #3A1C78 0%, transparent 60%), var(--night); }
.who { display: flex; align-items: center; gap: 18px; }
.avatar { position: relative; flex: none; width: clamp(96px, 9vw, 132px); aspect-ratio: 4 / 5; border-radius: 22px; overflow: hidden; background: linear-gradient(155deg, #8E6BFF, #3A1C78); box-shadow: 0 20px 50px -20px rgba(124,77,255,.8); }
.avatar::after { content: "AP"; position: absolute; inset: 0; display: grid; place-items: center; font: 800 40px var(--display); color: rgba(255,255,255,.25); }
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; }
.status { display: inline-flex; align-items: center; gap: 8px; font: 500 12px var(--mono); color: var(--on-night); background: rgba(183,156,255,.14); border: 1px solid rgba(183,156,255,.3); padding: 5px 11px; border-radius: 99px; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #7CF0B5; box-shadow: 0 0 0 4px rgba(124,240,181,.18); }
.hello { font: 500 15px var(--mono); color: var(--lilac); margin: 0 0 4px; }
.side h1 { font-size: clamp(36px, 3.4vw, 56px); line-height: 1; font-weight: 800; }
.lead { margin: 0; font: 700 clamp(19px, 1.5vw, 24px)/1.25 var(--display); letter-spacing: -0.01em; color: #fff; }
.lead em { font-style: normal; background: linear-gradient(90deg, #C9B5FF, #8E6BFF); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead span { color: var(--on-night-muted); }
.bio { margin: 0; color: var(--on-night-muted); font-size: 16px; max-width: 34em; }
.side nav ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.side nav a { display: flex; align-items: center; gap: 12px; padding: 6px 0; text-decoration: none; color: var(--on-night-muted); font: 500 13px var(--mono); letter-spacing: .06em; text-transform: uppercase; }
.side nav a::before { content: ""; width: 26px; height: 1px; background: currentColor; transition: width .2s; }
.side nav a:hover, .side nav a.on { color: #fff; }
.side nav a.on::before, .side nav a:hover::before { width: 56px; background: var(--lilac); }
.side-foot { margin-top: auto; display: grid; gap: 14px; }
.side .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.side .btn { background: transparent; color: var(--on-night); border-color: rgba(243,238,255,.3); }
.side .btn:hover { border-color: var(--lilac); }
.side .btn-primary { background: var(--lilac); color: var(--night); border-color: var(--lilac); }
.side .btn-primary:hover { background: #fff; border-color: #fff; }
.social { display: flex; gap: 14px; align-items: center; }
.social a { color: var(--on-night-muted); display: inline-flex; } .social a:hover { color: #fff; }
.social .lang { margin-left: auto; font: 500 12px var(--mono); text-decoration: none; border: 1px solid rgba(243,238,255,.3); padding: 5px 10px; border-radius: 99px; }
.social .lang:hover { border-color: var(--lilac); }

.content { min-width: 0; container-type: inline-size; }
.content > section { padding: clamp(40px, 6vh, 64px) var(--gutter); border-bottom: 1px solid var(--line); scroll-margin-top: 8px; }
.label { margin: 0 0 6px; color: var(--accent); }
.content h2 { font-size: clamp(26px, 2.6vw, 36px); line-height: 1.1; margin-bottom: 22px; max-width: 30ch; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.stats div { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 18px; }
.stats b { display: block; font: 700 clamp(24px, 2.2vw, 32px)/1.1 var(--display); color: var(--accent-ink); }
.stats span { font-size: 14px; color: var(--muted); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 26px; }
.card-top { display: flex; justify-content: space-between; gap: 6px 16px; flex-wrap: wrap; align-items: baseline; margin-bottom: 12px; }
.card h3 { font-size: 22px; }
.card h3 small { font-size: .6em; color: var(--muted); font-weight: 500; }
.card p { margin: 0 0 12px; color: var(--muted); }
.card ul { margin: 0 0 16px; padding-left: 18px; }
.card li { margin-bottom: 6px; }
.card li::marker { color: var(--accent); }
.card a { color: var(--accent); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips span { font: 500 12px var(--mono); background: var(--accent-soft); color: var(--accent-ink); padding: 5px 10px; border-radius: 99px; }
.note { font-size: 14px; color: var(--muted); }

.tl { list-style: none; margin: 0; padding: 0 0 0 22px; border-left: 2px solid var(--line); display: grid; gap: 20px; }
.tl > li { position: relative; min-width: 0; }
.tl > li::before { content: ""; position: absolute; left: -30px; top: 6px; width: 14px; height: 14px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--bg); }
.tl .when { display: block; margin-bottom: 8px; color: var(--accent); }
.role { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: baseline; margin: 16px 0 8px; padding-top: 14px; border-top: 1px dashed var(--line); }
.edu { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); gap: 14px; margin-top: 24px; }
.edu .card { padding: 22px; }
.edu h3 { font-size: 18px; margin: 6px 0 8px; }
.edu p { font-size: 15px; margin: 0; }

.paper { display: grid; grid-template-columns: 1.1fr 1fr; overflow: hidden; padding: 0; }
.paper > * { min-width: 0; }
.paper figure { margin: 0; background: #fff; padding: 20px; display: grid; place-items: center; border-right: 1px solid var(--line); }
.paper figure img { width: 100%; }
.paper .info { padding: 26px; display: grid; gap: 14px; align-content: start; }
.paper .info p { margin: 0; }
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.kpis div { background: var(--accent-soft); border-radius: 12px; padding: 12px; }
.kpis b { display: block; font: 700 20px/1.1 var(--display); color: var(--accent-ink); white-space: nowrap; }
.kpis span { font-size: 13px; color: var(--muted); }

.work { display: grid; gap: 18px; }
.project { display: grid; grid-template-columns: 1.4fr 1fr; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.project > * { min-width: 0; }
.project .shots { background: linear-gradient(160deg, #EFE8FD, #D9CBFF); padding: 24px 24px 0; display: flex; align-items: flex-end; justify-content: center; gap: 12px; }
.project .shots img { border-radius: 8px 8px 0 0; box-shadow: 0 14px 34px -14px rgba(42,22,80,.45); }
.project .shots .desk { width: 76%; } .project .shots .phone { width: 22%; border-radius: 10px 10px 0 0; }
.project .info { padding: 24px; display: grid; gap: 10px; align-content: start; }
.project h3 { font-size: 21px; }
.project p { margin: 0; font-size: 15px; color: var(--muted); }
.link { color: var(--accent); font-weight: 500; text-decoration: none; }
.link:hover { text-decoration: underline; }

.pgrid { display: grid; grid-template-columns: 1fr; gap: 16px; }
.pcard { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; min-width: 0; transition: border-color .15s, transform .15s; }
.pcard:hover { border-color: var(--accent); transform: translateY(-2px); }
.flow { height: 112px; display: flex; flex-wrap: nowrap; align-items: center; justify-content: center; gap: 5px; padding: 14px; background: linear-gradient(160deg, #EFE8FD, #D9CBFF); }
.flow .node { background: var(--surface); color: var(--ink); border: 1px solid #CDBDF7; border-radius: 10px; padding: 6px 8px; font: 500 11px var(--mono); text-align: center; white-space: nowrap; box-shadow: 0 8px 18px -14px rgba(42,22,80,.5); }
.flow .node small { display: block; color: var(--muted); font-size: 9.5px; }
.flow .arrow { color: var(--accent); font: 600 13px var(--mono); }
.pcard .body { padding: 20px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.pcard h3 { font-size: 19px; }
.pcard p { margin: 0; font-size: 15px; color: var(--muted); }
.pcard .role-line { color: var(--ink); }
.pcard .links { margin-top: auto; padding-top: 4px; display: flex; gap: 16px; flex-wrap: wrap; font-size: 15px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .flow, :root:not([data-theme="light"]) .project .shots { background: linear-gradient(160deg, #2A1C44, #3A2665); } :root:not([data-theme="light"]) .flow .node { border-color: #4A3577; } }
:root[data-theme="dark"] .flow, :root[data-theme="dark"] .project .shots { background: linear-gradient(160deg, #2A1C44, #3A2665); }
:root[data-theme="dark"] .flow .node { border-color: #4A3577; }

.services { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: 14px; }
.svc { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 22px; }
.svc .ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); margin-bottom: 12px; }
.svc h3 { font-size: 18px; margin: 0 0 6px; }
.svc p { margin: 0; font-size: 15px; color: var(--muted); }
.steps { list-style: none; margin: 28px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 18px; }
.steps li { border-top: 3px solid var(--accent); padding-top: 12px; }
.steps b { display: block; margin: 6px 0 4px; }
.steps span { font-size: 15px; color: var(--muted); }

.life { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 14px; }
.life .card { padding: 22px; }
.life .emoji { font-size: 28px; line-height: 1; margin-bottom: 12px; }
.life h3 { font-size: 18px; margin-bottom: 6px; }
.life p { margin: 0; font-size: 15px; }
.tri { display: flex; gap: 6px; margin-top: 14px; }
.tri span { flex: 1; height: 6px; border-radius: 99px; background: var(--accent); }

.bgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 14px; }
.bpost { display: block; text-decoration: none; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 22px; }
.bpost:hover { border-color: var(--accent); }
.bpost h3 { font-size: 19px; margin: 6px 0; }
.bpost p { margin: 0; font-size: 15px; color: var(--muted); }

.contact { text-align: center; display: grid; justify-items: center; gap: 14px; }
.contact h2 { margin: 0; max-width: 20ch; }
.contact p { margin: 0; color: var(--muted); }
.contact .actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.contact .btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.foot { padding: 22px var(--gutter); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* Columnas según el ancho real del contenido */
@container (min-width: 640px) { .pgrid { grid-template-columns: repeat(2, 1fr); } }
@container (min-width: 1040px) { .pgrid { grid-template-columns: repeat(3, 1fr); } }
@container (max-width: 760px) {
  .paper, .project { grid-template-columns: 1fr; }
  .paper figure { border-right: 0; border-bottom: 1px solid var(--line); }
  .stats { grid-template-columns: 1fr 1fr; }
}

/* Tablet y celular: el perfil pasa arriba y deja de ser fijo */
@media (max-width: 1000px) {
  .layout { grid-template-columns: 1fr; }
  .side { position: static; height: auto; overflow: visible; padding: 28px var(--gutter) 32px; }
  .side nav { display: none; }
  .side-foot { margin-top: 0; }
}

/* Pantallas de poca altura: el perfil entra completo sin cortarse */
@media (min-width: 1001px) and (max-height: 860px) {
  .side { gap: 14px; padding-block: 24px; }
  .avatar { width: 92px; }
  .side h1 { font-size: clamp(32px, 3vw, 46px); }
  .lead { font-size: 18px; }
  .bio { font-size: 15px; line-height: 1.5; }
  .side nav a { padding: 3px 0; }
}

/* Foto protagonista en la columna izquierda */
.hero-photo { position: relative; margin: 0; flex: none; height: clamp(260px, 46vh, 520px); border-radius: 24px; overflow: hidden; background: linear-gradient(155deg, #8E6BFF, #3A1C78); box-shadow: 0 30px 70px -30px rgba(124,77,255,.8); }
.hero-photo::before { content: "AP"; position: absolute; inset: 0; display: grid; place-items: center; font: 800 96px var(--display); color: rgba(255,255,255,.2); }
.hero-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 60% 42%; z-index: 1; }
.hero-photo::after { content: ""; position: absolute; inset: 0; z-index: 2; background: linear-gradient(to top, rgba(20,9,38,.92) 0%, rgba(20,9,38,.35) 38%, transparent 60%); }
.hero-photo .status { position: absolute; z-index: 3; top: 14px; left: 14px; background: rgba(30,16,53,.55); backdrop-filter: blur(6px); }
.hero-photo figcaption { position: absolute; z-index: 3; left: 22px; right: 22px; bottom: 18px; }
.hero-photo .hello { margin: 0 0 2px; }
.hero-photo h1 { color: #fff; font-size: clamp(34px, 3.2vw, 52px); line-height: 1; }
.side { gap: 20px; }
.intro { margin: 0 0 22px; font-size: clamp(17px, 1.25vw, 20px); color: var(--muted); max-width: 48em; }
@media (min-width: 1001px) and (max-height: 860px) { .hero-photo { height: 38vh; } .hero-photo h1 { font-size: 36px; } }
@media (max-width: 1000px) { .hero-photo { height: min(110vw, 440px); } }

/* La foto se muestra completa en su formato original (3:4), sin recortes */
.hero-photo { height: auto; aspect-ratio: 3 / 4; width: min(100%, calc(56vh * 3 / 4)); }
.hero-photo img { object-position: center; }
@media (min-width: 1001px) and (max-height: 860px) { .hero-photo { height: auto; width: min(100%, calc(50vh * 3 / 4)); } }
@media (max-width: 1000px) { .hero-photo { height: auto; width: min(100%, 440px); } }
.hero-photo { container-type: inline-size; }
.hero-photo h1, .hero-photo h1 { font-size: 12cqi; white-space: nowrap; }

/* Columna simétrica: mide lo mismo que la foto más el mismo margen a cada lado */
:root { --photo-w: clamp(260px, calc(58vh * 3 / 4), 440px); --side-pad: clamp(24px, 2.2vw, 40px); }
@media (min-width: 1001px) and (max-height: 860px) { :root { --photo-w: clamp(250px, calc(52vh * 3 / 4), 440px); } }
@media (min-width: 1001px) {
  .layout { grid-template-columns: calc(var(--photo-w) + 2 * var(--side-pad)) 1fr; }
  .side { padding-inline: var(--side-pad); }
  .hero-photo, .hero-photo[class] { width: 100%; }
}
@media (min-width: 1001px) and (max-height: 860px) {
  .side { gap: 12px; padding-block: 20px; }
  .lead { font-size: 16px; }
  .side nav a { padding: 2px 0; }
  .side .btn { padding: 10px 15px; font-size: 14px; }
  .side-foot { gap: 10px; }
}
