/* ============================================================
   RENOVEM · Obres i Serveis — Girona
   Sistema visual: "Blueprint Industrial"
   ============================================================ */

/* ---------- 1. Tokens ---------- */
:root {
  --bg:        #04070F;
  --bg-2:      #060C1A;
  --bg-3:      #0A1428;
  --card:      #08101F;
  --navy:      #071B49;
  --navy-2:    #0C2A6B;

  --ink:       #EEF2FA;
  --ink-2:     #B9C4DA;
  --mute:      #7C8AA8;
  --dim:       rgba(238, 242, 250, 0.42);

  --accent:    #FF6417;
  --accent-2:  #FF8A45;
  --accent-dk: #C64300;

  --line:      rgba(124, 138, 168, 0.20);
  --line-2:    rgba(124, 138, 168, 0.34);
  --grid:      rgba(124, 160, 220, 0.055);

  --font-d: "Space Grotesk", "Segoe UI", system-ui, sans-serif;
  --font-b: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-m: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --ease:     cubic-bezier(0.22, 1, 0.36, 1);
  --ease-io:  cubic-bezier(0.65, 0, 0.35, 1);

  --nav-h:  90px;
  --pad:    clamp(1.25rem, 5vw, 5.5rem);
  --maxw:   1400px;
  --r:      2px;
}

/* ---------- 2. Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

html {
  overflow-x: clip;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 20px);
  -webkit-text-size-adjust: 100%;
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  overflow-x: clip;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-b);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
ul, ol { list-style: none; }

::selection { background: var(--accent); color: #fff; }

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

/* ---------- 3. Tipografía ---------- */
h1, h2, h3, h4 {
  font-family: var(--font-d);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.d1 { font-size: clamp(2.6rem, 7.6vw, 6.6rem); }
.d2 { font-size: clamp(2.1rem, 5.2vw, 4.2rem); }
.d3 { font-size: clamp(1.5rem, 2.6vw, 2.3rem); letter-spacing: -0.025em; }
.d4 { font-size: clamp(1.15rem, 1.6vw, 1.4rem); letter-spacing: -0.02em; line-height: 1.18; }

em, .em {
  font-style: normal;
  color: var(--accent);
}

.kicker {
  font-family: var(--font-m);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 0.7rem;
}
.kicker::before {
  content: "";
  width: 26px;
  height: 1px;
  background: var(--accent);
  flex: none;
}
.kicker--plain::before { display: none; }

.lede {
  font-size: clamp(1.02rem, 1.35vw, 1.2rem);
  color: var(--ink-2);
  max-width: 62ch;
  line-height: 1.68;
}
p { color: var(--ink-2); }
.mute { color: var(--mute); }
strong { color: var(--ink); font-weight: 600; }

.mono {
  font-family: var(--font-m);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mute);
}

/* ---------- 4. Layout ---------- */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--pad);
}

.section {
  position: relative;
  padding-block: clamp(4.5rem, 9vw, 8.5rem);
}
.section--tight { padding-block: clamp(3rem, 6vw, 5.5rem); }
.section--alt { background: var(--bg-2); }

.section-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.4rem;
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
}
@media (min-width: 900px) {
  .section-head { grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: 3rem; align-items: end; }
}
.section-head .kicker { margin-bottom: 1.1rem; }

.rule {
  height: 1px;
  background: var(--line);
  border: 0;
}

/* ---------- 5. Fondo blueprint global ---------- */
.bp-grid {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(to right, var(--grid) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid) 1px, transparent 1px);
  background-size: 74px 74px;
  mask-image: radial-gradient(ellipse 120% 90% at 50% 0%, #000 20%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 120% 90% at 50% 0%, #000 20%, transparent 78%);
}

.bp-noise {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.035;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)'/%3E%3C/svg%3E");
}

body > main, body > footer, body > header { position: relative; z-index: 2; }

/* ---------- 6. Navegación ---------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 90;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  border-bottom: 1px solid transparent;
  transition: background 0.4s var(--ease), border-color 0.4s var(--ease), backdrop-filter 0.4s var(--ease);
}
.nav.is-stuck {
  background: rgba(4, 7, 15, 0.86);
  border-bottom-color: var(--line);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
}
.nav-inner {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--pad);
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex: none;
  transition: opacity 0.3s var(--ease);
}
.brand:hover { opacity: 0.82; }
/* La marca es el propio archivo del logotipo: el símbolo y el texto
   salen del original, así la tipografía es exactamente la de la marca. */
.brand-mark {
  width: clamp(46px, 4.6vw, 58px);
  height: auto;
}
.brand-word {
  width: clamp(118px, 12vw, 158px);
  height: auto;
}
/* En mòbil només el símbol: el logotip amb text empenyia el menú fora de
   pantalla. Cal guanyar en especificitat a la regla de tema de més avall. */
@media (max-width: 430px) {
  .brand-word,
  :root[data-theme="light"] .brand-word.logo-on-light { display: none; }
}

.nav-links {
  display: none;
  margin-left: auto;
  align-items: center;
  gap: clamp(0.5rem, 1.4vw, 1.5rem);
}
@media (min-width: 1080px) { .nav-links { display: flex; } }

.nav-link {
  position: relative;
  font-size: 0.83rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--ink-2);
  padding: 0.45rem 0.15rem;
  transition: color 0.25s var(--ease);
  white-space: nowrap;
}
.nav-link::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s var(--ease);
}
.nav-link:hover { color: var(--ink); }
.nav-link:hover::after { transform: scaleX(1); }
.nav-link.is-active { color: var(--ink); }
.nav-link.is-active::after { transform: scaleX(1); }

.nav-side {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-left: auto;
}
@media (min-width: 1080px) { .nav-side { margin-left: 0; } }

/* Selector de idioma */
.lang {
  display: flex;
  border: 1px solid var(--line-2);
  border-radius: var(--r);
  overflow: hidden;
  flex: none;
}
.lang button {
  font-family: var(--font-m);
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  padding: 0.42rem 0.6rem;
  color: var(--mute);
  transition: color 0.25s var(--ease), background 0.25s var(--ease);
}
.lang button:hover { color: var(--ink); }
.lang button.is-on { background: var(--accent); color: #fff; }

.nav-cta {
  display: none;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-m);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  padding: 0.6rem 1rem;
  border: 1px solid var(--accent);
  color: var(--accent);
  border-radius: var(--r);
  transition: background 0.3s var(--ease), color 0.3s var(--ease);
}
.nav-cta:hover { background: var(--accent); color: #fff; }
@media (min-width: 700px) { .nav-cta { display: inline-flex; } }

.burger {
  width: 42px; height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-2);
  border-radius: var(--r);
  flex: none;
}
@media (min-width: 1080px) { .burger { display: none; } }
.burger span {
  display: block;
  width: 17px; height: 1.5px;
  background: var(--ink);
  transition: transform 0.35s var(--ease), opacity 0.2s;
}
.burger span + span { margin-top: 4px; }
body.menu-open .burger span:nth-child(1) { transform: translateY(5.5px) rotate(45deg); }
body.menu-open .burger span:nth-child(2) { opacity: 0; }
body.menu-open .burger span:nth-child(3) { transform: translateY(-5.5px) rotate(-45deg); }

/* Menú móvil */
.drawer {
  position: fixed;
  inset: var(--nav-h) 0 0 0;
  z-index: 89;
  background: rgba(4, 7, 15, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 2rem var(--pad) 3rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-12px);
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease), visibility 0.35s;
  overflow-y: auto;
}
body.menu-open .drawer { opacity: 1; visibility: visible; transform: none; }
@media (min-width: 1080px) { .drawer { display: none; } }

.drawer a {
  font-family: var(--font-d);
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: baseline;
  gap: 0.85rem;
  transition: color 0.25s var(--ease), padding-left 0.3s var(--ease);
}
.drawer a:hover { color: var(--accent); padding-left: 0.5rem; }
.drawer a span {
  font-family: var(--font-m);
  font-size: 0.62rem;
  color: var(--accent);
  letter-spacing: 0.14em;
}
.drawer-foot {
  margin-top: auto;
  padding-top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.drawer-foot a {
  font-family: var(--font-b);
  font-size: 0.95rem;
  font-weight: 500;
  border: 0;
  padding: 0.3rem 0;
  color: var(--ink-2);
}

/* ---------- 7. Botones ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  font-family: var(--font-b);
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 0.95rem 1.6rem;
  border-radius: var(--r);
  border: 1px solid transparent;
  position: relative;
  overflow: hidden;
  transition: transform 0.3s var(--ease), background 0.3s var(--ease),
              color 0.3s var(--ease), border-color 0.3s var(--ease), box-shadow 0.35s var(--ease);
  will-change: transform;
}
.btn svg { width: 17px; height: 17px; flex: none; }

.btn--primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 0 0 rgba(255, 100, 23, 0);
}
.btn--primary:hover {
  background: var(--accent-2);
  transform: translateY(-2px);
  box-shadow: 0 14px 40px -12px rgba(255, 100, 23, 0.62);
}

.btn--ghost {
  border-color: var(--line-2);
  color: var(--ink);
}
.btn--ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

.btn--wa {
  background: #1FAF54;
  color: #fff;
}
.btn--wa:hover { background: #24c460; transform: translateY(-2px); box-shadow: 0 14px 40px -12px rgba(31, 175, 84, 0.6); }

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* Enlace-flecha */
.arrow-link {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-m);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}
.arrow-link svg { width: 15px; transition: transform 0.35s var(--ease); }
.arrow-link:hover svg { transform: translateX(5px); }

/* ---------- 8. Hero ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: flex-end;
  padding-top: calc(var(--nav-h) + 3rem);
  padding-bottom: clamp(2.5rem, 6vw, 5rem);
  overflow: hidden;
}
.hero--sub {
  min-height: 74vh;
  min-height: 74svh;
}

/* Foto de fondo, tratada en duotono */
.hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}
.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.5) contrast(1.14) brightness(0.52);
  transform: scale(1.06);
}
.hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, var(--bg) 4%, rgba(4,7,15,0.72) 42%, rgba(7,27,73,0.5) 100%),
    linear-gradient(115deg, rgba(255,100,23,0.20) 0%, transparent 55%);
  mix-blend-mode: normal;
}

/* Gradiente reactivo al ratón — efecto firma */
.hero-glow {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(circle 620px at var(--mx, 62%) var(--my, 38%), rgba(255, 100, 23, 0.30) 0%, transparent 62%),
    radial-gradient(circle 900px at calc(var(--mx, 62%) + 16%) calc(var(--my, 38%) + 12%), rgba(12, 42, 107, 0.55) 0%, transparent 60%);
  filter: blur(48px);
  opacity: 0.9;
}

/* Retícula técnica del hero */
.hero-hud {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(124,160,220,0.07) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(124,160,220,0.07) 1px, transparent 1px);
  background-size: 74px 74px;
}
.hero-hud::before,
.hero-hud::after {
  content: "";
  position: absolute;
  background: rgba(255, 100, 23, 0.28);
}
.hero-hud::before { left: var(--pad); top: 0; bottom: 0; width: 1px; }
.hero-hud::after  { right: var(--pad); top: 0; bottom: 0; width: 1px; }

.hero-inner {
  position: relative;
  z-index: 4;
  width: 100%;
}
.hero .kicker { margin-bottom: 1.5rem; }
.hero h1 { max-width: 17ch; }
.hero .lede { margin-top: 1.6rem; }
.hero .btn-row { margin-top: 2.2rem; }

.hero-foot {
  margin-top: clamp(2.5rem, 6vw, 4.5rem);
  padding-top: 1.4rem;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem 2.6rem;
  align-items: center;
}
.hero-stat { display: flex; align-items: baseline; gap: 0.5rem; }
.hero-stat b {
  font-family: var(--font-d);
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.03em;
}
.hero-stat b i { font-style: normal; color: var(--accent); }
/* Solo el rótulo: el <span> del contador vive dentro del <b> y debe heredar. */
.hero-stat > span {
  font-family: var(--font-m);
  font-size: 0.64rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mute);
}

/* Hero sin fotografía: el plano técnico es el protagonista.
   Se usa cuando aún no existe obra real que enseñar. */
.hero--draw {
  background:
    radial-gradient(ellipse 90% 70% at 20% 0%, rgba(12, 42, 107, 0.55), transparent 65%),
    radial-gradient(ellipse 70% 60% at 90% 100%, rgba(255, 100, 23, 0.14), transparent 70%),
    var(--bg);
}
.hero--draw .hero-draw {
  width: min(46vw, 560px);
  bottom: 12%;
  opacity: 0.72;
}
@media (max-width: 900px) {
  .hero--draw .hero-draw {
    display: block;
    position: absolute;
    right: -12%;
    bottom: auto;
    top: 16%;
    width: 78vw;
    opacity: 0.2;
  }
}

/* Dibujo técnico animado del hero */
.hero-draw {
  position: absolute;
  z-index: 3;
  right: calc(var(--pad) - 10px);
  bottom: 14%;
  width: min(40vw, 430px);
  opacity: 0.5;
  pointer-events: none;
}
.hero-draw path,
.hero-draw line,
.hero-draw rect,
.hero-draw circle,
.hero-draw polyline {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
.hero-draw .bp-dim { stroke: rgba(124, 160, 220, 0.55); stroke-width: 1; stroke-dasharray: 4 4; }
@media (max-width: 900px) { .hero-draw { display: none; } }

/* Indicador de scroll */
.scroll-hint {
  position: absolute;
  left: 50%;
  bottom: 1.3rem;
  transform: translateX(-50%);
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-m);
  font-size: 0.58rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--mute);
}
.scroll-hint i {
  display: block;
  width: 1px; height: 42px;
  background: linear-gradient(to bottom, var(--accent), transparent);
  animation: scrollPulse 2.4s var(--ease-io) infinite;
}
@keyframes scrollPulse {
  0%, 100% { transform: scaleY(0.35); opacity: 0.4; transform-origin: top; }
  50%      { transform: scaleY(1); opacity: 1; transform-origin: top; }
}
@media (prefers-reduced-motion: reduce) { .scroll-hint i { animation: none; } }
@media (max-width: 700px) { .scroll-hint { display: none; } }

/* ---------- 9. Tratamiento duotono de fotos ---------- */
.duo {
  position: relative;
  overflow: hidden;
  background: var(--bg-3);
}
.duo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(1.04) contrast(1.03);
  transition: transform 0.85s var(--ease), filter 0.6s var(--ease);
}
.duo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(150deg, rgba(7, 27, 73, 0.55) 0%, rgba(255, 100, 23, 0.35) 100%);
  mix-blend-mode: color;
  opacity: 0.3;
  transition: opacity 0.6s var(--ease);
  pointer-events: none;
}
.duo::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(to top, rgba(4, 7, 15, 0.78) 0%, transparent 58%);
  pointer-events: none;
}
.duo--flat::before { display: none; }
/* Retrat retallat a 4:3: per defecte s'agafa el centre i es menja la part
   alta. En les façanes, l'escut ha de quedar dins del quadre. */
.duo--top img { object-position: center 20%; }

/* ---------- 10. Tarjetas ---------- */
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  transition: border-color 0.45s var(--ease), transform 0.45s var(--ease), box-shadow 0.45s var(--ease);
  will-change: transform;
}
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 100, 23, 0.09) 50%, transparent 70%);
  opacity: 0;
  transition: opacity 0.6s var(--ease);
}
.card:hover {
  border-color: rgba(255, 100, 23, 0.5);
  transform: translateY(-5px);
  box-shadow: 0 26px 60px -30px rgba(255, 100, 23, 0.45);
}
.card:hover::before { opacity: 1; }
.card:hover .duo img { transform: scale(1.07); filter: saturate(1.12) contrast(1.05); }
.card:hover .duo::after { opacity: 0; }

.card-media { aspect-ratio: 4 / 3; }
.card-media--tall { aspect-ratio: 3 / 4; }
.card-body {
  padding: 1.5rem 1.5rem 1.7rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  flex: 1;
}
.card-body p { font-size: 0.92rem; line-height: 1.6; }
.card-num {
  position: absolute;
  top: 1rem; right: 1.15rem;
  z-index: 4;
  font-family: var(--font-m);
  font-size: 0.64rem;
  letter-spacing: 0.16em;
  color: rgba(238, 242, 250, 0.75);
}
.card-foot {
  margin-top: auto;
  padding-top: 1.1rem;
}
.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.tag {
  font-family: var(--font-m);
  font-size: 0.6rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--mute);
  border: 1px solid var(--line);
  padding: 0.28rem 0.55rem;
  border-radius: var(--r);
}
.tag--on { color: var(--accent); border-color: rgba(255, 100, 23, 0.4); }

/* Marcas de esquina tipo plano */
.ticks::after {
  content: "";
  position: absolute;
  inset: 9px;
  z-index: 4;
  pointer-events: none;
  background:
    linear-gradient(var(--accent), var(--accent)) 0 0 / 12px 1px no-repeat,
    linear-gradient(var(--accent), var(--accent)) 0 0 / 1px 12px no-repeat,
    linear-gradient(var(--accent), var(--accent)) 100% 100% / 12px 1px no-repeat,
    linear-gradient(var(--accent), var(--accent)) 100% 100% / 1px 12px no-repeat;
  opacity: 0;
  transition: opacity 0.45s var(--ease);
}
.card:hover .ticks::after,
.ticks:hover::after { opacity: 0.75; }

/* Rejillas */
.grid { display: grid; gap: 1.15rem; }
.grid-2 { grid-template-columns: 1fr; }
.grid-3 { grid-template-columns: 1fr; }
.grid-4 { grid-template-columns: 1fr; }
@media (min-width: 640px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1000px) {
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
}

/* ---------- 11. Bloques de área (portada) ---------- */
.area {
  position: relative;
  display: block;
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  min-height: 380px;
  isolation: isolate;
  transition: border-color 0.5s var(--ease), transform 0.5s var(--ease);
}
.area:hover { border-color: rgba(255, 100, 23, 0.55); transform: translateY(-4px); }
.area-media { position: absolute; inset: 0; z-index: 0; }
.area-media img {
  width: 100%; height: 100%;
  object-fit: cover;
  filter: saturate(0.55) contrast(1.12) brightness(0.55);
  transition: transform 1s var(--ease), filter 0.7s var(--ease);
}
.area:hover .area-media img { transform: scale(1.08); filter: saturate(0.9) contrast(1.08) brightness(0.66); }
.area-media::after {
  content: "";
  position: absolute; inset: 0;
  background:
    linear-gradient(to top, rgba(4,7,15,0.96) 8%, rgba(4,7,15,0.55) 55%, rgba(7,27,73,0.35) 100%),
    linear-gradient(140deg, rgba(255,100,23,0.22), transparent 60%);
}
.area-body {
  position: relative;
  z-index: 2;
  height: 100%;
  min-height: 380px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 0.65rem;
  padding: 1.7rem;
}
.area-body .mono { color: var(--accent); }
.area-body p { font-size: 0.9rem; max-width: 40ch; }
.area-go {
  margin-top: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-m);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink);
}
.area-go svg { width: 15px; transition: transform 0.4s var(--ease); }
.area:hover .area-go svg { transform: translateX(6px); }
.area-badge {
  position: absolute;
  top: 1.15rem; left: 1.15rem;
  z-index: 3;
  font-family: var(--font-m);
  font-size: 0.58rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 0.32rem 0.6rem;
  background: var(--accent);
  color: #fff;
  border-radius: var(--r);
}

/* ---------- 12. Marquesina de oficios (hilo conductor) ---------- */
.trades {
  position: relative;
  border-block: 1px solid var(--line);
  padding-block: 1.9rem;
  overflow: hidden;
  background: var(--bg-2);
}
.trades-track {
  display: flex;
  width: max-content;
  gap: 3.2rem;
  animation: tradeScroll 46s linear infinite;
}
.trades:hover .trades-track { animation-play-state: paused; }
@keyframes tradeScroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
.trade {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: none;
  opacity: 0.62;
  transition: opacity 0.35s var(--ease);
}
.trade:hover { opacity: 1; }
.trade svg { width: 30px; height: 30px; flex: none; }
.trade svg * {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.trade span {
  font-family: var(--font-m);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-2);
  white-space: nowrap;
}

/* ---------- 13. Proceso / pasos ---------- */
.steps { display: grid; gap: 0; }
.step {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.6rem;
  padding-block: 1.7rem;
  border-top: 1px solid var(--line);
  transition: background 0.4s var(--ease);
}
.step:last-child { border-bottom: 1px solid var(--line); }
@media (min-width: 820px) {
  .step {
    grid-template-columns: 90px minmax(0, 300px) minmax(0, 1fr);
    gap: 2rem;
    align-items: start;
  }
}
.step:hover { background: rgba(255, 100, 23, 0.035); }
.step-n {
  font-family: var(--font-m);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  color: var(--accent);
  padding-top: 0.35rem;
}
.step p { font-size: 0.95rem; }

/* ---------- 14. Cifras ---------- */
.figures {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
}
@media (min-width: 900px) { .figures { grid-template-columns: repeat(4, 1fr); } }
.figure {
  background: var(--bg);
  padding: 1.9rem 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  transition: background 0.4s var(--ease);
}
.figure:hover { background: var(--bg-3); }
.figure b {
  font-family: var(--font-d);
  font-size: clamp(2.1rem, 4vw, 3.1rem);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 1;
  color: var(--ink);
}
.figure b i { font-style: normal; color: var(--accent); }
.figure > span {
  font-family: var(--font-m);
  font-size: 0.64rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mute);
  line-height: 1.5;
}

/* ---------- 15. Split editorial ---------- */
.split {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}
@media (min-width: 940px) {
  .split { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .split--wide-l { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
  .split--rev > :first-child { order: 2; }
}
.split-media {
  position: relative;
  aspect-ratio: 4 / 3.2;
  border: 1px solid var(--line);
  border-radius: var(--r);
}
.split-media .duo { width: 100%; height: 100%; }
.split-cap {
  position: absolute;
  left: 0; bottom: -1px;
  z-index: 4;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-m);
  font-size: 0.6rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 0.45rem 0.85rem;
}

.bullets { display: flex; flex-direction: column; gap: 0.9rem; margin-top: 1.8rem; }
.bullet {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--line);
}
.bullet:last-child { border-bottom: 0; padding-bottom: 0; }
.bullet svg { width: 18px; height: 18px; flex: none; margin-top: 3px; stroke: var(--accent); fill: none; stroke-width: 1.6; }
.bullet div { flex: 1; }
.bullet b { display: block; font-family: var(--font-d); font-size: 1rem; letter-spacing: -0.01em; margin-bottom: 0.15rem; }
.bullet p { font-size: 0.9rem; line-height: 1.55; }

/* ---------- 16. Proyecto destacado (FCB) ---------- */
.feature {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  background: var(--card);
}
.feature-top {
  display: grid;
  grid-template-columns: 1fr;
}
@media (min-width: 940px) { .feature-top { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); } }
.feature-media { position: relative; aspect-ratio: 4 / 3; min-height: 300px; }
.feature-media .duo { width: 100%; height: 100%; }
.feature-body {
  padding: clamp(1.6rem, 3.2vw, 2.8rem);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  justify-content: center;
}
.feature-meta {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  margin-top: 0.6rem;
}
.feature-meta div { background: var(--card); padding: 0.85rem 1rem; }
.feature-meta dt {
  font-family: var(--font-m);
  font-size: 0.58rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--mute);
  margin-bottom: 0.25rem;
}
.feature-meta dd { font-size: 0.9rem; font-weight: 500; color: var(--ink); }

.feature-strip {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--line);
  border-top: 1px solid var(--line);
}
@media (min-width: 700px) { .feature-strip { grid-template-columns: repeat(4, 1fr); } }
.feature-strip .duo { aspect-ratio: 1 / 1; }
.feature-strip .duo img { transition: transform 0.8s var(--ease), filter 0.6s var(--ease); }
.feature-strip .duo:hover img { transform: scale(1.09); filter: saturate(1.12); }
.feature-strip .duo:hover::after { opacity: 0; }

/* ---------- 17. Formulario ---------- */
.form {
  display: grid;
  gap: 1.05rem;
  grid-template-columns: 1fr;
}
@media (min-width: 700px) { .form { grid-template-columns: repeat(2, 1fr); } }
.field { display: flex; flex-direction: column; gap: 0.45rem; }
.field--full { grid-column: 1 / -1; }
.field label {
  font-family: var(--font-m);
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--mute);
}
.field label span { color: var(--accent); }
.field input,
.field textarea,
.field select {
  background-color: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 0.85rem 1rem;
  font-size: 0.95rem;
  color: var(--ink);
  transition: border-color 0.3s var(--ease), background 0.3s var(--ease);
  width: 100%;
}
.field select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237C8AA8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  background-size: 16px;
  padding-right: 2.5rem;
  cursor: pointer;
}
.field select option { background: var(--bg-3); color: var(--ink); }
.field textarea { resize: vertical; min-height: 128px; }
.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-color: var(--accent);
  background-color: var(--bg-2);
}
.field input::placeholder, .field textarea::placeholder { color: rgba(124, 138, 168, 0.6); }

.check {
  grid-column: 1 / -1;
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
  font-size: 0.82rem;
  color: var(--mute);
  line-height: 1.5;
}
.check input {
  width: 17px; height: 17px;
  margin-top: 2px;
  flex: none;
  accent-color: var(--accent);
  cursor: pointer;
}
.check a { color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; }

.form-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-top: 0.3rem;
}
.form-note {
  grid-column: 1 / -1;
  font-family: var(--font-m);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  color: var(--mute);
  line-height: 1.7;
}

.form-ok {
  grid-column: 1 / -1;
  display: none;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 1.1rem 1.2rem;
  border: 1px solid rgba(31, 175, 84, 0.45);
  background: rgba(31, 175, 84, 0.09);
  border-radius: var(--r);
}
.form-ok.is-on { display: flex; }
.form-ok svg { width: 20px; height: 20px; flex: none; margin-top: 2px; stroke: #35d06f; fill: none; stroke-width: 2; }
.form-ok p { font-size: 0.9rem; color: var(--ink-2); }

/* ---------- 18. Contacto ---------- */
.contact-list { display: flex; flex-direction: column; }
.contact-item {
  display: flex;
  gap: 1.1rem;
  align-items: flex-start;
  padding-block: 1.25rem;
  border-bottom: 1px solid var(--line);
  transition: padding-left 0.35s var(--ease);
}
.contact-item:first-child { border-top: 1px solid var(--line); }
a.contact-item:hover { padding-left: 0.5rem; }
.contact-item svg { width: 19px; height: 19px; flex: none; margin-top: 4px; stroke: var(--accent); fill: none; stroke-width: 1.6; }
.contact-item dt {
  font-family: var(--font-m);
  font-size: 0.6rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--mute);
  margin-bottom: 0.25rem;
}
.contact-item dd {
  font-family: var(--font-d);
  font-size: 1.08rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.contact-item dd small {
  display: block;
  font-family: var(--font-b);
  font-size: 0.82rem;
  font-weight: 400;
  color: var(--mute);
  letter-spacing: 0;
  margin-top: 0.2rem;
}

/* ---------- 19. Banda CTA ---------- */
.cta-band {
  position: relative;
  overflow: hidden;
  border-top: 1px solid var(--line);
  background: var(--bg-2);
}
.cta-band::before {
  content: "";
  position: absolute;
  inset: -50% -10%;
  background: radial-gradient(50% 50% at 50% 50%, rgba(255, 100, 23, 0.18), transparent 70%);
  filter: blur(90px);
  pointer-events: none;
}
.cta-inner {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 2rem;
  align-items: center;
}
@media (min-width: 940px) { .cta-inner { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); } }
.cta-inner h2 { max-width: 16ch; }
/* Botones a ancho de contenido: estirados al ancho de la columna pesan demasiado. */
@media (min-width: 940px) {
  .cta-inner .stack { max-width: 320px; margin-left: auto; }
}

/* ---------- 20. Pie ---------- */
.footer {
  border-top: 1px solid var(--line);
  background: var(--bg);
  padding-block: clamp(3rem, 6vw, 4.5rem) 2rem;
}
.footer-top {
  display: grid;
  gap: 2.4rem;
  grid-template-columns: 1fr;
  padding-bottom: 2.6rem;
  border-bottom: 1px solid var(--line);
}
@media (min-width: 780px) { .footer-top { grid-template-columns: 1.5fr 1fr 1fr; } }
.footer h4 {
  font-family: var(--font-m);
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--mute);
  margin-bottom: 1.1rem;
}
.footer-nav { display: flex; flex-direction: column; gap: 0.6rem; }
.footer-nav a {
  font-size: 0.92rem;
  color: var(--ink-2);
  transition: color 0.25s var(--ease), transform 0.3s var(--ease);
  width: fit-content;
}
.footer-nav a:hover { color: var(--accent); transform: translateX(4px); }
.footer-brand img { width: clamp(150px, 15vw, 200px); margin-bottom: 1.5rem; }
.footer-brand p { font-size: 0.9rem; max-width: 34ch; }
.footer-bottom {
  padding-top: 1.6rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem 1.6rem;
  justify-content: space-between;
  align-items: center;
}
.footer-bottom p, .footer-bottom a {
  font-family: var(--font-m);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  color: var(--mute);
}
.footer-bottom a:hover { color: var(--accent); }

/* ---------- 21. Botón flotante de WhatsApp ---------- */
.wa-float {
  position: fixed;
  right: clamp(1rem, 3vw, 2rem);
  bottom: clamp(1rem, 3vw, 2rem);
  z-index: 80;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.85rem 1.15rem;
  background: #1FAF54;
  color: #fff;
  border-radius: 100px;
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: 0 12px 34px -10px rgba(31, 175, 84, 0.65);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
}
.wa-float:hover { transform: translateY(-3px) scale(1.03); box-shadow: 0 18px 44px -12px rgba(31, 175, 84, 0.8); }
.wa-float svg { width: 21px; height: 21px; flex: none; fill: currentColor; }
.wa-float span { display: none; }
@media (min-width: 640px) { .wa-float span { display: inline; } }

/* ---------- 22. Revelado al hacer scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.85s var(--ease), transform 0.85s var(--ease);
}
.reveal.is-in { opacity: 1; transform: none; }
.reveal[data-d="1"] { transition-delay: 0.08s; }
.reveal[data-d="2"] { transition-delay: 0.16s; }
.reveal[data-d="3"] { transition-delay: 0.24s; }
.reveal[data-d="4"] { transition-delay: 0.32s; }

/* Red de seguridad: si JS falla, nada queda invisible */
.no-js .reveal { opacity: 1; transform: none; }

/* Trazado de las líneas técnicas */
.draw-path {
  stroke-dasharray: var(--len, 1200);
  stroke-dashoffset: var(--len, 1200);
  transition: stroke-dashoffset 2.2s var(--ease-io);
}
.is-in .draw-path, .draw-path.is-drawn { stroke-dashoffset: 0; }

/* ---------- 23. Etiqueta "properament" ---------- */
.soon-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-m);
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid rgba(255, 100, 23, 0.42);
  padding: 0.4rem 0.8rem;
  border-radius: 100px;
  background: rgba(255, 100, 23, 0.07);
}
.soon-badge i {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: blip 2s ease-in-out infinite;
}
@keyframes blip { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }
@media (prefers-reduced-motion: reduce) { .soon-badge i { animation: none; } }

/* Cronología */
.timeline { display: flex; flex-direction: column; }
.tl-item {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.4rem;
  padding: 1.4rem 0 1.4rem 1.9rem;
  border-left: 1px solid var(--line);
  position: relative;
}
@media (min-width: 780px) { .tl-item { grid-template-columns: 160px minmax(0, 1fr); gap: 2rem; align-items: baseline; } }
.tl-item::before {
  content: "";
  position: absolute;
  left: -4.5px; top: 1.85rem;
  width: 8px; height: 8px;
  background: var(--bg);
  border: 1px solid var(--line-2);
  border-radius: 50%;
}
.tl-item.is-now::before { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 4px rgba(255, 100, 23, 0.16); }
.tl-when {
  font-family: var(--font-m);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}
.tl-item.is-next .tl-when { color: var(--mute); }
.tl-item p { font-size: 0.93rem; margin-top: 0.25rem; }

/* ---------- 24. Utilidades ---------- */
.stack { display: flex; flex-direction: column; }
.gap-sm { gap: 0.75rem; }
.gap-md { gap: 1.35rem; }
.gap-lg { gap: 2.2rem; }
.mt-sm { margin-top: 1rem; }
.mt-md { margin-top: 2rem; }
.mt-lg { margin-top: 3rem; }
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip {
  position: absolute;
  top: -60px; left: 1rem;
  z-index: 200;
  background: var(--accent);
  color: #fff;
  padding: 0.7rem 1.1rem;
  border-radius: var(--r);
  font-size: 0.85rem;
  transition: top 0.3s var(--ease);
}
.skip:focus { top: 1rem; }

/* Efectos intrusivos: sí se atenúan con reduced-motion */
@media (prefers-reduced-motion: reduce) {
  .trades-track { animation: none; }
  .hero-media img { transform: none; }
}

/* ---------- 25. Página de créditos ---------- */
.credits-wrap {
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow-x: auto;
}
.credits {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.credits th {
  text-align: left;
  font-family: var(--font-m);
  font-size: 0.6rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--mute);
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--line);
  background: var(--bg-2);
  white-space: nowrap;
}
.credits td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--line);
  color: var(--ink-2);
  vertical-align: middle;
}
.credits tr:last-child td { border-bottom: 0; }
.credits tbody tr { transition: background 0.3s var(--ease); }
.credits tbody tr:hover { background: rgba(255, 100, 23, 0.04); }
.credits td:first-child { width: 84px; padding-right: 0; }
.credits td img {
  width: 68px;
  height: 50px;
  object-fit: cover;
  border-radius: var(--r);
  filter: grayscale(1) brightness(0.85);
}
.credits td b {
  display: block;
  font-family: var(--font-d);
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.credits td small {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.76rem;
  color: var(--mute);
}
.credits a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
.credits a:hover { color: var(--accent-2); }

/* ============================================================
   26. TEMA CLAR — "Blueprint sobre paper"
   Mateixa estructura, paleta invertida. S'activa amb
   <html data-theme="light">. El tema fosc segueix sent el defecte.
   ============================================================ */
:root[data-theme="light"] {
  --bg:        #F3F6FB;
  --bg-2:      #E8EDF6;
  --bg-3:      #FFFFFF;
  --card:      #FFFFFF;

  --ink:       #071B49;
  --ink-2:     #3B4A69;
  --mute:      #6B7A97;
  --dim:       rgba(7, 27, 73, 0.45);

  --line:      rgba(7, 27, 73, 0.14);
  --line-2:    rgba(7, 27, 73, 0.26);
  --grid:      rgba(7, 27, 73, 0.055);
}

/* Fons i textures */
:root[data-theme="light"] .bp-noise {
  mix-blend-mode: multiply;
  opacity: 0.045;
}
:root[data-theme="light"] .section--alt { background: var(--bg-2); }

/* Navegació */
:root[data-theme="light"] .nav.is-stuck {
  background: rgba(243, 246, 251, 0.88);
  box-shadow: 0 1px 0 var(--line), 0 8px 30px -18px rgba(7, 27, 73, 0.35);
}
:root[data-theme="light"] .drawer { background: rgba(243, 246, 251, 0.98); }
:root[data-theme="light"] .brand-mark { filter: none; }
:root[data-theme="light"] .burger span { background: var(--ink); }

/* Hero: la foto s'aclareix i el text passa a blau marí */
:root[data-theme="light"] .hero-media img {
  filter: saturate(0.55) contrast(0.95) brightness(1.22);
}
:root[data-theme="light"] .hero-media::after {
  background:
    linear-gradient(to top, var(--bg) 3%, rgba(243, 246, 251, 0.86) 46%, rgba(243, 246, 251, 0.62) 100%),
    linear-gradient(100deg, rgba(243, 246, 251, 0.95) 8%, rgba(243, 246, 251, 0.35) 58%, transparent 100%),
    linear-gradient(115deg, rgba(255, 100, 23, 0.16) 0%, transparent 55%);
}
:root[data-theme="light"] .hero-glow {
  opacity: 0.5;
  background:
    radial-gradient(circle 620px at var(--mx, 62%) var(--my, 38%), rgba(255, 100, 23, 0.32) 0%, transparent 62%),
    radial-gradient(circle 900px at calc(var(--mx, 62%) + 16%) calc(var(--my, 38%) + 12%), rgba(120, 165, 235, 0.5) 0%, transparent 60%);
}
:root[data-theme="light"] .hero-hud {
  background-image:
    linear-gradient(to right, rgba(7, 27, 73, 0.06) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(7, 27, 73, 0.06) 1px, transparent 1px);
}
:root[data-theme="light"] .hero--draw {
  background:
    radial-gradient(ellipse 90% 70% at 20% 0%, rgba(150, 185, 240, 0.42), transparent 65%),
    radial-gradient(ellipse 70% 60% at 90% 100%, rgba(255, 100, 23, 0.13), transparent 70%),
    var(--bg);
}
:root[data-theme="light"] .hero-draw { opacity: 0.92; }
:root[data-theme="light"] .hero-draw path { stroke-width: 1.6; }
:root[data-theme="light"] .hero-draw .bp-dim { stroke: rgba(7, 27, 73, 0.5); stroke-width: 1.1; }

/* Fotografies: mateix duotò, però el vel inferior és clar */
:root[data-theme="light"] .duo::before {
  background: linear-gradient(to top, rgba(255, 255, 255, 0.9) 0%, transparent 55%);
}
:root[data-theme="light"] .duo img {
  filter: saturate(1.03) contrast(1.01) brightness(1.01);
}
:root[data-theme="light"] .duo::after {
  background: linear-gradient(150deg, rgba(7, 27, 73, 0.5) 0%, rgba(255, 100, 23, 0.32) 100%);
  opacity: 0.24;
}

/* Targetes: ombra en comptes de resplendor */
:root[data-theme="light"] .card {
  box-shadow: 0 1px 2px rgba(7, 27, 73, 0.05), 0 8px 24px -18px rgba(7, 27, 73, 0.3);
}
:root[data-theme="light"] .card:hover {
  box-shadow: 0 18px 44px -24px rgba(7, 27, 73, 0.42), 0 0 0 1px rgba(255, 100, 23, 0.35);
}
:root[data-theme="light"] .card::before {
  background: linear-gradient(115deg, transparent 30%, rgba(255, 100, 23, 0.12) 50%, transparent 70%);
}

/* Blocs d'àrea: el text va sobre un vel clar */
:root[data-theme="light"] .area-media img {
  filter: saturate(0.75) contrast(1.04) brightness(1.02);
}
:root[data-theme="light"] .area:hover .area-media img {
  filter: saturate(1.05) contrast(1.02) brightness(1.02);
}
/* El vel només ha de tapar el peu, on hi ha el text: a dalt la foto es veu. */
:root[data-theme="light"] .area-media::after {
  background:
    linear-gradient(to top, rgba(255, 255, 255, 0.98) 20%, rgba(255, 255, 255, 0.82) 42%, rgba(255, 255, 255, 0.14) 78%, transparent 100%),
    linear-gradient(140deg, rgba(255, 100, 23, 0.14), transparent 62%);
}
:root[data-theme="light"] .area-body { justify-content: flex-end; }
:root[data-theme="light"] .area {
  background: var(--card);
  box-shadow: 0 1px 2px rgba(7, 27, 73, 0.05), 0 10px 30px -22px rgba(7, 27, 73, 0.32);
}
:root[data-theme="light"] .area-go { color: var(--ink); }

/* Peces amb fons propi */
:root[data-theme="light"] .trades { background: var(--bg-2); }
:root[data-theme="light"] .figure { background: var(--card); }
:root[data-theme="light"] .figure:hover { background: var(--bg-2); }
:root[data-theme="light"] .figures { background: var(--line); }
:root[data-theme="light"] .feature,
:root[data-theme="light"] .feature-meta div { background: var(--card); }
:root[data-theme="light"] .credits th { background: var(--bg-2); }
:root[data-theme="light"] .credits tbody tr:hover { background: rgba(255, 100, 23, 0.06); }
:root[data-theme="light"] .card-num { color: var(--ink); }
:root[data-theme="light"] .step:hover { background: rgba(255, 100, 23, 0.05); }
:root[data-theme="light"] .tl-item::before { background: var(--bg); }

/* Formularis */
:root[data-theme="light"] .field input,
:root[data-theme="light"] .field textarea,
:root[data-theme="light"] .field select {
  /* background-color, no la drecera: 'background' reiniciaria la posició i
     la repetició de la fletxa del desplegable i en sortirien quatre. */
  background-color: var(--card);
  box-shadow: inset 0 1px 2px rgba(7, 27, 73, 0.05);
}
:root[data-theme="light"] .field input:focus,
:root[data-theme="light"] .field textarea:focus,
:root[data-theme="light"] .field select:focus { background-color: #fff; }
:root[data-theme="light"] .field select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236B7A97' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); }
:root[data-theme="light"] .form-ok { background: rgba(31, 175, 84, 0.1); }

/* Banda final i peu */
:root[data-theme="light"] .cta-band { background: var(--bg-2); }
:root[data-theme="light"] .cta-band::before {
  background: radial-gradient(50% 50% at 50% 50%, rgba(255, 100, 23, 0.2), transparent 70%);
}
:root[data-theme="light"] .footer { background: var(--bg); }

/* Botons */
:root[data-theme="light"] .btn--ghost { border-color: var(--line-2); }
:root[data-theme="light"] .btn--ghost:hover { border-color: var(--accent); background: rgba(255, 100, 23, 0.06); }
:root[data-theme="light"] .nav-cta:hover { color: #fff; }
:root[data-theme="light"] .soon-badge { background: rgba(255, 100, 23, 0.1); }

/* Logotip segons el fons */
.logo-on-light { display: none; }
.brand-mark.logo-on-dark { filter: drop-shadow(0 4px 14px rgba(255, 100, 23, 0.3)); }
:root[data-theme="light"] .logo-on-dark { display: none; }
:root[data-theme="light"] .logo-on-light { display: block; }

/* Interruptor de tema */
.theme-btn {
  width: 42px; height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-2);
  border-radius: var(--r);
  flex: none;
  color: var(--ink-2);
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease);
}
.theme-btn:hover { color: var(--accent); border-color: var(--accent); }
.theme-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.theme-btn .i-sun { display: none; }
:root[data-theme="light"] .theme-btn .i-sun { display: block; }
:root[data-theme="light"] .theme-btn .i-moon { display: none; }

/* ============================================================
   27. La casa que es construeix sola (Steel Framing)
   Tot es dibuixa amb stroke-dashoffset: una sola tècnica,
   sense transformacions que depenguin de transform-box.
   ============================================================ */
.build {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--bg-2);
  overflow: hidden;
}
.build::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(to right, var(--grid) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid) 1px, transparent 1px);
  background-size: 40px 40px;
}
.build-stage {
  position: relative;
  padding: clamp(1rem, 3vw, 2.4rem) clamp(0.5rem, 2vw, 2rem) 0;
}
.bh-svg { width: 100%; height: auto; display: block; }

/* Estat base: res dibuixat */
.bh-line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  stroke-dasharray: var(--len, 1400);
  stroke-dashoffset: var(--len, 1400);
}
.bh-thin  { stroke-width: 1.2; }
.bh-ground{ stroke: var(--mute); stroke-width: 1.4; }
.bh-slab  { stroke: var(--ink-2); stroke-width: 2.2; }
.bh-steel { stroke: var(--accent); }
.bh-roof  { stroke: var(--ink); stroke-width: 2.6; }
.bh-clad  { stroke: var(--mute); stroke-width: 1; opacity: 0.55; }
.bh-open  { stroke: var(--ink); stroke-width: 2; }
.bh-dim   { stroke: var(--mute); stroke-width: 1; stroke-dasharray: 5 5 !important; stroke-dashoffset: 0; opacity: 0; }
.bh-hole  { fill: var(--accent); opacity: 0; }

/* En marxa */
.build.is-building .bh-line:not(.bh-dim) {
  animation: bhDraw var(--t, 0.55s) var(--ease-io) var(--d, 0s) forwards;
}
.build.is-building .bh-dim {
  animation: bhFade 0.5s var(--ease) var(--d, 0s) forwards;
}
.build.is-building .bh-hole {
  animation: bhHole 0.7s var(--ease) var(--d, 0s) forwards;
}
@keyframes bhDraw { to { stroke-dashoffset: 0; } }
@keyframes bhFade { to { opacity: 0.85; } }
@keyframes bhHole { to { opacity: 0.13; } }

/* Llegenda de fases */
.build-steps {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--line);
  border-top: 1px solid var(--line);
}
@media (min-width: 760px) { .build-steps { grid-template-columns: repeat(4, 1fr); } }
.build-step {
  background: var(--bg-2);
  padding: 1rem 1.1rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  opacity: 0.4;
  transition: opacity 0.5s var(--ease), background 0.5s var(--ease);
}
.build-step.is-on { opacity: 1; background: var(--bg-3); }
.build-step span {
  font-family: var(--font-m);
  font-size: 0.6rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}
.build-step b {
  font-family: var(--font-d);
  font-size: 0.98rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.build-step small { font-size: 0.78rem; color: var(--mute); line-height: 1.45; }

/* Control de repetició */
.build-replay {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.9rem;
  border: 1px solid var(--line-2);
  border-radius: 100px;
  background: var(--bg);
  font-family: var(--font-m);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-2);
  transition: color 0.3s var(--ease), border-color 0.3s var(--ease);
}
.build-replay:hover { color: var(--accent); border-color: var(--accent); }
.build-replay svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; }


/* Qui prefereix menys moviment veu la casa ja acabada */
@media (prefers-reduced-motion: reduce) {
  .build .bh-line { stroke-dashoffset: 0; }
  .build .bh-dim { opacity: 0.85; }
  .build .bh-hole { opacity: 0.13; }
  .build.is-building .bh-line,
  .build.is-building .bh-dim,
  .build.is-building .bh-hole { animation: none; }
  .build-step { opacity: 1; }
}

/* ============================================================
   28. Detall constructiu per capes (mur, coberta i solera)
   ============================================================ */
.detail {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--bg-2);
  overflow: hidden;
}
.detail-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 1px;
  background: var(--line);
  border-bottom: 1px solid var(--line);
}
.detail-tab {
  flex: 1 1 auto;
  min-width: 110px;
  background: var(--bg-2);
  padding: 0.9rem 1.1rem;
  font-family: var(--font-m);
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--mute);
  text-align: left;
  transition: color 0.3s var(--ease), background 0.3s var(--ease);
}
.detail-tab:hover { color: var(--ink); }
.detail-tab.is-on { color: var(--accent); background: var(--bg-3); box-shadow: inset 0 -2px 0 var(--accent); }

.detail-body { display: grid; grid-template-columns: 1fr; }
@media (min-width: 940px) {
  .detail-body { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
}
.detail-stage {
  position: relative;
  padding: clamp(1rem, 2.5vw, 2rem);
  min-height: 320px;
}
.detail-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(to right, var(--grid) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid) 1px, transparent 1px);
  background-size: 34px 34px;
}
.lay-svg {
  position: relative;
  width: 100%;
  height: auto;
  display: none;
  color: var(--ink-2);
  overflow: visible;
}
.lay-svg.is-shown { display: block; }

/* Capes: cada una entra amb el seu retard */
.lay { opacity: 0; }
.detail.is-playing .lay { animation: layIn 0.55s var(--ease) var(--d, 0s) forwards; }
@keyframes layIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.lay-tint { fill: var(--ink-2); opacity: 0.1; }
.lay-fill { opacity: 0.9; }
.lay-edge { fill: none; stroke: var(--ink-2); stroke-width: 1.1; opacity: 0.55; }

.l-steel .lay-tint { fill: var(--accent); opacity: 0.16; }
.l-steel .lay-edge { stroke: var(--accent); opacity: 0.85; stroke-width: 1.4; }
.l-board .lay-tint { fill: var(--ink); opacity: 0.13; }
.l-memb  .lay-tint { fill: var(--accent); opacity: 0.85; }
.l-memb  .lay-edge { stroke: none; }
.l-air   .lay-tint { fill: var(--ink-2); opacity: 0.05; }
.l-soil  .lay-tint { fill: var(--mute); opacity: 0.14; }
.l-sate  .lay-tint { fill: var(--accent); opacity: 0.1; }
.l-fin   .lay-tint { fill: var(--ink); opacity: 0.08; }

/* Perfil C d'acer vist en secció */
.lay-c { opacity: 0; }
.detail.is-playing .lay-c { animation: layIn 0.5s var(--ease) var(--d, 0s) forwards; }
.lay-c path { fill: none; stroke: var(--accent); stroke-width: 3.4; stroke-linecap: round; stroke-linejoin: round; }

/* Numeració */
.lay-num { opacity: 0; }
.detail.is-playing .lay-num { animation: layIn 0.4s var(--ease) var(--d, 0s) forwards; }
.lay-num circle { fill: var(--bg-2); stroke: var(--accent); stroke-width: 1.2; }
.lay-num line { stroke: var(--accent); stroke-width: 1; opacity: 0.6; }
.lay-num text {
  fill: var(--accent);
  font-family: var(--font-m);
  font-size: 12px;
  text-anchor: middle;
}

/* Acotació i rètols */
.lay-dim { opacity: 0; }
.detail.is-playing .lay-dim { animation: layIn 0.5s var(--ease) var(--d, 0s) forwards; }
.lay-dim line { stroke: var(--mute); stroke-width: 1; stroke-dasharray: 4 4; }
.lay-total {
  fill: var(--ink);
  font-family: var(--font-m);
  font-size: 14px;
  text-anchor: middle;
  letter-spacing: 0.08em;
}
.lay-side {
  fill: var(--mute);
  font-family: var(--font-m);
  font-size: 10.5px;
  letter-spacing: 0.2em;
}

/* Llista de capes */
.lay-list {
  border-top: 1px solid var(--line);
  display: none;
  align-content: start;
}
@media (min-width: 940px) { .lay-list { border-top: 0; border-left: 1px solid var(--line); } }
.lay-list.is-shown { display: grid; }
.lay-row {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: baseline;
  padding: 0.78rem 1.2rem;
  border-bottom: 1px solid var(--line);
  opacity: 0;
  transition: background 0.3s var(--ease);
  cursor: default;
}
.detail.is-playing .lay-row { animation: layIn 0.5s var(--ease) var(--d, 0s) forwards; }
.lay-row:last-child { border-bottom: 0; }
.lay-row:hover { background: rgba(255, 100, 23, 0.07); }
.lay-n {
  font-family: var(--font-m);
  font-size: 0.66rem;
  color: var(--accent);
  border: 1px solid rgba(255, 100, 23, 0.4);
  border-radius: 50%;
  width: 22px; height: 22px;
  display: grid;
  place-items: center;
}
.lay-name { font-size: 0.9rem; color: var(--ink); line-height: 1.35; }
.lay-th {
  font-family: var(--font-m);
  font-size: 0.68rem;
  color: var(--mute);
  white-space: nowrap;
}

/* Ressaltat creuat entre la llista i el dibuix */
.lay.is-hot .lay-edge { stroke: var(--accent); stroke-width: 2; opacity: 1; }
.lay.is-hot .lay-tint { opacity: 0.32; }
.lay-num.is-hot circle { fill: var(--accent); }
.lay-num.is-hot text { fill: #fff; }
.lay-row.is-hot { background: rgba(255, 100, 23, 0.1); }

@media (prefers-reduced-motion: reduce) {
  .lay, .lay-c, .lay-num, .lay-dim, .lay-row { opacity: 1; }
  .detail.is-playing .lay,
  .detail.is-playing .lay-c,
  .detail.is-playing .lay-num,
  .detail.is-playing .lay-dim,
  .detail.is-playing .lay-row { animation: none; }
}

/* Casa que es construeix: peces del sistema constructiu */
.bh-track { stroke-width: 3.2; }
.bh-brace { stroke: var(--accent); stroke-width: 1.4; stroke-dasharray: 7 4; }
.bh-board { stroke: var(--ink-2); stroke-width: 1; }
.bh-soffit{ stroke: var(--ink); stroke-width: 1.2; stroke-dasharray: 6 5; }
.bh-sate-edge { stroke: var(--ink); stroke-width: 1.6; }
.bh-dim2  { stroke: var(--mute); stroke-width: 1; stroke-dasharray: 5 5 !important; stroke-dashoffset: 0; opacity: 0; }
.bh-panel { fill: var(--ink); opacity: 0; }
.bh-sate  { fill: var(--accent); opacity: 0; }
.bh-glass { fill: var(--ink); opacity: 0; }
.bh-screw { fill: var(--ink-2); opacity: 0; }
.bh-txt {
  fill: var(--ink);
  font-family: var(--font-m);
  font-size: 13px;
  text-anchor: middle;
  letter-spacing: 0.1em;
  opacity: 0;
}
.build.is-building .bh-dim2 { animation: bhFade 0.5s var(--ease) var(--d, 0s) forwards; }
.build.is-building .bh-panel { animation: bhPanel 0.5s var(--ease) var(--d, 0s) forwards; }
.build.is-building .bh-sate  { animation: bhSate 0.7s var(--ease) var(--d, 0s) forwards; }
.build.is-building .bh-glass { animation: bhHole 0.7s var(--ease) var(--d, 0s) forwards; }
.build.is-building .bh-screw { animation: bhScrew 0.4s var(--ease) var(--d, 0s) forwards; }
.build.is-building .bh-txt   { animation: bhFade 0.5s var(--ease) var(--d, 0s) forwards; }
@keyframes bhPanel { to { opacity: 0.07; } }
@keyframes bhSate  { to { opacity: 0.1; } }
@keyframes bhScrew { to { opacity: 0.55; } }

@media (prefers-reduced-motion: reduce) {
  .build .bh-panel { opacity: 0.07; }
  .build .bh-sate  { opacity: 0.1; }
  .build .bh-glass { opacity: 0.13; }
  .build .bh-screw { opacity: 0.55; }
  .build .bh-txt, .build .bh-dim2 { opacity: 0.85; }
  .build.is-building .bh-panel, .build.is-building .bh-sate,
  .build.is-building .bh-glass, .build.is-building .bh-screw,
  .build.is-building .bh-txt, .build.is-building .bh-dim2 { animation: none; }
}

/* ============================================================
   29. Croquis 3D dels models, a mà alçada
   ============================================================ */
.card-elev {
  position: relative;
  aspect-ratio: 16 / 10;
  display: grid;
  place-items: center;
  padding: clamp(0.5rem, 1.6vw, 1rem);
  background: var(--bg-3);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.card-elev::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, var(--grid) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid) 1px, transparent 1px);
  background-size: 26px 26px;
}
.sk3-svg { position: relative; width: 100%; height: auto; display: block; }
.sk3-svg path, .sk3-svg circle {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
.sk-l          { stroke: var(--ink); stroke-width: 1.9; }
.sk-thin       { stroke: var(--ink); stroke-width: 1.1; opacity: 0.72; }
.sk-ghost      { stroke: var(--ink); stroke-width: 0.9; opacity: 0.32; }
.sk-in         { stroke: var(--accent); stroke-width: 1.6; }
.sk-seam       { stroke: var(--ink); stroke-width: 0.7; opacity: 0.34; }
.sk-hatch      { stroke: var(--ink); stroke-width: 0.7; opacity: 0.24; }
.sk-shade      { stroke: var(--ink); stroke-width: 0.8; opacity: 0.2; }
.sk-wood       { stroke: var(--accent); stroke-width: 0.7; opacity: 0.45; }
.sk-glass      { stroke: var(--ink); stroke-width: 1.25; }
.sk-glasshatch { stroke: var(--ink); stroke-width: 0.6; opacity: 0.26; }
.sk-ground     { stroke: var(--ink); stroke-width: 1.4; opacity: 0.8; }
.sk-grass      { stroke: var(--ink); stroke-width: 0.9; opacity: 0.5; }
.sk-fig path, .sk-fig circle { stroke: var(--accent); stroke-width: 1.6; }
.sk3-svg .draw-path { transition-duration: 1.2s; transition-delay: calc(var(--i, 0) * 0.035s); }
.card:hover .sk-l { stroke: var(--accent); }

/* ---------- Croquis de planta a mà alçada ---------- */
.plan-box {
  position: relative;
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  padding: clamp(0.6rem, 2vw, 1.4rem);
  background: var(--bg-3);
  overflow: hidden;
}
.plan-box::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, var(--grid) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid) 1px, transparent 1px);
  background-size: 26px 26px;
}
.pl-svg { position: relative; width: 100%; height: auto; display: block; }
.pl-svg path { fill: none; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.pl-l, .pl-wall { stroke: var(--ink); stroke-width: 2.6; }
.pl-part  { stroke: var(--ink); stroke-width: 1.7; }
.pl-ghost { stroke: var(--ink); stroke-width: 1; opacity: 0.28; }
.pl-thin  { stroke: var(--ink); stroke-width: 1; opacity: 0.55; }
.pl-hatch { stroke: var(--ink); stroke-width: 0.7; opacity: 0.22; }
.pl-furn  { stroke: var(--ink); stroke-width: 1; opacity: 0.45; }
.pl-door  { stroke: var(--accent); stroke-width: 1.3; }
.pl-swing { stroke: var(--accent); stroke-width: 1; opacity: 0.55; }
.pl-glass { stroke: var(--accent); stroke-width: 1.6; }
.pl-txt {
  fill: var(--ink);
  font-family: var(--font-m);
  font-size: 10px;
  letter-spacing: 0.14em;
  opacity: 0.6;
}
.pl-cap {
  fill: var(--accent);
  font-family: var(--font-m);
  font-size: 9px;
  letter-spacing: 0.22em;
}
.pl-svg .draw-path { transition-duration: 1.3s; transition-delay: calc(var(--i, 0) * 0.03s); }

/* ---------- Icones de servei ----------
   Set Lucide (llicència ISC): línia geomètrica de 24 px, neta i sòbria.
   Els símbols pesen menys que qualsevol foto i no depenen de tercers. */
.card-icon {
  position: relative;
  aspect-ratio: auto;          /* .card-media imposa 4:3; una icona no el vol */
  /* Una icona no és una foto: la franja s'ajusta al símbol, no a 4:3.
     Amb la proporció de foto el símbol quedava perdut al mig del buit. */
  display: grid;
  place-items: center;
  min-height: 152px;
  padding: 1.9rem 1rem;
  background: var(--bg-3);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.card-icon::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, var(--grid) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid) 1px, transparent 1px);
  background-size: 26px 26px;
}
.card-icon svg {
  position: relative;
  width: 64px;
  height: 64px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.5s var(--ease), stroke 0.4s var(--ease);
}
.card:hover .card-icon svg { transform: scale(1.08); }

/* ============================================================
   30. Muntatge en 3D (Steel Framing)
   ============================================================ */
.scene {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  min-height: 320px;
  background: var(--bg-3);
  overflow: hidden;
}
.scene canvas { display: block; width: 100%; height: 100%; cursor: grab; }
.scene canvas:active { cursor: grabbing; }

/* Lectura tècnica sobreimpresa: el visor és nostre, no un vídeo */
.hud {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  font-family: var(--font-m);
  color: #b9cde6;
  padding: clamp(0.75rem, 2.1vw, 1.25rem);
  display: grid;
  grid-template-columns: 1fr auto;
  align-content: space-between;
  gap: 0.6rem;
}
.hud::before,
.hud::after {
  content: "";
  position: absolute;
  width: 26px; height: 26px;
  border: 1px solid rgba(140, 175, 220, 0.4);
}
.hud::before { top: 12px; left: 12px; border-right: 0; border-bottom: 0; }
.hud::after { bottom: 12px; right: 12px; border-left: 0; border-top: 0; }

.hud-brand {
  display: block;
  font-family: var(--font-d);
  font-size: clamp(0.85rem, 2.4vw, 1.05rem);
  letter-spacing: 0.22em;
  color: #fff;
}
.hud-sub {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.58rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #7d97b8;
}
.hud-read {
  display: grid;
  gap: 0.3rem;
  justify-items: end;
  text-align: right;
}
.hud-read span {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  font-size: 0.58rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.hud-read i { font-style: normal; color: #6d86a6; }
.hud-read b {
  font-weight: 500;
  color: #e7f0fb;
  font-variant-numeric: tabular-nums;
  min-width: 5.6em;
}
.hud-read b em { font-style: normal; color: var(--accent); }

.hud-foot {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.58rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #8ea6c4;
}
.hud-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  flex: none;
  box-shadow: 0 0 0 0 rgba(255, 100, 23, 0.6);
  animation: hudPulse 1.9s ease-out infinite;
}
@keyframes hudPulse {
  70%  { box-shadow: 0 0 0 9px rgba(255, 100, 23, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 100, 23, 0); }
}
.hud-drag {
  margin-left: auto;
  color: #61799a;
}
.hud-scale {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  color: #6d86a6;
}
.hud-scale::before {
  content: "";
  width: clamp(34px, 7vw, 58px);
  height: 1px;
  background: currentColor;
  box-shadow: 0 -3px 0 -1px currentColor, 0 3px 0 -1px currentColor;
}
@media (max-width: 560px) {
  .hud-read span:nth-child(n + 3) { display: none; }
  .hud-scale { display: none; }
}

/* Barra de control */
.scene-bar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  gap: 0.9rem;
  align-items: center;
  padding: 0.85rem clamp(0.8rem, 2vw, 1.3rem);
  border-top: 1px solid var(--line);
  background: var(--bg-2);
}
.scene-btn {
  width: 40px; height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-2);
  border-radius: 50%;
  color: var(--ink);
  flex: none;
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease), background 0.25s var(--ease);
}
.scene-btn:hover { color: var(--accent); border-color: var(--accent); }
.scene-btn svg { width: 15px; height: 15px; fill: currentColor; }
.scene-btn .i-pause { display: none; }
.scene.is-playing ~ .scene-bar .scene-btn .i-pause { display: block; }
.scene.is-playing ~ .scene-bar .scene-btn .i-play { display: none; }

.scene-track {
  position: relative;
  height: 4px;
  border-radius: 4px;
  background: var(--line);
  overflow: hidden;
  cursor: pointer;
}
.scene-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  background: var(--accent);
  border-radius: 4px;
}
.scene-now {
  font-family: var(--font-m);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  color: var(--ink);
  white-space: nowrap;
  text-align: right;
  min-width: 12ch;
}
.scene-now b { color: var(--accent); font-weight: 500; }

/* Llista de fases sota l'escena */
.scene-steps {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border-top: 1px solid var(--line);
}
@media (min-width: 700px)  { .scene-steps { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .scene-steps { grid-template-columns: repeat(7, minmax(0, 1fr)); } }
.scene-step {
  background: var(--bg-2);
  padding: 0.7rem 0.65rem 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  opacity: 0.42;
  transition: opacity 0.4s var(--ease), background 0.4s var(--ease);
  text-align: left;
}
.scene-step:hover { opacity: 0.8; }
.scene-step.is-on { opacity: 1; background: var(--bg-3); }
.scene-step.is-done { opacity: 0.72; }
.scene-step span {
  font-family: var(--font-m);
  font-size: 0.56rem;
  letter-spacing: 0.14em;
  color: var(--accent);
}
.scene-step b {
  font-family: var(--font-d);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
  line-height: 1.15;
}
