﻿/* ========================================
   GLOBAL VARIABLES
======================================== */
:root {
  --accent-color: rgb(255, 237, 0);
  --bg-color: #ffffff;          /* Fondo claro por defecto */
  --panel-color: #f3f3f3;       /* Color de panel en modo claro */
  --text-color: #000000;        /* Texto oscuro en modo claro */
}
/* Dark mode */
body.dark-mode {
  --bg-color: #1b1c23;
  --panel-color: #272833;
  --text-color: #ffffff;
}

/* ========================================
   GLOBAL STYLES
======================================== */
body {
  font-family: "Kanit", sans-serif;
  background-color: var(--bg-color);
  overflow-x: hidden;
  color: var(--text-color);
  transition: background-color 0.4s ease, color 0.4s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

h1, h2 {
  font-family: "Kanit", sans-serif;
  font-weight: 500;
}

h1 { line-height: 40px; }
h2 { margin-bottom: 0.3em; }
p { line-height: 30px; }

a {
  color: var(--text-color);
  text-decoration: none;
}

/* Typography Utilities */
.text-primary {
  font-weight: 600;
  font-size: 1.2em;
}

.text-secondary {
  color: #adadad;
}

.logo {
  width: 3em;
  margin-bottom: 0.5em;
}

/* ========================================
   GRID LAYOUT
======================================== */
.grid {
  max-width: 1920px;
  margin: 0 auto;
  position: relative;
}

.grid-panels {
  padding: 1.5em;
  display: grid;
  gap: 1.2em;
  transition: 300ms;
  position: relative;
  /* Global: columnas iguales */
  grid-template-columns: repeat(4, 1fr);
}

.panel {
  background-color: var(--panel-color);
  border-radius: 12px;
  padding: 1.5em;
  transition: transform 0.3s ease, background-color 0.4s ease, color 0.4s ease;
  color: var(--text-color);
}

.panel:hover {
  transform: translateY(-2px);
}

/* Base alignment for specific panels */
.panel:nth-child(3),
.panel:nth-child(4),
.panel:nth-child(5),
.panel:nth-child(6) {
  display: flex;
  justify-content: center;
  align-items: center;
}

.panel:nth-child(7),
.panel:nth-child(8) {
  display: flex;
  align-items: flex-end;
}

/* ========================================
   PANEL STYLES
======================================== */
.brand, .travel {
  display: flex;
  justify-content: space-between;
  flex-direction: column;
  gap: 1em;
}

/* Tighter line-height for brand description text */
.panel.brand .text-secondary {
  line-height: 1.3;
}

/* Brand description - clearer in light mode only */
body:not(.dark-mode) .panel.brand .text-secondary {
  color: #ffffff;
  mix-blend-mode: difference;
}

/* Brand panel: foto a la derecha con degradado */
.panel.brand {
  position: relative;
  overflow: hidden;
}

.brand-text {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 1em;
  position: relative;
  z-index: 3; /* texto por encima de imagen y degradado */
}

.brand-photo-side {
  position: relative;
  flex: 0 0 60%;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  overflow: hidden;
  border-radius: 0 12px 12px 0; /* redondeo costado derecho como panel */
}

.brand-photo-side::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to right,
    var(--panel-color) 0%,
    var(--panel-color) 30%,
    transparent 75%,
    transparent 100%
  );
  pointer-events: none;
  z-index: 2;
  border-radius: 0 12px 12px 0;
}

.brand-photo {
  position: relative;
  z-index: 1;
  max-width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 15% center; /* mover un poco m���s la imagen hacia la izquierda */
  border-radius: 0 12px 12px 0;
}

.brand {
  flex-direction: row;
  align-items: stretch;
}

/* Brand panel: imagen de fondo en el mismo div que el texto */
.panel.brand {
  position: relative;
  overflow: hidden;
}

.panel.brand .brand-text {
  position: relative;
  z-index: 3; /* texto por encima de imagen y degradado */
}

.panel.brand .brand-photo {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  object-fit: cover;
  object-position: 60% center;
  border-radius: 0 12px 12px 0;
  z-index: 1;
}

.panel.brand::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 100%;
  background: linear-gradient(
    to right,
    var(--panel-color) 0%,
    transparent 100%
  );
  pointer-events: none;
  z-index: 2;
  border-radius: 0 12px 12px 0;
}

.brand {
  flex-direction: column;
  align-items: flex-start;
}

.panel.brand h1 {
  display: flex;
  flex-direction: column;
}

.social {
  display: flex;
  gap: 1.5em;
}

.social a {
  color: var(--text-color);
  font-size: 2em;
  transition: color 0.3s;
}

.social a:hover {
  color: var(--accent-color);
}

/* Smooth shadow transition on icons */
.social a i { transition: filter 0.25s ease; }

/* Light mode only: dark shadow on hover while icon stays yellow */
body:not(.dark-mode) .social a:hover i {
  filter: drop-shadow(0 0 10px rgba(0, 0, 0, 0.55));
}

/* Dark mode: yellow glow on hover */
body.dark-mode .social a:hover i {
  filter: drop-shadow(0 0 10px var(--accent-color));
}

.title {
  background: radial-gradient(at bottom, var(--accent-color), var(--accent-color));
  text-align: center;
}

.title, .title h1, .title i {
  color: #000; /* texto e icono siempre negros sobre amarillo */
}

.title i {
  font-size: 2em;
  margin-top: 1.2em;
}

.travel i { font-size: 3em; }

/* ===========================
   TITLE PANEL SLIDER
   - Slider de 3 imï¿½genes
   - Puntos dentro de la imagen, parte superior
=========================== */
.title-slider-track {
  display: flex;
  width: 300%;
  height: 100%;
  transition: transform 0.6s ease-in-out;
}

.title-slider-track.is-dragging {
  transition: none !important;
}

.title-slide {
  flex: 0 0 100%;
}

.title-slider-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: rgba(0, 0, 0, 0.28);
  color: var(--accent-color);
  padding: 0.25em 0.55em;
  border-radius: 999px;
  cursor: pointer;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
  transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.title-slider-arrow.prev {
  left: 0.6em;
}

.title-slider-arrow.next {
  right: 0.6em;
}

.title-slider-arrow:hover {
  background: rgba(0, 0, 0, 0.45);
  transform: translateY(-50%) scale(1.03);
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.4);
}

.title-slider-arrow:focus-visible {
  outline: 2px solid var(--accent-color);
  outline-offset: 2px;
}

.title-slide img {
  display: block;
  width: 100%;
  height: 380px;            /* imagen mï¿½s alta en escritorio estï¿½ndar */
  object-fit: cover;
}

.title-slider-dots {
  position: absolute;
  top: 0.6em;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.4em;
  z-index: 2;
}

.title-slider-dots .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.7);
  background-color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  padding: 0;
}

.title-slider-dots .dot.active {
  background-color: #000;
}

/* ========================================
   PANEL 4: EXPERIENCE (+ in yellow, 16 larger)
======================================== */
.grid-panels .panel:nth-child(4) h1 {
  display: inline-flex;
  align-items: baseline;
  gap: 0.05em;
}

.grid-panels .panel:nth-child(4) .plus {
  color: var(--accent-color);
  font-weight: 600;
  font-size: 1.5em; /* match Projects/Skills/Last Visit icon size */
}

.grid-panels .panel:nth-child(4) .years {
  font-size: 1.5em;
  line-height: 1;
}

/* Light mode: add dark shadow to the + sign in +19 */
body:not(.dark-mode) .grid-panels .panel:nth-child(4) .plus {
  text-shadow: 0 0 8px rgba(0,0,0,0.45), 0 2px 6px rgba(0,0,0,0.35);
}

/* ========================================
   EARTH ANIMATION
======================================== */
.earth-container {
  width: calc(12.2em - 1px);
  height: calc(12.2em - 1px);
  position: absolute;
  top: 12em;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 50%;
  background-color: var(--bg-color);
  display: flex;
  justify-content: center;
  align-items: center;
  transition: 600ms ease-in-out;
  z-index: 1;
  cursor: pointer;
}

.earth {
  position: relative;
  background-image: url(./assets/img/earth.jpg);
  width: 80%;
  height: 80%;
  border-radius: inherit;
  box-shadow:
    0 0 18px #63cbff,
    inset -2em -2em 2em #000;
  background-repeat: repeat;
  background-size: 200% 100%;
  animation: rotate 140s linear infinite;
  cursor: inherit;
}

.clouds {
  background-repeat: repeat;
  background-size: 200% 100%;
  background-image: url(./assets/img/clouds.jpg);

/* ========================================
   PANEL 8: PROJECTS (icono abajo, amarillo y grande)
======================================== */
.grid-panels .panel:nth-child(8),
.experience-panel {
  display: flex;
  flex-direction: column;
  align-items: flex-start; /* alinear a la izquierda como Habilidades */
  text-align: left;
  padding-bottom: 3.2em; /* espacio para el tï¿½tulo absoluto */
}

/* Reordenar hijos directos del panel 8 */
.grid-panels .panel:nth-child(8) > div, /* contenedor del h2 */
.experience-panel > div {
  order: 1;
}

.grid-panels .panel:nth-child(8) > p#experience-desc,
.experience-panel > p#experience-desc {
  order: 2;
  margin-top: 0.6em;
}

.grid-panels .panel:nth-child(8) > i,
.experience-panel > i {
  /* ocultamos el <i> y usaremos ::before del h2 como en Skills */
  display: none;
}

/* TÃ­tulo de Projects alineado como Skills (abajo-izquierda con icono) */
.grid-panels .panel:nth-child(8) h2,
.experience-panel h2 {
  position: absolute;
  bottom: 0.5em;
  left: 1em;
  display: flex;
  align-items: center;
  gap: 0.4em;
  font-size: 1.5em;
  font-weight: 600;
  color: var(--text-color);
}

.grid-panels .panel:nth-child(8) h2::before,
.experience-panel h2::before {
  content: "\f807"; /* fa-helmet-safety (hard hat) */
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  font-size: 1em;
  color: var(--accent-color);
}

/* Ensure panels 7 (skills) and 8 (experience) have identical inner width */
@media screen and (min-width: 1000px) {
  .panel.skills-panel,
  .panel.experience-panel {
    padding-left: 1.5em !important;
    padding-right: 1.5em !important;
  }
  /* Pixel-level correction to center seam differences (rounding) */
  .panel.skills-panel { margin-right: -2px; }
  .panel.experience-panel { margin-left: -2px; }
}

/* Reduce inner side padding for Experience panel to align with Skills */
@media screen and (min-width: 1000px) {
  .grid-panels .panel.experience-panel { padding-left: 0.8em !important; padding-right: 0.8em !important; }
}

@media screen and (max-width: 1000px) and (min-width: 600px) {
  .grid-panels .panel.experience-panel { padding-left: 0.8em !important; padding-right: 0.8em !important; }
}

/* ========================================
   PANEL 8: PROJECTS - AcordeÃ³n y tooltips
======================================== */

/* Year accordion (div-based) */

/* Projects v2 filters */

/* Icons for the dropdown (folder left, chevron right) */

/* Hide Projects dropdown as requested */
/* Left building icon and right chevron on the filter */
/* remove decorative icons on select (reverted) */

/* Ensure visual order: title (1) -> filters (2) -> accordion (3) */
/* reverted: do not force explicit order */



/* Add simple arrow indicator */







  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  height: 100%;
  border-radius: inherit;
  opacity: 0.5;
  box-shadow: inherit;
  animation: rotate 140s linear infinite;
}

.earth-container:hover {
  transform: translateX(50%) scale(2);
}

.earth-container:hover + .grid-panels {
  opacity: 0.5;
}

@keyframes rotate {
  to { background-position: -200% 0; }
}

/* ========================================
   BUTTONS
======================================== */
.btn {
  background: var(--accent-color);
  color: #000;
  padding: 0.8em 2em;
  border-radius: 1em;
  font-size: 1.2em;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  /* Match software icon glow: use accent yellow */
  box-shadow: 0 0 8px var(--accent-color);
  transition: all 0.3s ease;
}

.btn:hover {
  box-shadow: 0 0 25px var(--accent-color);
}

/* CV: larger size */
#cv-btn {
  font-size: 1.35em;
  padding: 0.9em 2.2em;
}

/* CV (light mode): no shadow when not hovered */
body:not(.dark-mode) #cv-btn {
  /* Same shape as dark CV button */
  background-color: var(--accent-color) !important;
  color: #000 !important;
  border-radius: 1em;
  letter-spacing: 2px;
  text-transform: uppercase;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.35) !important; /* subtle rest shadow in light mode */
}

/* CV button keeps original style, add contextual shadows on hover */
body:not(.dark-mode) #cv-btn:hover {
  /* strong yellow glow on hover in light mode */
  box-shadow: 0 0 65px 14px var(--accent-color) !important;
}

body.dark-mode #cv-btn:hover {
  box-shadow: 0 0 25px var(--accent-color); /* yellow glow on dark mode */
}

/* ========================================
   PANEL 3: DARK MODE + LANGUAGE
======================================== */
.panel-3 {
  display: flex;
  flex-direction: row; /* una sola fila: dark mode | idiomas */
  justify-content: center;
  align-items: center;
  gap: 1em;
  padding: 1em;
}

.subpanel {
  width: auto;              /* ancho segÃºn contenido */
  display: flex;
  justify-content: center;
  align-items: center;
}

.subpanel.top {
  height: auto;
  justify-content: center;
}

.subpanel.bottom {
  height: auto;
  align-items: center;
}

/* Separador vertical entre dark mode y EN/ES */
.panel-3 .subpanel.top::after {
  content: "";
  display: inline-block;
  width: 1px;
  height: 1.8em;
  background: currentColor;
  opacity: 0.25;
  margin: 0 0.8em;
}

/* === DARK MODE BUTTON === */
.darkmode-btn {
  background-color: #000000; /* botÃ³n negro en modo claro */
  color: #000;               /* no afecta a los SVG de fondo */
  border: 2px solid var(--accent-color);
  border-radius: 50%;
  width: 2.8em;
  height: 2.8em;
  font-size: 1.3em;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.darkmode-btn:hover {
  transform: rotate(15deg);
}

.darkmode-btn .sun { display: none; }
.darkmode-btn .moon { display: inline-block; }

/* Use external SVG files for sun/moon icons */
.darkmode-btn i {
  display: inline-block;
  width: 1.6rem;   /* bigger icon */
  height: 1.6rem;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  font-style: normal;
  font-size: 1.1rem; /* balance sizing context */
  line-height: 1;
  text-indent: -9999px; /* hide text if any */
  overflow: hidden;
}

/* remove any previous pseudo glyphs */
.darkmode-btn i::before { content: none !important; }

.darkmode-btn .sun { background-image: url('assets/icons/sun.svg'); }
.darkmode-btn .moon { background-image: url('assets/icons/moon.svg'); }

/* toggle between sun and moon */
body.dark-mode .darkmode-btn .sun { display: inline-block; }
body.dark-mode .darkmode-btn .moon { display: none; }

body.dark-mode .darkmode-btn {
  background-color: var(--accent-color);
  color: #000; /* iconos negros en modo oscuro tambiÃ©n */
}

/* Asegurar contraste de los SVG de fondo */
.darkmode-btn i { filter: invert(1); }         /* iconos blancos sobre botÃ³n negro */
body.dark-mode .darkmode-btn i { filter: none; } /* iconos negros sobre botÃ³n amarillo */

body.dark-mode .darkmode-btn .sun { display: inline-block; }
body.dark-mode .darkmode-btn .moon { display: none; }

/* === LANGUAGE SWITCHER === */
.language-switcher {
  display: flex;
  justify-content: center;
  gap: 0.8em;
  width: 100%;
}

.modal-lang-switcher {
  justify-content: flex-start;
  gap: 0.4em;
}

.lang-btn {
  padding: 0.45em 1.4em;
  border: none;
  border-radius: 1em; /* same shape as CV */
  font-weight: 600;
  font-size: 0.9em;
  cursor: pointer;
  transition: all 0.3s ease;
  background-color: var(--panel-color);
  color: var(--text-color);
  box-shadow: 0 0 8px rgba(0,0,0,0.2);
  letter-spacing: 2px; /* match CV */
  text-transform: uppercase; /* match CV */
}

/* Increase size of language buttons in Panel 3 only */
.panel-3 .lang-btn {
  font-size: 1.1em;
  padding: 0.6em 1.8em;
}

.lang-btn.active {
  background-color: var(--accent-color);
  color: #000;
  box-shadow: 0 0 15px rgba(255, 237, 0, 0.45);
}

.lang-btn:hover {
  transform: translateY(-2px);
  /* Apply same yellow glow as CV button */
  box-shadow: 0 0 15px rgba(255, 237, 0, 0.45);
}

/* ========================================
   PANEL 9: LAST VISIT
======================================== */
.panel.bg {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  color: #f0f0f0;
  background-image: url(./assets/img/backroundrender.jpg);
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  overflow: hidden;
}

/* Last Visit icon: match Projects/Skills icon size and yellow color */
.panel.bg > i {
  color: var(--accent-color);
  font-size: 1.5em;
}

.panel.bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.55);
  z-index: 0;
}

.panel.bg * {
  position: relative;
  z-index: 1;
}

/* Last Visit text layout: location, date, time on separate lines */
#last-visit {
  line-height: 1.3;
}

#last-visit span {
  display: block;
}

/* ========================================
   RESPONSIVE GRID
======================================== */

/* Medium screens (iPad): columnas iguales como desktop */
@media screen and (max-width: 1000px) and (min-width: 600px) {
  .grid-panels {
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(4, 1fr); /* same row sizing as desktop */
    height: 100vh;
    min-height: 40em;
  }
  /* pixel-level seam correction for medium screens */
  .panel.skills-panel { margin-right: -2px; }
  .panel.experience-panel { margin-left: -2px; }

  /* reset generic spanning and ordering */
  .panel { min-height: unset; grid-column: auto; }
  .panel:nth-child(1),
  .panel:nth-child(2),
  .panel:nth-child(3),
  .panel:nth-child(4),
  .panel:nth-child(5),
  .panel:nth-child(6),
  .panel:nth-child(7),
  .panel:nth-child(8),
  .panel:nth-child(9) { order: 0; }

  /* mirror desktop placements */
  .panel:nth-child(1) { grid-column: 1 / 2; grid-row: 1 / 3; }
  .panel:nth-child(2) { grid-column: 2 / 4; grid-row: 1 / 3; }
  .panel:nth-child(3) { grid-column: 4 / 5; grid-row: 1 / 2; }
  .panel:nth-child(4) { grid-column: 4 / 5; grid-row: 2 / 3; }
  .panel:nth-child(5) { grid-column: 1 / 2; grid-row: 3 / 4; }
  .panel:nth-child(6) { grid-column: 1 / 2; grid-row: 4 / 5; }
  .panel:nth-child(7) { grid-column: 2 / 3; grid-row: 3 / 5; }
  .panel:nth-child(8) { grid-column: 3 / 4; grid-row: 3 / 5; }
  .panel:nth-child(9) { grid-column: 4 / 5; grid-row: 3 / 5; }

  /* iPad adjustments retained */
  .panel-3 { flex-direction: column; gap: 0.8em; }
  .panel-3 .subpanel.top::after { display: none; }
  .skills-grid { grid-template-columns: repeat(3, 1fr); }
  .skill { width: 37px; height: 37px; }

  /* iPad: place section titles at the top */
  .skills-panel { flex-direction: column !important; align-items: flex-start !important; padding-bottom: 1.2em; }
  .skills-panel h2 {
    position: static !important;
    left: auto; bottom: auto;
    display: flex; align-items: center; gap: 0.4em;
    margin: 0 0 0.8em 0;
    text-align: left;
  }

  .grid-panels .panel:nth-child(8) { align-items: flex-start !important; flex-direction: column; }
  .grid-panels .panel:nth-child(8) > div:first-child { display: flex; justify-content: flex-end; width: 100%; }
  .grid-panels .panel:nth-child(8) h2 {
    position: static !important;
    left: auto; bottom: auto;
    display: flex; align-items: center; gap: 0.4em;
    justify-content: flex-end; /* align to the right on iPad */
    width: 100%;
    margin: 0 0 0.8em 0;
    text-align: right;
  }
}

/* Small screens */
@media screen and (max-width: 600px) {
  .grid-panels {
    grid-template-columns: 1fr;     /* una sola columna */
    grid-auto-rows: auto;           /* filas con altura por contenido */
  }
  .panel {
    grid-column: auto;              /* ocupar su columna naturalmente */
    height: auto;                   /* altura determinada por su contenido */
    min-height: unset;              /* sin altura mÃ­nima fija */
  }
  /* Panel 3 primero en mÃ³vil */
  .panel.panel-3 { order: -10; }
  
  /* Panel amarillo (tÃ­tulo): texto e icono en negro en mÃ³vil */
  .panel.title, 
  .panel.title h1, 
  .panel.title i { 
    color: #000 !important; 
  }

  /* Skills: tÃ­tulo arriba dentro del panel (no abajo) */
  .skills-panel { flex-direction: column !important; padding-bottom: 1.2em; }
  .skills-panel h2 {
    position: static !important;
    left: auto; bottom: auto;
    align-self: center; /* centrar tÃ­tulo */
    display: flex; align-items: center; gap: 0.4em;
    margin: 0 0 0.8em 0;
    text-align: center;
  }

  /* Projects: tÃ­tulo arriba alineado a la derecha dentro del panel */
  .grid-panels .panel:nth-child(8) { align-items: flex-start; flex-direction: column; }
  .grid-panels .panel:nth-child(8) > div { align-self: stretch; width: 100%; }
  .grid-panels .panel:nth-child(8) h2 {
    position: static !important;
    left: auto; bottom: auto;
    display: flex; align-items: center; gap: 0.4em;
    justify-content: flex-start;
    width: 100%;
    margin: 0 0 0.8em 0;
    text-align: left;
  }
  /* Ocultar el planeta en mÃ³vil */
  .earth-container {
    display: none !important;
  }
}

/* Large screens */
@media screen and (min-width: 1000px) {
  h1 { font-size: 2.5em; }

  .earth-container {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
  }

  .earth-container:hover {
    transform: translate(-50%, -50%) scale(2);
  }

  .grid-panels {
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(4, 1fr);
    height: 100vh;
    min-height: 40em;
  }

  .panel:nth-child(1) { grid-column: 1 / 2; grid-row: 1 / 3; }
  .panel:nth-child(2) { grid-column: 2 / 4; grid-row: 1 / 3; }
  .panel:nth-child(3) { grid-column: 4 / 5; grid-row: 1 / 2; }
  .panel:nth-child(4) { grid-column: 4 / 5; grid-row: 2 / 3; }
  .panel:nth-child(5) { grid-column: 1 / 2; grid-row: 3 / 4; }
  .panel:nth-child(6) { grid-column: 1 / 2; grid-row: 4 / 5; }
  .panel:nth-child(7) { grid-column: 2 / 3; grid-row: 3 / 5; }
  .panel:nth-child(8) { grid-column: 3 / 4; grid-row: 3 / 5; }
  .panel:nth-child(9) { grid-column: 4 / 5; grid-row: 3 / 5; }

  /* Desktop layout adjustments */
  .panel-3 { flex-direction: column; gap: 0.8em; }
  .panel-3 .subpanel.top::after { display: none; }
  .skills-grid { grid-template-columns: repeat(3, 1fr); }
  .skill { width: 37px; height: 37px; }
  .panel.skills-panel { overflow: hidden !important; }

  /* Desktop: place section titles at the top */
  .skills-panel { flex-direction: column !important; align-items: flex-start !important; padding-bottom: 1.2em; }
  .skills-panel h2 {
    position: static !important;
    left: auto; bottom: auto;
    display: flex; align-items: center; gap: 0.4em;
    margin: 0 0 0.8em 0;
    text-align: left;
  }

  .grid-panels .panel:nth-child(8) { align-items: flex-start !important; flex-direction: column; }
  .grid-panels .panel:nth-child(8) > div:first-child { display: flex; justify-content: flex-end; width: 100%; }
  .grid-panels .panel:nth-child(8) h2 {
    position: static !important;
    left: auto; bottom: auto;
    display: flex; align-items: center; gap: 0.4em;
    justify-content: flex-end;
    width: 100%;
    margin: 0 0 0.8em 0;
    text-align: right;
  }
}

/* ========================================
   MODAL CV
======================================== */
.modal {
  display: none;
  position: fixed;
  z-index: 999;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.85);
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(4px);
  animation: fadeIn 0.3s ease;
}

.modal-content {
  background-color: var(--panel-color);
  padding: 1.5em;
  border-radius: 12px;
  width: 80%;
  max-width: 900px;
  color: var(--text-color);
  box-shadow: 0 0 25px rgba(0, 0, 0, 0.5);
}

.cv-content iframe {
  width: 100%;
  height: 80vh;
  border-radius: 8px;
  border: none;
}

.close {
  position: absolute;
  top: 10px;
  right: 20px;
  color: var(--text-color);
  font-size: 1.8em;
  cursor: pointer;
  transition: transform 0.3s ease, color 0.3s ease;
}

.close:hover {
  transform: scale(1.2);
  color: var(--accent-color);
}

/* ========================================
   EARTH FULL PANEL MODAL
   - Un solo panel que ocupa todo el espacio de la grilla
======================================== */
.earth-modal {
  display: none;
  position: fixed;
  inset: 0;
  padding: 1.5em;
  z-index: 999;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(3px);
  align-items: center;
  justify-content: center;
}

.earth-modal.open {
  display: flex;
}

.earth-modal-panel {
  background: var(--panel-color);
  color: var(--text-color);
  border-radius: 16px;
  width: calc(100vw - 3em);
  max-width: 1920px;
  height: calc(100vh - 3em);
  max-height: calc(100vh - 3em);
  padding: 1.6em 1.5em 1.5em; /* menor padding superior para ganar altura */
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.28);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.earth-modal-close {
  position: static;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-color);
  font-size: 1.2rem;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  margin-left: 0.5em;
}

body.dark-mode .earth-modal-close {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.35);
}

.earth-modal-close:hover {
  transform: scale(1.05);
  box-shadow: 0 0 18px rgba(255, 237, 0, 0.55);
}

.earth-modal-body {
  flex: 1 1 auto;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 1em;
  justify-content: flex-start;
  align-items: stretch;
}

.earth-modal-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.8em;
  flex-wrap: wrap;
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 0.5em;
  flex-wrap: nowrap;
  margin-left: auto;
}

.toolbar-actions .darkmode-btn {
  margin-right: 0.6em;
}

.toolbar-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  border: none;
  cursor: pointer;
}

body.dark-mode .toolbar-logo {
  background: transparent;
  border-color: transparent;
}

.toolbar-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.toolbar-btn {
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(0, 0, 0, 0.04);
  color: var(--text-color);
  border-radius: 10px;
  padding: 0.45em 1em;
  font-weight: 700;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
}

body.dark-mode .toolbar-btn {
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
}

.toolbar-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 12px rgba(255, 237, 0, 0.35);
  background: var(--accent-color);
  color: #000;
}

.lang-toggle-btn {
  min-width: 5.2em;
  text-transform: uppercase;
  background: var(--accent-color);
  color: #000;
  border-color: var(--accent-color);
  box-shadow: 0 0 12px rgba(255, 237, 0, 0.4);
  font-weight: 800;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
}

.earth-modal-title {
  flex: 0 1 auto;
  text-align: left;
  margin: 0;
  font-size: clamp(1.6rem, 2vw, 2.2rem);
  font-weight: 600;
}

.earth-modal-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr)); /* dos filas simétricas; evita que el grid crezca en vertical */
  gap: 1em;
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  padding-top: 0.5em;
  overflow: auto;
}

.earth-panel {
  background: linear-gradient(145deg, rgba(255, 237, 0, 0.12), var(--panel-color));
  border-radius: 12px;
  padding: 1.2em 1.4em;
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: none;
  display: flex;
  flex-direction: column;
  gap: 0.6em;
  color: var(--text-color);
  transition: transform 0.25s ease, box-shadow 0.3s ease, background 0.3s ease;
  min-height: 0;  /* permite que el contenido se contraiga dentro del panel */
  overflow: hidden; /* evita que nada sobresalga del panel */
}

body.dark-mode .earth-panel {
  border-color: rgba(255, 255, 255, 0.07);
  box-shadow: none;
  background: linear-gradient(145deg, rgba(255, 237, 0, 0.14), rgba(39, 40, 51, 0.95));
}

.earth-panel:hover {
  transform: translateY(-2px);
  box-shadow: none;
}

.earth-panel-primary { grid-column: 1 / 4; grid-row: 1 / 2; align-items: stretch; position: relative; }
.earth-panel-primary .map-container {
  width: 100%;
  max-width: 100%;
  aspect-ratio: 2000 / 857;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.02);
  position: relative;
  cursor: default;
  touch-action: none;
  flex: 1 1 auto;              /* ocupa el espacio disponible sin reducirse */
  margin-bottom: 0;            /* no empuja el texto ni reduce el mapa */
  max-height: none;            /* no limitar la altura del mapa */
}

.earth-panel-primary .map-container svg {
  width: 100%;
  height: auto;
  display: block;
  transform-origin: 0 0; /* sistema de referencia en la esquina para un zoom estable */
  transition: transform 0.2s ease;
}

.earth-panel-primary .map-container svg path {
  fill: #d9d9d9; /* gris claro visible en ambos modos */
  stroke: rgba(0, 0, 0, 0.7);
  stroke-width: 0.35;
}

/* Countries: interactive selection + highlight */
.earth-panel-primary .map-container svg .map-country {
  fill: #d9d9d9;
  cursor: pointer;
  transition: fill 0.18s ease, filter 0.18s ease, stroke 0.18s ease;
}

.earth-panel-primary .map-container svg .map-country.is-featured {
  fill: #8a7d00; /* amarillo oscuro (tono dorado) */
}

/* Dark mode: raise contrast for featured countries */
body.dark-mode .earth-panel-primary .map-container svg .map-country.is-featured {
  fill: #8a7d00; /* amarillo oscuro m??s visible en fondo oscuro */
  stroke: rgba(255, 237, 0, 0.75);
}

/* Dark mode: keep hover in amarillo proyecto */
body.dark-mode .earth-panel-primary .map-container svg .map-country.is-featured:hover {
  fill: var(--accent-color);
  stroke: rgba(0, 0, 0, 0.95);
}

/* Dark mode: selected state siempre en amarillo proyecto */
body.dark-mode .earth-panel-primary .map-container svg .map-country.is-selected {
  fill: var(--accent-color);
  stroke: rgba(0, 0, 0, 0.95);
  filter: drop-shadow(0 0 12px rgba(255, 237, 0, 0.95));
}

.earth-panel-primary .map-container svg .map-country:hover {
  fill: var(--accent-color);
  filter: drop-shadow(0 0 8px rgba(255, 237, 0, 0.85));
  stroke: rgba(0, 0, 0, 0.85);
}

.earth-panel-primary .map-container svg .map-country.is-selected {
  fill: var(--accent-color); /* amarillo proyecto */
  filter: drop-shadow(0 0 12px rgba(255, 237, 0, 0.95));
  stroke: rgba(0, 0, 0, 0.95);
}

.earth-panel-primary .map-container svg .map-country.is-selected:hover {
  filter: drop-shadow(0 0 14px rgba(255, 237, 0, 1));
}

.earth-panel-primary .map-container.is-panning {
  cursor: grabbing;
}

.map-controls {
  position: absolute;
  bottom: 1rem;
  right: 1rem;
  display: inline-flex;
  gap: 0.4rem;
  z-index: 3;
}

.map-zoom-btn {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.15);
  background: rgba(255, 255, 255, 0.9);
  color: #000;
  font-weight: 800;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}

body.dark-mode .map-zoom-btn {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
}

.map-zoom-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.18);
}

.map-pan-btn {
  width: 48px;
  font-size: 0.78rem;
  font-weight: 800;
}

.map-pan-btn.active {
  box-shadow: 0 0 0 2px var(--accent-color);
}

.earth-panel-primary .map-container.pan-enabled {
  cursor: grab;
}

/* Posiciona título y descripción en la esquina inferior izquierda sin reducir el mapa */
.earth-panel-primary h2 {
  position: absolute;
  left: 1rem;
  bottom: 4.2rem;
  margin: 0;
  z-index: 2;
}

.earth-panel-primary p.text-secondary {
  position: absolute;
  left: 1rem;
  bottom: 2.6rem;
  margin: 0;
  z-index: 2;
}

/* Ubica las tags abajo a la derecha y más pequeñas */
.earth-panel-primary .earth-panel-tags {
  position: absolute;
  right: 1rem;
  bottom: 1rem;
  margin: 0;
  gap: 0.4em;
  z-index: 2;
}

.earth-panel-primary .earth-panel-tags .tag {
  padding: 0.35em 0.8em;
  font-size: 0.8rem;
}

/* Override: tags alineadas a la izquierda debajo del t�tulo */
.earth-panel-primary .earth-panel-tags {
  left: 1rem;
  right: auto;
  bottom: 0.8rem;
  justify-content: flex-start;
}

.earth-panel-secondary {
  grid-column: 4 / 5;
  grid-row: 1 / 2;
  background: #ffffff;
  color: #000;
  padding: 1em 0 0.9em 0;
  gap: 0.4em;
}

body.dark-mode .earth-panel-secondary {
  background: #1b1c23;
  color: #fff;
}

.earth-panel-tertiary {
  grid-column: 1 / 5;
  grid-row: 2 / 3;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 0.8em;
  min-height: 0;
}

body.dark-mode .earth-panel-tertiary {
  background: #1b1c23;
}

.earth-selected-title {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.4em;
}

.earth-selected-title .flag-icon {
  width: 1.5em;
  height: 1em;
  object-fit: cover;
  border-radius: 3px;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.25);
}

.earth-selected-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  padding: 0.4em 0.85em;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 237, 0, 0.4);
  border-radius: 10px;
  backdrop-filter: blur(8px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
}

.earth-selected-pill i {
  color: var(--accent-color);
}

body.dark-mode .earth-selected-pill {
  background: rgba(0, 0, 0, 0.28);
  border-color: rgba(255, 237, 0, 0.35);
}

.earth-panel h2,
.earth-panel h3 { margin: 0; }

.earth-panel-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65em;
}

.project-row {
  display: flex;
  align-items: center;
  gap: 0.55em;
  min-height: 64px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0;
  padding: 0;
  margin-left: 0;
  margin-right: 0;
  width: 100%;
  text-align: left;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
body:not(.dark-mode) .project-row {
  border-color: rgba(0, 0, 0, 0.08);
}
.project-row:hover {
  background: rgba(255, 237, 0, 0.08);
  border-color: var(--accent-color);
}
.project-row.active {
  background: var(--accent-color);
  color: #000;
  border-color: var(--accent-color);
  margin-left: -1px;
  margin-right: -1px;
  width: calc(100% + 2px);
}
.project-row-icon {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: transparent;
  color: var(--accent-color);
  flex-shrink: 0;
  margin-right: 0.8em;
}
.project-row.active .project-row-icon {
  color: #000;
  border-color: rgba(0, 0, 0, 0.25);
}
.project-row-year {
  font-weight: 800;
  color: var(--accent-color);
  font-size: 0.95em;
  min-width: 70px;
  text-align: center;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.1;
}
.project-row.active .project-row-year {
  color: #000;
}
.year-line.year-end {
  font-size: 1.05em;
}
.year-line.year-start {
  font-size: 0.9em;
  opacity: 0.85;
}
.project-row-content {
  display: flex;
  flex-direction: column;
  gap: 0.3em;
  width: 100%;
}
.project-row-top {
  display: flex;
  align-items: center;
  gap: 0.4em;
}
.project-row-title {
  font-weight: 700;
  color: inherit;
}

.project-empty {
  padding: 0.8em 0.9em;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px dashed rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.8);
}
body:not(.dark-mode) .project-empty {
  background: rgba(0, 0, 0, 0.02);
  border-color: rgba(0, 0, 0, 0.1);
  color: #444;
}

.project-btn {
  border: none;
  background: transparent;
  padding: 0;
  margin: 0;
  font: inherit;
  color: inherit;
}

.project-btn:focus-visible,
.project-row:focus-visible {
  outline: 2px solid var(--accent-color);
  outline-offset: 2px;
}

.earth-panel .eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-size: 0.8em;
  font-weight: 700;
  color: var(--accent-color);
}

.earth-panel-list {
  margin: 0;
  padding: 0;
  color: var(--text-color);
  display: grid;
  gap: 0.35em;
}

.earth-panel-list li {
  line-height: 1.4;
  opacity: 0.88;
}

.earth-panel-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6em;
  margin-top: auto;
}

.earth-panel .tag {
  background: rgba(255, 255, 255, 0.9); /* mismo reposo que zoom/pan */
  color: #000;
  padding: 0.45em 1em;
  border-radius: 8px;
  font-weight: 800;
  letter-spacing: 0.02em;
  border: 1px solid rgba(0, 0, 0, 0.15);
  cursor: pointer;
  font: inherit;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.earth-panel .tag.active {
  background: var(--accent-color);
  color: #000;
  border-color: var(--accent-color);
  box-shadow: 0 0 14px rgba(255, 237, 0, 0.45);
}

.earth-panel .tag:hover {
  transform: translateY(-1px);
  background: var(--accent-color);
  color: #000;
  border-color: var(--accent-color);
  box-shadow: 0 0 12px rgba(255, 237, 0, 0.3);
}

.earth-panel .tag:focus-visible {
  outline: 2px solid var(--accent-color);
  outline-offset: 2px;
}

body.dark-mode .earth-panel .tag {
  background: rgba(0, 0, 0, 0.7); /* mirror zoom/pan dark */
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}

.project-btn:focus-visible {
  outline: 2px solid var(--accent-color);
  outline-offset: 2px;
}

body.dark-mode .earth-panel .tag.active {
  background: var(--accent-color);
  color: #000;
  border-color: var(--accent-color);
  box-shadow: 0 0 16px rgba(255, 237, 0, 0.6);
}

body.dark-mode .earth-panel .tag:hover {
  color: #000;
}

.earth-panel-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5em;
  color: var(--text-color);
  width: 100%;
  max-width: none;
  align-self: stretch;
  padding: 0.4em 0.6em;
}

.earth-panel-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8em;
}

.earth-panel-links a {
  color: var(--text-color);
  font-weight: 700;
  padding: 0.35em 0.75em;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.05);
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

body.dark-mode .earth-panel-links a {
  background: rgba(255, 255, 255, 0.06);
  color: #f3f3f3;
}

.earth-panel-links a:hover {
  transform: translateY(-1px);
  background: var(--accent-color);
  color: #000;
  box-shadow: 0 0 15px rgba(255, 237, 0, 0.35);
}

.earth-reel {
  width: 100%;
  margin-left: 0;
  margin-right: 0;
  display: flex;
  flex-direction: row;
  gap: 0.8em;
  flex: 1 1 auto;
  min-height: 0;
  align-items: stretch;
}

.earth-reel-left {
  flex: 0 0 42%;
  min-width: 260px;
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  gap: 0.4em;
}

.project-info-card {
  width: 100%;
  background: transparent;
  border: none;
  border-radius: 16px;
  padding: 1.2em 1.1em;
  display: flex;
  flex-direction: column;
  gap: 0.8em;
  color: inherit;
  box-shadow: none;
}

body:not(.dark-mode) .project-info-card {
  background: transparent;
  border-color: transparent;
  color: inherit;
  box-shadow: none;
}

.project-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1em;
}

.project-card-titles h3 {
  margin: 0 0 0.2em 0;
  font-size: 1.3em;
}

.project-meta-line {
  margin: 0;
  color: var(--text-color);
  opacity: 0.85;
  font-weight: 600;
}

.project-info-title {
  margin: 0.15em 0 0.15em;
  line-height: 1.25;
}

.project-type-chip {
  align-self: flex-start;
  border: 1px solid var(--accent-color);
  color: var(--accent-color);
  background: rgba(255, 237, 0, 0.1);
  padding: 0.3em 0.9em;
  border-radius: 999px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.8em;
  white-space: nowrap;
}

.project-info-description {
  margin: 0;
  line-height: 1.5;
  opacity: 0.95;
}

.project-section-title {
  margin: 0 0 0.25em 0;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.project-functions-list {
  margin: 0;
  padding-left: 1.2em;
  display: grid;
  gap: 0.2em;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5em;
  margin: 0.2em 0 0.2em;
}

.project-tags .project-tag {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #e7eaf2;
  padding: 0.35em 0.85em;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.9em;
  box-shadow: none;
}

body:not(.dark-mode) .project-tags .project-tag {
  color: #1b1c23;
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.08);
}

.project-highlights {
  display: flex;
  flex-direction: column;
  gap: 0.35em;
}

.project-highlights-title {
  margin: 0;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.project-highlights-list {
  margin: 0;
  padding-left: 0;
  list-style: none;
  display: grid;
  gap: 0.25em;
}

.project-highlights-list li {
  position: relative;
  padding-left: 1.3em;
  line-height: 1.4;
}

.project-highlights-list li::before {
  content: '\2713';
  position: absolute;
  left: 0;
  color: var(--accent-color);
  font-weight: 800;
}

.earth-reel-right {
  flex: 0 1 58%;
  display: flex;
  flex-direction: column;
  gap: 0.6em;
  min-height: 0;
}

.earth-reel-frame {
  background: linear-gradient(135deg, rgba(76, 86, 111, 0.28), rgba(30, 34, 46, 0.8));
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  padding: 0.7em 1.1em;
  min-height: 340px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #cfd4e0;
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
}

body:not(.dark-mode) .earth-reel-frame {
  border-color: rgba(0, 0, 0, 0.06);
  color: #1b1c23;
  background: linear-gradient(135deg, rgba(238, 238, 238, 0.75), rgba(216, 216, 216, 0.6));
}

.earth-reel-slide {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
}

.earth-reel-slide::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0.15));
  pointer-events: none;
}

.earth-reel-slide span {
  position: relative;
  z-index: 1;
  padding: 0.55em 1.2em;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
}

body:not(.dark-mode) .earth-reel-slide span {
  background: rgba(0, 0, 0, 0.45);
}

.earth-reel-buttons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.65em;
}

.reel-btn {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(23, 26, 36, 0.65);
  color: #cfd4e0;
  border-radius: 12px;
  padding: 0.65em 1em;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.25s ease, background 0.25s ease, color 0.25s ease;
}

body:not(.dark-mode) .reel-btn {
  background: rgba(0, 0, 0, 0.04);
  color: #1b1c23;
  border-color: rgba(0, 0, 0, 0.08);
}

.reel-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.2);
}

.reel-btn.active {
  background: var(--accent-color);
  color: #000;
  box-shadow: 0 0 18px rgba(255, 237, 0, 0.35);
}

@media screen and (max-width: 900px) {
  .earth-reel {
    flex-direction: column;
  }
  .earth-reel-left {
    flex: 0 0 auto;
    min-width: 100%;
  }
  .earth-reel-right {
    width: 100%;
  }
}

.earth-hidden {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}
/* ========================================
   ANIMATIONS
======================================== */
@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

/* ========================================
   TEMP: CENTER VERTICAL GUIDE (on top of all)
======================================== */
#center-guide {
  display: none;
}


/* ========================================
   PANEL 7: TECHNOLOGIES & TOOLS (FINAL ORDEN Y ESPACIADO)
======================================== */
.skills-panel {
  position: relative;
  display: flex;
  flex-direction: column-reverse; /* ordena de abajo hacia arriba */
  justify-content: flex-start;
  align-items: center;
  text-align: center;
  padding: 1.5em;
  padding-bottom: 3.5em; /* espacio inferior para el tÃ­tulo */
  overflow: visible;
  z-index: 2; /* debajo del planeta */
}

/* === TÃTULO ABAJO A LA IZQUIERDA === */
.skills-panel h2 {
  position: absolute;
  bottom: 0.5em; /* visible sobre el borde inferior */
  left: 1em;
  display: flex;
  align-items: center;
  gap: 0.4em;
  font-size: 1.5em; /* igual que otros h2 */
  font-weight: 600;
  color: var(--text-color);
}

.skills-panel h2::before {
  content: "\f121"; /* Ã­cono de cÃ³digo */
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  font-size: 1em;
  color: var(--accent-color);
}

/* Projects title style to match Skills across viewports */
#experience {
  display: flex;
  align-items: center;
  gap: 0.4em;
  font-weight: 600;
  color: var(--text-color);
}

#experience::before {
  content: "\f0b1"; /* fa-briefcase (work bag) */
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  font-size: 1em;
  color: var(--accent-color);
}

/* Light mode: add dark shadow to section icons (Skills and Experience) */
body:not(.dark-mode) .skills-panel h2::before,
body:not(.dark-mode) #experience::before,
body:not(.dark-mode) .experience-panel h2::before {
  text-shadow: 0 0 8px rgba(0,0,0,0.45), 0 2px 6px rgba(0,0,0,0.35);
}

/* ========================================
   PANEL 8: EXPERIENCE LIST (within projects panel)
   Scope styles so only panel 8 is affected
======================================== */
.experience-panel .experience-list {
  width: 100%;
  margin-top: 0.6em;
  display: flex;
  flex-direction: column;
  gap: 0.8em;
  flex: 1;
  min-height: 0;
}

.experience-panel .experience-item {
  /* Match general background in both themes */
  background: var(--bg-color);
  border-radius: 12px;
  /* Reserve space at bottom for the toggle */
  /* Tighter horizontal padding to align visual width with Skills */
  padding: 0.1em 0.1em 1em;
  box-shadow: none; /* remove card shadows inside Experience */
  position: relative;
  cursor: pointer; /* make whole card feel clickable */

  margin-left: -0.2em;
  margin-right: -0.2em;
}

.experience-panel .experience-header {
  /* Flag moved next to country inside .location; simplify grid */
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto auto;
  grid-template-areas:
    "text"
    "date";
  align-items: start;
  gap: 0.12em 0.6em;
  cursor: pointer;
}

.experience-panel .experience-header h3 {
  margin: 0;
  font-size: 1.05em;
  /* Change from accent yellow to white */
  color: var(--text-color);
}

.experience-panel .location,
.experience-panel .date { color: #a0a0a0; font-size: 0.9em; }

.experience-panel .flag { font-size: 1.1em; }
.experience-panel .location .flag { margin-right: 0.35em; }
.experience-panel .text-group { grid-area: text; min-width: 220px; }
.experience-panel .date { grid-area: date; }

.experience-panel .toggle-btn {
  position: absolute;
  right: 0.6em;
  bottom: 0.5em; /* bottom sector of the card */
  background: none;
  border: none;
  font-size: 0.9em; /* smaller size */
  line-height: 1;
  color: var(--accent-color); /* yellow */
  cursor: pointer;
}

.experience-panel .experience-content {
  margin-top: 0.6em;
  font-size: 0.95em;
  color: #cfcfcf;
  line-height: 1;
  display: block;
}

.experience-panel .experience-item:not(.active) .experience-content { display: none; }

/* === GRID DE ICONOS === */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2em 1.6em; /* aumenta el espacio vertical (entre filas) */
  justify-items: center;
  align-items: end; /* Ã­conos se apilan desde abajo */
  width: 100%;
  overflow: visible;
  margin-top: calc(0.5em + 2px); /* baja 2px extra los iconos respecto al tÃ­tulo */
  margin-bottom: 0.5em; /* deja aire sobre el tÃ­tulo */
}

/* === ICONOS === */
.skill {
  position: relative;
  width: 43px;
  height: 43px;
  display: flex;
  justify-content: center;
  align-items: center;
  filter: grayscale(100%) brightness(0.7);
  transition: all 0.4s ease;
  cursor: pointer;
  z-index: 3;
}

.skill img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 6px;
}

/* Hover */
.skill:hover {
  transform: scale(1.1);
  filter: grayscale(0%) brightness(1);
}

/* Inactive state after mobile tap timeout */
.skill.inactive {
  filter: grayscale(100%) brightness(0.6) !important;
  opacity: 0.6;
  transform: none !important;
  pointer-events: none;
}

/* === TOOLTIP (mÃ¡s visible y sin cortar) === */
.skill::after {
  content: attr(data-name);
  position: absolute;
  top: calc(100% + 2px); /* mÃ¡s pegado al icono */
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--panel-color);
  color: var(--text-color);
  font-size: 0.7em;
  padding: 0.3em 0.6em;
  border-radius: 6px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  white-space: nowrap;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.25);
  z-index: 20;
}

.skill:hover::after {
  opacity: 1;
}

/* === EFECTO BRILLO EN MODO OSCURO === */
body.dark-mode .skill:hover img {
  filter: drop-shadow(0 0 6px var(--accent-color));
}

/* Light mode: dark shadow on hover for software icons */
body:not(.dark-mode) .skill:hover img {
  filter: drop-shadow(0 0 10px rgba(0, 0, 0, 0.55));
}

/* ========================================
   FIX: PLANETA POR ENCIMA DEL PANEL
======================================== */
.earth-container {
  position: absolute;
  z-index: 50 !important; /* planeta visible sobre todo */
}

.panel {
  position: relative;
  z-index: 1;
}

.panel.skills-panel {
  z-index: 2;
  overflow: visible;
}

.skills-grid,
.skill {
  position: relative;
  z-index: 3;
  overflow: visible;
}
/* Light mode: dark shadow for software icons as well */
body:not(.dark-mode) .skill img {
  filter: drop-shadow(0 0 8px rgba(0,0,0,0.35));
}
/* Tighter line-height for role paragraphs inside Experience */
.experience-panel .experience-content p { line-height: 1.17em; margin: 0.25em 0; }

/* Light mode: experience paragraph color normal */
body:not(.dark-mode) .experience-panel .experience-content p { color: #0b0b0b; font-weight: 400; }

/* ========================================
   SKILLS: INTERNAL VERTICAL SCROLL (SUBTLE)
   - Keeps panel height fixed while icons scroll
   - Thin, discreet scrollbar styled per theme
======================================== */
.panel.skills-panel {
  min-height: 0; /* allow inner flex children to shrink */
  margin-bottom: 0 !important; /* reduce bottom margin of the panel */
  padding-bottom: 24px !important; /* requested bottom padding */
  overflow: visible !important; /* allow tooltips to extend within the panel */
}

.skills-grid {
  flex: 1 1 auto;        /* occupy remaining vertical space */
  min-height: 0;         /* enable internal scrolling */
  overflow-y: auto;
  overflow-x: hidden;    /* prevent horizontal scroll */
  overscroll-behavior: contain;
  padding-right: 0.2em;  /* breathing room so scrollbar doesn't cover content */
  gap: 0.45em 0.45em;      /* icons closer together */
  padding: 12px 16px 16px 16px; /* inner offset from outer border for glow/labels */

  /* Subtle scrollbar (Firefox) */
  scrollbar-width: thin;
  scrollbar-color: transparent transparent; /* visually hidden by default */
  /* Chrome/Edge/Brave/Yandex: reserve space so content width is stable */
  scrollbar-gutter: stable;
}

/* Subtle scrollbar (WebKit) */
.skills-grid::-webkit-scrollbar { width: 2px; height: 2px; }
.skills-grid::-webkit-scrollbar-track { background: transparent; }
.skills-grid::-webkit-scrollbar-thumb {
  background-color: transparent; /* hidden when not hovered */
  border-radius: 6px;
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
}
body.dark-mode .skills-grid::-webkit-scrollbar-thumb {
  background-color: transparent;
}

/* Show scrollbar only when cursor is over Skills panel (visual only) */
.panel.skills-panel:hover .skills-grid {
  scrollbar-color: rgba(255, 237, 0, 0.35) transparent;
}
body.dark-mode .panel.skills-panel:hover .skills-grid {
  scrollbar-color: rgba(255, 237, 0, 0.45) transparent;
}
.panel.skills-panel:hover .skills-grid::-webkit-scrollbar-thumb {
  background-color: rgba(255, 237, 0, 0.35);
  box-shadow: 0 0 8px rgba(255, 237, 0, 0.8);
}
body.dark-mode .panel.skills-panel:hover .skills-grid::-webkit-scrollbar-thumb {
  background-color: rgba(255, 237, 0, 0.45);
}

/* Tooltip closer to the icon (override) */
.skill::after {
  top: calc(100% - 2px) !important; /* as tight as possible */
  padding: 0.25em 0.5em !important; /* compact bubble */
  line-height: 1 !important;        /* minimize vertical footprint */
}

/* Provide breathing room inside each skill for glow and tooltip */
.skill { padding: 8px !important; margin-bottom: 6px !important; width: 56px !important; height: 56px !important; }

/* ========================================
   EXPERIENCE: Subtï¿½tulo Proyecto/Rol dentro del contenido
   - Separaciï¿½n mediante lï¿½nea discontinua y tipografï¿½a compacta
======================================== */
.experience-panel .exp-meta {
  margin-top: 0.6em;
  padding-top: 0.6em;
  border-top: 1px dashed rgba(255, 237, 0, 0.28);
  line-height: 1.25;
}
body:not(.dark-mode) .experience-panel .exp-meta { border-top-color: rgba(0,0,0,0.18); }
.experience-panel .exp-meta .exp-label {
  font-size: 0.85em;
  color: #a0a0a0;
  letter-spacing: 0.02em;
}
.experience-panel .exp-meta .exp-value {
  font-weight: 600;
  margin: 0.15em 0 0.4em;
}

/* Light mode: darken project name for better readability */
body:not(.dark-mode) .experience-panel .exp-meta .exp-value {
  color: #0b0b0b; /* match light paragraph color */
}

/* ========================================
   DESKTOP-TUNING FOR 1920x1080 (OR SIMILAR)
   - Slightly smaller type and tighter spacing
   - 4 columns + smaller icons to reduce rows
======================================== */
@media screen and (min-width: 1600px) and (max-height: 1080px) {
  /* Typography scale down */
  h1 { font-size: 2.2em; }
  .text-primary { font-size: 1.1em; }

  /* Tighter panel padding to gain usable space */
  .panel { padding: 1.2em; }

  /* Skills grid density + scroll friendliness (bigger + tighter) */
  .skills-grid { gap: 0.45em 0.45em; }
  .skill { width: 56px !important; height: 56px !important; }

  /* Keep section headings elegant but compact */
  .skills-panel h2 { font-size: 1.35em; }
}

/* ========================================
   TITLE SLIDER: ajustes adicionales
   - Mantener altura grande pero dentro del panel amarillo
======================================== */
.panel.title .title-slide img {
  height: auto !important;
}

/* ========================================
   TALL SCREENS (>1080px height)
   - Hacer el slider del Panel 2 mï¿½s alto
   - Usar porcentaje de la altura de la ventana
======================================== */
@media screen and (min-height: 1081px) {
  .panel.title .title-slide img {
    height: 36vh !important;      /* imagen alta pero sin invadir el panel */
    max-height: 620px !important; /* tope para monitores muy grandes */
  }
}

/* ========================================
   2560x1440: Reduce bottom padding so icons fit
======================================== */
@media screen and (min-width: 2560px) and (min-height: 1440px) {
  /* Bottom padding set to 24px as requested */
  .skills-panel { padding-bottom: 24px !important; overflow: visible !important; }
  /* Reclaim even more space for the last row and grow downward */
  .skills-grid {
    margin-bottom: -0.35em !important;
    padding-bottom: 0 !important;
    overflow-y: visible !important;           /* no scroll at this size */
    height: calc(100% + 1.4em) !important;    /* extend grid downward */
    gap: 0.45em 0.45em !important;              /* tighter gaps at 2560x1440 */
    padding: 10px 14px 14px 14px !important;  /* more offset from outer border */
  }
  .skill { width: 56px !important; height: 56px !important; }
  /* Optional: slightly tighter title spacing */
  .skills-panel h2 { margin-bottom: 0.6em !important; }
}

/* ========================================
   EXPERIENCE PANEL (renamed from Projects)
   Map styles to new class/id without touching original CSS
======================================== */
.panel.experience-panel {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  padding-bottom: 3.2em;
  padding-left: 10px !important;   /* base padding for smaller screens */
  padding-right: 10px !important;  /* base padding for smaller screens */
}

/* Experience title icon and style (alias of #projects) */
#experience {
  display: flex;
  align-items: center;
  gap: 0.4em;
  font-weight: 600;
  color: var(--text-color);
}
#experience::before {
  content: "\f0b1"; /* fa-briefcase (work bag) */
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  font-size: 1em;
  color: var(--accent-color);
}
body:not(.dark-mode) #experience::before,
body:not(.dark-mode) .experience-panel h2::before {
  text-shadow: 0 0 8px rgba(0,0,0,0.45), 0 2px 6px rgba(0,0,0,0.35);
}

.experience-panel .experience-list {
  width: 100%;
  margin-top: 0.6em;
  display: flex;
  flex-direction: column;
  gap: 1.2em; /* increased vertical spacing between cards */
  flex: 1;
  min-height: 0;
}

.experience-panel .experience-item {
  background: var(--bg-color);
  border-radius: 12px;
  padding: 12px 12px 16px !important; /* increased inner spacing for readability */
  box-shadow: none;
  position: relative;
  cursor: pointer;
}

.experience-panel .experience-header {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto auto;
  grid-template-areas: "text" "date";
  align-items: start;
  gap: 0.12em 0.6em;
  cursor: pointer;
}

.experience-panel .experience-header h3 { margin: 0; font-size: 1.05em; color: var(--text-color); }
.experience-panel .location,
.experience-panel .date { color: #a0a0a0; font-size: 0.9em; }
/* Generic flag style (emoji or img) */
.experience-panel .flag { font-size: 1.1em; }
.experience-panel .location .flag { margin-right: 0.35em; }
/* SVG flag images inside Experience cards */
.experience-panel img.flag {
  width: 1.1em;
  height: 0.8em;
  margin-right: 0.35em;
  border-radius: 2px;
  vertical-align: -0.1em;
  display: inline-block;
}
.experience-panel .text-group { grid-area: text; min-width: 220px; }
.experience-panel .date { grid-area: date; }

/* Country-specific SVG mappings (Experience panel) */
.flag-es { content: ""; }
.flag-gb { content: ""; }
.flag-pa { content: ""; }
.flag-co { content: ""; }

.experience-panel .toggle-btn {
  position: absolute;
  right: 0.6em;
  bottom: 0.5em;
  background: none;
  border: none;
  font-size: 0.9em;
  line-height: 1;
  color: var(--accent-color);
  cursor: pointer;
}

.experience-panel .experience-content {
  margin-top: 0.6em;
  font-size: 0.95em;
  color: #cfcfcf;
  line-height: 1.3; /* match p.text-secondary baseline */
  display: block;
}

.experience-panel .experience-item:not(.active) .experience-content { display: none; }

/* Experience list: stable, thin scrollbar */
.experience-panel .experience-list {
  overflow-y: auto;
  overflow-x: hidden; /* prevent horizontal scroll */
  scroll-behavior: smooth; /* gentle programmatic/user scroll */
  /* Firefox */
  scrollbar-width: thin;
  scrollbar-color: transparent transparent; /* hidden by default */
  /* Chrome/Edge/Brave/Yandex: reserve space to avoid width jumps */
  scrollbar-gutter: stable;
}
/* Show colored thumb only when hovering the panel (Firefox/Chromium) */
.experience-panel:hover .experience-list {
  scrollbar-color: rgba(255, 237, 0, 0.35) transparent;
}
body.dark-mode .experience-panel:hover .experience-list {
  scrollbar-color: rgba(255, 237, 0, 0.45) transparent;
}

.experience-panel.scrolling .experience-list { overflow-y: auto !important; }

/* ========================================
   EXPERIENCE: Entrance animation (slow ? fast, vertical)
   Duration matches +19 counter (3000ms)
======================================== */
@keyframes exp-enter {
  0%   { transform: translateY(-64px); }
  100% { transform: translateY(0); }
}
.experience-panel.ready .experience-item {
  animation: exp-enter 3000ms cubic-bezier(0.4, 0, 1, 1) both;
  will-change: transform;
}

/* WebKit scrollbar: always same (super thin) width; thumb appears on hover */
.experience-panel .experience-list::-webkit-scrollbar {
  width: 2px;
  height: 2px;
}
.experience-panel .experience-list::-webkit-scrollbar-track {
  background: transparent;
}
.experience-panel .experience-list::-webkit-scrollbar-thumb {
  background-color: transparent; /* hidden when not hovered */
  border-radius: 999px;
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
}
body.dark-mode .experience-panel .experience-list::-webkit-scrollbar-thumb {
  background-color: transparent;
}
.experience-panel:hover .experience-list::-webkit-scrollbar-thumb {
  background-color: rgba(255, 237, 0, 0.35);
  box-shadow: 0 0 8px rgba(255, 237, 0, 0.8);
}

/* ========================================
   DESKTOP: align Skills & Experience inner widths
   - Same horizontal padding so both panels visually
     occupy the same width around the center guide
======================================== */
@media screen and (min-width: 1000px) {
  .panel.skills-panel,
  .panel.experience-panel {
    padding-left: 1.2em !important;
    padding-right: 1.2em !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
  /* Reduce bottom padding on Experience so more content is visible */
  .panel.experience-panel {
    padding-bottom: 24px !important; /* similar a Skills */
  }
}

/* Medium screens (tablet): also remove seam tweaks so both panels
   respetan exactamente el mismo ancho de columna */
@media screen and (max-width: 1000px) and (min-width: 600px) {
  .panel.skills-panel,
  .panel.experience-panel {
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
}

/* ========================================
   =1920px: 4 columnas perfectamente iguales
   - El grid ocupa todo el ancho disponible
   - Sin hueco extra en el centro: Skills y
     Experience comparten exactamente la mitad
======================================== */
@media screen and (min-width: 1920px) {
  .grid {
    width: 1920px;
    max-width: 1920px;
  }
  .skills-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ========================================
   >=1900px: Nombre en dos lï¿½neas (Brand)
   - Nombres juntos y apellidos juntos
======================================== */
/* ========================================
   TITLE SLIDER / PANEL 2 (DESKTOP)
   - El contenedor se adapta al alto del panel
   - Padding igual en top, bottom, derecha e izquierda
   - Imagen escala automï¿½ticamente dentro del contenedor
======================================== */
@media screen and (min-width: 1000px) {
  .panel.title {
    display: flex;
    flex-direction: column;
  }

  .panel.title h1 {
    margin-bottom: 0;
  }

  .panel.title .title-slider {
    flex: 1 1 auto;
    width: 100%;
    margin: 1.5em 0 0 !important; /* mismo valor que padding lateral del panel */
    min-height: 220px;
  }

  .panel.title .title-slider-track {
    height: auto;
  }

  .panel.title .title-slide img {
    width: 100%;
    height: auto !important;      /* escala al ancho del slider */
    object-fit: contain;
    object-position: center center;
  }
}

/* ========================================
   TITLE SLIDER: altura responsiva final (mobile/tablet)
   - En pantallas pequeï¿½as la imagen no puede crecer tanto
======================================== */
@media screen and (max-width: 999px) {
  .panel.title .title-slide img {
    /* altura entre 220px y 320px,
       ajustada al 30% de la altura de la ventana */
    height: clamp(220px, 30vh, 320px) !important;
    object-fit: cover;
    object-position: center center;
  }
}
body.dark-mode .experience-panel:hover .experience-list::-webkit-scrollbar-thumb {
  background-color: rgba(255, 237, 0, 0.45);
}

/* Light mode: match paragraph color to body text for readability */
/* Ensure identical line-height in light and dark */
.experience-panel .experience-content p {
  color: #0b0b0b; /* same as projects alias */
  font-weight: 400;
  line-height: 1.3; /* same as p.text-secondary */
}
/* In dark mode, keep same line-height and adapt color */
body.dark-mode .experience-panel .experience-content p {
  color: #cfcfcf;
  line-height: 1.3;
}

/* ========================================
   TITLE SLIDER: comportamiento final
   - Imagen al 100% del ancho del slider
   - Centrada verticalmente en un contenedor flexible
======================================== */
@media screen and (min-width: 1000px) {
  .panel.title .title-slide {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
  }

  .panel.title .title-slide img {
    width: 100%;
    height: auto !important;  /* escala al ancho, mantiene proporciï¿½n */
    max-height: 100%;
    object-fit: contain;
    object-position: center center;
  }
}

@media screen and (max-width: 999px) {
  .panel.title .title-slide {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .panel.title .title-slide img {
    width: 100%;
    height: auto !important;
    object-fit: contain;
    object-position: center center;
  }
}

/* ========================================
   TITLE SLIDER: REGLAS FINALES
   - Imagen llena el ancho del slider
   - Altura fija por panel, centrada y con cover
======================================== */
@media screen and (min-width: 600px) {
  .panel.title .title-slider {
    width: 100%;
    margin-top: 1.5em;
    height: clamp(240px, 32vh, 420px);
  }

  .panel.title .title-slider-track,
  .panel.title .title-slide {
    height: 100%;
  }

  .panel.title .title-slide {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .panel.title .title-slide img {
    width: 100%;
    height: 100% !important;
    object-fit: cover;
    object-position: center center;
  }
}

@media screen and (max-width: 599px) {
  .panel.title .title-slider {
    width: 100%;
    margin-top: 1.2em;
    height: 220px;
  }

  .panel.title .title-slider-track,
  .panel.title .title-slide {
    height: 100%;
  }

  .panel.title .title-slide {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .panel.title .title-slide img {
    width: 100%;
    height: 100% !important;
    object-fit: cover;
    object-position: center center;
  }
}

/* ========================================
   720p HD TUNING (1280x720 aprox.)
   - Evitar que imagen y textos sobrepasen
   - NO afecta a otras resoluciones
======================================== */
@media screen and (min-width: 1200px) and (max-width: 1320px)
       and (min-height: 700px) and (max-height: 740px) {

  /* Reducir ligeramente el tamaño del nombre */
  .panel.brand h1 {
    font-size: 2.1em;
    line-height: 1.1;
  }

  /* Reducir tamaño del título del panel amarillo */
  .panel.title h1 {
    font-size: 2.2em;
  }

  /* Bajar un poco la altura del slider para que
     no invada el padding inferior del panel 2 */
  .panel.title .title-slider {
    height: clamp(210px, 28vh, 340px);
  }
}

/* ============================================================
   FIX DEFINITIVO PARA QUE LAS IMÁGENES NO SE VEAN ZOOMADAS
   ============================================================ */

/* Contenedor del slider */
.panel.title .title-slider {
  width: 100%;
  margin-top: 1.5em;
  height: clamp(260px, 32vh, 430px);
  border-radius: 12px;
  overflow: hidden;
  position: relative;
}

/* Pista del slider */
.panel.title .title-slider-track {
  display: flex;
  width: 300%;
  height: 100%;
  transition: transform 0.6s ease;
}

.panel.title .title-slide {
  flex: 0 0 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* ==== REGLA UNIVERSAL PARA TODAS LAS IMÁGENES (DESKTOP) ==== */
.panel.title .title-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* ==== MÓVIL / TABLET: se permite "cover" pero controlado ==== */
@media screen and (max-width: 900px) {
  .panel.title .title-slider {
    height: clamp(200px, 30vh, 320px);
  }

  .panel.title .title-slide img {
    width: 100%;
    height: 100% !important;
    object-fit: cover !important;  /* llena mejor en pantallas pequeñas */
    object-position: center center;
  }
}
/* ========================================
   TITLE SLIDER - regla final de escala
   - La imagen llena siempre el slider
   - Puede recortar para evitar franjas
======================================== */
.panel.title .title-slide img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: center center !important;
  display: block;
}

/* Mobile skills: keep 6x4 grid layout */
@media screen and (max-width: 600px) {
  .skills-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* Toolbar button adjustments */
.darkmode-btn {padding:0;aspect-ratio:1/1;width:2.8em;height:2.8em;display:inline-flex;align-items:center;justify-content:center;}

.earth-modal-close {padding:0;aspect-ratio:1/1;display:inline-flex;align-items:center;justify-content:center;}
