/* ============================================================
   Local 22J·451 — Passeig 22 de Juliol 451, Terrassa
   Blanc pur + tinta cobalt (oklch h256) · Archivo variable
   ============================================================ */

:root {
  --bg: oklch(1 0 0);
  --surface: oklch(0.965 0.006 256);
  --ink: oklch(0.24 0.03 256);
  --muted: oklch(0.44 0.025 256);
  --primary: oklch(0.34 0.10 256);
  --primary-hover: oklch(0.28 0.10 256);
  --dark: oklch(0.18 0.025 256);
  --sand: oklch(0.85 0.06 80);
  --line: oklch(0.88 0.01 256);

  --space: clamp(4.5rem, 10vw, 9rem);
  --pad: clamp(1.25rem, 4vw, 3rem);
  --radius: 2px;

  --z-topbar: 10;
  --z-lightbox: 20;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);

  --font-display: 'Big Shoulders', 'Archivo', system-ui, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Archivo', system-ui, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3 { text-wrap: balance; line-height: 1.05; }

.wrap { max-width: 74rem; margin-inline: auto; padding-inline: var(--pad); }

/* ---------- Topbar ---------- */
.topbar {
  position: absolute;
  inset: 0 0 auto 0;
  z-index: var(--z-topbar);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.1rem var(--pad);
  color: white;
}
.brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-stretch: 100%;
  font-size: 1.55rem;
  letter-spacing: 0.06em;
  color: inherit;
  text-decoration: none;
}
.brand span { color: var(--sand); }
.topbar-nav { display: flex; align-items: center; gap: 1.4rem; }
.topbar .tel {
  color: inherit;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
}
.topbar .tel:hover { text-decoration: underline; text-underline-offset: 4px; }

/* ---------- CTA buttons ---------- */
.cta {
  display: inline-block;
  background: var(--primary);
  color: white;
  text-decoration: none;
  font-weight: 700;
  font-size: 1rem;
  padding: 0.95rem 1.8rem;
  border-radius: var(--radius);
  transition: background 0.25s var(--ease-out), transform 0.25s var(--ease-out);
}
.cta:hover { background: var(--primary-hover); transform: translateY(-1px); }
.cta:active { transform: translateY(0); }
.cta:focus-visible, a:focus-visible, button:focus-visible {
  outline: 3px solid var(--sand);
  outline-offset: 2px;
}
.cta-small { padding: 0.55rem 1.1rem; font-size: 0.9rem; }
.cta-ghost {
  background: transparent;
  border: 1px solid oklch(1 0 0 / 0.65);
}
.cta-ghost:hover { background: oklch(1 0 0 / 0.12); }
.cta-dark { background: var(--dark); }
.cta-dark:hover { background: var(--primary); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  /* alçada = amplada / relació d'aspecte de la foto (1448x745) => es veu SENCERA en escriptori */
  min-height: max(30rem, min(100vw / 1.9436, 100svh));
  display: flex;
  align-items: flex-end;
  color: white;
  isolation: isolate;
}
.hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -2;
}
.hero-scrim {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(to top, oklch(0.15 0.03 256 / 0.88) 0%, oklch(0.15 0.03 256 / 0.35) 45%, oklch(0.15 0.03 256 / 0.15) 70%, oklch(0.15 0.03 256 / 0.4) 100%);
}
.hero-content {
  width: 100%;
  max-width: 74rem;
  margin-inline: auto;
  padding: 0 var(--pad) clamp(2.5rem, 7vh, 5rem);
}
.hero-place {
  font-weight: 600;
  font-stretch: 110%;
  font-size: clamp(0.95rem, 1.6vw, 1.1rem);
  letter-spacing: 0.04em;
  color: oklch(0.92 0.04 80);
  margin-bottom: 1rem;
}
.hero h1 {
  font-family: var(--font-display);
  font-weight: 650;
  font-stretch: 100%;
  text-transform: uppercase;
  font-size: clamp(2.6rem, 7vw, 5.6rem);
  letter-spacing: 0.015em;
  line-height: 0.98;
  max-width: 18ch;
  margin-bottom: 1.4rem;
}
.hero h1 .hl { color: oklch(0.79 0.09 256); }
.hero-deal {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem 1.2rem;
  font-size: clamp(1.15rem, 2.4vw, 1.6rem);
  font-weight: 300;
  margin-bottom: 2rem;
}
.hero-deal b { font-weight: 800; }
.deal-sep {
  width: 1px;
  height: 1.6em;
  background: oklch(1 0 0 / 0.45);
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.9rem; }

/* ---------- Fitxa (specs) ---------- */
.sheet { padding-block: var(--space); }
.specs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  border-top: 2px solid var(--ink);
}
.spec {
  border-bottom: 1px solid var(--line);
  padding: 1.5rem 1.5rem 1.7rem 0;
}
.spec dt {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 0.5rem;
}
.spec dd {
  font-family: var(--font-display);
  font-weight: 620;
  font-stretch: 100%;
  font-size: clamp(2.2rem, 3.8vw, 3.1rem);
  letter-spacing: 0.01em;
  line-height: 1.05;
}
.spec dd small { font-size: 0.55em; font-weight: 600; }
.spec-text {
  font-family: 'Archivo', system-ui, sans-serif !important;
  text-transform: none !important;
  font-size: clamp(1.05rem, 1.6vw, 1.25rem) !important;
  font-weight: 600 !important;
  font-stretch: 100% !important;
  line-height: 1.35 !important;
  letter-spacing: 0 !important;
  max-width: 24ch;
}
.lede {
  margin-top: clamp(2.5rem, 5vw, 4rem);
  margin-inline: auto;
  font-size: clamp(1.25rem, 2.3vw, 1.7rem);
  font-weight: 300;
  line-height: 1.5;
  max-width: 70ch;
  text-align: center;
  text-wrap: balance;
}

/* ---------- Floors / galleries ---------- */
.floor { padding-bottom: var(--space); }
.floor-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.7rem;
  margin-bottom: clamp(1.8rem, 3.8vw, 2.8rem);
}
.floor-head h2, .plan-data h2 {
  font-family: var(--font-display);
  font-weight: 620;
  font-stretch: 100%;
  text-transform: uppercase;
  font-size: clamp(2rem, 4.2vw, 3.1rem);
  letter-spacing: 0.025em;
}
.floor-head p {
  color: var(--muted);
  max-width: 62ch;
  margin-inline: auto;
  text-align: center;
  text-wrap: balance;
}

.plan-data > p {
  text-align: justify;
  text-wrap: pretty;
  hyphens: auto;
  -webkit-hyphens: auto;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: clamp(0.6rem, 1.4vw, 1.1rem);
}
.gallery figure {
  overflow: hidden;
  border-radius: var(--radius);
  cursor: zoom-in;
  box-shadow:
    0 14px 34px -14px oklch(0.25 0.04 256 / 0.32),
    0 3px 10px oklch(0.25 0.04 256 / 0.1);
  transition: box-shadow 0.4s var(--ease-out), translate 0.4s var(--ease-out);
}
.gallery figure:hover {
  translate: 0 -3px;
  box-shadow:
    0 24px 48px -16px oklch(0.25 0.04 256 / 0.4),
    0 6px 16px oklch(0.25 0.04 256 / 0.14);
}
.gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  aspect-ratio: 4 / 3;
  transition: transform 0.6s var(--ease-out);
}
.gallery figure:hover img { transform: scale(1.03); }
.gallery figure { grid-column: span 2; }
.gallery .g-wide { grid-column: span 4; }
.gallery .g-wide img { aspect-ratio: 16 / 9; }
.gallery .g-full { grid-column: span 6; }
.gallery .g-full img { aspect-ratio: 1448 / 993; } /* la foto sencera, sense retall */
.cols-2 figure { grid-column: span 3; }
.cols-2 img { aspect-ratio: 3 / 2; }

@media (max-width: 720px) {
  .gallery { grid-template-columns: repeat(2, 1fr); }
  .gallery figure, .gallery .g-wide, .gallery .g-full, .cols-2 figure { grid-column: span 2; }
  .gallery .g-full img { aspect-ratio: 16 / 9; }
}

/* ---------- Plan / location ---------- */
.plan { background: var(--surface); padding-block: var(--space); }
.plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}
.plan-img { cursor: zoom-in; }
.plan-img img {
  margin-inline: auto;
  border-radius: var(--radius);
  background: white;
  box-shadow:
    0 16px 38px -14px oklch(0.25 0.04 256 / 0.3),
    0 3px 10px oklch(0.25 0.04 256 / 0.1);
  transition: box-shadow 0.4s var(--ease-out), translate 0.4s var(--ease-out);
}
.plan-img:hover img {
  translate: 0 -3px;
  box-shadow:
    0 26px 52px -16px oklch(0.25 0.04 256 / 0.38),
    0 6px 16px oklch(0.25 0.04 256 / 0.14);
}
.plan .plan-img img { padding: clamp(1rem, 2.5vw, 2rem); }
.plan-data p { margin-block: 1.1rem; max-width: 52ch; }
.plan-data p + .cta { margin-top: 0.6rem; }
.plan-facts { list-style: none; margin-top: 1.8rem; border-top: 2px solid var(--ink); }
.plan-facts li {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--line);
}
.plan-facts span { color: var(--muted); }
.plan-facts b { font-weight: 700; text-align: right; }

/* ---------- Usos ---------- */
.uses { padding-block: var(--space); }
.use { margin-top: clamp(2.2rem, 5vw, 3.6rem); }
.use h3 {
  font-family: var(--font-display);
  font-weight: 580;
  text-transform: uppercase;
  font-size: clamp(1.4rem, 2.5vw, 1.8rem);
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--line);
}

/* ---------- Ubicació ---------- */
.location { padding-block: var(--space); padding-top: 0; }

/* ---------- Contacte ---------- */
.contact {
  position: relative;
  isolation: isolate;
  color: white;
  text-align: center;
  padding: calc(var(--space) * 1.15) var(--pad);
  background: var(--dark);
  overflow: hidden;
}
.contact-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.42;
  filter: saturate(0.55) brightness(1.2);
  z-index: -1;
}
.contact h2 {
  font-family: var(--font-display);
  font-weight: 650;
  font-stretch: 100%;
  text-transform: uppercase;
  font-size: clamp(2.4rem, 5.6vw, 4.2rem);
  letter-spacing: 0.03em;
}
.contact-deal {
  margin-top: 1rem;
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  color: oklch(0.92 0.04 80);
}
.contact-phone {
  display: inline-block;
  margin-block: clamp(1.4rem, 3.5vw, 2.4rem) 0.8rem;
  font-family: var(--font-display);
  font-weight: 620;
  font-stretch: 100%;
  font-size: clamp(3rem, 9vw, 6.4rem);
  letter-spacing: 0.02em;
  line-height: 1.05;
  color: white;
  text-decoration: none;
  transition: color 0.25s var(--ease-out);
}
.contact-phone:hover { color: var(--sand); }
.contact-note {
  color: oklch(0.82 0.015 256);
  max-width: 44ch;
  margin: 0 auto 2rem;
}
.contact .hero-actions { justify-content: center; }

/* ---------- Footer ---------- */
.foot {
  padding: 2rem var(--pad) 2.4rem;
  background: var(--dark);
  color: oklch(0.72 0.02 256);
  font-size: 0.85rem;
  text-align: center;
  border-top: 1px solid oklch(1 0 0 / 0.12);
}
.foot p + p { margin-top: 0.4rem; }

/* ---------- Lightbox ---------- */
.lightbox {
  border: none;
  background: transparent;
  padding: 0;
  max-width: 100vw;
  max-height: 100vh;
  z-index: var(--z-lightbox);
  opacity: 0;
  transform: scale(0.94);
  transition:
    opacity 0.35s var(--ease-out),
    transform 0.35s var(--ease-out),
    display 0.35s allow-discrete,
    overlay 0.35s allow-discrete;
}
.lightbox::backdrop {
  background: oklch(0.35 0.03 256 / 0.16);
  transition: opacity 0.35s var(--ease-out);
  opacity: 0;
}
.lightbox[open] {
  display: grid;
  place-items: center;
  gap: 0.9rem;
  width: 100vw;
  height: 100dvh;
  opacity: 1;
  transform: scale(1);
}
.lightbox[open]::backdrop { opacity: 1; }
@starting-style {
  .lightbox[open] { opacity: 0; transform: scale(0.94); }
  .lightbox[open]::backdrop { opacity: 0; }
}
.lightbox img {
  max-width: 96vw;
  max-height: 88dvh;
  width: auto;
  height: auto;
  border-radius: 4px;
  box-shadow:
    0 60px 120px -24px oklch(0.15 0.04 256 / 0.55),
    0 24px 48px -12px oklch(0.15 0.04 256 / 0.3),
    0 4px 14px oklch(0.15 0.04 256 / 0.16);
}
.lb-caption {
  color: var(--ink);
  font-size: 0.95rem;
  text-align: center;
  max-width: 60ch;
  background: oklch(1 0 0 / 0.92);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.45rem 1.2rem;
  box-shadow: 0 4px 14px oklch(0.2 0.03 256 / 0.14);
}
.lb-close, .lb-nav {
  position: fixed;
  background: oklch(1 0 0 / 0.75);
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 1.7rem;
  line-height: 1;
  width: 2.9rem;
  height: 2.9rem;
  border-radius: 50%;
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: 0 2px 10px oklch(0.2 0.03 256 / 0.12);
  transition: background 0.2s var(--ease-out), transform 0.2s var(--ease-out);
}
.lb-close:hover, .lb-nav:hover { background: white; transform: scale(1.06); }
.lb-close { top: 1rem; right: 1rem; }
.lb-prev { left: 1rem; top: 50%; translate: 0 -50%; }
.lb-next { right: 1rem; top: 50%; translate: 0 -50%; }

/* ---------- Reveals ---------- */
html.js .reveal {
  opacity: 0;
  translate: 0 24px;
  transition: opacity 0.8s var(--ease-out), translate 0.8s var(--ease-out);
}
html.js .reveal.in { opacity: 1; translate: 0 0; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  html.js .reveal { opacity: 1; translate: none; transition: none; }
  .gallery img, .cta, .gallery figure, .plan-img img { transition: none; }
  .gallery figure:hover img { transform: none; }
  .gallery figure:hover, .plan-img:hover img { translate: none; }
  .lightbox, .lightbox::backdrop, .lb-close, .lb-nav { transition: none; }
  .lightbox { opacity: 1; transform: none; }
}
