/* ==========================================================
   ESTILOS.CSS  -  Matias Silvero | Portfolio
   Para encontrar una seccion, buscá "SECCION:" (Ctrl+F)
   ========================================================== */


/* ==========================================================
   VARIABLES: colores, tipografias y ancho maximo
   ========================================================== */
:root{
  --slate:#121212;
  --steel:#1E1E1E;
  --line:#3A3A3A;
  --amber:#E11D16;
  --red-bright:#FF4A3F;
  --amber-deep:#B3140F;
  --paper:#F5F5F5;
  --white:#FFFFFF;
  --ink:#141414;
  --muted:#555555;
  --mist:#A8A8A8;
  --display:"Archivo","Arial Narrow",Arial,sans-serif;
  --body:"Public Sans",system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;
  --wrap:1120px;
}


/* ==========================================================
   BASE: reset y estilos generales de la pagina
   ========================================================== */

*,*::before,*::after {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}
body {
  margin: 0;
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
img {
  max-width: 100%;
  display: block;
}
a {
  color: inherit;
}
h1,h2,h3 {
  font-family: var(--display);
  margin: 0;
  line-height: 1.05;
  letter-spacing: -.02em;
  font-stretch: 108%;
}
p {
  margin: 0;
}
ul,ol {
  margin: 0;
  padding: 0;
  list-style: none;
}
:focus-visible {
  outline: 3px solid var(--red-bright);
  outline-offset: 3px;
  border-radius: 2px;
}
.wrap {
  width: min(var(--wrap),100% - 2.5rem);
  margin-inline: auto;
}
.skip {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--amber);
  color: var(--white);
  padding: .6rem 1rem;
  z-index: 100;
}
.skip:focus {
  left: 1rem;
  top: 1rem;
}

/* ==========================================================
   ESTILOS GENERALES DE SECCIONES (titulos, fondos, espaciados)
   ========================================================== */

.section {
  padding: clamp(4.5rem,9vw,7.5rem) 0;
}
.section-dark {
  background: var(--steel);
  color: var(--white);
}
.section-head {
  max-width: 40rem;
  margin-bottom: 3rem;
}
.section h2 {
  font-weight: 800;
  font-size: clamp(2rem,4.6vw,3.4rem);
}
.section-head p {
  margin-top: 1rem;
  color: var(--muted);
  font-size: 1.1rem;
}
.section-dark .section-head p {
  color: var(--mist);
}


/* ==========================================================
   SECCION: HEADER (menu superior)
   ========================================================== */

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  color: var(--white);
  transition: background-color .3s ease,box-shadow .3s ease;
}
.site-header.is-solid {
  background: rgba(18,18,18,.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 1px 0 var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4.5rem;
}
.brand {
  display: inline-flex;
  align-items: center;
}
.brand img {
  display: block;
  height: 40px;
  width: auto;
}
.nav {
  display: flex;
  align-items: center;
  gap: 2rem;
}
.nav-list {
  display: flex;
  gap: 1.75rem;
}
.nav-list a {
  text-decoration: none;
  font-size: .95rem;
  font-weight: 500;
  padding: .35rem 0;
  border-bottom: 2px solid transparent;
  transition: border-color .2s;
}
.nav-list a:hover {
  border-color: var(--red-bright);
}
.menu-btn {
  display: none;
  background: none;
  border: 0;
  color: inherit;
  padding: .5rem;
  cursor: pointer;
}
.menu-btn svg {
  width: 28px;
  height: 28px;
}


/* ==========================================================
   BOTONES
   ========================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font: 600 .95rem var(--body);
  text-decoration: none;
  padding: .8rem 1.4rem;
  border-radius: 999px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: background-color .2s,color .2s,border-color .2s;
}
.btn-solid {
  background: var(--amber);
  color: var(--white);
}
.btn-solid:hover {
  background: #FF3B30;
}
.btn-line {
  border-color: var(--mist);
  color: var(--white);
}
.btn-line:hover {
  border-color: var(--red-bright);
  color: var(--red-bright);
}
.btn-sm {
  padding: .5rem 1.1rem;
  font-size: .88rem;
}


/* ==========================================================
   ICONOS SOCIALES
   ========================================================== */

.social {
  display: flex;
  gap: .75rem;
}
.social a {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  color: var(--white);
  transition: background-color .2s,color .2s,border-color .2s;
}
.social a:hover {
  background: var(--amber);
  border-color: var(--amber);
  color: var(--white);
}
.social svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}


/* ==========================================================
   SECCION: HERO (portada)
   ========================================================== */

.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  background: var(--slate);
  color: var(--white);
  padding: 7rem 0 5rem;
  overflow: hidden;
}
.hero-copy {
  position: relative;
  z-index: 2;
  max-width: 46rem;
}
.hero-name {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.15rem;
  color: var(--red-bright);
  margin-bottom: 1.25rem;
}
.hero h1 {
  font-weight: 850;
  font-size: clamp(2.9rem,8.2vw,6.4rem);
  line-height: .98;
}
.hero-lead {
  margin-top: 1.75rem;
  max-width: 34rem;
  font-size: 1.2rem;
  color: #DADADA;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .9rem;
  margin-top: 2.25rem;
}
.hero .social {
  margin-top: 2rem;
}
.hero-now {
  position: absolute;
  z-index: 2;
  left: 0;
  right: 0;
  bottom: 1.75rem;
  font-size: .95rem;
  color: var(--mist);
}
.hero-now strong {
  color: var(--white);
  font-weight: 600;
}
.trace {
  position: absolute;
  z-index: 1;
  right: 0;
  bottom: 0;
  width: min(78%,980px);
  height: auto;
  pointer-events: none;
}
.trace path {
  fill: none;
  stroke: var(--line);
  stroke-width: 2;
  stroke-linejoin: round;
}
.trace .live {
  stroke: var(--red-bright);
  stroke-width: 2.5;
}
.trace path {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: draw 2.6s cubic-bezier(.5,0,.2,1) .4s forwards;
}
.trace .live {
  animation-delay: .9s;
}
.trace circle {
  fill: var(--slate);
  stroke: var(--line);
  stroke-width: 2;
  opacity: 0;
  animation: pop .4s ease 2.2s forwards;
}
.trace .spark {
  fill: var(--red-bright);
  stroke: none;
  animation-delay: 3.1s;
}
@keyframes draw{to{stroke-dashoffset:0}}
@keyframes pop{to{opacity:1}}



/* ==========================================================
   SECCIÓN: PROYECTOS
   ========================================================== */

#proyectos .projects {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2rem 1.5rem;
}

#proyectos .project figure {
  margin: 0;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--steel);
  border-radius: 6px;
}

#proyectos .project img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Zoom solo en dispositivos con mouse y si se permiten animaciones. */
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  #proyectos .project img {
    transition: transform .5s ease;
  }

  #proyectos .project figure:hover img {
    transform: scale(1.04);
  }
}

#proyectos .project h3 {
  margin: 1rem 0 0;
  font-size: 1.35rem;
  font-weight: 750;
}

#proyectos .project p {
  margin: .5rem 0 0;
  max-width: 28rem;
  color: var(--muted);
}

/* Espacio reservado para las fotos de electricidad y soldadura. */
#proyectos .ph,
.gallery .ph {
  display: grid;
  place-items: center;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  padding: 1rem;
  color: var(--mist);
  font-size: .9rem;
  text-align: center;
}

@media (max-width: 700px) {
  #proyectos .projects {
    grid-template-columns: 1fr;
  }
}


/* ==========================================================
   SECCION: SOBRE MI
   ========================================================== */

.about-text p+p {
  margin-top: 1.1rem;
}
.about-text {
  max-width: 38rem;
}
.about-text .lead {
  font-size: 1.3rem;
  line-height: 1.5;
}
.stack {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: 2rem;
}
.stack li {
  font-size: .9rem;
  font-weight: 500;
  padding: .35rem .8rem;
  border-radius: 4px;
  background: var(--white);
  border: 1px solid #D2D2D2;
}

/* ==========================================================
   GALERÍA: Fuera de la pantalla
   ========================================================== */

.galeria-personal {
  padding-top: 2rem;
}

.galeria-personal .gallery-title {
  margin: 0;
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  font-weight: 800;
}

/* Cada foto conserva su proporción original. */
#galeria-personal {
  columns: 2;
  column-gap: 1rem;
  margin-top: 1.5rem;
}

#galeria-personal figure {
  position: relative;
  margin: 0 0 1rem;
  overflow: hidden;
  break-inside: avoid;
  border-radius: 6px;
  background: var(--steel);
}

#galeria-personal a {
  display: block;
  cursor: zoom-in;
}

#galeria-personal img {
  display: block;
  width: 100%;
  height: auto;
}

#galeria-personal figcaption {
  display: none;
  position: absolute;
  inset: auto 0 0;
  padding: 2rem 1rem .75rem;
  background: linear-gradient(transparent, rgba(0, 0, 0, .78));
  color: var(--white);
  font-size: .9rem;
  font-weight: 500;
  pointer-events: none;
}

#galeria-personal figure:focus-within {
  outline: 3px solid var(--red-bright);
  outline-offset: 3px;
}

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  #galeria-personal img {
    transition: transform .35s ease;
  }

  #galeria-personal a:hover img {
    transform: scale(1.025);
  }
}

@media (max-width: 600px) {
  #galeria-personal {
    columns: 1;
  }
}

/* ==========================================================
   LIGHTBOX: cuadro centrado sobre la página
   ========================================================== */

#lightbox-personal {
  position: fixed;
  inset: 0;
  z-index: 100;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 1rem;
  overflow: visible;
  border: 0;
  background: rgba(0, 0, 0, .76);
  color: var(--white);
}

/* Se centra únicamente cuando el visor está abierto. */
#lightbox-personal[open] {
  display: grid;
  place-items: center;
}

.lightbox-cuadro {
  box-sizing: border-box;
  width: min(100%, 760px);
  max-height: calc(100dvh - 2rem);
  overflow-y: auto;
  padding: clamp(.75rem, 2vw, 1.25rem);
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--steel);
  box-shadow: 0 20px 70px rgba(0, 0, 0, .45);
}

.lightbox-cuadro figure {
  margin: 0;
}

#lightbox-imagen {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 58dvh;
  margin-inline: auto;
  border-radius: 10px;
}

#lightbox-caption {
  margin-top: .75rem;
  text-align: center;
  font-size: .95rem;
}

.lightbox-controles {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: .4rem;
  margin-top: 1rem;
}

.lightbox-controles button {
  min-height: 44px;
  padding: .45rem clamp(.45rem, 2vw, 1rem);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--white);
  font: inherit;
  font-size: .9rem;
  cursor: pointer;
}

#lightbox-anterior {
  justify-self: start;
}

#lightbox-siguiente {
  justify-self: end;
}

#lightbox-cerrar {
  background: var(--white);
  color: var(--ink);
}

.lightbox-controles button:hover {
  border-color: var(--white);
}



/* ==========================================================
   SECCION: TITULOS
   ========================================================== */

.degrees {
  border-top: 1px solid var(--line);
}
.degree {
  display: grid;
  grid-template-columns: minmax(0,1.1fr) minmax(0,1fr) auto;
  gap: 1rem 2rem;
  align-items: baseline;
  padding: 1.6rem 0;
  border-bottom: 1px solid var(--line);
}
.degree h3 {
  font-weight: 750;
  font-size: clamp(1.3rem,2.4vw,1.8rem);
}
.degree p {
  color: var(--mist);
}
.badge {
  background: black;
  font-size: .85rem;
  font-weight: 600;
  padding: .3rem .8rem;
  border-radius: 999px;
  border: 1.5px solid var(--mist);
  color: green;
  white-space: nowrap;
}
.badge.on {
  background: var(--amber);
  border-color: var(--amber);
  color: var(--white);
}


/* ==========================================================
   SECCION: EXPERIENCIA
   ========================================================== */

.timeline {
  position: relative;
  max-width: 46rem;
  margin-left: .5rem;
  border-left: 2px solid var(--ink);
  padding-left: 2rem;
}
.job {
  position: relative;
  padding-bottom: 3rem;
}
.job:last-child {
  padding-bottom: 0;
}
.job::before {
  content: "";
  position: absolute;
  left: calc(-2rem - 8px);
  top: .4rem;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--paper);
  border: 3px solid var(--ink);
}
.job.now::before {
  background: var(--amber);
}
.job time {
  font-size: .92rem;
  font-weight: 600;
  color: var(--amber-deep);
}
.job h3 {
  font-weight: 800;
  font-size: 1.6rem;
  margin-top: .25rem;
}
.job .company {
  font-weight: 600;
  color: var(--muted);
  margin-top: .2rem;
}
.job p {
  margin-top: 1rem;
  max-width: 36rem;
}
.job ul {
  margin-top: 1rem;
  display: grid;
  gap: .4rem;
}
.job li {
  position: relative;
  padding-left: 1.25rem;
}
.job li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .7em;
  width: .55rem;
  height: 2px;
  background: var(--ink);
}

/* Línea que conecta los empleos */
#experiencia .timeline {
  border-left-color: #b9c1bc;
}

/* Empleo anterior: punto y fecha en gris */
#experiencia .job::before {
  background: #858b88;
  border-color: #858b88;
}

#experiencia .job time {
  color: #555d59;
}

/* Empleo actual: punto verde con un halo suave */
#experiencia .job.now::before {
  background: #237347;
  border-color: #195c37;
  box-shadow:
    0 0 0 4px rgba(35, 115, 71, .16),
    0 0 10px 2px rgba(35, 115, 71, .22);
}

#experiencia .job.now time {
  color: #195c37;
  font-weight: 700;
}

/* ==========================================================
   SECCION: CONTACTO / FOOTER
   ========================================================== */

.contact {
  background: var(--slate);
  color: var(--white);
  padding: clamp(4.5rem,9vw,7rem) 0 2rem;
}
.contact h2 {
  font-weight: 850;
  font-size: clamp(2.4rem,7vw,5rem);
}
.contact-sub {
  margin-top: 1.25rem;
  color: var(--mist);
  max-width: 32rem;
  font-size: 1.15rem;
}
.mail {
  display: inline-block;
  margin-top: 2rem;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(1.3rem,3.6vw,2.2rem);
  text-decoration: none;
  border-bottom: 3px solid var(--red-bright);
  padding-bottom: .2rem;
  word-break: break-word;
}
.mail:hover {
  color: var(--red-bright);
}
.contact-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem 3rem;
  align-items: center;
  justify-content: space-between;
  margin-top: 3.5rem;
}
.place {
  color: var(--mist);
}
.foot {
  margin-top: 4rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  font-size: .9rem;
  color: var(--mist);
}


/* ==========================================================
   RESPONSIVE (celular y tablet)
   ========================================================== */

@media (max-width:860px){
  .menu-btn {
    display: block;
  }
  .nav {
    position: fixed;
    inset: 4.5rem 0 auto 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 1.25rem;
    padding: 1.5rem 1.25rem 2rem;
    background: var(--slate);
    border-bottom: 1px solid var(--line);
    transform: translateY(-120%);
    visibility: hidden;
    transition: transform .3s ease,visibility 0s .3s;
  }
  .nav.is-open {
    transform: none;
    visibility: visible;
    transition: transform .3s ease;
  }
  .nav-list {
    flex-direction: column;
    gap: 1rem;
  }
  .nav-list a {
    font-size: 1.15rem;
  }
  .degree {
    grid-template-columns: 1fr;
    gap: .4rem;
  }
  .degree .badge {
    justify-self: start;
    margin-top: .4rem;
  }
  .trace {
    width: 130%;
    opacity: .55;
  }
  .hero-now {
    position: static;
    margin-top: 2.5rem;
  }
  .hero {
    align-items: flex-start;
    padding-top: 8rem;
  }
  .hero .wrap {
    display: flex;
    flex-direction: column;
  }
}


/* ==========================================================
   ACCESIBILIDAD: sin animaciones si el usuario las desactiva
   ========================================================== */

@media (prefers-reduced-motion:reduce){
  html {
    scroll-behavior: auto;
  }
  .trace path {
    animation: none;
    stroke-dashoffset: 0;
  }
  .trace circle {
    animation: none;
    opacity: 1;
  }
  .nav {
    transition: none;
  }
}
