:root{
  --dark: #455560;
  --slate: #576066;
  --light: #dde4e8;
  --orange: #f8971d;
  --red: #b5121b;
  --white: #ffffff;
  --heading: 'Poppins', sans-serif;
  --body: 'Inter', sans-serif;
  --radius: 10px;
  --shadow: 0 12px 30px -14px rgba(69,85,96,0.25);
}

*{ box-sizing: border-box; margin:0; padding:0; }
html{ scroll-behavior: smooth; }
body{
  background: var(--white);
  color: var(--slate);
  font-family: var(--body);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a{ color: inherit; text-decoration: none; }
img{ max-width: 100%; display:block; }
ul{ list-style: none; }
h1,h2,h3,h4{ font-family: var(--heading); color: var(--dark); line-height: 1.2; }

.container{ max-width: 1140px; margin: 0 auto; padding: 0 24px; }

.tag{
  display:inline-block;
  font-family: var(--heading);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--orange);
  margin-bottom: 10px;
}
.tag::before{
  content:"";
  display:inline-block;
  width: 22px; height: 2px;
  background: var(--red);
  margin-right: 10px;
  vertical-align: middle;
}

.section-head{ text-align:center; max-width: 620px; margin: 0 auto 50px; }
.section-head h2{ font-size: clamp(26px,3.4vw,36px); font-weight: 700; }
.section-head p{ margin-top: 12px; color: var(--slate); }
.bg-light{ background: var(--light); }
section{ padding: 96px 0; }

/* ---------- buttons ---------- */
.btn{
  display:inline-flex;
  align-items:center;
  gap: 8px;
  font-family: var(--heading);
  font-weight: 600;
  font-size: 14.5px;
  padding: 14px 26px;
  border-radius: 50px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all .2s ease;
}
.btn-primary{ background: var(--orange); color: var(--white); }
.btn-primary:hover{ background: var(--red); transform: translateY(-2px); box-shadow: var(--shadow); }
.btn-outline{ border-color: rgba(255,255,255,0.55); color: var(--white); }
.btn-outline:hover{ background: rgba(255,255,255,0.12); border-color: var(--white); }
.btn-dark-outline{ border-color: var(--dark); color: var(--dark); }
.btn-dark-outline:hover{ background: var(--dark); color: var(--white); }
.btn-sm{ padding: 10px 20px; font-size: 13px; }

/* ---------- header ---------- */
.site-header{
  position: fixed; top:0; left:0; right:0; z-index: 100;
  background: transparent;
  transition: background .3s ease, box-shadow .3s ease, padding .3s ease;
  padding: 22px 0;
}
.site-header.scrolled{
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(8px);
  box-shadow: 0 2px 18px rgba(69,85,96,0.12);
  padding: 12px 0;
}
.header-inner{ display:flex; align-items:center; justify-content: space-between; gap: 20px; }
.logo{
  font-family: var(--heading); font-weight: 800; font-size: 21px; color: var(--white);
  transition: color .3s ease;
}
.site-header.scrolled .logo{ color: var(--dark); }
.logo span{ color: var(--orange); }
.main-nav{ display:flex; gap: 30px; }
.main-nav a{
  font-family: var(--heading); font-size: 14px; font-weight: 600;
  color: rgba(255,255,255,0.85); position: relative; padding: 4px 0;
  transition: color .3s ease;
}
.site-header.scrolled .main-nav a{ color: var(--slate); }
.main-nav a::after{
  content:""; position:absolute; left:0; bottom:-4px; width:0; height:2px;
  background: var(--orange); transition: width .2s ease;
}
.main-nav a:hover, .main-nav a.active{ color: var(--orange); }
.main-nav a:hover::after, .main-nav a.active::after{ width: 100%; }
.header-cta{ white-space: nowrap; }
.nav-toggle{
  display:none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 6px;
}
.nav-toggle span{ width: 24px; height: 2px; background: var(--white); transition: all .3s ease; }
.site-header.scrolled .nav-toggle span{ background: var(--dark); }

@media (max-width: 992px){
  .main-nav{
    position: fixed; top:0; right: -280px; height: 100vh; width: 260px;
    background: var(--dark); flex-direction: column; justify-content: center;
    align-items: flex-start; padding: 40px; gap: 24px; transition: right .3s ease;
  }
  .main-nav.open{ right: 0; }
  .main-nav a{ color: var(--white); font-size: 16px; }
  .header-cta{ display:none; }
  .nav-toggle{ display:flex; }
}

/* ---------- hero ---------- */
.hero{
  background: linear-gradient(155deg, var(--dark) 0%, var(--slate) 100%);
  padding: 168px 0 110px;
  position: relative;
  overflow: hidden;
}
.hero::before{
  content:""; position:absolute; width: 560px; height: 560px; border-radius: 50%;
  background: radial-gradient(circle, rgba(248,151,29,0.16), transparent 70%);
  top: -180px; right: -120px;
}
.hero-inner{
  display:grid; grid-template-columns: 1.15fr 0.85fr; gap: 50px; align-items:center;
  position: relative; z-index: 2;
}
.hero-text .tag{ color: var(--orange); }
.hero-text .tag::before{ background: var(--white); }
.hero-text h1{ color: var(--white); font-size: clamp(34px,5vw,54px); font-weight: 800; margin-bottom: 14px; }
.hero-role{ font-family: var(--heading); font-weight: 600; font-size: clamp(17px,2vw,20px); color: var(--orange); margin-bottom: 16px; }
.hero-desc{ color: rgba(255,255,255,0.78); max-width: 52ch; font-size: 15.5px; }
.hero-actions{ display:flex; gap: 14px; flex-wrap: wrap; margin-top: 30px; }
.hero-social{ display:flex; gap: 14px; margin-top: 34px; }
.hero-social a{
  width: 42px; height: 42px; border-radius: 50%; border: 1px solid rgba(255,255,255,0.3);
  display:flex; align-items:center; justify-content:center; color: var(--white);
  transition: all .2s ease;
}
.hero-social a:hover{ background: var(--orange); border-color: var(--orange); transform: translateY(-3px); }
.hero-social svg{ width: 18px; height: 18px; }

.hero-photo{ position: relative; display:flex; justify-content:center; }
.photo-frame{
  width: 300px; height: 300px; border-radius: 50%; overflow: hidden;
  border: 6px solid rgba(255,255,255,0.15); position: relative; z-index: 2;
  background: var(--light);
}
.photo-frame img{ width:100%; height:100%; object-fit: cover; }
.photo-fallback{
  position:absolute; inset:0; display:flex; align-items:center; justify-content:center;
  font-family: var(--heading); font-weight: 800; font-size: 44px; color: var(--dark);
  background: var(--light);
}
.photo-frame.no-photo img{ display:none; }
.photo-frame:not(.no-photo) .photo-fallback{ display:none; }
.photo-ring{
  position:absolute; width: 340px; height: 340px; border-radius: 50%;
  border: 2px dashed rgba(248,151,29,0.55); top: 50%; left: 50%;
  transform: translate(-50%,-50%); z-index: 1;
}
.scroll-cue{
  position:absolute; bottom: 26px; left: 50%; transform: translateX(-50%);
  color: rgba(255,255,255,0.7); animation: bob 1.8s infinite ease-in-out;
}
@keyframes bob{ 0%,100%{ transform: translate(-50%,0);} 50%{ transform: translate(-50%,8px);} }

@media (max-width: 992px){
  .hero-inner{ grid-template-columns: 1fr; text-align:center; }
  .hero-actions, .hero-social{ justify-content:center; }
  .hero-desc{ margin: 0 auto; }
  .hero-photo{ order:-1; }
  .photo-frame{ width: 220px; height:220px; }
  .photo-ring{ width: 256px; height:256px; }
}

/* ---------- about ---------- */
.about-grid{ display:grid; grid-template-columns: 300px 1fr; gap: 56px; align-items:center; }
.about-photo .photo-frame{ width: 100%; height: 340px; border-radius: var(--radius); border: none; box-shadow: var(--shadow); }
.about-photo .photo-fallback{ font-size: 56px; }
.about-content p{ font-size: 16.5px; }
.about-content p strong{ color: var(--dark); }
.about-info{ display:grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 28px; }
.about-info li{ font-size: 14.5px; border-left: 3px solid var(--orange); padding-left: 12px; }
.about-info li strong{ display:block; color: var(--dark); font-family: var(--heading); font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 2px; }

.stats-grid{
  margin-top: 64px; display:grid; grid-template-columns: repeat(4,1fr); gap: 20px;
  border-top: 1px solid var(--light); padding-top: 44px;
}
.stat{ text-align:center; }
.stat-num{ font-family: var(--heading); font-weight: 800; font-size: 40px; color: var(--dark); }
.stat-plus{ font-family: var(--heading); font-weight: 800; font-size: 40px; color: var(--orange); }
.stat-label{ display:block; font-size: 13.5px; margin-top: 6px; color: var(--slate); }

@media (max-width: 768px){
  .about-grid{ grid-template-columns: 1fr; }
  .about-photo .photo-frame{ max-width: 280px; margin: 0 auto; height: 280px; }
  .about-info{ grid-template-columns: 1fr; }
  .stats-grid{ grid-template-columns: repeat(2,1fr); }
}

/* ---------- services ---------- */
.services-grid{ display:grid; grid-template-columns: repeat(3,1fr); gap: 28px; }
.service-card{
  background: var(--white); border-radius: var(--radius); padding: 34px 28px;
  box-shadow: var(--shadow); border-top: 3px solid transparent; transition: all .25s ease;
}
.service-card:hover{ border-top-color: var(--orange); transform: translateY(-6px); }
.service-icon{
  width: 56px; height: 56px; border-radius: 14px; background: var(--light);
  display:flex; align-items:center; justify-content:center; margin-bottom: 20px;
  color: var(--dark); transition: all .25s ease;
}
.service-card:hover .service-icon{ background: var(--orange); color: var(--white); }
.service-icon svg{ width: 26px; height: 26px; }
.service-card h3{ font-size: 18px; font-weight: 700; margin-bottom: 10px; }
.service-card p{ font-size: 14.5px; }

@media (max-width: 900px){ .services-grid{ grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px){ .services-grid{ grid-template-columns: 1fr; } }

/* ---------- experiencia ---------- */
.itinerary{ position: relative; max-width: 820px; margin: 0 auto; }
.itinerary::before{
  content:""; position:absolute; left: 150px; top: 6px; bottom: 6px; width: 2px;
  background: var(--light);
}
.leg{ display:grid; grid-template-columns: 150px 1fr; gap: 30px; position: relative; padding-bottom: 40px; }
.leg:last-child{ padding-bottom: 0; }
.leg .gate{ font-family: var(--heading); font-size: 13px; color: var(--slate); text-align:right; padding-right: 26px; position: relative; font-weight: 600; white-space: nowrap; }
.leg .gate::after{
  content:""; position:absolute; right: -7px; top: 3px; width: 12px; height:12px; border-radius:50%;
  background: var(--orange); border: 3px solid var(--white); box-shadow: 0 0 0 2px var(--orange);
}
.leg .years{ display:block; color: var(--dark); font-weight: 700; }
.leg-card{ background: var(--white); border: 1px solid var(--light); border-radius: var(--radius); padding: 24px 26px; box-shadow: var(--shadow); }
.leg-card .role{ font-family: var(--heading); font-weight: 700; font-size: 18px; color: var(--dark); }
.leg-card .org{ font-family: var(--heading); font-size: 12.5px; color: var(--red); text-transform: uppercase; letter-spacing: 0.06em; margin-top: 3px; display:block; font-weight: 600; }
.leg-card ul{ margin-top: 14px; padding-left: 4px; }
.leg-card li{ margin-top: 8px; font-size: 14.5px; padding-left: 18px; position: relative; }
.leg-card li::before{ content:"—"; position:absolute; left:0; color: var(--orange); }

@media (max-width: 640px){
  .itinerary::before{ left: 10px; }
  .leg{ grid-template-columns: 1fr; gap: 6px; padding-left: 26px; }
  .leg .gate{ text-align:left; padding-right:0; font-size: 12px; white-space: normal; }
  .leg .gate::after{ content: none; }
  .leg::after{
    content:""; position:absolute; left: 5px; top: 4px; width: 12px; height:12px; border-radius:50%;
    background: var(--orange); border: 3px solid var(--white); box-shadow: 0 0 0 2px var(--orange);
  }
}

/* ---------- habilidades ---------- */
.skills-grid{ display:grid; grid-template-columns: 1fr 1fr; gap: 60px; }
.skill-bar{ margin-bottom: 24px; }
.skill-bar:last-child{ margin-bottom: 0; }
.skill-bar .sb-head{ display:flex; justify-content:space-between; font-family: var(--heading); font-size: 14px; font-weight: 600; color: var(--dark); margin-bottom: 8px; }
.sb-track{ height: 8px; border-radius: 6px; background: var(--white); overflow: hidden; }
.sb-fill{ height: 100%; width: 0; border-radius: 6px; background: linear-gradient(90deg, var(--orange), var(--red)); transition: width 1.1s ease; }
.tools-title{ font-family: var(--heading); font-weight: 700; color: var(--dark); margin-bottom: 18px; font-size: 15px; }
.chips{ display:flex; flex-wrap:wrap; gap: 10px; }
.chip{
  font-family: var(--heading); font-size: 13px; font-weight: 600; border: 1px solid var(--dark);
  background: var(--white); padding: 9px 16px; border-radius: 30px; color: var(--dark);
  transition: all .2s ease;
}
.chip:hover{ background: var(--dark); color: var(--white); }

@media (max-width: 768px){ .skills-grid{ grid-template-columns: 1fr; gap: 40px; } }

/* ---------- portafolio ---------- */
.filters{ display:flex; justify-content:center; gap: 12px; flex-wrap: wrap; margin-bottom: 44px; }
.filter-btn{
  font-family: var(--heading); font-size: 13.5px; font-weight: 600; padding: 10px 22px;
  border-radius: 30px; border: 1px solid var(--light); background: var(--white); color: var(--slate);
  cursor: pointer; transition: all .2s ease;
}
.filter-btn:hover{ border-color: var(--orange); color: var(--orange); }
.filter-btn.active{ background: var(--dark); border-color: var(--dark); color: var(--white); }
.portfolio-grid{ display:grid; grid-template-columns: repeat(3,1fr); gap: 26px; }
.portfolio-card{ border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: opacity .25s ease, transform .25s ease; }
.portfolio-card.hidden{ display:none; }
.pf-thumb{
  height: 190px; display:flex; align-items:center; justify-content:center; position: relative; color: var(--white);
}
.pf-thumb svg{ width: 44px; height:44px; opacity: 0.9; }
.pf-thumb.grad-1{ background: linear-gradient(135deg, var(--dark), var(--slate)); }
.pf-thumb.grad-2{ background: linear-gradient(135deg, var(--orange), var(--red)); }
.pf-thumb.grad-3{ background: linear-gradient(135deg, var(--red), var(--dark)); }
.pf-body{ background: var(--white); padding: 20px 22px; }
.pf-cat{ font-family: var(--heading); font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--orange); }
.pf-body h3{ font-size: 16.5px; margin-top: 6px; }
.pf-body p{ font-size: 13.5px; margin-top: 6px; }

@media (max-width: 900px){ .portfolio-grid{ grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px){ .portfolio-grid{ grid-template-columns: 1fr; } }

/* ---------- educacion ---------- */
.edu-list{ display:flex; flex-direction: column; max-width: 820px; margin: 0 auto; }
.edu-row{
  display:grid; grid-template-columns: 140px 1fr; gap: 24px; padding: 20px 0;
  border-bottom: 1px solid var(--light); align-items: baseline;
}
.edu-row:last-child{ border-bottom: none; }
.edu-row .yr{ font-family: var(--heading); font-size: 13px; color: var(--orange); font-weight: 700; }
.edu-row .deg{ font-weight: 700; font-family: var(--heading); font-size: 16px; color: var(--dark); }
.edu-row .inst{ color: var(--slate); font-size: 14px; margin-top: 3px; }

@media (max-width: 600px){ .edu-row{ grid-template-columns: 1fr; gap: 6px; } }

/* ---------- contacto ---------- */
.contacto{ background: var(--dark); color: var(--white); }
.contacto .tag{ color: var(--orange); }
.contacto .tag::before{ background: var(--white); }
.contacto .section-head h2{ color: var(--white); }
.contacto .section-head p{ color: rgba(255,255,255,0.75); }
.contact-grid{ display:grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: start; }
.contact-form{ display:flex; flex-direction: column; gap: 16px; }
.contact-form input, .contact-form textarea{
  width: 100%; padding: 14px 18px; border-radius: 8px; border: 1px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.06); color: var(--white); font-family: var(--body); font-size: 14.5px;
}
.contact-form input::placeholder, .contact-form textarea::placeholder{ color: rgba(255,255,255,0.5); }
.contact-form textarea{ min-height: 130px; resize: vertical; }
.contact-form .btn-primary{ align-self: flex-start; border:none; }
.contact-info{ display:flex; flex-direction: column; gap: 26px; }
.contact-info .ci-item .lbl{
  font-family: var(--heading); font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.1em;
  color: rgba(255,255,255,0.5); display:block; margin-bottom: 6px;
}
.contact-info .ci-item a, .contact-info .ci-item span{ font-size: 16px; font-weight: 600; }
.contact-info .ci-item a:hover{ color: var(--orange); }

@media (max-width: 900px){ .contact-grid{ grid-template-columns: 1fr; gap: 40px; } }

/* ---------- footer ---------- */
.site-footer{ background: var(--slate); color: rgba(255,255,255,0.8); padding: 32px 0; }
.footer-inner{ display:flex; align-items:center; justify-content: space-between; flex-wrap: wrap; gap: 16px; }
.footer-social{ display:flex; gap: 12px; }
.footer-social a{
  width: 36px; height: 36px; border-radius: 50%; border: 1px solid rgba(255,255,255,0.25);
  display:flex; align-items:center; justify-content:center; transition: all .2s ease;
}
.footer-social a:hover{ background: var(--orange); border-color: var(--orange); }
.footer-social svg{ width: 16px; height:16px; }
.footer-note{ font-size: 13px; }

/* ---------- back to top ---------- */
#backToTop{
  position: fixed; right: 26px; bottom: 26px; width: 46px; height: 46px; border-radius: 50%;
  background: var(--orange); color: var(--white); border: none; display:flex; align-items:center;
  justify-content:center; cursor: pointer; opacity: 0; pointer-events: none; transform: translateY(10px);
  transition: all .25s ease; z-index: 90; box-shadow: var(--shadow);
}
#backToTop.show{ opacity: 1; pointer-events: auto; transform: none; }
#backToTop:hover{ background: var(--red); }

/* ---------- reveal ---------- */
.reveal{ opacity: 0; transform: translateY(18px); transition: opacity .55s ease, transform .55s ease; }
.reveal.in{ opacity: 1; transform: none; }

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

:focus-visible{ outline: 2px solid var(--orange); outline-offset: 2px; }
