/* ═══════════════════════════════════════════
   RESET & VARIABLES
═══════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ═══════════════════════════════════════════
   EXPERIENCE IMAGE CARD — foto del item activo (panel izquierdo)
═══════════════════════════════════════════ */
.exp-image-card {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  border: 1px solid var(--clr-border);
  background: var(--clr-surface2);
  overflow: hidden;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.5s ease, transform 0.5s ease;
  pointer-events: none;
}
.exp-image-card.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.exp-image-card__layer {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 1.6s ease;
  will-change: opacity;
}
.exp-image-card__layer.is-visible { opacity: 1; }

:root {
  --clr-bg:        #060a14;
  --clr-surface:   #0c1424;
  --clr-surface2:  #111d35;
  --clr-border:    #ffffff0f;
  --clr-accent:    #0ea5e9;
  --clr-accent2:   #38bdf8;
  --clr-green:     #f0a500;
  --clr-text:      #e8f0fe;
  --clr-muted:     #6b8aad;

  --font-sans:  'Inter', system-ui, sans-serif;
  --font-head:  'Space Grotesk', system-ui, sans-serif;

  --nav-h: 64px;
  --radius: 16px;
  --transition: 0.25s cubic-bezier(.4,0,.2,1);
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background: var(--clr-bg);
  color: var(--clr-text);
  line-height: 1.6;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; }

/* ═══════════════════════════════════════════
   UTILITIES
═══════════════════════════════════════════ */
.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: 50px;
  font-family: var(--font-sans);
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  border: none;
}

.btn--primary {
  background: var(--clr-accent);
  color: #fff;
}
.btn--primary:hover { background: var(--clr-accent2); transform: translateY(-2px); box-shadow: 0 8px 24px #7c6bff40; }

.btn--outline {
  background: transparent;
  color: var(--clr-text);
  border: 1.5px solid var(--clr-border);
}
.btn--outline:hover { border-color: var(--clr-accent); color: var(--clr-accent); transform: translateY(-2px); }

.btn--full { width: 100%; justify-content: center; }

.section-tag {
  display: inline-block;
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--clr-accent);
  margin-bottom: 12px;
}

.section-title {
  font-family: var(--font-head);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 12px;
}

.section-sub {
  color: var(--clr-muted);
  max-width: 520px;
}

.section-header {
  text-align: center;
  margin-bottom: 56px;
}
.section-header .section-sub { margin: 0 auto; }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: .75rem;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 50px;
  background: #7c6bff1a;
  color: var(--clr-accent2);
  border: 1px solid #7c6bff30;
}
.tag i[class*="devicon"] {
  font-size: .95rem;
  line-height: 1;
}

/* ═══════════════════════════════════════════
   NAV
═══════════════════════════════════════════ */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  z-index: 100;
  transition: background var(--transition), backdrop-filter var(--transition);
}

.nav.scrolled {
  background: #0a0a0fcc;
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--clr-border);
}

.nav__logo {
  font-family: var(--font-head);
  font-size: 1rem;
  font-weight: 700;
  color: var(--clr-accent);
  letter-spacing: .04em;
  transition: opacity 0.35s ease;
}

.nav__links {
  display: flex;
  gap: 36px;
}

.nav__links a {
  font-size: .9rem;
  font-weight: 500;
  color: var(--clr-muted);
  transition: color var(--transition);
  position: relative;
}

.nav__links a::after {
  content: '';
  position: absolute;
  bottom: -4px; left: 0;
  width: 0; height: 2px;
  background: var(--clr-accent);
  border-radius: 2px;
  transition: width var(--transition);
}

.nav__links a:hover,
.nav__links a.active { color: var(--clr-text); }
.nav__links a:hover::after,
.nav__links a.active::after { width: 100%; }

.nav__right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.lang-switcher {
  display: flex;
  gap: 4px;
  background: var(--clr-surface2);
  border: 1px solid var(--clr-border);
  border-radius: 50px;
  padding: 3px;
}

.lang-btn {
  background: transparent;
  border: none;
  color: var(--clr-muted);
  font-family: var(--font-sans);
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .04em;
  padding: 5px 12px;
  border-radius: 50px;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
}
.lang-btn .fi {
  width: 18px;
  height: 13px;
  border-radius: 2px;
}
.lang-btn:hover { color: var(--clr-text); }
.lang-btn.active {
  background: var(--clr-accent);
  color: #fff;
}

.nav__burger { display: none; background: none; border: none; cursor: pointer; flex-direction: column; gap: 5px; }
.nav__burger span { display: block; width: 24px; height: 2px; background: var(--clr-text); border-radius: 2px; transition: all var(--transition); }

/* ═══════════════════════════════════════════
   HERO
═══════════════════════════════════════════ */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: calc(var(--nav-h) + 40px) 40px 80px;
  gap: 64px;
  overflow: hidden;
}

.hero__bg { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }

.hero__blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: .35;
}
.hero__blob--1 {
  width: 600px; height: 600px;
  background: radial-gradient(circle, #0ea5e9 0%, transparent 70%);
  top: -150px; left: -150px;
}
.hero__blob--2 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, #f0a500 0%, transparent 70%);
  bottom: -100px; right: -100px;
}

.hero__content {
  position: relative;
  z-index: 1;
  max-width: 580px;
}

.hero__tag {
  font-size: .85rem;
  font-weight: 500;
  color: var(--clr-green);
  letter-spacing: .08em;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.hero__tag::before {
  content: '';
  display: inline-block;
  width: 28px; height: 2px;
  background: var(--clr-green);
  border-radius: 2px;
}

.hero__name {
  font-family: var(--font-head);
  font-size: clamp(3rem, 8vw, 5.5rem);
  font-weight: 700;
  line-height: 1.05;
  margin-bottom: 16px;
}
.hero__name span { color: var(--clr-accent); }

.hero__role {
  font-size: 1.1rem;
  color: var(--clr-muted);
  margin-bottom: 20px;
  font-weight: 400;
}

.hero__bio {
  font-size: 1rem;
  color: var(--clr-muted);
  line-height: 1.75;
  margin-bottom: 36px;
  max-width: 460px;
}

.hero__cta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.hero__avatar {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
}

.avatar-ring {
  width: 280px; height: 280px;
  border-radius: 50%;
  padding: 4px;
  background: conic-gradient(var(--clr-accent), var(--clr-green), var(--clr-accent2), var(--clr-accent));
  animation: spin 8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.avatar-placeholder {
  width: 100%; height: 100%;
  border-radius: 50%;
  overflow: hidden;
  background: var(--clr-surface2);
  animation: spin 8s linear infinite reverse;
}

.avatar-placeholder img {
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.hero__scroll {
  position: absolute;
  bottom: 36px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--clr-muted);
  animation: bounce 2s ease-in-out infinite;
}
.hero__scroll svg {
  width: 24px; height: 24px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%       { transform: translateX(-50%) translateY(8px); }
}

/* ═══════════════════════════════════════════
   PROJECTS
═══════════════════════════════════════════ */
.projects {
  padding: 120px 0;
}

.filter-bar {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-bottom: 48px;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 8px 22px;
  border-radius: 50px;
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid var(--clr-border);
  background: transparent;
  color: var(--clr-muted);
  transition: all var(--transition);
}
.filter-btn:hover,
.filter-btn.active {
  background: var(--clr-accent);
  border-color: var(--clr-accent);
  color: #fff;
}

.projects__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 28px;
}

.project-card {
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.project-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 24px 48px #00000060;
  border-color: #7c6bff40;
}

.project-card__image {
  height: 200px;
  position: relative;
  background-size: cover;
  background-position: center;
}

.project-card__image--1     { background: linear-gradient(135deg, #0c1e3d 0%, #0a3060 50%, #0e4d8a 100%); }
.project-card__image--2 {
  background-image: url('img/rick-morty-cover.jpg');
  background-size: cover;
  background-position: center top;
}
.project-card__image--3     { background: linear-gradient(135deg, #1a1000 0%, #3d2600 50%, #f0a500 100%); }
.project-card__image--4     { background: linear-gradient(135deg, #001829 0%, #003a5c 50%, #38bdf8 100%); }
.project-card__image--bushy {
  background-image: url('img/bushy-labyrinth.png');
  background-size: cover;
  background-position: center;
}

.project-card--coming-soon {
  position: relative;
  cursor: default;
}
.project-card--coming-soon:hover {
  transform: none;
  box-shadow: none;
  border-color: var(--clr-border);
}
.project-card--coming-soon a,
.project-card--coming-soon button {
  pointer-events: none;
}
.project-card__coming-soon {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #00000075;
  backdrop-filter: blur(3px);
  border-radius: var(--radius);
  color: #fff;
  font-size: .85rem;
  font-weight: 700;
  letter-spacing: .15em;
  text-transform: uppercase;
  pointer-events: all;
  cursor: default;
}

.project-card__overlay {
  position: absolute; inset: 0;
  background: #00000088;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition);
}
.project-card:hover .project-card__overlay { opacity: 1; }

.project-card__live {
  color: #fff;
  font-weight: 600;
  font-size: .9rem;
  padding: 10px 22px;
  border: 2px solid #fff;
  border-radius: 50px;
  transition: background var(--transition);
}
.project-card__live:hover { background: #ffffff25; }

.project-card__body {
  padding: 24px;
}

.project-card__tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.project-card__title {
  font-family: var(--font-head);
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 10px;
}

.project-card__desc {
  font-size: .9rem;
  color: var(--clr-muted);
  line-height: 1.6;
  margin-bottom: 12px;
}

.project-card__highlights {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.project-card__highlights li {
  font-size: .78rem;
  color: var(--clr-muted);
  padding-left: 16px;
  position: relative;
  line-height: 1.4;
}
.project-card__highlights li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--clr-accent);
  font-weight: 700;
}

.project-card__link {
  font-size: .85rem;
  font-weight: 600;
  color: var(--clr-accent);
  transition: color var(--transition);
}
.project-card__link:hover { color: var(--clr-accent2); }

/* ═══════════════════════════════════════════
   EXPERIENCE / CV
═══════════════════════════════════════════ */
.experience {
  padding: 120px 0;
  background: var(--clr-surface);
  border-top: 1px solid var(--clr-border);
  border-bottom: 1px solid var(--clr-border);
}

.experience__layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 64px;
  align-items: start;
}

.experience__left {
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: sticky;
  top: calc(var(--nav-h) + 24px);
}

.experience__left--compact {
  flex-direction: row;
  align-items: flex-start;
  gap: 16px;
}

.experience__left--compact .exp-image-card {
  flex: 0 0 46%;
  width: 46%;
}

.experience__left--compact .skills-panel {
  flex: 1;
  min-width: 0;
}

.experience__left--compact .skills-panel__body {
  padding: 0 14px;
}

/* ══════════════════════════════════════════
   STACK SECTION — vitrina de tecnologías
══════════════════════════════════════════ */
.stack-section {
  padding: 80px 0 88px;
  background: var(--clr-surface);
  border-top:    1px solid var(--clr-border);
  border-bottom: 1px solid var(--clr-border);
}

.stack-section .section-header { margin-bottom: 56px; }

/* Grid de 8 columnas en desktop, fluido en móvil */
.stack-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 16px;
}

/* Cada item: card clickable con float animado */
.stack-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 22px 12px 18px;
  border-radius: 14px;
  border: 1px solid var(--clr-border);
  background: var(--clr-surface2);
  cursor: pointer;
  animation: tech-float 3.5s ease-in-out infinite;
  transition: border-color 0.25s, box-shadow 0.25s;
  user-select: none;
}

.stack-item:hover {
  border-color: var(--clr-accent);
  box-shadow: 0 8px 28px #0ea5e922;
  animation-play-state: paused;
}

.stack-item:active { transform: scale(0.95); }

.stack-item i {
  font-size: 2.8rem;
  opacity: 0.75;
  transition: opacity 0.2s;
  pointer-events: none;
}

.stack-item:hover i { opacity: 1; }

.stack-item span {
  font-size: .65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--clr-muted);
  text-align: center;
  transition: color 0.2s;
  pointer-events: none;
}

.stack-item:hover span { color: var(--clr-text); }

/* Stagger del float — ciclo de 8 offsets */
.stack-item:nth-child(8n+1) { animation-delay: 0s;    animation-duration: 3.3s; }
.stack-item:nth-child(8n+2) { animation-delay: .45s;  animation-duration: 3.7s; }
.stack-item:nth-child(8n+3) { animation-delay: .9s;   animation-duration: 3.1s; }
.stack-item:nth-child(8n+4) { animation-delay: 1.35s; animation-duration: 3.9s; }
.stack-item:nth-child(8n+5) { animation-delay: 1.8s;  animation-duration: 3.5s; }
.stack-item:nth-child(8n+6) { animation-delay: 2.25s; animation-duration: 3.2s; }
.stack-item:nth-child(8n+7) { animation-delay: 2.7s;  animation-duration: 4.0s; }
.stack-item:nth-child(8n+8) { animation-delay: 3.15s; animation-duration: 3.6s; }

@keyframes tech-float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-9px); }
}

/* ── Tech popup (no bloqueante) ── */
.tech-popup {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  background: var(--clr-surface2);
  border: 1px solid var(--clr-accent);
  border-radius: 16px;
  padding: 20px 24px 22px;
  width: min(380px, calc(100vw - 40px));
  z-index: 300;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  box-shadow: 0 16px 48px #00000055, 0 0 0 1px #0ea5e920;
}

.tech-popup.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

.tech-popup__close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: none;
  border: none;
  color: var(--clr-muted);
  font-size: 1rem;
  cursor: pointer;
  line-height: 1;
  padding: 4px;
  transition: color 0.2s;
}
.tech-popup__close:hover { color: var(--clr-text); }

.tech-popup__head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.tech-popup__head i {
  font-size: 2rem;
}

.tech-popup__head strong {
  font-family: var(--font-head);
  font-size: 1.1rem;
  color: var(--clr-text);
}

#techPopupDesc {
  font-size: .88rem;
  color: var(--clr-muted);
  line-height: 1.65;
  margin: 0;
}

/* ── Skills panel ── */
.skills-panel {
  background: var(--clr-surface2);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius);
  padding: 0 0 32px;
  overflow: hidden;
}

/* Cuerpo dinámico */
.skills-panel__body {
  padding: 0 28px;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.skills-panel__hint {
  font-size: .8rem;
  color: var(--clr-muted);
  text-align: center;
  padding: 16px 0 4px;
}

.skills-panel__title {
  font-family: var(--font-head);
  font-size: 1.05rem;
  padding-top: 24px;
  font-weight: 700;
  margin-bottom: 24px;
  color: var(--clr-text);
}

.skill-group { margin-bottom: 24px; }
.skill-group:last-child { margin-bottom: 0; }

.skill-group__label {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--clr-accent);
  margin-bottom: 12px;
}

/* ── AV chips ── */
.av-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.av-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 50px;
  font-size: .78rem;
  font-weight: 600;
  background: var(--clr-bg);
  border: 1px solid var(--clr-border);
  color: var(--clr-muted);
  cursor: default;
  transition: all var(--transition);
}

.av-chip:hover {
  border-color: var(--clr-green);
  color: var(--clr-text);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px #f0a50025;
}

.av-chip::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--clr-green);
  margin-right: 8px;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity var(--transition);
}
.av-chip:hover::before { opacity: 1; }

/* Tooltip */
.av-chip::after {
  content: attr(data-desc);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) scale(.9);
  background: var(--clr-surface2);
  border: 1px solid var(--clr-border);
  color: var(--clr-text);
  font-size: .72rem;
  font-weight: 400;
  line-height: 1.4;
  white-space: normal;
  width: 200px;
  text-align: center;
  padding: 8px 12px;
  border-radius: 8px;
  pointer-events: none;
  opacity: 0;
  z-index: 10;
  transition: opacity var(--transition), transform var(--transition);
}
.av-chip:hover::after {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}

/* ── Tech icon grid ── */
.tech-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.tech-icon {
  position: relative;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--clr-bg);
  border: 1px solid var(--clr-border);
  border-radius: 10px;
  cursor: default;
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}

.tech-icon i {
  font-size: 2rem;
  line-height: 1;
}

.tech-icon:hover {
  border-color: var(--clr-accent);
  transform: translateY(-3px);
  box-shadow: 0 6px 16px #0ea5e930;
}

/* Tooltip */
.tech-icon::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) scale(.85);
  background: var(--clr-surface2);
  border: 1px solid var(--clr-border);
  color: var(--clr-text);
  font-size: .72rem;
  font-weight: 600;
  white-space: nowrap;
  padding: 4px 10px;
  border-radius: 6px;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--transition), transform var(--transition);
}

.tech-icon:hover::after {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}

/* ── Timeline extra (expandible) ── */
.timeline__extra {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.7s cubic-bezier(.4,0,.2,1),
              opacity    0.5s ease 0.2s,
              margin-top 0.4s ease;
  margin-top: 0;
}

.timeline__card.is-expanded .timeline__extra {
  max-height: 1200px;
  opacity: 1;
  margin-top: 20px;
}

.timeline__extra-desc {
  font-size: .88rem;
  color: var(--clr-muted);
  line-height: 1.7;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--clr-border);
}

.timeline__extra-header {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--clr-border);
}

.timeline__extra-logo {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  object-fit: contain;
  background: #fff;
  padding: 2px;
}

.timeline__extra-badge {
  font-size: .75rem;
  font-weight: 600;
  color: var(--clr-muted);
  background: var(--clr-bg);
  border: 1px solid var(--clr-border);
  border-radius: 50px;
  padding: 3px 10px;
}

.timeline__extra-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

/* ── Timeline ── */
.timeline { position: relative; overflow-anchor: none; }

.timeline__section-label {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--clr-accent);
  margin: 0 0 24px 40px;
  padding-top: 8px;
}

.timeline__item {
  display: flex;
  gap: 20px;
  padding-bottom: 20px;
  margin-bottom: 0;
  position: relative;
}

.timeline__item::before {
  content: '';
  position: absolute;
  left: 9px;
  top: 28px;
  bottom: 0;
  width: 2px;
  background: var(--clr-border);
  transition: background 0.3s ease;
}
.timeline__item.is-active::before { background: var(--clr-accent); }
.timeline__item:last-child::before { display: none; }

.timeline__dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--clr-accent);
  border: 3px solid var(--clr-bg);
  box-shadow: 0 0 0 2px var(--clr-accent);
  flex-shrink: 0;
  margin-top: 4px;
  /* sin sticky — queda en flujo normal */
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}
.timeline__item.is-active .timeline__dot {
  box-shadow: 0 0 0 4px var(--clr-accent);
  transform: scale(1.2);
}
.timeline__dot--edu {
  background: var(--clr-green);
  box-shadow: 0 0 0 2px var(--clr-green);
}
.timeline__item.is-active .timeline__dot--edu {
  box-shadow: 0 0 0 4px var(--clr-green);
}

.timeline__card {
  background: var(--clr-surface2);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius);
  padding: 20px 24px;
  flex: 1;
  align-self: start;
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition);
  position: relative;
}

.timeline__expand-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  position: absolute;
  top: 16px;
  right: 16px;
  padding: 5px 14px;
  border-radius: 99px;
  border: 1px solid #0ea5e935;
  background: #0ea5e910;
  color: var(--clr-accent);
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .04em;
  cursor: pointer;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.3s ease, transform 0.3s ease,
              background var(--transition), border-color var(--transition);
  pointer-events: none;
}
.timeline__expand-btn svg {
  transition: transform 0.3s ease;
}
.timeline__item.is-active .timeline__expand-btn {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.timeline__item.is-active .timeline__card {
  padding-right: 110px; /* espacio para el botón */
}
.timeline__expand-btn:hover {
  background: #0ea5e920;
  border-color: #0ea5e960;
}
.timeline__card.is-expanded .timeline__expand-btn svg {
  transform: rotate(180deg);
}
.timeline__card.is-expanded {
  border-color: #0ea5e940;
  box-shadow: 0 12px 40px #0ea5e915;
}
.timeline__card:hover { border-color: #0ea5e940; }

.timeline__date {
  font-size: .78rem;
  font-weight: 600;
  color: var(--clr-muted);
  letter-spacing: .05em;
  margin-bottom: 6px;
  display: block;
}

.timeline__role {
  font-family: var(--font-head);
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.timeline__company {
  font-size: .85rem;
  color: var(--clr-accent);
  margin-bottom: 12px;
  font-weight: 500;
}

.timeline__bullets {
  list-style: none;
  padding: 0;
}
.timeline__bullets li {
  font-size: .88rem;
  color: var(--clr-muted);
  padding-left: 14px;
  position: relative;
  margin-bottom: 4px;
}
.timeline__bullets li::before {
  content: '·';
  position: absolute;
  left: 0;
  color: var(--clr-accent);
  font-size: 1.2rem;
  line-height: 1.3;
}

/* ═══════════════════════════════════════════
   CONTACT
═══════════════════════════════════════════ */
.contact {
  padding: 120px 0;
}

.contact__layout {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 64px;
  align-items: start;
}

.contact__info {
  display: flex;
  flex-direction: column;
  gap: 32px;
  padding-top: 8px;
}

.contact__item {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.contact__icon {
  width: 44px; height: 44px;
  background: var(--clr-surface2);
  border: 1px solid var(--clr-border);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.contact__icon svg {
  width: 20px; height: 20px;
  fill: var(--clr-accent);
  stroke: none;
}

.contact__label {
  font-size: .78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--clr-muted);
  margin-bottom: 4px;
}

.contact__value {
  font-size: .95rem;
  font-weight: 500;
  color: var(--clr-text);
  transition: color var(--transition);
}
.contact__value:hover { color: var(--clr-accent); }

/* ── Form ── */
.contact__form {
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius);
  padding: 36px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-size: .85rem;
  font-weight: 600;
  color: var(--clr-muted);
}

.form-group input,
.form-group textarea {
  background: var(--clr-surface2);
  border: 1.5px solid var(--clr-border);
  border-radius: 10px;
  padding: 12px 16px;
  color: var(--clr-text);
  font-family: var(--font-sans);
  font-size: .95rem;
  resize: vertical;
  transition: border-color var(--transition);
  outline: none;
}

.form-group input::placeholder,
.form-group textarea::placeholder { color: var(--clr-muted); }

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--clr-accent);
  box-shadow: 0 0 0 3px #7c6bff20;
}

/* ═══════════════════════════════════════════
   FOOTER
═══════════════════════════════════════════ */
.footer {
  background: var(--clr-surface);
  border-top: 1px solid var(--clr-border);
  padding: 32px 0;
}

.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.footer__copy {
  font-size: .85rem;
  color: var(--clr-muted);
}

.footer__links {
  display: flex;
  gap: 28px;
}
.footer__links a {
  font-size: .85rem;
  color: var(--clr-muted);
  transition: color var(--transition);
}
.footer__links a:hover { color: var(--clr-text); }

/* ═══════════════════════════════════════════
   FLOATING AVATAR
═══════════════════════════════════════════ */
.floating-avatar {
  position: fixed;
  z-index: 101;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  will-change: left, top, width, height, opacity;
}

.floating-avatar__ring {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  padding: 3px;
  background: conic-gradient(var(--clr-accent), var(--clr-green), var(--clr-accent2), var(--clr-accent));
  animation: spin 8s linear infinite;
}

.floating-avatar__inner {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--clr-surface2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-head);
  font-weight: 700;
  color: var(--clr-accent);
  animation: spin 8s linear infinite reverse;
  overflow: hidden;
}

/* Foto: capa superior, se desvanece según progreso */
.floating-avatar__photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  opacity: 1;          /* JS actualiza esto */
  transition: opacity 0.05s linear;
}

/* Iniciales: debajo de la foto, aparecen al final */
.floating-avatar__initials {
  position: relative;
  z-index: 1;
  line-height: 1;
  opacity: 0;          /* JS actualiza esto */
  transition: opacity 0.05s linear;
}

/* Ya no se usa, pero por si acaso */
.floating-avatar__inner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

/* ═══════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════ */
@media (max-width: 900px) {
  .hero {
    flex-direction: column-reverse;
    text-align: center;
    padding: calc(var(--nav-h) + 20px) 24px 80px;
    gap: 40px;
  }
  .hero__tag { justify-content: center; }
  .hero__bio { margin: 0 auto 36px; }
  .hero__cta { justify-content: center; }
  .avatar-ring { width: 200px; height: 200px; }
  .avatar-placeholder { font-size: 2.5rem; }

  .experience__layout { grid-template-columns: 1fr; }
  .experience__left { position: static; }

  .contact__layout { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .nav { padding: 0 20px; }
  .nav__links { display: none; flex-direction: column; position: absolute; top: var(--nav-h); left: 0; right: 0; background: #0a0a0fee; padding: 20px; gap: 20px; border-bottom: 1px solid var(--clr-border); }
  .nav__links.open { display: flex; }
  .nav__burger { display: flex; }

  .projects__grid { grid-template-columns: 1fr; }

  .timeline__section-label { margin-left: 28px; }

  .contact__form { padding: 24px; }

  .footer__inner { flex-direction: column; align-items: flex-start; }
}

/* ═══════════════════════════════════════════
   PROJECT CARD FILTER ANIMATION
═══════════════════════════════════════════ */
.project-card.hidden {
  display: none;
}

.project-card {
  animation: fadeUp .4s ease both;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
