/* polalvarez.cat */

@font-face {
  font-family: "Playfair Display";
  src: url("../fonts/PlayfairDisplay.woff2") format("woff2"),
       url("../fonts/PlayfairDisplay.ttf") format("truetype");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Playfair Display";
  src: url("../fonts/PlayfairDisplay-Italic.woff2") format("woff2"),
       url("../fonts/PlayfairDisplay-Italic.ttf") format("truetype");
  font-weight: 400 900;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Host Grotesk";
  src: url("../fonts/HostGrotesk.woff2") format("woff2"),
       url("../fonts/HostGrotesk.ttf") format("truetype");
  font-weight: 300 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --negre: #111;
  --vermell: #c7352e;
  --serif: "Playfair Display", Georgia, serif;
  --grotesk: "Host Grotesk", "Helvetica Neue", Arial, sans-serif;
  --marge: clamp(16px, 2.8vw, 40px);
}

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

html, body { margin: 0; }

body {
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--grotesk);
  color: var(--negre);
  background: #fff;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; }

/* Cursor estrella (només amb ratolí) */
@media (hover: hover) and (pointer: fine) {
  html, body, a {
    cursor: url("../img/estrella-32.png?v=2") 16 16, auto;
    cursor: -webkit-image-set(url("../img/estrella-32.png?v=2") 1x, url("../img/estrella-64.png?v=2") 2x) 16 16, auto;
    cursor: image-set(url("../img/estrella-32.png?v=2") 1x, url("../img/estrella-64.png?v=2") 2x) 16 16, auto;
  }
}

/* Efecte de desenfocament lletra a lletra del menú (vegeu assets/js/nav.js) */
.blur-char { display: inline-block; will-change: filter, opacity; }
@keyframes blurLink {
  0%   { filter: blur(0);   opacity: 1; }
  50%  { filter: blur(6px); opacity: .25; }
  100% { filter: blur(0);   opacity: 1; }
}

/* ---------- Menú ---------- */
.nav {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 16px var(--marge);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 20px;
}
.nav a { padding: 12px 0; text-decoration: none; color: var(--negre); white-space: nowrap; }
.nav a:nth-child(1) { justify-self: start; }
.nav a:nth-child(2) { justify-self: center; }
.nav a:nth-child(3) { justify-self: end; }
.nav--clar a, .nav a.sobre-foto { color: #fff; }

/* ---------- Inici ---------- */
.inici {
  position: relative;
  height: 100vh;
  height: 100dvh;
  min-height: 420px;
  overflow: hidden;
  background: #0d1b2a;
  color: #fff;
}
.inici video,
.inici .vel {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
}
.inici video { object-fit: cover; opacity: 0; }
.inici video.actiu { opacity: 1; }
.inici .vel { background: rgba(0,0,0,.16); }
.inici h1 {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(104px, 18vw, 280px);
  line-height: 1;
  letter-spacing: -0.01em;
  pointer-events: none;
}

/* ---------- Sobre mi ---------- */
.sobre {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
}
.sobre__foto {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  background: #1f3a4d;
  overflow: hidden;
}
.sobre__foto img {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: 63% 50%;
}
.sobre__text {
  flex: 1.4 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 40px;
  padding: 120px clamp(24px, 6vw, 96px) 72px;
  font-family: var(--serif);
}
.sobre__text p,
.sobre__text h2 {
  margin: 0;
  max-width: 34em;
  font-size: 21px;
  line-height: 1.6;
}
.sobre__text h2 { font-weight: 400; font-style: italic; margin-bottom: 20px; }
.experiencia {
  margin: 0; padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 16px;
  font-size: 18px;
  line-height: 1.4;
}
.experiencia li { display: flex; align-items: center; gap: 24px; }
.experiencia img {
  flex: 0 0 auto;
  width: 112px; height: 63px;
  border: 1px solid #e3e3e3;
  object-fit: cover;
}
.experiencia span { max-width: 26em; }

/* ---------- Contacte ---------- */
.contacte {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 32px;
  padding: 120px var(--marge) 80px;
  text-align: center;
}
.contacte h1 {
  margin: 0;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(26px, 3.2vw, 44px);
  line-height: 1.2;
}
.contacte a { text-decoration: none; transition: color .15s; }
.contacte a:hover, .contacte a:focus-visible { color: var(--vermell); }
.contacte h1 a { display: inline-block; padding: 4px 0; }
.xarxes {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px 48px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 20px;
}
.xarxes a { display: inline-flex; align-items: center; gap: 8px; padding: 12px 0; }

/* ---------- 404 ---------- */
.error {
  position: relative;
  height: 100vh;
  height: 100dvh;
  min-height: 560px;
  overflow: hidden;
  display: flex;
  justify-content: center;
  padding: 96px var(--marge);
  background: #000;
  color: #fff;
}
.error__foto {
  position: relative;
  height: 100%;
  aspect-ratio: 4 / 3;
  max-width: 100%;
  overflow: hidden;
}
.error__foto img,
.error__foto .vel {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
}
.error__foto img { object-fit: cover; object-position: 58% 50%; }
.error__foto .vel {
  background: linear-gradient(to bottom, rgba(0,0,0,.28) 0%, rgba(0,0,0,0) 42%, rgba(0,0,0,0) 68%, rgba(0,0,0,.6) 100%);
}
.error__text {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 8vh 32px 3vh;
  text-align: center;
}
.error__text h1 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(26px, 3.4vw, 50px);
  line-height: 1.2;
  letter-spacing: -0.005em;
}
.error__text a {
  padding: 12px 8px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 20px;
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.error__text a:hover, .error__text a:focus-visible { color: rgba(255,255,255,.7); }

/* ---------- Mòbil ---------- */
@media (max-width: 800px) {
  .nav { padding: 12px 16px; font-size: 13px; }

  .inici h1 { font-size: clamp(88px, 29vw, 200px); }

  .sobre { flex-direction: column; }
  .sobre__foto { flex: 0 0 auto; height: 420px; }
  .sobre__text { flex: 1 1 auto; justify-content: flex-start; gap: 32px; padding: 32px 24px 48px; }
  .sobre__text p, .sobre__text h2 { font-size: 18px; }
  .sobre__text h2 { margin-bottom: 16px; }
  .sobre .nav a { color: #fff; }
  .experiencia { font-size: 16px; }
  .experiencia li { gap: 16px; }
  .experiencia img { width: 96px; height: 54px; }

  .contacte { gap: 24px; padding: 96px 16px 64px; }
  .xarxes { flex-direction: column; gap: 4px; font-size: 13px; }

  .error { padding: 76px 0; min-height: 480px; }
  .error__foto { width: 100%; aspect-ratio: auto; }
  .error__foto img { object-position: 60% 50%; }
  .error__text { padding: 72px 20px 20px; }
}

@media (prefers-reduced-motion: reduce) {
  .contacte a { transition: none; }
}
