/* ==========================================================================
   Hèlix Estudi · helixestudi.cat
   Colors i tipografia del manual de marca (21/09/2026).
   Titulars: Frank Ruhl Libre (serif lleugera). Etiquetes i cos: Montserrat.
   Mai negreta: el contrast es fa amb mida, no amb gruix.
   ========================================================================== */

:root {
  --ink: #211A16;          /* fosc de fons */
  --ink-2: #28201B;        /* variació del fosc per separar seccions */
  --cream: #FAF6F1;        /* blanc càlid */
  --cream-80: rgba(250, 246, 241, .8);
  --cream-60: rgba(250, 246, 241, .64);
  --cream-50: rgba(250, 246, 241, .5);
  --line: rgba(250, 246, 241, .14);
  --salmon: #E39E7F;       /* accent sobre fosc */
  --salmon-deep: #C97B5E;  /* accent sobre clar */
  --paper: #F2EDE6;        /* fons clar */
  --paper-2: #E9E2D8;
  --terracotta: #A55A3E;   /* etiquetes sobre clar */
  --terracotta-text: #95503A; /* la mateixa terracota, 4,5:1 sobre paper per a text petit */
  --error: #F2B39A;

  --serif: "Frank Ruhl Libre", "Iowan Old Style", "Times New Roman", serif;
  --sans: "Montserrat", "Helvetica Neue", Arial, sans-serif;

  --ease: cubic-bezier(.16, 1, .3, 1);
  --ease-io: cubic-bezier(.65, 0, .35, 1);

  --gutter: clamp(20px, 5.5vw, 88px);
  --maxw: 1440px;
  --nav-h: 72px;

  /* capes */
  --z-nav: 50;
  --z-menu: 49;
}

/* ---------- Base ---------- */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: var(--nav-h);
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--cream);
  font: 400 1rem/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  -webkit-tap-highlight-color: transparent;
}

img, video, svg { display: block; max-width: 100%; }
img { height: auto; }
picture { display: block; }

h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }

::selection { background: var(--salmon); color: var(--ink); }

:focus-visible { outline: 2px solid var(--salmon); outline-offset: 3px; }

.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip {
  position: fixed; left: 12px; top: -80px; z-index: 100;
  padding: 12px 18px; background: var(--cream); color: var(--ink);
  font: 500 .8125rem/1 var(--sans); letter-spacing: .08em; text-transform: uppercase;
  transition: top .3s var(--ease);
}
.skip:focus { top: 12px; }

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.icon { width: 20px; height: 20px; fill: currentColor; flex: none; }

/* ---------- Tipografia ---------- */

.display {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(3.1rem, 1.3rem + 6.4vw, 7.6rem);
  line-height: 1.02;
  letter-spacing: -.014em;
  word-spacing: .04em;
}

.h2 {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(2.35rem, 1.35rem + 3.4vw, 4.75rem);
  line-height: 1.07;
  letter-spacing: -.008em;
  word-spacing: .05em;
  text-wrap: balance;
}

.h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.45rem, 1.1rem + .9vw, 2rem);
  line-height: 1.15;
  letter-spacing: -.008em;
}

.label {
  font: 500 .75rem/1.4 var(--sans);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--salmon);
}

.lead {
  font-size: clamp(1.125rem, 1rem + .45vw, 1.4rem);
  line-height: 1.5;
  color: var(--cream);
}

p { max-width: 62ch; color: var(--cream-80); text-wrap: pretty; }

.rule {
  display: block;
  width: 56px;
  height: 3px;
  background: var(--salmon);
}

/* ---------- Botons i enllaços ---------- */

.arrow {
  position: relative;
  display: inline-block;
  width: 28px;
  height: 9px;
  flex: none;
  transition: transform .5s var(--ease);
}
.arrow::before {
  content: "";
  position: absolute;
  left: 0; right: 5px; top: 50%;
  height: 1.5px; margin-top: -.75px;
  background: currentColor;
}
.arrow::after {
  content: "";
  position: absolute;
  right: 0; top: 0;
  width: 9px; height: 9px;
  background: currentColor;
  clip-path: polygon(0 0, 100% 50%, 0 100%);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  height: 54px;
  padding: 0 26px;
  font: 500 .8125rem/1 var(--sans);
  letter-spacing: .12em;
  text-transform: uppercase;
  white-space: nowrap;
  border: 1px solid transparent;
  transition: background-color .45s var(--ease), color .45s var(--ease), border-color .45s var(--ease), transform .2s var(--ease);
}
.btn:active { transform: scale(.98); }
.btn:hover .arrow { transform: translateX(5px); }

.btn--primary { background: var(--salmon); color: var(--ink); }
.btn--primary:hover { background: var(--cream); }

.btn--ghost { border-color: rgba(250, 246, 241, .42); color: var(--cream); }
.btn--ghost:hover { border-color: var(--cream); background: rgba(250, 246, 241, .07); }

.btn--sm { height: 42px; padding: 0 18px; gap: 12px; }
.btn--sm .arrow { width: 22px; }

.link {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font: 500 .8125rem/1 var(--sans);
  letter-spacing: .12em;
  text-transform: uppercase;
  padding: 10px 0;
}
.link:hover .arrow { transform: translateX(5px); }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(250, 246, 241, .26);
  color: var(--cream);
  transition: background-color .35s var(--ease), color .35s var(--ease), border-color .35s var(--ease), transform .2s var(--ease);
}
.icon-btn:hover { background: var(--cream); color: var(--ink); border-color: var(--cream); }
.icon-btn:active { transform: scale(.96); }
.icon-btn:disabled { opacity: .35; pointer-events: none; }

/* ---------- Navegació ---------- */

.nav {
  position: fixed;
  inset: 0 0 auto;
  z-index: var(--z-nav);
  height: var(--nav-h);
  border-bottom: 1px solid transparent;
  transition: background-color .5s var(--ease), border-color .5s var(--ease), backdrop-filter .5s var(--ease);
}
.nav.is-solid {
  background: rgba(33, 26, 22, .84);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  backdrop-filter: blur(14px) saturate(1.2);
  border-bottom-color: var(--line);
}
.nav.is-menu { background: var(--ink); -webkit-backdrop-filter: none; backdrop-filter: none; }
.nav__inner {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 40px;
}

.brand { display: inline-flex; align-items: center; gap: 14px; }
.brand__h { width: 24px; height: 26px; }
.brand__name {
  font-family: var(--serif);
  font-size: 1.3rem;
  font-weight: 400;
  letter-spacing: -.005em;
  line-height: 1;
}

.nav__links { display: flex; gap: 36px; margin-left: auto; }
.nav__links a {
  position: relative;
  font: 500 .75rem/1 var(--sans);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--cream-80);
  padding: 10px 0;
  transition: color .3s var(--ease);
}
.nav__links a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 2px;
  height: 1px;
  background: var(--salmon);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform .5s var(--ease);
}
.nav__links a:hover { color: var(--cream); }
.nav__links a:hover::after { transform: scaleX(1); transform-origin: left; }

.nav__toggle { display: none; width: 48px; height: 48px; place-items: center; margin-right: -12px; }
.nav__toggle .icon { width: 26px; height: 26px; }

.menu {
  position: fixed;
  inset: var(--nav-h) 0 0;
  z-index: var(--z-menu);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 24px var(--gutter) calc(32px + env(safe-area-inset-bottom));
  background: var(--ink);
}
.menu[hidden] { display: none; }
.menu nav a {
  display: block;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(2.2rem, 8vw, 3rem);
  line-height: 1.15;
}
.menu.is-open nav a { animation: menuIn .7s var(--ease) both; }
.menu.is-open nav a:nth-child(2) { animation-delay: .05s; }
.menu.is-open nav a:nth-child(3) { animation-delay: .1s; }
.menu.is-open nav a:nth-child(4) { animation-delay: .15s; color: var(--salmon); }
.menu__foot a { color: var(--cream-80); }

@keyframes menuIn {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}

@media (max-width: 899px) {
  .nav__links, .nav__cta { display: none; }
  .nav__toggle { display: inline-grid; margin-left: auto; }
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
}
.hero__media img {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 62% 60%;
}
.hero__shade {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(33, 26, 22, .6) 0%, rgba(33, 26, 22, 0) 20%),
    linear-gradient(0deg, rgba(33, 26, 22, .94) 0%, rgba(33, 26, 22, .72) 24%, rgba(33, 26, 22, .28) 52%, rgba(33, 26, 22, 0) 72%),
    linear-gradient(90deg, rgba(33, 26, 22, .6) 0%, rgba(33, 26, 22, 0) 58%);
}
.hero__content { padding-top: calc(var(--nav-h) + 48px); padding-bottom: 36px; }
.hero .rule { margin-bottom: 30px; }
.hero h1 { max-width: 12ch; }
.hero h1 .line { display: block; overflow: hidden; padding-bottom: .08em; margin-bottom: -.08em; }
.hero h1 .line > span { display: block; }
.hero__lead {
  max-width: 36ch;
  margin-top: 28px;
  font-size: clamp(1.05rem, .95rem + .4vw, 1.3rem);
  line-height: 1.55;
  color: var(--cream-80);
}
.hero__actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 38px; }
.hero__note {
  padding-bottom: 26px;
  font-size: .6875rem;
  letter-spacing: .06em;
  color: var(--cream-60);
  text-align: right;
  max-width: var(--maxw);
}
.hero__sentinel { position: absolute; left: 0; right: 0; top: calc(100% - var(--nav-h) - 1px); height: 1px; pointer-events: none; }

@media (max-width: 640px) {
  .hero__note { text-align: left; }
  .hero__actions .btn { flex: 1 1 auto; }
}

/* Entrada del hero */
@media (prefers-reduced-motion: no-preference) {
  .js .hero__media img { animation: heroZoom 2.8s var(--ease) both; }
  .js .hero .rule { animation: ruleIn 1.1s var(--ease) .15s both; transform-origin: left; }
  .js .hero h1 .line > span { animation: lineUp 1.25s var(--ease) both; }
  .js .hero h1 .line:nth-child(1) > span { animation-delay: .25s; }
  .js .hero h1 .line:nth-child(2) > span { animation-delay: .37s; }
  .js .hero__lead { animation: fadeUp 1.1s var(--ease) .6s both; }
  .js .hero__actions { animation: fadeUp 1.1s var(--ease) .72s both; }
  .js .hero__note { animation: fade 1.4s var(--ease) 1s both; }
}
@keyframes heroZoom { from { transform: scale(1.07); } to { transform: scale(1); } }
@keyframes lineUp { from { transform: translateY(108%); } to { transform: none; } }
@keyframes ruleIn { from { transform: scaleX(0); } to { transform: none; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Revelat en fer scroll ---------- */

@media (prefers-reduced-motion: no-preference) {
  .js [data-reveal] {
    opacity: 0;
    transform: translateY(26px);
    transition: opacity 1s var(--ease) var(--d, 0s), transform 1.15s var(--ease) var(--d, 0s);
  }
  .js [data-reveal].is-in { opacity: 1; transform: none; }
}

/* ---------- Manifest ---------- */

.manifest {
  position: relative;
  overflow: hidden;
  padding-block: clamp(120px, 18vh, 220px);
}
.manifest__h {
  position: absolute;
  right: -9vw;
  top: 50%;
  width: min(64vw, 920px);
  height: auto;
  aspect-ratio: 628 / 680;
  translate: 0 -50%;
  fill: var(--cream);
  opacity: .05;
  pointer-events: none;
}
.manifest__grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: 24px;
}
.manifest__title {
  grid-column: 1 / span 9;
  font-size: clamp(2.6rem, 1.2rem + 4.9vw, 6.2rem);
  line-height: 1.04;
}
.manifest__body {
  grid-column: 6 / span 6;
  margin-top: clamp(40px, 6vw, 88px);
}
.manifest__body p + p { margin-top: 1.1em; }
.manifest__honest {
  margin-top: 40px !important;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  color: var(--cream);
}

@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .manifest__h {
      animation: drift linear both;
      animation-timeline: view();
      animation-range: cover;
    }
    @keyframes drift {
      from { transform: translateY(14%); }
      to { transform: translateY(-14%); }
    }
  }
}

@media (max-width: 899px) {
  .manifest__title, .manifest__body { grid-column: 1 / -1; }
  .manifest__h { width: 120vw; right: -50vw; }
}

/* ---------- Seqüència: d'un solar a una casa ---------- */

.seq {
  position: relative;
  height: 500vh;
  background: var(--ink);
}
.seq__sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  display: flex;
  align-items: center;
  overflow: hidden;
}
.seq__grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: 24px;
  align-items: center;
  padding-top: var(--nav-h);
}
.seq__text { grid-column: 1 / span 5; }
.seq__text .h2 { margin-top: 18px; font-size: clamp(2.2rem, 1.2rem + 2.8vw, 4.1rem); }
.seq__steps { margin-top: clamp(28px, 4.5vh, 52px); }
.seq__steps li {
  display: grid;
  grid-template-columns: 48px 1fr;
  align-items: baseline;
  padding: clamp(9px, 1.5vh, 15px) 0;
  font-size: clamp(.95rem, .9rem + .2vw, 1.075rem);
  line-height: 1.45;
  color: var(--cream-50);
  transition: color .6s var(--ease);
}
.seq__steps li.is-active { color: var(--cream); }
.seq__n {
  font-family: var(--serif);
  font-size: 1rem;
  color: var(--cream-50);
  transition: color .6s var(--ease);
}
.seq__steps li.is-active .seq__n { color: var(--salmon); }
.seq__note {
  margin-top: clamp(20px, 3.5vh, 40px);
  font-size: .8125rem;
  color: var(--cream-60);
}

.seq__frame {
  grid-column: 7 / span 6;
  justify-self: end;
  position: relative;
  width: 100%;
  max-width: 640px;
  height: min(78dvh, 820px);
  overflow: hidden;
  background: var(--ink-2);
}
.seq__frame picture {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1s var(--ease-io);
}
.seq__frame picture.is-active { opacity: 1; }
.seq__frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 58%;
  transform: scale(1.045);
  transition: transform 2.2s var(--ease);
}
.seq__frame picture.is-active img { transform: none; }
.seq__progress {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 3px;
  background: rgba(33, 26, 22, .45);
}
.seq__progress span {
  display: block;
  height: 100%;
  background: var(--salmon);
  transform-origin: left;
  transform: scaleX(.2);
  transition: transform .8s var(--ease);
}
.seq__track {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-rows: repeat(5, 1fr);
  pointer-events: none;
}

@media (max-width: 899px) {
  .seq__grid { display: block; padding: 0; height: 100%; }
  .seq__frame {
    position: absolute;
    inset: 0;
    max-width: none;
    height: auto;
  }
  .seq__frame::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
      linear-gradient(180deg, rgba(33, 26, 22, .92) 0%, rgba(33, 26, 22, .55) 26%, rgba(33, 26, 22, 0) 44%),
      linear-gradient(0deg, rgba(33, 26, 22, .95) 0%, rgba(33, 26, 22, .6) 24%, rgba(33, 26, 22, 0) 42%);
  }
  .seq__text {
    position: relative;
    z-index: 2;
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: calc(var(--nav-h) + 20px) var(--gutter) calc(28px + env(safe-area-inset-bottom));
  }
  .seq__steps { margin-top: auto; min-height: 5.2em; }
  .seq__steps li { display: none; padding: 0; font-size: 1.1rem; color: var(--cream); }
  .seq__steps li.is-active { display: grid; animation: fadeUp .7s var(--ease) both; }
  .seq__note { margin-top: 14px; }
  .seq__progress { z-index: 3; }
}

/* ---------- Com treballem (peça clara) ---------- */

.paper {
  background: var(--paper);
  color: var(--ink);
  padding-block: clamp(100px, 15vh, 190px);
}
.paper p { color: rgba(33, 26, 22, .8); }
.paper :focus-visible { outline-color: var(--terracotta); }

.proces {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: 24px;
  align-items: start;
}

.stage {
  grid-column: 1 / span 5;
  position: sticky;
  top: calc(var(--nav-h) + 32px);
}
.stage__frame {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--paper-2);
}
.stage__frame picture {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity .9s var(--ease-io);
}
.stage__frame picture.is-active { opacity: 1; }
.stage__frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 52%;
}
.stage__frame .stage__plan img {
  object-fit: contain;
  padding: 6% 8%;
  mix-blend-mode: multiply;
}
.stage__tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-top: 14px;
}
.stage__tabs button {
  position: relative;
  padding: 16px 0 6px;
  text-align: left;
  font: 500 .6875rem/1.3 var(--sans);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(33, 26, 22, .68);
  transition: color .4s var(--ease);
}
.stage__tabs button::before,
.stage__tabs button::after {
  content: "";
  position: absolute;
  left: 0; right: 6px; top: 0;
  height: 2px;
}
.stage__tabs button::before { background: rgba(33, 26, 22, .14); }
.stage__tabs button::after {
  background: var(--terracotta);
  transform: scaleX(0);
  transform-origin: left;
}
.stage__tabs button[aria-selected="true"] { color: var(--ink); }
.stage__tabs button[aria-selected="true"]::after { transform: scaleX(1); transition: transform .6s var(--ease); }
.stage.is-auto .stage__tabs button[aria-selected="true"]::after {
  animation: tabTimer var(--stage-dur, 4200ms) linear both;
}
@keyframes tabTimer { from { transform: scaleX(0); } to { transform: scaleX(1); } }

.proces__text { grid-column: 7 / span 6; padding-top: 8px; }
.steps { margin-top: clamp(40px, 5vw, 64px); }
.steps li {
  display: grid;
  grid-template-columns: 64px 1fr;
  padding: 30px 0;
  border-top: 1px solid rgba(33, 26, 22, .14);
}
.steps__n {
  grid-row: span 2;
  font-family: var(--serif);
  font-size: 1.125rem;
  line-height: 1.6;
  color: var(--terracotta-text);
}
.steps .h3 { color: var(--ink); }
.steps p { margin-top: 10px; }

.proces__price {
  margin-top: 36px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 28px;
  padding: 26px 30px;
  background: var(--paper-2);
}
.proces__price p { max-width: 40ch; }
.proces__price-num {
  display: block;
  font-family: var(--serif);
  font-size: 1.75rem;
  line-height: 1.2;
  color: var(--ink);
  margin-bottom: 2px;
}
.proces__price .link { color: var(--ink); }
.proces__price .link .arrow { color: var(--terracotta); }

@media (max-width: 899px) {
  .stage, .proces__text { grid-column: 1 / -1; }
  .stage { position: relative; top: 0; margin-bottom: 64px; }
  .steps li { grid-template-columns: 48px 1fr; }
}

/* ---------- Projectes ---------- */

.projects { padding-block: clamp(110px, 16vh, 200px); }
.projects__title { margin-bottom: clamp(48px, 7vw, 100px); }
.projects__grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: 24px;
  row-gap: clamp(64px, 8vw, 128px);
  align-items: start;
}

.card { position: relative; }
.card__hit {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
}
.card__hit:focus-visible { outline-offset: 8px; }
.card__media {
  position: relative;
  overflow: hidden;
  background: var(--ink-2);
}
.card__media picture { height: 100%; }
.card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 1.4s var(--ease);
}
.card:hover .card__media img { transform: scale(1.035); }
.card__meta { margin-top: 22px; }
.card__meta .h3 {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 10px;
}
.card__meta .h3::after {
  content: "";
  width: 28px;
  height: 9px;
  background:
    linear-gradient(currentColor, currentColor) left center / calc(100% - 5px) 1.5px no-repeat;
  color: var(--salmon);
  opacity: 0;
  transform: translateX(-8px);
  transition: opacity .5s var(--ease), transform .5s var(--ease);
}
.card:hover .card__meta .h3::after { opacity: 1; transform: none; }
.card__status { margin-top: 8px; font-size: .9375rem; color: var(--cream-60); }

.card--a { grid-column: 1 / span 7; }
.card--a .card__media { aspect-ratio: 16 / 10; }
.card--b { grid-column: 9 / span 4; margin-top: clamp(80px, 13vw, 200px); }
.card--b .card__media { aspect-ratio: 4 / 5; }
.card--b .card__media img { object-position: 50% 60%; }
.card--c { grid-column: 2 / span 4; }
.card--c .card__media { aspect-ratio: 4 / 5; }
.card--c .card__media img { object-position: 50% 40%; }
.card--d { grid-column: 7 / span 6; margin-top: clamp(40px, 9vw, 140px); }
.card--d .card__media { aspect-ratio: 4 / 3; }
.card--d .card__media img { object-position: 50% 58%; }

@media (max-width: 899px) {
  .card--a, .card--b, .card--c, .card--d { grid-column: 1 / -1; margin-top: 0; }
  .card--b .card__media, .card--c .card__media { aspect-ratio: 4 / 5; }
}

/* ---------- Abans i després ---------- */

.compare {
  background: var(--ink-2);
  padding-block: clamp(100px, 15vh, 180px);
}
.compare__grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: 24px;
  align-items: center;
}
.compare__text { grid-column: 1 / span 4; }
.compare__text .h2 { margin-top: 18px; font-size: clamp(2.2rem, 1.3rem + 2.6vw, 3.9rem); }
.compare__text p:not(.label) { margin-top: 26px; }
.compare__hint { font-size: .8125rem; color: var(--cream-60) !important; }
.compare__box { grid-column: 6 / span 7; width: 100%; max-width: 760px; justify-self: end; }
.compare__labels {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
  font: 500 .6875rem/1 var(--sans);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--cream-60);
}
.compare__frame {
  --pos: 50%;
  position: relative;
  aspect-ratio: 1 / 1;
  max-height: 78vh;
  width: 100%;
  overflow: hidden;
  touch-action: pan-y;
  cursor: ew-resize;
  user-select: none;
  -webkit-user-select: none;
  background: var(--ink);
}
.compare__frame picture { position: absolute; inset: 0; }
.compare__frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 40%;
  pointer-events: none;
  -webkit-user-drag: none;
}
.compare__before { clip-path: inset(0 calc(100% - var(--pos)) 0 0); }
.compare__handle {
  position: absolute;
  top: 0; bottom: 0;
  left: var(--pos);
  width: 2px;
  margin-left: -1px;
  background: var(--cream);
  pointer-events: none;
}
.compare__knob {
  position: absolute;
  top: 50%; left: 50%;
  width: 50px; height: 50px;
  translate: -50% -50%;
  display: grid;
  place-items: center;
  background: var(--cream);
  color: var(--ink);
  transition: transform .3s var(--ease);
}
.compare__frame.is-dragging .compare__knob { transform: scale(.92); }
.compare__frame:has(.compare__range:focus-visible) .compare__knob { outline: 2px solid var(--salmon); outline-offset: 3px; }
.compare__range {
  position: absolute;
  inset: auto 0 0 0;
  width: 100%;
  height: 1px;
  opacity: 0;
  margin: 0;
  pointer-events: none;
}
.compare__foot { margin-top: 14px; font-size: .8125rem; color: var(--cream-60); }

@media (max-width: 899px) {
  .compare__text, .compare__box { grid-column: 1 / -1; }
  .compare__box { margin-top: 48px; max-width: none; }
  .compare__frame { aspect-ratio: 4 / 5; }
}

/* ---------- Per a qui ---------- */

.audience { padding-block: clamp(110px, 16vh, 200px); }
.audience__grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: 24px;
  align-items: start;
}
.audience__list { grid-column: 1 / span 7; }
.audience__list ul {
  margin-top: clamp(40px, 5vw, 72px);
  border-top: 1px solid var(--line);
}
.audience__list li { border-bottom: 1px solid var(--line); }
.audience__list button {
  display: grid;
  gap: 10px;
  width: 100%;
  padding: clamp(24px, 3vw, 36px) 0;
  text-align: left;
}
.audience__name {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(1.75rem, 1.15rem + 2.1vw, 3.1rem);
  line-height: 1.1;
  letter-spacing: -.012em;
  color: var(--cream-50);
  transition: color .5s var(--ease);
}
.audience__desc {
  max-width: 48ch;
  font-size: 1rem;
  color: var(--cream-60);
  transition: color .5s var(--ease);
}
.audience__list li.is-active .audience__name { color: var(--cream); }
.audience__list li.is-active .audience__desc { color: var(--cream-80); }

.audience__preview {
  grid-column: 9 / span 4;
  position: sticky;
  top: calc(var(--nav-h) + 40px);
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--ink-2);
}
.audience__preview picture {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity .8s var(--ease-io);
}
.audience__preview picture.is-active { opacity: 1; }
.audience__preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.06);
  transition: transform 1.8s var(--ease);
}
.audience__preview picture.is-active img { transform: none; }

@media (max-width: 899px) {
  .audience__list { grid-column: 1 / -1; }
  .audience__preview {
    grid-column: 1 / -1;
    grid-row: 2;
    position: relative;
    top: 0;
    aspect-ratio: 4 / 3;
    margin-top: 40px;
  }
}

/* ---------- El nom ---------- */

.name {
  padding-block: clamp(120px, 18vh, 220px);
  background: var(--ink-2);
  text-align: center;
}
.name__inner { display: flex; flex-direction: column; align-items: center; }
.name__h { width: 84px; height: 91px; margin-bottom: 52px; }
.name .h2 { max-width: 17ch; }
.name p { margin-top: 30px; max-width: 46ch; font-size: 1.0625rem; }
.name__who { margin-top: 18px !important; font-size: .9375rem !important; color: var(--cream-60); }

@media (prefers-reduced-motion: no-preference) {
  .js [data-draw] {
    clip-path: inset(100% 0 0 0);
    transition: clip-path 1.8s var(--ease);
  }
  .js [data-draw].is-in { clip-path: inset(0 0 0 0); }
}

/* ---------- Contacte ---------- */

.contact { padding-block: clamp(110px, 16vh, 200px); }
.contact__grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: 24px;
  row-gap: 64px;
  align-items: start;
}
.contact__text { grid-column: 1 / span 5; }
.contact__text .rule { margin-bottom: 30px; }
.contact__text > p { margin-top: 26px; }
.contact__lines { margin-top: 40px; display: grid; gap: 6px; }
.contact__lines a {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 8px 0;
  font-size: 1.0625rem;
  color: var(--cream);
  transition: color .3s var(--ease);
}
.contact__lines a:hover { color: var(--salmon); }
.contact__lines .icon { color: var(--salmon); }
.contact__base { margin-top: 32px; font-size: .875rem; color: var(--cream-60); }

.form { grid-column: 7 / span 6; }
.field { display: grid; gap: 10px; margin: 0 0 26px; }
.field > label,
.field legend {
  padding: 0;
  font: 500 .75rem/1.3 var(--sans);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--cream-80);
}
fieldset.field { border: 0; padding: 0; min-width: 0; }
fieldset.field legend { margin-bottom: 10px; }

.field input[type="text"],
.field input[type="email"],
.field textarea {
  width: 100%;
  min-height: 54px;
  padding: 14px 16px;
  font: 400 1rem/1.5 var(--sans);
  color: var(--cream);
  background: rgba(250, 246, 241, .04);
  border: 1px solid rgba(250, 246, 241, .3);
  border-radius: 0;
  transition: border-color .3s var(--ease), background-color .3s var(--ease), box-shadow .3s var(--ease);
  -webkit-appearance: none;
  appearance: none;
}
.field textarea { resize: vertical; min-height: 132px; }
.field input:hover, .field textarea:hover { border-color: rgba(250, 246, 241, .5); }
.field input:focus, .field textarea:focus {
  outline: none;
  border-color: var(--salmon);
  box-shadow: 0 0 0 1px var(--salmon);
  background: rgba(250, 246, 241, .06);
}
.field [aria-invalid="true"] { border-color: var(--error); }
.field__help { font-size: .8125rem; color: var(--cream-60); }
.field__error { font-size: .8125rem; color: var(--error); }

.choices { display: flex; flex-wrap: wrap; gap: 10px; }
.choices label { position: relative; cursor: pointer; }
.choices input {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
  cursor: pointer;
}
.choices span {
  display: inline-flex;
  align-items: center;
  height: 46px;
  padding: 0 20px;
  font-size: .9375rem;
  border: 1px solid rgba(250, 246, 241, .3);
  color: var(--cream-80);
  transition: background-color .3s var(--ease), color .3s var(--ease), border-color .3s var(--ease);
}
.choices label:hover span { border-color: rgba(250, 246, 241, .6); color: var(--cream); }
.choices input:checked + span { background: var(--cream); border-color: var(--cream); color: var(--ink); }
.choices input:focus-visible + span { outline: 2px solid var(--salmon); outline-offset: 3px; }

.form__submit { margin-top: 8px; }
.form__submit[aria-busy="true"] { opacity: .7; pointer-events: none; }
.form__status { margin-top: 18px; min-height: 1.6em; color: var(--salmon); max-width: 52ch; }
.form__privacy { margin-top: 6px; font-size: .8125rem; color: var(--cream-60); }

@media (max-width: 899px) {
  .contact__text, .form { grid-column: 1 / -1; }
  .form__submit { width: 100%; }
}

/* ---------- Peu ---------- */

.footer {
  padding: clamp(72px, 10vh, 110px) 0 calc(36px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
}
.footer__top {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 40px;
  align-items: start;
}
.footer__brand {
  display: inline-flex;
  align-items: center;
  gap: 18px;
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(1.9rem, 1.3rem + 2vw, 2.8rem);
  line-height: 1;
}
.footer__h { width: 40px; height: 44px; }
.footer__nav, .footer__contact { display: grid; gap: 4px; }
.footer__nav a, .footer__contact a {
  padding: 6px 0;
  font-size: .9375rem;
  color: var(--cream-80);
  transition: color .3s var(--ease);
}
.footer__nav a:hover, .footer__contact a:hover { color: var(--salmon); }
.footer__legal { margin-top: clamp(56px, 8vw, 96px); font-size: .8125rem; color: var(--cream-60); max-width: 84ch; }
.footer__copy { margin-top: 10px; font-size: .75rem; color: var(--cream-60); }

@media (max-width: 899px) {
  .footer__top { grid-template-columns: 1fr 1fr; }
  .footer__brand { grid-column: 1 / -1; }
}

/* ---------- Visor de projecte ---------- */

.viewer {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0 0 env(safe-area-inset-bottom);
  border: 0;
  background: var(--ink);
  color: var(--cream);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.viewer::backdrop { background: rgba(20, 15, 12, .72); }
.viewer[open] { animation: viewerIn .6s var(--ease) both; }
@keyframes viewerIn {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: none; }
}

.viewer__bar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 22px var(--gutter) 26px;
  background: linear-gradient(var(--ink) 72%, rgba(33, 26, 22, 0));
}
.viewer__title {
  margin-top: 8px;
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(1.8rem, 1.2rem + 2vw, 3rem);
  line-height: 1.08;
  letter-spacing: -.015em;
}

.viewer__track {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--gutter);
  padding: 4px var(--gutter) 8px;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}
.viewer__track::-webkit-scrollbar { display: none; }
.viewer__track:focus-visible { outline-offset: -2px; }
.viewer__track figure {
  flex: none;
  scroll-snap-align: start;
  max-width: calc(100vw - 2 * var(--gutter));
}
.viewer__track picture { height: min(66vh, 760px); background: var(--ink-2); }
.viewer__track img {
  height: 100%;
  width: auto;
  max-width: calc(100vw - 2 * var(--gutter));
  object-fit: cover;
}
.viewer__track figcaption {
  margin-top: 12px;
  font-size: .8125rem;
  color: var(--cream-60);
}

.viewer__nav {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 18px var(--gutter) 0;
}

.viewer__info {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: 24px;
  row-gap: 40px;
  padding: 40px var(--gutter) 56px;
  border-top: 1px solid var(--line);
  margin-top: 28px;
}
.viewer__facts {
  grid-column: 1 / span 5;
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 14px 32px;
  align-content: start;
}
.viewer__facts dt {
  font: 500 .6875rem/1.9 var(--sans);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--salmon);
}
.viewer__facts dd { color: var(--cream); }
.viewer__desc { grid-column: 7 / span 6; }
.viewer__desc p:first-child { font-size: clamp(1.05rem, 1rem + .3vw, 1.25rem); line-height: 1.55; color: var(--cream); }
.viewer__note { margin-top: 18px; font-size: .875rem; color: var(--cream-60) !important; }

.viewer__video { padding: 0 var(--gutter) 88px; }
.video {
  position: relative;
  aspect-ratio: 16 / 9;
  max-width: 1200px;
  background: #15110E;
  overflow: hidden;
}
.video video { width: 100%; height: 100%; object-fit: cover; }
.video__play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  font: 500 .8125rem/1 var(--sans);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--cream);
  background-color: #15110E;
  background-size: cover;
  background-position: center;
}
.video__play::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(33, 26, 22, .45);
  transition: background-color .4s var(--ease);
}
.video__play:hover::before { background: rgba(33, 26, 22, .3); }
.video__play > * { position: relative; }
.video__icon {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  background: var(--salmon);
  color: var(--ink);
  transition: transform .4s var(--ease);
}
.video__icon .icon { width: 26px; height: 26px; margin-left: 3px; }
.video__play:hover .video__icon { transform: scale(1.06); }
.video.is-playing .video__play { display: none; }

@media (max-width: 899px) {
  .viewer__facts, .viewer__desc { grid-column: 1 / -1; }
  .viewer__track picture { height: 56vh; }
}

/* ---------- Moviment reduït ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* ---------- Preguntes freqüents ---------- */

.faq { padding-block: clamp(110px, 16vh, 200px); border-top: 1px solid rgba(250, 246, 241, .08); }
.faq__grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: 24px;
  row-gap: 48px;
  align-items: start;
}
.faq__head { grid-column: 1 / span 4; position: sticky; top: 120px; }
.faq__head .rule { margin-bottom: 30px; }
.faq__list { grid-column: 6 / span 7; border-top: 1px solid rgba(250, 246, 241, .16); }
.faq__item { border-bottom: 1px solid rgba(250, 246, 241, .16); }
.faq__item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 26px 0;
  cursor: pointer;
  list-style: none;
}
.faq__item summary::-webkit-details-marker { display: none; }
.faq__q {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.25rem, 1.05rem + .6vw, 1.6rem);
  line-height: 1.2;
  color: var(--cream);
  transition: color .3s var(--ease);
}
.faq__item summary:hover .faq__q { color: var(--salmon); }
.faq__sign { position: relative; flex: none; width: 16px; height: 16px; }
.faq__sign::before,
.faq__sign::after {
  content: "";
  position: absolute;
  left: 0; top: 7px;
  width: 16px; height: 2px;
  background: var(--salmon);
  transition: transform .35s var(--ease);
}
.faq__sign::after { transform: rotate(90deg); }
.faq__item[open] .faq__sign::after { transform: rotate(0deg); }
.faq__a { padding: 0 0 30px; max-width: 58ch; }
.faq__a p { font-size: 1.0625rem; }
.faq__a .link { margin-top: 16px; }

@media (max-width: 899px) {
  .faq__head, .faq__list { grid-column: 1 / -1; }
  .faq__head { position: static; }
}

/* ---------- Pàgines d'article ---------- */

.article { padding-top: calc(var(--nav-h) + clamp(56px, 9vh, 110px)); padding-bottom: clamp(90px, 14vh, 170px); }
.article__wrap { max-width: 960px; }
.article__crumbs { font: 500 .75rem/1.4 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--cream-60); margin-bottom: 34px; }
.article__crumbs a { color: var(--cream-80); }
.article__crumbs a:hover { color: var(--salmon); }
.article__title { margin-top: 30px; max-width: 16ch; }
.article__lead { margin-top: 28px; max-width: 46ch; }
.article__figure { margin: clamp(48px, 8vh, 84px) 0 0; }
.article__figure img { width: 100%; height: auto; display: block; }
.article__figure figcaption { margin-top: 12px; font-size: .8125rem; color: var(--cream-60); }
.article__body { max-width: 64ch; margin-top: clamp(48px, 8vh, 84px); }
.article__body .h3 { margin: 56px 0 18px; }
.article__body .h3:first-child { margin-top: 0; }
.article__body p { font-size: 1.0625rem; }
.article__list { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; }
.article__list li { position: relative; padding-left: 28px; color: var(--cream-80); font-size: 1.0625rem; line-height: 1.6; }
.article__list li::before { content: ""; position: absolute; left: 0; top: .78em; width: 14px; height: 2px; background: var(--salmon); }
.article__list strong { color: var(--cream); font-weight: 500; }
.article__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 28px; margin-top: 34px; }
.page-article .nav__cta { margin-left: auto; }
