/* lzkn.dev: portfolio de Juan Pablo Lezcano. Minimalista, con aire de macOS. */

/* Onest (OFL), incluida en el sitio: sin Google Fonts. */
@font-face {
  font-family: "Onest"; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url("fuentes/onest-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: "Onest"; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url("fuentes/onest-latin-ext-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0100-02AF,U+0304,U+0308,U+0329,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}

:root {
  --fondo: #f5f5f7;
  --superficie: #ffffff;
  --texto: #1d1d1f;
  --suave: #6e6e73;
  --acento: #0066cc;
  --acento-texto: #ffffff;
  --linea: rgba(0, 0, 0, 0.09);
  --vidrio: rgba(245, 245, 247, 0.72);
  --sombra: 0 1px 2px rgba(0, 0, 0, 0.04), 0 12px 40px rgba(0, 0, 0, 0.10);
  --radio-ventana: 12px;
  --ancho: 1100px;
  --medida: 62ch;
  --fuente: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}

/* Modo oscuro: solo si la persona lo elige con el botón de la barra (js/tema.js). */
:root[data-tema="oscuro"] {
  --fondo: #000000;
  --superficie: #1c1c1e;
  --texto: #f5f5f7;
  --suave: #a1a1a6;
  --acento: #2997ff;
  --acento-texto: #000000;
  --linea: rgba(255, 255, 255, 0.12);
  --vidrio: rgba(22, 22, 23, 0.72);
  --sombra: 0 1px 2px rgba(0, 0, 0, 0.4), 0 16px 48px rgba(0, 0, 0, 0.55);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-padding-top: 5rem; }

body {
  margin: 0;
  background: var(--fondo);
  color: var(--texto);
  font-family: var(--fuente);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a { color: var(--acento); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 0.2em; }

:focus-visible { outline: 2px solid var(--acento); outline-offset: 3px; border-radius: 6px; }

.saltar {
  position: absolute; left: 1rem; top: -4rem; z-index: 20;
  background: var(--superficie); color: var(--texto); padding: 0.6rem 1rem; border-radius: 8px;
}
.saltar:focus { top: 1rem; }

.contenedor { width: min(100% - 2.5rem, var(--ancho)); margin-inline: auto; }

/* ---------- Barra ---------- */

.barra {
  position: sticky; top: 0; z-index: 10;
  background: var(--vidrio);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--linea);
}
.barra .contenedor { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 3.25rem; }
.marca { display: inline-flex; align-items: center; min-height: 44px; color: var(--texto); font-weight: 600; font-size: 1rem; letter-spacing: -0.02em; }
.marca:hover { text-decoration: none; }
.barra nav { display: flex; align-items: center; gap: 0.25rem; }
.barra nav a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 0.7rem;
  color: var(--texto); font-size: 0.875rem; opacity: 0.8;
}
.barra nav a:hover { opacity: 1; text-decoration: none; }
.barra nav .idioma { opacity: 1; color: var(--acento); }
@media (max-width: 640px) {
  .barra nav a:not(.idioma) { display: none; }
}

/* Botón de tema: luna en claro, sol en oscuro. Sin JS queda oculto (atributo hidden). */
.tema {
  display: inline-grid; place-items: center; width: 44px; height: 44px; padding: 0;
  border: 0; border-radius: 50%; background: transparent; color: var(--texto);
  cursor: pointer; opacity: 0.8;
}
.tema[hidden] { display: none; }
@media (hover: hover) { .tema:hover { opacity: 1; background: var(--linea); } }
.tema svg { width: 18px; height: 18px; }
.tema .sol { display: none; }
:root[data-tema="oscuro"] .tema .sol { display: block; }
:root[data-tema="oscuro"] .tema .luna { display: none; }
@media (prefers-reduced-motion: no-preference) {
  body, .barra { transition: background-color 0.3s ease, color 0.3s ease; }
  .tema svg { transition: transform 0.4s ease; }
  .tema:active svg { transform: rotate(-30deg) scale(0.9); }
}

/* ---------- Tipografía ---------- */

h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.025em; line-height: 1.08; }
h1 { font-size: clamp(2.6rem, 7.2vw, 5.4rem); letter-spacing: -0.04em; max-width: 14ch; }
h2 { font-size: clamp(1.9rem, 4.4vw, 3.2rem); max-width: 18ch; }
h3 { font-size: 1.25rem; letter-spacing: -0.015em; line-height: 1.3; }
p { margin: 0; max-width: var(--medida); }
.bajada { font-size: clamp(1.125rem, 2vw, 1.375rem); line-height: 1.5; color: var(--suave); }

section { padding-block: clamp(5rem, 11vw, 9rem); }
section + section { border-top: 1px solid var(--linea); }

/* ---------- Inicio ---------- */

.inicio { padding-top: clamp(4.5rem, 12vw, 10rem); border-top: 0; }
.inicio .rol { color: var(--suave); font-size: 1rem; margin-bottom: 1.25rem; }
.inicio h1 { margin-bottom: 1.75rem; }
.inicio .bajada { margin-bottom: 2.5rem; }
.acciones { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.5rem; }

.boton {
  display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 1.4rem;
  border-radius: 999px; background: var(--acento); color: var(--acento-texto); font-weight: 500;
  transition: transform 160ms ease, filter 160ms ease;
}
.boton:hover { text-decoration: none; filter: brightness(1.08); }
.boton:active { transform: scale(0.97); }
.enlace { display: inline-flex; align-items: center; min-height: 48px; font-weight: 500; }

/* Entrada del inicio: de desenfocado a nítido, como una ventana que se abre. Un solo momento. */
@media (prefers-reduced-motion: no-preference) {
  .aparece {
    animation: enfocar 900ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
    animation-delay: calc(var(--orden, 0) * 90ms + 80ms);
  }
  @keyframes enfocar {
    from { opacity: 0; filter: blur(10px); transform: translateY(10px); }
    to { opacity: 1; filter: blur(0); transform: none; }
  }
}
/* El título del inicio aparece palabra por palabra, cada una de desenfocada a nítida. */
.titulo-inicio .palabra { display: inline-block; }
@media (prefers-reduced-motion: no-preference) {
  .titulo-inicio .palabra { animation: enfocar 800ms cubic-bezier(0.2, 0.7, 0.2, 1) both; animation-delay: calc(var(--p, 0) * 70ms + 150ms); }
  .titulo-inicio .palabra:nth-child(1) { --p: 0; } .titulo-inicio .palabra:nth-child(2) { --p: 1; }
  .titulo-inicio .palabra:nth-child(3) { --p: 2; } .titulo-inicio .palabra:nth-child(4) { --p: 3; }
  .titulo-inicio .palabra:nth-child(5) { --p: 4; } .titulo-inicio .palabra:nth-child(6) { --p: 5; }
  .titulo-inicio .palabra:nth-child(7) { --p: 6; } .titulo-inicio .palabra:nth-child(8) { --p: 7; }
  .titulo-inicio .palabra:nth-child(9) { --p: 8; } .titulo-inicio .palabra:nth-child(10) { --p: 9; }
  /* Lo que sigue al título entra cuando termina. */
  .inicio .bajada.aparece { animation-delay: 750ms; }
  .inicio .acciones.aparece { animation-delay: 850ms; }

  /* Títulos de sección: aparecen al entrar en pantalla (sitio.js les pone y les saca .revelar). */
  h2.revelar { opacity: 0; filter: blur(8px); transform: translateY(14px); }
  h2 { transition: opacity 700ms ease, filter 700ms ease, transform 700ms cubic-bezier(0.2, 0.7, 0.2, 1); }
}
.aparece:nth-child(1) { --orden: 0; }
.aparece:nth-child(2) { --orden: 1; }
.aparece:nth-child(3) { --orden: 2; }
.aparece:nth-child(4) { --orden: 3; }

/* ---------- Qué hago ---------- */

.encabezado { display: grid; gap: 1rem; margin-bottom: clamp(2.5rem, 6vw, 4rem); }
.servicios { display: grid; gap: 2.5rem 3rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); margin: 0; padding: 0; list-style: none; }
.servicios h3 { margin-bottom: 0.5rem; }
.servicios p { color: var(--suave); }

/* ---------- Proyecto ---------- */

.proyecto .encabezado p { color: var(--suave); }
.escena { position: relative; margin-bottom: clamp(3rem, 7vw, 5rem); }

.ventana {
  margin: 0;
  background: var(--superficie); border-radius: var(--radio-ventana); overflow: hidden;
  box-shadow: var(--sombra); border: 1px solid var(--linea);
}
.ventana .titulo {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 1rem;
  height: 2.25rem; padding: 0 0.9rem; border-bottom: 1px solid var(--linea);
  font-size: 0.8125rem; color: var(--suave);
}
.ventana .titulo span:nth-child(2) { text-align: center; }
.semaforo { display: flex; gap: 0.45rem; }
.semaforo i { width: 0.75rem; height: 0.75rem; border-radius: 50%; display: block; }
.semaforo i:nth-child(1) { background: #ff5f57; }
.semaforo i:nth-child(2) { background: #febc2e; }
.semaforo i:nth-child(3) { background: #28c840; }
.ventana .titulo::after { content: ""; width: 3.15rem; }

.celus { display: flex; gap: 1rem; justify-content: center; margin-top: 1.5rem; }
.celu {
  width: min(44%, 13.5rem); border-radius: 2rem; padding: 0.22rem; background: #111113;
  box-shadow: var(--sombra);
}
.celu img { border-radius: 1.8rem; }

@media (min-width: 900px) {
  .escena { padding-right: 9rem; padding-bottom: 4rem; }
  .celus { position: absolute; right: 0; bottom: 0; margin: 0; gap: 1.25rem; }
  .celu { width: 12.5rem; }
  .celu:first-child { transform: translateY(-3.5rem); }
}

/* Al bajar, la ventana se acomoda (escala de 0.94 a 1, sin tocar la opacidad para no bajar el contraste). Solo donde el navegador lo soporta y sin pedido de menos movimiento. */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .escena .ventana {
      animation: acomodar linear both;
      animation-timeline: view();
      animation-range: entry 0% cover 40%;
    }
    @keyframes acomodar {
      from { transform: scale(0.94); }
      to { transform: scale(1); }
    }
  }
}

/* Video del proyecto: nunca arranca solo (sin autoplay), sin sonido y sin descargar nada hasta que lo den play. */
.video { margin: 0 0 clamp(3rem, 7vw, 5rem); }
.video video {
  display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; object-position: center top;
  background: var(--superficie); border-radius: var(--radio-ventana);
  border: 1px solid var(--linea); box-shadow: var(--sombra);
}
.video figcaption { margin-top: 0.85rem; color: var(--suave); font-size: 0.9375rem; max-width: var(--medida); }

/* Segundo proyecto: separado del anterior; una ventana grande y dos chicas abajo. */
.proyecto-siguiente { margin-top: clamp(5rem, 11vw, 8rem); padding-top: clamp(3rem, 6vw, 4rem); border-top: 1px solid var(--linea); }
.ventanas { display: grid; gap: 1.25rem; margin-top: 1.25rem; }
@media (min-width: 760px) { .ventanas { grid-template-columns: 1fr 1fr; gap: 1.5rem; margin-top: 1.5rem; } }
@media (min-width: 900px) { .escena.escena-ferre { padding-right: 0; padding-bottom: 0; } }

.detalle { display: grid; gap: 3rem; }
@media (min-width: 900px) { .detalle { grid-template-columns: 1fr 1fr; gap: 3rem 5rem; } }
.detalle h3 { margin-bottom: 0.75rem; }
.detalle p, .detalle ul:not(.fichas) li { color: var(--suave); }
.detalle ul:not(.fichas) { margin: 0; padding-left: 1.15rem; display: grid; gap: 0.45rem; max-width: var(--medida); }
.detalle li::marker { color: var(--texto); }

.fichas { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0; padding: 0; list-style: none; }
.fichas li {
  padding: 0.3rem 0.75rem; border-radius: 999px; font-size: 0.875rem; color: var(--texto);
  background: var(--superficie); border: 1px solid var(--linea);
}
.datos { display: grid; gap: 1rem; margin: 0; }
.datos div { display: grid; gap: 0.2rem; }
.datos dt { font-weight: 500; }
.datos dd { margin: 0; color: var(--suave); max-width: var(--medida); }

.separado { margin-top: 2rem; }
.separado-chico { margin-top: 1rem; }

/* ---------- Cómo trabajo ---------- */

.pasos { counter-reset: paso; display: grid; gap: 2.5rem 3rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr)); margin: 0; padding: 0; list-style: none; }
.pasos li { counter-increment: paso; }
.pasos li::before {
  content: counter(paso); display: inline-flex; align-items: center; justify-content: center;
  width: 2rem; height: 2rem; border-radius: 50%; margin-bottom: 1rem;
  border: 1px solid var(--linea); background: var(--superficie); font-size: 0.875rem; font-weight: 600;
}
.pasos h3 { margin-bottom: 0.4rem; }
.pasos p { color: var(--suave); }

/* ---------- Experiencia ---------- */

.stack { display: grid; gap: 1.75rem 3rem; margin: 0 0 2.5rem; }
@media (min-width: 760px) { .stack { grid-template-columns: repeat(2, 1fr); } }
.stack dt { font-weight: 500; margin-bottom: 0.6rem; }
.stack dd { margin: 0; }

/* ---------- Sobre mí y contacto ---------- */

.sobre p + p { margin-top: 1rem; }
.sobre p { font-size: clamp(1.125rem, 2vw, 1.3rem); line-height: 1.55; }

.contacto { text-align: left; }
.contacto .mail {
  display: inline-block; margin: 1.75rem 0 2rem; font-size: clamp(1.6rem, 5vw, 3rem);
  font-weight: 600; letter-spacing: -0.03em; overflow-wrap: anywhere;
}
.redes { display: flex; flex-wrap: wrap; gap: 0.5rem 1.75rem; }
.redes a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 500; }

.pie { border-top: 1px solid var(--linea); padding-block: 2rem; color: var(--suave); font-size: 0.875rem; }
.pie .contenedor { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; }
.pie a { display: inline-flex; align-items: center; min-height: 44px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
