/* ==========================================================================
   IMESDE — Integració, distribució i enginyeria escènica
   Identitat 2026: DM Sans · verd #BCE12A · tinta #2B2B2B · crema #F4F3EF
   ========================================================================== */

:root {
  --cream: #f4f3ef;
  --cream-2: #edecE6;
  --sage: #eaeddc;
  --white: #ffffff;
  --ink: #2b2b2b;
  --ink-soft: #62625e;
  --green: #bce12a;
  --green-deep: #a3c414;
  --green-ink: #5f7207;
  --dark: #2b2b2b;
  --dark-2: #343430;
  --line: rgba(43, 43, 43, 0.16);
  --line-strong: rgba(43, 43, 43, 0.32);
  --line-light: rgba(244, 243, 239, 0.2);
  --radius: 16px;
  --font: "DM Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --header-h: 74px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 20px);
  background: var(--cream);
  overflow-x: hidden;
  overflow-x: clip;
}

body {
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  overflow-x: clip;
}

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

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; background: none; border: none; cursor: pointer; color: inherit; }

.container {
  width: min(1240px, 100% - clamp(40px, 8vw, 96px));
  margin-inline: auto;
}

/* ==========================================================================
   Capçalera — editorial, filet inferior
   ========================================================================== */

.site-header {
  position: fixed;
  inset-inline: 0;
  z-index: 50;
  border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top, 0px);
  /* ni transform ni backdrop-filter aquí: farien que el menú desplegable (fixed)
     es posicionés respecte la capçalera en comptes de la finestra */
  top: calc(-1 * (var(--header-h) + env(safe-area-inset-top, 0px) + 40px));
  transition: top 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}
.site-header.visible { top: 0; }

.site-header > .container { position: relative; z-index: 1; }

/* el vidre viu en una capa pròpia, germana del menú */
.header-glass {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: rgba(244, 243, 239, 0.68);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  pointer-events: none;
}

/* extensió del vidre cap amunt: cobreix la zona sota la barra d'estat d'iOS,
   on el contingut passa per darrere; en escriptori queda fora de pantalla */
.header-glass::before {
  content: "";
  position: absolute;
  inset-inline: 0;
  bottom: 100%;
  height: 150px;
  background: rgba(244, 243, 239, 0.68);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
}

.site-header .bar {
  display: flex;
  align-items: center;
  gap: clamp(16px, 2.5vw, 28px);
  height: var(--header-h);
}

.brand { display: flex; align-items: center; flex: 0 0 auto; }
.brand img { height: 34px; width: auto; translate: 0 2px; }
.brand .logo-green { display: none; }

.brand-divider {
  width: 1px;
  height: 26px;
  background: var(--line);
}

.header-tag {
  font-size: 12.5px;
  letter-spacing: 0.02em;
  color: var(--ink-soft);
  line-height: 1;
}

.main-nav { display: flex; align-items: center; gap: clamp(14px, 2.2vw, 26px); margin-left: auto; }

.main-nav a.nav-link {
  font-size: 14.5px;
  font-weight: 500;
  color: var(--ink);
  padding: 6px 2px;
  transition: color 0.25s ease;
}
.main-nav a.nav-link:hover { color: var(--green-ink); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 999px;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease,
    color 0.25s ease, border-color 0.25s ease;
}

.btn-green {
  background: var(--green);
  color: var(--ink);
  padding: 11px 22px;
  font-size: 14.5px;
}
.btn-green:hover {
  background: var(--green-deep);
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(163, 196, 20, 0.4);
}

.btn-ghost {
  border: 1px solid var(--line-strong);
  color: var(--ink);
  padding: 11px 22px;
  font-size: 14.5px;
}
.btn-ghost:hover { border-color: var(--ink); }

.btn-ghost-light {
  border: 1px solid rgba(244, 243, 239, 0.35);
  color: var(--cream);
  padding: 11px 22px;
  font-size: 14.5px;
}
.btn-ghost-light:hover { border-color: var(--green); color: var(--green); }

.menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  position: relative;
  z-index: 70;
  border: 1px solid var(--line-strong);
}
.menu-toggle span {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 18px;
  height: 2px;
  background: var(--ink);
  translate: -50% -50%;
  transition: rotate 0.3s ease, translate 0.3s ease, opacity 0.3s ease;
}
.menu-toggle span:nth-child(1) { translate: -50% calc(-50% - 6px); }
.menu-toggle span:nth-child(3) { translate: -50% calc(-50% + 6px); }
body.menu-open .menu-toggle span:nth-child(1) { translate: -50% -50%; rotate: 45deg; }
body.menu-open .menu-toggle span:nth-child(2) { opacity: 0; }
body.menu-open .menu-toggle span:nth-child(3) { translate: -50% -50%; rotate: -45deg; }

/* ==========================================================================
   Hero — portada fosca amb cercles concèntrics (estil memòria)
   ========================================================================== */

.hero {
  position: relative;
  min-height: 100svh;
  background: var(--dark);
  color: var(--cream);
  display: flex;
  flex-direction: column;
  overflow: clip;
}

.hero-circles {
  position: absolute;
  top: 0;
  right: 0;
  width: clamp(420px, 52vw, 900px);
  aspect-ratio: 1;
  translate: 34% -34%;
  pointer-events: none;
}
.hero-circles::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: clamp(60px, 7vw, 120px) solid var(--green);
}
.hero-circles::after {
  content: "";
  position: absolute;
  inset: 27%;
  border-radius: 50%;
  background: var(--green);
}

.hero-inner {
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: clamp(48px, 9vh, 90px);
  padding-bottom: 40px;
}

.hero-logo img { height: clamp(52px, 7vw, 84px); width: auto; }

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-top: clamp(34px, 6vh, 60px);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--green);
}
.hero-eyebrow::before {
  content: "";
  width: 30px;
  height: 1px;
  background: var(--green);
}

.hero-title {
  margin-top: 18px;
  font-size: clamp(46px, 7.6vw, 108px);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.03em;
  max-width: 9em;
}

/* finestres amples i baixes: el títol respira i no toca els cercles */
@media (min-width: 1100px) and (max-height: 840px) {
  .hero-title { font-size: clamp(44px, 6vw, 88px); }
  .hero-eyebrow { margin-top: clamp(22px, 4vh, 40px); }
}
.hero-title .green { color: var(--green); }

.hero-sub {
  margin-top: clamp(20px, 3.5vh, 32px);
  max-width: 56ch;
  font-size: clamp(16px, 1.55vw, 19px);
  font-weight: 300;
  color: rgba(244, 243, 239, 0.78);
}
.hero-sub strong { font-weight: 600; color: var(--cream); }

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: clamp(28px, 4.5vh, 44px);
}
.hero-cta .btn { padding: 15px 30px; font-size: 15.5px; }

.hero-foot {
  position: relative;
  z-index: 2;
  border-top: 1px solid var(--line-light);
  padding-block: 18px;
}
.hero-foot .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  font-size: 12.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(244, 243, 239, 0.55);
}
.hero-foot .scroll-cue { display: inline-flex; align-items: center; gap: 10px; }
.hero-foot .scroll-cue i {
  width: 8px; height: 8px;
  border-right: 1.5px solid var(--green);
  border-bottom: 1.5px solid var(--green);
  rotate: 45deg;
  translate: 0 -2px;
  animation: cue 1.8s ease-in-out infinite;
}
@keyframes cue {
  0%, 100% { translate: 0 -3px; opacity: 0.5; }
  50% { translate: 0 2px; opacity: 1; }
}

/* ==========================================================================
   Marquesina d'espais — franja editorial
   ========================================================================== */

.marquee {
  border-bottom: 1px solid var(--line);
  background: var(--cream);
  padding-block: 16px;
  overflow: hidden;
}

.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee 38s linear infinite;
}

@keyframes marquee { to { translate: -50% 0; } }

.marquee-group { display: flex; align-items: center; flex: 0 0 auto; }

.marquee-group span {
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink);
  white-space: nowrap;
  padding-inline: 26px;
}

.marquee-group i {
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid var(--green);
  position: relative;
}
.marquee-group i::after {
  content: "";
  position: absolute;
  inset: 2px;
  border-radius: 50%;
  background: var(--green);
}

/* ==========================================================================
   Seccions — comuns
   ========================================================================== */

section { position: relative; }
.section-pad { padding-block: clamp(84px, 12vh, 150px); }

.section-head { margin-bottom: clamp(40px, 6.5vh, 72px); }

.kicker {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--green-ink);
  margin-bottom: 16px;
}
.kicker::after {
  content: "";
  height: 1px;
  width: 68px;
  background: var(--green);
}

.section-title {
  font-size: clamp(38px, 5.4vw, 72px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.04;
}
.section-title .green { color: var(--green-deep); }

/* icona de verificació (motiu de la memòria) */
.check {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--green);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.check::after {
  content: "";
  width: 10px;
  height: 5px;
  border-left: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  rotate: -45deg;
  translate: 0 -1px;
}

/* animacions d'entrada */
[data-reveal] {
  opacity: 0;
  translate: 0 30px;
  transition: opacity 0.85s cubic-bezier(0.22, 1, 0.36, 1),
    translate 0.85s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: var(--d, 0s);
}
[data-reveal].in { opacity: 1; translate: 0 0; }

/* ==========================================================================
   Serveis
   ========================================================================== */

.service-row {
  display: grid;
  grid-template-columns: 1.04fr 0.96fr;
  gap: clamp(34px, 5.5vw, 84px);
  align-items: center;
  padding-block: clamp(34px, 5.5vh, 60px);
}
.service-row + .service-row { border-top: 1px solid var(--line); }
.service-row:nth-child(even) .service-media { order: 2; }

.service-media {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: none;
  border-radius: var(--radius);
  overflow: hidden;
  isolation: isolate;
  box-shadow: 0 18px 44px rgba(43, 43, 43, 0.14);
  cursor: pointer;
}
.service-media img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  scale: 1.05;
  transition: scale 1.1s cubic-bezier(0.22, 1, 0.36, 1);
}
.service-row:hover .service-media img { scale: 1.0; }

.gallery-hint {
  position: absolute;
  z-index: 2;
  bottom: 14px;
  right: 14px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  background: rgba(244, 243, 239, 0.94);
  color: var(--ink);
  font-family: var(--font);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 8px 15px;
  transition: background 0.25s ease, translate 0.25s ease;
}
.gallery-hint i {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--green);
  position: relative;
}
.gallery-hint i::before,
.gallery-hint i::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  translate: -50% -50%;
  background: var(--ink);
}
.gallery-hint i::before { width: 8px; height: 2px; }
.gallery-hint i::after { width: 2px; height: 8px; }
.service-media:hover .gallery-hint { background: var(--green); translate: 0 -3px; }

.service-body h3 {
  font-size: clamp(24px, 2.8vw, 36px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.12;
  margin-bottom: 16px;
}

.service-body p { color: var(--ink-soft); max-width: 54ch; }

.chip-row { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 22px; }

.chip {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 15px;
  background: var(--white);
  transition: border-color 0.25s ease, background 0.25s ease;
}
.service-row:hover .chip { border-color: var(--green-deep); }

.service-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 26px;
  font-weight: 700;
  font-size: 15px;
  color: var(--ink);
  border-bottom: 2px solid var(--green);
  padding-bottom: 3px;
}
.service-link .arr { transition: translate 0.3s ease; }
.service-link:hover { color: var(--green-ink); }
.service-link:hover .arr { translate: 5px 0; }

/* ==========================================================================
   L'estudi
   ========================================================================== */

.statement {
  font-size: clamp(23px, 3vw, 40px);
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: -0.02em;
  max-width: 24em;
}
.statement .hl {
  font-style: normal;
  font-weight: 700;
  background: linear-gradient(transparent 62%, var(--green) 62%);
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-top: clamp(44px, 7vh, 76px);
}

.stat {
  background: var(--sage);
  border-radius: var(--radius);
  padding: 26px 24px 22px;
  transition: translate 0.3s ease, box-shadow 0.3s ease;
}
.stat:hover { translate: 0 -5px; box-shadow: 0 14px 30px rgba(43, 43, 43, 0.1); }

.stat b {
  display: block;
  font-size: clamp(34px, 3.4vw, 50px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--ink);
  margin-bottom: 10px;
  white-space: nowrap;
}
.stat b em { font-style: normal; color: var(--green-deep); }
.stat b span { font: inherit; color: inherit; display: inline; }
.stat > span { font-size: 14px; color: var(--ink-soft); line-height: 1.45; display: block; }

.espais { margin-top: clamp(52px, 8vh, 84px); }
.espais > p { color: var(--ink-soft); max-width: 62ch; margin-bottom: 20px; }
.espais > p strong { color: var(--ink); }

.espais-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.espais-chips .chip {
  font-size: 13px;
  padding: 10px 19px;
  background: var(--white);
  text-transform: none;
  letter-spacing: 0.01em;
  font-weight: 500;
}
.espais-chips .chip:hover { border-color: var(--green-deep); background: var(--sage); }

.pull-line {
  margin-block: clamp(56px, 9vh, 100px) clamp(36px, 6vh, 64px);
  display: flex;
  align-items: center;
  gap: 22px;
}
.pull-line::before, .pull-line::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--line);
}
.pull-line p {
  flex: 0 1 auto;
  text-align: center;
  font-size: clamp(17px, 1.85vw, 22px);
  font-weight: 600;
  max-width: 46ch;
}
.pull-line .hl {
  font-style: normal;
  background: linear-gradient(transparent 62%, var(--green) 62%);
}

.team-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }

.team-card {
  border-radius: var(--radius);
  background: var(--white);
  border: 1px solid var(--line);
  padding: clamp(24px, 2.8vw, 36px);
  transition: translate 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}
.team-card:hover {
  translate: 0 -5px;
  box-shadow: 0 16px 34px rgba(43, 43, 43, 0.1);
  border-color: var(--green-deep);
}
.team-card p { color: var(--ink-soft); font-size: 16px; }
.team-card p strong { color: var(--ink); font-weight: 700; }

/* ==========================================================================
   Valors
   ========================================================================== */

#valors { background: var(--sage); }
#valors .section-title { max-width: 14em; }

.values-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }

.value-card {
  background: var(--cream);
  border-radius: var(--radius);
  padding: 28px 24px;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: translate 0.3s ease, box-shadow 0.3s ease;
}
.value-card:hover { translate: 0 -5px; box-shadow: 0 16px 30px rgba(43, 43, 43, 0.12); }

.value-card .num {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--green-ink);
}
.value-card h3 { font-size: 20px; font-weight: 700; margin-top: 14px; }
.value-card p { color: var(--ink-soft); font-size: 14.5px; line-height: 1.55; }

/* ==========================================================================
   Acompanyament
   ========================================================================== */

.quote {
  font-size: clamp(28px, 4.2vw, 56px);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.08;
  max-width: 18em;
  margin-bottom: clamp(44px, 7vh, 80px);
}
.quote .green { color: var(--green-deep); }

.bento { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; }

.bento-card {
  grid-column: span 2;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(22px, 2.4vw, 32px);
  display: flex;
  flex-direction: column;
  gap: 13px;
  transition: translate 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}
.bento-card:hover {
  translate: 0 -5px;
  box-shadow: 0 16px 34px rgba(43, 43, 43, 0.1);
  border-color: var(--green-deep);
}
.bento-card.wide { grid-column: span 3; background: var(--sage); border-color: transparent; }

.bento-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.bento-card h3 { font-size: 19px; font-weight: 700; line-height: 1.25; letter-spacing: -0.01em; }

.bento-card > p { color: var(--ink-soft); font-size: 14.5px; flex: 1; }

.bento-card ul { list-style: none; display: grid; gap: 9px; }
.bento-card li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14.5px;
  font-weight: 500;
}
.bento-card li .check { width: 19px; height: 19px; margin-top: 2px; }
.bento-card li .check::after { width: 8px; height: 4px; }

/* ---- certificació ---- */
.cert-strip {
  display: flex;
  align-items: center;
  gap: clamp(22px, 4vw, 44px);
  border-radius: var(--radius);
  background: var(--white);
  border: 1px solid var(--line);
  padding: clamp(22px, 3vw, 36px);
  flex-wrap: wrap;
  margin-top: clamp(40px, 6vh, 60px);
}
.cert-strip .cert-badge img { height: 84px; width: auto; }
.cert-strip .cert-text h3 { font-size: 19px; font-weight: 700; margin-bottom: 5px; }
.cert-strip .cert-text p { color: var(--ink-soft); font-size: 14.5px; max-width: 56ch; }

/* ==========================================================================
   Contacte — contraportada fosca
   ========================================================================== */

.contact {
  background: var(--dark);
  color: var(--cream);
  overflow: clip;
}

.contact-circles {
  position: absolute;
  bottom: 0;
  right: 0;
  width: clamp(320px, 34vw, 580px);
  aspect-ratio: 1;
  translate: 40% 48%;
  pointer-events: none;
}
.contact-circles::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: clamp(50px, 6vw, 100px) solid var(--green);
  opacity: 0.9;
}
.contact-circles::after {
  content: "";
  position: absolute;
  inset: 27%;
  border-radius: 50%;
  background: var(--green);
}

.contact .container { position: relative; z-index: 2; }

.contact .kicker { color: var(--green); }
.contact .kicker::after { background: var(--green); }

.contact-title {
  font-size: clamp(44px, 7vw, 100px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.02;
  max-width: 10em;
}
.contact-title .green { color: var(--green); }

.contact-sub {
  margin-top: 18px;
  color: rgba(244, 243, 239, 0.7);
  font-weight: 300;
  max-width: 52ch;
  font-size: 17px;
}

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  margin-top: clamp(30px, 5vh, 48px);
}
.contact-actions .btn-green { padding: 17px 34px; font-size: 17px; }
.contact-actions .btn-ghost-light { padding: 17px 34px; font-size: 17px; }

/* ==========================================================================
   Peu — fosc, continuació del contacte
   ========================================================================== */

.site-footer {
  background: var(--dark);
  color: var(--cream);
  border-top: 1px solid var(--line-light);
  position: relative;
  overflow: clip;
}

.footer-watermark {
  position: absolute;
  right: -70px;
  bottom: -90px;
  width: 320px;
  opacity: 0.05;
  pointer-events: none;
}

.footer-top {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr 1fr;
  gap: clamp(30px, 5vw, 56px);
  padding-block: clamp(50px, 7vh, 76px) clamp(36px, 5vh, 56px);
}

.footer-brand img { height: 44px; width: auto; }
.footer-brand p {
  margin-top: 16px;
  color: rgba(244, 243, 239, 0.6);
  font-size: 14.5px;
  font-weight: 300;
  max-width: 34ch;
}

.footer-col h4 {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--green);
  margin-bottom: 16px;
}

.footer-col ul { list-style: none; display: grid; gap: 10px; }
.footer-col a {
  color: rgba(244, 243, 239, 0.72);
  font-size: 14.5px;
  transition: color 0.25s ease;
}
.footer-col a:hover { color: var(--green); }

.footer-bottom {
  border-top: 1px solid var(--line-light);
  padding-block: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: rgba(244, 243, 239, 0.55);
}
.footer-bottom a {
  color: var(--cream);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.footer-bottom a:hover { color: var(--green); }

/* ==========================================================================
   Pàgina legal
   ========================================================================== */

.legal-header {
  border-bottom: 1px solid var(--line);
  background: var(--cream);
}
.legal-header .container {
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.legal-header img { height: 30px; width: auto; translate: 0 2px; }
.legal-header a.back {
  font-size: 14.5px;
  font-weight: 600;
  border-bottom: 2px solid var(--green);
  padding-bottom: 2px;
  transition: color 0.25s ease;
}
.legal-header a.back:hover { color: var(--green-ink); }

.legal-main { padding-block: clamp(56px, 9vh, 100px); }
.legal-main h1 {
  font-size: clamp(34px, 4.6vw, 56px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin-bottom: clamp(28px, 4vh, 44px);
  max-width: 16em;
}

.legal-body {
  max-width: 72ch;
  display: grid;
  gap: 18px;
  color: var(--ink-soft);
}
.legal-body strong { color: var(--ink); }
.legal-body ul { list-style: none; display: grid; gap: 12px; padding-block: 6px; }
.legal-body li {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  color: var(--ink);
}
.legal-body li .check { margin-top: 3px; width: 19px; height: 19px; }
.legal-body li .check::after { width: 8px; height: 4px; }
.legal-body a {
  color: var(--green-ink);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.legal-footer {
  border-top: 1px solid var(--line);
  padding-block: 24px;
  font-size: 13px;
  color: var(--ink-soft);
}
.legal-footer a { text-decoration: underline; text-underline-offset: 3px; }
.legal-footer a:hover { color: var(--green-ink); }

/* ==========================================================================
   Lightbox de galeries
   ========================================================================== */

.lightbox[hidden] { display: none; }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--dark);
  clip-path: circle(0px at var(--cx, 50%) var(--cy, 50%));
  transition: clip-path 0.68s cubic-bezier(0.22, 1, 0.36, 1);
}
.lightbox.open { clip-path: circle(150% at var(--cx, 50%) var(--cy, 50%)); }
.lightbox.closing { transition-duration: 0.5s; }

.lb-stage {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: var(--dark);
}

.lb-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  user-select: none;
}
.lb-layer.is-in {
  animation:
    lb-in 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards,
    lb-kenburns 9s ease-in-out 0.7s infinite alternate;
}
.lb-layer.is-out { animation: lb-out 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards; }

@keyframes lb-in {
  from { opacity: 0; translate: calc(var(--dir, 0) * 7%) 0; scale: 1.08; }
  to { opacity: 1; translate: 0 0; scale: 1; }
}
@keyframes lb-out {
  from { opacity: 1; translate: 0 0; scale: 1; }
  to { opacity: 0; translate: calc(var(--dir, 0) * -6%) 0; scale: 0.97; }
}
@keyframes lb-kenburns { to { scale: 1.06; } }

.lb-scrim {
  position: absolute;
  inset-inline: 0;
  height: clamp(110px, 18vh, 170px);
  pointer-events: none;
  z-index: 2;
}
.lb-scrim-top { top: 0; background: linear-gradient(180deg, rgba(20, 20, 18, 0.65), transparent); }
.lb-scrim-bot { bottom: 0; background: linear-gradient(0deg, rgba(20, 20, 18, 0.65), transparent); }

.lb-top {
  position: absolute;
  top: 0;
  inset-inline: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: clamp(16px, 2.5vw, 26px) clamp(16px, 3vw, 36px);
  opacity: 0;
  translate: 0 -16px;
  transition: opacity 0.45s ease 0.32s, translate 0.45s ease 0.32s;
}
.lightbox.open .lb-top { opacity: 1; translate: 0 0; }

.lb-title {
  color: var(--cream);
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.lb-title::before {
  content: "";
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green);
}

.lb-close {
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--cream);
  color: var(--ink);
  font-size: 26px;
  line-height: 1;
  display: grid;
  place-items: center;
  transition: background 0.25s ease, rotate 0.25s ease;
}
.lb-close:hover { background: var(--green); rotate: 90deg; }

.lb-btn {
  position: absolute;
  top: calc(50% - 27px);
  z-index: 3;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--green);
  color: var(--ink);
  font-size: 20px;
  font-weight: 700;
  display: grid;
  place-items: center;
  opacity: 0;
  scale: 0.7;
  transition: opacity 0.4s ease 0.44s, scale 0.4s ease 0.44s, background 0.25s ease;
}
.lightbox.open .lb-btn { opacity: 1; scale: 1; }
.lb-btn:hover { background: var(--green-deep); scale: 1.08; }
.lb-prev { left: clamp(14px, 2.5vw, 32px); }
.lb-next { right: clamp(14px, 2.5vw, 32px); }

.lb-bottom {
  position: absolute;
  bottom: 0;
  inset-inline: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding-bottom: clamp(18px, 3.5vh, 30px);
  opacity: 0;
  translate: 0 16px;
  transition: opacity 0.45s ease 0.52s, translate 0.45s ease 0.52s;
}
.lightbox.open .lb-bottom { opacity: 1; translate: 0 0; }

.lb-count {
  color: var(--cream);
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
}

.lb-progress {
  display: block;
  width: min(220px, 40vw);
  height: 2px;
  border-radius: 2px;
  background: rgba(244, 243, 239, 0.25);
  overflow: hidden;
}
.lb-progress i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 2px;
  background: var(--green);
  transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.lightbox.closing .lb-top,
.lightbox.closing .lb-btn,
.lightbox.closing .lb-bottom { opacity: 0; transition: opacity 0.16s ease; }

body.lb-open { overflow: hidden; }

@media (max-width: 640px) {
  .lb-btn { width: 48px; height: 48px; top: auto; bottom: 74px; }
  .lb-bottom { padding-bottom: 16px; }
}

/* ==========================================================================
   Responsiu
   ========================================================================== */

@media (max-width: 1060px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .bento { grid-template-columns: repeat(2, 1fr); }
  .bento-card, .bento-card.wide { grid-column: span 1; }
  .values-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-top { grid-template-columns: 1fr 1fr; }
  .header-tag { display: none; }
  .brand-divider { display: none; }
}

@media (max-width: 880px) {
  /* amb el menú obert: capçalera sempre visible i pàgina bloquejada */
  body.menu-open { overflow: hidden; }
  body.menu-open .site-header { top: 0; }

  /* menú de vidre gelat que s'obre en cercle des del botó */
  .main-nav {
    position: fixed;
    inset: 0;
    z-index: 60;
    flex-direction: column;
    justify-content: center;
    gap: 10px;
    margin-left: 0;
    background: rgba(244, 243, 239, 0.72);
    backdrop-filter: blur(26px) saturate(1.6);
    -webkit-backdrop-filter: blur(26px) saturate(1.6);
    visibility: hidden;
    pointer-events: none;
    clip-path: circle(0px at var(--mx, 100%) var(--my, 37px));
    transition: clip-path 0.62s cubic-bezier(0.22, 1, 0.36, 1), visibility 0s linear 0.62s;
  }
  body.menu-open .main-nav {
    visibility: visible;
    pointer-events: auto;
    clip-path: circle(155% at var(--mx, 100%) var(--my, 37px));
    transition: clip-path 0.62s cubic-bezier(0.22, 1, 0.36, 1), visibility 0s;
  }

  body.menu-open .brand .logo-green { display: none; }
  body.menu-open .brand .logo-dark { display: block; position: relative; z-index: 65; }
  body.menu-open .brand { z-index: 65; position: relative; }

  .main-nav a.nav-link {
    font-size: clamp(30px, 8vw, 44px);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--ink);
    opacity: 0;
    translate: 0 22px;
    transition: opacity 0.45s ease, translate 0.55s cubic-bezier(0.22, 1, 0.36, 1),
      color 0.25s ease;
  }
  body.menu-open .main-nav a.nav-link { opacity: 1; translate: 0 0; color: var(--ink); }
  body.menu-open .main-nav a.nav-link:nth-child(1) { transition-delay: 0.16s; }
  body.menu-open .main-nav a.nav-link:nth-child(2) { transition-delay: 0.22s; }
  body.menu-open .main-nav a.nav-link:nth-child(3) { transition-delay: 0.28s; }
  body.menu-open .main-nav a.nav-link:nth-child(4) { transition-delay: 0.34s; }
  .main-nav a.nav-link:hover { color: var(--green-ink); }

  .main-nav .btn-green {
    margin-top: 18px;
    opacity: 0;
    scale: 0.94;
    transition: opacity 0.45s ease, scale 0.45s cubic-bezier(0.22, 1, 0.36, 1);
  }
  body.menu-open .main-nav .btn-green { opacity: 1; scale: 1; transition-delay: 0.42s; }

  .menu-toggle { display: block; margin-left: auto; }
  .main-nav + .menu-toggle { margin-left: 0; }
  .site-header .bar { justify-content: space-between; }

  .hero-circles, .contact-circles { display: none; }

  .service-row { grid-template-columns: 1fr; gap: 24px; }
  .service-row:nth-child(even) .service-media { order: 0; }

  .team-grid { grid-template-columns: 1fr; }
  .footer-top { grid-template-columns: 1fr; gap: 34px; }
  .cert-strip { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 560px) {
  body { font-size: 16px; }
  .value-card { min-height: 0; }
  .value-card h3 { margin-top: 4px; }
  .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .values-grid { grid-template-columns: 1fr; }
  .bento { grid-template-columns: 1fr; }
  .brand img { height: 28px; }
  .hero-cta .btn { width: 100%; }
  .contact-actions { flex-direction: column; align-items: stretch; }
  .hero-foot .container { justify-content: center; }
  .hero-foot .tagline { display: none; }
}

/* ==========================================================================
   Accessibilitat
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .marquee-track, .hero-foot .scroll-cue i { animation: none; }
  [data-reveal] { opacity: 1; translate: 0 0; transition: none; }
  * { transition-duration: 0.01ms !important; }
  .lightbox { clip-path: none; opacity: 0; }
  .lightbox.open { opacity: 1; }
  .lb-layer.is-in { animation: none; opacity: 1; }
  .lb-layer.is-out { animation: none; opacity: 0; }
}

:focus-visible { outline: 2px solid var(--green-deep); outline-offset: 3px; border-radius: 4px; }
