/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   styles.css — Portafolio Creativo — Armando
   Workspace-Inspired • 3D Cards • Scrollable
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

/* ═══════════════════════════════════════════
   1. CSS VARIABLES
   ═══════════════════════════════════════════ */
:root {
  --color-dark: #333333;
  --color-text: #555555;
  --color-accent-1: #FDC10D;
  --color-accent-2: #1AA7C5;
  --color-accent-3: #FF8E00;
  --color-accent-4: #FF8365;
  --color-accent-5: #88A80D;
  --color-accent-6: #93437A;

  --color-bg: #F8F8F8;
  --color-white: #FFFFFF;
  --color-gray-50: #FAFAFA;
  --color-gray-100: #F5F5F5;
  --color-gray-200: #EEEEEE;
  --color-gray-300: #DDDDDD;
  --color-gray-400: #AAAAAA;
  --color-gray-500: #888888;
  --color-gray-600: #666666;

  --font-primary: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-secondary: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  --space-4xl: 6rem;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-round: 50%;

  --glass-bg: rgba(255, 255, 255, 0.72);
  --glass-border: rgba(255, 255, 255, 0.4);
  --glass-blur: 16px;

  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.6s cubic-bezier(0.4, 0, 0.2, 1);

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.12);
  --shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.16);

  --z-canvas: 0;
  --z-content: 10;
  --z-nav: 100;
  --z-modal: 200;
  --z-loader: 300;
}


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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-secondary);
  color: var(--color-dark);
  background: var(--color-bg);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
}

a {
  text-decoration: none;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
  font-size: inherit;
}

::selection {
  background: var(--color-accent-1);
  color: var(--color-white);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-xl);
}


/* ═══════════════════════════════════════════
   3. CANVAS 3D (Particle Background)
   ═══════════════════════════════════════════ */
#canvas-3d {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: var(--z-canvas);
  pointer-events: none;
}


/* ═══════════════════════════════════════════
   4. LOADER
   ═══════════════════════════════════════════ */
.loader {
  position: fixed;
  inset: 0;
  z-index: var(--z-loader);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--color-white);
  transition: opacity 0.8s ease;
}

.loader--hidden {
  pointer-events: none;
}

.loader__logo {
  width: 90px;
  height: 90px;
  margin-bottom: var(--space-xl);
  display: flex;
  align-items: center;
  justify-content: center;
}

.loader__logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.loader__dots {
  display: flex;
  gap: 10px;
  margin-bottom: var(--space-lg);
}

.loader__dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  animation: loaderDot 1.4s ease-in-out infinite;
}

@keyframes loaderDot {

  0%,
  80%,
  100% {
    transform: scale(0.5);
    opacity: 0.4;
  }

  40% {
    transform: scale(1.2);
    opacity: 1;
  }
}

.loader__text {
  font-size: 0.95rem;
  color: var(--color-gray-500);
  margin-bottom: var(--space-lg);
}

.loader__progress {
  width: 200px;
  height: 3px;
  background: var(--color-gray-200);
  border-radius: 2px;
  overflow: hidden;
}

.loader__progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--color-accent-1), var(--color-accent-2), var(--color-accent-3));
  border-radius: 2px;
  transition: width 0.4s ease;
}


/* ═══════════════════════════════════════════
   5. NAVIGATION
   ═══════════════════════════════════════════ */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-nav);
  padding: var(--space-md) var(--space-xl);
  transition: var(--transition-normal);
}

.nav--scrolled {
  padding: var(--space-sm) var(--space-xl);
}

.nav__inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-xs) var(--space-xs);
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  transition: var(--transition-normal);
}

.nav--scrolled .nav__inner {
  padding: var(--space-xs) var(--space-xs);
  box-shadow: var(--shadow-md);
}

.nav__logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-family: var(--font-primary);
  font-weight: 700;
  font-size: 1.2rem;
  transition: var(--transition-fast);
}

.nav__logo:hover {
  color: var(--color-accent-2);
}

.nav__logo-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-round);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 2px;
}

.nav__logo-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius-round);
}

.nav__right {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.nav__links {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.nav__link {
  padding: var(--space-xs) var(--space-md);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-gray-600);
  border-radius: var(--radius-sm);
  transition: var(--transition-fast);
}

.nav__link:hover {
  color: var(--color-accent-2);
  background: rgba(26, 167, 197, 0.08);
}

.nav__link--active {
  color: var(--color-accent-2);
  font-weight: 600;
}

.lang-switch {
  display: flex;
  align-items: center;
  background: var(--color-gray-100);
  border-radius: var(--radius-lg);
  padding: 3px;
  border: 1px solid var(--color-gray-200);
}

.lang-switch__btn {
  padding: 5px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  color: var(--color-gray-500);
  transition: var(--transition-fast);
}

.lang-switch__btn:hover {
  color: var(--color-dark);
}

.lang-switch__btn.active {
  background: var(--color-white);
  color: var(--color-accent-2);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.nav__cta {
  padding: var(--space-xs) var(--space-lg);
  background: linear-gradient(135deg, var(--color-accent-2), #0D8FA8);
  color: var(--color-white) !important;
  font-size: 0.88rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  transition: var(--transition-fast);
  box-shadow: 0 2px 10px rgba(26, 167, 197, 0.3);
}

.nav__cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(26, 167, 197, 0.4);
}

.nav__toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
}

.nav__toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-dark);
  border-radius: 2px;
  transition: var(--transition-fast);
}

.nav__toggle--active span:nth-child(1) {
  transform: rotate(45deg) translateY(5px) translateX(5px);
}

.nav__toggle--active span:nth-child(2) {
  opacity: 0;
}

.nav__toggle--active span:nth-child(3) {
  transform: rotate(-45deg) translateY(-5px) translateX(5px);
}


/* ═══════════════════════════════════════════
   6. HERO SECTION
   ═══════════════════════════════════════════ */
.hero {
  position: relative;
  z-index: var(--z-content);
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  /* background-color: var(--color-bg); */
}

.hero__top {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: var(--space-3xl);
  padding: 60px var(--space-2xl) var(--space-xl);
  max-width: fit-content;
  margin: 120px auto 0;
  width: auto;
  pointer-events: none;
  
  /* Glassmorphism Effect */
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(15px) saturate(180%);
  -webkit-backdrop-filter: blur(15px) saturate(180%);
  border-radius: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.4);
}

.hero__top > * {
  pointer-events: auto; /* Enable buttons/links */
}

/* Profile Image */
.hero__profile-wrap {
  position: relative;
  flex-shrink: 0;
}

.hero__profile-img {
  width: 180px;
  height: 180px;
  border-radius: var(--radius-round);
  object-fit: cover;
  border: 4px solid var(--color-white);
  box-shadow: var(--shadow-lg);
  position: relative;
  z-index: 2;
}

.hero__profile-ring {
  position: absolute;
  top: -8px;
  left: -8px;
  width: calc(100% + 16px);
  height: calc(100% + 16px);
  border-radius: var(--radius-round);
  border: 3px solid transparent;
  background: linear-gradient(135deg, var(--color-accent-1), var(--color-accent-2), var(--color-accent-3)) border-box;
  -webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: spinRing 8s linear infinite;
}

@keyframes spinRing {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

/* Hero Text */
.hero__text {
  flex: 1;
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-xs) var(--space-md);
  background: var(--color-white);
  border: 1px solid var(--color-gray-200);
  border-radius: var(--radius-xl);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-gray-600);
  margin-bottom: var(--space-lg);
  box-shadow: var(--shadow-sm);
}

.hero__badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-accent-5);
  animation: pulseDot 2s ease-in-out infinite;
}

@keyframes pulseDot {

  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(136, 168, 13, 0.5);
  }

  50% {
    box-shadow: 0 0 0 6px rgba(136, 168, 13, 0);
  }
}

.hero__title {
  font-family: var(--font-primary);
  font-size: clamp(2rem, 4.5vw, 3.2rem);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: var(--space-lg);
}

.hero__title-line2 {
  display: block;
  background: linear-gradient(135deg, var(--color-accent-1), var(--color-accent-3), var(--color-accent-4));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero__description {
  font-size: 1.05rem;
  color: var(--color-text);
  line-height: 1.7;
  margin-bottom: var(--space-xl);
  max-width: 520px;
}

.hero__actions {
  display: flex;
  gap: var(--space-md);
  flex-wrap: wrap;
}

/* Workspace Image — FULL-VIEWPORT PINNED */
.hero__workspace {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  overflow: hidden;
}

/* Gradient overlay — blends image top edge into the background */
.hero__workspace-gradient {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 35%;
  background: linear-gradient(to bottom,
      var(--color-bg) 0%,
      rgba(248, 248, 248, 0.85) 25%,
      rgba(248, 248, 248, 0.4) 55%,
      transparent 100%);
  z-index: 2;
  pointer-events: none;
}

.hero__workspace picture {
  display: contents;
}

.hero__workspace-img,
.hero__workspace-canvas {
  display: block;
  width: 100%;
  height: 100%;
  transition: transform 0.15s ease-out;
  will-change: transform;
}


/* ═══════════════════════════════════════════
   7. BUTTONS
   ═══════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 13px 28px;
  font-family: var(--font-primary);
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  transition: var(--transition-fast);
}

.btn--primary {
  background: linear-gradient(135deg, var(--color-accent-2), #0D8FA8);
  color: var(--color-white);
  box-shadow: 0 4px 16px rgba(26, 167, 197, 0.3);
}

.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(26, 167, 197, 0.45);
}

.btn--outline {
  background: var(--color-white);
  border: 1.5px solid var(--color-gray-300);
  color: var(--color-dark);
}

.btn--outline:hover {
  border-color: var(--color-accent-1);
  color: var(--color-accent-1);
  background: rgba(253, 193, 13, 0.05);
}

.btn__icon {
  font-size: 1.1rem;
  transition: transform 0.3s ease;
}

.btn:hover .btn__icon {
  transform: translateX(3px);
}


/* ═══════════════════════════════════════════
   8. STATS RIBBON
   ═══════════════════════════════════════════ */
.stats-ribbon {
  position: relative;
  z-index: 20;
  padding: var(--space-3xl) 0;
  background-color: var(--color-bg); /* Ensure it covers the canvas behind it */
}

.stats-ribbon__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-lg);
}

.stats-ribbon__item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-lg) var(--space-xl);
  background: var(--color-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-gray-200);
  transition: var(--transition-fast);
}

.stats-ribbon__item:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.stats-ribbon__icon {
  font-size: 1.8rem;
}

.stats-ribbon__value {
  font-family: var(--font-primary);
  font-weight: 800;
  font-size: 1.6rem;
  color: var(--color-dark);
}

.stats-ribbon__label {
  font-size: 0.8rem;
  color: var(--color-gray-500);
  display: block;
}


/* ═══════════════════════════════════════════
   9. SECTION HEADERS
   ═══════════════════════════════════════════ */
.section-header {
  text-align: center;
  margin-bottom: var(--space-3xl);
}

.section-label {
  display: inline-block;
  font-family: var(--font-primary);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-accent-2);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--space-sm);
  padding: var(--space-xs) var(--space-md);
  background: rgba(26, 167, 197, 0.08);
  border-radius: var(--radius-xl);
}

.section-title {
  font-family: var(--font-primary);
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: var(--space-md);
}

.section-desc {
  font-size: 1.05rem;
  color: var(--color-text);
  max-width: 560px;
  margin: 0 auto;
  line-height: 1.7;
}

.gradient-text {
  background: linear-gradient(135deg, var(--color-accent-1), var(--color-accent-3), var(--color-accent-4));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}


/* ═══════════════════════════════════════════
   10. PORTFOLIO CATEGORIES (3D Cards)
   ═══════════════════════════════════════════ */
.portfolio {
  position: relative;
  z-index: var(--z-content);
  padding: var(--space-4xl) 0;
}

.categories-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-xl);
}

.cat-card {
  perspective: 800px;
  cursor: pointer;
}

.cat-card__inner {
  position: relative;
  border-radius: var(--radius-lg);
  background: var(--color-white);
  border: 1px solid var(--color-gray-200);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  transform-style: preserve-3d;
  will-change: transform;
}

/* top accent bar now lives on the face bottom-border, not ::before */

.cat-card__inner::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
      rgba(255, 255, 255, 0.1) 0%,
      transparent 60%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.cat-card:hover .cat-card__inner {
  transform: translateY(-8px) rotateX(4deg);
  box-shadow: var(--shadow-lg);
  border-color: var(--card-accent, var(--color-accent-2));
}

/* no ::before accent bar on hover (removed) */

.cat-card:hover .cat-card__inner::after {
  opacity: 1;
}

/* cat-card__icon removed — image replaces emoji icon */

.cat-card__title {
  font-family: var(--font-primary);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-dark);
  margin: 0;
  transition: color 0.3s ease;
}

.cat-card:hover .cat-card__title {
  color: var(--card-accent, var(--color-accent-2));
}

.cat-card__bar {
  width: 36px;
  height: 3px;
  background: var(--card-accent, var(--color-accent-2));
  border-radius: 2px;
  margin: var(--space-sm) auto 0;
  transition: width 0.35s ease;
}

.cat-card:hover .cat-card__bar {
  width: 64px;
}

/* -- Cat-card: poster image layout -- */
.cat-card__img-wrap {
  position: relative;
  width: 100%;
  height: 160px; /* Fixed height to avoid horizontal misalignment */
  overflow: hidden;
  flex-shrink: 0;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cat-card__img {
  width: 100%;
  max-height: 160px;
  height: auto;
  object-fit: contain;
  display: block;
  mix-blend-mode: multiply;
  transform: scale(1.02);
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.cat-card:hover .cat-card__img {
  transform: scale(1.05);
}

.cat-card__img-overlay {
  display: none;
}

/* Bottom label panel */
.cat-card__face--front {
  position: relative;
  z-index: 1;
  padding: var(--space-md) var(--space-xl) var(--space-lg);
  text-align: center;
  background: var(--color-white);
  border-top: 3px solid var(--card-accent, var(--color-accent-2));
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}


/* ═══════════════════════════════════════════
   11. ABOUT SECTION (Dark Theme)
   ═══════════════════════════════════════════ */
.about {
  position: relative;
  z-index: var(--z-content);
  padding: var(--space-4xl) 0;
  background: #004d5e;
  color: #E0E0E0;
}

/* Override section header colors inside dark about */
.about .section-label {
  color: var(--color-accent-1);
  background: rgba(253, 193, 13, 0.12);
}

.about .section-title {
  color: #FFFFFF;
}

.about .section-desc {
  color: rgba(255, 255, 255, 0.7);
}

.about__inner {
  display: flex;
  align-items: center;
  gap: var(--space-4xl);
}

.about__visual {
  flex-shrink: 0;
}

.about__image-wrapper {
  position: relative;
  width: 400px;
  height: 400px;
  perspective: 900px;
  cursor: pointer;
}

.about__image-wrapper::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: calc(var(--radius-xl) + 4px);
  background: linear-gradient(135deg, rgba(26, 167, 197, 0.5), rgba(139, 92, 246, 0.4));
  opacity: 0;
  transition: opacity 0.4s ease;
  z-index: -1;
  filter: blur(8px);
}

.about__image-wrapper:hover::after {
  opacity: 1;
}

.about__image-inner {
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.1s ease-out;
  border-radius: var(--radius-xl);
}

.about__image {
  width: 100%;
  height: 100%;
  border-radius: var(--radius-xl);
  object-fit: cover;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  transition: box-shadow 0.4s ease;
}

.about__image-wrapper:hover .about__image {
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}

.about__content {
  flex: 1;
}

.about__text {
  font-size: 1.05rem;
  color: rgba(255, 255, 255, 0.75);
  line-height: 1.8;
  margin-bottom: var(--space-md);
}

.about__skills {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xl);
  margin-top: var(--space-3xl);
  padding-top: var(--space-xl);
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

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

.skill-group__label {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-dark);
  opacity: 0.8;
}

.skill-group__tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

/* Base tag — inherits color from parent group via CSS custom property */
.skill-tag {
  padding: 7px 16px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--tag-color, var(--color-accent-2));
  background: var(--tag-bg, rgba(26, 167, 197, 0.12));
  border: 1.5px solid var(--tag-border, rgba(26, 167, 197, 0.35));
  border-radius: var(--radius-xl);
  cursor: default;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.2s ease, background 0.25s ease;
}

.skill-tag:hover {
  border-color: var(--tag-color, var(--color-accent-2));
  box-shadow: 0 0 0 3px var(--tag-glow, rgba(26, 167, 197, 0.2));
  transform: scale(1.05);
  background: var(--tag-bg-hover, rgba(26, 167, 197, 0.2));
}

/* ── Per-category color tokens ── */

/* Web & 3D → Teal (#1AA7C5) */
.skill-group--web {
  --tag-color: #1AA7C5;
  --tag-bg: rgba(26, 167, 197, 0.12);
  --tag-bg-hover: rgba(26, 167, 197, 0.22);
  --tag-border: rgba(26, 167, 197, 0.4);
  --tag-glow: rgba(26, 167, 197, 0.25);
}

/* UI/UX → Purple (#93437A) */
.skill-group--uiux {
  --tag-color: #93437A;
  --tag-bg: rgba(147, 67, 122, 0.1);
  --tag-bg-hover: rgba(147, 67, 122, 0.2);
  --tag-border: rgba(147, 67, 122, 0.4);
  --tag-glow: rgba(147, 67, 122, 0.22);
}

/* 3D Anim → Orange (#FF8E00) */
.skill-group--anim {
  --tag-color: #FF8E00;
  --tag-bg: rgba(255, 142, 0, 0.1);
  --tag-bg-hover: rgba(255, 142, 0, 0.2);
  --tag-border: rgba(255, 142, 0, 0.4);
  --tag-glow: rgba(255, 142, 0, 0.22);
}

/* IA → Yellow (#FDC10D) */
.skill-group--ai {
  --tag-color: #C99600;
  --tag-bg: rgba(253, 193, 13, 0.1);
  --tag-bg-hover: rgba(253, 193, 13, 0.2);
  --tag-border: rgba(253, 193, 13, 0.45);
  --tag-glow: rgba(253, 193, 13, 0.25);
}

/* Audiovisual → Coral (#FF8365) */
.skill-group--av {
  --tag-color: #FF8365;
  --tag-bg: rgba(255, 131, 101, 0.1);
  --tag-bg-hover: rgba(255, 131, 101, 0.2);
  --tag-border: rgba(255, 131, 101, 0.4);
  --tag-glow: rgba(255, 131, 101, 0.22);
}

/* Entornos & SO → Green (#88A80D) */
.skill-group--os {
  --tag-color: #88A80D;
  --tag-bg: rgba(136, 168, 13, 0.1);
  --tag-bg-hover: rgba(136, 168, 13, 0.2);
  --tag-border: rgba(136, 168, 13, 0.4);
  --tag-glow: rgba(136, 168, 13, 0.22);
}


/* ═══════════════════════════════════════════
/* ═══════════════════════════════════════════
   12. SKILLS SECTION
   ═══════════════════════════════════════════ */
.skills-section {
  position: relative;
  z-index: var(--z-content);
  padding: var(--space-4xl) 0;
  background: var(--color-white);
  backdrop-filter: blur(2px);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.skills-section .about__skills {
  margin-top: var(--space-3xl);
  padding-top: 0;
  border-top: none;
}


/* ═══════════════════════════════════════════
   13. CONTACT SECTION (Info Cards)

   ═══════════════════════════════════════════ */
.contact {
  position: relative;
  z-index: var(--z-content);
  padding: var(--space-4xl) 0;
}

.contact__cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-auto-rows: 1fr; /* Forces all rows (and thus all cards) to have the same height */
  gap: var(--space-xl);
  max-width: 900px;
  margin: 0 auto;
  align-items: stretch;
}

.contact__card {
  position: relative;
  background: var(--color-white);
  border: 1px solid var(--color-gray-200);
  border-radius: var(--radius-lg);
  padding: var(--space-2xl) var(--space-xl);
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start; /* Consistent starting point for all icons/labels */
  height: 100%;
}

.contact__card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background: linear-gradient(90deg, var(--color-accent-2), var(--color-accent-1));
  transition: height 0.3s ease;
}

.contact__card:nth-child(2)::before {
  background: linear-gradient(90deg, var(--color-accent-3), var(--color-accent-4));
}

.contact__card:nth-child(3)::before {
  background: linear-gradient(90deg, var(--color-accent-1), var(--color-accent-3));
}

.contact__card:nth-child(4)::before {
  background: linear-gradient(90deg, var(--color-accent-5), var(--color-accent-2));
}

.contact__card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}

.contact__card:hover::before {
  height: 5px;
}

.contact__card-icon {
  font-size: 2.4rem;
  margin-bottom: var(--space-md);
  height: 60px; /* Fixed height for vertical sync */
  display: flex;
  align-items: center;
  justify-content: center;
}

.contact__card-label {
  font-family: var(--font-primary);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-gray-500);
  margin-bottom: var(--space-sm);
  height: 24px; /* Fixed height for vertical sync */
  display: flex;
  align-items: center;
  justify-content: center;
}

.contact__card-value {
  font-family: var(--font-primary);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-dark);
  line-height: 1.5;
}

.contact__card-detail {
  font-size: 0.88rem;
  color: var(--color-text);
  line-height: 1.5;
}

.contact__card-link {
  color: var(--color-accent-2);
  font-weight: 600;
  transition: var(--transition-fast);
}

.contact__card-link:hover {
  color: var(--color-accent-3);
  text-decoration: underline;
}


/* ═══════════════════════════════════════════
   13. PORTFOLIO GALLERY (Dynamic Masonry)
   ═══════════════════════════════════════════ */
.portfolio-gallery-wrapper {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition-normal);
}

.portfolio-gallery-wrapper--open {
  opacity: 1;
  visibility: visible;
}

.portfolio-gallery-wrapper__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.portfolio-gallery-wrapper__content {
  position: relative;
  width: 95vw;
  max-width: 1400px;
  max-height: 90vh;
  background: var(--color-white);
  border-radius: var(--radius-xl);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-xl);
  transform: scale(0.95);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.portfolio-gallery-wrapper--open .portfolio-gallery-wrapper__content {
  transform: scale(1);
}

.portfolio-gallery-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-lg) var(--space-2xl);
  border-bottom: 1px solid var(--color-gray-200);
  background: var(--color-gray-50);
}

.portfolio-gallery-title {
  font-family: var(--font-primary);
  font-weight: 800;
  font-size: 1.5rem;
  color: var(--color-dark);
}

.portfolio-gallery-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--color-gray-200);
  color: var(--color-text);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
  font-weight: bold;
}

.portfolio-gallery-close:hover {
  background: var(--color-accent-2);
  color: var(--color-white);
  transform: rotate(90deg);
}

.portfolio-gallery__overflow {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-xl);
}

.portfolio-group-title {
  grid-column: 1 / -1;
  font-family: var(--font-primary);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-accent-2);
  margin-top: var(--space-xl);
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-xs);
  border-bottom: 2px solid rgba(26, 167, 197, 0.2);
  letter-spacing: 1px;
}

.portfolio-group-title:first-child {
  margin-top: 0;
}

.portfolio-group-content {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

/* Specific layout for "App de Movilidad" (request to fit all in 1 row) 
   We force 5 columns to match the 5 images, causing them to shrink. */
.portfolio-group-content[data-group-name="App de Movilidad"] {
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}

.portfolio-group-content[data-group-name="App de Movilidad"] img {
  object-fit: contain;
  /* Prevents phones from getting cropped when scaling down */
  background: var(--color-gray-100);
}

@media (max-width: 920px) {
  .portfolio-group-content[data-group-name="App de Movilidad"] {
    grid-template-columns: repeat(5, 1fr);
    gap: 5px;
  }
}

.portfolio-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--space-md);
}

.gallery-item {
  break-inside: avoid;
  margin-bottom: var(--space-md);
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  cursor: zoom-in;
  background: var(--color-white);
}

.gallery-item--link-only {
  cursor: pointer;
}

.gallery-item img {
  width: 100%;
  display: block;
  transition: transform 0.4s ease;
}

.gallery-item:hover img {
  transform: scale(1.05);
}

.gallery-item__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: var(--space-md);
}

.gallery-item:hover .gallery-item__overlay {
  opacity: 1;
}

.gallery-item__title {
  color: var(--color-white);
  font-weight: bold;
  font-size: 1rem;
  margin-bottom: 4px;
}

.gallery-item__desc {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.8rem;
}

.gallery-item__link {
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
  width: 38px;
  height: 38px;
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-dark);
  transition: var(--transition-fast);
  box-shadow: var(--shadow-sm);
  pointer-events: auto;
}

.gallery-item__link:hover {
  background: var(--color-white);
  color: var(--color-accent-2);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.gallery-item__link svg {
  width: 18px;
  height: 18px;
}


/* ═══════════════════════════════════════════
   13.b. LIGHTBOX MODAL (Fullscreen Image View)
   ═══════════════════════════════════════════ */
.lightbox-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(10, 10, 10, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition-normal);
  flex-direction: column;
}

.lightbox-modal--open {
  opacity: 1;
  visibility: visible;
}

.lightbox-modal__close {
  position: absolute;
  top: 20px;
  right: 30px;
  font-size: 2.5rem;
  color: #fff;
  background: transparent;
  width: 50px;
  height: 50px;
  transition: transform 0.3s;
}

.lightbox-modal__close:hover {
  transform: scale(1.1);
}

.lightbox-modal__content {
  position: relative;
  max-width: 90vw;
  max-height: 80vh;
}

.lightbox-modal__img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: var(--radius-sm);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.lightbox-modal__caption {
  text-align: center;
  color: #fff;
  margin-top: 24px;
  font-size: 1.1rem;
  font-weight: 300;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-lg);
}

.lightbox-modal__text {
  max-width: 600px;
  line-height: 1.5;
}

.lightbox-modal__actions {
  display: flex;
  justify-content: center;
}

.lightbox-modal__cta {
  box-shadow: 0 4px 20px rgba(26, 167, 197, 0.4);
}

.lightbox-modal__nav {
  position: static;
  transform: none;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 10;
  backdrop-filter: blur(4px);
  flex-shrink: 0;
}

.lightbox-modal__nav:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

.lightbox-modal__nav svg {
  width: 20px;
  height: 20px;
}

.lightbox-modal__pagination {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 10;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(8px);
  padding: 8px 16px;
  border-radius: 999px;
}

.lightbox-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  cursor: pointer;
  transition: all 0.3s ease;
}

.lightbox-dot.active {
  background: #fff;
  transform: scale(1.3);
}


/* ═══════════════════════════════════════════
   14. CV MODAL
   ═══════════════════════════════════════════ */
.cv-modal {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  transition: var(--transition-normal);
}

.cv-modal--open {
  opacity: 1;
  visibility: visible;
}

.cv-modal__content {
  width: 90vw;
  max-width: 1400px;
  height: 85vh;
  background: var(--color-white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-xl);
  transform: scale(0.9) translateY(20px);
  transition: var(--transition-normal);
}

.cv-modal--open .cv-modal__content {
  transform: scale(1) translateY(0);
}

.cv-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--color-gray-200);
  background: var(--color-gray-100);
}

.cv-modal__title {
  font-family: var(--font-primary);
  font-weight: 700;
  font-size: 1.1rem;
}

.cv-modal__close {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  color: var(--color-gray-500);
  transition: var(--transition-fast);
}

.cv-modal__close:hover {
  background: var(--color-gray-200);
  color: var(--color-dark);
}

.cv-modal__body {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.cv-modal__pdf {
  flex: 1;
  width: 100%;
  min-height: 0;
  border: none;
  border-radius: var(--radius-sm);
}

.cv-modal__download {
  align-self: center;
  flex-shrink: 0;
}

.cv-modal__fallback {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--color-gray-500);
  gap: var(--space-md);
}


/* ═══════════════════════════════════════════
   15. FOOTER
   ═══════════════════════════════════════════ */
.footer {
  position: relative;
  z-index: var(--z-content);
  padding: var(--space-2xl) 0;
  background: var(--color-dark);
  border-top: 1px solid var(--color-gray-200);
}

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

.footer__copy {
  font-size: 0.82rem;
  color: var(--color-white);
  max-width: 55%;
  line-height: 1.4;
}

.footer__back-to-top {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-gray-100);
  color: var(--color-gray-900);
  border: none;
  cursor: pointer;
  transition: var(--transition-fast);
}

.footer__back-to-top:hover {
  background: var(--color-accent-2);
  color: var(--color-white);
  transform: translateY(-4px);
}

.footer__back-to-top svg {
  width: 24px;
  height: 24px;
}


/* ═══════════════════════════════════════════
   16. SCROLL ANIMATIONS (GSAP targets)
   ═══════════════════════════════════════════ */
.reveal {
  opacity: 0;
  transform: translateY(40px);
}

.reveal--visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.7s ease, transform 0.7s ease;
}


/* ═══════════════════════════════════════════
   17. RESPONSIVE
   ═══════════════════════════════════════════ */
@media (max-width: 1024px) {
  .stats-ribbon__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .categories-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .about__inner {
    gap: var(--space-2xl);
  }

  .contact__cards {
    grid-template-columns: 1fr;
    max-width: 500px;
  }
}

@media (max-width: 920px) {
  .nav__toggle {
    display: flex;
  }

  .nav__right {
    position: fixed;
    top: 80px;
    left: var(--space-md);
    right: var(--space-md);
    z-index: 9999;
    flex-direction: column;
    background: var(--color-white);
    border: 1px solid var(--color-gray-200);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    box-shadow: var(--shadow-lg);
    transform: translateY(-20px);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-normal);
  }

  .nav__right.nav__links--open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .nav__links {
    flex-direction: column;
    width: 100%;
  }

  .nav__link {
    width: 100%;
    padding: var(--space-sm) var(--space-md);
    text-align: center;
    font-size: 1rem;
  }

  .nav__cta {
    width: 100%;
    text-align: center;
    justify-content: center;
  }

  .lang-switch {
    width: 100%;
    justify-content: center;
  }

  .hero {
    height: 100vh;
    min-height: 600px;
  }

  .hero__top {
    flex-direction: column;
    text-align: center;
    gap: var(--space-xl);
    padding: 150px var(--space-lg) var(--space-2xl);
    max-width: 100%;
    width: 100%;
    height: 100vh;
    margin: 0;
    border-radius: 0;
    justify-content: center;
  }

  .hero__profile-img {
    width: 140px;
    height: 140px;
  }

  .hero__title {
    font-size: clamp(1.6rem, 6vw, 2.4rem);
  }

  .hero__description {
    margin-left: auto;
    margin-right: auto;
  }

  .hero__actions {
    justify-content: center;
  }

  .stats-ribbon__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
  }

  .stats-ribbon__item {
    padding: var(--space-md);
    flex-direction: column;
    text-align: center;
  }

  .categories-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
  }

  .portfolio-gallery {
    column-count: 2;
  }

  .about__inner {
    flex-direction: column;
    text-align: center;
  }

  .about__image-wrapper {
    width: 300px;
    height: 300px;
    margin: 0 auto;
  }

  .about__skills {
    justify-content: center;
  }

  .footer__inner {
    flex-direction: column;
    gap: var(--space-md);
    text-align: center;
  }

  .footer__copy {
    max-width: 100%;
  }
}

@media (max-width: 480px) {
  .categories-grid {
    grid-template-columns: 1fr;
  }

  .portfolio-gallery {
    column-count: 1;
  }

  .hero__actions {
    flex-direction: column;
    width: 100%;
  }

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

  .stats-ribbon__grid {
    grid-template-columns: 1fr;
  }

  .gallery-modal__body {
    grid-template-columns: 1fr;
  }
}


/* ═══════════════════════════════════════════
   PORTRAIT ORIENTATION — imagen hero sin límite
   ═══════════════════════════════════════════ */
@media (max-width: 920px) {
  .hero {
    overflow: hidden;
    /* recorta la imagen en el borde del hero, no se encima */
    height: auto;
  }

  .hero__workspace {
    flex: none;
    /* no limita el alto al espacio restante */
    margin-top: auto;
    /* empuja la imagen hacia abajo del texto */
  }

  .hero__workspace-img {
    max-height: none;
    /* imagen a tamaño completo, se corta en el borde del hero */
    width: 100vw;
  }
}

@media (orientation: landscape) and (max-height: 1200px) {
  .hero {
    height: 100vh;
    min-height: auto;
    overflow: hidden;
  }

  .hero__top {
    margin-top: 80px;
    padding: var(--space-lg) var(--space-2xl);
    gap: var(--space-lg);
    justify-content: center;
    border-radius: 1rem;
    max-width: fit-content;
    width: auto;
  }

  .hero__profile-img {
    width: 110px;
    height: 110px;
  }

  .hero__title {
    font-size: clamp(1.4rem, 4vw, 2.2rem);
    line-height: 1.1;
  }

  .hero__description {
    font-size: 0.95rem;
    max-width: 500px;
  }

  .hero__actions {
    gap: var(--space-md);
  }

  .btn {
    padding: var(--space-xs) var(--space-md);
    font-size: 0.9rem;
  }
}

/* ═══════════════════════════════════════════
   Ultra-Short Landscape (Height < 460px)
   Switch to horizontal layout to save vertical space.
   ═══════════════════════════════════════════ */
@media (orientation: landscape) and (max-height: 460px) {
  .hero__top {
    flex-direction: row;
    justify-content: center;
    align-items: center;
    text-align: left;
    gap: var(--space-xl);
    padding: var(--space-lg) var(--space-xl);
    margin-top: 70px;
    max-width: 95%;
  }

  .hero__profile-img {
    width: 90px;
    height: 90px;
  }

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

  .hero__title {
    font-size: 1.3rem;
  }

  .hero__description {
    font-size: 0.85rem;
    margin-bottom: var(--space-sm);
    max-width: 400px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .hero__actions {
    justify-content: flex-start;
    gap: var(--space-sm);
  }

  .btn {
    padding: 6px 14px;
    font-size: 0.85rem;
  }
}


/* ═══════════════════════════════════════════
   18. ACCESSIBILITY
   ═══════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}