/* ========================================
   GLOBAL VARIABLES
======================================== */
:root {
  --accent-color: rgb(255, 237, 0);
  --bg-color: #ffffff;          /* Fondo claro por defecto */
  --panel-color: #e6e6e6;       /* Color de panel en modo claro */
  --text-color: #000000;        /* Texto oscuro en modo claro */
  --overlay-center: rgba(255, 255, 255, 1);
  --overlay-edge: rgba(255, 255, 255, 0);
}
/* Dark mode */
body.dark-mode {
  --bg-color: #1b1c23;
  --panel-color: #272833;
  --text-color: #ffffff;
  --overlay-center: rgba(27, 28, 35, 1);
  --overlay-edge: rgba(27, 28, 35, 0);
}

/* ========================================
   GLOBAL STYLES
======================================== */
[hidden] {
  display: none !important;
}

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;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at center, var(--overlay-center) 0%, var(--overlay-center) 22%, var(--overlay-edge) 100%);
}

.mobile-portrait-lock {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: clamp(1.25rem, 4vw, 2.25rem);
  background:
    radial-gradient(circle at 50% 30%, rgba(255, 237, 0, 0.2), transparent 38%),
    linear-gradient(180deg, rgba(10, 11, 18, 0.98), rgba(16, 18, 28, 0.98));
  color: #f3f3f3;
  text-align: center;
}

.mobile-portrait-lock__panel {
  width: min(100%, 28rem);
  padding: clamp(1.25rem, 4vw, 2rem);
  border: 1px solid rgba(255, 237, 0, 0.28);
  border-radius: 18px;
  background: rgba(24, 26, 38, 0.92);
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(10px);
}

.mobile-portrait-lock__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.5rem;
  height: 3.5rem;
  margin-bottom: 0.9rem;
  border-radius: 999px;
  background: rgba(255, 237, 0, 0.14);
  color: var(--accent-color);
  font-size: 1.5rem;
}

.mobile-portrait-lock__eyebrow {
  margin: 0 0 0.45rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 237, 0, 0.88);
}

.mobile-portrait-lock__title {
  margin: 0 0 0.65rem;
  font-size: clamp(1.35rem, 4vw, 1.9rem);
  line-height: 1.1;
}

.mobile-portrait-lock__text {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.45;
  color: rgba(243, 243, 243, 0.86);
}

* {
  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);
}

.experience-card-link {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  --experience-accent-soft: color-mix(in srgb, var(--accent-color) 82%, white 18%);
  --experience-accent-bright: color-mix(in srgb, var(--accent-color) 92%, white 8%);
  --experience-accent-deep: color-mix(in srgb, var(--accent-color) 76%, black 24%);
  --experience-accent-shadow: color-mix(in srgb, var(--accent-color) 24%, transparent);
  transition:
    transform 0.38s cubic-bezier(0.2, 0.8, 0.2, 1),
    box-shadow 0.38s ease,
    background-color 0.38s ease,
    color 0.35s ease;
}

.experience-card-link::before {
  content: "";
  position: absolute;
  inset: -35%;
  background:
    linear-gradient(118deg, transparent 26%, rgba(255, 237, 0, 0.04) 38%, rgba(255, 237, 0, 0.42) 49%, rgba(255, 255, 255, 0.24) 50%, rgba(255, 237, 0, 0.16) 53%, transparent 68%),
    radial-gradient(circle at 18% 18%, rgba(255, 237, 0, 0.14), transparent 42%);
  transform: translateX(-72%) rotate(8deg);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.35s ease;
  z-index: 0;
}

.experience-card-link::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  border: 1px solid rgba(255, 237, 0, 0);
  box-shadow: inset 0 0 0 1px rgba(255, 237, 0, 0);
  background:
    linear-gradient(90deg, transparent 0%, rgba(255, 237, 0, 0.14) 50%, transparent 100%),
    repeating-linear-gradient(90deg, rgba(255, 237, 0, 0) 0 13px, rgba(255, 237, 0, 0.045) 13px 14px),
    repeating-linear-gradient(180deg, rgba(255, 237, 0, 0) 0 13px, rgba(255, 237, 0, 0.035) 13px 14px);
  background-size: 220% 100%, 100% 100%, 100% 100%;
  background-position: -140% 0, 0 0, 0 0;
  opacity: 0;
  transition:
    border-color 0.35s ease,
    box-shadow 0.35s ease,
    background-position 0.85s cubic-bezier(0.2, 0.8, 0.2, 1),
    opacity 0.35s ease;
}

.experience-card-link > div {
  position: relative;
  z-index: 2;
  transition: transform 0.35s ease;
}

.experience-fireworks {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 1;
  pointer-events: none;
  border-radius: inherit;
  opacity: 0;
  transition: opacity 0.35s ease;
}

.experience-card-link__fx {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  border-radius: inherit;
}

.experience-card-link__progress,
.experience-card-link__celebration {
  position: absolute;
  inset: 0;
}

.experience-card-link__progress {
  transform-origin: left center;
  transform: scaleX(var(--experience-progress-ratio, 0));
  opacity: 0;
  transition: transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.35s ease;
}

.experience-card-link .plus,
.experience-card-link .years,
.experience-card-link #years {
  transition:
    transform 0.35s ease,
    color 0.35s ease,
    text-shadow 0.35s ease,
    opacity 0.35s ease,
    letter-spacing 0.35s ease;
}

.experience-card-link__hint {
  position: relative;
  z-index: 1;
  margin: 0.55rem 0 0;
  font-size: 0.78rem;
  line-height: 1.38;
  font-weight: 600;
  color: color-mix(in srgb, var(--text-color) 72%, var(--accent-color));
  opacity: 0.96;
  text-wrap: balance;
}

.experience-card-link__lead {
  position: relative;
  z-index: 2;
  margin: 0 0 0.35rem;
  font-size: 0.92rem;
  line-height: 1.12;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--text-color) 82%, var(--accent-color));
}

.experience-card-link--monthly-marker,
.experience-card-link--annual-countdown {
  background:
    radial-gradient(circle at 28% 24%, color-mix(in srgb, white 14%, transparent) 0%, color-mix(in srgb, var(--accent-color) 18%, transparent) 22%, transparent 46%),
    radial-gradient(circle at 74% 68%, color-mix(in srgb, var(--accent-color) 10%, transparent) 0%, transparent 34%),
    linear-gradient(135deg, var(--experience-accent-soft), var(--experience-accent-deep));
  color: #111;
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--accent-color) 28%, transparent),
    0 10px 26px color-mix(in srgb, var(--accent-color) 18%, transparent);
  animation: experience-monthly-glow 3.6s ease-in-out infinite;
}

.experience-card-link--monthly-marker::before,
.experience-card-link--annual-countdown::before {
  opacity: 1;
  transform: translateX(6%) rotate(6deg);
  background:
    linear-gradient(118deg, transparent 26%, color-mix(in srgb, var(--accent-color) 12%, transparent) 39%, color-mix(in srgb, white 8%, transparent) 49%, color-mix(in srgb, var(--accent-color) 8%, transparent) 58%, transparent 70%);
}

.experience-card-link--monthly-marker::after,
.experience-card-link--annual-countdown::after {
  opacity: 1;
  border-color: color-mix(in srgb, var(--accent-color) 24%, transparent);
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--accent-color) 9%, transparent),
    inset 0 0 34px color-mix(in srgb, var(--accent-color) 8%, transparent);
  background:
    linear-gradient(90deg, transparent 0%, color-mix(in srgb, var(--accent-color) 10%, transparent) 50%, transparent 100%),
    repeating-linear-gradient(90deg, rgba(255, 237, 0, 0) 0 13px, color-mix(in srgb, var(--accent-color) 5%, transparent) 13px 14px),
    repeating-linear-gradient(180deg, rgba(255, 237, 0, 0) 0 13px, color-mix(in srgb, var(--accent-color) 4%, transparent) 13px 14px);
  background-size: 220% 100%, 100% 100%, 100% 100%;
  background-position: -80% 0, 0 0, 0 0;
  animation: experience-monthly-electric 6.2s linear infinite;
}

.experience-card-link--monthly-marker:hover::before,
.experience-card-link--monthly-marker:focus-visible::before,
.experience-card-link--annual-countdown:hover::before,
.experience-card-link--annual-countdown:focus-visible::before {
  opacity: 1;
  transform: translateX(68%) rotate(8deg);
}

.experience-card-link--monthly-marker:hover::after,
.experience-card-link--monthly-marker:focus-visible::after,
.experience-card-link--annual-countdown:hover::after,
.experience-card-link--annual-countdown:focus-visible::after {
  opacity: 1;
  border-color: rgba(255, 237, 0, 0.28);
  box-shadow: inset 0 0 0 1px rgba(255, 237, 0, 0.1);
  background-position: 140% 0, 0 0, 0 0;
}

.experience-card-link--annual-countdown {
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--accent-color) 28%, transparent),
    0 10px 26px color-mix(in srgb, var(--accent-color) 18%, transparent);
}

.experience-card-link--annual-countdown .experience-card-link__progress {
  opacity: 0.9;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--accent-color) 22%, transparent), color-mix(in srgb, white 8%, transparent)),
    linear-gradient(90deg, color-mix(in srgb, var(--accent-color) 48%, transparent), color-mix(in srgb, var(--accent-color) 24%, black 8%));
}

.experience-card-link--monthly-marker .experience-card-link__progress,
.experience-card-link--annual-countdown .experience-card-link__progress,
.experience-card-link--anniversary .experience-card-link__progress {
  opacity: 1;
  background:
    linear-gradient(115deg, rgba(255, 255, 255, 0.18), transparent 30%, rgba(255, 255, 255, 0.1) 52%, transparent 72%),
    linear-gradient(180deg, color-mix(in srgb, var(--accent-color) 26%, transparent), color-mix(in srgb, var(--accent-color) 10%, black 10%));
  animation: experience-monthly-sheen 2.9s linear infinite;
}

.experience-card-link--anniversary {
  background:
    radial-gradient(circle at 18% 24%, color-mix(in srgb, white 26%, transparent), transparent 28%),
    radial-gradient(circle at 80% 12%, color-mix(in srgb, var(--accent-color) 30%, transparent), transparent 24%),
    linear-gradient(135deg, var(--experience-accent-bright), var(--experience-accent-deep));
  color: #111;
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--accent-color) 32%, transparent),
    0 14px 34px color-mix(in srgb, var(--accent-color) 22%, transparent),
    0 0 32px color-mix(in srgb, var(--accent-color) 18%, transparent),
    inset 0 1px 0 color-mix(in srgb, white 28%, transparent);
  animation: experience-anniversary-hero 3.8s ease-in-out infinite;
}

.experience-card-link--anniversary .experience-fireworks {
  opacity: 1;
}

.experience-card-link--monthly-marker .plus,
.experience-card-link--monthly-marker .years,
.experience-card-link--monthly-marker #years,
.experience-card-link--annual-countdown .plus,
.experience-card-link--annual-countdown .years,
.experience-card-link--annual-countdown #years,
.experience-card-link--anniversary .plus,
.experience-card-link--anniversary .years,
.experience-card-link--anniversary #years,
.experience-card-link--monthly-marker .experience-card-link__hint,
.experience-card-link--annual-countdown .experience-card-link__hint,
.experience-card-link--anniversary .experience-card-link__hint {
  color: #111;
  text-shadow: none;
}

.experience-card-link--monthly-marker .plus,
.experience-card-link--annual-countdown .plus,
.experience-card-link--anniversary .plus {
  color: #c89400;
}

.experience-card-link--anniversary > div {
  transform: translateY(-2px);
}

.experience-card-link--anniversary .experience-card-link__lead {
  color: #111;
  font-size: 0.98rem;
  letter-spacing: 0.1em;
}

.experience-card-link--anniversary .plus {
  transform: translateY(-4px) scale(1.2);
  text-shadow:
    0 0 22px color-mix(in srgb, white 42%, transparent),
    0 0 30px color-mix(in srgb, var(--accent-color) 26%, transparent);
}

.experience-card-link--anniversary .years {
  transform: scale(1.06);
  letter-spacing: 0.02em;
  color: #111;
  text-shadow:
    0 0 12px color-mix(in srgb, white 24%, transparent),
    0 0 22px color-mix(in srgb, var(--accent-color) 18%, transparent);
}

.experience-card-link--anniversary #years {
  font-size: 1rem;
  letter-spacing: 0.02em;
}

.experience-card-link--anniversary .experience-card-link__hint {
  font-size: 0.98rem;
  line-height: 1.46;
  font-weight: 700;
  max-width: 13ch;
}

.experience-card-link--monthly-marker .experience-card-link__hint,
.experience-card-link--annual-countdown .experience-card-link__hint {
  font-size: 1rem;
  line-height: 1.32;
  font-weight: 700;
  letter-spacing: 0.02em;
  max-width: none;
  white-space: nowrap;
  text-wrap: nowrap;
}

.experience-card-link--monthly-marker #years,
.experience-card-link--annual-countdown #years {
  font-size: 1rem;
  line-height: 1.32;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.experience-card-link--anniversary:hover .plus,
.experience-card-link--anniversary:focus-visible .plus {
  color: var(--accent-color);
}

body.dark-mode .grid-panels .panel:nth-child(4):hover .plus,
body.dark-mode .grid-panels .panel:nth-child(4):focus-visible .plus,
body.dark-mode .experience-card-link:hover .plus,
body.dark-mode .experience-card-link:focus-visible .plus {
  color: var(--accent-color);
}

body.dark-mode .experience-card-link:hover .years,
body.dark-mode .experience-card-link:focus-visible .years,
body.dark-mode .experience-card-link:hover .experience-card-link__hint,
body.dark-mode .experience-card-link:focus-visible .experience-card-link__hint {
  color: #fff;
}

.experience-card-link--anniversary:hover .years,
.experience-card-link--anniversary:focus-visible .years,
.experience-card-link--anniversary:hover #years,
.experience-card-link--anniversary:focus-visible #years,
.experience-card-link--anniversary:hover .experience-card-link__lead,
.experience-card-link--anniversary:focus-visible .experience-card-link__lead,
.experience-card-link--anniversary:hover .experience-card-link__hint,
.experience-card-link--anniversary:focus-visible .experience-card-link__hint {
  color: var(--text-color);
  text-shadow: none;
}

.experience-card-link:hover,
.experience-card-link:focus-visible {
  transform: translateY(-6px) scale(1.01);
  box-shadow:
    0 22px 42px rgba(0, 0, 0, 0.26),
    0 0 0 1px rgba(255, 237, 0, 0.14),
    0 0 28px rgba(255, 237, 0, 0.08);
  background:
    radial-gradient(circle at 16% 16%, rgba(255, 237, 0, 0.12), transparent 40%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0)),
    var(--panel-color);
}

.experience-card-link:hover::before,
.experience-card-link:focus-visible::before {
  opacity: 1;
  transform: translateX(68%) rotate(8deg);
}

.experience-card-link:hover::after,
.experience-card-link:focus-visible::after {
  opacity: 1;
  border-color: rgba(255, 237, 0, 0.28);
  box-shadow: inset 0 0 0 1px rgba(255, 237, 0, 0.1);
  background-position: 140% 0, 0 0, 0 0;
}

.experience-card-link:hover > div,
.experience-card-link:focus-visible > div {
  transform: translateY(-2px);
}

.experience-card-link:hover .plus,
.experience-card-link:focus-visible .plus {
  color: var(--accent-color);
  transform: translateY(-3px) scale(1.14);
  text-shadow:
    0 0 22px rgba(255, 237, 0, 0.38),
    0 0 6px rgba(255, 255, 255, 0.14);
}

.experience-card-link:hover .years,
.experience-card-link:focus-visible .years {
  transform: translateY(-2px) scale(1.08);
}

.experience-card-link:hover #years,
.experience-card-link:focus-visible #years {
  color: color-mix(in srgb, var(--text-color) 64%, var(--accent-color));
  letter-spacing: 0.03em;
}

.experience-card-link:focus-visible {
  outline: 2px solid var(--accent-color);
  outline-offset: 2px;
}

body:not(.dark-mode) .experience-card-link:hover,
body:not(.dark-mode) .experience-card-link:focus-visible {
  box-shadow:
    0 16px 30px rgba(55, 65, 81, 0.14),
    0 0 0 1px rgba(122, 111, 0, 0.16),
    0 0 20px rgba(122, 111, 0, 0.06);
}

body:not(.dark-mode) .experience-card-link::before {
  background:
    radial-gradient(circle at 18% 18%, rgba(122, 111, 0, 0.08), transparent 42%);
}

body:not(.dark-mode) .experience-card-link::after {
  background:
    linear-gradient(90deg, transparent 0%, rgba(122, 111, 0, 0.12) 50%, transparent 100%),
    repeating-linear-gradient(90deg, rgba(122, 111, 0, 0) 0 13px, rgba(122, 111, 0, 0.04) 13px 14px),
    repeating-linear-gradient(180deg, rgba(122, 111, 0, 0) 0 13px, rgba(122, 111, 0, 0.03) 13px 14px);
}

body:not(.dark-mode) .experience-card-link:hover::after,
body:not(.dark-mode) .experience-card-link:focus-visible::after {
  border-color: rgba(122, 111, 0, 0.26);
  box-shadow: inset 0 0 0 1px rgba(122, 111, 0, 0.12);
}

body:not(.dark-mode) .experience-card-link__hint {
  color: rgba(74, 60, 18, 0.88);
}

body:not(.dark-mode) .experience-card-link--monthly-marker,
body:not(.dark-mode) .experience-card-link--anniversary {
  color: #121212;
}

@keyframes experience-monthly-glow {
  0%, 100% {
    box-shadow:
      0 0 0 1px color-mix(in srgb, var(--accent-color) 22%, transparent),
      0 10px 24px color-mix(in srgb, var(--accent-color) 14%, transparent);
  }
  50% {
    box-shadow:
      0 0 0 1px color-mix(in srgb, var(--accent-color) 30%, transparent),
      0 14px 32px color-mix(in srgb, var(--accent-color) 22%, transparent),
      0 0 22px color-mix(in srgb, var(--accent-color) 14%, transparent);
  }
}

@keyframes experience-monthly-sheen {
  0% {
    background-position: -180% 0, 0 0;
  }
  100% {
    background-position: 220% 0, 0 0;
  }
}

@keyframes experience-monthly-electric {
  0% {
    background-position: center center, -120% 0, 0 0, 0 0;
  }
  50% {
    background-position: center center, 120% 0, 0 0, 0 0;
  }
  100% {
    background-position: center center, -120% 0, 0 0, 0 0;
  }
}

@keyframes experience-anniversary-hero {
  0%, 100% {
    box-shadow:
      0 0 0 1px color-mix(in srgb, var(--accent-color) 32%, transparent),
      0 14px 34px color-mix(in srgb, var(--accent-color) 22%, transparent),
      0 0 32px color-mix(in srgb, var(--accent-color) 18%, transparent),
      inset 0 1px 0 color-mix(in srgb, white 28%, transparent);
  }
  50% {
    box-shadow:
      0 0 0 1px color-mix(in srgb, var(--accent-color) 42%, transparent),
      0 18px 42px color-mix(in srgb, var(--accent-color) 28%, transparent),
      0 0 42px color-mix(in srgb, var(--accent-color) 26%, transparent),
      inset 0 1px 0 color-mix(in srgb, white 36%, transparent);
  }
}

@media (prefers-reduced-motion: reduce) {
  .experience-card-link,
  .experience-card-link::before,
  .experience-card-link::after,
  .experience-card-link > div,
  .experience-card-link .plus,
  .experience-card-link .years,
  .experience-card-link #years {
    transition: none;
  }

  .experience-card-link:hover,
  .experience-card-link:focus-visible,
  .experience-card-link:hover > div,
  .experience-card-link:focus-visible > div,
  .experience-card-link:hover .plus,
  .experience-card-link:focus-visible .plus,
  .experience-card-link:hover .years,
  .experience-card-link:focus-visible .years {
    transform: none;
  }

  .experience-card-link:hover::before,
  .experience-card-link:focus-visible::before {
    opacity: 0;
  }

  .experience-fireworks {
    display: none;
  }
}

/* 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);
}

.title {
  background: radial-gradient(at bottom, var(--accent-color), var(--accent-color));
  text-align: center;
  position: relative;
  overflow: hidden;
  color: #000; /* texto e icono siempre negros sobre amarillo */
}

.title::before {
  content: "";
  position: absolute;
  inset: -30% -10%;
  background:
    radial-gradient(circle at 18% 18%, rgba(255, 255, 255, 0.6), transparent 42%),
    radial-gradient(circle at 75% 65%, rgba(0, 0, 0, 0.18), transparent 46%),
    radial-gradient(circle at 50% 90%, rgba(255, 255, 255, 0.25), transparent 55%);
  opacity: 0.95;
  pointer-events: none;
  animation: titleGlow 6.5s ease-in-out infinite;
}

.title::after {
  content: "";
  position: absolute;
  inset: 0.9em;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 10px;
  pointer-events: none;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.12), inset 0 0 24px rgba(255, 255, 255, 0.18);
}

.title-hero {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.2em;
  height: 100%;
  flex: 1 1 auto;
  text-align: center;
}

.title-hero::before {
  content: "";
  position: absolute;
  inset: -40% -20%;
  background: linear-gradient(120deg, transparent 35%, rgba(255, 255, 255, 0.7) 50%, transparent 65%);
  transform: translateX(-70%) rotate(6deg);
  opacity: 0;
  mix-blend-mode: screen;
  pointer-events: none;
  animation: titleShine 8s ease-in-out infinite;
}

.title-hero::after {
  content: "";
  position: absolute;
  inset: -20%;
  background: radial-gradient(circle at 50% 45%, rgba(255, 255, 255, 0.35), transparent 60%);
  filter: blur(6px);
  opacity: 0.55;
  pointer-events: none;
  animation: titlePulse 4.8s ease-in-out infinite;
}

.title-hero > * {
  position: relative;
  z-index: 1;
}

.title-logo {
  width: clamp(220px, 62%, 520px);
  height: auto;
  filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.35)) drop-shadow(0 0 24px rgba(255, 255, 255, 0.55));
  animation: logoFloat 5.4s ease-in-out infinite;
}

.title-message {
  max-width: 720px;
  font-size: clamp(0.9rem, 1.5vw, 1.2rem);
  line-height: 1.45;
  font-weight: 500;
}

@keyframes titleGlow {
  0%, 100% { transform: scale(1); opacity: 0.9; }
  50% { transform: scale(1.03); opacity: 1; }
}

@keyframes titleShine {
  0% { transform: translateX(-70%) rotate(6deg); opacity: 0; }
  20% { opacity: 0.35; }
  50% { opacity: 0.2; }
  80% { opacity: 0; }
  100% { transform: translateX(70%) rotate(6deg); opacity: 0; }
}

@keyframes titlePulse {
  0%, 100% { opacity: 0.45; transform: scale(0.98); }
  50% { opacity: 0.7; transform: scale(1.02); }
}

@keyframes logoFloat {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-6px) scale(1.02); }
}

.travel i { font-size: 3em; }

/* ========================================
   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: #7a6f00;
  font-weight: 600;
  font-size: 1.5em; /* match Projects/Skills/Last Visit icon size */
}

body.dark-mode .grid-panels .panel:nth-child(4):not(.experience-card-link--monthly-marker):not(.experience-card-link--annual-countdown):not(.experience-card-link--anniversary) .plus {
  color: var(--accent-color);
}

.grid-panels .panel:nth-child(4) .years {
  font-size: 1.5em;
  line-height: 1;
}


/* ========================================
   EARTH ANIMATION
======================================== */
.earth-container {
  --earth-size-rest: 12.2em;
  --earth-size-hover: 19.6em;
  width: calc(var(--earth-size-rest) - 1px);
  height: calc(var(--earth-size-rest) - 1px);
  position: absolute;
  top: 12em;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 52%, rgba(13, 28, 52, 0.96) 0%, rgba(10, 22, 42, 0.88) 34%, rgba(8, 18, 34, 0.56) 57%, rgba(8, 18, 34, 0.16) 76%, rgba(8, 18, 34, 0) 100%),
    radial-gradient(circle at 32% 28%, rgba(99, 203, 255, 0.18), transparent 44%),
    radial-gradient(circle at 72% 74%, rgba(255, 237, 0, 0.08), transparent 32%);
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: visible;
  --earth-tilt-x: 0deg;
  --earth-tilt-y: 0deg;
  --earth-drift-x: 0px;
  --earth-drift-y: 0px;
  --earth-glow-x: 0%;
  --earth-glow-y: 0%;
  --earth-cloud-x: 0px;
  --earth-cloud-y: 0px;
  filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.18));
  transition:
    width 820ms cubic-bezier(0.2, 0.8, 0.2, 1),
    height 820ms cubic-bezier(0.2, 0.8, 0.2, 1),
    transform 820ms cubic-bezier(0.2, 0.8, 0.2, 1),
    filter 420ms ease,
    background 420ms ease;
  perspective: 1200px;
  transform-style: preserve-3d;
  isolation: isolate;
  z-index: 1;
  cursor: pointer;
}

body:not(.dark-mode) .earth-container,
body.light .earth-container,
body[data-theme="light"] .earth-container {
  background:
    radial-gradient(circle at 50% 52%, rgba(235, 242, 251, 0.94) 0%, rgba(219, 230, 245, 0.9) 34%, rgba(197, 214, 236, 0.54) 58%, rgba(197, 214, 236, 0.14) 78%, rgba(197, 214, 236, 0) 100%),
    radial-gradient(circle at 32% 28%, rgba(99, 203, 255, 0.16), transparent 44%),
    radial-gradient(circle at 72% 74%, rgba(255, 237, 0, 0.1), transparent 32%);
}

.earth-container::before,
.earth-container::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.earth-container::before {
  inset: 4%;
  background: radial-gradient(circle, rgba(99, 203, 255, 0.18) 0%, rgba(99, 203, 255, 0.08) 40%, transparent 72%);
  filter: blur(12px);
  opacity: 0.72;
  animation: earthHaloPulse 10s ease-in-out infinite;
}

.earth-container::after {
  inset: -7%;
  border: 1px solid rgba(99, 203, 255, 0.12);
  opacity: 0.24;
  transform: scale(0.96);
  animation: earthShellPulse 9s ease-in-out infinite;
}

.earth {
  position: relative;
  background-image: url(../img/home/earth.jpg);
  width: 80%;
  height: 80%;
  border-radius: inherit;
  overflow: hidden;
  box-shadow:
    0 0 18px rgba(99, 203, 255, 0.72),
    0 0 42px rgba(99, 203, 255, 0.2),
    inset -2.1em -2.1em 2.4em rgba(0, 0, 0, 0.9);
  background-repeat: repeat;
  background-size: 220% 100%;
  animation: earthTextureSpin 140s linear infinite, earthBreath 14s ease-in-out infinite;
  transform:
    translate3d(var(--earth-drift-x), var(--earth-drift-y), 0)
    rotateX(var(--earth-tilt-x))
    rotateY(var(--earth-tilt-y));
  transform-origin: 50% 50%;
  transform-style: preserve-3d;
  backface-visibility: hidden;
  will-change: transform, box-shadow, filter;
  filter: saturate(1.06) contrast(1.05) brightness(1.01);
  transition: transform 420ms cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 420ms ease, filter 420ms ease;
  cursor: inherit;
  z-index: 1;
}

.earth::before,
.earth::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
}

.earth::before {
  background:
    radial-gradient(circle at calc(28% + var(--earth-glow-x)) calc(30% + var(--earth-glow-y)), rgba(255, 255, 255, 0.34) 0%, rgba(255, 255, 255, 0.12) 16%, rgba(255, 255, 255, 0) 32%),
    linear-gradient(112deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.02) 22%, rgba(0, 0, 0, 0.1) 52%, rgba(0, 0, 0, 0.72) 100%);
  mix-blend-mode: screen;
  opacity: 0.92;
  animation: earthLightShift 18s ease-in-out infinite;
}

.earth::after {
  inset: -5%;
  background:
    radial-gradient(circle at calc(34% + var(--earth-glow-x)) calc(34% + var(--earth-glow-y)), rgba(99, 203, 255, 0.26), transparent 48%),
    radial-gradient(circle at calc(50% + var(--earth-glow-x)) calc(50% + var(--earth-glow-y)), transparent 58%, rgba(99, 203, 255, 0.22) 74%, rgba(99, 203, 255, 0) 82%);
  opacity: 0.78;
  filter: blur(1.4px);
  animation: earthAuraPulse 12s ease-in-out infinite;
}

.earth-container {
  overflow: visible;
}

/* Mobile-only Earth card */
.earth-mobile-panel {
  display: none;
  padding: 0;
  position: relative;
  overflow: hidden;
}

/* Curved text ring (SVG textPath) */
.earth-ring {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  transform: scale(0.96);
  filter: blur(8px);
  transition: opacity 250ms ease, transform 420ms cubic-bezier(0.2, 0.8, 0.2, 1), filter 320ms ease;
  color: #000;
  z-index: 3;
}

.earth-container.is-hover .earth-ring,
.earth-container:hover .earth-ring,
.earth-container:focus .earth-ring,
.earth-container:focus-visible .earth-ring {
  opacity: 1;
  transform: scale(1);
  filter: blur(0);
}

body.dark-mode .earth-container .earth-ring,
body.dark .earth-container .earth-ring,
body[data-theme="dark"] .earth-container .earth-ring {
  color: #fff;
}

body.light .earth-container .earth-ring,
body[data-theme="light"] .earth-container .earth-ring {
  color: #000;
}

.ring-svg {
  width: 172%;
  height: 172%;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  overflow: visible;
  filter: drop-shadow(0 0 8px rgba(255, 237, 0, 0.12));
}

.ring-rotor {
  transform-origin: 500px 500px;
  animation: ringSpin 24s linear infinite;
  animation-play-state: paused;
  will-change: transform;
}

.earth-container.is-hover .ring-rotor,
.earth-container:hover .ring-rotor,
.earth-container:focus .ring-rotor,
.earth-container:focus-visible .ring-rotor {
  animation-play-state: running;
}

.ring-text {
  fill: currentColor;
  font-family: "Kanit", "Noto Sans Arabic", "Noto Nastaliq Urdu", "Noto Sans", "Noto Sans SC", "Noto Sans JP", "Noto Sans KR", "Noto Sans Devanagari", "Noto Sans Bengali", sans-serif;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-anchor: start;
  dominant-baseline: middle;
  opacity: 0.96;
}

@keyframes ringSpin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .ring-rotor,
  .earth-container::before,
  .earth-container::after,
  .earth,
  .earth::before,
  .earth::after,
  .clouds {
    animation: none !important;
  }

  .earth-container,
  .earth,
  .earth-ring,
  .clouds {
    transition: none !important;
  }

  .earth {
    transform: none !important;
    filter: none;
  }

  .clouds {
    transform: translate(-50%, -50%) !important;
  }
}

.clouds {
  background-repeat: repeat;
  background-size: 220% 100%;
  background-image: url(../img/home/clouds.jpg);
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(calc(-50% + var(--earth-cloud-x)), calc(-50% + var(--earth-cloud-y))) scale(1.03);
  transform-origin: 50% 50%;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  opacity: 0.34;
  box-shadow: inherit;
  mix-blend-mode: screen;
  filter: blur(0.14px);
  animation: earthCloudSpin 92s linear infinite reverse, cloudPulse 16s ease-in-out infinite;
  will-change: transform, opacity, background-position;
  transition: transform 420ms cubic-bezier(0.2, 0.8, 0.2, 1), opacity 320ms ease, filter 320ms ease;
}

.earth-container.is-hover,
.earth-container:hover,
.earth-container:focus,
.earth-container:focus-visible {
  width: calc(var(--earth-size-hover) - 1px);
  height: calc(var(--earth-size-hover) - 1px);
  filter: drop-shadow(0 18px 34px rgba(0, 0, 0, 0.24));
}

.earth-container.is-hover::before,
.earth-container:hover::before,
.earth-container:focus::before,
.earth-container:focus-visible::before {
  opacity: 0.96;
}

.earth-container.is-hover::after,
.earth-container:hover::after,
.earth-container:focus::after,
.earth-container:focus-visible::after {
  opacity: 0.42;
}

.earth-container.is-hover .earth,
.earth-container:hover .earth,
.earth-container:focus .earth,
.earth-container:focus-visible .earth {
  animation-duration: 108s, 10s;
  filter: saturate(1.12) contrast(1.1) brightness(1.03);
  box-shadow:
    0 0 22px rgba(99, 203, 255, 0.86),
    0 0 56px rgba(99, 203, 255, 0.28),
    inset -2.2em -2.2em 2.6em rgba(0, 0, 0, 0.92);
}

.earth-container.is-hover .clouds,
.earth-container:hover .clouds,
.earth-container:focus .clouds,
.earth-container:focus-visible .clouds {
  animation-duration: 76s, 11s;
  opacity: 0.44;
  filter: blur(0);
  transform: translate(calc(-50% + var(--earth-cloud-x)), calc(-50% + var(--earth-cloud-y))) scale(1.05);
}

/* ========================================
   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 */







.earth-container:hover {
  transform: translateX(-50%);
}

.earth-container:hover + .grid-panels {
  opacity: 0.5;
}

@keyframes earthTextureSpin {
  to { background-position: -200% 0; }
}

@keyframes earthCloudSpin {
  to { background-position: 200% 0; }
}

@keyframes earthBreath {
  0%, 100% {
    transform:
      translate3d(var(--earth-drift-x), var(--earth-drift-y), 0)
      rotateX(var(--earth-tilt-x))
      rotateY(var(--earth-tilt-y))
      scale(1)
      rotate(-1.4deg);
  }
  50% {
    transform:
      translate3d(var(--earth-drift-x), var(--earth-drift-y), 0)
      rotateX(var(--earth-tilt-x))
      rotateY(var(--earth-tilt-y))
      scale(1.025)
      rotate(1.2deg);
  }
}

@keyframes earthLightShift {
  0%, 100% {
    transform: translateX(-3%) rotate(-3deg);
    opacity: 0.84;
  }
  50% {
    transform: translateX(3%) rotate(2deg);
    opacity: 1;
  }
}

@keyframes earthAuraPulse {
  0%, 100% {
    transform: scale(0.98);
    opacity: 0.72;
  }
  50% {
    transform: scale(1.02);
    opacity: 0.92;
  }
}

@keyframes earthHaloPulse {
  0%, 100% {
    transform: scale(0.96);
    opacity: 0.6;
  }
  50% {
    transform: scale(1.04);
    opacity: 0.9;
  }
}

@keyframes earthShellPulse {
  0%, 100% {
    transform: scale(0.96);
    opacity: 0.18;
  }
  50% {
    transform: scale(1.015);
    opacity: 0.34;
  }
}

@keyframes cloudPulse {
  0%, 100% {
    opacity: 0.34;
  }
  50% {
    opacity: 0.5;
  }
}

/* ========================================
   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);
}

/* Split panels (Panel 3 + Panel 6) */
.panel.panel-split {
  background-color: transparent;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.2em;
  align-items: stretch;
  justify-content: stretch;
}

.panel.panel-split:hover {
  transform: none;
}

.panel-tile {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background-color: var(--panel-color);
  border-radius: 12px;
  padding: 1.5em;
  color: var(--text-color);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6em;
  height: 100%;
  text-align: center;
  border: none;
  font-family: inherit;
  transition:
    transform 0.38s cubic-bezier(0.2, 0.8, 0.2, 1),
    box-shadow 0.38s ease,
    background-color 0.38s ease,
    color 0.35s ease;
}

.panel-tile::before {
  content: "";
  position: absolute;
  inset: -35%;
  background:
    linear-gradient(118deg, transparent 26%, rgba(255, 237, 0, 0.03) 38%, rgba(255, 237, 0, 0.34) 49%, rgba(255, 255, 255, 0.18) 50%, rgba(255, 237, 0, 0.12) 53%, transparent 68%),
    radial-gradient(circle at 18% 18%, rgba(255, 237, 0, 0.12), transparent 42%);
  transform: translateX(-72%) rotate(8deg);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.35s ease;
  z-index: 0;
}

.panel-tile::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  border: 1px solid rgba(255, 237, 0, 0);
  box-shadow: inset 0 0 0 1px rgba(255, 237, 0, 0);
  background:
    linear-gradient(90deg, transparent 0%, rgba(255, 237, 0, 0.12) 50%, transparent 100%),
    repeating-linear-gradient(90deg, rgba(255, 237, 0, 0) 0 13px, rgba(255, 237, 0, 0.04) 13px 14px),
    repeating-linear-gradient(180deg, rgba(255, 237, 0, 0) 0 13px, rgba(255, 237, 0, 0.03) 13px 14px);
  background-size: 220% 100%, 100% 100%, 100% 100%;
  background-position: -140% 0, 0 0, 0 0;
  opacity: 0;
  transition:
    border-color 0.35s ease,
    box-shadow 0.35s ease,
    background-position 0.85s cubic-bezier(0.2, 0.8, 0.2, 1),
    opacity 0.35s ease;
}

.panel-tile > * {
  position: relative;
  z-index: 1;
}

.panel-tile:hover,
.panel-tile:focus-visible,
.panel-tile.tap-active {
  transform: translateY(-4px) scale(1.01);
  box-shadow:
    0 18px 36px rgba(0, 0, 0, 0.24),
    0 0 0 1px rgba(255, 237, 0, 0.12),
    0 0 24px rgba(255, 237, 0, 0.07);
  background:
    radial-gradient(circle at 16% 16%, rgba(255, 237, 0, 0.1), transparent 40%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0)),
    var(--panel-color);
}

.panel-tile:hover::before,
.panel-tile:focus-visible::before,
.panel-tile.tap-active::before {
  opacity: 1;
  transform: translateX(68%) rotate(8deg);
}

.panel-tile:hover::after,
.panel-tile:focus-visible::after,
.panel-tile.tap-active::after {
  opacity: 1;
  border-color: rgba(255, 237, 0, 0.24);
  box-shadow: inset 0 0 0 1px rgba(255, 237, 0, 0.08);
  background-position: 140% 0, 0 0, 0 0;
}

body:not(.dark-mode) .panel-tile::before {
  background:
    linear-gradient(118deg, transparent 26%, rgba(122, 111, 0, 0.03) 38%, rgba(122, 111, 0, 0.22) 49%, rgba(255, 255, 255, 0.42) 50%, rgba(122, 111, 0, 0.08) 53%, transparent 68%),
    radial-gradient(circle at 18% 18%, rgba(122, 111, 0, 0.08), transparent 42%);
}

body:not(.dark-mode) .panel-tile::after {
  background:
    linear-gradient(90deg, transparent 0%, rgba(122, 111, 0, 0.1) 50%, transparent 100%),
    repeating-linear-gradient(90deg, rgba(122, 111, 0, 0) 0 13px, rgba(122, 111, 0, 0.035) 13px 14px),
    repeating-linear-gradient(180deg, rgba(122, 111, 0, 0) 0 13px, rgba(122, 111, 0, 0.025) 13px 14px);
}

body:not(.dark-mode) .panel-tile:hover,
body:not(.dark-mode) .panel-tile:focus-visible,
body:not(.dark-mode) .panel-tile.tap-active {
  box-shadow:
    0 14px 28px rgba(55, 65, 81, 0.12),
    0 0 0 1px rgba(122, 111, 0, 0.14),
    0 0 18px rgba(122, 111, 0, 0.05);
}

body:not(.dark-mode) .panel-tile:hover::after,
body:not(.dark-mode) .panel-tile:focus-visible::after,
body:not(.dark-mode) .panel-tile.tap-active::after {
  border-color: rgba(122, 111, 0, 0.22);
  box-shadow: inset 0 0 0 1px rgba(122, 111, 0, 0.08);
}

.panel-tile-link {
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 600;
  font-size: 1.25em;
  cursor: pointer;
  width: 100%;
  height: 100%;
  line-height: 1;
  transition: font-size 0.3s ease;
}

.panel-tile-link:focus-visible {
  outline: 2px solid var(--accent-color);
  outline-offset: 2px;
}

.panel-tile-lang {
  flex-direction: column;
  gap: 0.5em;
  font-size: 1em;
}

.panel-tile-lang .language-display {
  font-size: 3em;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: var(--accent-color);
  line-height: 1;
}

.panel-tile-lang .language-options {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6em;
  font-size: 0.85em;
  letter-spacing: 0.22em;
}

.panel-tile-lang .lang-option {
  opacity: 0.7;
}

.panel-tile-lang .lang-option.active {
  color: var(--accent-color);
  opacity: 1;
}

body:not(.dark-mode) .panel-tile-lang .language-display {
  color: #7a6f00;
}

body:not(.dark-mode) .panel-tile-lang .lang-option {
  color: #adadad;
  opacity: 1;
}

body:not(.dark-mode) .panel-tile-lang .lang-option.active {
  color: #7a6f00;
  opacity: 1;
}


.panel-6-split .panel-tile-link:hover {
  font-size: 1.5em;
}

.panel-6-split .panel-tile-link.tap-active {
  font-size: 1.5em;
}

.panel-tile-blog {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2em;
}

.blog-title {
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 600;
  font-size: 1em;
}

.blog-countdown-label {
  font-size: 0.68em;
  letter-spacing: 0.06em;
  opacity: 0.9;
  text-transform: none;
  color: color-mix(in srgb, var(--text-color) 86%, transparent);
  line-height: 1.2;
}

.blog-countdown-value {
  font-size: 0.95em;
  letter-spacing: 0.05em;
  color: var(--accent-color);
  font-weight: 700;
  line-height: 1.1;
  text-transform: none;
  font-variant-numeric: tabular-nums;
  background: color-mix(in srgb, var(--accent-color) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent-color) 50%, transparent);
  border-radius: 8px;
  padding: 0.24em 0.62em;
  min-width: 12.7ch;
  text-align: center;
  display: grid;
  gap: 0.18em;
}

body:not(.dark-mode) .blog-countdown-label {
  color: color-mix(in srgb, #1f2937 88%, transparent);
}

body:not(.dark-mode) .blog-countdown-value {
  color: #7a6f00;
  background: rgba(255, 237, 0, 0.2);
  border-color: rgba(122, 111, 0, 0.45);
}

/* Light mode: use the same darker yellow from countdown for key icons */
body:not(.dark-mode) .grid-panels .panel:nth-child(4) .plus,
body:not(.dark-mode) .skills-panel h2::before,
body:not(.dark-mode) .grid-panels .panel:nth-child(8) h2::before,
body:not(.dark-mode) .experience-panel h2::before,
body:not(.dark-mode) #experience::before {
  color: #7a6f00;
}

.blog-countdown-days {
  font-size: 0.82em;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.blog-countdown-time {
  font-size: 1em;
  font-weight: 800;
  letter-spacing: 0.1em;
}

@media (hover: none), (pointer: coarse) {
  .panel-tile:hover {
    transform: none;
    background-color: var(--panel-color);
  }

  .panel-6-split .panel-tile-link:hover {
    font-size: 1.25em;
  }

  .panel-tile-dark:hover .darkmode-btn {
    transform: none;
  }

  .darkmode-btn:hover {
    transform: none;
  }
}

/* ========================================
   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;
}

.panel-3.panel-split {
  gap: 1.2em;
}

.panel-3 .language-switcher {
  width: auto;
  flex-wrap: wrap;
}

/* === 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);
}

.panel-tile-dark.tap-active .darkmode-btn {
  transform: rotate(15deg);
}

.darkmode-btn.tap-active {
  transform: rotate(15deg);
}

.panel-tile-dark:hover .darkmode-btn {
  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('../img/icons/sun.svg'); }
.darkmode-btn .moon { background-image: url('../img/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;
  width: 100%;
}

.modal-lang-switcher {
  --switch-w: 86px;
  --switch-h: 2.6rem;
  --switch-pad: 3px;
  --thumb-size: calc(var(--switch-h) - (var(--switch-pad) * 2));
  position: relative;
  justify-content: stretch;
  align-items: center;
  width: var(--switch-w);
  min-width: var(--switch-w);
  height: var(--switch-h);
  padding: var(--switch-pad);
  border-radius: 999px;
  overflow: visible;
  isolation: isolate;
  background: #d6dae4;
  box-shadow: inset 0 2px 5px rgba(20, 28, 58, 0.2), 0 6px 14px rgba(8, 15, 34, 0.18);
  cursor: pointer;
  z-index: 20;
  user-select: none;
  touch-action: none;
}

.toolbar-actions .modal-lang-switcher {
  margin-left: 0.9rem;
  margin-right: 0.9rem;
}

.modal-lang-switcher::before {
  content: "";
  position: absolute;
  inset: var(--switch-pad);
  border-radius: 999px;
  background-image: url("../img/flags/gb.svg");
  background-position: center;
  background-size: cover;
  opacity: 0.95;
  transition: background-image 0.3s ease;
  z-index: 0;
}

.modal-lang-switcher::after {
  content: "EN";
  position: absolute;
  left: var(--switch-pad);
  top: 50%;
  width: var(--thumb-size);
  height: var(--thumb-size);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffffff 0%, #f3f5fb 100%);
  box-shadow: 0 3px 8px rgba(8, 15, 34, 0.3), inset 0 0 0 2px #d8dce8;
  transform: translate(0, -50%);
  transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.25, 1);
  will-change: transform;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #1e2744;
  z-index: 1;
}

.modal-lang-switcher.dragging {
  cursor: grabbing;
}

.modal-lang-switcher:has(#earthLangES.active)::before,
.modal-lang-switcher:has(.lang-btn[data-lang="es"].active)::before {
  background-image: url("../img/flags/es.svg");
}

.modal-lang-switcher:has(#earthLangES.active)::after,
.modal-lang-switcher:has(.lang-btn[data-lang="es"].active)::after {
  content: "ES";
  transform: translate(calc(var(--switch-w) - var(--thumb-size) - (var(--switch-pad) * 2)), -50%);
}

.modal-lang-switcher.dragging::after,
.modal-lang-switcher.dragging:has(#earthLangES.active)::after,
.modal-lang-switcher.dragging:has(.lang-btn[data-lang="es"].active)::after {
  transition: none;
  transform: translate(var(--drag-thumb-x, 0px), -50%) scale(1.02);
}

.lang-btn {
  display: none;
}

body.dark-mode .modal-lang-switcher {
  background: #2a2f3f;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.4), 0 6px 14px rgba(0, 0, 0, 0.35);
}

body.dark-mode .modal-lang-switcher::after {
  color: #1a2444;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.42), inset 0 0 0 2px #d8dce8;
}


/* ========================================
   PANEL 9: LAST VISIT
======================================== */
.panel.last-visit-panel {
  --last-visit-inner-pad: 1.5em;
  --last-visit-panel-marker-color: var(--accent-color);
  --last-visit-panel-marker-core-fill: var(--last-visit-panel-marker-color);
  --last-visit-panel-marker-core-highlight: transparent;
  --last-visit-top-accordion-height: 0px;
  --last-visit-top-accordion-offset: 0px;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-start;
  gap: 0.7rem;
  min-height: 13.5rem;
  padding: 0;
  text-align: left;
  color: #f0f0f0;
  background: #101a28;
  overflow: hidden;
  isolation: isolate;
  top: 0;
  backface-visibility: hidden;
  transition: top 0.3s ease, background-color 0.4s ease, color 0.4s ease;
}

.panel.last-visit-panel:hover {
  top: -2px;
  transform: none;
}

.last-visit-panel > :not(.last-visit-map-shell) {
  position: relative;
  z-index: 2;
}

.last-visit-panel > i {
  margin: 0 var(--last-visit-inner-pad);
  color: var(--accent-color);
  font-size: 1.3rem;
  line-height: 1;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.26);
}

.panel.last-visit-panel .last-visit-top-accordion {
  position: absolute;
  top: 0.9rem;
  right: 1rem;
  z-index: 4;
  width: min(16.6rem, calc(100% - 2rem));
  display: flex;
  flex-direction: column;
  align-items: stretch;
  border-radius: 1.15rem;
  overflow: hidden;
  isolation: isolate;
  padding: 0.32rem 0.34rem 0.34rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background:
    linear-gradient(180deg, rgba(18, 24, 36, 0.28), rgba(11, 16, 24, 0.18));
  backdrop-filter: blur(20px) saturate(145%);
  box-shadow:
    0 14px 28px rgba(4, 9, 16, 0.18);
  transform: translateY(0);
  transition: transform 0.3s ease, background-color 0.24s ease, border-color 0.24s ease, box-shadow 0.24s ease, backdrop-filter 0.24s ease;
}

.panel.last-visit-panel .last-visit-top-accordion::before {
  content: "";
  position: absolute;
  inset: -35%;
  background:
    linear-gradient(118deg, transparent 26%, rgba(255, 237, 0, 0.03) 38%, rgba(255, 237, 0, 0.26) 49%, rgba(255, 255, 255, 0.2) 50%, rgba(255, 237, 0, 0.1) 53%, transparent 68%),
    radial-gradient(circle at 18% 18%, rgba(255, 237, 0, 0.1), transparent 42%);
  opacity: 0;
  transform: translateX(-68%) rotate(8deg);
  pointer-events: none;
  transition: opacity 0.34s ease, transform 0.72s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 0;
}

.panel.last-visit-panel .last-visit-top-accordion > * {
  position: relative;
  z-index: 1;
}

.panel.last-visit-panel .last-visit-top-accordion:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 237, 0, 0.42);
}

.panel.last-visit-panel .last-visit-top-accordion.is-cooling-down:hover {
  transform: translateY(0);
  border-color: rgba(255, 255, 255, 0.12);
}

.panel.last-visit-panel .last-visit-top-accordion:hover::before,
.panel.last-visit-panel .last-visit-top-accordion:focus-within::before {
  opacity: 1;
  transform: translateX(68%) rotate(8deg);
}

.panel.last-visit-panel .last-visit-top-accordion.is-cooling-down::before {
  opacity: 0;
  transform: translateX(-68%) rotate(8deg);
}

.panel.last-visit-panel .last-visit-top-accordion:has(.last-visit-top-toggle[aria-expanded="true"]) {
  padding: 0.34rem 0.36rem 0.42rem;
  border: 1px solid color-mix(in srgb, var(--accent-color) 14%, rgba(255, 255, 255, 0.12));
  background:
    radial-gradient(circle at top left, color-mix(in srgb, var(--accent-color) 15%, transparent) 0%, transparent 42%),
    linear-gradient(180deg, rgba(20, 27, 39, 0.72), rgba(11, 16, 24, 0.68));
  backdrop-filter: blur(22px) saturate(148%);
  box-shadow:
    0 18px 34px rgba(4, 9, 16, 0.24);
}

.panel.last-visit-panel .last-visit-top-toggle {
  position: relative;
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  justify-content: space-between;
  width: 100%;
  border: 0;
  border-radius: 0.94rem;
  background: transparent;
  color: rgba(255, 255, 255, 0.94);
  padding: 0.44rem 0.56rem;
  min-width: 0;
  font: inherit;
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: none;
  cursor: pointer;
  transition: background-color 0.24s ease, border-color 0.24s ease, transform 0.24s ease;
  align-self: stretch;
}

.last-visit-top-toggle__label {
  min-width: 0;
  text-transform: none;
  font-size: 1.08em;
}

.last-visit-top-toggle[aria-expanded="true"] .last-visit-top-toggle__label {
  letter-spacing: 0.035em;
  font-size: 0.92rem;
}

.last-visit-top-toggle:hover,
.last-visit-top-toggle[aria-expanded="true"] {
  background: rgba(255, 255, 255, 0.04);
}

.last-visit-top-toggle:hover {
  transform: translateY(-1px);
}

.panel.last-visit-panel .last-visit-top-accordion.is-cooling-down .last-visit-top-toggle:hover {
  transform: translateY(0);
  background: transparent;
}

.last-visit-top-toggle i {
  font-size: 0.9rem;
  transition: transform 0.24s ease;
}

.last-visit-top-toggle[aria-expanded="true"] i {
  transform: rotate(180deg);
}

.panel.last-visit-panel .last-visit-top-sheet {
  position: relative;
  margin: 0.14rem 0 0;
  width: 100%;
  min-height: auto;
  max-height: 12.8rem;
  padding: 0.24rem 0.12rem 0 0.12rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  backdrop-filter: none;
  box-shadow: none;
}

.last-visit-top-sheet[hidden] {
  display: none;
}

.last-visit-top-sheet__eyebrow {
  display: none;
}

.last-visit-top-filters {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.34rem;
  margin: 0 0 0.5rem;
  overflow-x: auto;
  padding: 0 0.06rem 0.08rem;
  scrollbar-width: none;
}

.last-visit-top-filters::-webkit-scrollbar {
  display: none;
}

.last-visit-top-filter {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.038);
  color: rgba(255, 255, 255, 0.76);
  padding: 0.28rem 0.5rem;
  font: inherit;
  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: none;
  transition: background-color 0.22s ease, border-color 0.22s ease, color 0.22s ease, transform 0.22s ease;
}

.last-visit-top-filter:hover {
  transform: translateY(-1px);
}

.last-visit-top-filter.is-active {
  color: rgba(16, 20, 26, 0.96);
  font-weight: 800;
  border-color: rgba(255, 237, 0, 0.34);
  background: var(--accent-color);
  box-shadow: none;
}

.last-visit-top-list {
  display: grid;
  gap: 0.32rem;
  align-content: start;
  max-height: 8.65rem;
  overflow-y: auto;
  padding-right: 0.16rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 237, 0, 0.32) transparent;
}

.last-visit-top-list::-webkit-scrollbar {
  width: 6px;
}

.last-visit-top-list::-webkit-scrollbar-track {
  background: transparent;
}

.last-visit-top-list::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(255, 237, 0, 0.32);
}

.last-visit-top-row {
  display: grid;
  grid-template-columns: 1.65rem minmax(0, 1fr) auto;
  gap: 0.45rem;
  align-items: center;
  padding: 0.38rem 0.48rem;
  border-radius: 0.92rem;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.035));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.last-visit-top-rank {
  color: rgba(255, 237, 0, 0.82);
  font-weight: 700;
  font-size: 0.84rem;
}

.last-visit-top-country-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  min-width: 0;
}

.last-visit-top-flag {
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  object-fit: cover;
  flex: 0 0 auto;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.last-visit-top-country {
  min-width: 0;
  font-size: 0.84rem;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.last-visit-top-count {
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.78);
}

.last-visit-top-empty {
  margin: 0;
  padding: 0.3rem 0.1rem;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.74);
  line-height: 1.45;
}

.last-visit-top-privacy {
  position: static;
  display: inline-flex;
  align-items: center;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  opacity: 0.8;
}

.last-visit-meta-row {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  width: 100%;
  margin-top: 0.12rem;
}

.last-visit-top-privacy:hover {
  color: var(--accent-color);
  opacity: 1;
}

.last-visit-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    linear-gradient(180deg, rgba(7, 12, 20, 0.08) 0%, rgba(7, 12, 20, 0.14) 38%, rgba(7, 12, 20, 0.72) 100%);
  z-index: 1;
  backface-visibility: hidden;
}

.last-visit-map-shell {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  border-radius: inherit;
  background: #132033;
  pointer-events: none;
  backface-visibility: hidden;
}

.last-visit-map-fallback,
.last-visit-map {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  backface-visibility: hidden;
}

.last-visit-map-fallback {
  background:
    linear-gradient(180deg, rgba(18, 31, 47, 0.56), rgba(8, 16, 27, 0.9));
  transition: opacity 0.25s ease;
}

.last-visit-panel.is-map-ready .last-visit-map-fallback {
  opacity: 0;
}

.last-visit-map .leaflet-container {
  width: 100%;
  height: 100%;
  background: transparent;
  font: inherit;
  border-radius: inherit;
  overflow: hidden;
  backface-visibility: hidden;
}

.last-visit-map .leaflet-pane,
.last-visit-map .leaflet-control-container {
  pointer-events: none;
}

.last-visit-map .leaflet-tile-pane,
.last-visit-map .leaflet-map-pane,
.last-visit-map .leaflet-layer,
.last-visit-map .leaflet-tile {
  backface-visibility: hidden;
}

.last-visit-panel .leaflet-marker-icon,
.last-visit-panel .leaflet-marker-shadow,
.last-visit-panel .leaflet-pane > svg {
  filter: drop-shadow(0 1px 6px rgba(0, 0, 0, 0.2));
}

.last-visit-panel .last-visit-radar-shell {
  background: transparent;
  border: 0;
}

.last-visit-panel .last-visit-radar {
  --last-visit-marker-color: var(--last-visit-panel-marker-color, var(--accent-color));
  display: block;
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  opacity: 0;
  transform: scale(0.76);
  transform-origin: 50% 50%;
  transition: opacity 0.36s ease, transform 0.44s cubic-bezier(0.16, 1, 0.3, 1);
}

.last-visit-panel .last-visit-radar.is-visible {
  opacity: 1;
  transform: scale(1);
}

.last-visit-panel .last-visit-radar__glow,
.last-visit-panel .last-visit-radar__ring,
.last-visit-panel .last-visit-radar__pulse,
.last-visit-panel .last-visit-radar__core {
  position: absolute;
  inset: 50% auto auto 50%;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.last-visit-panel .last-visit-radar__glow {
  width: 34px;
  height: 34px;
  background: color-mix(in srgb, var(--last-visit-marker-color) 24%, transparent);
  filter: blur(10px);
  opacity: 0.9;
}

.last-visit-panel .last-visit-radar__ring {
  width: 30px;
  height: 30px;
  border: 1px solid color-mix(in srgb, var(--last-visit-marker-color) 42%, rgba(255, 255, 255, 0.35));
  background: color-mix(in srgb, var(--last-visit-marker-color) 8%, transparent);
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--last-visit-marker-color) 8%, transparent),
    0 0 22px color-mix(in srgb, var(--last-visit-marker-color) 16%, transparent);
}

.last-visit-panel .last-visit-radar__pulse {
  width: 26px;
  height: 26px;
  border: 1px solid color-mix(in srgb, var(--last-visit-marker-color) 38%, transparent);
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.85);
}

.last-visit-panel .last-visit-radar.is-visible .last-visit-radar__pulse {
  animation: last-visit-radar-wave 3.2s cubic-bezier(0.2, 0.65, 0.2, 1) infinite;
}

.last-visit-panel .last-visit-radar.is-visible .last-visit-radar__pulse--delayed {
  animation-delay: 1.6s;
}

.last-visit-panel .last-visit-radar__core {
  width: 11px;
  height: 11px;
  background: var(--last-visit-panel-marker-core-fill, var(--last-visit-marker-color));
  box-shadow:
    inset 0 0 0 1px var(--last-visit-panel-marker-core-highlight, transparent),
    0 0 0 3px color-mix(in srgb, var(--last-visit-marker-color) 16%, transparent),
    0 0 16px color-mix(in srgb, var(--last-visit-marker-color) 48%, transparent);
}

.last-visit-panel path.last-visit-map-marker {
  filter: drop-shadow(0 0 10px color-mix(in srgb, var(--last-visit-panel-marker-color, var(--accent-color)) 46%, transparent));
}

@keyframes last-visit-radar-wave {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.72);
  }
  20% {
    opacity: 0.38;
  }
  70% {
    opacity: 0.12;
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(2.3);
  }
}

.last-visit-copy {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  width: 100%;
  max-width: none;
  box-sizing: border-box;
  padding: 0 var(--last-visit-inner-pad) var(--last-visit-inner-pad);
  background: none;
  border: 0;
  box-shadow: none;
}

.last-visit-panel #last-visit-title,
.last-visit-panel #last-visit {
  max-width: 17rem;
}

.last-visit-panel #last-visit-title {
  margin: 0;
  font-size: 1.5em;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-transform: none;
  color: #ffffff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.last-visit-panel #last-visit {
  margin: 0;
  line-height: 1.22;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.28);
}

.last-visit-panel #last-visit span {
  display: block;
}

.last-visit-panel #last-visit .last-visit-location {
  font-weight: 500;
  font-size: 0.98rem;
  color: #fff;
}

.last-visit-panel #last-visit .last-visit-date,
.last-visit-panel #last-visit .last-visit-time {
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.92);
}

body:not(.dark-mode) .last-visit-panel {
  --last-visit-panel-marker-color: rgb(236, 190, 58);
  --last-visit-panel-marker-core-fill:
    radial-gradient(circle at 34% 30%, rgb(255, 251, 214) 0%, rgb(255, 237, 116) 28%, rgb(241, 198, 72) 62%, rgb(183, 138, 30) 100%);
  --last-visit-panel-marker-core-highlight: rgba(255, 252, 224, 0.82);
  color: #f0f0f0;
  background: #102031;
}

body:not(.dark-mode) .last-visit-panel .last-visit-radar__glow {
  width: 39px;
  height: 39px;
  background:
    radial-gradient(circle, rgba(255, 231, 119, 0.46) 0%, rgba(235, 180, 54, 0.24) 58%, transparent 100%);
  filter: blur(12px);
  opacity: 1;
}

body:not(.dark-mode) .last-visit-panel .last-visit-radar__ring {
  width: 31px;
  height: 31px;
  border-color: rgba(194, 143, 27, 0.88);
  background:
    radial-gradient(circle, rgba(255, 234, 143, 0.24) 0%, rgba(244, 193, 77, 0.12) 58%, transparent 100%);
  box-shadow:
    0 0 0 1px rgba(255, 249, 224, 0.72),
    0 0 0 5px rgba(78, 58, 10, 0.11),
    0 0 28px rgba(214, 164, 55, 0.42);
}

body:not(.dark-mode) .last-visit-panel .last-visit-radar__pulse {
  border-color: rgba(194, 143, 27, 0.72);
}

body:not(.dark-mode) .last-visit-panel .last-visit-radar__core {
  width: 12.5px;
  height: 12.5px;
  box-shadow:
    inset 0 0 0 1px rgba(255, 252, 224, 0.86),
    0 0 0 3px rgba(77, 57, 11, 0.2),
    0 0 0 6px rgba(246, 211, 106, 0.24),
    0 0 20px rgba(214, 164, 55, 0.48);
}

body:not(.dark-mode) .last-visit-panel .last-visit-radar__core::before,
body:not(.dark-mode) .last-visit-panel .last-visit-radar__core::after {
  content: "";
  position: absolute;
  inset: 50% auto auto 50%;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

body:not(.dark-mode) .last-visit-panel .last-visit-radar__core::before {
  width: 17px;
  height: 17px;
  background: rgba(72, 52, 9, 0.14);
  box-shadow: 0 0 0 1px rgba(255, 249, 224, 0.56);
  z-index: -1;
}

body:not(.dark-mode) .last-visit-panel .last-visit-radar__core::after {
  width: 3px;
  height: 3px;
  background: rgba(255, 253, 232, 0.96);
  box-shadow: 0 0 8px rgba(255, 248, 210, 0.72);
}

body:not(.dark-mode) .last-visit-panel path.last-visit-map-marker {
  filter:
    drop-shadow(0 0 0 2px rgba(255, 249, 224, 0.88))
    drop-shadow(0 0 14px rgba(92, 67, 11, 0.34));
}

body:not(.dark-mode) .last-visit-panel::before {
  background:
    linear-gradient(180deg, rgba(9, 18, 32, 0.06) 0%, rgba(9, 18, 32, 0.1) 36%, rgba(9, 18, 32, 0.66) 100%);
}

body:not(.dark-mode) .last-visit-panel > i {
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.22);
}

body:not(.dark-mode) .last-visit-top-toggle {
  color: rgba(12, 20, 34, 0.94);
}

body:not(.dark-mode) .last-visit-top-toggle:hover,
body:not(.dark-mode) .last-visit-top-toggle[aria-expanded="true"] {
  background: rgba(255, 255, 255, 0.18);
}

body:not(.dark-mode) .panel.last-visit-panel .last-visit-top-accordion {
  border-color: rgba(87, 100, 128, 0.1);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.26), rgba(245, 247, 250, 0.18));
  box-shadow:
    0 14px 28px rgba(36, 51, 74, 0.07);
  backdrop-filter: blur(20px) saturate(145%);
}

body:not(.dark-mode) .panel.last-visit-panel .last-visit-top-accordion::before {
  background:
    linear-gradient(118deg, transparent 26%, rgba(122, 111, 0, 0.03) 38%, rgba(122, 111, 0, 0.22) 49%, rgba(255, 255, 255, 0.38) 50%, rgba(122, 111, 0, 0.08) 53%, transparent 68%),
    radial-gradient(circle at 18% 18%, rgba(122, 111, 0, 0.08), transparent 42%);
}

body:not(.dark-mode) .panel.last-visit-panel .last-visit-top-accordion:hover {
  border-color: rgba(197, 144, 0, 0.42);
}

body:not(.dark-mode) .panel.last-visit-panel .last-visit-top-accordion.is-cooling-down:hover {
  border-color: rgba(87, 100, 128, 0.1);
}

body:not(.dark-mode) .panel.last-visit-panel .last-visit-top-accordion:has(.last-visit-top-toggle[aria-expanded="true"]) {
  border-color: rgba(197, 144, 0, 0.42);
  background:
    radial-gradient(circle at top left, rgba(205, 159, 44, 0.16) 0%, transparent 42%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.62), rgba(245, 247, 250, 0.56));
  box-shadow:
    0 16px 30px rgba(36, 51, 74, 0.09),
    0 0 0 1px rgba(197, 144, 0, 0.12);
  backdrop-filter: blur(22px) saturate(148%);
}

body:not(.dark-mode) .last-visit-top-toggle i,
body:not(.dark-mode) .last-visit-top-toggle .last-visit-top-toggle__label {
  color: rgba(12, 20, 34, 0.94);
}

body:not(.dark-mode) .panel.last-visit-panel .last-visit-top-sheet {
  background: transparent;
  box-shadow: none;
}

body:not(.dark-mode) .panel.last-visit-panel .last-visit-top-filter {
  color: rgba(26, 39, 59, 0.72);
  border-color: rgba(87, 100, 128, 0.08);
  background: rgba(255, 255, 255, 0.32);
}

body:not(.dark-mode) .panel.last-visit-panel .last-visit-top-filter.is-active {
  color: rgba(16, 24, 38, 0.96);
  font-weight: 800;
  border-color: rgba(255, 237, 0, 0.34);
  background: var(--accent-color);
  box-shadow: none;
}

body:not(.dark-mode) .panel.last-visit-panel .last-visit-top-row {
  border-color: rgba(87, 100, 128, 0.08);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(247, 248, 250, 0.82));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.96),
    0 8px 18px rgba(66, 81, 105, 0.06);
}

body:not(.dark-mode) .panel.last-visit-panel .last-visit-top-country {
  color: rgba(15, 25, 40, 0.94);
}

body:not(.dark-mode) .panel.last-visit-panel .last-visit-top-rank {
  color: #b78110;
}

body:not(.dark-mode) .panel.last-visit-panel .last-visit-top-count,
body:not(.dark-mode) .panel.last-visit-panel .last-visit-top-empty,
body:not(.dark-mode) .panel.last-visit-panel .last-visit-top-privacy {
  color: rgba(24, 38, 58, 0.78);
}

body:not(.dark-mode) .panel.last-visit-panel .last-visit-top-empty {
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0.3rem 0.1rem;
}

body:not(.dark-mode) .panel.last-visit-panel .last-visit-top-privacy {
  color: rgba(24, 38, 58, 0.68);
}

body:not(.dark-mode) .last-visit-top-list {
  scrollbar-color: rgba(197, 144, 0, 0.34) transparent;
}

body:not(.dark-mode) .last-visit-top-list::-webkit-scrollbar-thumb {
  background: rgba(197, 144, 0, 0.34);
}

body:not(.dark-mode) .privacy-modal-kicker {
  color: #d4a327;
}

body:not(.dark-mode) .privacy-modal-note a {
  color: #c79722;
}

@media (max-width: 760px) {
  .panel.last-visit-panel .last-visit-top-toggle {
    right: 0.8rem;
    top: 0.8rem;
    min-width: auto;
    padding: 0.42rem 0.62rem;
  }

  .panel.last-visit-panel .last-visit-top-sheet {
    right: 0.8rem;
    top: 3.35rem;
    width: min(15rem, calc(100% - 1.6rem));
  }

  .last-visit-top-privacy {
    right: 0.8rem;
    bottom: 0.72rem;
  }
}

body:not(.dark-mode) .last-visit-copy {
  background: none;
}

body:not(.dark-mode) .last-visit-panel #last-visit-title {
  color: #ffffff;
}

body:not(.dark-mode) .last-visit-panel #last-visit .last-visit-location {
  color: #ffffff;
}

body:not(.dark-mode) .last-visit-panel #last-visit .last-visit-date,
body:not(.dark-mode) .last-visit-panel #last-visit .last-visit-time {
  color: rgba(255, 255, 255, 0.92);
}

body:not(.dark-mode) .last-visit-map-fallback {
  background:
    linear-gradient(180deg, rgba(228, 236, 244, 0.92), rgba(199, 214, 228, 0.98));
}

/* Last Visit text layout: location, date, time on separate lines */
#last-visit {
  line-height: 1.3;
}

#last-visit span {
  display: block;
}

.site-footer__privacy {
  color: var(--blog-muted);
  text-decoration: none;
  opacity: 0.82;
}

.site-footer__privacy:hover {
  color: var(--accent-color);
}

.privacy-modal {
  background-color: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(8px);
}

.privacy-modal-content {
  width: min(900px, calc(100% - 2rem));
  max-height: min(86vh, 52rem);
  overflow: auto;
  padding: 1.35rem 1.35rem 1.25rem;
}

.privacy-modal .privacy-modal-content {
  background:
    radial-gradient(circle at top left, color-mix(in srgb, var(--accent-color) 15%, transparent) 0%, transparent 40%),
    linear-gradient(180deg, color-mix(in srgb, var(--panel-color) 92%, #ffffff 8%) 0%, var(--panel-color) 100%);
  border: 1px solid color-mix(in srgb, var(--accent-color) 16%, rgba(255, 255, 255, 0.12));
  box-shadow:
    0 26px 60px rgba(0, 0, 0, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.privacy-modal-close {
  z-index: 4;
  top: 0.55rem;
  right: 0.95rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.08rem 0.42rem 0.24rem;
  line-height: 1;
  font-size: 3.35rem;
  font-weight: 300;
  color: color-mix(in srgb, var(--text-color) 92%, transparent);
  background: transparent;
  border: 0;
  box-shadow: none;
  transition:
    transform 0.22s ease,
    color 0.22s ease,
    text-shadow 0.22s ease,
    opacity 0.22s ease;
}

.privacy-modal-close:hover,
.privacy-modal-close:focus-visible {
  transform: scale(1.08);
  color: var(--accent-color);
  text-shadow: 0 0 18px rgba(255, 237, 0, 0.42);
  outline: none;
}

.privacy-modal-body {
  position: relative;
  display: grid;
  gap: 1rem;
}

.privacy-modal-kicker {
  margin: 0;
  font-size: 0.76rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 237, 0, 0.82);
}

.privacy-modal-body h2,
.privacy-modal-body h3,
.privacy-modal-body p,
.privacy-modal-body ul {
  margin: 0;
}

.privacy-modal-body h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  line-height: 1.02;
}

.privacy-modal-lead {
  max-width: 60ch;
  opacity: 0.84;
  line-height: 1.55;
}

.privacy-modal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

.privacy-modal-card,
.privacy-modal-note {
  padding: 1rem 1.05rem;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.048), rgba(255, 255, 255, 0.03));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.privacy-modal-card h3,
.privacy-modal-note h3 {
  margin-bottom: 0.58rem;
  font-size: 1rem;
}

.privacy-modal-card p,
.privacy-modal-note p,
.privacy-modal-card li {
  line-height: 1.55;
  opacity: 0.84;
}

.privacy-modal-card ul {
  padding-left: 1.15rem;
}

.privacy-modal-note a {
  color: #fff1a0;
}

body:not(.dark-mode) .privacy-modal .privacy-modal-content {
  background:
    radial-gradient(circle at top left, rgba(255, 237, 0, 0.16) 0%, transparent 42%),
    linear-gradient(180deg, rgba(249, 250, 252, 0.98), rgba(233, 237, 242, 0.98));
}

body:not(.dark-mode) .privacy-modal-close {
  color: #101010;
}

body:not(.dark-mode) .privacy-modal-close:hover,
body:not(.dark-mode) .privacy-modal-close:focus-visible {
  color: #c59000;
  text-shadow: 0 0 16px rgba(197, 144, 0, 0.28);
}

body.dark-mode .privacy-modal-close {
  color: rgba(255, 255, 255, 0.92);
}

body.dark-mode .privacy-modal-close:hover,
body.dark-mode .privacy-modal-close:focus-visible {
  color: rgb(255, 237, 0);
  text-shadow: 0 0 18px rgba(255, 237, 0, 0.5);
}

body:not(.dark-mode) .privacy-modal-card,
body:not(.dark-mode) .privacy-modal-note {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(247, 248, 250, 0.72));
  border-color: rgba(58, 72, 94, 0.1);
}

@media (max-width: 760px) {
  .privacy-modal-content {
    width: min(100% - 1rem, 100%);
    max-height: 88vh;
    padding: 1.05rem 0.95rem 1rem;
  }

  .privacy-modal-grid {
    grid-template-columns: 1fr;
  }
}

/* ========================================
   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 + mobile landscape (match portrait layout) */
@media screen and (max-width: 600px),
       screen and (max-width: 900px) and (max-height: 600px) and (orientation: landscape) {
  .grid-panels {
    grid-template-columns: 1fr;     /* una sola columna */
    grid-auto-rows: auto;           /* filas con altura por contenido */
  }
  .panel:not(.title) {
    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.brand { order: -9; }
  .panel.title { order: -8; }
  .earth-mobile-panel { order: -7; }
  
  /* Panel amarillo (título): texto e icono en negro en móvil */
  .panel.title {
    color: #000 !important; 
  }
  .panel.title {
    grid-column: auto;
    display: flex;
    height: clamp(280px, 68vw, 430px) !important;
    min-height: clamp(280px, 68vw, 430px) !important;
  }
  .panel.title .title-story,
  .panel.title .title-story-viewport {
    height: 100% !important;
    min-height: 100% !important;
  }

  .title-hero { gap: 1em; }
  .title-logo { width: 82%; }
  .title-message { font-size: 1rem; line-height: 1.4; }

  /* 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;
  }
  .earth-mobile-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1 / 1;
    padding: 0.8em;
    background-color: var(--bg-color);
  }

  .earth-mobile-panel .earth-container {
    display: flex !important;
    position: relative;
    top: auto;
    left: auto;
    transform: none;
    width: 66%;
    height: 66%;
  }

  .earth-mobile-panel .earth-ring {
    opacity: 1;
  }

  .earth-mobile-panel .ring-rotor {
    animation-play-state: running;
  }

  .earth-mobile-panel .ring-svg {
    width: 150%;
    height: 150%;
  }
}

@media screen and (max-width: 600px) and (orientation: portrait) {
  .panel.last-visit-panel {
    width: 100%;
    justify-self: stretch;
    min-height: max(26.5rem, 50svh);
    padding-top: var(--last-visit-top-accordion-offset);
    background: transparent;
  }

  .panel.last-visit-panel .last-visit-top-accordion {
    top: 0.8rem;
    left: 0.8rem;
    right: 0.8rem;
    width: auto;
    max-width: none;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 0.32rem 0.34rem 0.34rem;
    border-radius: 1.15rem;
    overflow: hidden;
  }

  .panel.last-visit-panel .last-visit-top-accordion:has(.last-visit-top-toggle[aria-expanded="true"]) {
    padding: 0.34rem 0.36rem 0.42rem;
  }

  .panel.last-visit-panel .last-visit-top-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    min-height: 2.5rem;
    height: 2.5rem;
    top: auto;
    right: auto;
    gap: 0.55rem;
    padding: 0 0.72rem;
    border-radius: 0.94rem;
    font-size: 0.8rem;
    line-height: 1;
    letter-spacing: 0.04em;
    text-align: left;
  }

  .panel.last-visit-panel .last-visit-top-toggle__label {
    display: flex;
    align-items: center;
    min-width: 0;
    height: 100%;
    margin: 0;
    padding: 0;
    font-size: 0.98rem;
    font-weight: inherit;
    line-height: 1;
    letter-spacing: normal;
    text-align: inherit;
  }

  .panel.last-visit-panel .last-visit-top-toggle[aria-expanded="true"] .last-visit-top-toggle__label {
    font-size: 0.98rem;
    letter-spacing: 0.01em;
  }

  .panel.last-visit-panel .last-visit-top-toggle i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    height: auto;
    margin: 0;
    font-size: 0.95rem;
    line-height: 1;
  }

  .panel.last-visit-panel .last-visit-top-sheet {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin: 0.08rem 0 0;
    top: auto;
    right: auto;
    width: 100%;
    max-height: 16rem;
    padding: 0 0.56rem 0;
  }

  .panel.last-visit-panel .last-visit-top-list {
    max-height: 11.2rem;
    gap: 0.32rem;
    padding-right: 0.16rem;
  }

  .panel.last-visit-panel .last-visit-top-filters {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.34rem;
    margin: 0 0 0.26rem;
    overflow-x: auto;
    padding: 0 0 0.08rem;
  }

  .panel.last-visit-panel .last-visit-top-filter {
    padding: 0.28rem 0.5rem;
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.08em;
  }

  .panel.last-visit-panel .last-visit-top-row {
    padding: 0.38rem 0.48rem;
    gap: 0.45rem;
    border-radius: 0.92rem;
  }

  .panel.last-visit-panel .last-visit-top-country {
    font-size: 0.84rem;
  }

  .panel.last-visit-panel .last-visit-top-rank,
  .panel.last-visit-panel .last-visit-top-count {
    font-size: 0.82rem;
  }

  .panel.last-visit-panel .last-visit-map-shell {
    inset: 0;
  }

  .panel.last-visit-panel.last-visit-panel--top-open {
    min-height: max(36rem, 78svh);
  }

  body:not(.dark-mode) .last-visit-panel {
    background: transparent;
  }

}

/* Large screens */
@media screen and (min-width: 1000px) {
  h1 { font-size: 2.5em; }

  .earth-container {
    top: 50%;
    left: 50%;
    --earth-size-hover: 21.8em;
    transform: translate(-50%, -50%);
  }

  .earth-container:hover {
    transform: translate(-50%, -50%);
  }

  .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);
  position: relative;
}

.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;
}

/* Light mode: fondo blanco y tarjetas gris claro */
body:not(.dark-mode) .earth-modal-panel {
  background: #ffffff;
}
body:not(.dark-mode) .earth-panel {
  background: var(--panel-color);
  border-color: transparent;
  box-shadow: none;
}
body:not(.dark-mode) .earth-panel-secondary {
  background: var(--panel-color);
  color: #000;
}
/* Light mode: badge legibility next to photo */
body:not(.dark-mode) .earth-modal .project-type-chip {
  background: var(--accent-color);
  color: #000;
  border-color: var(--accent-color);
  box-shadow: none;
}

.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;
}

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.7em;
  flex-wrap: nowrap;
  margin-left: auto;
}

.toolbar-actions .darkmode-btn {
  margin-right: 0;
}

.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-secondary {
  min-height: 0; /* permite que la lista gestione su propio scroll */
}

.earth-panel-secondary .earth-panel-list {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65em;
  overflow-y: auto;
  padding-right: 0.35em; /* deja espacio para el scroll */
  overflow-x: hidden;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
  scrollbar-gutter: stable;
}

.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);
}

/* Scroll de proyectos (match experiencia) */
.earth-panel-secondary:hover .earth-panel-list {
  scrollbar-color: rgba(255, 237, 0, 0.35) transparent;
}
body.dark-mode .earth-panel-secondary:hover .earth-panel-list {
  scrollbar-color: rgba(255, 237, 0, 0.45) transparent;
}
.earth-panel-secondary .earth-panel-list::-webkit-scrollbar {
  width: 2px;
  height: 2px;
}
.earth-panel-secondary .earth-panel-list::-webkit-scrollbar-track {
  background: transparent;
}
.earth-panel-secondary .earth-panel-list::-webkit-scrollbar-thumb {
  background-color: transparent;
  border-radius: 999px;
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
}
.earth-panel-secondary:hover .earth-panel-list::-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 .earth-panel-secondary:hover .earth-panel-list::-webkit-scrollbar-thumb {
  background-color: rgba(255, 237, 0, 0.45);
}

.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;
  min-height: 0;
  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;
  flex: 1 1 auto;
  min-height: 0;
  gap: 0.8em;
  color: inherit;
  box-shadow: none;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-behavior: smooth;
  padding-right: 0.35em;
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
  scrollbar-gutter: stable;
}

.earth-panel-tertiary:hover .project-info-card {
  scrollbar-color: rgba(255, 237, 0, 0.35) transparent;
}

body.dark-mode .earth-panel-tertiary:hover .project-info-card {
  scrollbar-color: rgba(255, 237, 0, 0.45) transparent;
}

.project-info-card::-webkit-scrollbar {
  width: 2px;
  height: 2px;
}

.project-info-card::-webkit-scrollbar-track {
  background: transparent;
}

.project-info-card::-webkit-scrollbar-thumb {
  background-color: transparent;
  border-radius: 999px;
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.earth-panel-tertiary:hover .project-info-card::-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 .earth-panel-tertiary:hover .project-info-card::-webkit-scrollbar-thumb {
  background-color: rgba(255, 237, 0, 0.45);
}

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;
  font-weight: 400;
}

.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-functions-list li {
  font-weight: 400;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5em;
  margin: 0.2em 0 0.2em;
}

.project-tools {
  display: flex;
  flex-direction: column;
  gap: 0.35em;
}

.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: 500;
  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-tags.project-tags--iconized .project-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  padding: 0.28em 0.62em;
  border-radius: 8px;
  border-color: rgba(255, 255, 255, 0.16);
  background: transparent;
  color: #d5d9e3;
  transition: color 0.2s ease, border-color 0.2s ease, transform 0.2s ease, background-color 0.2s ease;
}

body:not(.dark-mode) .project-tags.project-tags--iconized .project-tag {
  color: #2f3138;
  border-color: rgba(0, 0, 0, 0.16);
}

.project-tags.project-tags--iconized .project-tag:hover {
  color: var(--accent-color);
  border-color: color-mix(in srgb, var(--accent-color) 62%, transparent);
  background: color-mix(in srgb, var(--accent-color) 12%, transparent);
  transform: scale(1.03);
}

.project-tags.project-tags--iconized .project-tag-icon {
  width: 1.05em;
  min-width: 1.05em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95em;
}

.project-tags.project-tags--iconized .project-tag-icon-img {
  width: 16px;
  height: 16px;
  object-fit: contain;
  display: block;
}

.project-tags.project-tags--iconized .project-tag-label {
  font-size: 0.88em;
  letter-spacing: 0.01em;
  line-height: 1;
}

.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;
  font-weight: 400;
}

.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 {
  position: relative;
  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;
  min-height: 340px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #cfd4e0;
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}
.earth-reel-frame.active-glow {
  box-shadow: 0 0 18px rgba(255, 237, 0, 0.38), 0 0 0 1px rgba(255, 237, 0, 0.25);
}

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: transparent;
  pointer-events: none;
}

.earth-reel-slide span {
  display: none; /* ocultar t?tulos sobre las fotos */
}

.reel-dots {
  position: absolute;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  z-index: 2;
}
.reel-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.6);
  background: rgba(0, 0, 0, 0.3);
  cursor: pointer;
  transition: transform 0.12s ease, background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}
.reel-dot.active {
  background: var(--accent-color);
  border-color: var(--accent-color);
  box-shadow: 0 0 10px rgba(255, 237, 0, 0.75);
  transform: scale(1.12);
  opacity: 1;
}
.reel-dot:hover {
  transform: scale(1.1);
  opacity: 1;
}

.earth-reel-disclaimer {
  padding: 0.55em 0.6em 0.35em;
  border-radius: 12px;
  border: 1px dashed rgba(255, 255, 255, 0.25);
  background: rgba(0, 0, 0, 0.2);
  color: #cfd4e0;
  font-size: 0.9em;
  line-height: 1.4;
}
body:not(.dark-mode) .earth-reel-disclaimer {
  border-color: rgba(0, 0, 0, 0.15);
  background: rgba(255, 255, 255, 0.6);
  color: #1b1c23;
}

@media screen and (max-width: 900px) {
  .reel-nav.reel-prev { left: 10px; }
  .reel-nav.reel-next { right: 10px; }
  .reel-nav {
    width: 48px;
    height: 48px;
  }
}

@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);
}


/* ========================================
   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;
}


/* ========================================
   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;
}
/* 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; }
}

/* ========================================
   <=1080p (desktop/tablet): bring title text closer to logo
   - Excludes mobile
======================================== */
@media screen and (max-height: 1080px) and (min-width: 900px) {
  .title-hero {
    gap: 0.1em;
  }
  #main-quote {
    margin-top: -0.2em;
  }
  .earth-container {
    --earth-size-rest: 10.2em;
    --earth-size-hover: 16.8em;
  }
}


/* ========================================
   TITLE PANEL (Card 2): HD + FullHD fine tuning
   - Reduce logo/text a bit to avoid overlap with Earth
======================================== */
@media screen and (min-width: 1200px) and (max-width: 1366px)
       and (min-height: 700px) and (max-height: 768px) {
  .panel.title .title-hero {
    gap: 0.6em;
  }

  .panel.title .title-logo {
    width: clamp(170px, 48%, 380px);
  }

  .panel.title .title-message {
    font-size: clamp(0.84rem, 1.1vw, 0.98rem);
    line-height: 1.32;
    max-width: 640px;
  }
}

@media screen and (max-width: 900px) and (orientation: landscape) and (pointer: coarse) {
  body {
    overflow: hidden;
  }

  .mobile-portrait-lock {
    display: flex;
  }

  .grid,
  #earth-modal,
  #cv-modal,
  #center-guide {
    visibility: hidden !important;
    pointer-events: none !important;
  }
}

@media screen and (min-width: 1900px) and (max-width: 1930px)
       and (min-height: 1000px) and (max-height: 1080px) {
  .panel.title .title-logo {
    width: clamp(200px, 56%, 470px);
  }

  .panel.title .title-message {
    font-size: clamp(0.86rem, 1.02vw, 1.06rem);
    line-height: 1.34;
    max-width: 660px;
  }
}
/* ========================================
   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);
}
.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
======================================== */
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;
}

/* ========================================
   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) {
  html { font-size: 85%; }

  /* Reducir ligeramente el tama?o del nombre */
  .panel.brand h1 {
    font-size: 2.1em;
    line-height: 1.1;
  }

  /* Mobile-like body copy sizing */
  .title-message {
    font-size: 1rem;
    line-height: 1.4;
  }

  /* Tighten spacing + reduce logo size in yellow panel */
  .title-hero { gap: 0.15em; }
  .title-logo { width: clamp(180px, 50%, 420px); }

  /* Reduce earth size for 720p HD */
  .earth-container {
    --earth-size-rest: 9.8em;
    --earth-size-hover: 15.8em;
  }
}

/* Mobile skills: keep 6x4 grid layout */
@media screen and (max-width: 600px) {
  .skills-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* ========================================
   TITLE CARD 2: STORY SLIDER (final rules)
======================================== */
.panel.title {
  display: flex;
  padding: 0.9em;
}

.panel.title .title-story {
  position: relative;
  z-index: 1;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.panel.title .title-story-progress {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 4;
  pointer-events: none;
  display: flex;
  gap: 0.35em;
  width: 100%;
  padding: 0.6em;
}

.panel.title .title-story-progress-segment {
  flex: 1 1 0;
  position: relative;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 237, 0, 0.28);
  overflow: hidden;
}

.panel.title .title-story-progress-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 100%;
  transform-origin: left center;
  transform: scaleX(0);
  background: rgba(255, 237, 0, 0.96);
}

.panel.title .title-story-viewport {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  border-radius: 10px;
  overflow: hidden;
  touch-action: pan-y;
  user-select: none;
}

.panel.title .title-story-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

.panel.title .title-story-slide.is-active {
  opacity: 1;
  pointer-events: auto;
}

.panel.title .title-story-slide > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.panel.title .title-origin-slide {
  position: absolute;
}

.panel.title .title-origin-slide::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.46) 0%, rgba(0, 0, 0, 0.2) 30%, rgba(0, 0, 0, 0) 62%),
    radial-gradient(circle at 18% 50%, rgba(0, 0, 0, 0.28), transparent 62%);
  pointer-events: none;
  z-index: 1;
}

.panel.title .title-origin-slide .title-origin-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 0.52em;
  padding: clamp(1.1em, 2.4vw, 2.2em);
  max-width: min(64%, 720px);
  color: #ededed;
}

.panel.title .title-origin-tag {
  margin: 0 0 0.35em;
  font-family: "Kanit", sans-serif;
  font-weight: 500;
  font-size: clamp(0.65rem, 0.82vw, 0.82rem);
  letter-spacing: 0.15em;
  color: rgba(255, 237, 0, 0.8);
  text-transform: uppercase;
}

.panel.title .title-origin-title {
  margin: 0;
  font-family: "Kanit", sans-serif;
  font-weight: 600;
  font-size: clamp(1.3rem, 2.48vw, 2.32rem);
  letter-spacing: 0.08em;
  color: #ededed;
  text-shadow: 0 10px 22px rgba(0, 0, 0, 0.45);
}

.panel.title .title-origin-caret {
  display: inline-block;
  color: rgba(255, 237, 0, 0.95);
  animation: originCaretBlink 3s steps(1, end) infinite;
}

.panel.title .title-origin-subtitle {
  margin: 0 0 0.25em;
  max-width: 95%;
  font-family: "Kanit", sans-serif;
  font-weight: 400;
  font-size: clamp(0.8rem, 1.12vw, 1rem);
  color: #c8ccd2;
  line-height: 1.35;
}

.panel.title .title-origin-readin {
  display: inline-flex;
  align-items: baseline;
  gap: 0.42em;
  padding: 0.4em 0.68em 0.38em;
  border-radius: 9px;
  border: 1px solid rgba(255, 237, 0, 0.35);
  background: rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(1px);
  cursor: pointer;
  user-select: none;
  transition: transform 180ms ease, border-color 180ms ease, background-color 180ms ease, box-shadow 180ms ease;
}

.panel.title .title-origin-readin:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 237, 0, 0.7);
  background: rgba(255, 237, 0, 0.12);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.24);
}

.panel.title .title-origin-readin:focus-visible {
  outline: 2px solid rgba(255, 237, 0, 0.82);
  outline-offset: 3px;
}

.panel.title .title-origin-readin-label {
  font-family: "Kanit", sans-serif;
  font-weight: 600;
  font-size: clamp(0.66rem, 0.84vw, 0.82rem);
  letter-spacing: 0.11em;
  color: rgba(255, 237, 0, 0.95);
  text-transform: uppercase;
  line-height: 1;
}

.panel.title .title-origin-countdown {
  font-family: "Kanit", sans-serif;
  font-weight: 700;
  font-size: clamp(0.74rem, 0.98vw, 0.92rem);
  letter-spacing: 0.07em;
  color: #ededed;
  line-height: 1;
}

.panel.title .title-origin-readin:hover .title-origin-readin-label {
  color: #fff6a3;
}

.panel.title .title-origin-readin:hover .title-origin-countdown {
  color: rgba(255, 237, 0, 0.98);
}

@media screen and (max-width: 900px) {
  .panel.title .title-origin-slide .title-origin-overlay {
    max-width: 88%;
    padding: 1em;
  }
  .panel.title .title-origin-title {
    font-size: clamp(1.02rem, 4.8vw, 1.34rem);
  }
}

@keyframes originCaretBlink {
  0%, 84%, 100% { opacity: 1; }
  85%, 92% { opacity: 0.22; }
}

.panel.title .title-current-slide {
  position: absolute;
}

.panel.title .title-current-slide::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.65) 0%, rgba(0, 0, 0, 0.28) 36%, rgba(0, 0, 0, 0) 72%);
  pointer-events: none;
  z-index: 1;
}

.panel.title .title-current-slide .title-current-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 0.45em;
  padding: clamp(1.1em, 2.35vw, 2.1em);
  max-width: min(62%, 700px);
}

.panel.title .title-current-slide .title-current-overlay > * {
  margin: 0;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 380ms ease, transform 380ms ease;
}

.panel.title .title-current-slide.is-active .title-current-overlay > * {
  opacity: 1;
  transform: translateY(0);
}

.panel.title .title-current-slide.is-active .title-current-overlay > *:nth-child(2) {
  transition-delay: 45ms;
}

.panel.title .title-current-slide.is-active .title-current-overlay > *:nth-child(3) {
  transition-delay: 90ms;
}

.panel.title .title-current-tag {
  font-family: "Kanit", sans-serif;
  font-weight: 500;
  font-size: clamp(0.65rem, 0.82vw, 0.82rem);
  letter-spacing: 0.15em;
  color: rgba(255, 237, 0, 0.82);
  text-transform: uppercase;
}

.panel.title .title-current-title {
  font-family: "Kanit", sans-serif;
  font-weight: 600;
  font-size: clamp(1.3rem, 2.55vw, 2.35rem);
  letter-spacing: 0.08em;
  color: #ededed;
  text-shadow: 0 10px 22px rgba(0, 0, 0, 0.45);
}

.panel.title .title-current-subtitle {
  font-family: "Kanit", sans-serif;
  font-weight: 400;
  font-size: clamp(0.8rem, 1.08vw, 0.98rem);
  color: #c8ccd2;
  line-height: 1.35;
}

@media screen and (max-width: 900px) {
  .panel.title .title-current-slide .title-current-overlay {
    max-width: 86%;
    padding: 1em;
  }
  .panel.title .title-current-tag {
    font-size: clamp(0.6rem, 0.74vw, 0.74rem);
  }
  .panel.title .title-current-title {
    font-size: clamp(1.02rem, 4.5vw, 1.28rem);
  }
  .panel.title .title-current-subtitle {
    font-size: clamp(0.72rem, 0.95vw, 0.86rem);
  }
}

.panel.title .title-story-slide:first-of-type {
  padding: clamp(0.8em, 1.8vw, 1.4em);
}

.panel.title .title-story-slide:first-of-type .title-hero {
  gap: clamp(0.45em, 0.9vw, 0.8em);
}

.panel.title .title-story-slide:first-of-type .title-logo {
  width: clamp(200px, 54%, 500px) !important;
  max-width: 60%;
  height: auto !important;
  object-fit: contain !important;
}

.panel.title .title-story-slide:first-of-type .title-message {
  max-width: 660px;
  font-size: clamp(0.9rem, 1.2vw, 1.12rem);
  line-height: 1.4;
}

@media screen and (max-width: 900px) {
  .panel.title .title-story-progress-segment {
    height: 3px;
  }
  .panel.title .title-story-slide:first-of-type {
    padding: 0.85em;
  }
  .panel.title .title-story-slide:first-of-type .title-logo {
    width: clamp(40px, 16vw, 76px) !important;
    max-width: 34%;
  }
}

@media screen and (max-width: 600px),
       screen and (max-width: 900px) and (max-height: 600px) and (orientation: landscape) {
  .panel.title {
    height: clamp(280px, 68vw, 430px) !important;
    min-height: clamp(280px, 68vw, 430px) !important;
  }

  .panel.title .title-story {
    height: 100% !important;
    min-height: 100%;
  }

  .panel.title .title-story-viewport {
    flex: 1 1 auto;
    height: 100% !important;
    min-height: 100% !important;
  }
}



/* 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 .toolbar-actions .darkmode-btn,
.earth-modal-close {
  padding: 0;
  aspect-ratio: 1/1;
  width: 2.6rem;
  height: 2.6rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.cv-content h2 {
  margin: 0 0 0.35em 0;
}

.cv-request-subtitle {
  margin: 0 0 1.1em 0;
  max-width: 54ch;
  opacity: 0.85;
}

.cv-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.cv-field {
  display: grid;
  gap: 0.42rem;
  align-content: start;
}

.cv-field--challenge {
  grid-column: 1 / -1;
}

.cv-form-grid label {
  font-weight: 600;
}

#cv-other-wrap {
  grid-column: 1 / -1;
}

#cv-other-wrap[hidden] {
  display: none !important;
}

.cv-form-grid input,
.cv-form-grid select {
  width: 100%;
  border: 1px solid color-mix(in srgb, var(--accent-color) 35%, transparent);
  background: color-mix(in srgb, var(--bg-color) 75%, transparent);
  color: var(--text-color);
  border-radius: 10px;
  padding: 0.72em 0.85em;
}

.cv-challenge-shell {
  display: grid;
  gap: 0.65rem;
}

.cv-challenge-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem;
  padding: 0.78rem 0.95rem;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--accent-color) 24%, transparent);
  background: color-mix(in srgb, var(--panel-color) 72%, transparent);
}

.cv-challenge-prompt {
  margin: 0;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.cv-challenge-refresh {
  border: 1px solid color-mix(in srgb, var(--accent-color) 36%, transparent);
  background: transparent;
  color: inherit;
  border-radius: 999px;
  padding: 0.48rem 0.82rem;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.2s ease, color 0.2s ease;
}

.cv-challenge-refresh:hover {
  transform: translateY(-1px);
  border-color: var(--accent-color);
}

.cv-challenge-refresh:disabled {
  opacity: 0.5;
  cursor: wait;
  transform: none;
}

.cv-form-grid input:focus,
.cv-form-grid select:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent-color) 30%, transparent);
}

body:not(.dark-mode) .cv-form-grid input,
body:not(.dark-mode) .cv-form-grid select {
  border-color: #c59000;
}

body:not(.dark-mode) .cv-challenge-meta {
  border-color: rgba(197, 144, 0, 0.36);
  background: linear-gradient(180deg, rgba(255, 251, 239, 0.96), rgba(248, 243, 228, 0.92));
}

body:not(.dark-mode) .cv-challenge-refresh {
  border-color: rgba(197, 144, 0, 0.42);
}

body:not(.dark-mode) .cv-challenge-refresh:hover {
  border-color: #c59000;
  color: #7d5900;
}

body:not(.dark-mode) .cv-form-grid input:focus,
body:not(.dark-mode) .cv-form-grid select:focus {
  border-color: #b07a00;
  box-shadow: 0 0 0 2px rgba(197, 144, 0, 0.24);
}

.cv-field.is-invalid input,
.cv-field.is-invalid select {
  border-color: #c75f5f;
  box-shadow: 0 0 0 2px rgba(199, 95, 95, 0.15);
}

.cv-field-error {
  margin: 0;
  min-height: 1.1em;
  font-size: 0.88em;
  color: #d98484;
}

.cv-field-error:empty {
  min-height: 0;
}

.cv-consent {
  display: flex;
  gap: 0.6em;
  align-items: flex-start;
  margin: 1rem 0 0.15rem;
  padding: 0.8rem 0.9rem;
  border: 1px solid transparent;
  border-radius: 12px;
  font-size: 0.95em;
  background: color-mix(in srgb, var(--bg-color) 40%, transparent);
}

.cv-consent.is-invalid {
  border-color: #c75f5f;
  background: color-mix(in srgb, #c75f5f 12%, var(--panel-color));
}

.cv-consent-error {
  margin-bottom: 0.85rem;
}

.cv-content button[type="submit"] {
  border: 0;
  border-radius: 10px;
  padding: 0.78em 1.1em;
  font-weight: 700;
  cursor: pointer;
  background: var(--accent-color);
  color: #101010;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.cv-content button[type="submit"]:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.cv-content button[type="submit"].is-busy {
  cursor: wait;
}

.cv-feedback {
  margin-top: 1rem;
  padding: 1rem 1.05rem;
  border-radius: 16px;
  border: 1px solid transparent;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.9rem;
  align-items: start;
}

.cv-feedback[hidden] {
  display: none !important;
}

.cv-feedback-copy {
  min-width: 0;
}

.cv-feedback-title,
.cv-feedback-message,
.cv-feedback-help {
  margin: 0;
}

.cv-feedback-title {
  font-weight: 700;
}

.cv-feedback-message {
  margin-top: 0.18rem;
  line-height: 1.45;
}

.cv-feedback-help {
  margin-top: 0.28rem;
  opacity: 0.82;
  font-size: 0.92em;
}

.cv-feedback-icon {
  width: 2.45rem;
  height: 2.45rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  position: relative;
  flex-shrink: 0;
}

.cv-feedback-action {
  border: 0;
  border-radius: 999px;
  padding: 0.68em 0.95em;
  font-weight: 700;
  font-size: 0.92em;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.2);
  color: inherit;
  white-space: nowrap;
}

.cv-feedback.is-loading {
  background: color-mix(in srgb, var(--accent-color) 14%, var(--panel-color));
  border-color: color-mix(in srgb, var(--accent-color) 30%, transparent);
}

.cv-feedback.is-loading .cv-feedback-icon {
  background: color-mix(in srgb, var(--accent-color) 18%, transparent);
  color: var(--text-color);
}

.cv-feedback.is-loading .cv-feedback-icon::before {
  content: '';
  width: 0.95rem;
  height: 0.95rem;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  animation: cv-feedback-spin 0.8s linear infinite;
}

.cv-feedback.is-success {
  background: color-mix(in srgb, #177567 14%, var(--panel-color));
  border-color: color-mix(in srgb, #177567 38%, transparent);
}

.cv-feedback.is-success .cv-feedback-icon {
  background: rgba(23, 117, 103, 0.18);
  color: #177567;
}

.cv-feedback.is-success .cv-feedback-icon::before {
  content: 'OK';
}

.cv-feedback.is-warning {
  background: color-mix(in srgb, #ad6200 14%, var(--panel-color));
  border-color: color-mix(in srgb, #ad6200 34%, transparent);
}

.cv-feedback.is-warning .cv-feedback-icon {
  background: rgba(173, 98, 0, 0.18);
  color: #ad6200;
}

.cv-feedback.is-warning .cv-feedback-icon::before {
  content: '!';
  display: block;
  font-size: 1.72rem;
  font-weight: 900;
  line-height: 1;
  transform: translateY(-0.02em);
  text-shadow: 0 0 8px currentColor;
}

.cv-feedback.is-error {
  background: color-mix(in srgb, #b84f5e 14%, var(--panel-color));
  border-color: color-mix(in srgb, #b84f5e 34%, transparent);
}

.cv-feedback.is-error .cv-feedback-icon {
  background: rgba(184, 79, 94, 0.18);
  color: #b84f5e;
}

.cv-feedback.is-error .cv-feedback-icon::before {
  content: '!';
  display: block;
  font-size: 1.72rem;
  font-weight: 900;
  line-height: 1;
  transform: translateY(-0.02em);
  text-shadow: 0 0 8px currentColor;
}

/* Hybrid variant: option 1 base + option 2 background + large success state */
.cv-modal--hybrid .cv-content {
  background:
    radial-gradient(circle at top left, color-mix(in srgb, var(--accent-color) 16%, transparent) 0%, transparent 42%),
    linear-gradient(180deg, color-mix(in srgb, var(--panel-color) 92%, #ffffff 8%) 0%, var(--panel-color) 100%);
}

.cv-modal--hybrid .close {
  z-index: 4;
  top: 0.55rem;
  right: 0.95rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.1rem 0.35rem 0.2rem;
  line-height: 1;
  font-size: 2.9rem;
  font-weight: 300;
  color: color-mix(in srgb, var(--text-color) 92%, transparent);
  background: transparent;
  border: 0;
  box-shadow: none;
  transition:
    transform 0.22s ease,
    color 0.22s ease,
    text-shadow 0.22s ease,
    opacity 0.22s ease;
}

.cv-modal--hybrid .close:hover,
.cv-modal--hybrid .close:focus-visible {
  transform: scale(1.08);
  color: var(--accent-color);
  text-shadow: 0 0 18px rgba(255, 237, 0, 0.42);
  outline: none;
}

.cv-modal--hybrid.cv-modal--success-screen .close {
  display: none !important;
}

.cv-modal--hybrid #cv-request-wrap {
  position: relative;
}

.cv-modal--hybrid #cv-form-title,
.cv-modal--hybrid .cv-request-subtitle,
.cv-modal--hybrid #cv-request-form > :not(.cv-feedback) {
  transition:
    opacity 0.28s ease,
    transform 0.32s ease,
    filter 0.32s ease,
    visibility 0.32s ease;
}

.cv-modal--hybrid #cv-request-wrap.feedback-success-screen {
  min-height: 31rem;
}

.cv-modal--hybrid #cv-request-wrap.feedback-success-screen #cv-form-title,
.cv-modal--hybrid #cv-request-wrap.feedback-success-screen .cv-request-subtitle,
.cv-modal--hybrid #cv-request-wrap.feedback-success-screen #cv-request-form > :not(.cv-feedback) {
  opacity: 0;
  visibility: hidden;
  transform: translateY(-12px);
  pointer-events: none;
  user-select: none;
}

.cv-modal--hybrid #cv-request-wrap.feedback-success-screen .cv-feedback {
  position: absolute;
  inset: 0;
  margin-top: 0;
  min-height: 100%;
  z-index: 2;
  grid-template-columns: 1fr;
  justify-items: center;
  align-content: center;
  text-align: center;
  gap: 1.1rem;
  padding: clamp(1.7rem, 4vw, 2.6rem);
  border-radius: 22px;
  box-shadow: 0 22px 45px rgba(0, 0, 0, 0.18);
  background:
    linear-gradient(180deg, color-mix(in srgb, #177567 20%, var(--panel-color)) 0%, color-mix(in srgb, #177567 10%, var(--panel-color)) 100%);
}

.cv-modal--hybrid #cv-request-wrap.feedback-success-screen .cv-feedback-copy {
  max-width: 33rem;
}

.cv-modal--hybrid #cv-request-wrap.feedback-success-screen .cv-feedback-title {
  font-size: clamp(1.35rem, 2.8vw, 1.8rem);
  letter-spacing: -0.02em;
}

.cv-modal--hybrid #cv-request-wrap.feedback-success-screen .cv-feedback-message {
  font-size: 1.03rem;
}

.cv-modal--hybrid #cv-request-wrap.feedback-success-screen .cv-feedback-help {
  font-size: 0.96rem;
}

.cv-modal--hybrid #cv-request-wrap.feedback-success-screen .cv-feedback-icon {
  width: 4.85rem;
  height: 4.85rem;
  font-size: 1rem;
}

.cv-modal--hybrid #cv-request-wrap.feedback-success-screen .cv-feedback-action {
  padding: 0.82em 1.3em;
  background: rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(8px);
}

body:not(.dark-mode) .cv-modal--hybrid .cv-content {
  background:
    radial-gradient(circle at top left, rgba(255, 225, 120, 0.3) 0%, transparent 38%),
    linear-gradient(180deg, #ffffff 0%, #f7f4ec 100%);
}

body:not(.dark-mode) .cv-modal--hybrid .close {
  color: #101010;
}

body:not(.dark-mode) .cv-modal--hybrid #cv-request-wrap.feedback-success-screen .cv-feedback-action {
  background: rgba(15, 23, 42, 0.08);
}

body.dark-mode .cv-modal--hybrid .close {
  color: rgba(255, 255, 255, 0.92);
}

body.dark-mode .cv-modal--hybrid .close:hover,
body.dark-mode .cv-modal--hybrid .close:focus-visible {
  color: rgb(255, 237, 0);
  text-shadow: 0 0 18px rgba(255, 237, 0, 0.5);
}

body:not(.dark-mode) .cv-modal--hybrid .close:hover,
body:not(.dark-mode) .cv-modal--hybrid .close:focus-visible {
  color: #c59000;
  text-shadow: 0 0 16px rgba(197, 144, 0, 0.28);
}

@keyframes cv-feedback-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@media (max-width: 640px) {
  .cv-form-grid {
    grid-template-columns: 1fr;
  }

  .cv-feedback {
    grid-template-columns: auto 1fr;
  }

  .cv-feedback-action {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .cv-modal--hybrid #cv-request-wrap.feedback-success-screen {
    min-height: 28rem;
  }

  .cv-modal--hybrid #cv-request-wrap.feedback-success-screen .cv-feedback-action {
    justify-self: center;
  }
}

.cv-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
