/* ── Portada (redisseny novembre 2026) ───────────────────────────
   Només la carrega index.html i tot va sota body.home, així que no toca
   les altres pàgines que fan servir main.css (fitxes, vols, guies…).
   Llenguatge: paper crema, titular gegant en Inter 800, globus al mig,
   micro-etiquetes en majúscules, botons en forma de píndola. */

body.home {
  --ink: #1a0a2e;
  --ink-2: rgba(26, 10, 46, .64);      /* text secundari: 4,9:1 sobre crema */
  --hair: rgba(26, 10, 46, .1);
  --coral-ink: #b8361a;                /* corall per a text petit: 5,2:1 */
  --gut: clamp(16px, 3.4vw, 48px);
  --font-display: 'Inter', sans-serif;
  background: var(--cream);
}
body.home::before { background: var(--cream); }

/* Títols de les seccions de sota, al mateix registre que el titular. */
body.home .how-inner h2,
body.home .trend-title,
body.home .essentials-section h2 {
  font-family: 'Inter', sans-serif;
  font-variation-settings: normal;
  font-weight: 800;
  letter-spacing: -.045em;
  line-height: 1;
}

/* ── Focus visible a tot arreu ─────────────────────────────────── */
body.home a:focus-visible,
body.home button:focus-visible,
body.home select:focus-visible,
body.home input:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
  border-radius: 999px;
}
body.home .rank-card:focus-visible,
body.home .trend-card:focus-visible,
body.home .ess-card:focus-visible { border-radius: 16px; }

/* ── Navbar ─────────────────────────────────────────────────────── */
body.home .navbar {
  background: rgba(250, 247, 244, 0);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-bottom: 1px solid transparent;
  padding: 0 var(--gut);
  transition: background .3s, border-color .3s;
}
body.home .navbar--scrolled {
  background: rgba(250, 247, 244, .88);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border-bottom-color: var(--hair);
  box-shadow: none;
}
body.home .logo { font-weight: 800; letter-spacing: -.05em; font-size: 1.45rem; }
body.home .nav-links { gap: clamp(1rem, 1.8vw, 1.75rem); }
body.home .nav-links a,
body.home .nav-links a:link,
body.home .nav-links a:visited {
  font-size: .7rem;
  font-weight: 650;
  letter-spacing: .11em;
  text-transform: uppercase;
  color: var(--ink-2) !important;
}
body.home .nav-links a:hover { color: var(--ink) !important; }
body.home .nav-ico { width: 13px; height: 13px; }
body.home .btn-signin {
  border-radius: 999px;
  border: 1px solid rgba(26, 10, 46, .22);
  background: transparent;
  font-weight: 600;
}
body.home .lang-select {
  height: 36px;
  background-color: transparent;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%231a0a2e' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .7rem center;
  color: var(--ink);
  border: 1px solid rgba(26, 10, 46, .22);
}
body.home .lang-select:hover { border-color: var(--ink); }

/* ── Peces comunes ──────────────────────────────────────────────── */
.hx-micro {
  font-size: .68rem;
  font-weight: 650;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--ink-2);
  line-height: 1.5;
}
.hx-num {
  display: inline-block;
  color: var(--coral-ink);
  margin-right: .55em;
  font-variant-numeric: tabular-nums;
}
.hx-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .7rem;
  height: 52px;
  padding: 0 .55rem 0 1.5rem;
  border-radius: 999px;
  font-size: .98rem;
  font-weight: 700;
  letter-spacing: -.015em;
  text-decoration: none;
  white-space: nowrap;
  transition: transform .18s ease, background .18s ease, color .18s ease, border-color .18s ease;
}
.hx-pill--primary { background: var(--ink); color: #fff; }
.hx-pill--primary:hover { transform: translateY(-2px); }
.hx-pill-ico {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--coral);
  color: #fff;
  transition: transform .25s ease;
}
.hx-pill-ico svg { width: 17px; height: 17px; }
.hx-pill--primary:hover .hx-pill-ico { transform: rotate(-45deg); }
/* Secundari: la cerca de vols hi és, però no competeix amb el matcher. */
.hx-pill--ghost {
  padding: 0 1rem;
  border: 1px solid transparent;
  color: var(--ink);
  background: transparent;
  gap: .5rem;
}
.hx-pill--ghost span { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.hx-pill--ghost:hover { border-color: rgba(26, 10, 46, .25); }
.hx-pill--ghost svg { width: 17px; height: 17px; }

/* ── Hero ───────────────────────────────────────────────────────── */
.hx {
  --p: 0;
  --fs: 13.6vw;
  --gd: min(38vw, 560px, calc(100svh - 330px));
  position: relative;
  min-height: min(100svh, 1000px);
  padding: 80px var(--gut) clamp(24px, 4vh, 44px);
  display: flex;
  flex-direction: column;
  overflow: clip;
  isolation: isolate;
}
.hx-corners {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding-top: 6px;
  opacity: calc(1 - var(--p) * 2);
}
.hx-corners .hx-micro { margin: 0; display: inline-flex; align-items: center; gap: .55em; }
.hx-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--coral); display: inline-block; }

.hx-title {
  position: relative;
  z-index: 1;
  margin: clamp(10px, 2.4vh, 28px) 0 0;
  width: 100%;
  font-size: var(--fs);
  font-weight: 800;
  letter-spacing: -.06em;
  line-height: .8;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--ink);
  text-align: center;
}
.hx-title span { display: inline-block; }
.hx-l2 { margin-left: .14em; }
/* fit-content: home-globe.js mesura l'amplada real de cada línia. */
.hx-title.is-stacked .hx-l1,
.hx-title.is-stacked .hx-l2 { display: block; width: fit-content; margin: 0 auto; }
.hx-title.is-stacked .hx-l2 { margin-top: .04em; }

.hx-main {
  position: relative;
  z-index: 2;
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--gd) minmax(0, 1fr);
  align-items: end;
  gap: clamp(16px, 2.4vw, 40px);
  margin-top: calc(var(--fs) * -.3);
}

.hx-globe-box { position: relative; width: var(--gd); aspect-ratio: 1; align-self: start; }
.hx-globe { position: absolute; inset: 0; }
.hx-sphere {
  position: absolute; inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 30%, #3a2358 0%, #1f0d36 55%, #12061f 100%);
  box-shadow: 0 0 0 1px rgba(232, 77, 43, .12), 0 30px 60px -30px rgba(26, 10, 46, .45);
  transition: opacity .6s ease;
}
.hx-globe canvas {
  position: absolute;
  left: -15%; top: -15%;
  width: 130%; height: 130%;
  opacity: 0;
  transition: opacity .8s ease;
}
.hx-globe.is-ready canvas { opacity: 1; }
.hx-globe.is-ready .hx-sphere { opacity: 0; }

/* Etiqueta del millor destí: segueix el punt del globus. */
.hx-pin {
  position: absolute;
  left: 0; top: 0;
  z-index: 3;
  text-decoration: none;
  pointer-events: none;
  opacity: 0;
  transition: opacity .3s ease;
}
.hx-pin.is-on { opacity: 1; pointer-events: auto; }
.hx-pin-card {
  position: absolute;
  left: 14px; bottom: 14px;
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .5rem .9rem .5rem .55rem;
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 10px 30px -8px rgba(26, 10, 46, .45);
  white-space: nowrap;
}
.hx-pin-flag { font-size: 1.35rem; line-height: 1; }
.hx-pin-txt { display: flex; flex-direction: column; line-height: 1.15; }
.hx-pin-name { font-weight: 800; font-size: .92rem; letter-spacing: -.02em; }
.hx-pin-meta { font-size: .72rem; font-weight: 600; color: var(--ink-2); }
.hx-pin-kick { font-size: .58rem; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; color: var(--coral-ink); }

.hx-intro { align-self: end; max-width: 380px; }
.hx-sub {
  font-size: clamp(1rem, 1.15vw, 1.12rem);
  line-height: 1.45;
  color: var(--ink);
  letter-spacing: -.01em;
  margin: 0 0 1.3rem;
}
.hx-ctas { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }

.hx-facts {
  list-style: none;
  align-self: end;
  justify-self: end;
  text-align: right;
  display: grid;
  gap: 1.1rem;
  margin: 0;
}
.hx-facts li { display: grid; gap: .25rem; }
.hx-facts .hx-micro { margin: 0; }
.hx-facts strong { font-size: 1rem; font-weight: 700; letter-spacing: -.02em; }

/* Scroll: el titular es queda enrere, el globus s'acosta. */
@media (prefers-reduced-motion: no-preference) {
  .hx-title { transform: translate3d(0, calc(var(--p) * 14vh), 0); will-change: transform; }
  .hx-globe { transform: translate3d(0, calc(var(--p) * -3vh), 0) scale(calc(1 + var(--p) * .2)); will-change: transform; }
  .hx-intro, .hx-facts { opacity: calc(1 - var(--p) * 1.6); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* Tauleta: tot en columna, globus al mig. */
@media (max-width: 1000px) {
  .hx { --gd: min(72vw, 560px); min-height: 0; }
  .hx-main {
    grid-template-columns: 1fr 1fr;
    grid-template-areas: "globe globe" "intro facts";
    row-gap: 2rem;
  }
  .hx-globe-box { grid-area: globe; justify-self: center; }
  .hx-intro { grid-area: intro; }
  .hx-facts { grid-area: facts; }
}

/* Mòbil */
@media (max-width: 640px) {
  .hx { --fs: 26.3vw; --gd: min(80vw, 400px); padding-top: 76px; }
  .hx-title { margin-top: 14px; }
  .hx-main {
    grid-template-columns: 1fr;
    grid-template-areas: "globe" "intro" "facts";
    row-gap: 1.6rem;
    margin-top: calc(var(--fs) * -.24);
  }
  .hx-intro { max-width: none; }
  .hx-sub { font-size: 1.02rem; }
  .hx-pill { flex: 1 1 auto; }
  .hx-pill { height: 50px; font-size: .92rem; padding-left: 1.1rem; }
  .hx-pill--ghost { padding: 0 .9rem; border-color: rgba(26, 10, 46, .25); }
  .hx-pill--ghost span { text-decoration: none; }
  .hx-facts { justify-self: stretch; text-align: left; grid-template-columns: 1fr 1fr; gap: .9rem; border-top: 1px solid var(--hair); padding-top: 1rem; }
  .hx-facts strong { font-size: .88rem; }
  .hx-pin-card { left: -60px; bottom: 16px; }
}

/* ── Capçalera de secció (matcher, vols) ────────────────────────── */
.hx-sec-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: .5rem 2rem;
  padding: clamp(56px, 9vh, 110px) 0 clamp(20px, 3vh, 32px);
  border-bottom: 1px solid var(--hair);
  margin-bottom: clamp(18px, 2.6vh, 28px);
}
.hx-sec-head .hx-micro { margin: 0; grid-column: 1 / -1; }
.hx-h2 {
  margin: 0;
  font-size: clamp(2.1rem, 5.6vw, 5rem);
  font-weight: 800;
  letter-spacing: -.055em;
  line-height: .92;
  color: var(--ink);
  max-width: 15ch;
}
.hx-sec-note { justify-self: end; text-align: right; max-width: 30ch; }
@media (max-width: 760px) {
  .hx-sec-head { grid-template-columns: 1fr; }
  .hx-sec-note { justify-self: start; text-align: left; }
}

/* ── Matcher (filtres + mapa + llistes) ─────────────────────────── */
body.home .explore-wrap {
  max-width: 1480px;
  padding: 0 var(--gut) clamp(56px, 8vh, 96px);
  scroll-margin-top: 0;
}
body.home .explore-wrap > .hx-sec-head { grid-column: 1 / -1; order: 0; }
body.home .explore-side,
body.home .filter-strip {
  background: #fff;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: 1px solid var(--hair);
  border-radius: 24px;
  box-shadow: none;
}
body.home .explore-side { top: 84px; }
body.home .explore-side .panel-rank-header {
  background: none;
  padding: 1.1rem 1.25rem .9rem;
  border-bottom: 1px solid var(--hair);
  margin: 0;
  border-radius: 24px 24px 0 0;
}
body.home .pr-title { font-size: .95rem; font-weight: 800; letter-spacing: -.025em; }
body.home .pr-sub { font-size: .66rem; font-weight: 650; letter-spacing: .11em; text-transform: uppercase; color: var(--ink-2); margin-top: .2rem; }
body.home .pr-dot--green { background: var(--coral); box-shadow: 0 0 0 4px rgba(232, 77, 43, .14); }
body.home .pr-dot--red { background: var(--ink); box-shadow: 0 0 0 4px rgba(26, 10, 46, .1); }

body.home .fbar-title { font-size: .68rem; font-weight: 700; letter-spacing: .13em; color: var(--ink-2); }
body.home .fpill {
  --fc: var(--coral-ink);
  --fc-bg: rgba(232, 77, 43, .07);
  --fc-shadow: transparent;
  height: 44px;
  border: 1px solid rgba(26, 10, 46, .18);
  background: transparent;
  box-shadow: none;
}
body.home .fpill:hover:not(.fpill--active):not(.fpill--open) {
  border-color: var(--ink);
  color: var(--ink);
  background: rgba(26, 10, 46, .03);
  box-shadow: none;
  transform: none;
}
body.home .fpill--open { background: var(--ink); border-color: var(--ink); box-shadow: none; transform: none; }
body.home .fpill--active:not(.fpill--open) { border-color: var(--coral); box-shadow: none; }
body.home .fpill--active.fpill--open { background: var(--coral-ink); border-color: var(--coral-ink); box-shadow: none; }
body.home .fpill-count { background: var(--coral); color: #fff; }
body.home .fpill--active .fpill-count { background: var(--coral); color: #fff; }
body.home .fpill--active.fpill--open .fpill-count { background: rgba(255, 255, 255, .3); }
body.home .filter-strip .fdrop { border-radius: 20px; box-shadow: 0 18px 40px -12px rgba(26, 10, 46, .25); border: 1px solid var(--hair); }
body.home .chip { height: 38px; border: 1px solid rgba(26, 10, 46, .16); color: var(--ink); background: transparent; }
body.home .chip:hover:not(.chip--active) { border-color: var(--ink); background: rgba(26, 10, 46, .03); }
body.home .chip--active { background: var(--ink); border-color: var(--ink); color: #fff; box-shadow: none; }
body.home .results-count-strip { color: var(--ink-2); font-size: .74rem; }
body.home .share-btn, body.home .reset-btn { border-radius: 999px; }

body.home .map-wrap #map { border-radius: 24px; border: 1px solid var(--hair); }
body.home .map-legend { border-radius: 999px; }

body.home .rank-card { border-radius: 14px; }
body.home .rank-card:hover { background: var(--cream); border-color: transparent; box-shadow: none; transform: none; }
body.home .rank-pos { color: rgba(26, 10, 46, .38); }
body.home .rank-name { font-weight: 750; letter-spacing: -.02em; }
body.home .rank-reason { color: var(--ink-2); }

/* ── Cerca de vols (ara secundària) ─────────────────────────────── */
.fx { padding: 0 var(--gut); max-width: 1480px; margin: 0 auto clamp(48px, 7vh, 88px); }
.fx .hx-sec-head { padding-top: clamp(24px, 4vh, 48px); }
.fx .hx-h2 { font-size: clamp(1.9rem, 4.2vw, 3.6rem); }
body.home .hsearch { margin: 0; padding: 0; max-width: none; }
body.home .hsearch-card {
  border-radius: 24px;
  border: 1px solid var(--hair);
  box-shadow: none;
  padding: .7rem .8rem .9rem;
}
body.home .hstab { border-radius: 999px; }
body.home .hstab-under { border-radius: 18px; border-width: 1px; }
body.home .hu-btn { border-radius: 999px; }
body.home .hsearch-results { padding: 0; max-width: none; }
#explore, #search { scroll-margin-top: 72px; }

/* ── Seccions de sota: mateix aire ──────────────────────────────── */
body.home .trending-section { background: transparent; border-top: 1px solid var(--hair); }
body.home .trend-card { border-radius: 22px; box-shadow: none; }
body.home .trend-card:hover { box-shadow: 0 20px 40px -16px rgba(26, 10, 46, .4); }
body.home .trend-all { background: var(--ink); }
body.home .trend-inner .section-label,
body.home .how-inner .section-label { color: var(--coral-ink); font-size: .68rem; letter-spacing: .13em; }
body.home .ess-card { border-radius: 20px; box-shadow: none; border: 1px solid var(--hair); }

/* Navbar a amplades mitjanes: els enllaços en majúscules ocupen més. */
body.home .nav-links a { white-space: nowrap; }
@media (max-width: 1180px) {
  body.home .nav-links a[href="#how"],
  body.home .nav-links a[href="#explore"] { display: none; }
  body.home .nav-ico { display: none; }
}
@media (max-width: 920px) {
  body.home .nav-links { display: none; }
}
