/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: #0D0D0D;
  color: #fff;
  font-family: 'Poppins', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
strong { font-weight: 600; }

/* ============================================================
   VARIABLES
   ============================================================ */
:root {
  --accent: #cc6ce6;
  --accent-glow: rgba(204,108,230,0.25);
  --text-primary: #ffffff;
  --text-secondary: #D8D8D8;
  --text-muted: #888888;
  --glass-bg: rgba(255,255,255,0.04);
  --glass-border: rgba(255,255,255,0.08);
  --radius: 32px;
  --pill: 50px;
  --tr: 0.3s ease;
  --max: 1200px;
}

/* ============================================================
   GLOW BLOBS
   ============================================================ */
.blob {
  position: fixed;
  border-radius: 50%;
  filter: blur(130px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.3;
}
.blob-1 {
  width: 650px; height: 650px;
  background: #1a5c3a;
  top: -200px; left: -200px;
  animation: blob1 24s ease-in-out infinite;
}
.blob-2 {
  width: 550px; height: 550px;
  background: #3d1a5c;
  bottom: -150px; right: -150px;
  animation: blob2 28s ease-in-out infinite;
}
@keyframes blob1 {
  0%,100% { transform: translate(0,0) scale(1); }
  40% { transform: translate(70px,80px) scale(1.1); }
  70% { transform: translate(-30px,110px) scale(0.93); }
}
@keyframes blob2 {
  0%,100% { transform: translate(0,0) scale(1); }
  35% { transform: translate(-80px,-60px) scale(1.07); }
  65% { transform: translate(50px,-90px) scale(0.9); }
}

/* ============================================================
   LAYOUT HELPERS
   ============================================================ */
.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 28px;
  position: relative;
  z-index: 1;
}
.section { padding: 100px 0; }
.section-title {
  text-align: center;
  font-size: clamp(26px, 3.5vw, 42px);
  font-weight: 600;
  margin-bottom: 60px;
}
.section-cta { text-align: center; margin-top: 48px; }

/* ============================================================
   SCROLL REVEAL
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(36px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 34px;
  border-radius: var(--pill);
  font-family: 'Poppins', sans-serif;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  min-height: 48px;
  white-space: nowrap;
  transition: transform var(--tr), filter var(--tr), box-shadow var(--tr);
}
.btn:hover { transform: scale(1.05); filter: brightness(1.12); }
.btn-white { background: #fff; color: #0D0D0D; box-shadow: 0 4px 24px rgba(255,255,255,0.12); }
.btn-accent { background: var(--accent); color: #fff; box-shadow: 0 4px 24px var(--accent-glow); }
.btn-outline {
  background: transparent;
  color: var(--text-secondary);
  border: 1.5px solid var(--glass-border);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); filter: none; }
.mt-btn { margin-top: 32px; align-self: flex-start; }

/* Break helpers for responsive line control */
.br-m { display: none; }

/* ============================================================
   NAVBAR
   ============================================================ */
.navbar {
  position: fixed;
  top: 20px; left: 0; right: 0;
  z-index: 1000;
  display: flex;
  justify-content: center;
  padding: 0 24px;
  transition: top var(--tr);
}
.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(13,13,13,0.65);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--glass-border);
  border-radius: var(--pill);
  padding: 12px 30px;
  width: 100%;
  max-width: 860px;
}
.navbar-brand {
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  transition: color var(--tr);
}
.navbar-brand:hover { color: var(--accent); }
.navbar-links {
  display: flex;
  gap: 30px;
  align-items: center;
}
.navbar-links a {
  font-size: 14px;
  font-weight: 400;
  color: var(--text-muted);
  transition: color var(--tr);
}
.navbar-links a:hover { color: #fff; }
.navbar-links li:last-child a:hover { color: #ce6ce6; }

/* Burger */
.burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
}
.burger span {
  display: block;
  width: 22px; height: 2px;
  background: var(--text-secondary);
  border-radius: 2px;
  transition: transform var(--tr), opacity var(--tr);
}
.burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger.open span:nth-child(2) { opacity: 0; }
.burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile nav */
.mobile-nav {
  position: fixed;
  inset: 0;
  background: rgba(13,13,13,0.97);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}
.mobile-nav.open { opacity: 1; pointer-events: all; }
.mobile-nav ul { display: flex; flex-direction: column; gap: 36px; text-align: center; }
.mobile-nav a {
  font-size: 30px; font-weight: 600;
  color: var(--text-secondary);
  transition: color var(--tr);
}
.mobile-nav a:hover { color: var(--accent); }
.mobile-nav-close {
  position: absolute;
  top: 28px; right: 28px;
  background: none;
  border: 1px solid var(--glass-border);
  color: var(--text-muted);
  width: 44px; height: 44px;
  border-radius: 50%;
  font-size: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color var(--tr), color var(--tr);
}
.mobile-nav-close:hover { border-color: var(--accent); color: var(--accent); }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 120px 24px 80px;
  position: relative;
  z-index: 1;
}
.hero-content {
  max-width: 820px;
  animation: heroUp 1s ease 0.15s both;
}
@keyframes heroUp {
  from { opacity: 0; transform: translateY(40px); }
  to   { opacity: 1; transform: translateY(0); }
}
.hero h1 {
  font-size: clamp(38px, 7.5vw, 92px);
  font-weight: 600;
  line-height: 1.04;
  letter-spacing: -2px;
  margin-bottom: 28px;
}
.hero h1 .accent { color: var(--accent); }
.hero h1 .light  { color: var(--text-secondary); }
.hero-sub {
  font-size: clamp(15px, 1.8vw, 18px);
  color: var(--text-muted);
  max-width: 680px;
  margin: 0 auto 40px;
  line-height: 1.75;
}

/* ============================================================
   PERFIL
   ============================================================ */
.profile-grid {
  display: grid;
  grid-template-columns: 1fr 1.45fr;
  gap: 64px;
  align-items: center;
}
.profile-image img {
  width: 100%;
  height: 464px;
  object-fit: cover;
  object-position: top center;
  border-radius: var(--radius);
  filter: grayscale(15%);
  transition: filter var(--tr), transform var(--tr), box-shadow var(--tr);
}
.profile-image img:hover {
  filter: grayscale(0%);
  transform: scale(1.02);
  box-shadow: 0 8px 56px var(--accent-glow);
}
.profile-text p {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.8;
}
.value-question { margin-top: 24px; font-size: 15px; }
.profile-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.profile-list {
  margin: 18px 0 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.profile-list li {
  font-size: 14px;
  color: var(--text-secondary);
  padding-left: 18px;
  position: relative;
  line-height: 1.75;
}
.profile-list li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 600;
}

/* ============================================================
   EJES DE VALOR
   ============================================================ */
.values-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.value-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 36px 30px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: transform var(--tr), box-shadow var(--tr), border-color var(--tr);
}
.value-card:hover {
  transform: scale(1.04);
  box-shadow: 0 10px 48px var(--accent-glow);
  border-color: rgba(204,108,230,0.28);
}
.value-icon { margin-bottom: 20px; }
.value-card h3 { font-size: 18px; font-weight: 600; margin-bottom: 20px; }
.value-list { display: flex; flex-direction: column; gap: 11px; }
.value-list li {
  font-size: 14px;
  color: var(--text-secondary);
  padding-left: 18px;
  position: relative;
  line-height: 1.5;
}
.value-list li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 600;
}

/* ============================================================
   EXPERIENCIA — ACORDEÓN
   ============================================================ */
.experience .container { max-width: var(--max); }
.accordion {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  margin-bottom: 16px;
  overflow: hidden;
  transition: border-color var(--tr), box-shadow var(--tr);
}
.accordion.active {
  border-color: rgba(204,108,230,0.3);
  box-shadow: 0 4px 32px rgba(204,108,230,0.08);
}
.accordion-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 28px 32px;
  cursor: pointer;
  user-select: none;
}
.accordion-meta { flex: 1; }
.accordion-top {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.accordion-role { font-size: 16px; font-weight: 600; color: #fff; }
.accordion-company {
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
  background: rgba(204,108,230,0.1);
  padding: 3px 12px;
  border-radius: 20px;
}
.accordion-years {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.accordion-brief { font-size: 14px; color: var(--text-secondary); line-height: 1.65; }
.accordion-toggle {
  background: none;
  border: 1.5px solid var(--glass-border);
  color: var(--text-muted);
  width: 38px; height: 38px; min-width: 38px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--tr), border-color var(--tr), color var(--tr), transform var(--tr);
  flex-shrink: 0;
  margin-top: 2px;
  line-height: 1;
}
.accordion.active .accordion-toggle {
  background: rgba(204,108,230,0.12);
  border-color: var(--accent);
  color: var(--accent);
}
.accordion-chevron {
  transition: transform 0.35s ease;
  display: block;
}
.accordion.active .accordion-chevron { transform: rotate(180deg); }
.accordion-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.48s ease;
}
.accordion.active .accordion-body { max-height: 700px; }
.accordion-list {
  padding: 20px 32px 30px;
  border-top: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  gap: 13px;
}
.accordion-list li {
  font-size: 14px;
  color: var(--text-secondary);
  padding-left: 20px;
  position: relative;
  line-height: 1.65;
  letter-spacing: 0.025em;
}
.accordion-list li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-size: 12px;
  top: 3px;
}

/* ============================================================
   PROYECTOS
   ============================================================ */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}
.project-card {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--glass-border);
  transition: transform var(--tr), box-shadow var(--tr), border-color var(--tr);
}
.project-card:hover {
  transform: scale(1.04);
  box-shadow: 0 8px 40px var(--accent-glow);
  border-color: rgba(204,108,230,0.28);
}
.project-thumb {
  flex-shrink: 0;
  background: #f0f0f2;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 260px;
}
.project-thumb img {
  width: 100%;
  height: 260px;
  object-fit: contain;
  display: block;
  transition: transform 0.5s ease;
}
.project-card:hover .project-thumb img { transform: scale(1.05); }
.project-info {
  padding: 18px 22px 22px;
  background: rgba(13,13,13,0.92);
  border-top: 1px solid rgba(255,255,255,0.1);
  flex: 1;
}
.project-cat {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  display: block;
  margin-bottom: 8px;
}
.project-info h3 { font-size: 17px; font-weight: 600; margin-bottom: 6px; color: #fff; }
.project-info p { font-size: 13px; color: var(--text-secondary); line-height: 1.5; }

/* ============================================================
   RECOMENDACIONES
   ============================================================ */
.carousel-wrapper {
  display: flex;
  align-items: center;
  gap: 14px;
}
.carousel-viewport {
  flex: 1;
  overflow: hidden;
  border-radius: 20px;
}
.carousel-track {
  display: flex;
  gap: 20px;
  transition: transform 0.42s ease;
  will-change: transform;
}
.tcard {
  flex-shrink: 0;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 28px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: transform var(--tr), box-shadow var(--tr), border-color var(--tr);
}
.tcard:hover {
  transform: scale(1.025);
  box-shadow: 0 8px 40px rgba(204,108,230,0.1);
  border-color: rgba(204,108,230,0.2);
}
.tcard-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.tavatar {
  width: 46px; height: 46px; min-width: 46px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  flex-shrink: 0;
}
.tcard-header strong { display: block; font-size: 14px; font-weight: 600; }
.tcard-header span { display: block; font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.tcard-relation { font-size: 11px; color: var(--accent); margin-top: 4px; font-style: italic; }
.tcard-text { font-size: 13px; color: var(--text-secondary); line-height: 1.7; margin-bottom: 14px; }
.tcard-more {
  background: none;
  border: none;
  color: var(--accent);
  font-family: 'Poppins', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  transition: opacity var(--tr);
}
.tcard-more:hover { opacity: 0.75; }
.carousel-btn {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  width: 46px; height: 46px; min-width: 46px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background var(--tr), border-color var(--tr), color var(--tr), opacity var(--tr);
}
.carousel-btn:hover {
  background: rgba(204,108,230,0.12);
  border-color: var(--accent);
  color: var(--accent);
}
.carousel-btn:disabled { opacity: 0.3; pointer-events: none; }

/* ============================================================
   FOOTER
   ============================================================ */
.footer { border-top: 1px solid var(--glass-border); }
.footer-title {
  font-size: clamp(26px, 4vw, 50px);
  font-weight: 600;
  text-align: center;
  margin-bottom: 56px;
  line-height: 1.15;
}
.footer-title-white { color: #ffffff; }
.footer-title-accent { color: #ce6ce6; }
.footer-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 48px;
}
.footer-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 30px 24px;
  text-align: center;
  display: block;
  transition: transform var(--tr), box-shadow var(--tr), border-color var(--tr);
}
.footer-card:hover {
  transform: scale(1.04);
  box-shadow: 0 8px 40px var(--accent-glow);
  border-color: rgba(204,108,230,0.28);
}
.footer-card-icon { display: flex; justify-content: center; margin-bottom: 14px; }
.footer-card h4 { font-size: 15px; font-weight: 600; margin-bottom: 6px; }
.footer-card p { font-size: 13px; color: var(--text-muted); word-break: break-word; }
.footer-legal { text-align: center; font-size: 12px; color: var(--text-muted); padding-bottom: 40px; }

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(13,13,13,0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal-card {
  background: rgba(18,18,18,0.97);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 40px;
  max-width: 560px;
  width: 100%;
  position: relative;
  transform: scale(0.91);
  transition: transform 0.3s ease;
}
.modal-overlay.open .modal-card { transform: scale(1); }
.modal-close {
  position: absolute;
  top: 18px; right: 20px;
  background: none;
  border: 1px solid var(--glass-border);
  color: var(--text-muted);
  width: 38px; height: 38px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color var(--tr), color var(--tr);
}
.modal-close:hover { border-color: var(--accent); color: var(--accent); }
.modal-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
}
.modal-header strong { display: block; font-size: 16px; font-weight: 600; }
.modal-header span { display: block; font-size: 13px; color: var(--text-muted); margin-top: 3px; }
#modal-text {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.82;
  max-height: 52vh;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--accent) transparent;
  padding-right: 6px;
}
#modal-text::-webkit-scrollbar { width: 5px; }
#modal-text::-webkit-scrollbar-track { background: transparent; }
#modal-text::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 10px;
}
#modal-text p { margin-bottom: 14px; }
#modal-text p:last-child { margin-bottom: 0; }
.modal-relation {
  display: block;
  font-size: 12px;
  color: var(--accent);
  margin-top: 3px;
  font-style: italic;
}

/* ============================================================
   RESPONSIVE — 1024px
   ============================================================ */
@media (max-width: 1024px) {
  .profile-grid { grid-template-columns: 1fr 1.3fr; gap: 44px; }
  .profile-image img { height: 384px; }
}

/* ============================================================
   RESPONSIVE — 900px
   ============================================================ */
@media (max-width: 900px) {
  .values-grid { grid-template-columns: 1fr 1fr; }
  .values-grid .value-card:last-child { grid-column: 1 / -1; max-width: 48%; margin: 0 auto; width: 100%; }
  .tcard { flex: 0 0 calc(50% - 10px); }
}

/* ============================================================
   RESPONSIVE — 767px MOBILE
   ============================================================ */
@media (max-width: 767px) {
  .section { padding: 72px 0; }
  .section-title { margin-bottom: 44px; }

  /* Navbar */
  .navbar-links { display: none; }
  .burger { display: flex; }

  /* Hero */
  .hero h1 { letter-spacing: -1px; }

  /* Profile */
  .profile-grid { grid-template-columns: 1fr; gap: 36px; }
  .profile-image img { height: 304px; }

  /* Values */
  .values-grid { grid-template-columns: 1fr; }
  .values-grid .value-card:last-child { max-width: 100%; grid-column: auto; }

  /* Accordion */
  .accordion-header { padding: 22px 20px; }
  .accordion-list { padding: 16px 20px 24px; }

  /* Break helpers */
  .br-d { display: none; }
  .br-m { display: inline; }

  /* Projects */
  .projects-grid { grid-template-columns: 1fr; }
  .project-thumb { min-height: 200px; }
  .project-thumb img { height: 200px; }

  /* Carousel */
  .tcard { flex: 0 0 100%; }
  .carousel-btn { width: 40px; height: 40px; min-width: 40px; font-size: 16px; }

  /* Footer */
  .footer-cards { grid-template-columns: 1fr; }
  .footer-title { margin-bottom: 40px; }

  /* Modal */
  .modal-card { padding: 28px 20px; }
}

/* ============================================================
   RESPONSIVE — 480px
   ============================================================ */
@media (max-width: 480px) {
  .navbar-inner { padding: 10px 20px; }
  .accordion-role { font-size: 14px; }
  .accordion-top { gap: 8px; }
}
