@font-face {
  font-family: "Satoshi";
  src: url("../assets/fonts/satoshi/Satoshi-Variable.woff2") format("woff2"),
       url("../assets/fonts/satoshi/Satoshi-Variable.woff") format("woff");
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Satoshi";
  src: url("../assets/fonts/satoshi/Satoshi-VariableItalic.woff2") format("woff2"),
       url("../assets/fonts/satoshi/Satoshi-VariableItalic.woff") format("woff");
  font-weight: 300 900;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "Approach Mono";
  src: url("../assets/fonts/approach-mono/ApproachMono-Light.otf") format("opentype");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Approach Mono";
  src: url("../assets/fonts/approach-mono/ApproachMono-Regular.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Approach Mono";
  src: url("../assets/fonts/approach-mono/ApproachMono-Medium.otf") format("opentype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Approach Mono";
  src: url("../assets/fonts/approach-mono/ApproachMono-SemiBold.otf") format("opentype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Approach Mono";
  src: url("../assets/fonts/approach-mono/ApproachMono-Bold.otf") format("opentype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Approach Mono";
  src: url("../assets/fonts/approach-mono/ApproachMono-Black.otf") format("opentype");
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --color-granate: #400610;
  --color-granate-dark: #450c0f;
  --color-crema: #faf8f0;

  /* Escala granate (1000 -> 200) */
  --granate-1000: #450c0f;
  --granate-900: #582427;
  --granate-800: #6a3d3f;
  --granate-700: #7d5557;
  --granate-600: #8f6d6f;
  --granate-500: #a28687;
  --granate-400: #b59e9f;
  --granate-300: #c7b6b7;
  --granate-200: #dacecf;
  --color-text-dark: #130303;
  --color-text-muted: #898181;
  --color-text-year: #716868;
  --color-placeholder: #d9d9d9;

  --font-body: "Satoshi", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-heading: "malila", Georgia, serif;
  --font-mono: "Approach Mono", "SFMono-Regular", Menlo, monospace;
}

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

html {
  width: 100%;
  overflow-x: hidden;
  scroll-behavior: smooth;
}

body {
  width: 100%;
}

main {
  display: block;
  overflow-x: hidden;
}

body {
  font-family: var(--font-body);
  background: var(--color-crema);
}

/* Page transitions: new page slides in from the right, old page slides out to the left */

@view-transition {
  navigation: auto;
}

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 420ms;
  animation-timing-function: cubic-bezier(0.65, 0, 0.35, 1);
  animation-fill-mode: both;
}

::view-transition-old(root) {
  animation-name: page-slide-out;
}

::view-transition-new(root) {
  animation-name: page-slide-in;
}

@keyframes page-slide-out {
  to {
    transform: translateX(-6%);
  }
}

@keyframes page-slide-in {
  from {
    transform: translateX(100%);
  }
}

.hero {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 10;
  width: 100%;
  /* El hero és més llarg que la pantalla: a alguns mòbils la barra flotant del navegador
     deixa veure la web per sota de 100vh, així que se'n deixa mitja pantalla de marge */
  height: 150vh;
  height: calc(100lvh + 50vh);
  background: var(--color-granate);
  transition: transform 900ms cubic-bezier(0.65, 0, 0.35, 1);
}

/* Safari (iPhone) no deixa que un element fix arribi a sota de la barra flotant del navegador:
   mentre el hero és a la pantalla, tota la pàgina és granate i la web queda amagada,
   així no es veu res per sota. Quan el hero comença a pujar, la web torna a aparèixer. */
html:has(#hero:not(.hero--out)),
html:has(#hero:not(.hero--out)) body {
  background: var(--color-granate);
}

html:has(#hero:not(.hero--out)) body > :not(#hero) {
  visibility: hidden;
}

.hero--out {
  transform: translateY(-100%);
  pointer-events: none;
}

/* Hero: text que s'escriu com una màquina d'escriure, amb el cursor de bloc (Figma) */
.hero__type {
  position: absolute;
  /* Centrat a la pantalla visible, no al hero allargat */
  top: 50vh;
  top: 50dvh;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: "Approach Mono", ui-monospace, monospace;
  font-weight: 400;
  font-size: 18px;
  line-height: 16px;
  color: #fff;
  text-transform: uppercase;
  white-space: nowrap;
}

.hero__row {
  display: flex;
  align-items: center;
  gap: 13px;
}

/* La fila fantasma fixa la mida final: el text es va escrivint sense que res es mogui */
.hero__row--ghost {
  visibility: hidden;
}

.hero__row--live {
  position: absolute;
  inset: 0;
}

.hero__cursor {
  display: block;
  flex: none;
  width: 7px;
  height: 16px;
  background: var(--granate-600);
}

.hero__cursor.is-blinking {
  animation: hero-blink 1s steps(1) infinite;
}

@keyframes hero-blink {
  50% {
    opacity: 0;
  }
}

@media (max-width: 960px), (pointer: coarse) {
  .hero__type {
    top: calc(50vh - 7px);
    top: calc(50dvh - 7px);
  }
}

/* Header */

.site-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: clamp(20px, 4vw, 40px) clamp(20px, 6vw, 64px);
}

.site-header__logo {
  display: block;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  width: clamp(170px, 16vw, 240px);
  aspect-ratio: 197.348 / 51;
}

.site-header__logo img {
  position: absolute;
  top: -45.53%;
  left: -19%;
  width: 126.21%;
  height: 191.06%;
  max-width: none;
}

.site-header__nav {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.nav-link {
  position: relative;
  padding: 8px;
  border: none;
  background: none;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 18px;
  line-height: normal;
  text-transform: uppercase;
  text-align: right;
  text-decoration: none;
  color: var(--color-granate-dark);
  white-space: nowrap;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 2px;
  height: 6px;
  background: url("../assets/images/header/nav-underline.svg") no-repeat center / 100% 100%;
  opacity: 0;
  transition: opacity 200ms ease;
}

/* Current page stays underlined by default */
.nav-link--active::after {
  opacity: 1;
}

/* Hovering anywhere in the nav "un-underlines" the active item... */
.site-header__nav:hover .nav-link--active::after {
  opacity: 0;
}

/* ...and underlines whatever link is actually being hovered, active or not */
.nav-link:hover::after {
  opacity: 1;
}

/* Idioma: no underline, swaps text for EN / CA / ES on hover */
.nav-link--lang {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: default;
}

/* Icona del món al costat d'"Idioma" (Figma), del mateix color que el text */
.lang-icon {
  flex: none;
  width: 24px;
  height: 24px;
  background: currentColor;
  -webkit-mask: url("../assets/images/header/language.svg") no-repeat center / 100% 100%;
  mask: url("../assets/images/header/language.svg") no-repeat center / 100% 100%;
}

.nav-link--lang::after {
  content: none;
}

.nav-link--lang .lang-options {
  display: none;
  gap: 4px;
}

.nav-link--lang .lang-options button,
.nav-link--lang .lang-options a {
  text-decoration: none;
  border: none;
  border-bottom: 2px solid transparent;
  background: none;
  padding: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.nav-link--lang .lang-options a:hover,
.nav-link--lang .lang-options a.is-active {
  font-weight: 700;
  border-bottom-color: var(--color-granate-dark);
}

/* Amb ratolí s'obre en passar-hi per sobre; en pantalles tàctils (iPad...) s'obre amb un toc */
@media (hover: hover) and (not (pointer: coarse)) {
  .nav-link--lang:hover .lang-default {
    display: none;
  }

  .nav-link--lang:hover .lang-options {
    display: inline-flex;
  }
}

.nav-link--lang.is-open .lang-default {
  display: none;
}

.nav-link--lang.is-open .lang-options {
  display: inline-flex;
}

/* Intro title */

.intro {
  display: flex;
  align-items: center;
  min-height: 600px;
  padding: 0 clamp(20px, 6vw, 64px) clamp(40px, 8vw, 88px);
}

.intro__title {
  max-width: none;
  white-space: nowrap;
  font-family: var(--font-heading);
  font-weight: 400;
  /* Cada frase en una sola línia: la lletra s'ajusta a l'ample disponible (fins a 80px) */
  font-size: clamp(30px, calc((100vw - 2 * clamp(20px, 6vw, 64px)) / 18.2), 80px);
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--granate-1000);
}

.intro__title .letter {
  transition: color 200ms ease;
}

@media (max-width: 960px), (pointer: coarse) {
  .intro__title {
    white-space: normal;
    font-size: 42px;
  }
}

/* Marquee */

.marquee {
  overflow: hidden;
  width: 100%;
  margin: 24px 0;
  padding: 3px 0;
  background: var(--color-granate-dark);
  border: 1px solid var(--color-crema);
  transform: rotate(-1deg) scale(1.03);
  transition: background-color 200ms ease, border-color 200ms ease;
}

.marquee:hover {
  background: var(--color-crema);
  border-color: var(--color-granate-dark);
}

.marquee__track {
  display: flex;
  width: max-content;
  animation: marquee-scroll 28s linear infinite;
}

.marquee__item {
  flex-shrink: 0;
  padding: 0 149px;
  transform: rotate(0.41deg) skewX(1.1deg);
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 16px;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--color-crema);
  transition: color 200ms ease;
}

.marquee:hover .marquee__item {
  color: var(--color-granate-dark);
}

@media (max-width: 960px), (pointer: coarse) {
  .marquee {
    padding: 1px 0;
  }

  .marquee__item {
    padding: 0 48px;
    font-size: 14px;
  }
}

@keyframes marquee-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* Project list */

.projects {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
  padding: 40px clamp(20px, 6vw, 64px) 88px;
}

.project-list {
  list-style: none;
  width: 100%;
  max-width: 1312px;
}

.project-row {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  padding: 16px 0;
  border-bottom: 1px solid var(--color-granate-dark);
  text-decoration: none;
  color: var(--color-granate-dark);
}

.project-row::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("../assets/images/projects/row-hover-gradient.png") no-repeat center / 100% 100%;
  opacity: 0;
  transition: opacity 250ms ease;
  z-index: 0;
}

.project-row:hover::before {
  opacity: 1;
}

.project-row__main,
.project-row__meta {
  position: relative;
  z-index: 1;
}

.project-row__main {
  display: flex;
  align-items: center;
  gap: clamp(24px, 6vw, 136px);
  min-width: 0;
}

.project-row__year {
  flex-shrink: 0;
  width: 87px;
  font-family: var(--font-mono);
  font-size: 14px;
  text-transform: uppercase;
}

.project-row__title {
  font-family: var(--font-body);
  font-size: clamp(22px, 3vw, 36px);
  line-height: 1.1;
}

.project-row__meta {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-shrink: 0;
}

.project-row__tag {
  display: none;
  font-family: var(--font-mono);
  font-size: 14px;
  text-transform: uppercase;
  text-align: right;
  max-width: 310px;
}

.project-row__icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 31px;
  height: 31px;
}

.project-row__icon img {
  display: block;
}

.project-row__mobile-img {
  display: none;
}

@media (min-width: 961px) and (not (pointer: coarse)) {
  .project-row__tag {
    display: block;
  }
}

@media (max-width: 960px), (pointer: coarse) {
  .project-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .project-row__main {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .project-row__title {
    font-size: 30px;
    line-height: 34px;
  }

  .project-row__meta {
    width: 100%;
    justify-content: space-between;
  }

  .project-row__tag {
    display: block;
    max-width: 248px;
    text-align: left;
  }

  .project-row__mobile-img {
    display: block;
    width: 100%;
    aspect-ratio: 343 / 247;
    border-radius: 2px;
    object-fit: cover;
    background: var(--color-placeholder);
  }

  .project-row::before {
    display: none;
  }

  .project-row:hover .project-row__tag {
    text-decoration: none;
  }
}

.project-row:hover .project-row__tag {
  text-decoration: underline;
  text-decoration-thickness: 9%;
}

/* Trailing project-cover image, follows the cursor above everything else */

.trail-image {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
  width: 260px;
  max-width: 26vw;
  aspect-ratio: 389 / 280;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.85);
  border-radius: 3px;
  overflow: hidden;
}

.trail-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (max-width: 960px), (pointer: coarse) {
  .trail-image {
    display: none;
  }
}

.see-more {
  position: relative;
  border: none;
  background: none;
  cursor: pointer;
  padding: 8px;
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--color-granate-dark);
  text-decoration: none;
}

.see-more[hidden] {
  display: none;
}

.see-more::after {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 2px;
  height: 6px;
  background: url("../assets/images/header/nav-underline.svg") no-repeat center / 100% 100%;
  opacity: 0;
  transition: opacity 200ms ease;
}

.see-more:hover::after {
  opacity: 1;
}

/* Sketchbook */

.sketchbook {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding-top: 160px;
}

.sketchbook__heading {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 24px 0;
  overflow-x: hidden;
}

.sketchbook__heading .marquee {
  margin: 0;
  position: relative;
  z-index: 2;
}

.sketchbook__title {
  position: relative;
  z-index: 1;
  margin-top: -14px;
  max-width: 1312px;
  padding: 0 clamp(20px, 6vw, 64px);
  font-family: var(--font-heading);
  font-weight: 400;
  font-size: clamp(22px, 3vw, 32px);
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--granate-1000);
  text-align: center;
}

.sketchbook__gallery {
  display: flex;
  align-items: flex-end;
  gap: 24px;
  padding: 40px clamp(20px, 6vw, 64px);
  overflow-x: auto;
  cursor: grab;
  scrollbar-width: none;
  transform-origin: center center;
}

.sketchbook__gallery::-webkit-scrollbar {
  display: none;
}

.sketchbook__gallery:active {
  cursor: grabbing;
}

.sketchbook__img {
  flex-shrink: 0;
  width: clamp(180px, 22vw, 310px);
  object-fit: cover;
  pointer-events: none;
  transform-origin: center center;
}

.sketchbook__img--tall {
  aspect-ratio: 310 / 365;
}

.sketchbook__img--medium {
  aspect-ratio: 310 / 313;
}

.sketchbook__img--short {
  aspect-ratio: 310 / 240;
}

/* Footer */

.site-footer {
  --footer-pad-x: clamp(20px, 6vw, 64px);
  --footer-grow: 64px;
  padding: clamp(40px, 6vw, 96px) var(--footer-pad-x) clamp(32px, 5vw, 64px);
}

.site-footer__card {
  position: relative;
  max-width: 1312px;
  min-height: 420px;
  margin: 0 auto;
}

/* The background is a separate layer, so it can grow on hover without
   dragging the content inside it along for the ride. */
.site-footer__bg {
  position: absolute;
  inset: 0;
  left: 0;
  right: 0;
  margin-left: 0;
  margin-right: 0;
  z-index: 0;
  border-radius: 16px;
  background: var(--color-granate-dark);
  transition: left 500ms cubic-bezier(0.65, 0, 0.35, 1),
              right 500ms cubic-bezier(0.65, 0, 0.35, 1),
              margin-left 500ms cubic-bezier(0.65, 0, 0.35, 1),
              margin-right 500ms cubic-bezier(0.65, 0, 0.35, 1),
              bottom 500ms cubic-bezier(0.65, 0, 0.35, 1),
              border-radius 500ms cubic-bezier(0.65, 0, 0.35, 1);
}

.site-footer:hover .site-footer__bg {
  /* Break out of the centered/max-width card to run edge-to-edge with the
     viewport, no matter how wide the window is. */
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
  bottom: calc(var(--footer-grow) * -1);
  border-radius: 0;
}

/* There's no hover on touch devices, so the mobile footer always sits in
   the "hover" full-bleed state from the Figma design. */
@media (max-width: 960px), (pointer: coarse) {
  .site-footer__bg,
  .site-footer:hover .site-footer__bg {
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    bottom: 0;
    border-radius: 0;
  }

  /* La web acaba just al final del footer granate: sense franja ni scroll de més */
  .site-footer {
    padding-bottom: 0;
  }

  .site-footer__card {
    padding-bottom: 32px;
  }

  /* Rebot natural: per sota de la web, el rebot es veu granate (continua el footer) i per dalt, crema */
  html {
    background-color: var(--color-granate-dark);
    background-image:
      linear-gradient(var(--color-crema), var(--color-crema)),
      linear-gradient(var(--color-crema), var(--color-crema));
    background-repeat: no-repeat;
    background-size: 100% 100%, 100% 100vh;
    background-position: 0 0, 0 -100vh;
  }
}

.site-footer__content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 88px;
  min-height: 420px;
  padding: clamp(32px, 5vw, 88px) clamp(24px, 5vw, 64px) clamp(24px, 4vw, 48px);
}

.site-footer__title {
  max-width: 700px;
  font-family: var(--font-heading);
  font-weight: 400;
  font-size: clamp(36px, 6vw, 72px);
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--color-crema);
}

.site-footer__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.site-footer__email {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 20px;
  line-height: 24px;
  color: var(--color-crema);
  text-decoration: none;
}

.site-footer__email:hover {
  text-decoration: underline;
}

.site-footer__links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}

.footer-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 20px;
  line-height: 24px;
  color: var(--color-crema);
  text-decoration: none;
}

.footer-link img {
  width: 20px;
  height: 20px;
}

.footer-link::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 34px;
  bottom: 5px;
  height: 4.5px;
  background: url("../assets/images/footer/link-underline.svg") no-repeat center / 100% 100%;
  opacity: 0;
  transition: opacity 200ms ease;
}

.footer-link:hover::after {
  opacity: 1;
}

@media (max-width: 960px), (pointer: coarse) {
  .site-footer__content {
    gap: 40px;
    padding: 52px 24px 48px;
    min-height: auto;
  }

  .site-footer__row {
    flex-direction: column;
    align-items: flex-start;
    gap: 24px;
  }

  .site-footer__links {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .footer-link {
    padding-left: 0;
  }

  .footer-link::after {
    left: 0;
  }

  .footer-link img {
    width: 33px;
    height: 33px;
  }
}

/* Sobre mi */

.site-header--sticky {
  position: sticky;
  top: 0;
  z-index: 20;
  background: transparent;
}

/* A la home la capçalera queda per sota de la intro (hero) */
.site-header--under-hero {
  z-index: 9;
}

.about-hero {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 190px clamp(20px, 6vw, 64px) 0;
  min-height: 540px;
  transition: min-height 400ms ease, padding 400ms ease;
}

.about-hero__title {
  max-width: 866px;
  font-family: var(--font-heading);
  font-weight: 400;
  font-size: clamp(32px, 7vw, 64px);
  line-height: 1.06;
  letter-spacing: -0.03em;
  color: var(--granate-1000);
  text-align: center;
  transition: font-size 400ms ease;
}

.about-hero.is-compact {
  min-height: 270px;
  padding-top: 89px;
}

.about-hero.is-compact .about-hero__title {
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.1;
}

.about-bio {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 100px;
  min-height: 472px;
  padding: 40px clamp(20px, 8vw, 175px);
  overflow: hidden;
}

.about-bio__image img {
  display: block;
  width: 335px;
  max-width: 100%;
  height: auto;
  aspect-ratio: 335 / 322;
  object-fit: cover;
}

.about-bio__text {
  max-width: 463px;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 16px;
  line-height: 20px;
  color: var(--color-text-dark);
}

.marquee--about {
  position: absolute;
  top: 119px;
  left: 0;
  width: 100%;
  margin: 0;
  transform: translateY(-50%) rotate(1deg) scale(1.05);
  z-index: 2;
}

.about-bio__image,
.about-bio__text {
  position: relative;
  z-index: 1;
}

.about-block {
  padding: 40px clamp(20px, 8vw, 175px) 80px;
}

.about-block--single {
  padding: 40px clamp(20px, 8vw, 175px) 80px;
}

.about-block__heading {
  margin-bottom: 40px;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 36px;
  line-height: 40px;
  color: var(--color-text-dark);
}

.about-block__columns {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
}

.about-block__col {
  display: flex;
  flex-direction: column;
  gap: 32px;
  width: 533px;
  max-width: 100%;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 16px;
  line-height: 20px;
  color: var(--color-text-dark);
}

.about-entry {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.about-entry__line--meta {
  color: var(--color-text-year);
}

.about-block--single p {
  max-width: 868px;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 16px;
  line-height: 20px;
  color: var(--color-text-dark);
}

@media (max-width: 960px), (pointer: coarse) {
  .about-hero {
    padding: 120px 16px 0;
    min-height: 270px;
  }

  .about-hero__title {
    font-size: 30px;
    line-height: 34px;
    letter-spacing: -0.03em;
  }

  .about-hero.is-compact {
    min-height: 120px;
    padding-top: 36px;
  }

  .about-hero.is-compact .about-hero__title {
    font-size: 22px;
    line-height: 1.1;
  }

  .sketchbook {
    padding-top: 40px;
    padding-bottom: 88px;
  }

  .about-bio {
    min-height: 0;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 40px;
    padding: 24px 16px 40px;
  }

  .about-bio__image {
    position: relative;
    z-index: 1;
    width: 100%;
    margin-top: -14px;
  }

  .about-bio__image img {
    width: 100%;
    aspect-ratio: 343 / 322;
  }

  .about-bio__text {
    max-width: none;
    max-height: none;
    overflow: visible;
  }

  .marquee--about {
    position: relative;
    top: 62px;
    z-index: 2;
    order: -1;
    width: 100vw;
    margin-left: calc(50% - 50vw);
    transform: rotate(1deg);
  }

  .about-block,
  .about-block--single {
    padding: 40px 16px;
  }

  .about-block__heading {
    font-size: 30px;
    line-height: 34px;
  }

  .about-block__columns {
    flex-direction: column;
    gap: 24px;
  }

  .about-block__col {
    gap: 24px;
    width: auto;
    max-width: none;
  }

  .about-block--single p {
    max-width: none;
  }
}

/* Detall de projecte */

.project-intro {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 40px clamp(20px, 6vw, 64px);
}

.project-intro__text {
  max-width: 463px;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 16px;
  line-height: 20px;
  color: var(--color-text-dark);
}

.project-intro__meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  text-align: right;
}

.project-intro__year {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 36px;
  line-height: 40px;
  color: var(--color-text-muted);
}

.project-intro__title {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: clamp(36px, 6vw, 64px);
  line-height: 1.06;
  color: var(--color-text-dark);
}

.project-cover {
  width: 100%;
  aspect-ratio: 1440 / 719;
}

.project-cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-body {
  display: flex;
  flex-direction: column;
  gap: 48px;
  padding: 56px clamp(20px, 6vw, 64px);
}

.project-block {
  width: 100%;
}

.project-paragraph {
  display: flex;
  justify-content: center;
  padding: 40px 0;
}

.project-paragraph p {
  max-width: 866px;
  text-align: center;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 16px;
  line-height: 20px;
  color: var(--color-text-dark);
}

.project-trio {
  display: flex;
  gap: 24px;
}

.project-trio__img {
  flex: 1;
  aspect-ratio: 421 / 367;
  border-radius: 4px;
  background: var(--color-placeholder);
}

.project-feature {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.project-feature__slides {
  position: relative;
  width: 100%;
  aspect-ratio: 1312 / 719;
  border-radius: 4px;
  overflow: hidden;
  cursor: pointer;
}

.project-feature__slide {
  position: absolute;
  inset: 0;
  background: var(--color-placeholder);
  opacity: 0;
  transition: opacity 500ms ease;
}

.project-feature__slide:nth-child(2) {
  filter: brightness(0.96);
}

.project-feature__slide:nth-child(3) {
  filter: brightness(0.92);
}

.project-feature__slide:nth-child(4) {
  filter: brightness(0.88);
}

.project-feature__slide.is-active {
  opacity: 1;
}

.project-feature__progress {
  display: flex;
  gap: 8px;
  width: 422px;
  max-width: 100%;
}

.project-feature__progress-seg {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: var(--granate-200);
  overflow: hidden;
}

.project-feature__progress-fill {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--granate-1000);
  transition: width var(--drain-ms, 350ms) ease;
}

.project-feature__progress-seg.is-done .project-feature__progress-fill {
  width: 100%;
  transition: none;
}

.project-feature__progress-seg.is-active .project-feature__progress-fill {
  width: 100%;
  transition: width var(--slide-ms, 4000ms) linear;
}

.project-split {
  display: flex;
  align-items: flex-start;
  gap: 24px;
}

.project-split--reverse {
  flex-direction: row-reverse;
}

.project-split__media {
  flex: 1.417 1 0%;
  aspect-ratio: 755 / 474;
  border-radius: 4px;
  background: var(--color-placeholder);
}

.project-split__text {
  flex: 1 1 0%;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 16px;
  line-height: 20px;
  color: var(--color-text-dark);
}

.project-duo {
  display: flex;
  align-items: center;
  gap: 24px;
}

.project-duo--reverse {
  flex-direction: row-reverse;
}

.project-duo__img {
  border-radius: 4px;
  background: var(--color-placeholder);
}

.project-duo__img--sm {
  flex: 1 1 0%;
  aspect-ratio: 533 / 474;
}

.project-duo__img--lg {
  flex: 1.417 1 0%;
  aspect-ratio: 755 / 474;
}

.project-video {
  position: relative;
  display: flex;
  justify-content: center;
}

.project-video__img {
  width: 100%;
  max-width: 866px;
  aspect-ratio: 866 / 475;
  border-radius: 3px;
  background: var(--color-placeholder);
}

.project-video__play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: clamp(56px, 8vw, 86px);
  height: clamp(56px, 8vw, 86px);
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
}

.project-video__play img {
  display: block;
  width: 100%;
  height: 100%;
  transform: rotate(180deg) scaleY(-1);
}

.marquee--other-projects {
  margin: 0;
}

.project-carousel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
  padding: 40px 0;
}

.project-carousel__controls {
  display: flex;
  justify-content: space-between;
  width: 100%;
  padding: 0 clamp(20px, 6vw, 64px);
}

.project-carousel__btn {
  width: 46px;
  height: 46px;
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
}

.project-carousel__btn img {
  display: block;
  width: 100%;
  height: 100%;
}

.project-carousel__track {
  display: flex;
  gap: 16px;
  width: 100%;
  padding: 0 clamp(20px, 6vw, 64px);
  scroll-padding: 0 clamp(20px, 6vw, 64px);
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  cursor: grab;
}

.project-carousel__track::-webkit-scrollbar {
  display: none;
}

.project-carousel__track:active,
.project-carousel__track.is-dragging {
  cursor: grabbing;
}

.project-carousel__track.is-dragging {
  user-select: none;
}

.project-carousel__track.is-dragging a {
  cursor: grabbing;
}

.project-carousel__card {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 32px;
  width: 552px;
  scroll-snap-align: start;
  text-decoration: none;
}

.project-carousel__img {
  width: 100%;
  aspect-ratio: 552 / 360;
  border-radius: 6.7px;
  background: var(--color-placeholder);
}

.project-carousel__meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.project-carousel__year {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 20px;
  line-height: 24px;
  color: var(--color-text-muted);
}

.project-carousel__title {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 36px;
  line-height: 40px;
  color: var(--color-text-dark);
}

.project-carousel__desc {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 24px;
  line-height: 28px;
  color: var(--color-text-muted);
}

@media (max-width: 960px), (pointer: coarse) {
  .project-split,
  .project-duo {
    flex-direction: column;
  }

  .project-split__media,
  .project-duo__img {
    flex: 0 0 auto;
    width: 100%;
  }

  .project-intro {
    flex-direction: column;
    align-items: flex-start;
    gap: 56px;
    padding: 40px 16px;
  }

  .project-intro__meta {
    order: -1;
    width: 100%;
  }

  .project-intro__text {
    max-width: none;
    text-align: left;
  }

  .project-intro__year {
    font-size: 30px;
    line-height: 34px;
  }

  .project-intro__title {
    font-size: 42px;
    line-height: 46px;
  }

  /* La portada manté la proporció de l'escriptori perquè no es retalli la foto */
  .project-cover {
    aspect-ratio: 1440 / 719;
  }

  .project-body {
    padding: 40px 16px;
  }

  .project-trio {
    flex-direction: column;
    gap: 24px;
  }

  .project-trio__img {
    aspect-ratio: 343 / 367;
  }

  .project-video__img {
    max-width: none;
    aspect-ratio: 1312 / 719;
  }

  .project-video__play {
    width: 52px;
    height: 52px;
  }

  .project-carousel__controls {
    display: none;
  }

  .project-carousel__track {
    gap: 8px;
    padding: 0 16px;
    scroll-padding: 0 16px;
  }

  .project-carousel__card {
    width: 260px;
    gap: 24px;
  }

  .project-carousel__img {
    aspect-ratio: 260 / 170;
    border-radius: 3.234px;
  }

  .project-carousel__year {
    font-size: 14px;
    line-height: 18px;
  }

  .project-carousel__title {
    font-size: 24px;
    line-height: 28px;
  }

  .project-carousel__desc {
    font-size: 18px;
    line-height: 22px;
  }
}

/* Mobile nav: hamburger + full-screen overlay */

.site-header__burger {
  display: none;
  width: 46px;
  height: 46px;
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
  flex-shrink: 0;
}

.site-header__burger img {
  display: block;
  width: 100%;
  height: 100%;
}

.mobile-menu {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 50;
}

.mobile-menu.is-open,
.mobile-menu.is-closing {
  display: flex;
}

.mobile-menu__panel {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 72px;
  padding: 24px;
  background: var(--color-granate-dark);
  animation: mobile-menu-in 700ms cubic-bezier(0.65, 0, 0.35, 1);
  transform-origin: top right;
}

.mobile-menu.is-closing .mobile-menu__panel {
  animation: mobile-menu-out 700ms cubic-bezier(0.65, 0, 0.35, 1) forwards;
}

@keyframes mobile-menu-in {
  from {
    clip-path: inset(0% 0% 100% 100% round 24px);
  }
  to {
    clip-path: inset(0% 0% 0% 0% round 0px);
  }
}

@keyframes mobile-menu-out {
  from {
    clip-path: inset(0% 0% 0% 0% round 0px);
  }
  to {
    clip-path: inset(0% 0% 100% 100% round 24px);
  }
}

.mobile-menu__close {
  width: 46px;
  height: 46px;
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
}

.mobile-menu__close img {
  display: block;
  width: 100%;
  height: 100%;
}

.mobile-menu__nav {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  width: 100%;
}

.mobile-menu__link {
  padding: 8px;
  font-family: var(--font-body);
  font-size: 18px;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--color-crema);
}

.mobile-menu__lang {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px;
  font-family: var(--font-body);
  font-size: 18px;
  text-transform: uppercase;
  color: var(--color-crema);
  text-align: right;
}

.mobile-menu__lang-options {
  display: none;
  gap: 4px;
  justify-content: flex-end;
}

.mobile-menu__lang-options button,
.mobile-menu__lang-options a {
  text-decoration: none;
  border: none;
  border-bottom: 2px solid transparent;
  background: none;
  padding: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.mobile-menu__lang-options a.is-active {
  font-weight: 700;
  border-bottom-color: var(--color-crema);
}

.mobile-menu.is-lang-open .mobile-menu__lang-default {
  display: none;
}

.mobile-menu.is-lang-open .mobile-menu__lang-options {
  display: inline-flex;
}

@media (max-width: 960px), (pointer: coarse) {
  .site-header {
    align-items: flex-start;
    padding: 18px 16px 10px;
    background: var(--color-crema);
  }

  .site-header__logo {
    width: 171px;
  }

  .site-header__nav {
    display: none;
  }

  .site-header__burger {
    display: block;
  }
}

/* Mobile: tighten the space between the last block and the footer */
@media (max-width: 960px), (pointer: coarse) {
  .projects {
    padding-bottom: 24px;
  }

  .sketchbook {
    padding-bottom: 0;
  }

  .sketchbook__gallery {
    padding-bottom: 16px;
  }

  .project-carousel {
    padding-bottom: 16px;
  }

  .site-footer {
    --footer-pad-x: 0px;
    padding-top: 16px;
  }
}

/* Imatges pujades des del CMS dins dels mòduls */
.project-trio__img,
.project-feature__slide,
.project-split__media,
.project-duo__img,
.project-video__img,
.project-carousel__img {
  overflow: hidden;
}

.project-trio__img img,
.project-feature__slide img,
.project-split__media img,
.project-duo__img img,
.project-video__img img,
.project-carousel__img img,
.project-trio__img video,
.project-feature__slide video,
.project-split__media video,
.project-duo__img video,
.project-video__img video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-video__play {
  display: block;
}

.project-feature__slide:has(img),
.project-feature__slide:has(video) {
  filter: none;
}

.project-video.is-playing .project-video__play {
  display: none;
}

.project-feature.is-single .project-feature__slides {
  cursor: default;
}

/* Enquadrament de les fotos: les verticals (o les marcades "sencera") es mostren senceres amb marges negres */
img.fit-contain,
video.fit-contain,
img.is-portrait:not(.fit-fixed),
video.is-portrait:not(.fit-fixed) {
  object-fit: contain;
  background: #000;
}

/* Header escriptori (Figma 91:394): barra horitzontal amb fons */
@media (min-width: 961px) and (not (pointer: coarse)) {
  .site-header,
  .site-header--sticky {
    align-items: center;
    padding: 17.5px clamp(20px, 6vw, 64px);
    background: var(--color-crema);
  }

  .site-header__logo {
    width: clamp(170px, 16vw, 197.348px);
  }

  .site-header__nav {
    flex-direction: row;
    align-items: center;
    gap: 42px;
  }

  .nav-link {
    padding: 8px 0 8px 8px;
    font-size: 16px;
  }

  .nav-link::after {
    right: 0;
  }
}

/* Galeria (prova) */

.desk {
  position: relative;
  min-height: 680px;
  margin: 0 clamp(16px, 4.5vw, 64px);
  border-radius: 16px;
  background: var(--color-granate-dark);
  overflow: hidden;
  user-select: none;
}

.desk__folders {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 56px 24px 24px;
  width: max-content;
}

.desk-folder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 88px;
  border: none;
  background: none;
  padding: 0;
  color: var(--color-crema);
  cursor: pointer;
}

.desk-folder__icon {
  position: relative;
  display: block;
  width: 80px;
  height: 80px;
}

.desk-folder__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transition: opacity 180ms ease;
}

.desk-folder__img--open {
  opacity: 0;
}

.desk-folder:hover .desk-folder__img,
.desk-folder:focus-visible .desk-folder__img,
.desk-folder.is-open .desk-folder__img {
  opacity: 0;
}

.desk-folder:hover .desk-folder__img--open,
.desk-folder:focus-visible .desk-folder__img--open,
.desk-folder.is-open .desk-folder__img--open {
  opacity: 1;
}

.desk-folder__name {
  font-family: var(--font-mono);
  font-size: 14px;
}

.desk-file {
  position: absolute;
  width: 150px;
  margin: 0;
  padding: 8px 8px 6px;
  background: var(--color-crema);
  border-radius: 2px;
  transform: rotate(var(--rot, 0deg));
  cursor: grab;
  touch-action: none;
}

.desk-file img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

.desk-file figcaption {
  padding-top: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--color-granate-dark);
}

.gwin {
  position: absolute;
  width: min(780px, 90%);
  background: var(--color-crema);
  border: 1px solid var(--color-crema);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.35);
}

.gwin[hidden] {
  display: none;
}

.gwin__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--color-granate-dark);
  cursor: grab;
  touch-action: none;
}

.gwin__title {
  font-family: var(--font-mono);
  font-size: 14px;
  text-transform: none;
  color: var(--color-granate-dark);
}

.gwin__close {
  border: none;
  background: none;
  padding: 0 4px;
  font-size: 24px;
  line-height: 1;
  color: var(--color-granate-dark);
  cursor: pointer;
}

.gwin__body {
  display: grid;
  grid-template-columns: 280px 1fr;
  height: 440px;
}

.gwin__list {
  list-style: none;
  min-height: 0;
  overflow-y: auto;
  border-right: 1px solid var(--color-granate-dark);
}

.gwin__lists {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-right: 1px solid var(--color-granate-dark);
}

.gwin__lists > .gwin__list {
  flex: 1;
  border-right: none;
}

.gwin__list[hidden] {
  display: none;
}

.gwin__sub {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  border: none;
  border-bottom: 1px solid rgba(69, 12, 15, 0.15);
  background: none;
  padding: 12px 14px;
  font-family: var(--font-mono);
  font-size: 13px;
  text-align: left;
  color: var(--color-granate-dark);
  cursor: pointer;
}

.gwin__sub:hover {
  background: var(--color-granate-dark);
  color: var(--color-crema);
}

.gwin__subname {
  display: flex;
  align-items: center;
  gap: 8px;
}

.gwin__subname svg {
  width: 16px;
  height: 12px;
  flex: none;
}

.gwin__back {
  border-bottom: 1px solid var(--color-granate-dark);
}

.gwin__item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  border: none;
  border-bottom: 1px solid rgba(69, 12, 15, 0.15);
  background: none;
  padding: 12px 14px;
  font-family: var(--font-mono);
  font-size: 13px;
  text-align: left;
  color: var(--color-granate-dark);
  cursor: pointer;
}

.gwin__item:hover,
.gwin__item.is-active {
  background: var(--color-granate-dark);
  color: var(--color-crema);
}

.gwin__thumb {
  display: none;
}

.gwin__preview {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.gwin__preview img {
  max-width: 100%;
  max-height: 100%;
  min-height: 0;
  object-fit: contain;
  cursor: zoom-in;
}

.glight {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 32px;
  background: rgba(40, 6, 8, 0.94);
  cursor: zoom-out;
  touch-action: none;
}

.glight[hidden] {
  display: none;
}

.glight img {
  max-width: 100%;
  max-height: calc(100vh - 110px);
  object-fit: contain;
}

.glight__caption {
  font-family: var(--font-mono);
  font-size: 14px;
  text-transform: none;
  color: var(--color-crema);
}

/* La foto creix en obrir-se (a mòbil no hi ha hover) */
.glight:not([hidden]) {
  animation: glight-bg 300ms ease both;
}

.glight:not([hidden]) img {
  animation: glight-zoom 450ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

@keyframes glight-bg {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes glight-zoom {
  from { transform: scale(0.45); opacity: 0.4; }
  to { transform: scale(1); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .glight:not([hidden]),
  .glight:not([hidden]) img { animation: none; }
}

@media (max-width: 960px), (pointer: coarse) {
  .desk {
    min-height: 0;
    padding-bottom: 24px;
  }

  .desk__folders {
    flex-direction: row;
    gap: 8px;
    padding: 24px 16px 12px;
    width: auto;
  }

  .desk-file {
    display: none;
  }

  /* A mòbil les finestres són un pop-up centrat a la pantalla */
  .gwin {
    position: fixed;
    left: 50% !important;
    top: 50% !important;
    z-index: 150 !important;
    width: calc(100vw - 32px);
    max-width: 440px;
    margin: 0;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 0 100vmax rgba(40, 6, 8, 0.62);
  }

  .gwin__body {
    display: block;
    height: auto;
    max-height: calc(100vh - 160px);
    overflow-y: auto;
  }

  .gwin__note {
    max-height: calc(100vh - 160px);
  }

  .gwin__list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 12px;
    border-right: none;
  }

  .gwin__item {
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    border: none;
    padding: 0;
    font-size: 12px;
  }

  .gwin__item:hover,
  .gwin__item.is-active {
    background: none;
    color: var(--color-granate-dark);
  }

  .gwin__thumb {
    display: block;
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
  }

  .gwin__preview {
    display: none;
  }
}

/* Polaroid fantasma mentre s'arrossega un arxiu de la finestra */
.desk-file--ghost {
  position: fixed;
  z-index: 300;
  margin: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) rotate(-3deg);
  opacity: 0.9;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
}

/* Escriptori: barra de menú, frase central i widgets (referència: elenagonci.com) */

.desk__bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 32px;
  padding: 0 16px;
  background: rgba(250, 248, 240, 0.12);
  backdrop-filter: blur(8px);
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--color-crema);
}

.desk__folders {
  position: absolute;
  top: 56px;
  left: 24px;
  z-index: 1;
  padding: 0;
}

.desk__tagline {
  position: absolute;
  inset: 32px 0 0;
  z-index: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 0 0;
  font-family: var(--font-heading);
  font-size: clamp(36px, 5vw, 64px);
  line-height: 1.05;
  letter-spacing: -0.03em;
  text-align: center;
  color: var(--color-crema);
  pointer-events: none;
}

.desk__widgets {
  position: absolute;
  top: 56px;
  right: 24px;
  z-index: 1;
  display: grid;
  grid-template-columns: 122px 216px;
  gap: 12px;
}

.widget {
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--color-crema);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  color: var(--color-granate-dark);
}

.widget--weather {
  grid-column: 1 / -1;
}

.widget__title {
  margin-bottom: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: capitalize;
  opacity: 0.6;
}

.clock {
  position: relative;
  width: 76px;
  height: 76px;
  margin: 0 auto;
}

.clock__tick {
  position: absolute;
  top: 0;
  left: 50%;
  width: 1px;
  height: 4px;
  margin-left: -0.5px;
  background: rgba(69, 12, 15, 0.45);
  transform-origin: 50% 38px;
  transform: rotate(var(--r));
}

.clock__tick--main {
  height: 5px;
  width: 1.5px;
  background: rgba(69, 12, 15, 0.7);
}

.clock__city {
  position: absolute;
  top: 20px;
  left: 0;
  right: 0;
  font-family: var(--font-body);
  font-size: 7px;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-granate-dark);
  opacity: 0.55;
}

.clock i {
  position: absolute;
  bottom: 50%;
  left: 50%;
  border-radius: 2px;
  background: var(--color-granate-dark);
  transform-origin: 50% 100%;
}

.clock__h { height: 17px; width: 3.5px; margin-left: -1.75px; }
.clock__m { height: 27px; width: 3px; margin-left: -1.5px; }
.clock__s { height: 29px; width: 1px; margin-left: -0.5px; background: #e0552a; }

.clock__s::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 0;
  width: 1px;
  height: 8px;
  background: #e0552a;
}

.clock::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 5px;
  height: 5px;
  margin: -2.5px 0 0 -2.5px;
  border-radius: 50%;
  background: #e0552a;
}

.widget__song {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 20px;
}

.widget__artist {
  margin-top: 4px;
  font-family: var(--font-mono);
  font-size: 12px;
  opacity: 0.65;
}

.widget__progress {
  height: 4px;
  margin: 10px 0 4px;
  border-radius: 2px;
  background: rgba(69, 12, 15, 0.18);
  cursor: pointer;
}

.widget__progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: 2px;
  background: var(--color-granate-dark);
}

.widget__controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
}

.widget__controls button {
  border: none;
  background: none;
  padding: 2px 8px;
  font-size: 16px;
  color: var(--color-granate-dark);
  cursor: pointer;
}

.widget__controls button:disabled {
  opacity: 0.3;
  cursor: default;
}

.forecast {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-family: var(--font-body);
  font-size: 11px;
  text-align: center;
}

.forecast div {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.wicon {
  width: 20px;
  height: 20px;
}

.forecast b {
  font-weight: 400;
  font-size: 11px;
}

.widget__desc {
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  opacity: 0.65;
}

@media (max-width: 960px), (pointer: coarse) {
  .desk__bar {
    position: relative;
  }

  .desk__tagline {
    position: relative;
    inset: auto;
    padding: 32px 16px 8px;
    font-size: 36px;
  }

  .desk__folders {
    position: relative;
    top: auto;
    left: auto;
    padding: 8px 16px 12px;
  }

  .desk__widgets {
    position: relative;
    top: auto;
    right: auto;
    grid-template-columns: 1fr;
    margin: 12px 16px 0;
  }

  .widget--clock {
    display: none;
  }
}

/* Arxius de text amagats */

.desk-note {
  position: absolute;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 88px;
  border: none;
  background: none;
  padding: 0;
  color: var(--color-crema);
  cursor: pointer;
  touch-action: none;
}

.desk-note svg {
  width: 44px;
  height: auto;
  transition: transform 180ms ease;
}

.desk-note:hover svg {
  transform: translateY(-3px) rotate(-3deg);
}

.desk-note span {
  font-family: var(--font-mono);
  font-size: 12px;
}

.gwin--note {
  width: min(440px, 90%);
}

.gwin__note {
  max-height: 420px;
  overflow-y: auto;
  padding: 24px 28px 32px;
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 22px;
  color: var(--color-granate-dark);
}

@media (max-width: 960px), (pointer: coarse) {
  .desk-note {
    position: relative;
    left: auto !important;
    top: auto !important;
    display: inline-flex;
    margin: 12px 0 0 16px;
  }
}

.gwin--note .gwin__title {
  text-transform: none;
}

/* Marquesina "Galeria" i títol només per a lectors de pantalla */

.gallery__title {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.gallery {
  position: relative;
}

.marquee--gallery {
  margin: 40px 0 32px;
}

/* Reproductor de YouTube (sense interfície pròpia) */
.yt-host {
  position: fixed;
  left: -400px;
  bottom: 0;
  width: 200px;
  height: 200px;
  pointer-events: none;
}

/* Documents amagats: PDF amb vista prèvia */
.gwin__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.gwin__open {
  font-size: 18px;
  line-height: 1;
  color: var(--color-granate-dark);
  text-decoration: none;
}

.gwin--pdf {
  width: min(520px, 90%);
}

.gwin__pdf {
  display: block;
  width: 100%;
  height: 460px;
  border: 0;
  background: #fff;
}

@media (max-width: 960px), (pointer: coarse) {
  .gwin__pdf {
    height: calc(100vh - 160px);
  }
}

/* Prova: textos de l'escriptori en Satoshi (els noms dels arxius de les carpetes es queden en Approach Mono) */
.desk__bar,
.desk-folder__name,
.desk-file figcaption,
.desk-note span,
.gwin__title,
.gwin__note,
.widget__title,
.widget__artist,
.widget__desc,
.forecast,
.glight__caption {
  font-family: var(--font-body);
}

/* Portada del disc al reproductor */
.widget__head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.widget__cover {
  flex: none;
  width: 52px;
  height: 52px;
  border-radius: 8px;
  object-fit: cover;
  background: rgba(69, 12, 15, 0.12);
}

.widget__cover[hidden] {
  display: none;
}

.widget__info {
  min-width: 0;
}

.widget__song {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Marquesina "Galeria": inclinada com la de Sobre mi i en sentit contrari */
.marquee--gallery {
  transform: rotate(1deg) scale(1.03);
}

.marquee--gallery .marquee__track {
  animation-direction: reverse;
}

/* Rellotge centrat i temps amb més aire */
.widget--clock {
  display: flex;
  align-items: center;
  justify-content: center;
}

.widget--weather {
  padding: 12px 16px 12px;
}

.widget--weather .widget__title {
  margin-bottom: 10px;
}

.forecast {
  gap: 8px;
}

.forecast div {
  gap: 5px;
}

.widget--weather .widget__desc {
  margin-top: 8px;
}

.wicon {
  width: 22px;
  height: 22px;
}

/* Rellotge: la targeta sempre és quadrada */
.widget--clock {
  align-self: start;
  width: 122px;
  height: 122px;
  aspect-ratio: 1 / 1;
  padding: 0;
}

/* ---------- Mòbil: pantalla d'iPhone ---------- */

.phone {
  display: none;
}

@media (max-width: 960px), (pointer: coarse) {
  .desk {
    display: none;
  }

  .phone {
    display: block;
    margin: 0 16px;
  }

  .phone__bezel {
    padding: 8px;
    border-radius: 54px;
    background: #14090a;
  }

  .phone__screen {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 640px;
    overflow: hidden;
    border-radius: 46px;
    background: radial-gradient(120% 80% at 20% 0%, #7a2227 0%, #450c0f 55%, #25060a 100%);
    color: var(--color-crema);
  }

  .phone__status {
    position: relative;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 48px;
    padding: 6px 28px 0;
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 600;
    transition: color 200ms ease;
  }

  .phone__screen.in-app .phone__status {
    color: var(--color-granate-dark);
  }

  .phone__island {
    position: absolute;
    top: 10px;
    left: 50%;
    width: 92px;
    height: 26px;
    margin-left: -46px;
    border-radius: 13px;
    background: #000;
  }

  .phone__sys {
    display: flex;
    align-items: center;
    gap: 6px;
  }

  .phone__sys svg {
    height: 11px;
    width: auto;
    fill: currentColor;
  }

  .phone__home {
    flex: 1;
    padding: 18px 16px 40px;
  }

  .phone__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }

  .widget--square {
    aspect-ratio: 1 / 1;
    display: flex;
    flex-direction: column;
    padding: 12px;
    border-radius: 22px;
  }

  .widget--square .widget__head {
    margin-bottom: 8px;
  }

  .widget--square .widget__cover {
    width: 44px;
    height: 44px;
    border-radius: 8px;
  }

  .widget--square .widget__song {
    font-size: 14px;
    line-height: 17px;
    -webkit-line-clamp: 2;
  }

  .widget--square .widget__artist {
    margin-top: 2px;
    font-size: 11px;
  }

  .widget--square .widget__progress {
    margin: auto 0 2px;
  }

  .widget--square .widget__controls button {
    padding: 0 6px;
    font-size: 15px;
  }

  .widget--wide {
    grid-column: 1 / -1;
    padding: 16px 18px;
    border-radius: 22px;
  }

  .phone__apps {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-auto-rows: 1fr;
    align-content: start;
    gap: 12px 8px;
  }

  .app-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    border: none;
    background: none;
    padding: 0;
    color: var(--color-crema);
    cursor: pointer;
  }

  .app-icon__img {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: var(--color-crema);
  }

  .app-icon__img img {
    width: 46px;
    height: 46px;
  }

  .app-icon__name {
    font-family: var(--font-body);
    font-size: 12px;
  }

  .app-icon:active .app-icon__img {
    transform: scale(0.94);
  }

  .phone__indicator {
    position: absolute;
    bottom: 8px;
    left: 50%;
    z-index: 6;
    width: 120px;
    height: 5px;
    margin-left: -60px;
    border-radius: 3px;
    background: var(--color-crema);
    transition: background-color 200ms ease;
  }

  .phone__screen.in-app .phone__indicator {
    background: var(--color-granate-dark);
  }

  /* L'app Galeria (àlbums i fotos) */
  .app {
    position: absolute;
    inset: 0;
    z-index: 4;
    display: flex;
    flex-direction: column;
    padding-top: 48px;
    overflow-y: auto;
    background: var(--color-crema);
    color: var(--color-granate-dark);
    transform: translateX(100%);
    visibility: hidden;
    transition: transform 280ms cubic-bezier(0.32, 0.72, 0, 1), visibility 0s 280ms;
  }

  .app.is-open {
    transform: translateX(0);
    visibility: visible;
    transition: transform 280ms cubic-bezier(0.32, 0.72, 0, 1);
  }

  .app__bar {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    background: var(--color-crema);
  }

  .app__back {
    position: absolute;
    left: 12px;
    display: flex;
    align-items: center;
    gap: 2px;
    border: none;
    background: none;
    padding: 4px;
    font-family: var(--font-body);
    font-size: 16px;
    color: var(--color-granate-dark);
    cursor: pointer;
  }

  .app__back span:first-child {
    font-size: 30px;
    line-height: 1;
    margin-top: -3px;
  }

  .app__title {
    font-family: var(--font-body);
    font-size: 17px;
    font-weight: 600;
  }

  .app__view[hidden] {
    display: none;
  }

  .app__albums {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px 14px;
    padding: 16px;
  }

  .album {
    display: flex;
    flex-direction: column;
    gap: 2px;
    border: none;
    background: none;
    padding: 0;
    text-align: left;
    color: var(--color-granate-dark);
    cursor: pointer;
  }

  .album__cover {
    width: 100%;
    aspect-ratio: 1;
    margin-bottom: 4px;
    border-radius: 10px;
    object-fit: cover;
  }

  .album__name {
    font-family: var(--font-body);
    font-size: 15px;
  }

  .album__count {
    font-family: var(--font-body);
    font-size: 13px;
    opacity: 0.55;
  }

  .app__photos {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2px;
    padding: 2px 0 24px;
  }

  .photo {
    display: block;
    aspect-ratio: 1;
    border: none;
    background: none;
    padding: 0;
    cursor: pointer;
  }

  .photo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
}

@media (max-width: 960px), (pointer: coarse) {
  .phone__home {
    display: flex;
  }

  .phone__grid {
    flex: 1;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto 1fr;
    align-items: end;
    padding-bottom: 8px;
  }

  .widget--wide {
    grid-column: 1 / -1;
    align-self: start;
  }

  .widget--square {
    width: 100%;
  }

  .phone__dock {
    display: flex;
    justify-content: center;
    padding: 0;
    background: none;
  }
}

@media (max-width: 960px), (pointer: coarse) {
  .widget--square {
    overflow: hidden;
    padding: 12px 12px 8px;
  }

  .widget--square .widget__head {
    margin-bottom: 6px;
  }

  .widget--square .widget__cover {
    width: 38px;
    height: 38px;
  }

  .widget--square .widget__song {
    font-size: 13px;
    line-height: 16px;
  }

  .widget--square .widget__artist {
    display: none;
  }

  .widget--square .widget__progress {
    margin: auto 0 4px;
  }

  .widget--square .widget__controls button {
    font-size: 14px;
    padding: 0 5px;
  }
}

/* Mòbil: música just sota el temps; l'app Galeria a baix a l'esquerra */
@media (max-width: 960px), (pointer: coarse) {
  .phone__grid {
    grid-template-rows: auto auto 1fr;
    align-items: start;
  }

  .widget--wide {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  .widget--square {
    grid-column: 1;
    grid-row: 2;
  }

  .phone__dock {
    grid-column: 1;
    grid-row: 3;
    align-self: end;
    justify-self: start;
    padding-left: 4px;
  }
}

/* Barra de progrés a sota dels controls */
.widget--music .widget__progress {
  margin: 10px 0 2px;
}

@media (max-width: 960px), (pointer: coarse) {
  .widget--square .widget__controls {
    margin-top: auto;
  }

  .widget--square .widget__progress {
    margin: 6px 0 2px;
  }
}

/* Icones de la botonera (SVG: el símbol de pausa no es deforma) */
.widget__controls button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 28px;
  padding: 0;
}

.widget__controls svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

@media (max-width: 960px), (pointer: coarse) {
  .widget--square .widget__controls button {
    width: 32px;
    height: 24px;
    padding: 0;
  }

  .widget--square .widget__controls svg {
    width: 14px;
    height: 14px;
  }
}

/* Footer: quan les xarxes baixen de línia (format mitjà), el primer enllaç s'alinea amb el correu i el títol */
.footer-link:first-child {
  padding-left: 0;
}

.footer-link:first-child::after {
  left: 0;
}


/* ---------- Mòbil: arxivador amb pestanyes (substitueix la pantalla d'iPhone) ---------- */

.mobile-gallery {
  display: none;
}

@media (max-width: 960px), (pointer: coarse) {
  .mobile-gallery {
    display: block;
    margin: 0 16px;
  }

  .mobile-gallery__widgets {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }

  .mobile-gallery .widget {
    border: 1px solid rgba(69, 12, 15, 0.12);
    box-shadow: 0 6px 18px rgba(69, 12, 15, 0.12);
  }

  .mobile-gallery .widget--wide {
    grid-column: 1 / -1;
  }

  .mobile-gallery .widget--square {
    grid-column: 1;
    width: 100%;
  }

  .cabinet {
    margin-top: 32px;
    padding-bottom: 8px;
  }

  /* Dues carpetes apilades i tancades per defecte: Fotos va sempre darrere i Sketchbook davant.
     En desplegar-ne una, la de sota baixa per deixar lloc a la galeria. */
  .folder {
    position: relative;
    z-index: 1;
    padding-top: 40px;
    pointer-events: none;
  }

  /* Alçades de les carpetes tancades: la de darrere és 44 px més alta perquè totes dues acabin a la mateixa línia */
  .folder:first-child {
    --closed-h: 284px;
  }

  .folder:last-child {
    --closed-h: 240px;
  }

  .folder + .folder {
    z-index: 2;
    margin-top: -280px;
  }


  .folder > * {
    pointer-events: auto;
  }

  .folder__tab {
    position: absolute;
    top: 0;
    left: calc(36px + var(--i) * 60px);
    height: 40px;
    padding: 0 16px;
    border: none;
    border-radius: 18px 18px 0 0;
    background: var(--c);
    font-family: var(--font-heading);
    font-size: 19px;
    letter-spacing: -0.03em;
    color: var(--color-crema);
    cursor: pointer;
  }

  .folder__tab::before,
  .folder__tab::after {
    content: "";
    position: absolute;
    bottom: 0;
    width: 20px;
    height: 20px;
  }

  .folder__tab::before {
    left: -20px;
    background: radial-gradient(circle at 0 0, transparent 19.5px, var(--c) 20px);
  }

  .folder__tab::after {
    right: -20px;
    background: radial-gradient(circle at 100% 0, transparent 19.5px, var(--c) 20px);
  }

  .folder__body {
    position: relative;
    height: var(--closed-h, 48px);
    overflow: hidden;
    border-radius: 16px;
    background: var(--c);
    color: var(--color-crema);
  }

  .folder.is-open .folder__body {
    height: auto;
    min-height: var(--closed-h, 48px);
    overflow: visible;
  }

  /* Amb Fotos oberta, la carpeta fosca continua cap avall darrere de Sketchbook (280 px) perquè totes dues acabin a la mateixa línia */
  .folder:not(:last-child).is-open .folder__body {
    padding-bottom: 288px;
  }

  .folder__strip {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    width: 100%;
    height: 44px;
    padding: 0 18px;
    border: none;
    background: none;
    font-family: var(--font-body);
    font-size: 14px;
    color: inherit;
    cursor: pointer;
  }

  .folder__strip svg {
    width: 12px;
    height: 8px;
    transition: transform 200ms ease;
  }

  .folder.is-open .folder__strip svg {
    transform: rotate(180deg);
  }

  .folder__chips {
    display: flex;
    gap: 6px;
    padding: 0 12px 12px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .folder__chips::-webkit-scrollbar {
    display: none;
  }

  .folder:not(.is-open) .folder__chips {
    display: none;
  }

  .folder__chip {
    flex: none;
    padding: 6px 14px;
    border: 1px solid var(--color-crema);
    border-radius: 999px;
    background: none;
    font-family: var(--font-body);
    font-size: 13px;
    color: var(--color-crema);
    cursor: pointer;
  }

  .folder__chip.is-active {
    background: var(--color-crema);
    color: var(--c);
  }

  /* Graella justificada: cada foto agafa l'ample segons la seva proporció (--ar), així totes les files
     tenen la mateixa alçada i sempre el mateix espai (8 px) entre fotos, tinguin la mida que tinguin */
  .folder__grid {
    display: none;
    max-height: 460px;
    padding: 0 12px 16px;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    flex-wrap: wrap;
    align-content: flex-start;
    gap: 8px;
  }

  .folder.is-open .folder__grid {
    display: flex;
  }

  .cabinet__photo {
    display: block;
    flex: calc(var(--ar, 1.5)) 1 calc(var(--ar, 1.5) * 110px);
    min-width: 0;
    margin: 0;
    padding: 0;
    border: none;
    background: none;
    cursor: pointer;
  }

  .cabinet__photo[hidden] {
    display: none;
  }

  /* Evita que l'última fila s'estiri per omplir tot l'ample */
  .folder__fill {
    flex: 100 1 0;
    height: 0;
  }

  .cabinet__photo img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 6px;
  }
}

/* =====================================================================
   Galeria (explorador estil Finder): home, pàgina general i carpetes
   ===================================================================== */

/* La pàgina arriba fins a la targeta del footer (se li treu l'aire de dalt) perquè el dibuix de fons hi quedi enganxat */
.gpage {
  position: relative;
  overflow-x: clip;
  padding-bottom: clamp(40px, 6vw, 96px);
}

main:has(.gpage) + .site-footer {
  padding-top: 0;
}

.gpage > *:not(.gbg) {
  position: relative;
  z-index: 1;
}

/* Dibuix de fons (només a la pàgina general i a Il·lustracions) */
.gbg {
  position: absolute;
  left: 5.7%;
  bottom: 0;
  width: 89.6%;
  aspect-ratio: 1290 / 927;
  overflow: hidden;
  opacity: 0.1;
  mix-blend-mode: multiply;
  pointer-events: none;
  z-index: 0;
}

.gbg img {
  position: absolute;
  left: -22.94%;
  bottom: 0;
  width: 122.95%;
  max-width: none;
  height: auto;
}

.marquee--gpage {
  margin: 56px 0 24px;
}

/* Graella de 7 columnes: cada foto, centrada a la seva cel·la i amb la mida segons la proporció */
.ggrid {
  --cell: 105px;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  column-gap: 56px;
  row-gap: 80px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.ggrid > li {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: var(--cell);
}

.ggrid > li:hover,
.ggrid > li:focus-within {
  z-index: 5;
}

.gitem {
  position: relative;
  display: block;
  width: calc(var(--cell) * min(1, var(--ar, 1.5)));
  aspect-ratio: var(--ar, 1.5);
  margin: 0;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  transition: transform 450ms cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 450ms ease;
}

.gitem__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gitem__name,
.gitem__year {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.gitem > img:not(.gitem__img) {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (hover: hover) and (not (pointer: coarse)) {
  .gpreview .gitem:hover,
  .gx[data-view="grid"] .gitem:hover {
    transform: scale(2.2);
    box-shadow: 0 14px 36px rgba(69, 12, 15, 0.28);
  }
}

.gitem:focus-visible {
  outline: 2px solid var(--color-granate-dark);
  outline-offset: 3px;
}

/* Carpetes */
.gfolder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 101px;
  color: var(--color-granate-dark);
  text-decoration: none;
}

/* Carpeta feta amb capes (mida de disseny: 128 px; --u = 1/128 de l'ample): en passar-hi per sobre
   els papers pugen i giren per sobre de la carpeta, com un "smart animate" */
.gfolder__icon {
  --u: 0.78125cqw;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
  display: block;
  width: 101px;
  aspect-ratio: 1;
  container-type: inline-size;
  /* Ombra molt lleu que segueix la silueta (carpeta + papers) perquè els papers no es confonguin amb el fons */
  filter: drop-shadow(0 2px 4px rgba(69, 12, 15, 0.16));
  transition: filter 520ms var(--ease);
}

.gfolder:hover .gfolder__icon,
.gfolder:focus-visible .gfolder__icon {
  filter: drop-shadow(0 3px 5px rgba(69, 12, 15, 0.22));
}

.fo {
  position: absolute;
  display: block;
}

.fo-back {
  left: calc(var(--u) * 8);
  top: calc(var(--u) * 18);
  width: calc(var(--u) * 112);
  height: calc(var(--u) * 92);
  background: url("../assets/images/gallery/folder-back.svg") no-repeat center / 100% 100%;
}

.fo-sheet {
  left: calc(var(--u) * 12);
  top: calc(var(--u) * 32);
  width: calc(var(--u) * 104);
  height: calc(var(--u) * 73);
  border-radius: calc(var(--u) * 4);
  transition: transform 520ms var(--ease);
}

.fo-sheet--a {
  background: #fff;
}

.fo-sheet--b {
  background: #fff3db;
  transition-delay: 40ms;
}

.fo-front {
  left: calc(var(--u) * 7);
  top: calc(var(--u) * 36);
  width: calc(var(--u) * 114);
  height: calc(var(--u) * 75);
  box-sizing: border-box;
  overflow: hidden;
  border: calc(var(--u) * 0.75) solid rgba(232, 247, 255, 0.25);
  border-radius: calc(var(--u) * 10) calc(var(--u) * 10) calc(var(--u) * 9.75) calc(var(--u) * 9.75);
  /* Capes del Figma (de dalt a baix): línies de llum, 3 franges inferiors, franja clara de la base,
     llum radial ampla (el·lipse 88x58 centrada a dalt, 55 % d'opacitat) i color base #a28587 */
  background:
    linear-gradient(rgba(255, 255, 255, 0.25), rgba(255, 255, 255, 0.25)) 0 calc(var(--u) * 59.25) / 100% calc(var(--u) * 0.5) no-repeat,
    linear-gradient(rgba(255, 255, 255, 0.25), rgba(255, 255, 255, 0.25)) 0 calc(var(--u) * 64.25) / 100% calc(var(--u) * 0.5) no-repeat,
    linear-gradient(rgba(255, 255, 255, 0.25), rgba(255, 255, 255, 0.25)) 0 calc(var(--u) * 69.25) / 100% calc(var(--u) * 0.5) no-repeat,
    linear-gradient(to top, rgba(125, 85, 87, 0.77), rgba(143, 109, 111, 0.77)) 0 calc(var(--u) * 59.75) / 100% calc(var(--u) * 4) no-repeat,
    linear-gradient(to top, rgba(125, 85, 87, 0.77), rgba(143, 109, 111, 0.77)) 0 calc(var(--u) * 64.75) / 100% calc(var(--u) * 4) no-repeat,
    linear-gradient(to top, rgba(125, 85, 87, 0.77), rgba(143, 109, 111, 0.77)) 0 calc(var(--u) * 69.75) / 100% calc(var(--u) * 4) no-repeat,
    linear-gradient(#8f6d6f, #8f6d6f) 0 calc(var(--u) * 69.5) / 100% calc(var(--u) * 6) no-repeat,
    radial-gradient(ellipse calc(var(--u) * 88) calc(var(--u) * 57.9) at calc(var(--u) * 57) calc(var(--u) * 17.1), rgba(255, 255, 255, 0.153), rgba(255, 255, 255, 0)),
    #a28587;
}

/* Ombres suaus dels laterals (rectangles #7d5557 desenfocats del Figma) */
.fo-front::before,
.fo-front::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: calc(var(--u) * 28);
}

.fo-front::before {
  left: 0;
  background: linear-gradient(to right, rgba(125, 85, 87, 0.55), rgba(125, 85, 87, 0));
}

.fo-front::after {
  right: 0;
  background: linear-gradient(to left, rgba(125, 85, 87, 0.55), rgba(125, 85, 87, 0));
}

.gfolder:hover .fo-sheet--a,
.gfolder:focus-visible .fo-sheet--a {
  transform: translateY(calc(var(--u) * -8)) rotate(2.92deg);
}

.gfolder:hover .fo-sheet--b,
.gfolder:focus-visible .fo-sheet--b {
  transform: translate(calc(var(--u) * 5.2), calc(var(--u) * -3.3)) rotate(5.34deg);
}

.gfolder__name {
  width: 160px;
  max-width: none;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 20px;
  text-align: center;
}

.gfolder__count {
  display: none;
}

.gexp {
  padding: 40px 64px 0;
}

.gexp--landing {
  min-height: 560px;
}

/* Home: previsualitzacions + "Veure tot" */
.gpreview {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 56px;
  padding: 40px 64px 40px;
}

.gpreview .ggrid,
.gx__items.ggrid {
  --cell: 120px;
  width: 100%;
}

.gall-link {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 20px;
  color: var(--color-granate-dark);
  text-decoration: none;
}

.gall-link {
  position: relative;
}

.gall-link img {
  width: 33px;
  height: 33px;
}

.gall-link::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 34px;
  bottom: 7px;
  height: 5px;
  background: url("../assets/images/gallery/link-underline.svg") no-repeat center / 100% 100%;
  opacity: 0;
  transition: opacity 200ms ease;
}

.gall-link:hover::after {
  opacity: 1;
}

/* Barra de ruta + vistes */
.gx__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 64px;
}

.gx__back {
  display: none;
}

.gx__crumbs {
  display: flex;
  align-items: center;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 20px;
  color: var(--color-granate-dark);
}

.gx__crumbs a {
  color: inherit;
  text-decoration: none;
}

.gx__crumbs a:hover {
  text-decoration: underline;
}

.gx__crumbs h1 {
  font: inherit;
  letter-spacing: 0;
}

.gx__sep {
  width: 8px;
  height: 12px;
  margin: 0 10px;
}

.gx__views {
  display: flex;
  align-items: center;
  gap: 6px;
}

.gx__view {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: none;
  color: var(--color-granate-dark);
  cursor: pointer;
  transition: background-color 200ms ease;
}

.gx__view svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
}

.gx__view .dot {
  fill: currentColor;
  stroke: none;
}

.gx__view:hover {
  background: rgba(143, 109, 111, 0.28);
}

.gx__view.is-active {
  background: var(--granate-600);
}

.gx__divider {
  width: 1px;
  height: 32px;
  margin: 0 4px;
  background: var(--color-granate-dark);
}

.gx__stage {
  padding: 40px 64px 0;
}

.gx__more {
  display: block;
  margin: 56px auto 0;
}

.gx__more[hidden],
.gx__items > .is-extra {
  display: none;
}

.gx__preview[hidden] {
  display: none;
}

@media (min-width: 961px) and (not (pointer: coarse)) {
  /* Llista */
  .gx[data-view="list"] .gx__items {
    display: block;
  }

  .gx[data-view="list"] .gx__items > li {
    display: block;
    min-height: 0;
    border-bottom: 1px solid var(--color-granate-dark);
  }

  .gx[data-view="list"] .gitem,
  .gx[data-view="columns"] .gitem {
    display: flex;
    align-items: center;
    width: 100%;
    aspect-ratio: auto;
    text-align: left;
    color: var(--color-granate-dark);
  }

  .gx[data-view="list"] .gitem {
    gap: 136px;
    height: 72px;
    padding: 12px 0;
  }

  .gx[data-view="list"] .gitem:hover {
    background: rgba(69, 12, 15, 0.06);
  }

  .gx[data-view="list"] .gitem__year,
  .gx[data-view="list"] .gitem__name {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip: auto;
  }

  .gx[data-view="list"] .gitem__year {
    order: 1;
    width: 87px;
    font-family: var(--font-mono);
    font-size: 12px;
    line-height: 16px;
    text-transform: uppercase;
  }

  .gx[data-view="list"] .gitem__name {
    order: 2;
    font-family: var(--font-body);
    font-size: 28px;
    line-height: 32px;
  }

  .gx[data-view="list"] .gitem__img {
    order: 3;
    width: calc(48px * var(--ar, 1.5));
    height: 48px;
    margin-left: auto;
  }

  .gx[data-view="list"] .gx__folder .gfolder,
  .gx[data-view="columns"] .gx__folder .gfolder,
  .gx[data-view="gallery"] .gx__folder .gfolder {
    flex-direction: row;
    width: 100%;
  }

  .gx[data-view="list"] .gx__folder .gfolder {
    gap: 136px;
    height: 72px;
    padding: 12px 0;
  }

  .gx[data-view="list"] .gfolder__icon {
    order: 3;
    width: 48px;
    margin-left: auto;
  }

  .gx[data-view="list"] .gfolder__name {
    order: 2;
    width: auto;
    margin-right: 0;
    font-size: 28px;
    line-height: 32px;
    text-align: left;
  }

  .gx[data-view="list"] .gfolder__count {
    display: block;
    order: 1;
    width: 87px;
    font-family: var(--font-mono);
    font-size: 12px;
  }

  /* Columnes: llista a l'esquerra i foto gran a la dreta */
  .gx[data-view="columns"] .gx__stage {
    display: grid;
    grid-template-columns: 340px 1fr;
    grid-template-areas: "items preview";
    height: 600px;
    margin: 40px 64px 0;
    padding: 0;
    border: 1px solid var(--color-granate-dark);
    border-radius: 8px;
    overflow: hidden;
  }

  .gx[data-view="columns"] .gx__items {
    grid-area: items;
    display: block;
    min-height: 0;
    overflow-y: auto;
    border-right: 1px solid var(--color-granate-dark);
  }

  .gx[data-view="columns"] .gx__items > li {
    display: block;
    min-height: 0;
  }

  .gx[data-view="columns"] .gx__preview {
    grid-area: preview;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    min-height: 0;
    padding: 24px;
  }

  .gx[data-view="columns"] .gx__preview img,
  .gx[data-view="gallery"] .gx__preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    cursor: zoom-in;
  }

  .gx[data-view="columns"] .gitem {
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-bottom: 1px solid rgba(69, 12, 15, 0.15);
    font-family: var(--font-mono);
    font-size: 13px;
  }

  .gx[data-view="columns"] .gitem__img {
    display: none;
  }

  .gx[data-view="columns"] .gitem__year,
  .gx[data-view="columns"] .gitem__name {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip: auto;
  }

  .gx[data-view="columns"] .gitem.is-active,
  .gx[data-view="columns"] .gitem:hover {
    background: var(--color-granate-dark);
    color: var(--color-crema);
  }

  .gx[data-view="columns"] .gx__folder .gfolder {
    gap: 10px;
    padding: 10px 14px;
    border-bottom: 1px solid rgba(69, 12, 15, 0.15);
  }

  .gx[data-view="columns"] .gfolder__icon,
  .gx[data-view="gallery"] .gfolder__icon {
    width: 32px;
  }

  .gx[data-view="columns"] .gfolder__name {
    width: auto;
    font-size: 14px;
    text-align: left;
  }

  /* Galeria: foto gran al mig i les altres a sota */
  .gx[data-view="gallery"] .gx__stage {
    display: flex;
    flex-direction: column;
    gap: 24px;
  }

  .gx[data-view="gallery"] .gx__preview {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 520px;
  }

  .gx[data-view="gallery"] .gx__items {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 4px;
    overflow-x: auto;
  }

  .gx[data-view="gallery"] .gx__items > li {
    flex: none;
    min-height: 0;
  }

  .gx[data-view="gallery"] .gitem {
    width: calc(72px * var(--ar, 1.5));
    height: 72px;
    aspect-ratio: auto;
    opacity: 0.6;
    transition: opacity 200ms ease;
  }

  .gx[data-view="gallery"] .gitem:hover,
  .gx[data-view="gallery"] .gitem.is-active {
    opacity: 1;
  }

  .gx[data-view="gallery"] .gitem.is-active {
    outline: 2px solid var(--color-granate-dark);
    outline-offset: 3px;
  }

  .gx[data-view="gallery"] .gx__folder .gfolder {
    flex-direction: column;
    width: 72px;
    gap: 4px;
  }

  .gx[data-view="gallery"] .gfolder__name {
    width: auto;
    font-size: 12px;
  }
}

/* Àlbums (només mòbil) */
.gfolder__cover,
.gfolder__total {
  display: none;
}

/* ---- Mòbil: com l'app Fotos de l'iPhone (graella a sang, àlbums) ---- */
@media (max-width: 960px), (pointer: coarse) {
  .marquee--gpage {
    margin: 32px 0 16px;
  }

  /* Graella de fotos a sang: quadrats, 3 columnes, 2px entre foto i foto */
  .gpreview .ggrid,
  .gx__items.ggrid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    column-gap: 2px;
    row-gap: 2px;
  }

  .gpreview .ggrid > li,
  .gx__items.ggrid > li {
    display: block;
    aspect-ratio: 1;
    min-height: 0;
  }

  .gpreview .gitem,
  .gx__items .gitem {
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
    transform: none;
    box-shadow: none;
  }

  .gpreview .ggrid > li:nth-child(n + 13) {
    display: none;
  }

  .gpreview {
    gap: 24px;
    padding: 24px 0 8px;
  }

  .gx__stage {
    padding: 0 0 8px;
  }

  .gx__more {
    margin-top: 24px;
  }

  /* Barra d'àlbum: botó enrere a l'esquerra i títol al centre, com a l'iPhone */
  .gx__bar {
    position: relative;
    justify-content: flex-start;
    min-height: 52px;
    padding: 4px 16px;
  }

  .gx__back {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 44px;
    margin-left: -6px;
    padding: 0 8px 0 6px;
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 20px;
    color: var(--color-granate-dark);
    text-decoration: none;
  }

  .gx__back svg {
    width: 10px;
    height: 17px;
  }

  .gx__crumbs {
    position: absolute;
    inset: 0;
    justify-content: center;
    pointer-events: none;
  }

  .gx__crumbs a,
  .gx__sep {
    display: none;
  }

  .gx__crumbs h1 {
    font-weight: 600;
  }

  .gx__views,
  .gx__preview {
    display: none;
  }

  /* Pàgina de galeria: àlbums, de dos en dos */
  .gexp--landing {
    min-height: 0;
    padding: 16px 16px 0;
  }

  .ggrid--folders {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 16px;
    row-gap: 24px;
  }

  .ggrid--folders > li {
    display: block;
    min-height: 0;
  }

  .ggrid--folders .gfolder {
    align-items: stretch;
    gap: 0;
    width: 100%;
  }

  .ggrid--folders .gfolder__icon {
    display: none;
  }

  .gfolder__cover {
    display: block;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 12px;
    background: var(--granate-600);
  }

  .gfolder__cover img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .ggrid--folders .gfolder__name {
    width: 100%;
    margin-top: 6px;
    font-size: 16px;
    line-height: 20px;
    text-align: left;
  }

  .gfolder__total {
    display: block;
    font-size: 14px;
    line-height: 18px;
    opacity: 0.6;
  }

  /* Subcarpetes dins d'un àlbum: àlbums de dos en dos (graella de 6: àlbum = 3, foto = 2) */
  .gx__items.ggrid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .gx__items.ggrid > li {
    grid-column: span 2;
  }

  .gx__items.ggrid > .gx__folder {
    grid-column: span 3;
    aspect-ratio: auto;
    padding: 16px 8px 14px;
  }

  .gx__items.ggrid > .gx__folder:nth-child(odd) {
    padding-left: 16px;
  }

  .gx__items.ggrid > .gx__folder:nth-child(even) {
    padding-right: 16px;
  }

  .gx__items .gx__folder .gfolder {
    align-items: stretch;
    gap: 0;
    width: 100%;
  }

  .gx__items .gx__folder .gfolder__icon {
    display: none;
  }

  .gx__items .gx__folder .gfolder__count {
    display: block;
    font-size: 14px;
    line-height: 18px;
    opacity: 0.6;
  }

  .gx__items .gx__folder .gfolder__name {
    width: 100%;
    margin-top: 6px;
    font-size: 16px;
    line-height: 20px;
    text-align: left;
  }
}

/* ---- Tauleta (iPad): versió mòbil amb més fotos per fila, com l'app Fotos de l'iPad ---- */
@media (min-width: 701px) and (max-width: 960px), (min-width: 701px) and (pointer: coarse) {
  .gpreview .ggrid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .gpreview .ggrid > li:nth-child(n + 13) {
    display: block;
  }

  .gpreview .ggrid > li:nth-child(n + 19) {
    display: none;
  }

  /* Pàgines d'àlbum: 12 columnes (foto = 2 → 6 per fila; àlbum = 4 → 3 per fila) */
  .gx__items.ggrid {
    grid-template-columns: repeat(12, minmax(0, 1fr));
  }

  .gx__items.ggrid > .gx__folder {
    grid-column: span 4;
  }

  .gx__items.ggrid > .gx__folder:nth-child(odd),
  .gx__items.ggrid > .gx__folder:nth-child(even) {
    padding: 24px 12px 16px;
  }

  .gexp--landing {
    padding: 24px 32px 0;
  }

  .ggrid--folders {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    column-gap: 24px;
    row-gap: 32px;
  }

  .gx__bar {
    padding: 4px 32px;
  }
}

@media (min-width: 1000px) and (pointer: coarse) {
  .gpreview .ggrid {
    grid-template-columns: repeat(7, minmax(0, 1fr));
  }

  .gpreview .ggrid > li:nth-child(n + 13),
  .gpreview .ggrid > li:nth-child(n + 19) {
    display: block;
  }

  .gpreview .ggrid > li:nth-child(n + 22) {
    display: none;
  }

  .gx__items.ggrid {
    grid-template-columns: repeat(24, minmax(0, 1fr));
  }

  .gx__items.ggrid > li {
    grid-column: span 3;
  }

  .gx__items.ggrid > .gx__folder {
    grid-column: span 6;
  }

  .ggrid--folders {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* Mòbil i tauleta: el footer sempre arriba al final de la pantalla (cap franja blanca sota seu en pàgines curtes) */
@media (max-width: 960px), (pointer: coarse) {
  body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
  }

  main {
    flex: 1 0 auto;
  }

  /* Les pàgines de galeria omplen tot l'espai fins al footer (així el dibuix de fons queda enganxat al footer) */
  main:has(> .gpage) {
    display: flex;
    flex-direction: column;
  }

  main:has(> .gpage) > .gpage {
    flex: 1 0 auto;
  }
}

/* Tauleta: Sobre mi amb la foto a mida raonable i la marquesina sobre el cabell (com a mòbil) */
@media (min-width: 701px) and (max-width: 960px), (min-width: 701px) and (pointer: coarse) {
  .about-hero {
    padding-top: 150px;
    min-height: 360px;
  }

  .about-hero__title {
    font-size: 48px;
    line-height: 54px;
  }

  .about-hero.is-compact {
    min-height: 160px;
    padding-top: 56px;
  }

  .about-hero.is-compact .about-hero__title {
    font-size: 32px;
  }

  .about-bio__image,
  .about-bio__text {
    width: 100%;
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
  }

  .about-bio__image {
    margin-top: -14px;
  }

  .marquee--about {
    top: 100px;
  }

  .about-block,
  .about-block--single {
    padding: 48px 32px;
  }
}

/* Escriptori: la graella de fotos s'ajusta a l'amplada de la finestra (no es queden petites quan es fa estreta) */
@media (min-width: 961px) and (not (pointer: coarse)) {
  .gpreview .ggrid,
  .gx[data-view="grid"] .gx__items.ggrid {
    --gap: clamp(12px, 2.4vw, 56px);
    --cell: min(120px, calc((100cqw - 6 * var(--gap)) / 7 * 0.9));
    container-type: inline-size;
    column-gap: var(--gap);
    row-gap: calc(var(--gap) * 1.4);
  }
}
