@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@300;400;700;800&family=Barlow:wght@300;400&display=swap');

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

:root {
  --black: #080808;
  --white: #f5f5f0;
  --grey: #888880;
  --nav-gap: 2.4rem;
  --letter-spacing-nav: 0.18em;
}

html {
  height: 100%;
  width: 100%;
}

body {
  width: 100%;
  min-height: 100%;
  background: var(--black);
  color: var(--white);
  font-family: 'Barlow', sans-serif;
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}

/* ─── NAV ─────────────────────────────────────── */

nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 2rem 2.8rem;
  gap: var(--nav-gap);
}

nav a {
  color: var(--white);
  text-decoration: none;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 400;
  font-size: 0.78rem;
  letter-spacing: var(--letter-spacing-nav);
  text-transform: uppercase;
  position: relative;
  padding: 0.6rem 0 3px;
  margin: -0.6rem 0 0;
  transition: opacity 0.25s ease;
}

nav a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--white);
  transition: width 0.3s ease;
}

nav a:hover::after,
nav a.active::after {
  width: 100%;
}

nav a.active {
  opacity: 1;
}

nav a:not(.active) {
  opacity: 0.75;
}

nav a:hover {
  opacity: 1;
}

/* ─── HOME PAGE ───────────────────────────────── */

.page-home {
  width: 100%;
  height: 100vh;
  height: 100dvh;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.page-home .bg {
  position: absolute;
  inset: 0;
  background-image: url('../img/portada-bg.jpg');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  filter: brightness(0.9) contrast(1.12) saturate(0.82);
  transform: scale(1.02);
  animation: slowZoom 18s ease-out forwards;
  will-change: transform;
}

.page-home .bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to right, rgba(4, 8, 14, 0.45) 0%, transparent 35%),
    linear-gradient(to top,   rgba(4, 8, 14, 0.50) 0%, transparent 32%),
    linear-gradient(to bottom, rgba(4, 8, 14, 0.20) 0%, transparent 22%);
}

@keyframes slowZoom {
  from { transform: scale(1.06); }
  to   { transform: scale(1.0);  }
}

.page-home .title-wrap {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 0 1.2rem;
  width: 100%;
  animation: fadeUp 1.4s cubic-bezier(0.22, 1, 0.36, 1) 0.3s both;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.site-logo {
  display: inline-flex;
  align-items: baseline;
  gap: 0.45rem;
  line-height: 1;
  flex-wrap: wrap;
  justify-content: center;
}

.site-logo .brand {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 800;
  font-size: clamp(2rem, 8vw, 4.4rem);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--white);
  text-shadow: 0 0 80px rgba(4, 8, 14, 0.65), 0 0 25px rgba(4, 8, 14, 0.4);
}

.site-logo .sub {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 300;
  font-size: clamp(0.9rem, 3.2vw, 1.85rem);
  letter-spacing: 0.12em;
  text-transform: lowercase;
  color: var(--white);
  opacity: 0.9;
}

/* ─── HOME NAV ────────────────────────────────── */

.page-home nav {
  background: transparent;
}

/* ─── NAV LOGO (inner pages) ──────────────────── */

.nav-logo {
  margin-right: auto;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 800;
  font-size: 0.88rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--white);
  text-decoration: none;
  opacity: 0.9;
  display: inline-flex;
  align-items: baseline;
  gap: 0.3rem;
}

.nav-logo .nav-sub {
  font-weight: 300;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  opacity: 0.7;
}

/* ─── INFO PAGE ───────────────────────────────── */

.page-info {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* Fons: position absolute (compatible iOS Safari) */
.page-info .bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image: url('../img/info-bg.jpg');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
}

/* Overlay fosc sobre la imatge */
.page-info .bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(8, 8, 8, 0.50);
}

.page-info .info-content {
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  padding: 7rem 3rem 4rem;
  animation: fadeUp 1.2s cubic-bezier(0.22, 1, 0.36, 1) 0.4s both;
}

.info-label {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 400;
  font-size: 0.72rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--grey);
  margin-bottom: 2rem;
}

.info-content p {
  font-family: 'Barlow', sans-serif;
  font-weight: 300;
  font-size: clamp(0.97rem, 1.8vw, 1.1rem);
  line-height: 1.82;
  color: var(--white);
  margin-bottom: 1.4rem;
}

.info-content p:last-child {
  margin-bottom: 0;
}

/* ─── PROJECTES PAGE ──────────────────────────── */

.page-projectes {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* Fons: position absolute, s'estira amb el contingut */
.page-projectes .bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image: url('../img/projectes-bg.png');
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
}

/* Overlay: gradient per llegibilitat del text llarg */
.page-projectes .bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(8, 8, 8, 0.22) 0%,
    rgba(8, 8, 8, 0.40) 40%,
    rgba(8, 8, 8, 0.55) 100%
  );
}

.page-projectes .projectes-content {
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  width: 100%;
  max-width: 740px;
  margin: 0 auto;
  padding: 7rem 3rem 5rem;
  animation: fadeUp 1.2s cubic-bezier(0.22, 1, 0.36, 1) 0.4s both;
}

.project-label {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 400;
  font-size: 0.72rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--grey);
  margin-bottom: 0.8rem;
}

.project-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 800;
  font-size: clamp(3rem, 8vw, 5.5rem);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--white);
  line-height: 1;
  margin-bottom: 2.6rem;
}

.projectes-content p {
  font-family: 'Barlow', sans-serif;
  font-weight: 300;
  font-size: clamp(0.93rem, 1.6vw, 1.04rem);
  line-height: 1.82;
  color: rgba(245, 245, 240, 0.90);
  margin-bottom: 1.2rem;
}

.projectes-content p:last-child {
  margin-bottom: 0;
}

.project-status {
  margin-top: 2.4rem;
  padding-top: 1.8rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 400;
  font-size: 0.75rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--grey);
}

/* ─── RESPONSIVE ──────────────────────────────── */

/* Tablet */
@media (max-width: 900px) {
  .page-info .info-content,
  .page-projectes .projectes-content {
    max-width: 100%;
  }
}

/* Tablet petit / mòbil gran */
@media (max-width: 768px) {
  nav {
    padding: 1.4rem 1.8rem;
    gap: 1.6rem;
  }

  .page-info .info-content,
  .page-projectes .projectes-content {
    padding: 6rem 2rem 4rem;
  }
}

/* Mòbil */
@media (max-width: 480px) {
  nav {
    padding: 1.1rem 1.4rem;
    gap: 1.2rem;
  }

  nav a {
    font-size: 0.72rem;
    letter-spacing: 0.12em;
  }

  .nav-logo {
    font-size: 0.72rem;
    letter-spacing: 0.08em;
  }

  .nav-logo .nav-sub {
    font-size: 0.65rem;
  }

  .page-info .info-content,
  .page-projectes .projectes-content {
    padding: 5rem 1.4rem 3.5rem;
  }

  .info-label,
  .project-label {
    margin-bottom: 1.4rem;
  }

  .project-title {
    font-size: clamp(2.4rem, 12vw, 3.2rem);
    margin-bottom: 1.8rem;
  }

  .info-content p,
  .projectes-content p {
    font-size: 0.95rem;
    line-height: 1.75;
    margin-bottom: 1rem;
  }

  .project-status {
    font-size: 0.68rem;
    letter-spacing: 0.16em;
    margin-top: 1.8rem;
    padding-top: 1.4rem;
  }
}

/* Mòbil petit (iPhone SE, 375px) */
@media (max-width: 390px) {
  nav {
    gap: 1rem;
    padding: 1rem 1.2rem;
  }

  nav a {
    font-size: 0.68rem;
    letter-spacing: 0.1em;
  }

  .nav-logo {
    font-size: 0.65rem;
  }

  .page-info .info-content,
  .page-projectes .projectes-content {
    padding: 4.5rem 1.2rem 3rem;
  }

  .project-title {
    font-size: clamp(2.2rem, 13vw, 2.8rem);
  }
}
