/* ============================================================
   STYLEHOMM — estil.css
   Fosc i cinematogràfic · nit, crema, ambre · mòbil primer
   ============================================================ */

:root {
  --nit: #14100c;
  --fum: #1d1712;
  --crema: #f1e8db;
  --sorra: #a4917b;
  --ambre: #d79a52;
  --linia: rgba(241, 232, 219, .14);
  --serif: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --sans: 'Outfit', system-ui, 'Segoe UI', sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--nit);
  color: var(--crema);
  font-family: var(--sans);
  font-weight: 300;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: var(--ambre); color: var(--nit); }

img { display: block; max-width: 100%; height: auto; }

a { color: inherit; }

/* ---------- HERO ---------- */
.hero { position: relative; height: 100vh; min-height: 560px; overflow: hidden; }
.hero-img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover;
  animation: lent 26s ease-out forwards;
}
@keyframes lent { from { transform: scale(1.12); } to { transform: scale(1); } }
.hero-vel {
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(20,16,12,.6) 0%, rgba(20,16,12,.42) 45%, rgba(20,16,12,.9) 100%);   /* foto de portada clara: més vel */
}
.hero-cos {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  text-align: center; padding: 0 1.5rem;
}
.marca {
  font-weight: 200;
  font-size: clamp(1.9rem, 7vw, 4.6rem);
  letter-spacing: .52em;
  margin-right: -.52em; /* compensa el tracking del darrer glif */
  text-transform: uppercase;
  line-height: 1.15;
}
.marca, .marca-sub { text-shadow: 0 1px 18px rgba(20, 16, 12, .55); }
.marca-sub {
  margin-top: 1.4rem;
  font-size: clamp(.72rem, 1.6vw, .88rem);
  letter-spacing: .34em;
  margin-right: -.34em;
  text-transform: uppercase;
  color: var(--sorra);
}
.avall {
  position: absolute; bottom: 2.2rem; left: 50%; transform: translateX(-50%);
  width: 1px; height: 64px;
  background: linear-gradient(to bottom, transparent, var(--ambre));
  animation: pols 2.6s ease-in-out infinite;
}
@keyframes pols { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }

/* ---------- MANIFEST ---------- */
.manifest { max-width: 60rem; margin: 0 auto; padding: 9rem 1.5rem 7rem; text-align: center; }
.manifest p {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(1.5rem, 3.6vw, 2.6rem);
  line-height: 1.45;
  text-wrap: balance;
}
.manifest em { font-style: italic; color: var(--ambre); }

/* ---------- COL·LECCIÓ / PECES ---------- */
.familia { max-width: 78rem; margin: 0 auto; padding: 0 1.5rem; }
.familia-cap {
  display: flex; align-items: baseline; gap: 1.2rem; flex-wrap: wrap;
  border-top: 1px solid var(--linia);
  padding: 1.1rem 0 3rem;
}
.familia-cap h2 {
  font-size: .8rem; font-weight: 400; letter-spacing: .3em;
  text-transform: uppercase; color: var(--ambre);
}
.familia-cap span { font-size: .8rem; letter-spacing: .12em; color: var(--sorra); }

/* cada taula en una pantalla: foto a l'esquerra, compra a la dreta */
.peca {
  margin-bottom: 7rem;
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(16rem, 1fr);
  gap: 3rem;
  align-items: center;
}
.peca > figure, .peca > .duo { max-height: calc(100vh - 6rem); }

/* foto o 3D a la mateixa caixa */
.vista { position: relative; aspect-ratio: 3 / 2; max-height: calc(100vh - 6rem); }
.vista > figure { height: 100%; }
.vista > figure img { height: 100%; }
.visor3d {
  display: block;
  visibility: hidden;
  touch-action: none;          /* dins del 3D el dit gira i fa zoom; la pàgina es mou fora */
  cursor: grab;
  position: absolute; inset: 0; width: 100%; height: 100%;
  background: var(--nit);   /* el mateix fons que la web */
  border-radius: 2px;
  --poster-color: transparent;
  --progress-bar-color: transparent;
}
.vista.en-3d > figure { visibility: hidden; }
/* fitxa amb dues fotos: la caixa la fa la parella de fotos; en 3D, 3:2 com les altres */
.vista-duo { aspect-ratio: auto; }
.vista-duo.en-3d { aspect-ratio: 3 / 2; }
.vista-duo.en-3d > .duo { display: none; }
.vista.en-3d > .visor3d { visibility: visible; }
/* Mostres d'acabat dins del visor 3D (només es veuen amb el 3D obert) */
.mostres-3d {
  position: absolute; left: 1rem; bottom: 1rem; z-index: 2;
  display: none; gap: .4rem;
  padding: .4rem;
  background: rgba(20, 16, 12, .72);
  border: 1px solid var(--linia);
  border-radius: 999px;
}
.vista.en-3d > .mostres-3d { display: flex; }
.mostra-3d {
  width: 30px; height: 30px; padding: 0;
  border: 1px solid var(--linia); border-radius: 50%;
  background-size: cover; background-position: center;
  cursor: pointer;
  transition: border-color .3s, transform 0s;
}
.mostra-3d[aria-pressed="true"] { border-color: var(--ambre); box-shadow: 0 0 0 2px rgba(215, 154, 82, .45); }
.mostra-3d:focus-visible { outline: 2px solid var(--crema); outline-offset: 2px; }

/* Els dos botons de la foto, en una sola píndola a baix a la dreta (opció 3) */
.vistes {
  position: absolute; right: 1rem; bottom: 1rem; z-index: 2;
  display: flex;
  background: rgba(20, 16, 12, .72);
  border: 1px solid var(--ambre);
  border-radius: 999px;
  overflow: hidden;
}
.vistes:empty, .vistes:not(:has(.boto-ico:not([hidden]))) { display: none; }
.boto-ico {
  display: flex; align-items: center; justify-content: center;
  width: 3.1rem; height: 2.6rem;
  padding: 0; background: none; border: 0;
  color: var(--crema);
  cursor: pointer;
  transition: background .3s, color .3s;
}
.boto-ico + .boto-ico { border-left: 1px solid var(--linia); }
.boto-ico svg { width: 1.25rem; height: 1.25rem; }
.boto-ico:hover, .boto-ico:focus-visible { background: var(--ambre); color: var(--nit); }
.boto-ico:focus-visible { outline: 2px solid var(--crema); outline-offset: -4px; }
.boto-ico[hidden] { display: none; }
.boto-ico[aria-busy="true"] { opacity: .45; cursor: default; }
.boto-ico[aria-pressed="true"] { background: rgba(215, 154, 82, .18); }

.avis-ra {
  position: absolute; left: 1rem; top: 1rem; z-index: 2;
  max-width: 14rem; padding: .6rem 1rem;
  background: rgba(20, 16, 12, .82);
  border: 1px solid var(--linia); border-radius: 999px;
  font-size: .66rem; letter-spacing: .12em; color: var(--sorra);
}
.peca > figure img, .vista > figure img { aspect-ratio: 3 / 2; object-fit: cover; }
.peca figure { position: relative; overflow: hidden; border-radius: 2px; }
.peca img {
  width: 100%; height: auto; display: block;
  transform: scale(1.001);
  transition: transform 1.4s cubic-bezier(.2, .6, .2, 1);
}
.peca figure:hover img { transform: scale(1.035); }
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.duo figure { aspect-ratio: 3 / 2; }
.duo img { width: 100%; height: 100%; object-fit: cover; }

.peca-peu {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.6rem;
  align-items: start;
}
.peca-peu h3 {
  font-family: var(--serif);
  font-weight: 400; font-style: italic;
  font-size: clamp(1.4rem, 2.8vw, 1.9rem);
  letter-spacing: .02em;
  line-height: 1.2;
}
.peca-mida {
  margin-top: .55rem;
  font-size: .72rem; letter-spacing: .22em; text-transform: uppercase;
  color: var(--sorra);
  line-height: 1.9;
}

/* ---------- COMPRA ---------- */
.compra { min-width: 15.5rem; }
.compra-opcions { display: grid; gap: .55rem; }
.compra-opcions label {
  font-size: .66rem; letter-spacing: .28em; text-transform: uppercase;
  color: var(--sorra);
}
.compra-opcions select {
  width: 100%;
  padding: .7rem 2.4rem .7rem .9rem;
  background: var(--fum);
  color: var(--crema);
  border: 1px solid var(--linia);
  border-radius: 2px;
  font-family: var(--sans);
  font-weight: 300;
  font-size: .85rem;
  letter-spacing: .06em;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23a4917b' stroke-width='1.2'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .9rem center;
  cursor: pointer;
  transition: border-color .4s;
}
.compra-opcions select:hover { border-color: rgba(215, 154, 82, .5); }
.compra-opcions select:focus-visible { outline: none; border-color: var(--ambre); }
.compra-opcions option { background: var(--fum); color: var(--crema); }

/* caselletes d'acabat */
.mostres { border: 0; margin: .35rem 0 0; display: grid; grid-template-columns: repeat(3, max-content); gap: .9rem; }
.mostres legend {
  grid-column: 1 / -1;
  margin-bottom: .6rem;
  font-size: .66rem; letter-spacing: .28em; text-transform: uppercase;
  color: var(--sorra);
}
.compra-opcions .mostra { display: grid; gap: .45rem; cursor: pointer; letter-spacing: .14em; }
.mostra input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.mostra-pell {
  display: block;
  width: 56px; height: 56px; justify-self: center;
  border-radius: 2px;
  border: 1px solid var(--linia);
  outline: 1px solid transparent; outline-offset: 2px;
  background-size: cover; background-position: center;
  transition: outline-color .3s, border-color .3s;
}
.mostra-pi     { background-image: url("../assets/img/acabat-pi-natural-3.jpg"); }
.mostra-nogal  { background-image: url("../assets/img/acabat-pi-nogal-3.jpg"); }
/* pi tenyit roure i pi tenyit nogal: textura CC0 d'ambientCG (Wood050) entonada amb els dos tints */
/* roure: textura CC0 d'ambientCG (Wood049), entonada a roure clar */
.mostra-roure  { background-image: url("../assets/img/acabat-roure.jpg"); }
.mostra-nom { text-align: center; line-height: 1.35; max-width: 6.2rem; justify-self: center; }
.mostra input:checked ~ .mostra-nom { color: var(--crema); }
.mostra:hover .mostra-pell { border-color: rgba(215, 154, 82, .5); }
.mostra input:checked + .mostra-pell { border-color: var(--ambre); outline-color: var(--ambre); }
.mostra input:focus-visible + .mostra-pell { outline: 2px solid var(--crema); }

.compra-preu {
  margin-top: 1.3rem;
  font-family: var(--serif);
  font-size: 1.65rem;
  font-weight: 400;
  color: var(--crema);
  line-height: 1;
}
.compra-preu small {
  font-family: var(--sans);
  font-size: .64rem; letter-spacing: .24em; text-transform: uppercase;
  color: var(--sorra);
  margin-left: .4rem;
}

.boto {
  display: inline-block;
  margin-top: 1.3rem;
  padding: .95rem 2.8rem;
  background: transparent;
  border: 1px solid var(--ambre);
  border-radius: 999px;
  color: var(--crema);
  text-decoration: none;
  font-family: var(--sans);
  font-weight: 300;
  font-size: .78rem;
  letter-spacing: .3em;
  margin-right: -.3em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background .5s, color .5s, box-shadow .5s;
}
.boto:hover, .boto:focus-visible {
  background: var(--ambre);
  color: var(--nit);
  box-shadow: 0 0 42px rgba(215, 154, 82, .38);
}
.boto:focus-visible { outline: 2px solid var(--crema); outline-offset: 4px; }

.compra-nota {
  margin-top: 1.2rem;
  font-size: .68rem; letter-spacing: .12em;
  color: var(--sorra);
  line-height: 1.9;
}

/* ---------- CTA / QUI SOM ---------- */
.cta { text-align: center; padding: 8rem 1.5rem 4rem; }
.cta p {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(1.6rem, 4vw, 2.8rem);
  line-height: 1.35;
  text-wrap: balance;
}
.cta em { font-style: italic; color: var(--ambre); }
.cta .credit {
  font-family: var(--sans);
  margin-top: 2rem;
  font-size: .72rem; letter-spacing: .28em; text-transform: uppercase;
  color: var(--sorra);
}

/* ---------- CONTACTE ---------- */
.contacte { text-align: center; padding: 2rem 1.5rem 9rem; }
.contacte-sub {
  font-size: .8rem; letter-spacing: .18em;
  color: var(--sorra);
  max-width: 30rem; margin: 0 auto;
  line-height: 2;
}
.contacte .boto-gran { margin-top: 2.4rem; padding: 1.05rem 3.2rem; text-transform: none; letter-spacing: .18em; margin-right: -.18em; }

/* ---------- PEU ---------- */
.peu {
  border-top: 1px solid var(--linia);
  padding: 3rem 1.5rem 3.4rem;
  text-align: center;
  background: var(--nit);
}
.peu-marca {
  font-size: .9rem; font-weight: 200;
  letter-spacing: .5em; margin-right: -.5em;
  text-transform: uppercase;
}
.peu-linia {
  margin-top: 1rem;
  font-size: .68rem; letter-spacing: .26em; text-transform: uppercase;
  color: var(--sorra);
  line-height: 2.1;
}
.peu-nav {
  margin-top: 1.6rem;
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: .8rem 2rem;
}
.peu-nav a {
  font-size: .66rem; letter-spacing: .22em; text-transform: uppercase;
  color: var(--sorra);
  text-decoration: none;
  transition: color .4s;
}
.peu-nav a:hover, .peu-nav a:focus-visible { color: var(--ambre); }
.peu-copy {
  margin-top: 1.6rem;
  font-size: .62rem; letter-spacing: .22em; text-transform: uppercase;
  color: rgba(164, 145, 123, .6);
}

/* ---------- PÀGINES LEGALS ---------- */
.legal-cap {
  border-bottom: 1px solid var(--linia);
  padding: 2.6rem 1.5rem 2.2rem;
  text-align: center;
}
.legal-marca {
  display: inline-block;
  font-weight: 200;
  font-size: 1.15rem;
  letter-spacing: .5em; margin-right: -.5em;
  text-transform: uppercase;
  text-decoration: none;
  transition: color .4s;
}
.legal-marca:hover, .legal-marca:focus-visible { color: var(--ambre); }
.legal-cap-sub {
  margin-top: .7rem;
  font-size: .62rem; letter-spacing: .3em; margin-right: -.3em;
  text-transform: uppercase;
  color: var(--sorra);
}

.legal-cos {
  max-width: 44rem;
  margin: 0 auto;
  padding: 4.5rem 1.5rem 7rem;
}
.legal-cos .etiqueta {
  margin-top: 0;
  font-size: .7rem; font-weight: 400; letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--ambre);
}
.legal-cos h1 {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(2rem, 5vw, 2.9rem);
  line-height: 1.15;
  margin-top: .9rem;
}
.legal-cos .legal-actualitzacio {
  margin-top: 1rem;
  font-size: .66rem; letter-spacing: .22em; text-transform: uppercase;
  color: var(--sorra);
}
.legal-cos h2 {
  font-family: var(--serif);
  font-weight: 400; font-style: italic;
  font-size: 1.45rem;
  line-height: 1.25;
  margin: 3rem 0 .4rem;
  color: var(--crema);
}
.legal-cos p, .legal-cos li {
  font-size: .95rem;
  line-height: 1.85;
  color: rgba(241, 232, 219, .82);
}
.legal-cos p { margin-top: 1rem; }
.legal-cos ul, .legal-cos ol { margin: 1rem 0 0 1.2rem; display: grid; gap: .55rem; }
.legal-cos li::marker { color: var(--ambre); }
.legal-cos strong { font-weight: 400; color: var(--crema); }
.legal-cos a {
  color: var(--ambre);
  text-decoration-color: rgba(215, 154, 82, .45);
  text-underline-offset: 3px;
  transition: text-decoration-color .4s;
}
.legal-cos a:hover, .legal-cos a:focus-visible { text-decoration-color: var(--ambre); }
mark.pendent {
  background: var(--ambre);
  color: var(--nit);
  font-weight: 400;
  padding: .12em .45em;
  border-radius: 2px;
}
.peu-nav a[aria-current="page"] { color: var(--ambre); }

/* ---------- REVELAT ---------- */
.revela { opacity: 0; transform: translateY(34px); transition: opacity 1.1s ease, transform 1.1s ease; }
.revela.vist { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-img { animation: none; }
  .avall { animation: none; }
  .revela { opacity: 1; transform: none; transition: none; }
  .peca img { transition: none; }
  .boto { transition: none; }
  .mostra-pell { transition: none; }
}

/* ---------- MÒBIL ---------- */
@media (max-width: 820px) {
  /* les icones surten de la foto: tapaven la taula. Van a la línia del títol. */
  /* la base de la píndola, a la línia del text del títol (no centrada) */
  .titol-peca { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 0 1rem; }
  .titol-peca .peca-mida { grid-column: 1 / -1; }
  .titol-peca .vistes { position: static; }
  .peca { grid-template-columns: 1fr; gap: 1.6rem; }
  .peca > figure, .peca > .duo, .vista { max-height: none; }
  .compra { min-width: 0; max-width: 24rem; }
}
@media (max-width: 700px) {
  .duo { gap: .5rem; }
  .peca { margin-bottom: 5rem; }
  .manifest { padding: 6.5rem 1.5rem 5rem; }
}
