/* ==========================================================
   Anem de Festa · full d'estils
   Paleta inspirada en l'autobús groc i els llapis de colors
   ========================================================== */
:root {
  --groc: #FFC21A;     /* autobús */
  --vermell: #E8352E;  /* llapis vermell */
  --verd: #2FA44F;     /* gespa */
  --blau: #2C6FE0;     /* cel */
  --raim: #6A3FB5;     /* llapis lila */
  --tinta: #1D1A3A;    /* text */
  --cel-clar: #EAF2FF;
  --blanc: #FFFFFF;

  --display: "Bagel Fat One", "Arial Rounded MT Bold", system-ui, sans-serif;
  --text: "Bricolage Grotesque", system-ui, -apple-system, "Segoe UI", sans-serif;

  --wrap: 1180px;
  --pad: clamp(1rem, 4vw, 2.5rem);
  --sec: clamp(4rem, 9vw, 7.5rem);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0;
  font-family: var(--text);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--tinta);
  background: var(--blanc);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.05; }
h2 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2.1rem, 5.2vw, 3.6rem);
  letter-spacing: -0.01em;
  max-width: 20ch;
  text-wrap: balance;
  hyphens: manual;
}
h3 { font-size: 1.2rem; font-weight: 800; }
p { margin: 0; }

.wrap { width: min(var(--wrap), 100% - 2 * var(--pad)); margin-inline: auto; }

:focus-visible { outline: 3px solid var(--blau); outline-offset: 3px; border-radius: 6px; }

.skip {
  position: absolute; left: -999px; top: 8px; z-index: 100;
  background: var(--tinta); color: #fff; padding: .6rem 1rem; border-radius: 8px;
}
.skip:focus { left: 8px; }

/* ---------- Botons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .55rem;
  padding: .95rem 1.4rem;
  border-radius: 999px;
  font-weight: 800; font-size: 1rem; text-decoration: none;
  border: 3px solid var(--tinta);
  transition: transform .15s ease, box-shadow .15s ease;
  box-shadow: 4px 4px 0 var(--tinta);
}
.btn:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--tinta); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--tinta); }
.btn svg { width: 1.25em; height: 1.25em; fill: currentColor; }
.btn--wa { background: #25D366; color: var(--tinta); }
.btn--ghost { background: var(--blanc); color: var(--tinta); }
.btn--dark { background: var(--tinta); color: #fff; box-shadow: 4px 4px 0 var(--groc); }
.btn--dark:hover { box-shadow: 6px 6px 0 var(--groc); }
.btn--dark svg { fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.btn--light { background: var(--blanc); color: var(--tinta); border-color: var(--blanc); box-shadow: 4px 4px 0 var(--groc); }
.btn--light:hover { box-shadow: 6px 6px 0 var(--groc); }
.btn--small { padding: .55rem 1.1rem; font-size: .95rem; box-shadow: 3px 3px 0 var(--tinta); }

/* ---------- Navegació ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .7rem var(--pad);
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(10px);
  border-bottom: 3px solid transparent;
  transition: border-color .2s;
}
.nav.is-scrolled { border-bottom-color: var(--tinta); }
.nav__brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; }
.nav__brand img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; border: 3px solid var(--tinta); }
.nav__brand span { font-family: var(--display); font-size: 1.35rem; }
.nav__menu { display: flex; align-items: center; gap: 1.6rem; }
.nav__menu a:not(.btn) { text-decoration: none; font-weight: 600; position: relative; }
.nav__menu a:not(.btn)::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 3px;
  background: var(--vermell); border-radius: 3px; transform: scaleX(0); transition: transform .2s;
}
.nav__menu a:not(.btn):hover::after { transform: scaleX(1); }
.nav__toggle { display: none; }

@media (max-width: 860px) {
  .nav__toggle {
    display: grid; gap: 5px; width: 46px; height: 46px; place-content: center;
    border: 3px solid var(--tinta); border-radius: 12px; background: var(--groc); cursor: pointer;
  }
  .nav__toggle span { width: 20px; height: 3px; background: var(--tinta); border-radius: 2px; transition: transform .2s, opacity .2s; }
  .nav__toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
  .nav__toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .nav__toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }
  .nav__menu {
    position: fixed; inset: 70px 0 auto 0;
    flex-direction: column; align-items: flex-start; gap: 1.1rem;
    padding: 1.5rem var(--pad) 2rem;
    background: var(--blanc); border-bottom: 3px solid var(--tinta);
    font-size: 1.25rem;
    transform: translateY(-120%); visibility: hidden;
    transition: transform .25s ease, visibility .25s;
  }
  .nav__menu.is-open { transform: none; visibility: visible; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: min(92vh, 900px);
  display: grid;
  grid-template-rows: 1fr auto auto;
  grid-template-columns: minmax(0, 1fr);
  overflow: hidden;
  background: var(--blanc);
  isolation: isolate;
}
.hero__sun {
  position: absolute; z-index: -1;
  width: 150vmax; height: 150vmax;
  left: 50%; top: 48%;
  translate: -50% -50%;
  background: repeating-conic-gradient(from 0deg, #FFF4D1 0deg 9deg, #fff 9deg 18deg);
  mask-image: radial-gradient(circle, #000 18%, transparent 55%);
  -webkit-mask-image: radial-gradient(circle, #000 18%, transparent 55%);
  animation: gira 90s linear infinite;
}
@keyframes gira { to { rotate: 360deg; } }

.hero__inner {
  align-self: center;
  text-align: center;
  padding: clamp(2.5rem, 6vw, 4rem) var(--pad) 1rem;
}
.hero__kicker {
  display: inline-block;
  font-weight: 800; font-size: 1.05rem;
  background: var(--tinta); color: #fff;
  padding: .35rem 1rem; border-radius: 999px;
  rotate: -2deg;
  margin-bottom: 1.2rem;
}
.hero__title {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(4.2rem, 15.5vw, 12.5rem);
  line-height: .86;
  letter-spacing: -0.02em;
}
.hero__line { display: block; }
.hero__title .ch {
  display: inline-block;
  color: var(--c);
  -webkit-text-stroke: .045em var(--tinta);
  paint-order: stroke fill;
  text-shadow: .045em .055em 0 var(--tinta);
  transform-origin: 50% 90%;
}
.hero__title .ch.sp { width: .28em; }
.hero__title .ch:hover { animation: boing .5s ease; }
@keyframes boing {
  30% { transform: translateY(-.12em) rotate(-6deg) scale(1.08); }
  60% { transform: translateY(.02em) rotate(3deg); }
}
.hero__lead {
  max-width: 36ch; margin: 1.6rem auto 0;
  font-size: clamp(1.1rem, 2.1vw, 1.35rem);
  font-weight: 600;
}
.hero__cta { display: flex; flex-wrap: wrap; justify-content: center; gap: 1rem; margin-top: 2rem; }

.hero__road {
  position: relative;
  height: clamp(110px, 16vw, 170px);
  margin-top: 1rem;
}
.hero__bus {
  position: absolute; bottom: -8px; left: 50%;
  width: clamp(130px, 18vw, 200px);
  margin-left: calc(clamp(130px, 18vw, 200px) / -2);
  mix-blend-mode: multiply;
  animation: arriba 2.2s cubic-bezier(.2,.7,.25,1) .2s both, sacseja .9s ease-in-out 2.4s infinite;
}
@keyframes arriba {
  from { transform: translateX(-75vw) rotate(-3deg); }
  80% { transform: translateX(2vw) rotate(1deg); }
  to { transform: translateX(0) rotate(0); }
}
@keyframes sacseja {
  50% { transform: translateY(-3px) rotate(-.8deg); }
}

/* Llapis de colors (homenatge a la capçalera original) */
.pencils {
  display: flex; align-items: flex-end;
  height: 64px;
  margin-top: 8px;
  overflow: hidden;
}
.pencils i {
  flex: 1 0 34px;
  height: var(--h, 56px);
  background: var(--c);
  clip-path: polygon(0 100%, 0 32%, 50% 0, 100% 32%, 100% 100%);
  position: relative;
}
.pencils i::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(transparent 0 32%, rgba(255,255,255,.18) 32% 40%, transparent 40%),
              linear-gradient(90deg, rgba(0,0,0,.08) 0 30%, transparent 30% 70%, rgba(0,0,0,.08) 70%);
}

/* Entrada orquestrada del títol */
.js .hero__title .ch { opacity: 0; transform: translateY(.4em) scale(.6); }
.js .is-ready .hero__title .ch {
  opacity: 1; transform: none;
  transition: opacity .35s ease, transform .55s cubic-bezier(.3,1.6,.5,1);
  transition-delay: calc(var(--i) * 55ms + 1.3s);
}

/* ---------- L'espai ---------- */
.espai {
  background: var(--groc);
  padding-block: var(--sec);
  border-block: 3px solid var(--tinta);
}
.espai__intro { display: grid; grid-template-columns: 1.4fr 1fr; gap: 2rem; align-items: end; margin-bottom: 3rem; }
.espai__intro p { font-size: 1.25rem; font-weight: 600; max-width: 30ch; }

.bento {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: minmax(190px, auto);
  grid-template-areas:
    "hero hero foto clima"
    "hero hero alim bany"
    "taul tron adap bany";
  gap: 1.1rem;
}
.tile {
  margin: 0;
  border: 3px solid var(--tinta);
  border-radius: 22px;
  background: var(--blanc);
  overflow: hidden;
  box-shadow: 6px 6px 0 var(--tinta);
  position: relative;
}
.tile--hero { grid-area: hero; border-radius: 34px; }
.bento > :nth-child(2) { grid-area: foto; }
.bento > :nth-child(3) { grid-area: clima; }
.bento > :nth-child(4) { grid-area: alim; }
.bento > :nth-child(5) { grid-area: bany; }
.bento > :nth-child(6) { grid-area: taul; }
.bento > :nth-child(7) { grid-area: tron; }
.bento > :nth-child(8) { grid-area: adap; }

.tile--photo img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.tile figcaption {
  position: absolute; left: .8rem; right: .8rem; bottom: .8rem;
  background: var(--blanc);
  border: 3px solid var(--tinta);
  border-radius: 14px;
  padding: .6rem .9rem;
  font-size: .98rem; line-height: 1.35;
}
.tile figcaption strong { display: block; font-size: 1.05rem; }
.tile--photo figcaption { right: auto; }
.tile--photo figcaption strong { display: inline; }
/* Peça principal: el parc de boles, amb boles de colors al fons */
.tile--hero {
  display: flex; flex-direction: column; align-items: flex-start;
  padding: clamp(1.5rem, 3vw, 2.4rem);
  color: #fff;
  background:
    radial-gradient(circle at 88% 14%, var(--groc) 0 22px, transparent 23px),
    radial-gradient(circle at 74% 30%, var(--verd) 0 15px, transparent 16px),
    radial-gradient(circle at 93% 40%, var(--blanc) 0 11px, transparent 12px),
    radial-gradient(circle at 12% 88%, var(--raim) 0 26px, transparent 27px),
    radial-gradient(circle at 26% 96%, var(--groc) 0 14px, transparent 15px),
    radial-gradient(circle at 4% 70%, var(--blau) 0 12px, transparent 13px),
    var(--vermell);
}
.tile--hero h3 {
  font-family: var(--display); font-weight: 400;
  font-size: clamp(2rem, 3.6vw, 3rem); line-height: 1;
  max-width: 11ch;
}
.tile--hero p { margin-top: .7rem; font-size: 1.15rem; font-weight: 600; max-width: 26ch; }
.tile--hero img {
  margin-top: auto; align-self: flex-end;
  width: min(300px, 78%); aspect-ratio: 4 / 3; object-fit: cover;
  border: 6px solid #fff; outline: 3px solid var(--tinta);
  border-radius: 6px;
  rotate: 3deg;
  box-shadow: 6px 6px 0 var(--tinta);
  translate: 0 .4rem;
}

.tile--feat { padding: 1.4rem; color: #fff; display: flex; flex-direction: column; gap: .4rem; }
.tile--feat svg {
  width: 46px; height: 46px; margin-bottom: auto;
  fill: none; stroke: currentColor; stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round;
}
.tile--feat h3 { margin-top: 1.2rem; font-size: 1.3rem; }
.tile--feat p { font-size: .98rem; opacity: .95; }
.tile--blue { background: var(--blau); }
.tile--green { background: var(--verd); }
.tile--red { background: var(--vermell); }
.tile--grape { background: var(--raim); }
.tile--sky { background: var(--blanc); color: var(--tinta); }

/* ---------- Galeria ---------- */
.galeria { padding-block: var(--sec); background: var(--blanc); }
.galeria__sub { margin-top: .8rem; font-size: 1.1rem; }
.polaroids {
  list-style: none; padding: 0; margin: 3rem 0 0;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 2.2rem 1.8rem;
}
.polaroid {
  all: unset;
  cursor: zoom-in;
  display: block;
  background: #fff;
  padding: .7rem .7rem 0;
  border: 3px solid var(--tinta);
  box-shadow: 6px 6px 0 var(--c, var(--groc));
  rotate: var(--r, -2deg);
  transition: rotate .2s ease, scale .2s ease;
}
.polaroid:hover, .polaroid:focus-visible { rotate: 0deg; scale: 1.04; }
.polaroid:focus-visible { outline: 3px solid var(--blau); outline-offset: 6px; }
.polaroid img { width: 250px; height: 190px; object-fit: cover; background: var(--cel-clar); }
.polaroid span { display: block; font-family: var(--display); font-size: 1.3rem; text-align: center; padding: .55rem 0 .7rem; }
.polaroids li:nth-child(1) .polaroid { --r: -3deg; --c: var(--vermell); }
.polaroids li:nth-child(2) .polaroid { --r: 2deg;  --c: var(--groc); }
.polaroids li:nth-child(3) .polaroid { --r: -1.5deg; --c: var(--verd); }
.polaroids li:nth-child(4) .polaroid { --r: 3deg;  --c: var(--blau); }
.polaroids li:nth-child(5) .polaroid { --r: -2.5deg; --c: var(--raim); }
.polaroids li:nth-child(6) .polaroid { --r: 1.5deg; --c: var(--vermell); }

.lightbox {
  border: 3px solid var(--tinta); border-radius: 18px; padding: 0;
  max-width: none; max-height: none; overflow: visible; background: #fff;
}
.lightbox::backdrop { background: rgba(29,26,58,.82); }
.lightbox img {
  width: min(92vw, 1100px); height: auto;
  max-width: none; max-height: 86vh;
  object-fit: contain; border-radius: 15px;
}
.lightbox__close {
  position: absolute; top: -18px; right: -18px;
  width: 44px; height: 44px; border-radius: 50%;
  border: 3px solid var(--tinta); background: var(--groc);
  font-size: 1.6rem; line-height: 1; cursor: pointer; font-weight: 800;
}

/* ---------- Com reservar ---------- */
.reserva { background: var(--blau); color: #fff; padding-block: var(--sec); border-block: 3px solid var(--tinta); }
.steps {
  list-style: none; padding: 0; margin: 3rem 0 0;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem;
  counter-reset: none;
}
.steps li { position: relative; padding-top: 1rem; }
.steps li:not(:last-child)::after {
  content: ""; position: absolute; top: 2.9rem; left: 5.2rem; right: -1rem;
  border-top: 4px dashed rgba(255,255,255,.55);
}
.steps__n {
  display: grid; place-items: center;
  width: 4rem; height: 4rem; border-radius: 50%;
  background: var(--groc); color: var(--tinta);
  border: 3px solid var(--tinta); box-shadow: 4px 4px 0 var(--tinta);
  font-family: var(--display); font-size: 2rem;
  margin-bottom: 1.2rem; position: relative; z-index: 1;
}
.steps h3 { font-size: 1.45rem; margin-bottom: .45rem; }
.steps p { max-width: 30ch; }
.steps a { color: var(--groc); font-weight: 800; white-space: nowrap; }

/* ---------- Normativa ---------- */
.normativa { padding-block: var(--sec); background: var(--cel-clar); }
.normativa__grid { display: grid; grid-template-columns: 1fr 1.5fr; gap: clamp(2rem, 5vw, 4.5rem); align-items: start; }
.normativa__intro { position: sticky; top: 110px; }
.normativa__intro p { margin: 1rem 0 1.8rem; font-size: 1.15rem; max-width: 34ch; }
.rules { list-style: none; padding: 0; margin: 0; display: grid; gap: .9rem; }
.rules li {
  display: grid; grid-template-columns: 3rem 1fr; gap: 1rem; align-items: start;
  background: #fff; border: 3px solid var(--tinta); border-radius: 18px;
  padding: 1rem 1.2rem;
}
.rules__ic {
  display: grid; place-items: center; width: 3rem; height: 3rem;
  background: var(--groc); border-radius: 50%; font-size: 1.45rem; border: 3px solid var(--tinta);
}
.rules li:nth-child(2n) .rules__ic { background: #FFD9D7; }
.rules li:nth-child(3n) .rules__ic { background: #D5F2DE; }

/* ---------- Contacte ---------- */
.contacte { background: var(--tinta); color: #fff; padding-block: var(--sec); text-align: center; }
.contacte h2 { margin-inline: auto; }
.contacte__lead { max-width: 44ch; margin: 1rem auto 0; font-size: 1.2rem; opacity: .9; }
.contacte__phone {
  display: inline-block;
  font-family: var(--display);
  font-size: clamp(3.2rem, 12vw, 8.5rem);
  line-height: 1;
  margin: 2rem 0 2.2rem;
  color: var(--groc);
  text-decoration: none;
  text-shadow: .05em .06em 0 var(--vermell);
  transition: transform .2s;
}
.contacte__phone:hover { transform: rotate(-2deg) scale(1.02); }
.contacte__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 1rem; }
.contacte .btn--wa { border-color: #fff; box-shadow: 4px 4px 0 var(--groc); }

/* ---------- Peu ---------- */
.footer { background: #fff; padding: 2.5rem 0 2rem; border-top: 3px solid var(--tinta); }
.footer__kids { width: min(560px, 90%); margin: 0 auto 1.5rem; mix-blend-mode: multiply; }
.footer__row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .6rem 1.5rem; font-size: .95rem; }
.footer a { text-decoration: none; font-weight: 600; }
.footer a:hover { text-decoration: underline; }

/* ---------- Botó flotant WhatsApp ---------- */
.fab {
  position: fixed; right: 18px; bottom: 18px; z-index: 40;
  width: 62px; height: 62px; border-radius: 50%;
  display: grid; place-items: center;
  background: #25D366; border: 3px solid var(--tinta); box-shadow: 4px 4px 0 var(--tinta);
  transition: transform .2s, opacity .3s;
}
.fab svg { width: 32px; height: 32px; fill: var(--tinta); }
.fab:hover { transform: scale(1.08) rotate(-6deg); }
.fab.is-hidden { opacity: 0; pointer-events: none; transform: scale(.6); }

.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 60; width: 100%; height: 100%; }

/* ---------- Vista prèvia privada (contrasenya) ---------- */
/* Mentre <html> té .gate-locked, s'amaga tota la web i només es veu la pantalla de contrasenya */
html.gate-locked body > *:not(.preview-gate) { display: none !important; }
html.gate-locked { overflow: hidden; }

.preview-gate {
  display: none;
  position: fixed; inset: 0; z-index: 1000;
  align-items: center; justify-content: center;
  padding: 20px;
  background: var(--groc);
}
html.gate-locked .preview-gate { display: flex; }
.preview-gate-box {
  background: #fff;
  border: 3px solid var(--tinta);
  border-radius: 22px;
  box-shadow: 8px 8px 0 var(--tinta);
  padding: 36px 32px;
  max-width: 380px; width: 100%;
  text-align: center;
}
.preview-gate-logo {
  width: 84px; height: 84px; margin: 0 auto 16px;
  border-radius: 50%; object-fit: cover; border: 3px solid var(--tinta);
}
.preview-gate-title { font-family: var(--display); font-size: 2rem; line-height: 1; margin: 0 0 10px; }
.preview-gate-desc { font-size: .95rem; margin: 0 0 20px; line-height: 1.5; }
.preview-gate-label { display: block; text-align: left; font-weight: 800; font-size: .9rem; margin-bottom: 6px; }
.preview-gate-box input[type="password"] {
  width: 100%; padding: 12px 14px; margin-bottom: 18px;
  font: inherit; font-size: 1rem;
  border: 3px solid var(--tinta); border-radius: 12px;
}
.preview-gate-btn { width: 100%; justify-content: center; cursor: pointer; font-family: inherit; }
.preview-gate-error { color: var(--vermell); font-weight: 600; font-size: .9rem; margin: 14px 0 0; }
.preview-gate-box.is-shake { animation: preview-gate-shake .35s; }
@keyframes preview-gate-shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .bento {
    grid-template-columns: repeat(2, 1fr);
    grid-template-areas:
      "hero hero"
      "hero hero"
      "foto clima"
      "alim bany"
      "taul bany"
      "tron adap";
  }
  .espai__intro { grid-template-columns: 1fr; }
  .normativa__grid { grid-template-columns: 1fr; }
  .normativa__intro { position: static; }
}
@media (max-width: 720px) {
  .steps { grid-template-columns: 1fr; gap: 2rem; }
  .steps li:not(:last-child)::after { display: none; }
  .polaroid img { width: min(78vw, 300px); height: auto; aspect-ratio: 4 / 3; }
}
@media (max-width: 520px) {
  .bento {
    grid-template-columns: 1fr;
    grid-auto-rows: auto;
    grid-template-areas: "hero" "foto" "clima" "alim" "bany" "taul" "tron" "adap";
  }
  .tile--hero { min-height: 0; }
  .tile--hero img { margin-top: 1.5rem; }
  .tile--photo { min-height: 260px; }
  .tile--tall { min-height: 420px; }
  .hero__cta .btn { width: 100%; justify-content: center; }
  .footer__row { flex-direction: column; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
  .js .hero__title .ch { opacity: 1; transform: none; }
}
