/* Estilos propios de la home del portfolio. Se cargan después de styles.css. */

@keyframes caretBlink { 0%, 45% { opacity: 1; } 55%, 100% { opacity: 0; } }
@keyframes skyShift { 0% { background-position: 0% 0%; } 100% { background-position: 100% 40%; } }
@keyframes cloudDrift { 0% { transform: translate3d(-5%, 0, 0); } 100% { transform: translate3d(5%, -2%, 0); } }
@keyframes cloudDrift2 { 0% { transform: translate3d(4%, 1%, 0); } 100% { transform: translate3d(-6%, -1%, 0); } }

@media (min-width: 900px) {
  .col-1-5 { grid-column: 1 / 5; }
  .col-1-6 { grid-column: 1 / 6; }
  .col-1-7 { grid-column: 1 / 7; }
  .col-1-10 { grid-column: 1 / 10; }
  .col-5-8 { grid-column: 5 / 8; }
  .col-6-13 { grid-column: 6 / 13; }
  .col-7-13 { grid-column: 7 / 13; }
  .col-8-11 { grid-column: 8 / 11; }
  .col-11-13 { grid-column: 11 / 13; }
}
/* Elementos decorativos que solo existen en desktop */
@media (max-width: 899.98px) { .wide-only { display: none !important; } }

.section { padding: clamp(64px, 9vw, 128px) 0; }
.section-head { row-gap: 24px; align-items: end; margin-bottom: 40px; }
.section-body { display: flex; flex-direction: column; gap: 40px; }
@media (min-width: 900px) {
  .section-head { margin-bottom: 64px; }
  .section-body { gap: 64px; }
}

/* ---------- Navbar de la home ---------- */

.nav__links { display: none; gap: 32px; font-size: 15px; font-weight: 500; }
.nav__links a { display: flex; gap: 4px; text-decoration: none; }
.nav__links sup { font-family: var(--font-label); font-size: 10px; font-weight: 600; font-variant-numeric: tabular-nums; }
.nav--home .btn--sm { padding: 0 18px; }
@media (min-width: 900px) {
  .nav__links { display: flex; }
  .nav--home .btn--sm { padding: 0 24px; }
}

/* ---------- Cielo animado (hero, habilidades, CTA) ---------- */

.sky {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 100vw;
  transform: translateX(-50%);
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  /* Se funde con el papel arriba y abajo */
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 20%, #000 80%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 20%, #000 80%, transparent 100%);
}
.sky--hero {
  /* En el hero el cielo arranca completo arriba y solo se desvanece abajo */
  -webkit-mask-image: linear-gradient(to bottom, #000 0, #000 80%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0, #000 80%, transparent 100%);
  background: linear-gradient(180deg, #BCDCF2 0%, #CFE6F6 30%, #E2EFF7 62%, #F0F3F1 86%, #F7F5F0 100%);
}
.sky--skills { background: linear-gradient(180deg, #F7F5F0 0%, #D3E6F3 16%, #C4E0F4 45%, #DCEBF5 78%, #F7F5F0 100%); }
.sky--cta { background: linear-gradient(180deg, #F7F5F0 0%, #D3E6F3 24%, #C4E0F4 52%, #DCEBF5 80%, #F7F5F0 100%); }
.sky__light {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(55% 45% at 25% 30%, rgba(165, 208, 238, .55), transparent 70%),
    radial-gradient(45% 40% at 80% 18%, rgba(150, 200, 236, .45), transparent 70%),
    radial-gradient(60% 50% at 60% 70%, rgba(220, 236, 248, .6), transparent 70%);
  background-size: 160% 160%;
  animation: skyShift 38s ease-in-out infinite alternate;
}
.sky__clouds {
  position: absolute;
  inset: -10%;
  background-image:
    radial-gradient(22% 10% at 18% 26%, rgba(255, 255, 255, .75), transparent 72%),
    radial-gradient(16% 8% at 30% 22%, rgba(255, 255, 255, .6), transparent 72%),
    radial-gradient(26% 11% at 72% 38%, rgba(255, 255, 255, .55), transparent 72%);
  filter: blur(18px);
  animation: cloudDrift 46s ease-in-out infinite alternate;
}
.sky__clouds--far {
  background-image:
    radial-gradient(20% 9% at 55% 14%, rgba(255, 255, 255, .5), transparent 72%),
    radial-gradient(24% 10% at 88% 58%, rgba(255, 255, 255, .45), transparent 72%),
    radial-gradient(18% 8% at 40% 52%, rgba(255, 255, 255, .35), transparent 72%);
  filter: blur(24px);
  animation: cloudDrift2 60s ease-in-out infinite alternate;
}

/* ---------- Brillo que sigue al cursor (vía --mx / --my) ---------- */

.glow { position: relative; overflow: hidden; }
.glow::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(var(--glow-size, 420px) circle at var(--mx, -999px) var(--my, -999px), rgba(255, 255, 255, .6), transparent 65%);
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  width: 90%;
  margin: 0 auto;
  /* svh en el celu: alto fijo que no cambia cuando aparece o se va la barra del navegador */
  height: 100vh;
  height: 100svh;
  display: flex;
  flex-direction: column;
  gap: 2vh;
  padding: calc(76px + 1.6vh) 0 2.4vh;
  box-sizing: border-box;
  transform-origin: 50% 0;
}
/* En desktop con poco alto, el hero crece en vez de cortar contenido */
@media (min-width: 900px) { .hero { height: 100dvh; } }
@media (min-width: 900px) and (max-height: 699.98px) { .hero { height: auto; } }

.hero__photo {
  position: absolute;
  bottom: 0;
  right: 50%;
  transform: translateX(50%);
  z-index: 0;
  display: block;
  width: 124vw;
  /* En mobile la foto arranca justo debajo del párrafo: --photo-top lo mide portfolio.js */
  height: calc(100% - var(--photo-top, 420px));
  object-fit: contain;
  object-position: center bottom;
  pointer-events: none;
  user-select: none;
}
@media (min-width: 900px) {
  .hero__photo {
    right: 0;
    transform: none;
    width: min(48%, 820px);
    height: calc(100% - 72px);
    object-position: right bottom;
  }
}

.hero__grid {
  position: relative;
  z-index: 1;
  flex: 1;
  min-height: 0;
  /* Mobile: titular arriba, párrafo y botones ocupan el resto. Desktop: titular centrado, párrafo abajo */
  grid-template-rows: auto 1fr;
  row-gap: 20px;
  padding-top: 0;
  box-sizing: border-box;
}
.hero__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: min(clamp(44px, 7.2vw, 120px), 10.5vh);
  letter-spacing: -.04em;
  line-height: .94;
  text-wrap: balance;
  position: relative;
  z-index: 1;
}
.hero__title .accent { letter-spacing: -.02em; }
/* Eyebrow + titular: bloque único, arriba en mobile y centrado en desktop */
.hero__head { display: flex; flex-direction: column; gap: 12px; align-self: start; position: relative; z-index: 1; }
/* En mobile el eyebrow va en dos líneas a propósito (título arriba, rol abajo), sin el punto */
.hero__eyebrow { display: flex; flex-direction: column; gap: 2px; }
.hero__eyebrow-sep { display: none; }
/* Titular un poco más chico en mobile: entra en tres líneas y le deja lugar a la foto */
.hero__title { font-size: clamp(34px, 9.6vw, 44px); }
.hero__intro {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-self: stretch;
  justify-content: space-between;
  gap: 16px;
}
.hero__lead { margin: 0; font-size: 15px; line-height: 1.45; color: var(--ink-2); max-width: 44ch; text-wrap: pretty; }
@media (min-width: 900px) {
  .hero { padding-top: calc(96px + 1vh); }
  .hero__grid { row-gap: 3vh; padding-top: 2vh; }
  .hero__grid { grid-template-rows: 1fr auto; }
  .hero__head { align-self: center; gap: 2.4vh; }
  .hero__eyebrow { display: block; }
  .hero__eyebrow-sep { display: inline; }
  .hero__title { font-size: min(clamp(44px, 7.2vw, 120px), 10.5vh); }
  .hero__intro { align-self: auto; justify-content: flex-start; gap: 3vh; padding-bottom: 4vh; }
  .hero__lead { font-size: 19px; }
}
.btn--glass {
  background: rgba(255, 255, 255, .6);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  backdrop-filter: blur(18px) saturate(180%);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .btn--glass { background: var(--paper); }
}

/* Carrusel de marcas */
.marquee {
  position: relative;
  z-index: 1;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 10%, #000 90%, transparent);
  mask-image: linear-gradient(to right, transparent, #000 10%, #000 90%, transparent);
}
.marquee__track { display: flex; gap: 12px; width: max-content; will-change: transform; }
.marquee__set { display: flex; gap: 12px; }
.brand {
  flex: none;
  display: flex;
  align-items: center;
  gap: 12px;
  /* Más bajas que los botones (52px): las marcas acompañan, la acción manda */
  height: 40px;
  padding: 0 20px 0 6px;
  border-radius: 100px;
  background: var(--paper-2);
  border: 1px solid var(--hairline);
  white-space: nowrap;
}
.brand__name { font-family: var(--font-display); font-weight: 700; font-size: 18px; letter-spacing: -.02em; }
/* Marcas con logo: solo el logo, que ya incluye el nombre */
.brand--logo { padding: 0 20px; --logo-h: 18px; }
.brand--logo .logo--stacked { --logo-h: 28px; }
/* Logos que son solo letras llenan todo el alto: un poco más bajos para pesar igual que los que tienen ícono */
.brand--logo .logo--dense { --logo-h: 14px; }
/* Sin movimiento: una sola copia de las marcas, en filas centradas */
@media (prefers-reduced-motion: reduce) {
  .marquee__track { flex-wrap: wrap; justify-content: center; width: auto; }
  .marquee__set { flex-wrap: wrap; justify-content: center; }
  .marquee__set[aria-hidden="true"] { display: none; }
}

/* ---------- Cuentas (stacking) ---------- */

/* En mobile, una pausa entre tarjetas: la actual queda fija y entera (con su CTA) antes de que llegue la siguiente */
.stack-item { position: sticky; top: 96px; margin-bottom: 32svh; }
.stack-item:last-child { margin-bottom: 24px; }
.account { will-change: transform, opacity; }
@media (min-width: 900px) { .stack-item, .stack-item:last-child { margin-bottom: 48px; } }
@media (prefers-reduced-motion: reduce) { .stack-item { position: relative; top: auto !important; } }

.account {
  transform-origin: 50% 0;
  background: var(--paper-2);
  border: 1px solid var(--hairline);
  border-radius: 24px;
  padding: clamp(24px, 4vw, 48px);
  row-gap: 20px;
}
@media (min-width: 900px) { .account { row-gap: 32px; } }
.account__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.account__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.account__meta > :first-child { color: var(--ink); }
.account__name {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(30px, 3.2vw, 46px);
  letter-spacing: -.034em;
  line-height: 1;
}
.account__desc { align-self: end; max-width: 52ch; }

/* Índice de posición (barritas) */
.pos { display: flex; gap: 4px; }
.pos span { width: 24px; height: 4px; border-radius: 2px; background: var(--hairline); }
.pos span.is-current { background: var(--lime); box-shadow: inset 0 0 0 1px rgba(14, 14, 12, .35); }

.spec { margin: 0; display: flex; flex-direction: column; border-top: 1px solid var(--hairline); }
.spec > div { display: grid; grid-template-columns: 96px 1fr; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--hairline); }
.spec dt { padding-top: 4px; }
.spec dd { margin: 0; font-size: 16px; font-weight: 500; }

.account__metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
  border-top: 1px solid var(--hairline);
}
.account__metrics > div { display: flex; flex-direction: column; gap: 12px; padding: 16px 16px 24px 0; border-bottom: 1px solid var(--hairline); container-type: inline-size; }
.account__value {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(20px, 16cqi, 34px);
  letter-spacing: -.034em;
  line-height: 1;
}
.account__label { font-size: 14px; color: var(--ink-2); }
.btn__arrow--lime { background: var(--lime); }

/* ---------- Método ---------- */

.method { align-items: start; row-gap: 40px; }
.method__intro { display: flex; flex-direction: column; gap: 24px; }
.method__intro .lead { max-width: 40ch; }
@media (min-width: 900px) {
  .method { row-gap: 64px; }
  .method__intro { position: sticky; top: 120px; }
}
.method__index { list-style: none; margin: 24px 0 0; padding: 0; flex-direction: column; border-top: 1px solid var(--hairline); }
@media (min-width: 900px) { .method__index { display: flex; } }
.method__index li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--hairline);
  font-size: 16px;
  font-weight: 600;
  color: var(--ink-2);
}
.method__index li.is-active { color: var(--ink); }
.method__bar { height: 2px; width: 0; background: var(--ink); transition: width 300ms var(--ease); }
.method__index li.is-active .method__bar { width: 24px; }

.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.step {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 24px 16px;
  margin: 0 -16px 8px;
  border-radius: 20px;
  border: 1px solid transparent;
  background: transparent;
  opacity: .55;
  transform-origin: 50% 50%;
  transition: background 400ms var(--ease), transform 400ms var(--ease), box-shadow 400ms var(--ease), opacity 400ms var(--ease), border-color 400ms var(--ease);
}
.step.is-active { background: var(--paper-2); border-color: var(--hairline); box-shadow: 0 16px 40px rgba(14, 14, 12, .08); opacity: 1; }
@media (min-width: 900px) {
  .step { padding: 48px 32px; margin: 0 -32px 8px; border-radius: 24px; }
  .step.is-active { transform: scale(1.03); }
}
@media (prefers-reduced-motion: reduce) { .step.is-active { transform: none; } }
.step__top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.step__top .label { padding-top: 8px; }
.step__num {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(32px, 3.6vw, 52px);
  letter-spacing: -.04em;
  line-height: .85;
}
.step .body { max-width: 56ch; }

/* ---------- Lo que sé hacer ---------- */

.skills-section { position: relative; overflow: hidden; }
.skills-section > .container { position: relative; z-index: 1; }
.skills-section .lead { max-width: 56ch; }
.skills { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 24px; }
.skill {
  --glow-size: 360px;
  display: flex;
  flex-direction: column;
  gap: 32px;
  padding: 32px;
  border-radius: 24px;
  background: rgba(255, 255, 255, .42);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  backdrop-filter: blur(18px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, .8);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .9) inset, 0 12px 32px rgba(14, 14, 12, .08);
  transition: transform 300ms var(--ease);
}
.skill:hover { transform: translateY(-3px); }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .skill { background: var(--paper); }
}
.skill__head { display: flex; flex-direction: column; gap: 16px; }
.skill__items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; font-size: 16px; line-height: 1.4; flex: 1; }
.skill__items li { display: flex; gap: 12px; }
.skill__items li::before { content: "✓"; content: "✓" / ""; }
.skill__tools { display: flex; flex-direction: column; gap: 12px; border-top: 1px solid var(--hairline); padding-top: 24px; }
.skill__tools .chip { padding: 8px 12px; }

/* ---------- Experiencia (acordeón) ---------- */

.jobs { border-bottom: 1px solid var(--hairline); }
.job { border-top: 1px solid var(--hairline); }
.job summary { list-style: none; cursor: pointer; }
.job summary::-webkit-details-marker { display: none; }
.job__summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  column-gap: 16px;
  row-gap: 12px;
  align-items: center;
  padding: 24px 0;
}
.job__when { grid-column: 1 / 2; display: flex; flex-direction: column; gap: 4px; font-variant-numeric: tabular-nums; }
.job__date { font-size: 16px; font-weight: 600; color: var(--ink); }
.job__dur { font-size: 14px; color: var(--ink-2); }
.job__what { grid-column: 1 / 2; display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.job__co { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.job__chip {
  padding: 6px 12px;
  border-radius: 100px;
  border: 1px solid var(--hairline);
  background: var(--paper-2);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  flex: none;
}
.job__sector { font-size: 14px; color: var(--ink-2); }

/* Desktop: botón "Ver más" con un + que rota 45° */
.job__more {
  display: none;
  grid-column: 10 / 13;
  justify-self: end;
  white-space: nowrap;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 8px 0 20px;
  border-radius: 100px;
  border: 1.5px solid var(--ink);
  font-weight: 600;
  font-size: 14px;
  box-sizing: border-box;
  transition: background 300ms var(--ease), color 300ms var(--ease), transform 300ms var(--ease);
}
.job__more:hover { background: var(--ink); color: var(--paper); transform: translateY(-2px); }
.job__plus { display: grid; place-items: center; width: 28px; height: 28px; font-size: 22px; line-height: 1; transition: transform 300ms var(--ease); }
.job.is-open .job__plus { transform: rotate(45deg); }

/* Mobile: chevron en un círculo a la derecha */
.job__chev {
  display: grid;
  grid-column: 2 / 3;
  grid-row: 1 / 3;
  align-self: start;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1.5px solid var(--ink);
  box-sizing: border-box;
  place-items: center;
}
.job__chev span {
  display: block;
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  margin-top: -4px;
  transform: rotate(45deg);
  transition: transform 400ms var(--ease), margin 400ms var(--ease);
}
.job.is-open .job__chev span { margin-top: 4px; transform: rotate(-135deg); }

@media (min-width: 900px) {
  .job__summary { grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; padding: 32px 0; }
  .job__when { grid-column: 1 / 4; }
  .job__what { grid-column: 4 / 10; }
  .job__more { display: inline-flex; }
  .job__chev { display: none; }
}

.job__body { overflow: hidden; }
.job__content { row-gap: 24px; padding-bottom: 32px; }
@media (min-width: 900px) { .job__content { padding-bottom: 48px; } }
.job__place { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.job__place-label { font-size: 14px; color: var(--ink-2); }
.job__place-value { font-size: 16px; font-weight: 500; }

/* ---------- CTA final ---------- */

.cta {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  padding: clamp(80px, 12vw, 192px) 0;
  box-sizing: border-box;
}
@media (min-width: 900px) { .cta { min-height: 100dvh; } }
.cta__inner { position: relative; z-index: 1; display: flex; flex-direction: column; gap: clamp(40px, 5vw, 72px); align-items: flex-start; }
.cta__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(52px, 9.2vw, 160px);
  letter-spacing: -.05em;
  line-height: .9;
  max-width: 12ch;
}
.cta__title .accent { letter-spacing: -.02em; }
.cta__row {
  display: flex;
  flex-wrap: wrap;
  gap: 32px 64px;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  border-top: 1px solid var(--hairline);
  padding-top: clamp(32px, 4vw, 48px);
}
.cta__row .lead { max-width: 44ch; }
.btn--xl {
  gap: 20px;
  height: clamp(72px, 7vw, 96px);
  padding: 0 10px 0 clamp(28px, 3vw, 40px);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(22px, 2.2vw, 32px);
  letter-spacing: -.02em;
}
.btn--xl:hover { transform: translateY(-3px); box-shadow: 0 18px 40px rgba(14, 14, 12, .25); }
.btn--xl .btn__arrow { width: clamp(52px, 5vw, 76px); height: clamp(52px, 5vw, 76px); font-size: clamp(22px, 2.2vw, 32px); }

/* Efecto de tipeo: cada letra entra con fundido, sube apenas y pasa de desenfocada a nítida */
.tw-word { display: inline-block; white-space: nowrap; }
.tw-char {
  display: inline-block;
  opacity: 0;
  transform: translateY(.12em);
  filter: blur(6px);
  transition: opacity 420ms var(--ease), transform 520ms var(--ease), filter 420ms var(--ease);
}
.tw-char.is-on { opacity: 1; transform: none; filter: none; }
.tw-caret {
  display: inline-block;
  width: .06em;
  height: .82em;
  margin: 0 -.06em 0 .02em;
  background: var(--ink);
  vertical-align: -.04em;
}
.tw-caret.is-done { animation: caretBlink 1.1s steps(1) infinite; }

/* ---------- Footer de la home ---------- */

.site-footer--home .container { gap: 40px; }
@media (min-width: 900px) { .site-footer--home .container { gap: 64px; } }
.footer-cols { row-gap: 32px; }
.footer-col { display: flex; flex-direction: column; gap: 12px; }
.footer-col a { font-size: 16px; text-decoration: none; overflow-wrap: anywhere; }
.site-footer--home .site-footer__name { border-top: 1px solid var(--hairline); padding-top: 32px; }
.site-footer__legal { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }

/* El logo de la cuenta es el título de la tarjeta: ya incluye el nombre, que queda en el alt para lectores de pantalla */
.account__logo { --logo-h: clamp(32px, 3.2vw, 44px); align-self: center; }
.account__logo .logo--stacked { --logo-h: clamp(64px, 6vw, 88px); }
