/* ============================================
   LORENA VEGA — Custom Immersive Portal
   Innectia · Vanilla CSS · Mobile-First
   ============================================ */

/* --- CUSTOM PROPERTIES --- */
:root {
  /* Palette — extracted from brand (navy + gold + burgundy) */
  --color-primary: #0d1b2a;
  --color-primary-light: #1b2a3d;
  --color-accent: #c8a44e;
  --color-accent-hover: #dbb85e;
  --color-accent-soft: rgba(200, 164, 78, 0.15);
  --color-secondary: #8b2332;
  --color-secondary-light: #a63245;
  --color-text: #f5f0e8;
  --color-text-muted: rgba(245, 240, 232, 0.65);
  --color-surface: rgba(13, 27, 42, 0.85);
  --color-surface-solid: #0d1b2a;
  --color-glass: rgba(13, 27, 42, 0.6);
  --color-glass-heavy: rgba(13, 27, 42, 0.82);
  --color-border: rgba(200, 164, 78, 0.2);
  --color-border-light: rgba(245, 240, 232, 0.1);
  --color-gradient-warm: rgba(32, 25, 18, 0.68);
  --color-gradient-warm-mid: rgba(32, 25, 18, 0.20);

  /* Z-index hierarchy (mandatory) */
  --z-video-bg: 0;
  --z-content: 1;
  --z-section-decorations: 2;
  --z-sidenav: 100;
  --z-header: 200;
  --z-mobile-nav: 250;
  --z-mobile-cta: 400;
  --z-footer: 500;
  --z-chatbot-teaser: 600;
  --z-chatbot-button: 700;
  --z-chatbot-panel: 800;
  --z-cookie-banner: 9000;
  --z-modal-overlay: 9500;
  --z-modal-content: 9600;

  /* Typography */
  --font-display: 'Cormorant Garamond', 'Georgia', serif;
  --font-body: 'Inter', 'Helvetica Neue', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Spacing */
  --header-h: 56px;
  --footer-h: 48px;
  --chatbot-btn-size: 56px;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-full: 50%;

  /* Transitions */
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-smooth: cubic-bezier(0.16, 0.84, 0.24, 1);
  --duration-fast: 200ms;
  --duration-base: 350ms;
  --duration-slow: 600ms;
}

/* --- REDUCED MOTION --- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.15s !important;
  }
  .pager-track { transition: transform 0.4s ease !important; }
  [data-depth] { transition: none !important; }
}

/* --- RESET --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; overflow: hidden; height: 100%; }
body {
  font-family: var(--font-body);
  background: var(--color-primary);
  color: var(--color-text);
  overflow: hidden;
  height: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img { max-width: 100%; display: block; }
a { color: var(--color-accent); text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
ul, ol { list-style: none; }

/* --- CUSTOM CURSOR (legal: scale/pluma) --- */
@media (pointer: fine) {
  html {
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 28 28'%3E%3Cpath d='M14 3 L17 11 L14 9 L11 11 Z M14 9 L14 25' stroke='%23c8a44e' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3Ccircle cx='14' cy='3' r='1.5' fill='%23c8a44e'/%3E%3Cpath d='M8 17 L20 17' stroke='%23c8a44e' stroke-width='1' stroke-linecap='round'/%3E%3C/svg%3E") 14 14, auto;
  }
  a, button, [role="button"], .interactive-card, .chip {
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Cpath d='M16 2 L20 12 L16 10 L12 12 Z M16 10 L16 28' stroke='%23c8a44e' stroke-width='2' fill='rgba(200,164,78,0.2)' stroke-linecap='round'/%3E%3Ccircle cx='16' cy='2' r='2' fill='%23c8a44e'/%3E%3Cpath d='M8 19 L24 19' stroke='%23c8a44e' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E") 16 16, pointer;
  }
}

/* --- CURSOR TRAIL (desktop only) --- */
.cursor-trail {
  position: fixed;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--color-accent);
  pointer-events: none;
  z-index: 99999;
  opacity: 0;
  transform: translate(-50%, -50%);
}
.cursor-click-ring {
  position: fixed;
  width: 24px; height: 24px;
  border-radius: 50%;
  border: 2px solid var(--color-accent);
  pointer-events: none;
  z-index: 99999;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.5);
}

/* --- HEADER --- */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: var(--z-header);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: rgba(13, 27, 42, 0.55);
  border-bottom: 1px solid var(--color-border);
  transition: background var(--duration-base) ease;
}
.header-logo {
  height: 36px;
  width: auto;
  transition: transform var(--duration-base) var(--ease-out-expo), filter var(--duration-base) ease;
}
.header-logo:hover { transform: scale(1.06); filter: brightness(1.15); }

/* Logo glow animation */
@keyframes logoGlow {
  0%, 100% { filter: drop-shadow(0 0 4px rgba(200,164,78,0.3)); }
  50% { filter: drop-shadow(0 0 12px rgba(200,164,78,0.6)); }
}
.header-logo { animation: logoGlow 3s ease-in-out infinite; }

.nav-desktop {
  display: flex;
  gap: 20px;
  align-items: center;
}
.nav-desktop a {
  font-size: 13px;
  color: var(--color-text-muted);
  letter-spacing: 0.02em;
  transition: color var(--duration-fast) ease;
  white-space: nowrap;
}
.nav-desktop a:hover, .nav-desktop a.active { color: var(--color-accent); }

/* Atención Online highlight */
.nav-desktop a[href="atencion-online.html"],
.mobile-nav a[href="atencion-online.html"] {
  color: var(--color-accent);
  font-weight: 600;
  padding: 4px 12px;
  border: 1px solid var(--color-accent);
  border-radius: 100px;
  transition: background var(--duration-fast) ease, color var(--duration-fast) ease;
}
.nav-desktop a[href="atencion-online.html"]:hover,
.mobile-nav a[href="atencion-online.html"]:hover {
  background: var(--color-accent);
  color: var(--color-primary);
}

.lang-switch {
  display: flex;
  gap: 6px;
  margin-left: 12px;
  padding-left: 12px;
  border-left: 1px solid var(--color-border);
}
.lang-btn {
  font-size: 18px;
  opacity: 0.5;
  transition: opacity var(--duration-fast) ease, transform var(--duration-fast) ease;
  padding: 2px;
}
.lang-btn.active { opacity: 1; }
.lang-btn:hover { opacity: 1; transform: scale(1.15); }

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 28px;
  padding: 4px 0;
}
.hamburger span {
  display: block;
  height: 2px;
  background: var(--color-text);
  border-radius: 2px;
  transition: transform var(--duration-base) ease, opacity var(--duration-fast) ease;
}
.hamburger.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* Mobile nav overlay */
.mobile-nav {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--color-glass-heavy);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: var(--z-mobile-nav);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration-base) ease;
}
.mobile-nav.open {
  display: flex;
  opacity: 1;
  pointer-events: auto;
}
.mobile-nav a {
  font-family: var(--font-display);
  font-size: 24px;
  color: var(--color-text);
  transition: color var(--duration-fast) ease;
}
.mobile-nav a:hover { color: var(--color-accent); }
.mobile-nav .lang-switch { border-left: none; margin-left: 0; padding-left: 0; margin-top: 16px; }

/* --- PAGER (full-screen navigation) --- */
.pager-viewport {
  position: fixed;
  inset: 0;
  overflow: hidden;
}
.pager-track {
  display: flex;
  flex-direction: column;
  will-change: transform;
}

/* --- SCREEN (each section) --- */
.screen {
  width: 100vw;
  height: 100vh;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: var(--header-h) 24px var(--footer-h);
  overflow: hidden;
}
.screen-inner {
  position: relative;
  z-index: var(--z-content);
  max-width: 1100px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

/* --- VIDEO BACKGROUND --- */
.pnl-video {
  position: absolute;
  inset: 0;
  z-index: var(--z-video-bg);
  overflow: hidden;
}
.pnl-video video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.pnl-video::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(13, 27, 42, 0.92) 0%,
    rgba(13, 27, 42, 0.70) 35%,
    rgba(13, 27, 42, 0.45) 65%,
    rgba(13, 27, 42, 0.30) 100%
  );
  z-index: 1;
}

/* Center overlay variant */
.pnl-video.center-overlay::after {
  background: radial-gradient(
    ellipse at center,
    rgba(13, 27, 42, 0.78) 0%,
    rgba(13, 27, 42, 0.65) 40%,
    rgba(13, 27, 42, 0.50) 70%,
    rgba(13, 27, 42, 0.40) 100%
  );
}

/* --- TYPOGRAPHY --- */
.eyebrow {
  font-family: var(--font-body);
  font-size: clamp(10px, 1.5vw, 13px);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-accent);
  font-weight: 500;
  text-shadow: 0 1px 8px rgba(0,0,0,0.5);
}
/* Inline flags in text */
.flag-inline {
  display: inline-block;
  width: 18px;
  height: 12px;
  vertical-align: middle;
  margin: 0 1px;
  border-radius: 2px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
h1 {
  font-family: var(--font-display);
  font-size: clamp(28px, min(6vw, 5.5vh), 64px);
  font-weight: 300;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--color-text);
  text-shadow: 0 2px 16px rgba(0,0,0,0.5), 0 1px 4px rgba(0,0,0,0.3);
}
h2 {
  font-family: var(--font-display);
  font-size: clamp(22px, min(4.5vw, 4vh), 44px);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.01em;
  text-shadow: 0 2px 12px rgba(0,0,0,0.5), 0 1px 4px rgba(0,0,0,0.3);
}
h3 {
  font-family: var(--font-display);
  font-size: clamp(16px, min(3vw, 2.8vh), 24px);
  font-weight: 500;
  line-height: 1.25;
  text-shadow: 0 1px 6px rgba(0,0,0,0.4);
}
.subtitle {
  font-size: clamp(13px, min(2.5vw, 2.2vh), 18px);
  color: var(--color-text-muted);
  max-width: 560px;
  line-height: 1.5;
  text-shadow: 0 1px 8px rgba(0,0,0,0.4);
}
p {
  font-size: clamp(12px, min(2.2vw, 2vh), 16px);
  line-height: 1.6;
}

/* --- BADGE --- */
.section-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: rgba(13, 27, 42, 0.7);
  border: 1px solid var(--color-border);
  border-radius: 100px;
  font-size: 12px;
  color: var(--color-accent);
  font-weight: 500;
  letter-spacing: 0.04em;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  text-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

/* About photo */
.about-photo {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--color-accent);
  box-shadow: 0 4px 24px rgba(200, 164, 78, 0.3), 0 8px 32px rgba(0,0,0,0.3);
  margin-bottom: -4px;
}

/* --- CTA BUTTONS --- */
.cta-group {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 8px;
}
.cta-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  background: var(--color-accent);
  color: var(--color-primary);
  font-weight: 600;
  font-size: 14px;
  border-radius: var(--radius-sm);
  transition: background var(--duration-base) ease, transform var(--duration-fast) ease, box-shadow var(--duration-base) ease;
  box-shadow: 0 4px 20px rgba(200, 164, 78, 0.3);
}
.cta-primary:hover {
  background: var(--color-accent-hover);
  transform: scale(1.04);
  box-shadow: 0 8px 32px rgba(200, 164, 78, 0.4);
}
.cta-primary:active { transform: scale(0.98); }

@keyframes ctaGlow {
  0%, 100% { box-shadow: 0 4px 20px rgba(200, 164, 78, 0.3); }
  50% { box-shadow: 0 4px 28px rgba(200, 164, 78, 0.5); }
}
.cta-primary { animation: ctaGlow 2.5s ease-in-out infinite; }

.cta-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  background: transparent;
  color: var(--color-text);
  font-weight: 500;
  font-size: 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  transition: border-color var(--duration-base) ease, transform var(--duration-fast) ease, background var(--duration-base) ease;
}
.cta-secondary:hover {
  border-color: var(--color-accent);
  background: var(--color-accent-soft);
  transform: scale(1.04);
}
.cta-secondary:active { transform: scale(0.98); }

/* --- STATS ROW --- */
.stats-row {
  display: flex;
  gap: 32px;
  justify-content: center;
  margin-top: 12px;
}
.stat-item { text-align: center; }
.stat-value {
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 48px);
  font-weight: 300;
  color: var(--color-accent);
  line-height: 1;
  text-shadow: 0 2px 12px rgba(0,0,0,0.4);
}
.stat-label {
  font-size: 11px;
  color: var(--color-text-muted);
  margin-top: 4px;
  letter-spacing: 0.02em;
  text-shadow: 0 1px 6px rgba(0,0,0,0.4);
}

/* --- CARDS GRID --- */
.grid-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  width: 100%;
  max-width: 900px;
}
.interactive-card {
  background: rgba(13, 27, 42, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 24px 20px;
  text-align: left;
  transition: transform var(--duration-base) var(--ease-smooth), box-shadow var(--duration-base) ease, border-color var(--duration-base) ease;
}
.interactive-card:hover {
  transform: translateY(-4px) scale(1.015);
  box-shadow: 0 12px 40px rgba(0,0,0,0.15);
  border-color: var(--color-accent);
}
.interactive-card:active {
  transform: translateY(-1px) scale(0.98);
}
.card-icon {
  width: 40px; height: 40px;
  margin-bottom: 12px;
  color: var(--color-accent);
}
.card-icon svg { width: 100%; height: 100%; }
.interactive-card h3 {
  margin-bottom: 8px;
  color: var(--color-text);
}
.interactive-card p {
  color: var(--color-text-muted);
  font-size: 13px;
  line-height: 1.5;
}

/* --- STEPS GRID (Methodology) --- */
.grid-steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  width: 100%;
  max-width: 900px;
}
.step-card {
  background: rgba(13, 27, 42, 0.75);
  backdrop-filter: blur(16px);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 24px 16px;
  text-align: left;
  position: relative;
  transition: transform var(--duration-base) var(--ease-smooth), border-color var(--duration-base) ease;
}
.step-card:hover {
  transform: translateY(-3px);
  border-color: var(--color-accent);
}
.step-num {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 300;
  color: var(--color-accent);
  opacity: 0.4;
  line-height: 1;
  margin-bottom: 12px;
}
.step-card h3 { margin-bottom: 8px; }
.step-card p { color: var(--color-text-muted); font-size: 12px; }

/* --- COUNTRIES GRID (Experience) --- */
.grid-countries {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  width: 100%;
  max-width: 900px;
}
.country-card {
  background: rgba(13, 27, 42, 0.75);
  backdrop-filter: blur(16px);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 20px 16px;
  text-align: center;
  transition: transform var(--duration-base) var(--ease-smooth), border-color var(--duration-base) ease;
}
.country-card:hover {
  transform: translateY(-3px);
  border-color: var(--color-accent);
}
.country-flag { width: 40px; height: 28px; margin: 0 auto 8px; border-radius: 4px; object-fit: cover; box-shadow: 0 2px 8px rgba(0,0,0,0.3); }
.country-card h3 { font-size: 16px; margin-bottom: 6px; }
.country-card p { font-size: 12px; color: var(--color-text-muted); }

/* --- INSTITUTIONS (Docencia) --- */
.grid-institutions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  width: 100%;
  max-width: 900px;
}
.institution-card {
  background: rgba(13, 27, 42, 0.75);
  backdrop-filter: blur(16px);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: transform var(--duration-base) var(--ease-smooth), border-color var(--duration-base) ease;
}
.institution-card:hover { transform: translateY(-2px); border-color: var(--color-accent); }
.institution-card h3 { font-size: 15px; }
.institution-card .role { font-size: 12px; color: var(--color-text-muted); }
.institution-card .year { font-size: 11px; color: var(--color-accent); font-weight: 500; }

/* --- TIMELINE (Reconocimientos) --- */
.grid-timeline {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  width: 100%;
  max-width: 900px;
}
.timeline-card {
  background: rgba(13, 27, 42, 0.75);
  backdrop-filter: blur(16px);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: left;
  border-left: 3px solid var(--color-accent);
  transition: transform var(--duration-base) var(--ease-smooth);
}
.timeline-card:hover { transform: translateY(-2px); }
.timeline-card h3 { font-size: 15px; margin-bottom: 6px; }
.timeline-card p { font-size: 12px; color: var(--color-text-muted); }

/* --- CONTACT SECTION --- */
.contact-links {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 8px;
}
.contact-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--color-text-muted);
  transition: border-color var(--duration-base) ease, color var(--duration-base) ease;
}
.contact-link:hover { border-color: var(--color-accent); color: var(--color-accent); }
.contact-link svg { width: 16px; height: 16px; }

/* --- SLIDE INDICATORS --- */
.slide-indicators {
  position: fixed;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: var(--z-sidenav);
}
.slide-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--color-text-muted);
  opacity: 0.3;
  transition: opacity var(--duration-base) ease, transform var(--duration-base) ease, background var(--duration-base) ease;
}
.slide-dot.active {
  opacity: 1;
  background: var(--color-accent);
  transform: scale(1.4);
}
.slide-dot:hover { opacity: 0.7; }

/* Slide counter */
.slide-counter {
  position: fixed;
  left: 20px;
  bottom: calc(var(--footer-h) + 16px);
  z-index: var(--z-sidenav);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--color-text-muted);
  letter-spacing: 0.05em;
}
.slide-counter .current { color: var(--color-accent); font-weight: 600; }

/* --- FOOTER --- */
.site-footer {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--footer-h);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 0 16px;
  z-index: var(--z-footer);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: rgba(13, 27, 42, 0.7);
  border-top: 1px solid var(--color-border);
  font-size: 11px;
  color: var(--color-text-muted);
}
.site-footer a {
  color: var(--color-text-muted);
  transition: color var(--duration-fast) ease;
}
.site-footer a:hover { color: var(--color-accent); }
.footer-innectia { color: var(--color-accent); font-weight: 500; }

/* --- CHATBOT --- */
.chatbot-teaser {
  position: fixed;
  bottom: 140px;
  right: 20px;
  max-width: 260px;
  padding: 12px 16px;
  background: var(--color-glass-heavy);
  backdrop-filter: blur(16px);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md) var(--radius-md) 4px var(--radius-md);
  font-size: 13px;
  color: var(--color-text);
  z-index: var(--z-chatbot-teaser);
  opacity: 0;
  transform: translateY(8px) scale(0.95);
  transition: opacity var(--duration-base) ease, transform var(--duration-base) var(--ease-out-expo);
  pointer-events: none;
  line-height: 1.45;
}
.chatbot-teaser.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.chatbot-teaser-close {
  position: absolute;
  top: 4px; right: 8px;
  font-size: 16px;
  color: var(--color-text-muted);
  line-height: 1;
  padding: 4px;
}

.chatbot-btn {
  position: fixed;
  bottom: 72px;
  right: 20px;
  width: var(--chatbot-btn-size);
  height: var(--chatbot-btn-size);
  border-radius: var(--radius-full);
  background: var(--color-accent);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-chatbot-button);
  box-shadow: 0 4px 24px rgba(200, 164, 78, 0.35);
  transition: transform var(--duration-fast) ease, box-shadow var(--duration-base) ease;
}
.chatbot-btn:hover { transform: scale(1.08); box-shadow: 0 6px 32px rgba(200, 164, 78, 0.5); }
.chatbot-btn:active { transform: scale(0.95); }
.chatbot-btn svg { width: 24px; height: 24px; }

/* Chatbot rings animation */
@keyframes chatbotRing {
  0% { transform: scale(1); opacity: 0.5; }
  100% { transform: scale(2); opacity: 0; }
}
.chatbot-btn::before, .chatbot-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--color-accent);
  opacity: 0;
  pointer-events: none;
}
.chatbot-btn::before { animation: chatbotRing 2s ease-out infinite; }
.chatbot-btn::after { animation: chatbotRing 2s ease-out infinite 1s; }

.chatbot-panel {
  position: fixed;
  bottom: 0; right: 0;
  width: 380px;
  height: 520px;
  max-height: calc(100vh - var(--header-h) - 16px);
  background: var(--color-surface-solid);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  z-index: var(--z-chatbot-panel);
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateY(100%);
  pointer-events: none;
  transition: opacity var(--duration-base) ease, transform var(--duration-base) var(--ease-out-expo);
  overflow: hidden;
}
.chatbot-panel.open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.chatbot-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-primary-light);
}
.chatbot-header-info {
  display: flex;
  align-items: center;
  gap: 10px;
}
.chatbot-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 2px solid var(--color-accent);
  object-fit: cover;
}
.chatbot-name { font-size: 14px; font-weight: 600; }
.chatbot-status {
  font-size: 11px;
  color: var(--color-accent);
  display: flex;
  align-items: center;
  gap: 4px;
}
.chatbot-status::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--color-accent);
  animation: statusPulse 2s ease infinite;
}
@keyframes statusPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
.chatbot-close-btn {
  font-size: 20px;
  color: var(--color-text-muted);
  padding: 4px;
  transition: color var(--duration-fast) ease;
}
.chatbot-close-btn:hover { color: var(--color-text); }

.chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
}
.chatbot-msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  line-height: 1.5;
  animation: msgIn 0.4s var(--ease-out-expo);
}
@keyframes msgIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.chatbot-msg.bot {
  background: rgba(13, 27, 42, 0.75);
  border: 1px solid var(--color-border);
  align-self: flex-start;
}
.chatbot-msg.user {
  background: var(--color-accent);
  color: var(--color-primary);
  align-self: flex-end;
  font-weight: 500;
}

/* Typing indicator */
.chatbot-typing {
  display: flex;
  gap: 4px;
  padding: 10px 14px;
  align-self: flex-start;
}
.chatbot-typing span {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--color-text-muted);
  animation: typingBounce 1.2s ease infinite;
}
.chatbot-typing span:nth-child(2) { animation-delay: 0.15s; }
.chatbot-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-6px); }
}

.chatbot-chips {
  padding: 12px 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  border-top: 1px solid var(--color-border);
  background: var(--color-primary-light);
}
.chip {
  padding: 8px 14px;
  border: 1px solid var(--color-border);
  border-radius: 100px;
  font-size: 12px;
  color: var(--color-text);
  background: rgba(13, 27, 42, 0.75);
  transition: background var(--duration-fast) ease, border-color var(--duration-fast) ease, transform var(--duration-fast) ease;
  white-space: nowrap;
}
.chip:hover {
  background: var(--color-accent-soft);
  border-color: var(--color-accent);
  transform: scale(1.03);
}
.chip:active { transform: scale(0.97); }

/* --- COOKIE BANNER --- */
.cookie-banner {
  position: fixed;
  bottom: 56px;
  left: 50%;
  transform: translateX(-50%);
  max-width: 560px;
  width: calc(100% - 32px);
  padding: 16px 20px;
  background: var(--color-surface-solid);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  z-index: var(--z-cookie-banner);
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 13px;
  color: var(--color-text-muted);
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}
.cookie-banner.hidden { display: none; }
.cookie-actions { display: flex; gap: 8px; flex-shrink: 0; }
.cookie-accept {
  padding: 8px 16px;
  background: var(--color-accent);
  color: var(--color-primary);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  transition: background var(--duration-fast) ease;
}
.cookie-accept:hover { background: var(--color-accent-hover); }
.cookie-reject {
  padding: 8px 16px;
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--color-text-muted);
  transition: border-color var(--duration-fast) ease;
}
.cookie-reject:hover { border-color: var(--color-text-muted); }

/* --- MOBILE CTA (fixed) --- */
.mobile-cta-fixed {
  display: none;
  position: fixed;
  bottom: calc(var(--footer-h) + 4px);
  left: 16px;
  right: 80px;
  z-index: var(--z-mobile-cta);
}
.mobile-cta-fixed .cta-primary {
  width: 100%;
  justify-content: center;
  padding: 12px 16px;
  font-size: 13px;
  border-radius: var(--radius-sm);
}

/* --- SHARE BUTTON (mobile) --- */
.share-btn {
  position: fixed;
  top: calc(var(--header-h) + 12px);
  right: 16px;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(13, 27, 42, 0.75);
  border: 1px solid var(--color-border);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: var(--z-sidenav);
  color: var(--color-text-muted);
}
.share-btn svg { width: 16px; height: 16px; }

/* ========================================
   RESPONSIVE
   ======================================== */

/* Tablet */
@media (max-width: 900px) and (min-width: 601px) {
  .grid-steps { grid-template-columns: repeat(2, 1fr); }
  .grid-countries { grid-template-columns: repeat(2, 1fr); }
  .nav-desktop { display: none; }
  .hamburger { display: flex; }
  .slide-indicators { right: 12px; }
}

/* Mobile */
@media (max-width: 600px) {
  .screen {
    padding-top: 6px !important;
    justify-content: flex-start !important;
    padding-left: 16px;
    padding-right: 16px;
  }
  .nav-desktop { display: none; }
  .hamburger { display: flex; }
  .slide-indicators { display: none; }
  .slide-counter { display: none; }

  h1 { font-size: clamp(22px, min(7vw, 5vh), 36px); }
  h2 { font-size: clamp(18px, min(5.5vw, 4vh), 28px); }

  .stats-row { gap: 16px; }
  .stat-value { font-size: clamp(24px, 6vw, 36px); }

  .grid-cards, .grid-steps, .grid-countries, .grid-institutions, .grid-timeline {
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
  }
  .interactive-card, .step-card, .country-card, .institution-card, .timeline-card {
    padding: 14px 12px;
  }
  .interactive-card p, .step-card p, .country-card p, .institution-card .role {
    font-size: 11px;
  }
  .card-icon { width: 28px; height: 28px; margin-bottom: 8px; }
  .step-num { font-size: 24px; margin-bottom: 8px; }
  .country-flag { width: 32px; height: 22px; margin-bottom: 4px; }

  .cta-group { flex-direction: column; align-items: stretch; }
  .cta-primary, .cta-secondary { justify-content: center; padding: 12px 20px; font-size: 13px; }

  .mobile-cta-fixed { display: block; }
  .share-btn { display: flex; }

  /* Chatbot mobile */
  .chatbot-panel {
    width: 100vw;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
  }
  .chatbot-teaser { max-width: 220px; bottom: 140px; right: 12px; font-size: 12px; padding: 10px 12px; }
  .chatbot-btn { bottom: 72px; right: 12px; width: 48px; height: 48px; }
  .chatbot-btn svg { width: 20px; height: 20px; }

  /* Gradients more intense on mobile */
  .pnl-video::after {
    background: linear-gradient(
      to top,
      rgba(13, 27, 42, 0.95) 0%,
      rgba(13, 27, 42, 0.80) 35%,
      rgba(13, 27, 42, 0.55) 65%,
      rgba(13, 27, 42, 0.40) 100%
    );
  }
  .pnl-video.center-overlay::after {
    background: radial-gradient(
      ellipse at center,
      rgba(13, 27, 42, 0.88) 0%,
      rgba(13, 27, 42, 0.75) 40%,
      rgba(13, 27, 42, 0.60) 80%
    );
  }

  /* Cookie banner mobile */
  .cookie-banner {
    flex-direction: column;
    bottom: 56px;
    gap: 10px;
    text-align: center;
  }

  .site-footer { gap: 8px; font-size: 10px; padding: 0 8px; }
  .contact-links { flex-direction: column; align-items: stretch; }
}

/* Small mobile */
@media (max-width: 379px) {
  .grid-cards, .grid-steps, .grid-countries { grid-template-columns: 1fr; }
}

/* Short screens */
@media (max-height: 700px) {
  .screen { padding-top: 4px; }
  .screen-inner { gap: 8px; }
  h1 { font-size: clamp(20px, 4.5vh, 32px); }
  h2 { font-size: clamp(16px, 3.5vh, 26px); }
  .stats-row { gap: 12px; }
  .stat-value { font-size: clamp(20px, 4vh, 32px); }
  .grid-cards, .grid-steps { gap: 6px !important; }
  .interactive-card, .step-card { padding: 10px 8px; }
}

/* Overflow safety */
body, .pager-viewport { overflow-x: hidden; }
img { max-width: 100%; }
* { word-break: break-word; }

/* --- LEGAL PAGES (scrollable) --- */
.legal-page {
  background: var(--color-primary);
  color: var(--color-text);
  min-height: 100vh;
  padding: 80px 24px 80px;
  overflow-y: auto;
}
.legal-page body { overflow: auto; height: auto; }
.legal-content {
  max-width: 800px;
  margin: 0 auto;
  font-size: 15px;
  line-height: 1.65;
}
.legal-content h1 {
  font-size: 32px;
  margin-bottom: 24px;
  color: var(--color-accent);
}
.legal-content h2 {
  font-size: 22px;
  margin-top: 32px;
  margin-bottom: 12px;
  color: var(--color-text);
}
.legal-content h3 {
  font-size: 18px;
  margin-top: 24px;
  margin-bottom: 8px;
}
.legal-content p { margin-bottom: 12px; color: var(--color-text-muted); }
.legal-content a { color: var(--color-accent); }
.legal-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 13px;
}
.legal-content th, .legal-content td {
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  text-align: left;
}
.legal-content th { background: rgba(13, 27, 42, 0.75); color: var(--color-accent); }
.legal-toc {
  margin-bottom: 32px;
  padding: 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}
.legal-toc a {
  display: block;
  padding: 4px 0;
  font-size: 14px;
  color: var(--color-text-muted);
}
.legal-toc a:hover { color: var(--color-accent); }
