/* ================= FONTS ================= */
@font-face{
  font-family: 'Kapakana';
  src: url('fonts/Kapakana-Regular.ttf') format('truetype');
}

/* ================= RESET ================= */
*{ margin:0; padding:0; box-sizing:border-box; }

html, body{
  height:100%;
  background:#000;
  overflow-x:hidden;
}

/* ================= ANIMACIONS ================= */
@keyframes slideUpIn{
  0%   { transform: translate3d(0,110%,0); opacity:0; }
  60%  { opacity:1; }
  100% { transform: translate3d(0,0,0);   opacity:1; }
}

@keyframes slideDownIn{
  from { transform: translate3d(0,-6%,0); opacity:.7; }
  to   { transform: translate3d(0,0,0);   opacity:1; }
}

/* ================= WRAPPERS ================= */
.page{
  min-height:100vh;
  width:100%;
  backface-visibility:hidden;
  transform: translateZ(0);
}

/* ================= HOME ================= */
.page--home{
  overflow:hidden;
  /* animation: slideDownIn 520ms cubic-bezier(.16,1,.3,1) both; */
}

.page--home .hero-section{
  height:100vh;
  background-image:url('data/fons.jpg');
  background-size:cover;
  background-position:center;
  display:flex;
  flex-direction:column;
  justify-content:flex-start;
  padding:8px;
}

.page--home .header-container{
  width:100%;
  text-align:center;
}

.page--home .titol-principal{
  font-family:'Syne', sans-serif;
  font-weight:800;
  font-size:8.9vw;
  color:#000;
  line-height:1;
  letter-spacing:-0.02em;
  text-transform:uppercase;
}

.page--home .menu-navegacio{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  width:100%;
  padding:0 10px;
  margin-top:8px;
}

.page--home .menu-navegacio a{
  font-family:'Kapakana', serif;
  font-size:32px;
  color:#000;
  text-decoration:none;
  margin-right:40px;
}

.page--home .menu-navegacio .bloc-dreta a{
  margin-right:0;
}

/* ================= INFO ================= */
.page--info{
  background:#000;
  color:#fff;
  overflow-y:auto;
  -webkit-overflow-scrolling:touch;
  animation: slideUpIn 700ms cubic-bezier(.16,1,.3,1) both;
}

/* links blancs */
.page--info a,
.page--info a:visited,
.page--info a:hover,
.page--info a:active{
  color:#fff;
  text-decoration:none;
}

/* header */
.page--info .topbar{
  position:sticky;
  top:0;
  z-index:10;
  background:#000;

  padding:26px 34px 10px;
  display:flex;
  justify-content:space-between;
  align-items:baseline;
  gap:16px;
}

.page--info .brand{
  font-family:'Syne', sans-serif;
  font-weight:800;
  font-size:18px;
  letter-spacing:-0.02em;
  color:#fff;
}

.page--info .topnav{
  display:flex;
  gap:14px;
  align-items:baseline;
}

.page--info .topnav a{
  font-family:'Kapakana', serif;
  font-size:18px;
  opacity:.95;
}

.page--info .topnav a.is-current{
  opacity:1;
  text-decoration:underline;
  text-underline-offset:7px;
}

/* contenidor + centrat vertical */
.page--info .info-content{
  max-width:none;
  padding:36px 34px 44px;

  min-height: calc(100vh - 70px);
  display:flex;
  flex-direction:column;
  justify-content:center;
}

/* mega bloc */
.page--info .mega{
  max-width:1200px;
  margin:0 auto;
  text-align:center;
  line-height:0.85;
}

/* outline */
.page--info .stroke{
  display:block;
  margin:0 auto;

  font-family:'Syne', sans-serif;
  font-weight:800;

  font-size:clamp(50px, 6.4vw, 116px);
  letter-spacing:-0.04em;
  text-transform:uppercase;
  line-height:0.9;

  color:#000;
  -webkit-text-stroke:1.3px #fff;
  -webkit-text-fill-color:#000;

  white-space:nowrap;
  position: relative;
  z-index: 1;
}

/* enganxar línies */
.page--info .stroke:nth-of-type(2){ margin-top:-10px; }
.page--info .stroke:nth-of-type(3){
  margin-top:4px;
  font-size:clamp(42px, 5.8vw, 100px);
  white-space:normal;
  text-wrap:balance;
}

/* vuit milions GRAN + SOLAPAT */
.page--info .script{
  position:relative;
  z-index:6;

  font-family:'Kapakana', serif;
  font-size: clamp(110px, 12vw, 260px);
  line-height: 0.82;
  color:#fff;

  white-space:nowrap;

  margin-top:-80px;
  margin-bottom:-50px;
}

/* 9 eneatips DEFINITIU */
.page--info .script--small{
  position: relative;
  z-index: 6;

  left: 50%;
  transform: translateX(-50%);

  width: max-content;
  max-width: calc(100vw - 68px);
  white-space: nowrap;

  font-family:'Kapakana', serif;
  font-size: 220px;
  line-height: 0.85;

  margin-top: -48px;
}

/* text explicatiu */
.page--info .info-text{
  max-width:720px;
  margin:18px auto 0;
  text-align:center;

  font-family:'Alumni Sans SC', sans-serif;
  font-size:20px;
  letter-spacing:0.14em;
  opacity:0.85;
}

/* CTA */
.page--info .cta{
  margin-top:26px;
  display:grid;
  grid-template-columns:1fr auto 1fr;
  align-items:center;
  gap:14px;
}

.page--info .cta-decor{
  height:22px;
  border-top:1px solid rgba(255,255,255,.7);
  border-bottom:1px solid rgba(255,255,255,.25);
  border-radius:999px;
  opacity:.85;
}

.page--info .cta-btn{ padding:6px 10px; }

.page--info .cta-stroke{
  font-family:'Syne', sans-serif;
  font-weight:800;
  font-size:clamp(34px, 5.8vw, 66px);

  color:#000;
  -webkit-text-stroke:1.2px #fff;
  -webkit-text-fill-color:#000;

  text-transform:lowercase;
}

.page--info .cta-sub{
  margin-top:6px;
  text-align:center;

  font-family:'Alumni Sans SC', sans-serif;
  font-size:18px;
  letter-spacing:0.14em;
  opacity:0.75;
}

/* ================= TEST ================= */
.page--test{
  background:#000;
  color:#fff;
  overflow-y:auto;
  -webkit-overflow-scrolling:touch;
  animation: slideUpIn 700ms cubic-bezier(.16,1,.3,1) both;
}

/* links blancs */
.page--test a,
.page--test a:visited,
.page--test a:hover,
.page--test a:active{
  color:#fff;
  text-decoration:none;
}

/* header (igual que info) */
.page--test .topbar{
  position: sticky;
  top: 0;
  z-index: 10;
  background:#000;

  padding: 26px 34px 10px;
  display:flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
}

.page--test .brand{
  font-family:'Syne', sans-serif;
  font-weight:800;
  font-size:18px;
  letter-spacing:-0.02em;
}

.page--test .topnav{
  display:flex;
  gap:14px;
  align-items: baseline;
}

.page--test .topnav a{
  font-family:'Kapakana', serif;
  font-size:18px;
  opacity:.95;
}

.page--test .topnav a.is-current{
  opacity:1;
  text-decoration: underline;
  text-underline-offset: 7px;
}

/* contenidor */
.page--test .test-content{
  padding: 18px 34px 60px;
}

/* HERO */
.page--test .test-hero{
  max-width: none;
  margin: 0;
  text-align: center;
}

.page--test .test-mega{
  line-height: 0.86;
  margin-top: 6px;
}

.page--test .test-mega .stroke{
  font-family:'Syne', sans-serif;
  font-weight:800;
  text-transform: uppercase;

  color:#000;
  -webkit-text-stroke: 1.3px #fff;
  -webkit-text-fill-color:#000;

  letter-spacing:-0.055em;
  line-height: 0.9;

  white-space: nowrap;
  overflow:hidden;
  display:block;

  font-size: clamp(60px, 10.5vw, 190px);
}

.page--test .test-mega .script{
  position: relative;
  z-index: 6;

  font-family:'Kapakana', serif;
  color:#fff;

  font-size: 320px;
  line-height: 0.78;
  white-space: nowrap;
  overflow:hidden;

  margin-top: -130px;
  margin-bottom: -70px;
}

/* TESTEST (5 línies) */
.page--test .noise-block{
  margin: 16px auto 0;
  max-width: none;
  opacity: 0.92;
}

.page--test .noise-block div{
  font-family:'Syne', sans-serif;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;

  font-size: 18px;
  line-height: 1.2;

  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
}

/* NÚMERO */
.page--test .test-pick{
  text-align:center;
  margin-top: 26px;
}

.page--test .pick-title{
  line-height: 0.9;
}

.page--test .pick-title .stroke{
  font-family:'Syne', sans-serif;
  font-weight:800;
  text-transform: uppercase;

  color:#000;
  -webkit-text-stroke: 1.3px #fff;
  -webkit-text-fill-color:#000;

  letter-spacing:-0.05em;
  white-space: nowrap;
  overflow:hidden;
  display:block;
}

.page--test .pick-title .stroke.small{
  font-size: clamp(40px, 6.2vw, 90px);
}

.page--test .pick-title .stroke.big{
  font-size: clamp(64px, 9.6vw, 160px);
  margin-top:-10px;
}

/* ===== DNI GRID + FLIP ===== */
.page--test .dni-grid{
  display:flex;
  flex-wrap: nowrap;
  justify-content: center;
  gap: 18px;

  margin: 18px auto 0;

  padding: 14px 34px;
  max-width: calc(100vw - 68px);

  overflow-x: auto;
  overflow-y: visible;

  scrollbar-width: none;
}
.page--test .dni-grid::-webkit-scrollbar{ display:none; }

.page--test .card{
  flex: 0 0 auto;
  width: 140px;
  height: 190px;
  perspective: 1200px;
  display:block;
  text-decoration:none;
}

.page--test .card-inner{
  position: relative;
  width:100%;
  height:100%;
  transform-style: preserve-3d;
  transition: transform 520ms cubic-bezier(.16,1,.3,1);
}

.page--test .card:hover .card-inner{
  transform: rotateY(180deg);
}

.page--test .card-face{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  object-fit: cover;
  border-radius: 16px;

  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;

  box-shadow: 0 10px 28px rgba(0,0,0,0.55);
}

.page--test .card-back{
  transform: rotateY(180deg);
}

/* rotacions */
.page--test .card.r1{ transform: rotate(-4deg); }
.page--test .card.r2{ transform: rotate( 2deg); }
.page--test .card.r3{ transform: rotate(-2deg); }
.page--test .card.r4{ transform: rotate( 3deg); }
.page--test .card.r5{ transform: rotate(-3deg); }
.page--test .card.r6{ transform: rotate( 2deg); }
.page--test .card.r7{ transform: rotate(-2deg); }
.page--test .card.r8{ transform: rotate( 3deg); }
.page--test .card.r9{ transform: rotate(-3deg); }

/* final */
.page--test .pick-bottom{
  margin-top: 22px;
}

.page--test .stroke.bottom{
  font-family:'Syne', sans-serif;
  font-weight:800;
  text-transform: uppercase;

  color:#000;
  -webkit-text-stroke: 1.3px #fff;
  -webkit-text-fill-color:#000;

  font-size: clamp(44px, 7.2vw, 120px);
  letter-spacing:-0.05em;
  white-space: nowrap;
  overflow:hidden;
  display:block;
}

.page--test .pick-sub{
  margin-top: 8px;
  font-family:'Alumni Sans SC', sans-serif;
  letter-spacing: 0.16em;
  opacity: 0.8;
  font-size: 18px;
}

/* ================= RESPONSIVE ================= */
@media (max-width:768px){
  .page--info .topbar{ padding:18px 18px 10px; }
  .page--info .info-content{ padding:28px 18px 40px; }
  .page--info .topnav{ flex-wrap:wrap; gap:12px; }
  .page--info .info-text{ font-size:18px; }

  .page--home .titol-principal{ font-size:14vw; }
  .page--home .menu-navegacio{
    flex-direction:column;
    align-items:center;
    gap:12px;
    text-align:center;
  }
  .page--home .menu-navegacio a{ margin-right:0; }

  .page--test .topbar{ padding:18px 18px 10px; }
  .page--test .test-content{ padding:16px 18px 50px; }
  .page--test .dni-grid{ padding: 12px 18px; max-width: calc(100vw - 36px); }
  .page--test .card{ width: 120px; height: 170px; }
  .page--test .noise-block div{ font-size:16px; }
  .page--test .test-mega .script{ font-size: 200px; margin-top:-90px; margin-bottom:-50px; }
}
/* ===== PATCH URGENT TEST: IMATGES + NO OVERFLOW ===== */

/* 1) FIX imatges: span inline -> block */
.page--test .card-inner{
  display: block;      /* CLAU */
}

.page--test .card-face{
  display: block;      /* per assegurar render */
}

/* 2) Assegurar que la card tingui mida real sempre */
.page--test .card{
  width: 140px;
  height: 190px;
}

/* 3) Evitar que els strokes surtin de pantalla */
.page--test .test-mega .stroke{
  max-width: calc(100vw - 68px);
  margin-left: auto;
  margin-right: auto;
  overflow: hidden;

  /* baixa una mica per seguretat */
  font-size: clamp(52px, 9.2vw, 170px);

  /* si és massa llarg, permet que trenqui (no overflow) */
  white-space: normal;
  text-wrap: balance;
}

/* 4) Manté eneatip gran però dins del viewport */
.page--test .test-mega .script{
  max-width: calc(100vw - 68px);
  margin-left: auto;
  margin-right: auto;
  overflow: hidden;
  white-space: nowrap; /* eneatip 1 sola línia */
}

/* 5) El text repetit que no empenyi res raro */
.page--test .noise-block div{
  max-width: calc(100vw - 68px);
  margin-left: auto;
  margin-right: auto;
}

/* mòbil */
@media (max-width: 768px){
  .page--test .test-mega .stroke,
  .page--test .test-mega .script,
  .page--test .noise-block div{
    max-width: calc(100vw - 36px);
  }
}
/* ===== PATCH 2: DESC0BREIX + FOTOS DINS ===== */

/* 1) “DESCOBREIX” més segur (no overflow dret) */
.page--test .test-mega .stroke:first-child{
  font-size: clamp(48px, 8.4vw, 160px); /* baixa una mica */
  letter-spacing: -0.07em;             /* compacta perquè càpiga */
  padding: 0 2px;                      /* micro marge */
}

/* (Opcional) totes les strokes una mica més compactes */
.page--test .test-mega .stroke{
  letter-spacing: -0.06em;
}

/* 2) Fotos: que 1 i 9 NO es tallin amb rotació */
.page--test .dni-grid{
  padding-left: 64px;   /* més marge lateral */
  padding-right: 64px;
  scroll-padding-left: 64px;
  scroll-padding-right: 64px;
  scroll-snap-type: x proximity;
}

/* dona “aire” per la rotació (evita tallar a la vora) */
.page--test .card{
  margin: 12px;
  scroll-snap-align: center;
}

/* mòbil */
@media (max-width: 768px){
  .page--test .dni-grid{
    padding-left: 28px;
    padding-right: 28px;
    scroll-padding-left: 28px;
    scroll-padding-right: 28px;
  }
  .page--test .card{ margin: 10px; }
}
/* ===== FIX DEFINITIU: rotació sense tallar + scroll horitzontal ===== */

/* el wrapper fa l'scroll */
.page--test .dni-wrap{
  overflow-x: auto;
  overflow-y: visible;          /* important */
  padding: 30px 60px;           /* aire perquè no talli 1 i 9 + rotació */
  -webkit-overflow-scrolling: touch;

  scrollbar-width: none;
}
.page--test .dni-wrap::-webkit-scrollbar{ display:none; }

/* la grid ja NO talla res */
.page--test .dni-grid{
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  gap: 18px;

  overflow: visible;            /* CLAU */
  width: max-content;           /* perquè el scroll funcioni bé */
  margin: 0 auto;               /* centrat quan cap */
}

/* aire extra per cada carta (rotació) */
.page--test .card{
  margin: 14px;
  transform-origin: center center;
}

/* mòbil */
@media (max-width: 768px){
  .page--test .dni-wrap{
    padding: 22px 18px;
  }
  .page--test .card{
    margin: 10px;
  }
}
/* ===== FIX DEFINITIU (GUANYA A TOTS ELS DUPLICATS) ===== */

.page.page--test .dni-wrap{
  overflow-x: auto !important;
  overflow-y: visible !important;      /* que la rotació no es talli */
  padding: 36px 80px !important;       /* aire lateral + aire vertical */
  -webkit-overflow-scrolling: touch !important;

  scrollbar-width: none !important;
}
.page.page--test .dni-wrap::-webkit-scrollbar{ display:none !important; }

.page.page--test .dni-wrap .dni-grid{
  display: flex !important;
  flex-wrap: nowrap !important;
  gap: 18px !important;

  overflow: visible !important;        /* CLAU: aquí NO hi ha tall */
  width: max-content !important;       /* perquè el scroll sigui real */
  margin: 0 auto !important;           /* centrat si cap */
  padding: 0 !important;
}

.page.page--test .dni-wrap .card{
  margin: 18px !important;             /* aire per la rotació */
  transform-origin: center center !important;
}

/* mòbil */
@media (max-width: 768px){
  .page.page--test .dni-wrap{
    padding: 26px 22px !important;
  }
  .page.page--test .dni-wrap .card{
    margin: 12px !important;
  }
}


