/* ══════════════════════════════════════════════════════════════════
   Living History · Editorial Pitch-Deck Style
   ══════════════════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* ── Brand palette ─────────────────── */
  --primary:    #154193;   /* deep brand blue  */
  --accent:     #35CBFE;   /* cyan highlight   */
  --bg-dark:    #0A172A;   /* dark slide bg    */
  --bg-soft:    #0F223F;   /* card/panel bg    */
  --bg-light:   #F5F7FA;   /* light slide bg   */
  --text-main:  #0B1A2F;   /* body text dark   */
  --text-muted: #8FA3BF;   /* secondary text   */

  /* ── Semantic aliases ───────────────── */
  --blue:   var(--primary);   /* keeps existing var(--blue) refs on-brand */
  --amber:  #d97706;
  --green:  #059669;
  --purple: #7c3aed;
  --sans:   'Inter', system-ui, sans-serif;
  --serif:  'Inter', system-ui, sans-serif;
}

html { scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  background: #fff;
  color: #1e293b;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── PROGRESS BAR ─────────────────────────────────────────────── */
#progress-bar {
  position: fixed; top: 0; left: 0; height: 3px; z-index: 1000;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  width: 0%; transition: width 0.1s;
}

/* ── NAVBAR ───────────────────────────────────────────────────── */
nav {
  position: fixed; top: 3px; left: 0; right: 0; z-index: 900;
  transition: background 0.3s, box-shadow 0.3s; padding: 10px 24px;
}
nav.scrolled {
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(12px);
  box-shadow: 0 2px 20px rgba(0,0,0,0.08);
}
.nav-inner {
  max-width: 1400px; margin: auto;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.nav-logo {
  display: flex; align-items: center; gap: 10px; text-decoration: none; flex-shrink: 0;
}
.nav-logo-isotip {
  width: 34px; height: 34px; border-radius: 50%;
  background: #fff;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; flex-shrink: 0;
  box-shadow: 0 0 0 1.5px rgba(53,203,254,0.35);
  transition: box-shadow 0.2s;
}
.nav-logo:hover .nav-logo-isotip {
  box-shadow: 0 0 0 2px var(--accent), 0 0 12px rgba(53,203,254,0.3);
}
.nav-logo-head {
  width: 26px; height: 26px; object-fit: contain; display: block;
}
.nav-logo-wordmark {
  height: 18px; width: auto; object-fit: contain; display: block;
  /* on dark (non-scrolled) navbar: force white */
  filter: brightness(0) invert(1);
  opacity: 0.90; transition: filter 0.3s, opacity 0.3s;
}
/* on light navbar (scrolled): show original wordmark colours */
nav.scrolled .nav-logo-wordmark { filter: none; opacity: 1; }

.nav-slides { display: flex; gap: 2px; align-items: center; }
.nav-slide-link {
  width: 32px; height: 32px; border-radius: 8px;
  font-size: 11px; font-weight: 700;
  color: rgba(255,255,255,0.6); text-decoration: none;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s; cursor: pointer;
}
nav.scrolled .nav-slide-link { color: #64748b; }
.nav-slide-link:hover,
.nav-slide-link.active { background: var(--accent); color: var(--text-main) !important; }

.nav-badge {
  font-size: 11px; font-weight: 700;
  padding: 5px 12px; border-radius: 99px;
  border: 1.5px solid rgba(255,255,255,0.4);
  color: #fff; text-decoration: none;
  transition: all 0.2s; white-space: nowrap;
}
/* EU co-funded logo — navbar right */
.nav-eu-badge {
  display: flex; align-items: center; flex-shrink: 0;
  background: #fff;
  border-radius: 6px;
  padding: 4px 8px;
  text-decoration: none;
  transition: opacity 0.2s, box-shadow 0.2s;
  opacity: 0.92;
}
.nav-eu-badge:hover { opacity: 1; box-shadow: 0 0 0 1.5px rgba(53,203,254,0.4); }
.nav-eu-logo {
  height: 26px; width: auto; display: block; object-fit: contain;
}

/* EU logo variant in portada strip */
.cover-logo-eu {
  height: 36px !important;
}

@media(max-width:768px){
  .nav-eu-logo { height: 20px; }
}

@media(max-width:768px){ .nav-slides { display: none; } }

/* ── LANGUAGE SELECTOR ───────────────────────────────────────── */
.lang-selector {
  display: flex;
  gap: 2px;
  align-items: center;
  flex-shrink: 0;
}
.lang-btn {
  background: transparent;
  border: 1px solid transparent;
  color: rgba(255,255,255,0.55);
  font-family: var(--font);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 4px 7px;
  border-radius: 4px;
  cursor: pointer;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
  line-height: 1;
}
.lang-btn:hover {
  color: #fff;
  background: rgba(255,255,255,0.1);
}
.lang-btn.active {
  color: var(--accent);
  border-color: rgba(53,203,254,0.4);
  background: rgba(53,203,254,0.1);
}
nav.scrolled .lang-btn { color: rgba(0,0,0,0.45); }
nav.scrolled .lang-btn:hover { color: var(--primary); background: rgba(21,65,147,0.07); }
nav.scrolled .lang-btn.active { color: var(--primary); border-color: rgba(21,65,147,0.35); background: rgba(21,65,147,0.08); }

/* Mobile compact dropdown — hidden on desktop */
.lang-mobile { display: none; }

@media(max-width:767px) {
  /* Hide desktop pills, show compact toggle */
  .lang-btn { display: none; }
  .lang-mobile { display: block; position: relative; }

  .lang-mobile-toggle {
    display: flex;
    align-items: center;
    gap: 3px;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 6px;
    color: rgba(255,255,255,0.85);
    font-family: var(--font);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    padding: 6px 10px;
    cursor: pointer;
    white-space: nowrap;
    min-width: 52px;
    justify-content: center;
    transition: background 0.15s, border-color 0.15s;
    line-height: 1;
  }
  .lang-mobile-toggle:hover,
  .lang-mobile-toggle[aria-expanded="true"] {
    background: rgba(255,255,255,0.1);
    border-color: rgba(53,203,254,0.5);
  }
  .lang-mobile-arrow {
    font-size: 8px;
    opacity: 0.65;
    transition: transform 0.2s;
    display: inline-block;
  }
  .lang-mobile-toggle[aria-expanded="true"] .lang-mobile-arrow {
    transform: rotate(180deg);
  }

  /* Dropdown panel */
  .lang-mobile-menu {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: #0d2a5e;
    border: 1px solid rgba(53,203,254,0.3);
    border-radius: 8px;
    box-shadow: 0 8px 28px rgba(0,0,0,0.35);
    overflow: hidden;
    z-index: 1200;
    min-width: 64px;
  }
  .lang-mobile-menu.open { display: block; }

  .lang-mobile-option {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 44px;
    padding: 0 18px;
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.65);
    font-family: var(--font);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-align: center;
    cursor: pointer;
    transition: background 0.12s, color 0.12s;
    line-height: 1;
  }
  .lang-mobile-option:last-child { border-bottom: none; }
  .lang-mobile-option:hover { background: rgba(53,203,254,0.1); color: #fff; }
  .lang-mobile-option.active { color: var(--accent); background: rgba(53,203,254,0.08); }

  /* Scrolled nav */
  nav.scrolled .lang-mobile-toggle {
    color: rgba(0,0,0,0.65);
    border-color: rgba(0,0,0,0.18);
  }
  nav.scrolled .lang-mobile-toggle:hover,
  nav.scrolled .lang-mobile-toggle[aria-expanded="true"] {
    background: rgba(21,65,147,0.07);
    border-color: rgba(21,65,147,0.3);
  }
  nav.scrolled .lang-mobile-menu {
    background: #fff;
    border-color: rgba(21,65,147,0.2);
    box-shadow: 0 8px 28px rgba(0,0,0,0.12);
  }
  nav.scrolled .lang-mobile-option {
    color: rgba(0,0,0,0.55);
    border-bottom-color: rgba(0,0,0,0.06);
  }
  nav.scrolled .lang-mobile-option:hover { background: rgba(21,65,147,0.06); color: var(--primary); }
  nav.scrolled .lang-mobile-option.active { color: var(--primary); background: rgba(21,65,147,0.07); }
}

/* ── BACK TO TOP ──────────────────────────────────────────────── */
#backtop {
  position: fixed; bottom: 24px; right: 24px; z-index: 800;
  width: 48px; height: 48px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border: none; color: var(--text-main); cursor: pointer;
  display: none; align-items: center; justify-content: center;
  box-shadow: 0 8px 24px rgba(53,203,254,0.35);
  transition: transform 0.2s; font-size: 20px;
}
#backtop:hover { transform: translateY(-3px); }
#backtop.visible { display: flex; }

/* ── ANIMATIONS ───────────────────────────────────────────────── */
@keyframes fadeUp  { from { opacity:0; transform:translateY(30px); } to { opacity:1; transform:translateY(0); } }
@keyframes bounce  { 0%,100%{transform:translateY(0)} 50%{transform:translateY(10px)} }
@keyframes revealAnim { from{opacity:0;transform:translateY(40px)} to{opacity:1;transform:translateY(0)} }

/* ── REVEAL ON SCROLL ─────────────────────────────────────────── */
.reveal { opacity: 0; transform: translateY(40px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ══════════════════════════════════════════════════════════════
   BASE SLIDE SYSTEM
   ══════════════════════════════════════════════════════════════ */
.slide {
  min-height: 100vh; padding: 100px 48px 80px;
  position: relative;
  display: flex; flex-direction: column; justify-content: center;
}
.slide-inner { max-width: 1200px; margin: 0 auto; width: 100%; }

/* Backgrounds */
.slide-cover {
  background: var(--bg-dark);
  color: #e2e8f0;
  overflow: hidden;
  height: 100vh;
  height: 100dvh;        /* Safari 15.4+: accounts for browser chrome correctly */
  max-height: 100vh;
  max-height: 100dvh;
  padding-bottom: 148px; /* reserve space for logos strip */
}
.slide-light { background: var(--bg-light); color: var(--text-main); }
.slide-dark  { background: var(--bg-dark);  color: #e2e8f0; }

/* Slide header */
.slide-header {
  display: flex; align-items: flex-start; gap: 24px; margin-bottom: 48px;
}
.slide-num-display {
  font-size: clamp(80px, 10vw, 140px);
  font-weight: 900; line-height: 0.85;
  color: currentColor; opacity: 0.08;
  flex-shrink: 0;
  letter-spacing: -0.04em;
  user-select: none;
}
.slide-label {
  display: block; font-size: 11px; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase; margin-bottom: 10px;
}
.slide-title {
  font-size: clamp(32px, 5vw, 56px);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0;
}
.slide-intro {
  font-size: 17px; line-height: 1.75;
  max-width: 760px; margin-bottom: 48px;
  font-weight: 400;
}

/* Slide nav bar (prev/next) */
.slide-nav-bar {
  position: relative;
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 56px; padding-top: 24px;
  border-top: 1px solid rgba(0,0,0,0.08);
}
.slide-dark .slide-nav-bar,
.slide-cover .slide-nav-bar { border-top-color: rgba(255,255,255,0.1); }
.slide-cover .slide-nav-bar { display: none; } /* portada: no cal nav inferior */

.slide-nav-count {
  font-size: 12px; font-weight: 700;
  letter-spacing: 0.1em; color: #94a3b8;
}
.slide-nav-btn {
  font-size: 13px; font-weight: 700;
  padding: 10px 20px; border-radius: 99px;
  border: 1.5px solid currentColor;
  background: none; cursor: pointer;
  font-family: var(--sans); transition: all 0.2s;
}
.slide-light .slide-nav-btn { color: #475569; }
.slide-light .slide-nav-btn:hover { background: var(--accent); color: var(--text-main); border-color: var(--accent); }
.slide-dark  .slide-nav-btn,
.slide-cover .slide-nav-btn { color: rgba(255,255,255,0.6); }
.slide-dark  .slide-nav-btn:hover,
.slide-cover .slide-nav-btn:hover { background: var(--accent); color: var(--text-main); border-color: var(--accent); }

/* ══════════════════════════════════════════════════════════════
   PORTADA
   ══════════════════════════════════════════════════════════════ */

/* Layer 1 — photo */
.cover-photo {
  position: absolute; inset: 0; z-index: 0;
  background-image: url('assets/images/altea_hero.jpg');
  background-size: cover;
  background-position: center 32%;
  pointer-events: none;
}

/* Layer 2 — dark blue overlay for legibility + depth */
.cover-overlay {
  position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(
    to bottom,
    rgba(10,25,60,0.65) 0%,
    rgba(10,25,60,0.45) 35%,
    rgba(10,25,60,0.25) 70%,
    rgba(10,25,60,0.50) 100%
  );
  pointer-events: none;
}

/* Layer 3 — tech grid */
.cover-grid-bg {
  position: absolute; inset: 0; z-index: 2; opacity: 0.04;
  background-image:
    linear-gradient(rgba(96,165,250,0.5) 1px, transparent 1px),
    linear-gradient(90deg, rgba(96,165,250,0.5) 1px, transparent 1px);
  background-size: 60px 60px; pointer-events: none;
}

/* Ensure content floats above all layers */
.slide-cover > .slide-inner { position: relative; z-index: 3; }

/* ── Content area ───────────────────────────── */
.cover-inner { text-align: center; padding: 16px 0 28px; }

.cover-pretitle {
  font-size: clamp(10px, 1.1vw, 12px);
  font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase;
  color: #93c5fd; opacity: 0.8;
  margin-bottom: 14px;
  animation: fadeUp 0.8s 0.1s both;
}
.cover-title {
  font-size: clamp(48px, 7.5vw, 86px);
  font-weight: 800; color: #fff;
  line-height: 0.95; letter-spacing: -0.04em;
  margin-bottom: 6px; animation: fadeUp 0.8s 0.25s both;
  text-shadow: 0 10px 40px rgba(0,0,0,0.7);
}
.cover-title-sub {
  font-size: clamp(20px, 2.8vw, 40px);
  font-weight: 600; color: rgba(255,255,255,0.92);
  line-height: 1.1; letter-spacing: -0.02em;
  margin-bottom: 18px;
  text-shadow: 0 4px 20px rgba(0,0,0,0.55);
  animation: fadeUp 0.8s 0.35s both;
}
.cover-subtitle {
  font-size: clamp(14px, 1.8vw, 19px);
  color: #bfdbfe; font-weight: 400;
  letter-spacing: -0.01em; line-height: 1.4;
  margin-bottom: 6px; animation: fadeUp 0.8s 0.45s both;
}
.cover-subt2 {
  font-size: clamp(11px, 1.1vw, 13px);
  color: rgba(255,255,255,0.62); font-weight: 400;
  line-height: 1.5; margin-bottom: 0;
  text-shadow: 0 1px 4px rgba(0,0,0,0.5);
  animation: fadeUp 0.8s 0.55s both;
}

/* ── Erasmus+ hero badge (above titles) ─── */
.cover-erasmus-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.80);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.18), 0 1px 4px rgba(0,0,0,0.10);
  padding: 10px 22px;
  margin: 0 auto 22px;
  animation: fadeUp 0.8s 0s both;
  text-decoration: none;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.2s;
}
.cover-erasmus-badge:hover { opacity: 0.90; transform: scale(1.03); }
.cover-erasmus-hero {
  display: block;
  width: clamp(120px, 13vw, 180px);
  height: auto;
}

/* ── Project number ─── */
.cover-project-nr {
  font-size: clamp(11px, 1.2vw, 14px);
  color: rgba(147,197,253,0.75);
  font-weight: 400;
  letter-spacing: 0.03em;
  line-height: 1.5;
  margin-top: 10px;
  margin-bottom: 10px;
  animation: fadeUp 0.8s 0.52s both;
}

/* ── Cover mark logo ─── */
.cover-mark-logo-link {
  display: block;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.2s;
}
.cover-mark-logo-link:hover { opacity: 0.85; transform: scale(1.04); }
.cover-mark-logo {
  display: block;
  width: clamp(100px, 14vw, 200px);
  margin: 16px auto;
  opacity: 0.95;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.4));
  animation: coverMarkIn 0.6s 0.65s ease-out both;
}
@keyframes coverMarkIn {
  from { opacity: 0; transform: scale(0.88); }
  to   { opacity: 0.95; transform: scale(1); }
}

/* ── Logos strip — full-width, absolute at bottom ─── */
.cover-logos-strip {
  position: absolute; bottom: 0; left: 0; right: 0; z-index: 4;
  display: flex; align-items: center; justify-content: center;
  gap: 0;
  padding: 12px 48px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px)); /* home indicator */
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid rgba(0,0,0,0.07);
  animation: fadeUp 0.8s 1.0s both;
}
.cover-logos-group {
  display: flex; flex-direction: column;
  align-items: center; gap: 6px;
  padding: 0 36px;
}
.cover-logos-group--lead { align-items: flex-start; }
.cover-logos-label {
  font-size: 9px; font-weight: 800;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: #6b7a90;
}
.cover-logos-sep-v {
  width: 1px; height: 40px; flex-shrink: 0;
  background: rgba(0,0,0,0.09);
  opacity: 0.2;
}
.cover-logos-row {
  display: flex; align-items: center; gap: 24px;
}
.cover-logo {
  height: 32px; width: auto; object-fit: contain;
  display: block; cursor: default;
  transition: opacity 0.2s;
}
/* Lead partner: slightly larger for hierarchy */
.cover-logo-lead  { height: 36px; }
/* Puglia Tourist Information */
.cover-logo-puglia { height: 34px; }
/* Ajuntament d'Altea */
.cover-logo-altea { height: 30px; }
/* EuroAltea */
.cover-logo-minor   { height: 22px; }
/* E-School */
.cover-logo-eschool { height: 22px; position: relative; top: -2px; }

.cover-logos-disclaimer {
  flex-basis: 100%;
  font-size: 8.5px;
  line-height: 1.55;
  color: #7a8fa8;
  text-align: center;
  max-width: 760px;
  margin: 6px auto 0;
  padding: 0 16px;
  opacity: 0.80;
}

.cover-logo-link {
  display: inline-flex; align-items: center;
  text-decoration: none;
  transition: opacity 0.2s, transform 0.2s;
}
.cover-logo-link:hover { opacity: 0.7; transform: scale(1.04); }

.partner-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

.cover-cta {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 18px 40px; border-radius: 99px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: rgba(255,255,255,0.95); font-size: 16px; font-weight: 700; letter-spacing: -0.01em;
  text-decoration: none;
  box-shadow: 0 12px 40px rgba(37,99,235,0.4);
  transition: transform 0.2s, box-shadow 0.2s;
  animation: fadeUp 0.8s 0.9s both;
}
.cover-cta:hover { transform: translateY(-4px) scale(1.02); box-shadow: 0 20px 50px rgba(37,99,235,0.5); }
.cover-scroll-hint {
  margin-top: 16px; color: rgba(255,255,255,0.3);
  font-size: 24px; animation: bounce 2s infinite 1.5s;
}

/* ── Portada: ajustos per altures de pantalla baixes ─── */
@media (max-height: 820px) {
  .cover-inner { padding: 8px 0 16px; }
  .cover-mark-logo { width: clamp(80px, 11vw, 150px); margin: 10px auto; }
  .cover-title { margin-bottom: 4px; }
  .cover-title-sub { font-size: clamp(18px, 2.4vw, 34px); margin-bottom: 12px; }
  .cover-subtitle { margin-bottom: 4px; }
  .cover-scroll-hint { display: none; }
  .cover-erasmus-badge { padding: 8px 18px; margin-bottom: 16px; }
  .cover-erasmus-hero { width: clamp(100px, 12vw, 155px); }
  .cover-project-nr { margin-top: 6px; margin-bottom: 6px; }
}
@media (max-height: 660px) {
  .cover-mark-logo { width: clamp(60px, 9vw, 110px); margin: 8px auto; }
  .cover-pretitle { margin-bottom: 8px; }
  .cover-title-sub { font-size: clamp(15px, 2vw, 26px); margin-bottom: 8px; }
  .cover-cta { padding: 14px 32px; font-size: 14px; }
  .cover-erasmus-badge { padding: 7px 14px; margin-bottom: 10px; border-radius: 10px; }
  .cover-erasmus-hero { width: clamp(80px, 10vw, 130px); }
  .cover-project-nr { margin-top: 4px; margin-bottom: 4px; font-size: 11px; }
}

/* ── Móvil muy pequeño (iPhone SE, Mini con barra visible, etc.) ─── */
/* Ocultar el logo mark para que el CTA no quede detrás del logos strip */
@media (max-height: 700px) and (max-width: 480px) {
  .cover-mark-logo-link { display: none; }
}

/* ══════════════════════════════════════════════════════════════
   SPLIT LAYOUT
   ══════════════════════════════════════════════════════════════ */
.split-layout {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 64px; align-items: center;
}
@media(max-width:768px){ .split-layout { grid-template-columns: 1fr; gap: 40px; } }
.split-text p {
  line-height: 1.75; margin-bottom: 18px;
  font-size: 16px; color: #475569; font-weight: 400;
}
.slide-dark .split-text p { color: #94a3b8; }

/* Image placeholder */
.img-placeholder {
  background: #e8e4de; border-radius: 24px;
  padding: 60px 32px; text-align: center;
  color: #94a3b8; border: 2px dashed #d1cdc7;
}
.img-placeholder.dark {
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.15);
  color: rgba(191,219,254,0.5);
}
.img-placeholder-icon { font-size: 48px; margin-bottom: 16px; opacity: 0.5; }
.img-placeholder p { font-size: 13px; font-style: italic; }

/* ══════════════════════════════════════════════════════════════
   SLIDE 01 · INTRODUCCIÓN
   ══════════════════════════════════════════════════════════════ */
/* Fila 1 — header ample */
.s1-header {
  display: flex; align-items: flex-start; gap: 20px;
  margin-bottom: 36px;
}
.s1-num {
  font-size: clamp(80px, 10vw, 130px);
  font-weight: 900; line-height: 0.85;
  letter-spacing: -0.04em;
  color: #1e293b; opacity: 0.06;
  flex-shrink: 0; user-select: none;
}
.s1-header-text { flex: 1; }
.s1-title {
  margin-top: 8px;
}

/* Fila 2 — dues columnes */
.s1-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  align-items: start;
}
.s1-body {
  padding-right: 56px;
  max-width: 520px;
}
.s1-body p {
  font-size: 16px; line-height: 1.80;
  color: #475569; font-weight: 400;
  margin-bottom: 18px;
}
.s1-body p:last-child { margin-bottom: 0; }

/* Image col */
.s1-image-wrap {
  position: relative;
  height: clamp(320px, 42vh, 460px);
  overflow: hidden;
  transform: translateX(40px);
}
.s1-image-wrap.visible { transform: translateX(0); }
.s1-image {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: 30% 40%;
  display: block;
  border-radius: 20px;
  -webkit-mask-image: linear-gradient(to right, transparent 0%, rgba(0,0,0,0.8) 10%, black 18%);
          mask-image: linear-gradient(to right, transparent 0%, rgba(0,0,0,0.8) 10%, black 18%);
}

@media(max-width:768px){
  .s1-header { margin-bottom: 24px; }
  .s1-layout { grid-template-columns: 1fr; gap: 28px; }
  .s1-body { padding-right: 0; max-width: 100%; }
  .s1-image-wrap {
    height: clamp(220px, 48vw, 320px);
    transform: translateY(40px);
  }
  .s1-image-wrap.visible { transform: translateY(0); }
  .s1-image {
    border-radius: 14px;
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 18%);
            mask-image: linear-gradient(to bottom, transparent 0%, black 18%);
  }
}

/* ══════════════════════════════════════════════════════════════
   SLIDE 02 · MAP + COMPACT OBJECTIVES
   ══════════════════════════════════════════════════════════════ */

/* Main two-column layout */
.s2-layout {
  display: grid;
  grid-template-columns: 58% 42%;
  gap: 24px;
  align-items: start;
  margin-bottom: 16px;
}

/* Map column */
.s2-map-wrap { display: flex; flex-direction: column; gap: 8px; }
.s2-map-container {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--primary);
  border-radius: 16px;
  border: 1px solid rgba(96,165,250,0.18);
  overflow: hidden;
  box-shadow: inset 0 0 40px rgba(0,0,0,0.6);
}
/* SVG map — zoom/pan manual cap a Europa del sud */
.s2-map-img {
  display: block;
  width: 140%; height: auto;
  position: relative;
  left: -23%;
  margin-top: -36%;
  filter: invert(1) brightness(0.44) contrast(1.25) sepia(0.3) hue-rotate(195deg) saturate(3);
  pointer-events: none;
}
/* Country color glow blobs */
.s2-cg {
  position: absolute;
  width: 120px; height: 90px;
  border-radius: 50%;
  background: var(--g);
  transform: translate(-50%, -50%);
  filter: blur(22px);
  opacity: 0.28;
  pointer-events: none;
}
/* Marker layer */
.s2-markers {
  position: absolute; inset: 0;
  pointer-events: none;
}
.s2-marker {
  position: absolute;
  transform: translate(-50%, -50%);
  pointer-events: all;
  background: none; border: none; padding: 0;
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  cursor: pointer;
}
.s2-dot-wrap {
  position: relative; width: 28px; height: 28px;
}
.s2-dot {
  position: absolute; inset: 0;
  border-radius: 50%;
  background: var(--c);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800; color: #fff;
  box-shadow: 0 0 10px var(--c);
  transition: transform 0.2s;
  z-index: 2;
}
.s2-marker:hover .s2-dot { transform: scale(1.25); }
.s2-pulse {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 2px solid var(--c);
  animation: s2pulse 2.6s ease-out infinite;
  z-index: 1;
}
@keyframes s2pulse {
  0%   { width: 28px; height: 28px; opacity: 0.7; }
  100% { width: 58px; height: 58px; opacity: 0; }
}
.s2-label {
  white-space: nowrap;
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.05em; text-transform: uppercase;
  text-shadow: 0 1px 6px rgba(0,0,0,0.95);
}
/* Label offset variants to avoid overlap between nearby markers */
.s2-marker--label-left {
  flex-direction: row;
  gap: 6px;
  align-items: center;
}
.s2-marker--label-left .s2-dot-wrap { order: 2; }
.s2-marker--label-left .s2-label    { order: 1; text-align: right; }
.s2-marker--label-right {
  flex-direction: row;
  gap: 6px;
  align-items: center;
}
.s2-marker--label-right .s2-dot-wrap { order: 1; }
.s2-marker--label-right .s2-label    { order: 2; text-align: left; }
.s2-map-hint {
  font-size: 11px; font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase; color: rgba(255,255,255,0.25);
  text-align: center;
}

/* Right column */
.s2-side { display: flex; flex-direction: column; gap: 10px; margin-top: -14px; }
.s2-obj-list { display: flex; flex-direction: column; gap: 8px; }

/* Mini flipcard */
.obj-mini {
  height: 60px; perspective: 700px; cursor: pointer;
}
.obj-mini-inner {
  position: relative; width: 100%; height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.5s cubic-bezier(.4,0,.2,1);
  border-radius: 14px;
}
.obj-mini.flipped .obj-mini-inner { transform: rotateY(180deg); }
.obj-mini-front, .obj-mini-back {
  position: absolute; inset: 0;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  border-radius: 14px;
  display: flex; align-items: center;
  padding: 0 18px; color: #fff;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(53,203,254,0.2);
  border-left: 3px solid var(--card-accent, rgba(53,203,254,0.4));
  backdrop-filter: blur(10px);
  transition: background 0.25s, box-shadow 0.25s;
}
.obj-mini-back {
  transform: rotateY(180deg); padding: 12px 18px; align-items: center;
  background: linear-gradient(135deg, #0d2d5e, #154193);
  border-left: 3px solid var(--card-accent, rgba(53,203,254,0.4));
}
.obj-mini:not(.flipped):hover .obj-mini-front {
  background: linear-gradient(135deg, #154193, #35cbfe);
  box-shadow: 0 0 18px rgba(53,203,254,0.25);
  border-color: rgba(53,203,254,0.5);
}
/* Per-card accent colors */
.obj-mini--1 { --card-accent: #c97a2b; }
.obj-mini--2 { --card-accent: #35cbfe; }
.obj-mini--3 { --card-accent: #2f8f6b; }
.obj-mini--4 { --card-accent: #6a4bbf; }
.obj-mini-icon { font-size: 20px; margin-right: 14px; flex-shrink: 0; }
.obj-mini-title { font-size: 14px; font-weight: 700; line-height: 1.25; flex: 1; letter-spacing: -0.01em; }
.obj-mini-arrow { font-size: 20px; opacity: 0.5; margin-left: 8px; flex-shrink: 0; transition: transform 0.2s; }
.obj-mini:hover .obj-mini-arrow { transform: translateX(3px); opacity: 0.9; }
.obj-mini-back p { font-size: 12px; line-height: 1.6; font-weight: 400; }

/* Purpose callout */
.s2-purpose {
  background: rgba(37,99,235,0.10);
  border: 1px solid rgba(37,99,235,0.20);
  border-radius: 12px; padding: 12px 16px;
}
.s2-purpose p { color: #93c5fd; font-size: 12.5px; line-height: 1.65; font-weight: 400; }

@media(max-width:900px){
  .s2-layout { grid-template-columns: 1fr; gap: 20px; }
  .s2-obj-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  /* Safari fix ① — grid item must be able to shrink */
  .s2-map-wrap { min-width: 0; width: 100%; max-width: 100%; overflow: hidden; }
  /* Safari fix ② — container té mida explícita i no pot créixer per contingut */
  .s2-map-container { width: 100%; max-width: 100%; min-width: 0; }
  /* Safari fix ③ — treure la img del flux és la clau:
     width:140% en flux estira el contenidor; com a absolute no pot fer-ho.
     Les percentatges de left/margin-top seguixen referenciant l'ample del contenidor. */
  .s2-map-img {
    position: absolute;
    width: 140%;
    left: -23%;
    top: 0;
    margin-top: -36%;
  }
}
@media(max-width:560px){
  .s2-obj-list { grid-template-columns: 1fr; }
  /* Proporció més alta en mòbil: 4:3 en lloc de 16:9 → +33% d'alçada visible */
  .s2-map-container { aspect-ratio: 4 / 3; }
}

/* S2-specific overrides to keep slide compact */
#s2 .slide-header { margin-bottom: 24px; }
#s2 .slide-num-display { font-size: clamp(60px, 7vw, 100px); }
#s2 .slide-nav-bar { margin-top: 28px; }

/* Keep old flipcard styles for any other potential use */
.objectives-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 24px; margin-bottom: 32px;
}

.obj-card {
  height: 240px; perspective: 900px; cursor: pointer;
}
.obj-card-inner {
  position: relative; width: 100%; height: 100%;
  transform-style: preserve-3d; transition: transform 0.55s cubic-bezier(.4,0,.2,1);
  border-radius: 20px;
}
.obj-card.flipped .obj-card-inner { transform: rotateY(180deg); }

.obj-card-front,
.obj-card-back {
  position: absolute; inset: 0;
  backface-visibility: hidden;
  border-radius: 20px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 28px 20px; text-align: center; color: #fff;
}
.obj-card-back { transform: rotateY(180deg); }

.obj-icon { font-size: 40px; margin-bottom: 12px; }
.obj-title { font-size: 17px; font-weight: 700; line-height: 1.25; letter-spacing: -0.01em; }
.obj-hint { font-size: 11px; margin-top: 12px; opacity: 0.65; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
.obj-card-back p { font-size: 14px; line-height: 1.7; font-weight: 400; }

/* Guide purpose callout */
.guide-purpose {
  margin-top: 32px;
  background: rgba(37,99,235,0.12);
  border: 1px solid rgba(37,99,235,0.25);
  border-radius: 16px; padding: 24px 28px;
}
.guide-purpose p { color: #93c5fd; font-size: 16px; line-height: 1.75; font-weight: 400; }

/* ══════════════════════════════════════════════════════════════
   SLIDE 03 · USE-CASE CARDS + PHONE MOCKUP + QR IMAGE
   ══════════════════════════════════════════════════════════════ */

/* Cards */
.use-case-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 16px; margin-bottom: 16px;
}
.use-card {
  background: #fff; border: 1px solid #e2e8f0;
  border-radius: 16px; padding: 16px 18px;
  transition: transform 0.2s, box-shadow 0.2s;
}
.use-card:hover { transform: translateY(-3px); box-shadow: 0 12px 24px rgba(0,0,0,0.06); }
.use-card-icon {
  width: 38px; height: 38px; border-radius: 10px;
  font-size: 18px; display: flex; align-items: center; justify-content: center;
  margin-bottom: 10px;
}
.use-card-title { font-size: 14px; font-weight: 700; margin-bottom: 5px; color: #1e293b; letter-spacing: -0.01em; }
.use-card-desc {
  font-size: 12px; color: #64748b; line-height: 1.55; font-weight: 400;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}

/* ── Bottom layout: positioned overlay (image bg + phone foreground) ── */
.s3-bottom {
  position: relative;
  height: clamp(360px, 47vh, 560px);
  margin-top: 0;
}

/* ── Phone frame: absolutely left, floats in front ── */
.s3-phone-frame {
  position: absolute;
  left: -4%; top: 0; bottom: 0;
  width: 48%;
  z-index: 2;
  display: flex; align-items: center; justify-content: center;
  padding: 8px 0;
}
.s3-phone {
  background: var(--bg-dark);
  border-radius: 36px;
  padding: 10px;
  box-shadow:
    0 28px 64px rgba(0,0,0,0.30),
    0 0 0 1px rgba(255,255,255,0.07),
    inset 0 1px 0 rgba(255,255,255,0.12);
  width: 100%;
  max-width: 320px;
  height: 100%;
  display: flex;
  flex-direction: column;
}
/* Fake iOS status bar */
.s3-phone-status {
  display: flex; justify-content: space-between; align-items: center;
  padding: 5px 14px 3px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.02em;
  color: #e2e8f0; font-family: var(--sans);
  flex-shrink: 0;
}
/* Phone screen */
.s3-phone-inner {
  background: #fff;
  border-radius: 28px;
  overflow: hidden;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
/* Home bar */
.s3-phone-indicator {
  height: 16px; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.s3-phone-indicator::after {
  content: ''; width: 72px; height: 3px;
  background: rgba(255,255,255,0.35); border-radius: 99px;
}

/* Chat header inside phone */
.chatbot-header {
  background: linear-gradient(135deg, var(--primary), var(--bg-dark));
  padding: 8px 14px; display: flex; align-items: center; gap: 10px;
  flex-shrink: 0;
}
.chatbot-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: rgba(255,255,255,0.15);
  display: flex; align-items: center; justify-content: center; font-size: 15px;
}
.chatbot-name { font-weight: 700; color: #fff; font-size: 13px; letter-spacing: -0.01em; }
.chatbot-status { font-size: 10px; font-weight: 500; color: #34d399; margin-top: 1px; letter-spacing: 0.02em; }

/* Messages */
.chat-messages {
  flex: 1; overflow-y: auto; padding: 8px 10px;
  display: flex; flex-direction: column; gap: 6px;
  background: #f8fafc; min-height: 0;
}
.msg {
  max-width: 82%; padding: 7px 10px;
  border-radius: 12px; font-size: 11px; font-weight: 400; line-height: 1.5;
}
.msg.bot { background: #e0e7ff; color: #1e293b; align-self: flex-start; border-bottom-left-radius: 3px; }
.msg.user { background: var(--primary); color: #fff; align-self: flex-end; border-bottom-right-radius: 3px; }

/* Quick-reply buttons */
.chat-suggestions {
  padding: 5px 8px; display: flex; flex-direction: column; gap: 3px;
  border-top: 1px solid #e2e8f0; background: #fff; flex-shrink: 0;
}
.chat-btn {
  padding: 3px 8px; border-radius: 7px;
  border: 1px solid #e2e8f0; background: #f8fafc;
  font-size: 9.5px; font-weight: 500; color: #475569;
  cursor: pointer; transition: all 0.18s;
  font-family: var(--sans); text-align: left; line-height: 1.35;
}
.chat-btn:hover { background: var(--accent); color: var(--text-main); border-color: var(--accent); }

/* Fake input bar */
.s3-phone-input {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 12px;
  border-top: 1px solid #e2e8f0; background: #fff; flex-shrink: 0;
}
.s3-phone-input-placeholder {
  flex: 1; font-size: 11px; color: #94a3b8; font-family: var(--sans);
}
.s3-phone-send {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--accent); border: none; color: var(--text-main);
  font-size: 15px; font-weight: 700; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0;
}

/* ── QR image: background layer, behind phone ── */
.s3-qr-wrap {
  position: absolute;
  left: 36%; right: 0; top: 0; bottom: 0;
  z-index: 1;
  overflow: hidden;
  border-radius: 16px;
}
.s3-qr-img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: center 25%;
  display: block;
}
/* Left-fade: blends left edge of image with slide bg (#f8f6f2) */
.s3-qr-wrap::after {
  content: '';
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(
    to right,
    rgba(245,247,250,1)   0%,
    rgba(245,247,250,0.7) 10%,
    rgba(245,247,250,0.2) 26%,
    rgba(245,247,250,0)   40%
  );
}

/* ── S3-specific compaction ── */
#s3 { padding-top: 72px; padding-bottom: 56px; }
#s3 .slide-header { margin-bottom: 12px; }
#s3 .slide-num-display { font-size: clamp(52px, 6vw, 88px); }
#s3 .slide-title { font-size: clamp(24px, 3.6vw, 44px); }
#s3 .use-case-grid { margin-bottom: 12px; }
#s3 .slide-nav-bar { margin-top: 12px; }

/* ── Responsive: stack vertically on tablet/mobile ── */
@media(max-width:900px){
  .s3-bottom { height: auto; }
  .s3-phone-frame {
    position: relative; left: auto; top: auto; bottom: auto;
    width: 100%; height: 560px; padding: 0; /* 320px wide × 560px ≈ 9:16 */
  }
  .s3-phone { max-width: 100%; }
  .s3-qr-wrap {
    position: relative; left: auto; right: auto; top: auto; bottom: auto;
    height: 240px; border-radius: 12px;
    margin-top: 16px;
  }
}
@media(max-width:768px){ .use-case-grid { grid-template-columns: 1fr; } }

/* ══════════════════════════════════════════════════════════════
   SLIDE 04 · METHODOLOGY TIMELINE
   ══════════════════════════════════════════════════════════════ */
.steps-layout {
  display: grid; grid-template-columns: 220px 1fr;
  gap: 40px; align-items: start;
}
@media(max-width:768px){ .steps-layout { grid-template-columns: 1fr; } }

/* Timeline column */
.steps-timeline {
  position: relative;
  display: flex; flex-direction: column;
  padding-left: 8px;
}
.tl-line {
  position: absolute;
  left: 23px; top: 22px; bottom: 22px;
  width: 2px;
  background: linear-gradient(to bottom, rgba(255,255,255,0.18), rgba(255,255,255,0.04));
  z-index: 0;
}
.tl-step {
  display: flex; align-items: center; gap: 14px;
  background: none; border: none;
  cursor: pointer; padding: 7px 0;
  position: relative; z-index: 1;
  transition: all 0.2s;
  font-family: var(--sans);
}
.tl-node {
  width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
  border: 2px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.04);
  display: flex; align-items: center; justify-content: center;
  transition: all 0.25s cubic-bezier(0.34,1.36,0.64,1);
}
.tl-num {
  font-size: 11px; font-weight: 700;
  color: rgba(255,255,255,0.40);
  transition: color 0.2s;
}
.tl-label {
  font-size: 12px; font-weight: 600;
  color: rgba(255,255,255,0.38);
  text-align: left; line-height: 1.3;
  transition: color 0.2s;
}
.tl-step:hover .tl-node { border-color: rgba(255,255,255,0.45); background: rgba(255,255,255,0.09); }
.tl-step:hover .tl-num  { color: rgba(255,255,255,0.8); }
.tl-step:hover .tl-label { color: rgba(255,255,255,0.7); }
.tl-step.active .tl-node {
  background: var(--primary); border-color: var(--accent);
  box-shadow: 0 0 0 5px rgba(53,203,254,0.18), 0 0 18px rgba(53,203,254,0.35);
}
.tl-step.active .tl-num   { color: #fff; }
.tl-step.active .tl-label { color: #fff; font-weight: 700; font-size: 13px; }

/* Detail panel */
.step-detail {
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px; padding: 32px;
  opacity: 0; transform: translateY(10px) scale(0.99);
  transition: opacity 0.22s ease, transform 0.22s ease;
  pointer-events: none;
}
.step-detail.visible { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }

/* Inner layout: text left + optional image right */
.step-detail-content {
  display: flex; gap: 24px; align-items: flex-start;
}
.step-detail-text { flex: 1; min-width: 0; }

/* Image column — hidden until step has one */
.step-detail-img-wrap {
  display: none;
  width: 340px; flex-shrink: 0;
  border-radius: 14px; overflow: hidden;
  border: 1px solid rgba(255,255,255,0.10);
  box-shadow: 0 12px 32px rgba(0,0,0,0.35);
  margin-top: 8px;
}
.step-detail-img-wrap.has-image { display: block; }
.step-detail-img-wrap.portrait { width: 220px; }
.step-detail-img-wrap.portrait .step-detail-img { height: 300px; }
.step-detail-img {
  width: 100%; height: 210px; object-fit: cover; display: block;
  filter: brightness(0.95) saturate(0.9);
}
@media(max-width:860px){
  .step-detail-content { flex-direction: column; }
  .step-detail-img-wrap { width: 100%; }
  .step-detail-img { height: 160px; }
}

.step-detail-icon {
  font-size: 42px; line-height: 1;
  margin-bottom: 14px; display: block;
  filter: drop-shadow(0 0 12px rgba(255,255,255,0.15));
}
.step-detail-num {
  display: inline-block; font-size: 11px; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 10px;
}
.step-detail-title { font-size: 28px; font-weight: 700; color: #fff; margin-bottom: 20px; letter-spacing: -0.02em; line-height: 1.2; }
.step-detail-desc {
  font-size: 16px; line-height: 1.78; color: #94a3b8; margin-bottom: 0; font-weight: 400;
  list-style: none; padding: 0;
  display: flex; flex-direction: column; gap: 18px;
}
.step-detail-desc li {
  padding-left: 22px; position: relative;
}
.step-detail-desc li::before {
  content: '•'; position: absolute; left: 0;
  color: var(--accent); font-size: 18px; line-height: 1.5;
}

/* ══════════════════════════════════════════════════════════════
   SLIDE 05 · EDITORIAL LAYOUT (TEXT + PHOTO)
   ══════════════════════════════════════════════════════════════ */
.s5-layout {
  display: grid; grid-template-columns: 1fr 1.35fr; gap: 36px; align-items: center;
}
.s5-text { display: flex; flex-direction: column; gap: 20px; }
.s5-para {
  font-size: 16px; line-height: 1.80; color: #475569; font-weight: 400; margin: 0;
}
.s5-para strong { color: #1e293b; font-weight: 700; }
.s5-photo-wrap {
  position: relative; overflow: hidden; border-radius: 20px;
  height: clamp(300px, 44vh, 460px);
  margin-left: -12px;
  width: calc(100% + 12px);
  transform: translateX(30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.s5-photo-wrap.visible { transform: translateX(0); }
.s5-photo-wrap::before {
  content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(to right,
    var(--bg-light) 0%,
    rgba(245,247,250,0.80) 12%,
    rgba(245,247,250,0.25) 24%,
    rgba(245,247,250,0) 34%
  );
}
.s5-photo { width: 100%; height: 100%; object-fit: cover; object-position: center center; display: block; }
#s5 .slide-header { margin-bottom: 28px; }
#s5 .slide-nav-bar { margin-top: 28px; }
@media(max-width:900px){
  .s5-layout { grid-template-columns: 1fr; gap: 28px; }
  .s5-photo-wrap { transform: translateX(0); margin-left: 0; width: 100%; }
}

/* ══════════════════════════════════════════════════════════════
   SLIDE 06 · EDITORIAL LAYOUT (TITLE TOP / TEXT LEFT / IMAGE RIGHT)
   ══════════════════════════════════════════════════════════════ */

/* Two-column body */
.s6-body {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 44px; align-items: start;
  margin-top: 4px;
}
.s6-left { display: flex; flex-direction: column; gap: 18px; }

/* Staggered reveal animations */
.quote-block.reveal     { transition-delay: 0.05s; }
.s6-intro-line.reveal   { transition-delay: 0.18s; }
.content-list.reveal    { transition-delay: 0.30s; }
#s6 .slide-intro.reveal { transition-delay: 0.44s; }
.s6-right.reveal        { transition-delay: 0.15s; }

/* Image column */
.s6-right {
  display: flex; align-items: flex-start; justify-content: center;
  position: relative;
}
.s6-right::before {
  content: ''; position: absolute; inset: -32px;
  background: radial-gradient(ellipse at center,
    rgba(217,119,6,0.22) 0%, rgba(217,119,6,0) 68%
  );
  filter: blur(28px); border-radius: 50%; pointer-events: none;
}
.s6-img-wrap {
  position: relative; z-index: 1; width: 100%;
  border-radius: 20px; overflow: hidden;
  height: clamp(300px, 42vh, 470px);
  box-shadow: 0 28px 72px rgba(0,0,0,0.65),
              0 0 0 1px rgba(255,255,255,0.08),
              0 0 40px rgba(217,119,6,0.12);
}
.s6-avatar-img {
  width: 100%; height: 100%;
  object-fit: contain; object-position: center;
  display: block; background: var(--bg-dark);
}

/* Quote block */
.quote-block {
  position: relative; padding: 26px 32px;
  background: rgba(21,65,147,0.22);
  border: 1px solid rgba(53,203,254,0.20); border-radius: 16px;
}
.quote-mark {
  font-size: 96px; line-height: 0.7;
  color: rgba(255,255,255,0.07);
  position: absolute; top: 14px; left: 20px;
  pointer-events: none; font-weight: 900; letter-spacing: -0.04em;
}
.quote-text {
  font-size: clamp(19px, 2.4vw, 26px);
  font-weight: 700; color: #fff; line-height: 1.4;
  font-style: italic; letter-spacing: -0.02em;
  position: relative; z-index: 1;
}

/* Introductory line before bullets */
.s6-intro-line {
  font-size: 15.5px; font-weight: 600; color: #cbd5e1;
  letter-spacing: 0.01em; line-height: 1.5; margin: 0;
}

/* Content list */
.content-list { display: flex; flex-direction: column; gap: 6px; }
.content-list-item {
  display: flex; align-items: flex-start; gap: 12px;
  background: rgba(21,65,147,0.18); border-radius: 11px;
  padding: 8px 13px; border: 1px solid rgba(53,203,254,0.14);
}
.content-list-icon { font-size: 19px; flex-shrink: 0; margin-top: 1px; }
.content-list-item p { font-size: 13.5px; line-height: 1.55; color: #94a3b8; font-weight: 400; }

/* Compaction */
#s6 .slide-header { margin-bottom: 18px; }
#s6 .slide-nav-bar { margin-top: 18px; }
@media(max-width:860px){
  .s6-body { grid-template-columns: 1fr; gap: 28px; }
  .s6-img-wrap { height: 260px; }
}

/* ══════════════════════════════════════════════════════════════
   SLIDE 07 · TRANSFER CARDS + IMAGE BAND
   ══════════════════════════════════════════════════════════════ */
.transfer-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 14px; margin-top: 0;
}
@media(max-width:768px){ .transfer-grid { grid-template-columns: 1fr; } }

.transfer-card {
  background: #fff; border: 1px solid #e2e8f0;
  border-radius: 14px; padding: 14px 18px;
  transition: transform 0.22s, box-shadow 0.22s;
  position: relative; overflow: hidden;
}
.transfer-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--primary));
}
.transfer-card:hover { transform: translateY(-4px); box-shadow: 0 14px 32px rgba(0,0,0,0.09); }

/* Compact horizontal card head */
.tc-head {
  display: flex; align-items: center; gap: 10px; margin-bottom: 7px;
}
.tc-icon { font-size: 22px; flex-shrink: 0; line-height: 1; }
.transfer-title {
  font-size: 15px; font-weight: 700; color: #1e293b;
  margin: 0; letter-spacing: -0.01em; line-height: 1.3;
}
.transfer-desc {
  font-size: 13px; color: #64748b; line-height: 1.55; font-weight: 400;
  padding-left: 32px; /* indent to align with title (22px icon + 10px gap) */
  margin: 0;
}

/* Image band — tall, protagonist */
.s7-img-band {
  position: relative; overflow: hidden;
  height: clamp(290px, 44vh, 480px);
  border-radius: 14px;
  margin-top: 6px;
}
.s7-img-band::before {
  content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(to bottom,
    var(--bg-light) 0%,
    rgba(245,247,250,0.55) 16%,
    rgba(245,247,250,0) 36%
  );
}
.s7-img {
  width: 100%; height: 100%; object-fit: cover; object-position: center 50%;
  display: block; filter: saturate(0.9) contrast(1.03);
}
/* On mobile: let the image define its own height — no lateral cropping */
@media(max-width:900px){
  .s7-img-band {
    height: auto;
    aspect-ratio: 4 / 3;
  }
  .s7-img {
    width: 100%; height: 100%;
    object-fit: contain;
    object-position: center;
    background: var(--bg-light);
  }
}

/* s7 compaction */
#s7 .slide-header { margin-bottom: 10px; }
#s7 .transfer-grid { margin-bottom: 0; }
#s7 .slide-nav-bar { margin-top: 6px; }

/* ══════════════════════════════════════════════════════════════
   SLIDE 08 · TEXT + ANIMATED BAR CHART
   ══════════════════════════════════════════════════════════════ */

/* Two-column layout */
.s8-layout {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 52px; align-items: center;
}
@media(max-width:860px){ .s8-layout { grid-template-columns: 1fr; gap: 28px; } }

/* Left column */
.s8-left { display: flex; flex-direction: column; gap: 18px; }
.s8-intro {
  font-size: 16px; line-height: 1.78; color: #cbd5e1; font-weight: 400; margin: 0;
}
.s8-sub {
  font-size: 12px; font-weight: 700; color: #64748b;
  text-transform: uppercase; letter-spacing: 0.09em; margin: 0;
}
.s8-bullets {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 10px;
}
.s8-bullets li {
  font-size: 15px; color: #cbd5e1; line-height: 1.6;
  padding-left: 20px; position: relative; font-weight: 400;
}
.s8-bullets li::before {
  content: '•'; position: absolute; left: 0;
  color: var(--green); font-size: 18px; line-height: 1.35;
}

/* Right column — bar chart */
.s8-chart { display: flex; flex-direction: column; gap: 22px; }
.s8-bar-row { display: flex; flex-direction: column; gap: 7px; }
.s8-bar-label {
  font-size: 12px; font-weight: 600; color: #94a3b8;
  letter-spacing: 0.03em; text-transform: uppercase;
}
.s8-bar-track {
  height: 30px; background: rgba(255,255,255,0.05);
  border-radius: 8px; overflow: hidden;
  border: 1px solid rgba(255,255,255,0.07);
}
.s8-bar {
  height: 100%; width: 0; border-radius: 8px;
  transition: width 1.1s cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
  box-shadow: 0 0 12px rgba(53,203,254,0.3);
}
.s8-bar::after {
  content: ''; position: absolute; inset: 0; border-radius: 8px;
  background: linear-gradient(to bottom, rgba(255,255,255,0.18) 0%, rgba(255,255,255,0) 100%);
}
/* Trigger: when .s8-chart gets .visible (from revealObs), bars expand */
.s8-chart.visible .s8-bar { width: var(--w); }

.s8-chart-note {
  font-size: 11px; color: #475569; font-style: italic;
  text-align: right; margin: 0; letter-spacing: 0.02em;
}

/* s8 compaction */
#s8 .slide-header { margin-bottom: 28px; }
#s8 .slide-nav-bar { margin-top: 28px; }

/* ══════════════════════════════════════════════════════════════
   SLIDE 09 · CHECKLIST / TIPS
   ══════════════════════════════════════════════════════════════ */
.tips-grid {
  display: grid; grid-template-columns: repeat(5, 1fr);
  gap: 16px; margin-bottom: 32px;
}
@media(max-width:960px){ .tips-grid { grid-template-columns: repeat(3, 1fr); } }
@media(max-width:600px){ .tips-grid { grid-template-columns: 1fr; } }

.check-item {
  background: linear-gradient(160deg, #f8fbff 0%, #eef5ff 60%, #e8f2ff 100%);
  border: 2px solid #c3d9f7;
  border-radius: 20px; padding: 28px 20px;
  cursor: pointer; text-align: center;
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  box-shadow: 0 2px 10px rgba(59,130,246,0.07), 0 1px 3px rgba(0,0,0,0.05);
  transition: background 0.25s, border-color 0.25s, box-shadow 0.25s, transform 0.25s;
}
.check-item::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--green); transform: scaleX(0); transition: transform 0.3s;
}
.check-item:hover {
  background: linear-gradient(160deg, #f0f7ff 0%, #dbeeff 60%, #d1e9ff 100%);
  border-color: #60a5fa;
  transform: translateY(-4px);
  box-shadow: 0 10px 28px rgba(59,130,246,0.14), 0 0 0 3px rgba(147,197,253,0.18);
}
.check-item.done { border-color: var(--green); background: #f0fdf4; box-shadow: 0 2px 10px rgba(34,197,94,0.08); }
.check-item.done::before { transform: scaleX(1); }

/* ── Slide 09: check-box idle microanimation ──────────────────── */
@keyframes checkBreath {
  0%, 100% { transform: scale(1);    box-shadow: 0 0 0 0   rgba(96,165,250,0);    border-color: #cbd5e1; }
  50%       { transform: scale(1.08); box-shadow: 0 0 0 5px rgba(96,165,250,0.14); border-color: #93c5fd; }
}
@keyframes checkRingPulse {
  0%        { transform: scale(1);   opacity: 0.6; }
  70%, 100% { transform: scale(1.8); opacity: 0;   }
}
@keyframes checkGhostFade {
  0%, 100%  { opacity: 0;    transform: scale(0.85); }
  35%, 65%  { opacity: 0.28; transform: scale(1);    }
}

.check-box {
  width: 40px; height: 40px; border-radius: 50%;
  border: 2px solid #cbd5e1;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 700; color: var(--green);
  transition: background 0.25s, border-color 0.25s, color 0.25s;
  flex-shrink: 0;
  position: relative;
  animation: checkBreath 2.8s ease-in-out infinite;
}

/* Halo ring */
.check-box::before {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 1.5px solid rgba(96,165,250,0.55);
  animation: checkRingPulse 2.8s ease-out infinite;
  pointer-events: none;
}

/* Ghost check */
.check-box::after {
  content: '✓';
  position: absolute;
  font-size: 15px;
  font-weight: 700;
  color: #93c5fd;
  line-height: 1;
  animation: checkGhostFade 2.8s ease-in-out infinite;
  pointer-events: none;
}

/* Staggered delays so cards pulse in a gentle wave */
.check-item:nth-child(1) .check-box,
.check-item:nth-child(1) .check-box::before,
.check-item:nth-child(1) .check-box::after { animation-delay: 0s; }

.check-item:nth-child(2) .check-box,
.check-item:nth-child(2) .check-box::before,
.check-item:nth-child(2) .check-box::after { animation-delay: 0.5s; }

.check-item:nth-child(3) .check-box,
.check-item:nth-child(3) .check-box::before,
.check-item:nth-child(3) .check-box::after { animation-delay: 1.0s; }

.check-item:nth-child(4) .check-box,
.check-item:nth-child(4) .check-box::before,
.check-item:nth-child(4) .check-box::after { animation-delay: 1.5s; }

.check-item:nth-child(5) .check-box,
.check-item:nth-child(5) .check-box::before,
.check-item:nth-child(5) .check-box::after { animation-delay: 2.0s; }

/* Completado: sin animación, pseudo-elementos ocultos */
.check-item.done .check-box { background: var(--green); border-color: var(--green); color: #fff; animation: none; }
.check-item.done .check-box::before,
.check-item.done .check-box::after { display: none; }


.check-content { flex: 1; }
.check-num { font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: #94a3b8; margin-bottom: 8px; }
.check-item.done .check-num { color: var(--green); }
.check-item p { font-size: 14px; line-height: 1.65; color: #475569; font-weight: 500; }
.check-item.done p { color: #166534; }

.checklist-done { display: none !important; /* replaced by celebration modal */ }

/* ══════════════════════════════════════════════════════════════
   CELEBRATION MODAL (slide 09 checklist completion)
   ══════════════════════════════════════════════════════════════ */
.celebration-modal {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  background: rgba(10,15,30,0.72);
  backdrop-filter: blur(5px);
  opacity: 0; pointer-events: none;
  transition: opacity 0.32s ease;
}
.celebration-modal.open {
  opacity: 1; pointer-events: all;
}
.celebration-box {
  background: #fff; border-radius: 24px;
  max-width: 520px; width: 92%; overflow: hidden;
  box-shadow: 0 40px 80px rgba(0,0,0,0.32), 0 0 0 1px rgba(255,255,255,0.08);
  position: relative;
  transform: scale(0.88) translateY(28px);
  transition: transform 0.42s cubic-bezier(0.34, 1.48, 0.64, 1);
}
.celebration-modal.open .celebration-box {
  transform: scale(1) translateY(0);
}
.celebration-close {
  position: absolute; top: 12px; right: 14px; z-index: 2;
  background: rgba(0,0,0,0.07); border: none; border-radius: 50%;
  width: 30px; height: 30px; font-size: 13px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: #64748b; transition: background 0.18s; line-height: 1;
}
.celebration-close:hover { background: rgba(0,0,0,0.14); }
.celebration-img-wrap {
  width: 100%; height: 210px; overflow: hidden;
}
.celebration-img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: center 30%;
  display: block;
}
.celebration-body {
  padding: 26px 36px 30px; text-align: center;
}
.celebration-title {
  font-size: 20px; font-weight: 800; color: #1e293b;
  letter-spacing: -0.02em; line-height: 1.28;
  margin: 0 0 10px;
}
.celebration-sub {
  font-size: 14px; color: #64748b; line-height: 1.65; margin: 0 0 22px;
}
.celebration-cta {
  background: var(--accent); color: var(--text-main); border: none;
  border-radius: 12px; padding: 12px 30px;
  font-size: 15px; font-weight: 700; cursor: pointer;
  font-family: var(--sans); letter-spacing: -0.01em;
  transition: background 0.18s, transform 0.15s;
}
.celebration-cta:hover { background: #1d4ed8; transform: translateY(-2px); }

/* ══════════════════════════════════════════════════════════════
   SLIDE 10 · HERO CLOSING SCREEN
   ══════════════════════════════════════════════════════════════ */

/* Full-bleed hero — section provides horizontal padding like other slides */
#s10.s10-hero {
  padding: 0 48px; position: relative; overflow: hidden;
  display: flex; flex-direction: column;
  padding-bottom: 148px; /* reserve space for logos strip */
}

/* Full-bleed background (absolute — ignores section padding) */
.s10-bg { position: absolute; inset: 0; z-index: 0; }
.s10-bg-img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: center center;
  display: block;
}
.s10-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(
    160deg,
    rgba(10,20,55,0.78) 0%,
    rgba(10,20,55,0.52) 55%,
    rgba(10,20,55,0.35) 100%
  );
}

/* Inner — same centering as all other slides, plus flex column */
.s10-inner {
  position: relative; z-index: 1;
  flex: 1; display: flex; flex-direction: column;
  padding-top: 100px; /* match .slide top padding */
}

/* Header — no extra overrides needed; inherits slide-header defaults */
#s10 .slide-header { margin-bottom: 16px; }
#s10 .slide-num-display { opacity: 0.10; }
#s10 .slide-title { color: #fff; }
#s10 .s10-label { color: #7dd3fc; letter-spacing: 0.14em; }

/* Resource cards grid */
.s10-resources {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 11px;
  max-width: 940px;
  margin: 0 auto;
}
.s10-card {
  display: flex; align-items: flex-start; gap: 12px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  backdrop-filter: blur(10px);
  border-radius: 12px; padding: 14px 18px;
}
.s10-card-icon { font-size: 18px; flex-shrink: 0; margin-top: 1px; }
.s10-card-text {
  font-size: 13px; color: rgba(255,255,255,0.82);
  line-height: 1.5; font-weight: 400; margin: 0;
}
.s10-card-links { display: block; margin-top: 4px; }

/* Clickable links inside cards */
.s10-link {
  font-size: 11px; color: rgba(255,255,255,0.50);
  text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,0.20);
  transition: color 0.18s, border-color 0.18s;
}
.s10-link:hover { color: #fff; border-color: rgba(255,255,255,0.7); }
.s10-link-sep { font-size: 11px; color: rgba(255,255,255,0.25); margin: 0 4px; }

/* Closing quote */
.s10-closing {
  margin-top: clamp(40px, 6vw, 60px); text-align: center;
  border-top: 1px solid rgba(255,255,255,0.12);
  padding-top: 16px;
}
.s10-quote {
  font-size: clamp(19px, 2.6vw, 30px);
  font-weight: 300; font-style: italic;
  color: #fff; line-height: 1.75;
  letter-spacing: -0.01em; margin: 0 0 10px; padding: 0;
  text-shadow: 0 2px 24px rgba(0,0,0,0.6);
}
.s10-sub {
  font-size: 10px; font-weight: 700;
  color: rgba(255,255,255,0.28);
  letter-spacing: 0.18em; text-transform: uppercase; margin: 0;
}

/* Disclaimer legal text above nav bar */
.s10-disclaimer {
  font-size: clamp(13px, 1.4vw, 15px);
  line-height: 1.6;
  color: rgba(255,255,255,0.62);
  text-align: center;
  max-width: 760px;
  margin: 32px auto 0;
  padding: 0 16px;
}

/* Navigation — anchored to bottom via margin-top: auto */
.s10-nav-bar { margin-top: auto; }

@media(max-width:700px){
  #s10.s10-hero  { padding: 0 24px; }
  .s10-resources { grid-template-columns: 1fr; gap: 8px; }
  .s10-closing   { margin-top: 40px; }
}

/* ══════════════════════════════════════════════════════════════
   WATERMARK — LH Head · centrada, única regla per a totes
   light PNG → slides fosques  |  dark PNG → slides clares
   Portada (slide 00) exclosa.
   ══════════════════════════════════════════════════════════════ */

/* ── Base compartida: posició, mida i efectes ──────────────── */
#s1::before, #s2::before, #s3::before, #s4::before, #s5::before,
#s6::before, #s7::before, #s8::before, #s9::before, #s10::before {
  content: '';
  position: absolute;
  pointer-events: none;
  z-index: 0;
  /* centrada horitzontalment, baixada per evitar el títol */
  left: 50%; top: 59%;
  transform: translate(-50%, -50%);
  /* mida gran, estable en responsive */
  width: 46%;
  min-width: 260px;
  aspect-ratio: 1 / 1;
  height: auto;
  background-repeat: no-repeat;
  background-size: contain;
  background-position: center;
  /* dissolució suau als marges */
  -webkit-mask-image: radial-gradient(circle, rgba(0,0,0,0.75) 32%, transparent 68%);
  mask-image:         radial-gradient(circle, rgba(0,0,0,0.75) 32%, transparent 68%);
  filter: blur(0.5px);
}

/* ── Slides fosques → cap blanc ────────────────────────────── */
#s2::before, #s4::before, #s6::before,
#s8::before, #s9::before {
  background-image: url('assets/watermarks/lh-head-watermark-light.png');
  opacity: 0.10;
}

/* S10 necessita z-index superior al seu layer d'imatge de fons */
#s10::before {
  background-image: url('assets/watermarks/lh-head-watermark-light.png');
  opacity: 0.10;
  z-index: 1;
}

/* ── Slides clares → cap fosc ──────────────────────────────── */
#s1::before, #s3::before, #s5::before, #s7::before {
  background-image: url('assets/watermarks/lh-head-watermark-dark.png');
  opacity: 0.08;
}

/* ── Responsive: en mòbil redueix lleument per no cobrir tot── */
@media (max-width: 600px) {
  #s1::before, #s2::before, #s3::before, #s4::before, #s5::before,
  #s6::before, #s7::before, #s8::before, #s9::before, #s10::before {
    width: 72%;
    min-width: 180px;
  }
}

/* ══════════════════════════════════════════════════════════════
   PARTNER MODAL
   ══════════════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0; z-index: 1100;
  background: rgba(0,0,0,0.65); backdrop-filter: blur(6px);
  display: none; align-items: center; justify-content: center;
  padding: 24px;
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: #fff; border-radius: 24px;
  max-width: 420px; width: 100%;
  box-shadow: 0 40px 80px rgba(0,0,0,0.22);
  animation: fadeUp 0.3s both;
  overflow: hidden;
  position: relative;
}

/* X close button — top-right corner */
.modal-x-close {
  position: absolute; top: 14px; right: 14px; z-index: 2;
  width: 30px; height: 30px; border-radius: 50%;
  border: none; background: rgba(0,0,0,0.08); cursor: pointer;
  font-size: 13px; color: #475569;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.18s;
}
.modal-x-close:hover { background: rgba(0,0,0,0.15); }

/* Logo banner at top */
.modal-logo-wrap {
  display: flex; align-items: center; justify-content: center;
  padding: 28px 36px 22px;
  background: #f8fafc;
  border-bottom: 1px solid #f1f5f9;
}
.modal-logo-img {
  height: 54px; width: auto; max-width: 220px;
  object-fit: contain; display: block;
}
/* Altea i Molfetta tenen logos amb més detall — els fem més grans */
#partner-modal[data-partner="altea"] .modal-logo-img {
  height: 76px; max-width: 260px;
}
#partner-modal[data-partner="molfetta"] .modal-logo-img {
  height: 96px; max-width: 280px;
}

/* Body content */
.modal-body { padding: 22px 28px 28px; }
.modal-header-row {
  display: flex; align-items: center; gap: 10px; margin-bottom: 10px;
}
.modal-name { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; color: #1e293b; }
.modal-role {
  font-size: 11px; font-weight: 600; letter-spacing: 0.02em;
  text-transform: none; color: #fff;
  padding: 3px 10px; border-radius: 6px;
  display: inline-block; flex-shrink: 0;
  opacity: 0.90;
}
.modal-country {
  display: flex; align-items: center; gap: 6px; margin-bottom: 10px;
}
.modal-country-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: #94a3b8; }
.modal-country-val { font-size: 13px; font-weight: 600; color: #475569; }
.modal-org { font-size: 13px; font-weight: 700; margin-bottom: 8px; }
.modal-desc { font-size: 13px; color: #64748b; line-height: 1.70; margin-bottom: 18px; }

/* Links */
.modal-links { display: flex; flex-direction: column; gap: 7px; }
.modal-link {
  display: flex; align-items: center; gap: 6px;
  padding: 9px 14px; border-radius: 10px;
  background: #f1f5f9; border: 1px solid #e2e8f0;
  color: var(--primary); text-decoration: none;
  font-size: 13px; font-weight: 600;
  transition: background 0.18s, color 0.18s, border-color 0.18s;
}
.modal-link:hover {
  background: var(--accent); color: var(--text-main); border-color: var(--accent);
}

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE ADJUSTMENTS
   ══════════════════════════════════════════════════════════════ */
@media(max-width:768px){
  .slide { padding: 88px 24px 64px; }
  .slide-header { gap: 16px; }
  .steps-timeline { flex-direction: row; flex-wrap: wrap; padding-left: 0; }
  .tl-line { display: none; }
  .tl-step { padding: 5px 10px; }
  /* Portada */
  .cover-photo { background-position: center 20%; }
  .cover-inner { padding: 12px 0 20px; }
  /* flex-start: badge always starts from padding-top, never pushed up by centering */
  .slide-cover { justify-content: flex-start; padding-bottom: 130px; }
  .cover-mark-logo { width: clamp(140px, 36vw, 190px); margin: 14px auto; }
  .cover-title { margin-bottom: 4px; }
  .cover-title-sub { font-size: clamp(17px, 4.4vw, 30px); margin-bottom: 14px; }
  .cover-cta { padding: 14px 28px; font-size: 15px; }
  .cover-erasmus-badge { padding: 9px 18px; margin-bottom: 16px; }
  .cover-erasmus-hero { width: clamp(110px, 28vw, 160px); }
  .cover-project-nr { font-size: clamp(10px, 2.6vw, 13px); margin-top: 7px; margin-bottom: 7px; }
  /* Logos strip */
  .cover-logos-strip { padding: 10px 24px; padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px)); }
  .cover-logos-group { padding: 0 20px; }
  .cover-logo { height: 26px; }
  .cover-logo-eu  { height: 30px !important; }
  .cover-logo-lead  { height: 32px; }
  .cover-logo-puglia { height: 30px; }
  .cover-logo-altea { height: 26px; }
  .cover-logo-minor { height: 18px; }
  .cover-logo-eschool { height: 18px; }
  .cover-logos-sep-v { height: 34px; }
  /* Modal partner */
  .modal-logo-wrap { padding: 20px 28px 16px; }
  .modal-logo-img { height: 44px; }
  #partner-modal[data-partner="altea"]   .modal-logo-img { height: 60px; max-width: 200px; }
  #partner-modal[data-partner="molfetta"] .modal-logo-img { height: 74px; max-width: 220px; }
  .modal-body { padding: 16px 20px 20px; }
  /* Slide 10 */
  #s10.s10-hero { padding-bottom: 130px; }
}
@media(max-width:480px){
  .slide { padding: 80px 16px 56px; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  /* Portada */
  .cover-inner { padding: 8px 0 16px; }
  .slide-cover { padding-bottom: 180px; }
  .cover-mark-logo { width: clamp(120px, 32vw, 160px); margin: 12px auto; }
  .cover-title { margin-bottom: 3px; }
  .cover-title-sub { font-size: clamp(14px, 4vw, 24px); letter-spacing: -0.015em; margin-bottom: 10px; }
  .cover-cta { padding: 13px 22px; font-size: 14px; }
  .cover-erasmus-badge { padding: 7px 14px; margin-bottom: 12px; border-radius: 10px; }
  .cover-erasmus-hero { width: clamp(90px, 24vw, 135px); }
  .cover-project-nr { font-size: 10px; letter-spacing: 0.01em; margin-top: 5px; margin-bottom: 5px; }
  /* Logos strip */
  .cover-logos-strip { flex-wrap: wrap; gap: 10px 0; padding: 10px 16px; padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px)); }
  .cover-logos-group { padding: 0 12px; }
  .cover-logos-sep-v { display: none; }
  .cover-logo { height: 22px; }
  .cover-logo-eu  { height: 24px !important; }
  .cover-logo-lead  { height: 28px; }
  .cover-logo-puglia { height: 26px; }
  .cover-logo-altea { height: 22px; }
  .cover-logo-minor { height: 16px; }
  .cover-logo-eschool { height: 16px; top: 0; }
  .cover-logos-row { gap: 12px; }
  /* Modal partner */
  .modal-overlay { padding: 12px; }
  .modal-box { border-radius: 14px; }
  .modal-logo-wrap { padding: 16px 20px 12px; }
  .modal-logo-img { height: 36px; }
  #partner-modal[data-partner="altea"]   .modal-logo-img { height: 48px; max-width: 160px; }
  #partner-modal[data-partner="molfetta"] .modal-logo-img { height: 60px; max-width: 180px; }
  .modal-body { padding: 14px 16px 18px; }
  .modal-name { font-size: 17px; }
  .modal-desc { font-size: 12px; }
  /* Slide 03 */
  .s3-phone-frame { height: 500px; } /* manté proporcions de telèfon en mòbil petit */
  .s3-qr-wrap { height: 200px; }
  /* Slide 10 */
  #s10.s10-hero { padding-bottom: 210px; }
  .s10-nav-bar { flex-wrap: wrap; gap: 8px; }
}

/* ── Slide 04: portrait image stacks to full width on mobile ── */
@media(max-width:860px){
  .step-detail-img-wrap.portrait { width: 100%; }
  /* Portrait (vertical) images: override both base and 860px height rules */
  #s4 .step-detail-img-wrap.portrait .step-detail-img {
    height: auto !important;
    max-height: 460px;
    object-fit: contain;
    object-position: center;
  }
}

/* ── Slide 02: correccions de posició dels markers NOMÉS en mòbil estret ── */
/* Recalculats per a aspect-ratio 4:3: top_mobil = top_desktop × (9/16)/(3/4) = top × 0.75 */
/* Usa IDs per vèncer els style="" inline. No afecta desktop ni tablet.                      */
@media(max-width:560px){
  /* Glow blobs */
  #cg-altea    { left: 32%   !important; top: 66%   !important; }
  #cg-molfetta { left: 54%   !important; top: 55%   !important; }
  #cg-karditsa { left: 81%   !important; top: 61%   !important; }
  /* Markers */
  #mk-altea    { left: 32%   !important; top: 66%   !important; }
  #mk-molfetta { left: 54%   !important; top: 55%   !important; }
  #mk-karditsa { left: 81%   !important; top: 61%   !important; }
}
