/* ==========================================================================
   Juan Pablo Restrepo · portafolio y CV
   Barra lateral oscura + contenido claro + acento azul.
   ========================================================================== */

:root {
  --sidebar: #040b14;
  --sidebar-2: #0b1622;
  --accent: #149ddd;
  --accent-dark: #0b6f99;
  --bg: #ffffff;
  --bg-alt: #f4fafd;
  --text: #272829;
  --heading: #050d18;
  --muted: #5d6773;
  --border: #e6ecef;
  --nav: #a8a9b4;
  --radius: 8px;
  --sidebar-w: 300px;
  --shadow: 0 4px 24px rgba(5, 13, 24, .08);
  --ease: cubic-bezier(.2, .7, .2, 1);
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Roboto", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5 {
  margin: 0;
  font-family: "Raleway", "Poppins", sans-serif;
  color: var(--heading);
  line-height: 1.2;
  font-weight: 600;
}

p { margin: 0 0 1rem; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-dark); }
img { display: block; max-width: 100%; height: auto; }

::selection { background: var(--accent); color: #fff; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

.icon {
  width: 1em;
  height: 1em;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
  vertical-align: -0.14em;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 300;
  background: var(--accent-dark);
  color: #fff;
  padding: 12px 18px;
}
.skip:focus { left: 12px; top: 12px; }

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

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  background: var(--sidebar);
  color: #cfd3da;
  padding: 0 15px;
  overflow-y: auto;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.sidebar__photo {
  width: 120px;
  height: auto;
  border-radius: 50%;
  border: 8px solid rgba(255, 255, 255, .15);
  margin: 15px auto;
}

.sidebar__name {
  color: #fff;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -.01em;
  margin: 0 0 15px;
}

.social {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 25px;
}

.social a {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, .08);
  color: #e9edf2;
  font-size: 16px;
  transition: background .2s linear, transform .2s var(--ease);
}
.social a:hover { background: var(--accent); color: #fff; transform: translateY(-2px); }

.sidebar nav { width: 100%; }

.sidebar nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 2px;
  text-align: left;
}

.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 10px;
  min-height: 44px;
  border-radius: 6px;
  color: var(--nav);
  font-family: "Poppins", sans-serif;
  font-size: 15px;
  transition: color .2s linear, background .2s linear;
}
.sidebar nav a .icon { font-size: 19px; color: #6c7684; transition: color .2s linear; }
.sidebar nav a:hover { color: #fff; }
.sidebar nav a:hover .icon { color: #fff; }
.sidebar nav a.active { color: #fff; }
.sidebar nav a.active .icon { color: var(--accent); }

.sidebar__cv {
  margin-top: 26px;
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 6px;
  background: var(--accent-dark);
  color: #fff;
  font-family: "Poppins", sans-serif;
  font-size: 14px;
  font-weight: 500;
  transition: background .2s linear;
}
.sidebar__cv:hover { background: #085a7d; color: #fff; }

/* ---------- Barra móvil ---------- */

.topbar {
  display: none;
  position: fixed;
  inset: 0 0 auto 0;
  height: 64px;
  background: var(--sidebar);
  color: #fff;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 18px;
  z-index: 120;
}

.topbar__name { font-family: "Poppins", sans-serif; font-size: 16px; font-weight: 600; }

.topbar__toggle {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, .08);
  color: #fff;
  border: 0;
  border-radius: 6px;
  font-size: 22px;
  cursor: pointer;
}

.sidebar__close {
  display: none;
  position: absolute;
  top: 14px;
  right: 14px;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, .16);
  border: 0;
  border-radius: 6px;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  z-index: 3;
}

/* ---------- Estructura ---------- */

.main { margin-left: var(--sidebar-w); }

.container {
  width: 100%;
  max-width: 1180px;
  margin-inline: auto;
  padding-inline: 28px;
}

.section { padding-block: 60px; }
.section--alt { background: var(--bg-alt); }

.section-title {
  padding-bottom: 60px;
  position: relative;
}

.section-title h2 {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -.01em;
  margin-bottom: 20px;
  padding-bottom: 20px;
  position: relative;
}

.section-title p {
  margin: 0;
  color: var(--muted);
  max-width: 72ch;
  font-size: 16px;
}

.section-title::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 50px;
  height: 3px;
  background: var(--accent);
}

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

.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px 0;
  position: relative;
  background-image: url("../img/hero-bg.jpg");
  background-size: cover;
  background-position: center 30%;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(4, 11, 20, .68);
}

.hero__inner {
  position: relative;
  z-index: 2;
  color: #fff;
}

.hero h1 {
  color: #fff;
  font-size: 64px;
  font-weight: 700;
  letter-spacing: -.02em;
  margin: 0 0 6px;
}

.hero__roles {
  font-family: "Poppins", sans-serif;
  font-size: 26px;
  color: #fff;
  margin: 0;
  min-height: 1.4em;
}

.hero__roles .typed {
  letter-spacing: 1px;
  border-bottom: 2px solid var(--accent);
  padding-bottom: 1px;
}

.typed-cursor { color: var(--accent); animation: blink 1s step-end infinite; }

.hero__roles b { color: var(--accent); font-weight: 600; }
.hero__roles span { color: var(--accent); animation: blink 1s step-end infinite; }

@keyframes blink { 50% { opacity: 0; } }

.hero__line {
  font-size: 18px;
  color: #c9d1d9;
  max-width: 54ch;
  margin-bottom: 28px;
}

.hero__actions { display: flex; flex-wrap: wrap; gap: 14px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 46px;
  padding: 12px 24px;
  border: 0;
  border-radius: 6px;
  background: var(--accent-dark);
  color: #fff;
  font-family: "Poppins", sans-serif;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background .2s linear, transform .2s var(--ease);
}
.btn:hover { background: #085a7d; color: #fff; }
.btn:active { transform: translateY(1px); }

.btn--ghost {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .45);
}
.btn--ghost:hover { background: rgba(255, 255, 255, .1); color: #fff; }

.btn--small { min-height: 40px; padding: 9px 16px; font-size: 14px; }

/* ---------- Sobre mí ---------- */

.about-grid {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 36px;
  align-items: start;
}

.about-grid > img {
  width: 100%;
  height: auto;
}

.about h3 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 14px;
}

.about-lead { color: var(--text); margin-bottom: 18px; max-width: 72ch; }

.about-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 28px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.about-cols li {
  display: flex;
  gap: 8px;
  font-size: 15px;
  color: var(--text);
  padding: 4px 0;
}
.about-cols li .icon { color: var(--accent); font-size: 15px; margin-top: .45em; }
.about-cols strong { font-weight: 600; color: var(--heading); margin-right: 4px; }

/* ---------- Cifras ---------- */

.stats { display: grid; grid-template-columns: repeat(4, 1fr); }

.stats-item { padding: 30px 24px; }

.stats-item__icon {
  color: var(--accent);
  float: left;
  font-size: 44px;
  line-height: 0;
  width: 1em;
  height: 1em;
}

.purecounter, .stats-item__suffix {
  color: var(--heading);
  font-size: 48px;
  line-height: 40px;
  font-weight: 700;
  font-family: "Poppins", sans-serif;
}
.purecounter { margin-left: 60px; }

.stats-item p {
  color: var(--muted);
  padding-top: 15px;
  margin: 0 0 0 60px;
  font-family: "Poppins", sans-serif;
  font-size: 14px;
  line-height: 1.4;
}
.stats-item p strong { color: var(--heading); font-weight: 600; }

/* ---------- Habilidades ---------- */

.skills-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 60px;
}

.skill { padding: 0 0 6px; }

.skill__top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-family: "Poppins", sans-serif;
  font-size: 15px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--heading);
  margin-bottom: 6px;
}
.skill__top span { color: var(--heading);
  font-weight: 600; font-style: normal; }

.skill__track {
  height: 10px;
  background: #e3ebf0;
  overflow: hidden;
}

.skill__bar {
  height: 10px;
  width: 0;
  background: var(--accent);
  transition: width .9s;
}

/* ---------- Currículum ---------- */

.resume-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}

.resume h3 {
  font-size: 20px;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 22px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border);
}

.timeline {
  position: relative;
  padding-left: 24px;
  border-left: 2px solid rgba(20, 157, 221, .25);
}

.timeline__item { position: relative; padding-bottom: 26px; }
.timeline__item:last-child { padding-bottom: 0; }

.timeline__item::before {
  content: "";
  position: absolute;
  left: -31px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid #fff;
  box-shadow: 0 0 0 2px rgba(20, 157, 221, .25);
}

.timeline__item h4 { font-size: 17px; font-weight: 600; text-transform: uppercase; margin-bottom: 6px; color: #3a4149; }

.timeline__when {
  font-size: 13px;
  color: var(--accent-dark);
  font-weight: 500;
  margin-bottom: 6px;
  display: inline-block;
  background: rgba(20, 157, 221, .1);
  padding: 2px 9px;
  border-radius: 4px;
}

.timeline__where { font-size: 14px; color: var(--muted); font-style: italic; margin-bottom: 8px; }

.timeline ul { margin: 8px 0 0; padding-left: 18px; }
.timeline li { font-size: 15px; margin-bottom: 4px; }

/* ---------- Portafolio ---------- */

.portfolio-filters {
  padding: 0;
  margin: 0 auto 20px;
  list-style: none;
  text-align: center;
}
.portfolio-filters li {
  cursor: pointer;
  display: inline-block;
  padding: 0;
  font-size: 14px;
  text-transform: uppercase;
  margin: 0 10px 10px;
  line-height: 1;
  transition: color .3s ease-in-out;
}
.portfolio-filters li:hover,
.portfolio-filters li.filter-active { color: var(--accent); }

.isotope-container { position: relative; }
.portfolio-item { width: 33.3333%; padding: 12px; float: left; }

.portfolio-content { position: relative; overflow: hidden; }
.portfolio-content img { width: 100%; height: auto; transition: .3s; }

.portfolio-info {
  opacity: 0;
  position: absolute;
  inset: 0;
  z-index: 3;
  transition: all ease-in-out .3s;
  background: rgba(0, 0, 0, .6);
  padding: 15px;
}
.portfolio-info h3 {
  font-size: 14px;
  font-weight: 400;
  color: #fff;
  display: inline-block;
  background: var(--accent);
  padding: 5px 10px;
  margin: 0;
}
.portfolio-info p {
  position: absolute;
  bottom: 10px;
  left: 15px;
  right: 15px;
  font-size: 15px;
  font-weight: 600;
  color: rgba(255, 255, 255, .85);
  margin: 0;
}
.portfolio-links a {
  position: absolute;
  left: calc(50% - 40px);
  top: calc(50% - 14px);
  font-size: 26px;
  color: #fff;
  line-height: 1;
  transition: .3s;
}
.portfolio-links a:hover { color: var(--accent); }
.portfolio-links .details { left: 50%; font-size: 30px; }

.portfolio-content:hover .portfolio-info { opacity: 1; }
.portfolio-content:hover img { transform: scale(1.1); }

/* ---------- Servicios ---------- */

.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.service {
  background: #fff;
  border: 1px solid var(--border);
  border-left: 3px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 22px;
  transition: border-color .2s linear, transform .2s var(--ease);
}
.service:hover { border-left-color: var(--accent); transform: translateY(-3px); }

.service__icon {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(20, 157, 221, .1);
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 21px;
  margin-bottom: 14px;
}

.service h3 { font-size: 17px; margin-bottom: 6px; }
.service p { font-size: 14px; color: var(--muted); margin: 0; }

/* ---------- Contacto ---------- */

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  gap: 36px;
  align-items: start;
}

.contact-info { display: grid; gap: 12px; }

.contact-item {
  display: flex;
  gap: 14px;
  align-items: center;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  color: var(--text);
  transition: border-color .2s linear;
}
.contact-item:hover { border-color: var(--accent); color: var(--text); }
.contact-item .icon { font-size: 20px; color: var(--accent); }
.contact-item b { display: block; font-family: "Poppins", sans-serif; font-size: 14px; color: var(--heading); }
.contact-item span { font-size: 14px; color: var(--muted); }

.form { display: grid; gap: 14px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.form label {
  display: block;
  font-family: "Poppins", sans-serif;
  font-size: 13.5px;
  color: var(--heading);
  margin-bottom: 6px;
}

.form input, .form textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 15px;
}
.form textarea { min-height: 140px; resize: vertical; }
.form input:focus, .form textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }

.form__note { font-size: 13px; color: var(--muted); margin: 0; }

/* ---------- Pie ---------- */

.footer {
  background: var(--sidebar);
  color: #a8b0ba;
  padding: 34px 0;
  font-size: 14px;
}

.footer__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}
.footer a { color: #dfe5ea; }
.footer a:hover { color: var(--accent); }

/* ---------- Volver arriba ---------- */

.top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--accent-dark);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity .25s, transform .25s, visibility .25s;
  z-index: 90;
}
.top.show { opacity: 1; visibility: visible; transform: none; }
.top:hover { background: #085a7d; color: #fff; }

/* ---------- Páginas de proyecto ---------- */

.project-hero {
  padding-block: 150px 46px;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
}

.project-hero h1 {
  font-size: clamp(34px, 5vw, 54px);
  letter-spacing: -.02em;
  margin-bottom: 12px;
}

.project-hero .lead {
  font-size: 18px;
  color: var(--muted);
  max-width: 62ch;
  margin: 0;
}

.project-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 26px;
  margin-top: 22px;
  font-size: 14px;
}
.project-meta div { display: flex; gap: 7px; }
.project-meta dt { color: var(--muted); }
.project-meta dd { margin: 0; color: var(--heading); font-weight: 500; }

.project-body { padding-block: 52px; }

.project-body h2 { font-size: 22px; margin: 30px 0 12px; }
.project-body h2:first-child { margin-top: 0; }
.project-body p { color: var(--text); max-width: 74ch; }

.project-body ul { margin: 0 0 1rem; padding-left: 20px; }
.project-body li { margin-bottom: 6px; }

.project-shot {
  margin: 26px 0 8px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}
.project-shot img { width: 100%; }

.project-nav {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding-block: 26px;
  border-top: 1px solid var(--border);
  font-size: 14px;
}
.project-nav a { color: var(--muted); }
.project-nav a:hover { color: var(--accent); }
.project-nav b { display: block; font-family: "Poppins", sans-serif; font-size: 16px; color: var(--heading); }
.project-nav .next { text-align: right; margin-left: auto; }

@media (hover: none) {
  .portfolio-info { opacity: 1; background: rgba(0, 0, 0, .35); }
  .portfolio-info p { display: none; }
}

/* ---------- Preloader ---------- */

#preloader {
  position: fixed;
  inset: 0;
  z-index: 999999;
  background: var(--bg);
  transition: all .6s ease-out;
}
#preloader::before {
  content: "";
  position: fixed;
  top: calc(50% - 30px);
  left: calc(50% - 30px);
  border: 6px solid #fff;
  border-color: var(--accent) transparent var(--accent) transparent;
  border-radius: 50%;
  width: 60px;
  height: 60px;
  animation: animate-preloader 1.5s linear infinite;
}
#preloader.done { opacity: 0; visibility: hidden; }
@keyframes animate-preloader { to { transform: rotate(360deg); } }

/* ---------- Movimiento ---------- */

.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .55s var(--ease), transform .55s var(--ease);
  transition-delay: var(--d, 0ms);
}
.js .reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .skill__bar { transition: none; }
}

/* ---------- Responsive ---------- */

@media (max-width: 1199px) {
  .topbar { display: flex; }
  .sidebar {
    transform: translateX(-100%);
    transition: transform .3s var(--ease);
    width: 290px;
    padding-top: 60px;
  }
  .sidebar.open { transform: none; box-shadow: 0 0 60px rgba(0, 0, 0, .4); }
  .sidebar__close { display: inline-flex; }
  .main { margin-left: 0; padding-top: 64px; }
  .hero { min-height: calc(100svh - 64px); }
  .hero__inner { padding-block: 80px; }
}

@media (max-width: 900px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .services-grid { grid-template-columns: 1fr 1fr; }
  .portfolio-item { width: 50%; }
  .about-grid { grid-template-columns: 1fr; }
  .about-grid > img { max-width: 320px; }
  .resume-grid { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .section { padding-block: 48px; }
  .container { padding-inline: 18px; }
  .section-title h2 { font-size: 25px; }
  .hero h1 { font-size: 32px; }
  .hero__roles { font-size: 20px; }
  .stats-item__icon { font-size: 36px; }
  .purecounter, .stats-item__suffix { font-size: 40px; }
  .about-cols { grid-template-columns: 1fr; }
  .skills-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr; }
  .services-grid { grid-template-columns: 1fr; }
  .portfolio-item { width: 100%; }
  .form-row { grid-template-columns: 1fr; }
  .hero__actions .btn { width: 100%; }
  .topbar__name { font-size: 15px; }
  .project-hero { padding-top: 110px; }
}
