/* ============================================================
   UNPAS Accessibilitat — Design System & Styles
   WCAG 2.2 AAA compliant | BEM methodology | CSS Custom Properties
   Typography: Instrument Serif (display) + Outfit (body)
   ============================================================ */

/* ----------------------------------------------------------
   1. DESIGN TOKENS (Custom Properties)
   ---------------------------------------------------------- */
:root {
  /* --- Brand Colors --- */
  --color-black: #0a0a0a;
  --color-white: #fafafa;
  --color-gray-50: #f7f7f7;
  --color-gray-100: #f0f0f0;
  --color-gray-200: #e4e4e4;
  --color-gray-300: #d4d4d4;
  --color-gray-400: #a3a3a3;
  --color-gray-500: #737373;
  --color-gray-600: #525252;
  --color-gray-700: #333333;
  --color-gray-800: #1a1a1a;

  /* --- MVAC Color System (disability-type differentiation) ---
     All pass AAA contrast ratio (7:1+) on white backgrounds */
  --color-motriu: #1e40af;       /* M — Motor: deep blue */
  --color-motriu-light: #dbeafe;
  --color-motriu-mid: #3b82f6;
  --color-visual: #92400e;       /* V — Visual: deep amber */
  --color-visual-light: #fef3c7;
  --color-visual-mid: #f59e0b;
  --color-auditiva: #065f46;     /* A — Auditory: deep green */
  --color-auditiva-light: #d1fae5;
  --color-auditiva-mid: #10b981;
  --color-cognitiva: #5b21b6;    /* C — Cognitive: deep purple */
  --color-cognitiva-light: #ede9fe;
  --color-cognitiva-mid: #8b5cf6;

  /* --- Functional Colors --- */
  --color-primary: var(--color-black);
  --color-primary-inverse: var(--color-white);
  --color-text: var(--color-gray-800);
  --color-text-secondary: var(--color-gray-600);
  --color-text-inverse: var(--color-white);
  --color-bg: var(--color-white);
  --color-bg-alt: var(--color-gray-50);
  --color-bg-dark: var(--color-gray-800);
  --color-border: var(--color-gray-200);
  --color-focus: var(--color-motriu-mid);
  --color-link: var(--color-motriu);
  --color-link-hover: #1e3a8a;

  /* --- Typography --- */
  --font-display: 'Instrument Serif', Georgia, 'Times New Roman', serif;
  --font-body: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  --font-size-xs: 0.8125rem;  /* 13px */
  --font-size-sm: 0.9375rem;  /* 15px */
  --font-size-base: 1.125rem; /* 18px */
  --font-size-lg: 1.375rem;   /* 22px */
  --font-size-xl: 1.625rem;   /* 26px */
  --font-size-2xl: 2.25rem;   /* 36px */
  --font-size-3xl: 2.75rem;   /* 44px */
  --font-size-4xl: 3.5rem;    /* 56px */
  --font-size-5xl: 4.5rem;    /* 72px */
  --font-size-display: clamp(3.75rem, 8.5vw, 7rem);

  --line-height-tight: 1.1;
  --line-height-snug: 1.3;
  --line-height-base: 1.7;
  --line-height-relaxed: 1.8;

  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;

  /* --- Spacing Scale --- */
  --space-xs: 0.25rem;   /* 4px */
  --space-sm: 0.5rem;    /* 8px */
  --space-md: 1rem;      /* 16px */
  --space-lg: 1.5rem;    /* 24px */
  --space-xl: 2rem;      /* 32px */
  --space-2xl: 3rem;     /* 48px */
  --space-3xl: 4rem;     /* 64px */
  --space-4xl: 6rem;     /* 96px */
  --space-5xl: 8rem;     /* 128px */

  /* --- Layout --- */
  --container-max: 75rem;     /* 1200px */
  --container-narrow: 48rem;  /* 768px */
  --container-padding: var(--space-lg);
  --grid-gap: 1.5rem;
  --section-padding: var(--space-4xl) 0;

  /* --- Borders & Radii --- */
  --radius-sm: 0.25rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-full: 9999px;
  --border-width: 2px;

  /* --- Shadows --- */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.12);

  /* --- Transitions --- */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 400ms ease;

  /* --- Focus ring --- */
  --focus-ring: 3px solid var(--color-focus);
  --focus-ring-offset: 3px;

  /* --- Header --- */
  --header-height: 4.5rem;
}


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

html {
  font-size: 100%;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  font-family: var(--font-body);
  font-size: var(--font-size-base);
  line-height: var(--line-height-base);
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

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

a {
  color: var(--color-link);
  text-decoration: underline;
  text-underline-offset: 0.2em;
  text-decoration-thickness: 1px;
  transition: color var(--transition-fast), text-decoration-color var(--transition-fast);
}

a:hover {
  color: var(--color-link-hover);
}

/* --- Global focus styles (WCAG AAA visible focus) --- */
:focus-visible {
  outline: var(--focus-ring);
  outline-offset: var(--focus-ring-offset);
  border-radius: var(--radius-sm);
}

:focus:not(:focus-visible) {
  outline: none;
}

/* Display headings */
h1, h2 {
  font-family: var(--font-body);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
  color: var(--color-primary);
}

/* Section & card headings: clean sans */
h3, h4, h5, h6 {
  font-family: var(--font-body);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-snug);
  color: var(--color-primary);
}

h1 { font-size: var(--font-size-4xl); }
h2 { font-size: clamp(var(--font-size-2xl), 4vw, var(--font-size-3xl)); }
h3 { font-size: var(--font-size-xl); }
h4 { font-size: var(--font-size-lg); }

@media (max-width: 48rem) {
  h1 { font-size: var(--font-size-3xl); }
}

p + p {
  margin-top: var(--space-md);
}

ul, ol {
  padding-left: var(--space-xl);
}

/* Selection */
::selection {
  background-color: var(--color-motriu);
  color: var(--color-white);
}

/* Smooth anchor scrolling with header offset */
.page--home [id] {
  scroll-margin-top: var(--header-height);
}

[id] {
  scroll-margin-top: var(--header-height);
}


/* ----------------------------------------------------------
   3. SKIP LINK
   ---------------------------------------------------------- */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-md);
  z-index: 10000;
  padding: var(--space-sm) var(--space-lg);
  background: var(--color-primary);
  color: var(--color-primary-inverse);
  font-family: var(--font-body);
  font-weight: var(--font-weight-semibold);
  text-decoration: none;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
}

.skip-link:focus {
  top: 0;
}

/* Screen reader only — visually hidden but accessible */
.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;
}


/* ----------------------------------------------------------
   4. LAYOUT: CONTAINER
   ---------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-padding);
}

.container--narrow {
  max-width: var(--container-narrow);
}


/* ----------------------------------------------------------
   5. HEADER & NAVIGATION
   ---------------------------------------------------------- */
.header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  transition: background-color 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.header--scrolled {
  box-shadow: var(--shadow-md);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
}

.header__logo {
  display: flex;
  align-items: center;
  gap: 0;
  text-decoration: none;
  font-family: var(--font-body);
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-primary);
  letter-spacing: -0.03em;
  transition: color 0.3s ease;
}

.header__logo-chevron {
  color: var(--color-motriu-mid);
  font-weight: var(--font-weight-bold);
  transition: color 0.3s ease;
}

/* Logo image (SVG) */
.header__logo-img {
  height: 1.5rem;
  width: auto;
  display: block;
}

.footer__logo-img {
  height: 1.25rem;
  width: auto;
  display: block;
}

/* --- Homepage: transparent header over dark hero --- */
.page--home .header {
  position: fixed;
  left: 0;
  right: 0;
  background: transparent;
  border-bottom-color: transparent;
}

.page--home .header .nav__link {
  color: var(--color-text);
}

.page--home .header .nav__link:hover,
.page--home .header .nav__link--active {
  color: var(--color-motriu);
  border-bottom-color: var(--color-motriu);
}

.page--home .header .nav__toggle {
  color: var(--color-text);
}

/* Homepage: scrolled state — solid */
.page--home .header.header--scrolled {
  background: var(--color-bg);
  border-bottom-color: var(--color-border);
}

.page--home .header.header--scrolled .nav__link {
  color: var(--color-text);
}

.page--home .header.header--scrolled .nav__link:hover,
.page--home .header.header--scrolled .nav__link--active {
  color: var(--color-motriu);
  border-bottom-color: var(--color-motriu);
}

.page--home .header.header--scrolled .nav__toggle {
  color: var(--color-text);
}

/* Navigation */
.nav__list {
  display: flex;
  gap: var(--space-xl);
  list-style: none;
  padding: 0;
  margin: 0;
}

.nav__link {
  display: inline-block;
  padding: var(--space-xs) 0;
  color: var(--color-text);
  text-decoration: none;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  letter-spacing: 0.02em;
  border-bottom: var(--border-width) solid transparent;
  transition: color 0.3s ease, border-color 0.3s ease;
}

.nav__link:hover,
.nav__link--active {
  color: var(--color-motriu);
  border-bottom-color: var(--color-motriu);
}

.nav__link:focus-visible {
  border-bottom-color: transparent;
}

/* Mobile menu toggle */
.nav__toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-sm);
  color: var(--color-text);
}

.nav__toggle-bar {
  display: block;
  width: 1.5rem;
  height: 2px;
  background: currentColor;
  transition: transform var(--transition-base), opacity var(--transition-base);
}

.nav__toggle-bar + .nav__toggle-bar {
  margin-top: 5px;
}

.nav__toggle[aria-expanded="true"] .nav__toggle-bar:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.nav__toggle[aria-expanded="true"] .nav__toggle-bar:nth-child(2) {
  opacity: 0;
}

.nav__toggle[aria-expanded="true"] .nav__toggle-bar:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

@media (max-width: 48rem) {
  .nav__toggle {
    display: block;
  }

  .nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    transform: translateY(-0.5rem);
    opacity: 0;
    visibility: hidden;
    transition: transform var(--transition-base), opacity var(--transition-base), visibility var(--transition-base);
  }

  .nav--open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .nav__list {
    flex-direction: column;
    gap: 0;
    padding: var(--space-md) var(--container-padding) var(--space-xl);
  }

  .nav__link {
    display: block;
    padding: var(--space-sm) 0;
    font-size: var(--font-size-base);
    border-bottom: none;
  }

  /* Scrolled state on homepage mobile: use regular light nav */
  .page--home .header.header--scrolled .nav {
    background: var(--color-bg);
    border-bottom-color: var(--color-border);
  }
}


/* ----------------------------------------------------------
   6. BUTTONS
   ---------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-xl);
  font-family: var(--font-body);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  line-height: 1;
  letter-spacing: 0.02em;
  text-decoration: none;
  border: var(--border-width) solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background-color var(--transition-fast), color var(--transition-fast),
    border-color var(--transition-fast), box-shadow var(--transition-fast),
    transform var(--transition-fast);
}

.btn:hover {
  transform: translateY(-1px);
}

@media (prefers-reduced-motion: reduce) {
  .btn:hover {
    transform: none;
  }
}

.btn--primary {
  background: var(--color-primary);
  color: var(--color-primary-inverse);
  border-color: var(--color-primary);
}

.btn--primary:hover {
  background: var(--color-gray-700);
  border-color: var(--color-gray-700);
  color: var(--color-white);
  box-shadow: var(--shadow-md);
}

.btn--secondary {
  background: transparent;
  color: var(--color-primary);
  border-color: var(--color-primary);
}

.btn--secondary:hover {
  background: var(--color-primary);
  color: var(--color-primary-inverse);
}

/* Ghost button — for use on dark backgrounds */
.btn--ghost {
  background: transparent;
  color: var(--color-white);
  border-color: rgba(255, 255, 255, 0.4);
}

.btn--ghost:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.7);
  color: var(--color-white);
}

.btn--large {
  padding: var(--space-lg) var(--space-2xl);
  font-size: var(--font-size-base);
}

.btn__chevron {
  font-family: var(--font-body);
  font-weight: var(--font-weight-bold);
  transition: transform var(--transition-fast);
}

.btn:hover .btn__chevron {
  transform: translateX(4px);
}

@media (prefers-reduced-motion: reduce) {
  .btn:hover .btn__chevron {
    transform: none;
  }
}


/* ----------------------------------------------------------
   7. SECTIONS (generic)
   ---------------------------------------------------------- */
.section {
  padding: var(--section-padding);
}

.section--light,
.section--alt {
  background: var(--color-bg-alt);
}

.section--dark {
  background: var(--color-bg-dark);
  color: var(--color-text-inverse);
}

.section--dark h2,
.section--dark h3 {
  color: var(--color-white);
}

.section__header {
  max-width: var(--container-narrow);
  margin-bottom: var(--space-3xl);
}

.section__header--centered {
  margin-inline: auto;
  text-align: center;
}

.section__eyebrow {
  display: inline-block;
  font-family: var(--font-body);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--color-motriu);
  margin-bottom: var(--space-lg);
}

.section__title {
  margin-bottom: var(--space-lg);
}

.section__intro {
  font-size: var(--font-size-lg);
  color: var(--color-text-secondary);
  line-height: var(--line-height-relaxed);
}

.section--dark .section__intro {
  color: var(--color-gray-300);
}

.section--dark .section__eyebrow {
  color: var(--color-motriu-mid);
}


/* ----------------------------------------------------------
   8. HERO
   ---------------------------------------------------------- */
.hero {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 100vh;
  padding: calc(var(--header-height) + var(--space-3xl)) 0 var(--space-4xl);
  background: var(--color-gray-50);
  overflow: hidden;
}

.hero__content {
  position: relative;
  z-index: 3;
  max-width: 44rem;
}

/* Eyebrow label */
.hero__eyebrow {
  font-family: var(--font-body);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-2xl);
}

/* Display title */
.hero__title {
  font-family: var(--font-body);
  font-size: var(--font-size-display);
  font-weight: var(--font-weight-normal);
  line-height: 1.05;
  color: var(--color-text);
  margin-bottom: var(--space-xl);
  letter-spacing: -0.02em;
}

.hero__title-line {
  display: block;
}

/* Emphasis on "tothom" — italic with MVAC gradient underline */
.hero__title em {
  font-style: italic;
  position: relative;
  white-space: nowrap;
}

.hero__title em::after {
  content: '';
  position: absolute;
  bottom: 0.05em;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(
    90deg,
    var(--color-motriu-mid),
    var(--color-visual-mid),
    var(--color-auditiva-mid),
    var(--color-cognitiva-mid)
  );
  border-radius: 2px;
}

.hero__subtitle {
  font-family: var(--font-body);
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-normal);
  color: var(--color-text-secondary);
  line-height: var(--line-height-relaxed);
  margin-bottom: var(--space-2xl);
  max-width: 36rem;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
}

/* --- Hero Background Layers --- */
.hero__bg {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.hero-canvas {
  width: 100%;
  height: 100%;
  opacity: 0.6;
}

/* Gradient mesh using MVAC colors — atmospheric background */
.hero__gradient-mesh {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 15% 80%, rgba(30, 64, 175, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 85% 20%, rgba(91, 33, 182, 0.10) 0%, transparent 40%),
    radial-gradient(ellipse at 55% 50%, rgba(6, 95, 70, 0.07) 0%, transparent 45%);
  animation: meshDrift 30s ease-in-out infinite alternate;
}

@keyframes meshDrift {
  0% { opacity: 1; }
  50% { opacity: 0.7; }
  100% { opacity: 1; }
}

/* Film grain texture overlay */
.hero__grain {
  position: absolute;
  inset: 0;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  pointer-events: none;
}

/* Decorative chevron grid — branded > pattern */
.hero__chevrons {
  position: absolute;
  right: -3%;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  font-family: var(--font-body);
  font-size: clamp(5rem, 12vw, 11rem);
  font-weight: var(--font-weight-bold);
  line-height: 0.85;
  color: rgba(0, 0, 0, 0.055);
  user-select: none;
  pointer-events: none;
}

/* Wave animation — chevrons appear/disappear left-to-right */
.hero__chevrons span {
  opacity: 0;
  animation: chevronWave 5s ease-in-out infinite;
}

/* Stagger by column (left → right) with slight row offset for organic diagonal wave */
.hero__chevrons span:nth-child(1) { animation-delay: 0s; }
.hero__chevrons span:nth-child(2) { animation-delay: 0.5s; }
.hero__chevrons span:nth-child(3) { animation-delay: 1.0s; }
.hero__chevrons span:nth-child(4) { animation-delay: 0.15s; }
.hero__chevrons span:nth-child(5) { animation-delay: 0.65s; }
.hero__chevrons span:nth-child(6) { animation-delay: 1.15s; }
.hero__chevrons span:nth-child(7) { animation-delay: 0.3s; }
.hero__chevrons span:nth-child(8) { animation-delay: 0.8s; }
.hero__chevrons span:nth-child(9) { animation-delay: 1.3s; }

@keyframes chevronWave {
  0%, 100% { opacity: 0; }
  25%, 40% { opacity: 1; }
  65% { opacity: 0; }
}

@media (max-width: 64rem) {
  .hero__chevrons {
    font-size: 6rem;
    right: -1rem;
    opacity: 0.5;
  }
}

@media (max-width: 40rem) {
  .hero__chevrons {
    display: none;
  }

  .hero__title {
    font-size: clamp(2.5rem, 10vw, 3.5rem);
  }
}


/* ----------------------------------------------------------
   8b. HERO VIDEO VARIANT
   Video background with dark overlay for text readability
   ---------------------------------------------------------- */
.hero-video {
  background: #0a0a0a;
}

.hero-video__bg {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
}

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

/* Dark gradient overlay — ensures text readability over video */
.hero-video__overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      to right,
      rgba(10, 10, 10, 0.82) 0%,
      rgba(10, 10, 10, 0.6) 40%,
      rgba(10, 10, 10, 0.3) 70%,
      rgba(10, 10, 10, 0.15) 100%
    ),
    linear-gradient(
      to top,
      rgba(10, 10, 10, 0.5) 0%,
      transparent 40%
    );
  z-index: 1;
}

/* Text styles for video hero — always light text */
.hero-video .hero__eyebrow {
  color: rgba(255, 255, 255, 0.6);
}

.hero-video .hero__title {
  color: var(--color-white);
}

.hero-video .hero__subtitle {
  color: rgba(255, 255, 255, 0.7);
}

.hero-video .hero__chevrons {
  color: rgba(255, 255, 255, 0.05);
}

.hero-video .btn--primary {
  background: var(--color-white);
  color: var(--color-black);
  border-color: var(--color-white);
}

.hero-video .btn--primary:hover {
  background: var(--color-gray-200);
  border-color: var(--color-gray-200);
}

.hero-video .btn--secondary {
  color: var(--color-white);
  border-color: rgba(255, 255, 255, 0.3);
}

.hero-video .btn--secondary:hover {
  border-color: var(--color-white);
  color: var(--color-white);
}

/* Reduced motion: pause video, show static frame */
@media (prefers-reduced-motion: reduce) {
  .hero-video__media {
    animation: none;
  }
}

/* --- Video hero: solid white header --- */
.page--home-video .header {
  background: var(--color-bg);
  border-bottom-color: var(--color-border);
}

.page--home-video .header .nav__link {
  color: var(--color-text);
}

.page--home-video .header .nav__link:hover,
.page--home-video .header .nav__link--active {
  color: var(--color-motriu);
  border-bottom-color: var(--color-motriu);
}

.page--home-video .header .nav__toggle {
  color: var(--color-text);
}

/* Print: hide video background */
@media print {
  .hero-video__bg {
    display: none !important;
  }

  .hero-video {
    background: #fff;
  }
}


/* ----------------------------------------------------------
   9. MVAC COLOR BAR
   Brand signature — thin horizontal bar with 4 MVAC colors
   ---------------------------------------------------------- */
.mvac-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 4;
  display: flex;
  height: 4px;
}

.mvac-bar__segment {
  flex: 1;
  transition: flex var(--transition-slow);
}

.mvac-bar__segment--m { background: var(--color-motriu-mid); }
.mvac-bar__segment--v { background: var(--color-visual-mid); }
.mvac-bar__segment--a { background: var(--color-auditiva-mid); }
.mvac-bar__segment--c { background: var(--color-cognitiva-mid); }


/* ----------------------------------------------------------
   10. SERVICES GRID (Bento)
   ---------------------------------------------------------- */
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--grid-gap);
}

@media (max-width: 64rem) {
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 40rem) {
  .services-grid {
    grid-template-columns: 1fr;
  }
}

/* Featured card spans 2 columns */
.service-card--featured {
  grid-column: span 2;
}

@media (max-width: 40rem) {
  .service-card--featured {
    grid-column: span 1;
  }
}

.service-card {
  position: relative;
  padding: var(--space-2xl);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--color-border);
  border-radius: var(--radius-lg);
  transition: transform var(--transition-base), box-shadow var(--transition-base),
    border-color var(--transition-base);
}

.service-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

@media (prefers-reduced-motion: reduce) {
  .service-card:hover {
    transform: none;
  }
}

/* MVAC-colored left borders — cycling through the 4 colors */
.service-card:nth-child(1) { border-left-color: var(--color-motriu-mid); }
.service-card:nth-child(2) { border-left-color: var(--color-visual-mid); }
.service-card:nth-child(3) { border-left-color: var(--color-auditiva-mid); }
.service-card:nth-child(4) { border-left-color: var(--color-cognitiva-mid); }
.service-card:nth-child(5) { border-left-color: var(--color-motriu-mid); }
.service-card:nth-child(6) { border-left-color: var(--color-visual-mid); }

.service-card:hover {
  border-left-width: 5px;
}

/* Numbered label */
.service-card__number {
  display: inline-block;
  font-family: var(--font-body);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  color: var(--color-gray-400);
  letter-spacing: 0.1em;
  margin-bottom: var(--space-lg);
}

.service-card__title {
  font-size: var(--font-size-xl);
  margin-bottom: var(--space-md);
}

.service-card__text {
  color: var(--color-text-secondary);
  font-size: var(--font-size-base);
  line-height: var(--line-height-relaxed);
}

/* Featured card — MVAC gradient top border via pseudo-element (preserves border-radius) */
.service-card--featured {
  background: var(--color-bg);
  border-color: var(--color-border);
  border-left: 1px solid var(--color-border);
  overflow: hidden;
}

.service-card--featured::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--color-motriu-mid), var(--color-visual-mid), var(--color-auditiva-mid), var(--color-cognitiva-mid));
}


/* ----------------------------------------------------------
   11. CTA BANNER
   ---------------------------------------------------------- */
.cta-banner {
  position: relative;
  padding: var(--space-5xl) 0;
  background: var(--color-gray-50);
  color: var(--color-text);
  text-align: center;
  overflow: hidden;
}

.cta-banner__eyebrow {
  display: inline-block;
  font-family: var(--font-body);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--color-motriu-mid);
  margin-bottom: var(--space-xl);
}

.cta-banner__title {
  color: var(--color-text);
  font-size: clamp(var(--font-size-2xl), 5vw, var(--font-size-4xl));
  margin-bottom: var(--space-lg);
  max-width: 40rem;
  margin-inline: auto;
}

.cta-banner__text {
  max-width: var(--container-narrow);
  margin-inline: auto;
  margin-bottom: var(--space-2xl);
  font-size: var(--font-size-lg);
  color: var(--color-text-secondary);
  line-height: var(--line-height-relaxed);
}

/* Decorative chevrons */
.cta-banner__chevrons {
  position: absolute;
  right: 5%;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-body);
  font-size: 10rem;
  font-weight: var(--font-weight-bold);
  color: rgba(0, 0, 0, 0.03);
  line-height: 0.85;
  user-select: none;
  pointer-events: none;
}


/* ----------------------------------------------------------
   12. TESTIMONIALS
   ---------------------------------------------------------- */
.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--grid-gap);
}

@media (max-width: 64rem) {
  .testimonials-grid {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
  }
}

.testimonial {
  padding: var(--space-2xl);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  transition: box-shadow var(--transition-base);
}

.testimonial:hover {
  box-shadow: var(--shadow-md);
}

/* Large decorative quotation mark */
.testimonial__mark {
  font-family: var(--font-display);
  font-size: 4rem;
  line-height: 0.6;
  color: var(--color-motriu-mid);
  margin-bottom: var(--space-md);
  user-select: none;
}

.testimonial__quote {
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--font-size-lg);
  line-height: var(--line-height-relaxed);
  margin-bottom: var(--space-lg);
  color: var(--color-text);
}

.testimonial__footer {
  padding-top: var(--space-md);
  border-top: 1px solid var(--color-border);
}

.testimonial__author {
  font-family: var(--font-body);
  font-weight: var(--font-weight-semibold);
  font-style: normal;
  color: var(--color-text);
  font-size: var(--font-size-sm);
}

.testimonial__role {
  font-size: var(--font-size-xs);
  color: var(--color-text-secondary);
  margin-top: var(--space-xs);
}


/* ----------------------------------------------------------
   13. CLIENT LOGOS — Architectural grid with separators
   ---------------------------------------------------------- */
.clients-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  border-top: 1px solid var(--color-border);
  border-left: 1px solid var(--color-border);
}

@media (max-width: 64rem) {
  .clients-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 40rem) {
  .clients-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.client-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-xl) var(--space-md);
  border-bottom: 1px solid var(--color-border);
  border-right: 1px solid var(--color-border);
  transition: background-color var(--transition-base);
}

.client-logo:hover {
  background: var(--color-bg-alt);
}

.client-logo__name {
  font-family: var(--font-body);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  color: var(--color-gray-500);
  text-align: center;
  line-height: var(--line-height-snug);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: color var(--transition-base);
}

.client-logo:hover .client-logo__name {
  color: var(--color-text);
}


/* ----------------------------------------------------------
   14. CONTACT INFO (address block)
   ---------------------------------------------------------- */
.contact-info {
  font-style: normal;
  margin-top: var(--space-2xl);
}

.contact-info__item {
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--color-border);
}

.contact-info__item:first-child {
  border-top: 1px solid var(--color-border);
}

.contact-info__label {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-xs);
}


/* ----------------------------------------------------------
   15. CONTACT FORM
   ---------------------------------------------------------- */
.form {
  max-width: 36rem;
}

.form__group {
  margin-bottom: var(--space-xl);
}

.form__label {
  display: block;
  margin-bottom: var(--space-sm);
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-sm);
}

.form__hint {
  display: block;
  margin-bottom: var(--space-sm);
  font-size: var(--font-size-xs);
  color: var(--color-text-secondary);
}

.form__input,
.form__textarea,
.form__select {
  display: block;
  width: 100%;
  padding: var(--space-md);
  font-family: var(--font-body);
  font-size: var(--font-size-base);
  line-height: var(--line-height-base);
  color: var(--color-text);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form__input:focus,
.form__textarea:focus,
.form__select:focus {
  border-color: var(--color-focus);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
  outline: none;
}

.form__input--error,
.form__textarea--error {
  border-color: #dc2626;
}

.form__error {
  display: block;
  margin-top: var(--space-sm);
  font-size: var(--font-size-sm);
  color: #dc2626;
  font-weight: var(--font-weight-medium);
}

/* Honeypot anti-spam */
.form__honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Missatge d'estat del formulari */
.form__status {
  display: none;
  padding: var(--space-md);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  margin-bottom: var(--space-md);
}
.form__status:not(:empty) {
  display: block;
}
.form__status--ok {
  background-color: #dcfce7;
  color: #166534;
  border: 1px solid #bbf7d0;
}
.form__status--error {
  background-color: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}
.form__status--error a {
  color: inherit;
  text-decoration: underline;
}

.form__textarea {
  min-height: 8rem;
  resize: vertical;
}


/* ----------------------------------------------------------
   16. FOOTER
   ---------------------------------------------------------- */
.footer {
  background: var(--color-gray-50);
  color: var(--color-text-secondary);
  padding: var(--space-4xl) 0 var(--space-xl);
}

.footer a {
  color: var(--color-text-secondary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.footer a:hover {
  color: var(--color-text);
}

.footer__grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--space-3xl);
  margin-bottom: var(--space-3xl);
}

@media (max-width: 64rem) {
  .footer__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 40rem) {
  .footer__grid {
    grid-template-columns: 1fr;
  }
}

.footer__brand {
  margin-bottom: var(--space-md);
}

.footer__brand-chevron {
  color: var(--color-motriu-mid);
}

.footer__tagline {
  font-size: var(--font-size-sm);
  margin-bottom: var(--space-lg);
  max-width: 20rem;
  line-height: var(--line-height-relaxed);
}

.footer__heading {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  color: var(--color-text);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--space-lg);
}

.footer__list {
  list-style: none;
  padding: 0;
}

.footer__list li + li {
  margin-top: var(--space-sm);
}

.footer__list a {
  font-size: var(--font-size-sm);
}

.footer__contact-item {
  font-size: var(--font-size-sm);
  margin-bottom: var(--space-sm);
  line-height: var(--line-height-relaxed);
}

.footer__bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-md);
  padding-top: var(--space-xl);
  border-top: 1px solid var(--color-border);
  font-size: var(--font-size-xs);
  color: var(--color-gray-500);
}

.footer__bar a {
  color: var(--color-gray-500);
}

.footer__bar a:hover {
  color: var(--color-text);
}

.footer__legal {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
}


/* ----------------------------------------------------------
   17. SCROLL ANIMATIONS
   ---------------------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(1.5rem);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal--visible {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered delays for grid children */
.services-grid .reveal:nth-child(1) { transition-delay: 0ms; }
.services-grid .reveal:nth-child(2) { transition-delay: 80ms; }
.services-grid .reveal:nth-child(3) { transition-delay: 160ms; }
.services-grid .reveal:nth-child(4) { transition-delay: 240ms; }
.services-grid .reveal:nth-child(5) { transition-delay: 320ms; }
.services-grid .reveal:nth-child(6) { transition-delay: 400ms; }

.testimonials-grid .reveal:nth-child(1) { transition-delay: 0ms; }
.testimonials-grid .reveal:nth-child(2) { transition-delay: 100ms; }
.testimonials-grid .reveal:nth-child(3) { transition-delay: 200ms; }

/* Reveal variants — scale entrance */
.reveal--scale {
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal--scale.reveal--visible {
  opacity: 1;
  transform: scale(1);
}

/* Reveal variants — slide from left / right */
.reveal--left {
  opacity: 0;
  transform: translateX(-2rem);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal--right {
  opacity: 0;
  transform: translateX(2rem);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal--left.reveal--visible,
.reveal--right.reveal--visible {
  opacity: 1;
  transform: translateX(0);
}

/* Staggered delays for feature cards */
.features-grid .reveal:nth-child(1) { transition-delay: 0ms; }
.features-grid .reveal:nth-child(2) { transition-delay: 80ms; }
.features-grid .reveal:nth-child(3) { transition-delay: 160ms; }
.features-grid .reveal:nth-child(4) { transition-delay: 240ms; }
.features-grid .reveal:nth-child(5) { transition-delay: 320ms; }
.features-grid .reveal:nth-child(6) { transition-delay: 400ms; }

@media (prefers-reduced-motion: reduce) {
  .reveal,
  .reveal--scale,
  .reveal--left,
  .reveal--right {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .services-grid .reveal,
  .testimonials-grid .reveal,
  .features-grid .reveal {
    transition-delay: 0ms;
  }
}


/* ----------------------------------------------------------
   17b. ECHARTS POLAR CHART
   ---------------------------------------------------------- */
#chart-reveal {
  will-change: transform, opacity;
}

.echarts-polar {
  width: 100%;
  max-width: 32rem;
  aspect-ratio: 1 / 1;
  margin: 0 auto;
}


/* ----------------------------------------------------------
   17b2. RADAR CHART — MVAC scroll-driven spider chart
   ---------------------------------------------------------- */
.radar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xl);
  margin-top: var(--space-2xl);
}

@media (min-width: 64rem) {
  .radar {
    flex-direction: row;
    align-items: flex-start;
  }
}

.radar__chart {
  flex-shrink: 0;
  width: 100%;
  max-width: 26rem;
}

.radar__svg {
  width: 100%;
  height: auto;
}

/* Data polygons */
.radar__polygon {
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill-opacity: 0;
}

.radar__polygon--m {
  stroke: var(--color-motriu-mid);
  fill: var(--color-motriu-mid);
}

.radar__polygon--v {
  stroke: var(--color-visual-mid);
  fill: var(--color-visual-mid);
}

.radar__polygon--a {
  stroke: var(--color-auditiva-mid);
  fill: var(--color-auditiva-mid);
}

.radar__polygon--c {
  stroke: var(--color-cognitiva-mid);
  fill: var(--color-cognitiva-mid);
}

/* Legend */
.radar__legend {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.radar__legend-title {
  font-family: var(--font-body);
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  margin-bottom: var(--space-xs);
}

.radar__legend-desc {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-sm);
}

.radar__legend-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: var(--color-bg-alt);
  border-radius: var(--radius-md);
  opacity: 0.4;
  transition: opacity 0.4s ease;
}

.radar__legend-item.is-active {
  opacity: 1;
}

.radar__legend-color {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.radar__legend-label {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
}


/* ----------------------------------------------------------
   17c. PROGRESS TRACKER — Animated project tracking
   ---------------------------------------------------------- */
.progress-tracker {
  margin-top: var(--space-2xl);
  max-width: 36rem;
}

.progress-tracker__periods {
  display: flex;
  gap: var(--space-xl);
  margin-bottom: var(--space-sm);
}

.progress-tracker__period {
  font-family: var(--font-body);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  color: var(--color-text);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.progress-tracker__bar-wrapper {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.progress-tracker__bar {
  position: relative;
  height: 1.5rem;
  flex: 1 1 0%;
  background: var(--color-gray-200);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.progress-tracker__fill {
  position: absolute;
  inset: 0;
  width: 0;
  background: var(--color-primary);
  border-radius: var(--radius-sm);
  will-change: width;
}

.progress-tracker__pct {
  font-family: var(--font-body);
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-bold);
  color: var(--color-primary);
  min-width: 3.5ch;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.progress-tracker__midline {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--color-bg);
  opacity: 0.4;
  z-index: 1;
}

/* Indicators */
.progress-tracker__indicators {
  margin-bottom: var(--space-md);
}

.progress-tracker__row {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  flex-wrap: wrap;
}

.progress-tracker__dot {
  width: 0.875rem;
  height: 0.875rem;
  border-radius: var(--radius-full);
  background: var(--color-gray-300);
  transition: background-color 0.5s ease, transform 0.3s ease;
  flex-shrink: 0;
}

.progress-tracker__dot.is-active[data-final="green"] {
  background: #16a34a;
}

.progress-tracker__dot.is-active[data-final="yellow"] {
  background: #eab308;
}

.progress-tracker__dot.is-active[data-final="red"] {
  background: #dc2626;
}

.progress-tracker__dot.is-active[data-final="gray"] {
  background: var(--color-gray-300);
}

.progress-tracker__dot.is-active {
  transform: scale(1.15);
}

.progress-tracker__sep {
  width: 1px;
  height: 0.875rem;
  background: var(--color-gray-300);
  flex-shrink: 0;
  margin: 0 0.125rem;
}

/* Legend */
.progress-tracker__legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-lg);
}

.progress-tracker__legend-item {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: var(--font-size-xs);
  color: var(--color-text-secondary);
}

.progress-tracker__legend-dot {
  width: 0.625rem;
  height: 0.625rem;
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

.progress-tracker__legend-dot--green {
  background: #16a34a;
}

.progress-tracker__legend-dot--yellow {
  background: #eab308;
}

.progress-tracker__legend-dot--red {
  background: #dc2626;
}

/* Reduced motion: show final state immediately */
@media (prefers-reduced-motion: reduce) {
  .progress-tracker__fill {
    transition: none;
    width: 72%;
  }

  .progress-tracker__dot {
    transition: none;
  }

  .progress-tracker__dot[data-final="green"] {
    background: #16a34a;
  }

  .progress-tracker__dot[data-final="yellow"] {
    background: #eab308;
  }

  .progress-tracker__dot[data-final="red"] {
    background: #dc2626;
  }
}


/* ----------------------------------------------------------
   17d. CHECKLIST TREE — Animated hierarchical tree
   ---------------------------------------------------------- */
.checklist-tree {
  font-family: var(--font-body);
  font-size: var(--font-size-sm);
  max-width: 100%;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-bg);
  box-shadow: var(--shadow-md);
}

.checklist-tree__item {
  border-bottom: 1px solid var(--color-border);
}

.checklist-tree__item:last-child {
  border-bottom: none;
}

.checklist-tree__row {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  cursor: default;
  transition: background-color var(--transition-fast);
}

.checklist-tree__row:hover {
  background: var(--color-bg-alt);
}

/* Nesting depth indentation */
.checklist-tree__item--depth-1 .checklist-tree__row { padding-left: var(--space-2xl); }
.checklist-tree__item--depth-2 .checklist-tree__row { padding-left: var(--space-3xl); }
.checklist-tree__item--depth-3 .checklist-tree__row { padding-left: calc(var(--space-3xl) + var(--space-lg)); }

/* Connector line for child items */
.checklist-tree__connector {
  width: 1rem;
  height: 1px;
  background: var(--color-gray-300);
  flex-shrink: 0;
}

/* Toggle chevron for expandable items */
.checklist-tree__toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
  color: var(--color-text-secondary);
  font-size: var(--font-size-xs);
  transition: transform var(--transition-fast);
}

.checklist-tree__toggle--open {
  transform: rotate(90deg);
}

/* Category header bar */
.checklist-tree__row--category {
  background: var(--color-motriu-mid);
  color: var(--color-white);
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
  font-size: var(--font-size-xs);
  letter-spacing: 0.05em;
  padding: var(--space-xs) var(--space-md);
}

.checklist-tree__row--category:hover {
  background: var(--color-motriu);
}

.checklist-tree__item--depth-1 .checklist-tree__row--category { padding-left: var(--space-2xl); }
.checklist-tree__item--depth-2 .checklist-tree__row--category { padding-left: var(--space-3xl); }

.checklist-tree__label {
  flex: 1;
  min-width: 0;
}

/* Collapse/expand animation for children */
.checklist-tree__children {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.checklist-tree__children--open {
  max-height: 40rem;
}

/* Action icons placeholder */
.checklist-tree__actions {
  display: flex;
  gap: var(--space-xs);
  flex-shrink: 0;
}

.checklist-tree__action {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  font-size: 0.625rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  color: var(--color-text-secondary);
  background: var(--color-bg);
}

.checklist-tree__action--danger {
  border-color: #dc2626;
  color: #dc2626;
  background: #fef2f2;
}

/* Staggered entrance for tree items */
.checklist-tree__item {
  opacity: 0;
  transform: translateX(-0.5rem);
  transition: opacity 0.4s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.checklist-tree.is-animated .checklist-tree__item {
  opacity: 1;
  transform: translateX(0);
}

.checklist-tree.is-animated .checklist-tree__item:nth-child(1) { transition-delay: 0ms; }
.checklist-tree.is-animated .checklist-tree__item:nth-child(2) { transition-delay: 80ms; }
.checklist-tree.is-animated .checklist-tree__item:nth-child(3) { transition-delay: 160ms; }
.checklist-tree.is-animated .checklist-tree__item:nth-child(4) { transition-delay: 240ms; }
.checklist-tree.is-animated .checklist-tree__item:nth-child(5) { transition-delay: 320ms; }

@media (prefers-reduced-motion: reduce) {
  .checklist-tree__item {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .checklist-tree__children {
    transition: none;
  }

  .checklist-tree__toggle {
    transition: none;
  }
}


/* ----------------------------------------------------------
   17d. MVAC STAT COUNTERS
   ---------------------------------------------------------- */
.mvac-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-md);
  margin-top: var(--space-2xl);
  will-change: transform, opacity;
}

@media (max-width: 30rem) {
  .mvac-stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

.mvac-stat {
  text-align: center;
  padding: var(--space-lg) var(--space-sm);
  border-radius: var(--radius-md);
  background: var(--color-bg-alt);
  border-top: 3px solid var(--color-border);
}

.mvac-stat--m,
.mvac-stat--v,
.mvac-stat--a,
.mvac-stat--c { border-top-color: var(--color-gray-400); }

.mvac-stat__icon {
  width: 4rem;
  height: 4rem;
  margin: 0 auto var(--space-sm);
}

.mvac-icon {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}

/* Stroke-draw initial state: hidden strokes, no fill */
.mvac-icon path,
.mvac-icon rect {
  fill: currentColor;
  fill-opacity: 0;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}

.mvac-stat--m .mvac-stat__icon,
.mvac-stat--v .mvac-stat__icon,
.mvac-stat--a .mvac-stat__icon,
.mvac-stat--c .mvac-stat__icon { color: var(--color-gray-700); }

.mvac-stat__label {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-secondary);
}

@media (prefers-reduced-motion: reduce) {
  .mvac-icon path,
  .mvac-icon rect {
    stroke-dashoffset: 0;
    fill-opacity: 1;
  }
}


/* ----------------------------------------------------------
   18. HERO CANVAS ANIMATION
   ---------------------------------------------------------- */
.hero-canvas {
  width: 100%;
  height: 100%;
}

@media (prefers-reduced-motion: reduce) {
  .hero-canvas {
    display: none;
  }

  .hero__gradient-mesh {
    animation: none;
  }

  .hero__chevrons span {
    animation: none;
    opacity: 1;
  }
}


/* ----------------------------------------------------------
   19. TWO-COLUMN LAYOUT
   ---------------------------------------------------------- */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3xl);
  align-items: start;
}

@media (max-width: 48rem) {
  .two-col {
    grid-template-columns: 1fr;
    gap: var(--space-2xl);
  }
}

.two-col--reverse {
  direction: rtl;
}

.two-col--reverse > * {
  direction: ltr;
}


/* ----------------------------------------------------------
   20. LANDING HERO (for metode-mapa and museus pages)
   ---------------------------------------------------------- */
.landing-hero {
  padding: var(--space-5xl) 0 var(--space-3xl);
  background: var(--color-bg-alt);
}

.landing-hero--mesh {
  position: relative;
  overflow: hidden;
}

.landing-hero--mesh .container {
  position: relative;
  z-index: 1;
}

.mesh-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

@media (prefers-reduced-motion: reduce) {
  .mesh-canvas {
    display: none;
  }
}

.landing-hero__title {
  font-size: clamp(var(--font-size-2xl), 4vw, var(--font-size-4xl));
  margin-bottom: var(--space-lg);
  max-width: 40rem;
}

.landing-hero__subtitle {
  font-size: var(--font-size-lg);
  color: var(--color-text-secondary);
  line-height: var(--line-height-relaxed);
  max-width: 40rem;
  margin-bottom: var(--space-2xl);
}

.landing-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
}


/* ----------------------------------------------------------
   21. MAPA RADAR CHART
   ---------------------------------------------------------- */
.radar-chart {
  max-width: 24rem;
  margin: 0 auto;
}

.radar-chart__svg {
  width: 100%;
  height: auto;
}

.radar-chart__axis-label {
  font-family: var(--font-body);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  fill: var(--color-text);
}

.radar-chart__polygon {
  stroke-width: 2;
  fill-opacity: 0.15;
  transition: fill-opacity var(--transition-base);
}

.radar-chart__polygon:hover {
  fill-opacity: 0.3;
}

.radar-chart__grid-line {
  stroke: var(--color-border);
  stroke-width: 1;
  fill: none;
}


/* ----------------------------------------------------------
   22. MAPA PHASES / WORKFLOW
   ---------------------------------------------------------- */
.phases {
  counter-reset: phase;
}

.phase {
  counter-increment: phase;
  position: relative;
  padding: var(--space-2xl) 0;
  padding-left: var(--space-4xl);
}

.phase + .phase {
  border-top: 1px solid var(--color-border);
}

.phase::before {
  content: counter(phase);
  position: absolute;
  left: 0;
  top: var(--space-2xl);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  background: var(--color-primary);
  color: var(--color-primary-inverse);
  font-family: var(--font-body);
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-bold);
  border-radius: var(--radius-full);
}

.phase__title {
  margin-bottom: var(--space-md);
}

.phase__text {
  color: var(--color-text-secondary);
  line-height: var(--line-height-relaxed);
}

/* Standalone phase — used when outside .phases counter container */
.phase--standalone {
  position: relative;
  padding: 0;
  padding-left: var(--space-4xl);
}

.phase--standalone::before {
  display: none;
}

.phase__number {
  position: absolute;
  left: 0;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  background: var(--color-primary);
  color: var(--color-primary-inverse);
  font-family: var(--font-body);
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-bold);
  border-radius: var(--radius-full);
}


/* ----------------------------------------------------------
   23. FEATURES GRID (MAPA app features)
   ---------------------------------------------------------- */
.features-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--grid-gap);
}

@media (max-width: 48rem) {
  .features-grid {
    grid-template-columns: 1fr;
  }
}

.feature-card {
  position: relative;
  padding: var(--space-2xl);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  transition: border-color var(--transition-base);
  overflow: hidden;
}

.feature-card:hover {
  border-color: var(--color-motriu-mid);
}

.feature-card__number {
  display: inline-block;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  color: var(--color-motriu);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--space-md);
}

.feature-card__title {
  font-size: var(--font-size-xl);
  margin-bottom: var(--space-md);
}

.feature-card__text {
  color: var(--color-text-secondary);
  line-height: var(--line-height-relaxed);
}

/* Decorative SVG icon — bottom right */
.feature-card__icon {
  position: absolute;
  bottom: -0.5rem;
  right: -0.5rem;
  width: 10rem;
  height: 10rem;
  pointer-events: none;
}

.feature-card__icon svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.feature-card__icon svg path {
  fill: none;
  stroke: var(--color-gray-400);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.feature-card:hover .feature-card__icon svg path {
  stroke: var(--color-motriu-mid);
  transition: stroke 0.4s ease;
}

@media (max-width: 48rem) {
  .feature-card__icon {
    width: 7.5rem;
    height: 7.5rem;
  }
}


/* ----------------------------------------------------------
   23b. VIDEO BAND — Scroll-driven fullwidth video
   ---------------------------------------------------------- */
.video-band {
  position: relative;
  height: 300vh;
}

.video-band__sticky {
  position: sticky;
  top: 0;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  background: var(--color-black);
}

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

@media (prefers-reduced-motion: reduce) {
  .video-band {
    height: auto;
  }

  .video-band__sticky {
    position: relative;
    height: auto;
    aspect-ratio: 16 / 9;
  }
}


/* ----------------------------------------------------------
   24. SECTORS / TAGS
   ---------------------------------------------------------- */
.sectors-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--grid-gap);
}

@media (max-width: 48rem) {
  .sectors-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 30rem) {
  .sectors-grid {
    grid-template-columns: 1fr;
  }
}

.sector-card {
  padding: var(--space-xl);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}

.sector-card__title {
  font-size: var(--font-size-lg);
  margin-bottom: var(--space-sm);
}

.sector-card__examples {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
}


/* ----------------------------------------------------------
   25. CASE STUDIES / PROJECT CARDS
   ---------------------------------------------------------- */
.cases-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--grid-gap);
}

@media (max-width: 48rem) {
  .cases-grid {
    grid-template-columns: 1fr;
  }
}

/* ----------------------------------------------------------
   25b. CASES SLIDER — Full-width horizontal scroll-snap
   ---------------------------------------------------------- */
.cases-slider {
  display: flex;
  gap: var(--grid-gap);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-left: max(var(--container-padding), calc((100vw - var(--container-max)) / 2 + var(--container-padding)));
  padding-left: max(var(--container-padding), calc((100vw - var(--container-max)) / 2 + var(--container-padding)));
  padding-right: var(--container-padding);
  padding-bottom: var(--space-md);
  -webkit-overflow-scrolling: touch;
}

.cases-slider::-webkit-scrollbar {
  height: 6px;
}

.cases-slider::-webkit-scrollbar-track {
  background: transparent;
}

.cases-slider::-webkit-scrollbar-thumb {
  background: var(--color-gray-300);
  border-radius: 3px;
}

.cases-slider::-webkit-scrollbar-thumb:hover {
  background: var(--color-gray-400);
}

.cases-slider .case-card {
  flex: 0 0 22rem;
  max-width: 24rem;
  scroll-snap-align: start;
}

@media (max-width: 48rem) {
  .cases-slider .case-card {
    flex: 0 0 80vw;
    max-width: 80vw;
  }
}

.case-card {
  display: flex;
  flex-direction: column;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.case-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

@media (prefers-reduced-motion: reduce) {
  .case-card:hover {
    transform: none;
  }
}

.case-card__image {
  aspect-ratio: 16 / 9;
  background: var(--color-gray-200);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
  overflow: hidden;
}

.case-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.case-card__body {
  flex: 1;
  padding: var(--space-xl);
}

.case-card__title {
  font-size: var(--font-size-xl);
  margin-bottom: var(--space-sm);
}

.case-card__meta {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-md);
}

.case-card__text {
  color: var(--color-text-secondary);
  line-height: var(--line-height-relaxed);
  margin-bottom: var(--space-lg);
}

.case-card__link {
  font-weight: var(--font-weight-semibold);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
}

.case-card__link:hover {
  text-decoration: underline;
}


/* ----------------------------------------------------------
   26. TABLES (normative, funding)
   ---------------------------------------------------------- */
.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: var(--space-xl) 0;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--font-size-base);
}

.table th,
.table td {
  padding: var(--space-md) var(--space-lg);
  text-align: left;
  border-bottom: 1px solid var(--color-border);
  vertical-align: top;
}

.table th {
  font-weight: var(--font-weight-semibold);
  background: var(--color-bg-alt);
  white-space: nowrap;
}

.table tbody tr:hover {
  background: var(--color-bg-alt);
}


/* ----------------------------------------------------------
   27. PRIORITY LIST (criteria)
   ---------------------------------------------------------- */
.criteria-list {
  list-style: none;
  padding: 0;
  counter-reset: criteria;
}

.criteria-item {
  counter-increment: criteria;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-lg);
  padding: var(--space-lg) 0;
  border-bottom: 1px solid var(--color-border);
}

.criteria-item__number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  background: var(--color-bg-alt);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-bold);
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

.criteria-item__title {
  font-weight: var(--font-weight-semibold);
  margin-bottom: var(--space-xs);
}

.criteria-item__text {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
}


/* ----------------------------------------------------------
   28. FUNDING / HIGHLIGHT BOXES
   ---------------------------------------------------------- */
.highlight-box {
  padding: var(--space-xl);
  background: var(--color-motriu-light);
  border-left: 4px solid var(--color-motriu);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin: var(--space-xl) 0;
}

.highlight-box__title {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  margin-bottom: var(--space-sm);
}

.highlight-box__text {
  color: var(--color-text-secondary);
}


/* ----------------------------------------------------------
   29. USP / VALUE PROPS
   ---------------------------------------------------------- */
.value-props {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--grid-gap);
}

@media (max-width: 48rem) {
  .value-props {
    grid-template-columns: 1fr;
  }
}

.value-prop {
  padding: var(--space-xl);
}

.value-prop__title {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  margin-bottom: var(--space-sm);
}

.value-prop__text {
  color: var(--color-text-secondary);
  line-height: var(--line-height-relaxed);
}


/* ----------------------------------------------------------
   30. PROJECTS PAGE — Filter + Cards
   ---------------------------------------------------------- */

/* Filter bar */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-bottom: var(--space-3xl);
}

.filter-bar__btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-lg);
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  font-family: var(--font-body);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all var(--transition-base);
  white-space: nowrap;
}

.filter-bar__btn:hover {
  border-color: var(--color-gray-400);
  color: var(--color-text);
}

.filter-bar__btn:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 2px;
}

.filter-bar__btn--active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: var(--color-primary-inverse);
}

.filter-bar__btn--active:hover {
  background: var(--color-gray-700);
  border-color: var(--color-gray-700);
  color: var(--color-primary-inverse);
}

.filter-bar__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.3rem;
  background: var(--color-bg-alt);
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
}

.filter-bar__btn--active .filter-bar__count {
  background: rgba(255, 255, 255, 0.2);
  color: var(--color-primary-inverse);
}

/* Projects grid */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--grid-gap);
}

@media (max-width: 64rem) {
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 40rem) {
  .projects-grid {
    grid-template-columns: 1fr;
  }
}

/* Project card */
.project-card {
  display: flex;
  flex-direction: column;
  padding: var(--space-xl);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-gray-300);
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
  transition: transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base);
}

.project-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

@media (prefers-reduced-motion: reduce) {
  .project-card:hover {
    transform: none;
  }
}

/* Sector color borders */
.project-card[data-sector="transport"] {
  border-left-color: var(--color-motriu-mid);
}

.project-card[data-sector="equipaments"] {
  border-left-color: var(--color-visual-mid);
}

.project-card[data-sector="administracio"] {
  border-left-color: var(--color-auditiva-mid);
}

.project-card[data-sector="empreses"] {
  border-left-color: var(--color-cognitiva-mid);
}

.project-card[data-sector="tercer-sector"] {
  border-left-color: #f43f5e;
}

/* Card header: year + tags */
.project-card__header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
  flex-wrap: wrap;
}

.project-card__year {
  font-family: var(--font-body);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  color: var(--color-text-secondary);
  letter-spacing: 0.05em;
}

.project-card__tag {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  font-size: 0.6875rem;
  font-weight: var(--font-weight-semibold);
  letter-spacing: 0.03em;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  white-space: nowrap;
}

.project-card__tag--auditoria {
  background: var(--color-motriu-light);
  color: var(--color-motriu);
}

.project-card__tag--pla {
  background: var(--color-auditiva-light);
  color: var(--color-auditiva);
}

.project-card__tag--certificacio {
  background: var(--color-cognitiva-light);
  color: var(--color-cognitiva);
}

.project-card__tag--formacio {
  background: var(--color-visual-light);
  color: var(--color-visual);
}

.project-card__tag--consultoria {
  background: #fce7f3;
  color: #9d174d;
}

.project-card__tag--tecnologia {
  background: #e0e7ff;
  color: #3730a3;
}

.project-card__client {
  font-family: var(--font-display);
  font-size: var(--font-size-xl);
  line-height: var(--line-height-snug);
  margin-bottom: var(--space-sm);
}

.project-card__text {
  flex: 1;
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  line-height: var(--line-height-relaxed);
}

/* Hidden state for filter */
.project-card[aria-hidden="true"] {
  display: none;
}

/* Results count */
.projects-count {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-lg);
}

.projects-count__number {
  font-weight: var(--font-weight-bold);
  color: var(--color-text);
}

/* Stagger entrance animation for project cards */
.projects-grid .reveal:nth-child(1) { transition-delay: 0ms; }
.projects-grid .reveal:nth-child(2) { transition-delay: 60ms; }
.projects-grid .reveal:nth-child(3) { transition-delay: 120ms; }
.projects-grid .reveal:nth-child(4) { transition-delay: 180ms; }
.projects-grid .reveal:nth-child(5) { transition-delay: 240ms; }
.projects-grid .reveal:nth-child(6) { transition-delay: 300ms; }

@media (prefers-reduced-motion: reduce) {
  .projects-grid .reveal {
    transition-delay: 0ms !important;
  }
}


/* ----------------------------------------------------------
   31. LEGAL / PROSE PAGES
   ---------------------------------------------------------- */
.legal-prose {
  max-width: var(--container-narrow);
  padding-bottom: var(--space-4xl);
}

.legal-prose h2 {
  font-size: var(--font-size-2xl);
  margin-top: var(--space-3xl);
  margin-bottom: var(--space-md);
}

.legal-prose h3 {
  font-size: var(--font-size-xl);
  margin-top: var(--space-2xl);
  margin-bottom: var(--space-sm);
}

.legal-prose p {
  color: var(--color-text-secondary);
  line-height: var(--line-height-relaxed);
  margin-bottom: var(--space-md);
}

.legal-prose ul,
.legal-prose ol {
  color: var(--color-text-secondary);
  line-height: var(--line-height-relaxed);
  margin-bottom: var(--space-md);
  padding-left: var(--space-xl);
}

.legal-prose li {
  margin-bottom: var(--space-sm);
}

.legal-prose strong {
  color: var(--color-text);
  font-weight: var(--font-weight-semibold);
}

.legal-prose a {
  color: var(--color-link);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.legal-prose a:hover {
  color: var(--color-link-hover);
}

.legal-prose .legal-prose__meta {
  font-size: var(--font-size-sm);
  color: var(--color-gray-400);
  margin-bottom: var(--space-3xl);
  padding-bottom: var(--space-lg);
  border-bottom: 1px solid var(--color-border);
}

.legal-prose address {
  font-style: normal;
  color: var(--color-text-secondary);
  line-height: var(--line-height-relaxed);
  margin-bottom: var(--space-md);
}

.legal-prose dl {
  margin-bottom: var(--space-lg);
}

.legal-prose dt {
  font-weight: var(--font-weight-semibold);
  color: var(--color-text);
  margin-top: var(--space-md);
}

.legal-prose dd {
  color: var(--color-text-secondary);
  line-height: var(--line-height-relaxed);
  margin-left: 0;
  padding-left: var(--space-xl);
}


/* ----------------------------------------------------------
   32. DARK MODE
   ---------------------------------------------------------- */
@media (prefers-color-scheme: dark) {
  :root {
    --color-text: #e4e4e4;
    --color-text-secondary: #a3a3a3;
    --color-bg: #0f1117;
    --color-bg-alt: #181b22;
    --color-bg-dark: #0a0c10;
    --color-border: #2a2d35;
    --color-link: #93b4f4;
    --color-link-hover: #b6ccf8;
    --color-focus: #93b4f4;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.45);
    --shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.5);
  }

  h1, h2, h3, h4, h5, h6 {
    color: var(--color-white);
  }

  /* Logo inversion for dark backgrounds */
  .header__logo-img,
  .footer__logo-img {
    filter: brightness(0) invert(1);
  }

  .hero {
    background: #0f1117;
  }

  .hero__eyebrow {
    color: rgba(255, 255, 255, 0.5);
  }

  .hero__title {
    color: var(--color-white);
  }

  .hero__subtitle {
    color: rgba(255, 255, 255, 0.6);
  }

  .hero__chevrons {
    color: rgba(255, 255, 255, 0.04);
  }

  .hero__gradient-mesh {
    background:
      radial-gradient(ellipse at 15% 80%, rgba(30, 64, 175, 0.12) 0%, transparent 50%),
      radial-gradient(ellipse at 85% 20%, rgba(91, 33, 182, 0.08) 0%, transparent 40%),
      radial-gradient(ellipse at 55% 50%, rgba(6, 95, 70, 0.05) 0%, transparent 45%);
  }

  .hero .btn--primary {
    background: var(--color-white);
    color: var(--color-black);
    border-color: var(--color-white);
  }

  .hero .btn--primary:hover {
    background: var(--color-gray-200);
    border-color: var(--color-gray-200);
  }

  .page--home .header .nav__link {
    color: rgba(255, 255, 255, 0.75);
  }

  .page--home .header .nav__link:hover,
  .page--home .header .nav__link--active {
    color: var(--color-white);
    border-bottom-color: var(--color-white);
  }

  .page--home .header .nav__toggle {
    color: var(--color-white);
  }

  /* Video hero: keep solid header in dark mode */
  .page--home-video .header {
    background: var(--color-bg);
    border-bottom-color: var(--color-border);
  }

  .page--home-video .header .nav__link {
    color: var(--color-text);
  }

  .page--home-video .header .nav__link:hover,
  .page--home-video .header .nav__link--active {
    color: var(--color-motriu-mid);
    border-bottom-color: var(--color-motriu-mid);
  }

  .page--home-video .header .nav__toggle {
    color: var(--color-text);
  }

  .service-card--featured {
    background: #0a0c10;
    border-color: #2a2d35;
  }

  .cta-banner {
    background: #0f1117;
  }

  .cta-banner__title {
    color: var(--color-white);
  }

  .cta-banner__text {
    color: var(--color-gray-400);
  }

  .cta-banner__chevrons {
    color: rgba(255, 255, 255, 0.03);
  }

  .cta-banner .btn--primary {
    background: var(--color-white);
    color: var(--color-black);
    border-color: var(--color-white);
  }

  .footer {
    background: #0a0c10;
    color: var(--color-gray-400);
  }

  .footer a {
    color: var(--color-gray-400);
  }

  .footer a:hover {
    color: var(--color-white);
  }

  .footer__heading {
    color: var(--color-white);
  }

  .footer__bar {
    border-top-color: #1a1d25;
  }

  .footer__bar,
  .footer__bar a {
    color: var(--color-gray-600);
  }

  .footer__bar a:hover {
    color: var(--color-gray-400);
  }

  .highlight-box {
    background: rgba(30, 64, 175, 0.12);
  }

  .phase::before {
    background: var(--color-white);
    color: var(--color-black);
  }

  .btn--primary {
    background: var(--color-white);
    color: var(--color-black);
    border-color: var(--color-white);
  }

  .btn--primary:hover {
    background: var(--color-gray-200);
    border-color: var(--color-gray-200);
  }

  .btn--secondary {
    color: var(--color-white);
    border-color: var(--color-white);
  }

  .btn--secondary:hover {
    background: var(--color-white);
    color: var(--color-black);
  }

  .client-logo:hover {
    background: rgba(255, 255, 255, 0.03);
  }

  .filter-bar__btn {
    border-color: #2a2d35;
    color: #a3a3a3;
  }

  .filter-bar__btn:hover {
    border-color: #555;
    color: #e4e4e4;
  }

  .filter-bar__count {
    background: rgba(255, 255, 255, 0.08);
  }

  .project-card__tag--auditoria {
    background: rgba(30, 64, 175, 0.15);
    color: #93b4f4;
  }

  .project-card__tag--pla {
    background: rgba(6, 95, 70, 0.15);
    color: #6ee7b7;
  }

  .project-card__tag--certificacio {
    background: rgba(91, 33, 182, 0.15);
    color: #c4b5fd;
  }

  .project-card__tag--formacio {
    background: rgba(146, 64, 14, 0.15);
    color: #fcd34d;
  }

  .project-card__tag--consultoria {
    background: rgba(157, 23, 77, 0.15);
    color: #fda4af;
  }

  .project-card__tag--tecnologia {
    background: rgba(55, 48, 163, 0.15);
    color: #a5b4fc;
  }

  .cases-slider::-webkit-scrollbar-thumb {
    background: var(--color-gray-600);
  }

  .cases-slider::-webkit-scrollbar-thumb:hover {
    background: var(--color-gray-500);
  }
}


/* ----------------------------------------------------------
   31. PRINT STYLES
   ---------------------------------------------------------- */
@media print {
  .header,
  .footer,
  .skip-link,
  .nav__toggle,
  .hero__bg,
  .hero__chevrons,
  .hero__grain,
  .hero__gradient-mesh,
  .mvac-bar,
  .cta-banner__chevrons {
    display: none !important;
  }

  body {
    font-size: 12pt;
    color: #000;
    background: #fff;
  }

  a {
    color: #000;
    text-decoration: underline;
  }

  .hero {
    background: #fff;
    color: #000;
    min-height: auto;
    padding: 2rem 0;
  }

  .hero__title,
  .hero__eyebrow,
  .hero__subtitle {
    color: #000;
  }

  .section {
    padding: 1.5rem 0;
    break-inside: avoid;
  }

  .service-card--featured {
    background: #fff;
    color: #000;
  }

  .service-card--featured .service-card__title,
  .service-card--featured .service-card__text {
    color: #000;
  }
}
