/* ===== BRAND ===== */
.nav__brand {
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: 0.04em;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
}

/* Marvin */
.brand-marvin {
  color: var(--text-main);
  transition: color 0.3s ease;
}

/* Apps (resaltado) */
.brand-apps {
  margin-left: 2px;
  color: var(--brand-apps-color);
  position: relative;
  transition: color 0.3s ease;
}

/* underline animation */
.brand-apps::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -4px;
  width: 0;
  height: 2px;
  background-color: var(--brand-apps-color);
  transition: width 0.3s ease, left 0.3s ease;
}

/* Hover */
.nav__brand:hover .brand-apps::after {
  width: 100%;
  left: 0;
}

.nav__brand:active {
  transform: scale(0.96);
}

.nav__brand {
  animation: brandFadeIn 0.6s ease;
}

@keyframes brandFadeIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}


/* ===== BUTTONS ===== */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: 10px;
  font-weight: 600;
  background-color: var(--accent);
  color: white;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}






/* ===== SECTION TITLES (GLOBAL) ===== */



nav a {
  position: relative;
  transition: color 0.25s ease;
}

nav a.active {
  color: var(--accent);
  font-weight: 600;
}


/* ===== NAV LINKS ===== */
.nav__menu a {
  position: relative;
  font-weight: 600;
  padding: 0.3rem 0;
  color: var(--text-main);
  transition: color 0.25s ease;
}



/* Hover underline */
.nav__menu a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 100%;
  height: 2px;
  background-color: var(--accent);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.25s ease;
}

/* Hover */
.nav__menu a:hover {
  color: var(--accent);
}

.nav__menu a:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* Active link */
.nav__menu a.active {
  color: var(--accent);
}

.nav__menu a.active::after {
  transform: scaleX(1);
}




/* ===== TOGGLES BASE ===== */
.toggle {
  position: relative;
  border: none;
  cursor: pointer;
  background-color: var(--bg-secondary);
  box-shadow: var(--shadow);
  border-radius: 999px;
  display: flex;
  align-items: center;
  padding: 0.3rem;
  transition: background-color 0.3s ease, transform 0.15s ease;
}

.toggle:active {
  transform: scale(0.94);
}


/* ===== LANGUAGE TOGGLE ===== */
.toggle-lang {
  width: 70px;
  height: 32px;
  justify-content: space-between;
  padding: 0.3rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.lang-option {
  z-index: 2;
  width: 50%;
  text-align: center;
  color: var(--text-muted);
  transition: color 0.3s ease;
}

.lang-indicator {
  position: absolute;
  top: 3px;
  left: 3px;
  width: calc(50% - 3px);
  height: calc(100% - 6px);
  background-color: var(--lang-background-color);
  border-radius: 999px;
  transition: transform 0.3s ease;
}

/* Estado EN activo */
body[data-lang="en"] .lang-indicator {
  transform: translateX(100%);
}

body[data-lang="es"] .lang-option[data-lang="es"],
body[data-lang="en"] .lang-option[data-lang="en"] {
  color: #fff;
}



/* ===== THEME TOGGLE ===== */
.toggle-theme {
  width: 42px;
  height: 32px;
  justify-content: center;
}

.theme-icon {
  position: absolute;
  font-size: 1rem;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.theme-icon.sun {
  opacity: 0;
  transform: scale(0.8);
}

.theme-icon.moon {
  opacity: 1;
}

/* Light theme */
body[data-theme="light"] .theme-icon.sun {
  opacity: 1;
  transform: scale(1);
}

body[data-theme="light"] .theme-icon.moon {
  opacity: 0;
  transform: scale(0.8);
}



/* ===== HERO ===== */
.hero__content {
  max-width: 600px;
}

.hero__name {
  font-size: clamp(2.2rem, 5vw, 3rem);
  font-weight: 800;
  margin-bottom: .5rem;
}

.hero__title {
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 1rem;
}

.hero__subtitle {
  font-size: 1.05rem;
  line-height: 1.7;
  margin-bottom: 1.2rem;
  color: var(--text-main);
}

.hero__tagline {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

@media (max-width: 768px) {
  .section {
    padding-top: 1rem;
  }
}



/* ===== PROJECT CARDS ===== */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}

.project-card {
  background-color: var(--bg-secondary);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.project-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.project-card__image {
  aspect-ratio: 16 / 9;
  width: 100%;
  overflow: hidden;
}

.project-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-card__content {
  padding: 1.5rem;
}

.project-card__title {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.project-card__description {
  font-size: 1rem;
  margin-bottom: 1rem;
}

.project-card__stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
  color: var(--text-muted);
}

.stack-item {
  font-size: 0.75rem;
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  background-color: rgba(10, 126, 139, 0.2);
  color: var(--text-muted);
}

.project-card__footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.project-card__link {
  font-weight: 600;
  color: var(--text-muted);
}



/* ===== ROLES / TABS ===== */

.roles {
  max-width: 800px;
  max-height: 600px;
  margin: 0 auto;
}


/* ===== ROLES TABS ===== */
.roles-tabs {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.roles-tabs button {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-secondary);
  position: relative;
  transition: color 0.3s ease;
  font-size: 1rem;
}



/* ===== ROLE CARD ===== */
.role-card {
  max-width: 700px;
  padding: 2rem;
  border-radius: 16px;
  background-color: var(--bg-secondary);
  box-shadow: var(--shadow);
  animation: roleFadeIn 0.4s ease;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Header: icon + title */
.role-card .role-icon,
.role-card .role-title {
  display: inline-flex;
  align-items: center;
}


.role-card {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas:
    "icon title"
    "desc desc";
  column-gap: 0.75rem;
}

/* Icon */
.role-icon {
  grid-area: icon;
  font-size: 2rem;
  line-height: 1;
}

/* Title */
.role-title {
  grid-area: title;
  font-size: 1.1rem;
  font-weight: 700;
  align-self: center;
}

/* Description */
.role-description {
  grid-area: desc;
  margin-top: 0.5rem;
}





/* Animación */
@keyframes roleFadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}



/* ===== R1.1 – ROLES TABS UX ===== */

.roles-tabs {
  position: relative;
}

/* Base tab */
.roles-tabs button {
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  transition:
    color 0.25s ease,
    background-color 0.25s ease;
}

/* Hover */
.roles-tabs button:hover {
  color: var(--accent);
  background-color: var(--bg-secondary);

}

/* Active tab (aria-selected=true) */
.roles-tabs button[aria-selected="true"] {
  background-color: var(--bg-secondary);
  color: var(--accent);
}

.roles-tabs button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ===== R1.1 – ROLE CONTENT TRANSITION ===== */



.role-card {
  animation: roleSlideIn 0.4s ease;
}

@keyframes roleContentFade {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}


.role-card {
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.role-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}


/* ===== R1.3 – ROLES SLIDE TRANSITION ===== */
.role-card {
  animation: roleSlideIn 0.4s ease;
}

@keyframes roleSlideIn {
  from {
    opacity: 0;
    transform: translateX(12px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}








/* ======================================================
   CV SECTION – CLEAN & STABLE
   ====================================================== */

/* CV section container */
#cv {
  position: relative;
  margin-bottom: 3rem;
}

/* Title spacing (CRÍTICO para scroll UX) */
#cv .section__title {
  margin-bottom: 3rem;
}

/* ======================================================
   TIMELINE (SINGLE SYSTEM – FINAL)
   ====================================================== */

.timeline {
  position: relative;
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 0;
  list-style: none;
}


/* Central vertical line */
.timeline::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  background-color: var(--accent);
  transform: translateX(-50%);
}

/* Timeline item */
.timeline-item {
  position: relative;
  width: 50%;
  padding: 1rem 2rem;
  box-sizing: border-box;
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 0.6s ease,
    transform 0.6s ease;
}


/* Visible */
.timeline-item.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Alternating sides */
.timeline-item.left {
  left: 0;
  text-align: right;
}

.timeline-item.right {
  left: 50%;
  text-align: left;
}

/* Timeline icon */
.timeline-icon {
  position: absolute;
  top: 1.5rem;
  width: 36px;
  height: 36px;
  border-radius: 12%;
  background-color: var(--bg-secondary);
  border: 1px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  z-index: 2;
}

/* Align icon */
.timeline-item.left .timeline-icon {
  right: -18px;
}

.timeline-item.right .timeline-icon {
  left: -18px;
}

/* Content card */
.timeline-content {
  background-color: var(--bg-secondary);
  padding: 1.25rem;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.06),
    0 1px 3px rgba(0, 0, 0, 0.08);
}

.timeline-content:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}


/* Date */
.timeline-date {
  display: block;
  font-size: 0.8rem;
  color: var(--accent);
  margin-bottom: 0.3rem;
}

/* Title */
.timeline-content h3 {
  margin: 0 0 0.4rem;
  font-size: 1.1rem;
  font-weight: 700;
}

/* Description */
.timeline-content p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-secondary);
}

/* ======================================================
   MOBILE
   ====================================================== */
@media (max-width: 768px) {
  .timeline-content {
    max-width: 100%;
  }

  .timeline::before {
    left: 17px;
  }

  .timeline-item {
    width: 100%;
    left: 0 !important;
    padding-left: 3rem;
    padding-right: 0;
    text-align: left;
  }

  .timeline-item.left,
  .timeline-item.right {
    left: 0 !important;
  }

  .timeline-icon {
    left: 0px !important;
    right: auto !important;
  }
}









/* ===== CONTACT ===== */
.contact {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.contact__item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 1.5rem;
  background-color: var(--bg-secondary);
  border-radius: 14px;
  box-shadow: var(--shadow);
  font-weight: 600;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.contact__item:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}

.contact__icon {
  font-size: 1.2rem;
}

.section::after {
  content: '';
  display: block;
  width: 60px;
  height: 4px;
  background-color: var(--accent);
  margin: 3rem auto 20rem;
  border-radius: 2px;
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.contact__subtitle {
  text-align: center;
  margin-bottom: 5rem;
  color: var(--text-muted);
  font-size: 1.3rem;
  margin-left: auto;
  margin-right: auto;
}

@media (max-width: 768px) {
  .contact__item {
    width: 90%;
    justify-content: center;
    margin: 0;
    padding-top: 0.3rem;
    padding-bottom: 0;
  }

  .contact__subtitle {
    margin-top: -20px;
    margin-bottom: 20px;
  }

  .contact {
    gap: 1rem;
  }

}