:root {
  --blue-950: #102241;
  --blue-900: #19305a;
  --blue-800: #203f73;
  --blue-600: #4472ca;
  --cyan-500: #62c5d8;
  --ink: #15233d;
  --muted: #687287;
  --paper: #ffffff;
  --soft: #f3f6fb;
  --soft-blue: #e9f0fb;
  --line: rgba(25, 48, 90, 0.14);
  --shadow: 0 20px 55px rgba(21, 35, 61, 0.15);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Montserrat, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  line-height: 1.65;
  overflow-x: hidden;
}

body.menu-open {
  overflow: hidden;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
}

h1,
h2,
h3,
h4,
h5,
h6,
button,
input,
select,
textarea {
  font-family: inherit;
}

.site-header {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 20;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 68px;
  padding: 10px clamp(18px, 4vw, 46px);
  background: rgba(16, 34, 65, 0.12);
  transition: background 180ms ease, box-shadow 180ms ease, min-height 180ms ease;
}

.site-header.is-scrolled,
.site-header.is-open {
  min-height: 58px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 10px 34px rgba(25, 48, 90, 0.12);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  min-width: 122px;
  position: relative;
  width: clamp(126px, 14vw, 188px);
  height: 100%;
}

.brand img {
  position: absolute;
  left: 0;
  top: 50%;
  width: 100%;
  height: auto;
  transform: translateY(-50%);
  transition: opacity 180ms ease;
}

/* Ensure logo is vertically centered inside the fixed header */
.brand {
  height: 100%;
}

.brand img {
  display: block;
  margin: 0;
  align-self: center;
}

.logo-dark {
  opacity: 0;
}

.site-header.is-scrolled .logo-dark,
.site-header.is-open .logo-dark {
  opacity: 1;
}

.site-header.is-scrolled .logo-light,
.site-header.is-open .logo-light {
  opacity: 0;
}

.legal-page .logo-light {
  opacity: 0;
}

.legal-page .logo-dark {
  opacity: 1;
}

:root[data-theme="dark"] .logo-light,
:root[data-theme="dark"] .site-header.is-scrolled .logo-light,
:root[data-theme="dark"] .site-header.is-open .logo-light {
  opacity: 1;
}

:root[data-theme="dark"] .logo-dark,
:root[data-theme="dark"] .site-header.is-scrolled .logo-dark,
:root[data-theme="dark"] .site-header.is-open .logo-dark {
  opacity: 0;
}

:root[data-theme="dark"] .legal-page .logo-light {
  opacity: 1;
}

:root[data-theme="dark"] .legal-page .logo-dark {
  opacity: 0;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(10px, 1.5vw, 22px);
  font-weight: 700;
  font-size: 13px;
  color: #ffffff;
}

.site-header.is-scrolled .site-nav,
.site-header.is-open .site-nav {
  color: var(--blue-900);
}

.site-nav a,
.footer-column a {
  text-decoration: none;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  white-space: nowrap;
  transition: background 180ms ease, box-shadow 180ms ease, color 180ms ease, opacity 180ms ease;
}

.site-nav a.is-active {
  color: var(--blue-950);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 8px 22px rgba(16, 34, 65, 0.08);
  opacity: 1;
}

.site-header.is-scrolled .site-nav a.is-active,
.site-header.is-open .site-nav a.is-active {
  color: #ffffff;
  background: var(--blue-900);
}

.site-nav a:hover,
.footer-column a:hover {
  opacity: 0.82;
}

.language-switcher {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}

.site-header.is-scrolled .language-switcher,
.site-header.is-open .language-switcher {
  border-color: var(--line);
  background: var(--soft);
}

.language-switcher button {
  min-height: 30px;
  padding: 0 10px;
  color: #ffffff;
  border: 0;
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.site-header.is-scrolled .language-switcher button,
.site-header.is-open .language-switcher button {
  color: var(--blue-900);
}

.language-switcher button.is-active {
  color: var(--blue-950);
  background: #ffffff;
}

.site-header.is-scrolled .language-switcher button.is-active,
.site-header.is-open .language-switcher button.is-active {
  color: #ffffff;
  background: var(--blue-900);
}

.menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  padding: 10px;
  color: #ffffff;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.menu-toggle span {
  display: block;
  height: 2px;
  margin: 6px 0;
  background: currentColor;
}

.hero {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  background: var(--blue-900);
}

.hero {
  /* make the hero span the full viewport width (full-bleed) */
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
}

.hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover; /* fill the area */
  object-position: center center;
  background: transparent;
  transform: none;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(16, 34, 65, 0.42), rgba(16, 34, 65, 0.16) 45%, rgba(16, 34, 65, 0.34)),
    radial-gradient(circle at 50% 45%, rgba(68, 114, 202, 0.14), transparent 42%);
}

.hero-content {
  position: relative;
  z-index: 1;
  display: grid;
  min-height: 100vh;
  place-items: center;
  align-content: center;
  padding: 112px 24px 70px;
  text-align: center;
}

.hero-kicker,
.section-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  margin: 0 auto 16px;
  padding: 8px 14px;
  color: var(--blue-950);
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(25, 48, 90, 0.12);
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero-kicker {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(10px);
}

.section-dark .section-label {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.16);
}

.hero h1 {
  max-width: 1020px;
  margin: 0;
  color: #ffffff;
  font-size: clamp(2rem, 5vw, 4rem);
  font-weight: 500;
  line-height: 1.22;
  text-shadow: 7px 7px 10px rgba(0, 0, 0, 0.72);
}

.hero-subtitle {
  margin: 16px 0 0;
  color: rgba(255, 255, 255, 0.9);
  font-size: clamp(1.1rem, 2.6vw, 2rem);
  font-weight: 500;
  line-height: 1.4;
  text-shadow: 6px 6px 10px rgba(0, 0, 0, 0.6);
}

.section {
  padding: clamp(74px, 9vw, 118px) 0;
}

.section-dark {
  color: #ffffff;
  background:
    linear-gradient(145deg, rgba(98, 197, 216, 0.08), transparent 42%),
    var(--blue-900);
}

#equip {
  position: relative;
  overflow: hidden;
}

#equip::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("assets/ofi.png") center/cover no-repeat;
  opacity: 0.09;
  filter: saturate(0.7) brightness(1.08) contrast(0.92);
  pointer-events: none;
}

#equip .container {
  position: relative;
  z-index: 1;
}

.section-light {
  background: var(--paper);
}

.section-services {
  background: linear-gradient(180deg, #ffffff 0%, #f7f9fd 100%);
}

.projects {
  background: linear-gradient(180deg, #ffffff 0%, #f6f8fc 100%);
}

.contact {
  color: #ffffff;
  background: linear-gradient(180deg, #ffffff 0%, #f6f8fc 100%);
}

.contact h2 {
  color: #ffffff;
}

.container {
  width: min(1102px, calc(100% - 42px));
  margin: 0 auto;
}

h2 {
  margin: 0 0 42px;
  text-align: center;
  font-size: clamp(2rem, 4.2vw, 3rem);
  line-height: 1.12;
  font-weight: 650;
}

h3,
h4,
p {
  margin-top: 0;
}

.section-label {
  text-align: center;
}

.two-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(26px, 5vw, 58px);
  font-size: 1.03rem;
}

.two-columns p {
  margin-bottom: 0;
}

.values h3 {
  grid-column: 1 / -1;
  width: 100%;
  margin: 10px 0 0;
  margin-top: 25px;
  padding: 0;
  text-align: center;
  font-size: clamp(2rem, 3.2vw, 2.5rem);
  line-height: 1.25;
  color: var(--blue-950);
}

.values {
  padding-top: 14px;
  padding-bottom: 96px;
  background: linear-gradient(180deg, #f7f9fd 0%, #edf3fa 100%);
}

.value-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 26px;
}

.value-item {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  align-items: center;
  gap: 20px;
  min-height: 184px;
  padding: 24px 26px;
  text-align: left;
  background: linear-gradient(180deg, #ffffff 0%, #fafcff 100%);
  border: 1px solid rgba(25, 48, 90, 0.08);
  border-radius: 22px;
  box-shadow: 0 10px 28px rgba(25, 48, 90, 0.07);
  cursor: default;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.value-item--top {
  grid-column: span 2;
}

.value-item--bottom {
  grid-column: span 3;
  min-height: 198px;
  padding: 26px 30px;
}

.value-item::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--blue-900), var(--cyan-500));
}

.value-item:hover {
  transform: none;
  box-shadow: 0 10px 28px rgba(25, 48, 90, 0.07);
  border-color: rgba(25, 48, 90, 0.08);
  background: linear-gradient(180deg, #ffffff 0%, #fafcff 100%);
}

.value-icon {
  display: grid;
  place-items: center;
  width: 88px;
  height: 88px;
  border-radius: 24px;
  background: linear-gradient(180deg, #f4f7fc 0%, #edf2f9 100%);
  color: var(--blue-900);
  box-shadow: inset 0 0 0 1px rgba(25, 48, 90, 0.04);
}

.value-icon svg {
  width: 44px;
  height: 44px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.value-item h4 {
  margin: 0;
  color: var(--ink);
  font-size: 1.1rem;
  line-height: 1.5;
  font-weight: 680;
  max-width: none;
}

.service-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 28px;
}

/* Projects section */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 28px;
}

@media (max-width: 1024px) {
  .projects-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

/* Reduce gap specifically between Projects and Contact sections */
#proyectos {
  padding-bottom: 52px;
}

#contacte {
  padding-top: 52px;
}

@media (max-width: 1024px) {
  #proyectos { padding-bottom: 28px; }
  #contacte { padding-top: 28px; }
}

@media (max-width: 820px) {
  #proyectos { padding-bottom: 22px; }
  #contacte { padding-top: 22px; }
}

@media (max-width: 540px) {
  #proyectos { padding-bottom: 18px; }
  #contacte { padding-top: 18px; }
}

.project-card {
  overflow: hidden;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 12px 28px rgba(25, 48, 90, 0.06);
  display: flex;
  flex-direction: column;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.project-card:hover {
  transform: translateY(-4px);
  border-color: rgba(25, 48, 90, 0.22);
  box-shadow: 0 20px 44px rgba(25, 48, 90, 0.12);
}

.project-card img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  background: var(--soft);
}

.project-body {
  padding: 18px;
}

.project-body h3 {
  margin: 0 0 8px;
  color: var(--blue-900);
  font-size: 1.05rem;
}

.project-body p {
  margin: 0;
  color: var(--muted);
}

.service-card {
  grid-column: span 2;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 12px 28px rgba(25, 48, 90, 0.08);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.service-card:hover {
  transform: translateY(-4px);
  border-color: rgba(25, 48, 90, 0.22);
  box-shadow: 0 20px 44px rgba(25, 48, 90, 0.14);
}

.service-wide {
  grid-column: span 3;
}

.service-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: var(--soft);
}

.service-card div {
  padding: 24px;
}

.service-card h3 {
  margin-bottom: 10px;
  color: var(--blue-900);
  font-size: 1.35rem;
  line-height: 1.2;
}

.service-card p {
  margin-bottom: 0;
  color: var(--muted);
}

.service-carousel-dots {
  display: none;
}

.service-carousel-shell {
  position: relative;
}

.service-carousel-arrows {
  display: none;
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 28px;
}

.team-card {
  padding: 28px 18px;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.045);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.team-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.32);
  box-shadow: 0 20px 40px rgba(16, 34, 65, 0.28);
}
.team-card h3 {
  min-height: 58px;
  margin-bottom: 18px;
  font-size: 1.08rem;
  line-height: 1.25;
}

.team-card img {
  width: min(210px, 82%);
  margin: 0 auto 18px;
  border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, 0.18);
}

.team-card p {
  margin: 0;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.95rem;
  line-height: 1.45;
}

.contact-grid {
  display: grid;
  grid-template-columns: minmax(300px, 0.78fr) minmax(0, 1.22fr);
  gap: 40px;
  align-items: start;
}

.contact .container {
  width: min(1280px, calc(100% - 42px));
}

.contact-stack {
  display: grid;
  gap: 24px;
  align-content: start;
}

.office-photo {
  width: 100%;
  height: 100%;
  min-height: 620px;
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.contact-panel {
  overflow: visible;
  display: grid;
  align-content: start;
  gap: 18px;
  padding: 0; /* no panel background; map will sit flush */
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.contact-box {
  padding: 18px;
  color: #ffffff;
  background: var(--blue-900);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.contact-stack .office-photo {
  min-height: 620px;
}

.contact-stack .contact-box {
  min-height: 100%;
}

.contact-panel .map {
  min-height: 360px;
  border: 0;
  border-radius: 14px;
  box-shadow: none;
  background: transparent; /* transparent map container */
}

.contact-panel .contact-box {
  border-top: 0;
}

.contact-box h3 {
  margin-bottom: 22px;
  font-size: 1.55rem;
  line-height: 1.2;
  color: #ffffff;
}

.contact-box ul {
  display: grid;
  gap: 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.contact-box span {
  display: block;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
}

.contact-box a {
  text-decoration: none;
  color: #ffffff;
}

.contact-box a:hover {
  text-decoration: underline;
}

.map {
  width: 100%;
  min-height: 360px;
  border: 0;
  border-radius: 14px;
  box-shadow: none;
  background: transparent;
}

.map:hover {
  transform: translateY(-2px);
}

.contact-grid .map {
  align-self: start;
}

.site-footer {
  color: #ffffff;
  background:
    linear-gradient(135deg, rgba(98, 197, 216, 0.12), transparent 35%),
    var(--blue-950);
}

.footer-main {
  display: grid;
  grid-template-columns: minmax(220px, 1.25fr) repeat(3, minmax(150px, 0.75fr));
  gap: clamp(28px, 5vw, 62px);
  width: min(1180px, calc(100% - 42px));
  margin: 0 auto;
  padding: 58px 0 42px;
}

.footer-brand img {
  width: 220px;
  margin-bottom: 20px;
  filter: brightness(0) invert(1);
}

.footer-brand p {
  max-width: 360px;
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.76);
}

.footer-column {
  display: grid;
  align-content: start;
  gap: 10px;
}

.footer-column h3 {
  margin: 0 0 10px;
  color: rgba(255, 255, 255, 0.94);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.footer-column a,
.footer-column span,
.footer-link-button {
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.95rem;
}

.footer-link-button {
  width: fit-content;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.footer-link-button:hover {
  color: #ffffff;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  width: min(1180px, calc(100% - 42px));
  margin: 0 auto;
  padding: 20px 0 26px;
  color: rgba(255, 255, 255, 0.68);
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 0.9rem;
}

.back-to-top {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 10;
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  color: #ffffff;
  background: var(--blue-900);
  border-radius: 50%;
  box-shadow: var(--shadow);
  text-decoration: none;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.back-to-top.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 500ms ease, transform 500ms ease;
}

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

.button {
  min-height: 42px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 750;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease, color 160ms ease, border-color 160ms ease;
}

.button-primary {
  color: #ffffff;
  background: var(--blue-600);
}

.button-primary:hover {
  background: var(--blue-800);
  box-shadow: 0 12px 28px rgba(32, 63, 115, 0.24);
  transform: translateY(-1px);
}

.button-secondary {
  color: var(--blue-900);
  background: #ffffff;
  border-color: var(--line);
}

.button-secondary:hover {
  background: #eef2f8;
  border-color: rgba(25, 48, 90, 0.2);
  transform: translateY(-1px);
}

.cookie-banner {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 40;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 22px;
  width: min(760px, calc(100% - 36px));
  padding: 22px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 22px 70px rgba(16, 34, 65, 0.24);
}

.cookie-banner[hidden],
.cookie-modal[hidden] {
  display: none;
}

.cookie-copy h2 {
  margin: 0 0 8px;
  text-align: left;
  font-size: 1.25rem;
}

.cookie-copy p {
  margin: 0 0 8px;
  color: var(--muted);
  line-height: 1.5;
}

.cookie-copy a {
  color: var(--blue-600);
  font-weight: 700;
  text-decoration: none;
}

.cookie-actions {
  display: flex;
  align-items: end;
  gap: 10px;
}

.cookie-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(16, 34, 65, 0.56);
}

.cookie-modal-panel {
  position: relative;
  width: min(620px, 100%);
  padding: 30px;
  background: #ffffff;
  border-radius: var(--radius);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.24);
}

.cookie-modal-panel h2 {
  margin: 0 0 10px;
  text-align: left;
  font-size: 1.7rem;
}

.cookie-modal-panel p {
  color: var(--muted);
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--soft);
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
}

.cookie-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
}

.cookie-option:last-of-type {
  border-bottom: 1px solid var(--line);
}

.cookie-option strong,
.cookie-option small {
  display: block;
}

.cookie-option small {
  color: var(--muted);
}

.cookie-option input {
  width: 22px;
  height: 22px;
  accent-color: var(--blue-600);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
}

.legal-page {
  background: var(--soft);
}

.legal-hero {
  padding: 130px 0 70px;
  color: #ffffff;
  background:
    linear-gradient(135deg, rgba(98, 197, 216, 0.18), transparent 42%),
    var(--blue-900);
}

/* Make header on legal pages more grey so logo contrasts better */
.legal-page .site-header {
  background: rgba(245, 247, 250, 0.96);
  color: var(--blue-900);
  border-bottom: 1px solid var(--line);
}

.legal-page .site-header .site-nav a {
  color: var(--blue-900);
}

.legal-page .menu-toggle,
.legal-page .site-header.is-scrolled .menu-toggle,
.legal-page .site-header.is-open .menu-toggle {
  color: var(--blue-900);
}

.legal-page .language-switcher {
  border-color: var(--line);
  background: var(--soft);
}

.legal-page .language-switcher button {
  color: var(--blue-900);
}

.legal-page .language-switcher button:hover {
  background: rgba(25, 48, 90, 0.08);
  opacity: 1;
}

.legal-page .language-switcher button.is-active {
  color: #ffffff;
  background: var(--blue-900);
}

.legal-page .language-switcher button.is-active:hover {
  background: var(--blue-800);
}

.legal-page .brand img {
  filter: none;
}

.legal-hero .container {
  max-width: 880px;
}

.legal-hero h1 {
  margin: 0 0 16px;
  font-size: clamp(2.2rem, 5vw, 4rem);
  line-height: 1.1;
}

.legal-hero p {
  max-width: 720px;
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.82);
}

.legal-content {
  width: min(880px, calc(100% - 42px));
  margin: -34px auto 90px;
  padding: clamp(26px, 5vw, 54px);
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  line-height: 1.7;
}

.legal-content h2 {
  margin: 34px 0 12px;
  text-align: left;
  font-size: 1.45rem;
}

.legal-content h2:first-child {
  margin-top: 0;
}

.legal-content p,
.legal-content li {
  color: var(--muted);
}

@media (max-width: 1140px) {
  .site-header {
    align-items: flex-start;
  }

  .header-actions {
    flex-direction: column-reverse;
    align-items: flex-end;
    gap: 10px;
  }

  .legal-page .site-header {
    align-items: center;
  }

  .legal-page .menu-toggle {
    display: block;
  }

  .legal-page .site-header.is-scrolled .menu-toggle,
  .legal-page .site-header.is-open .menu-toggle {
    color: var(--blue-900);
  }

  .legal-page .header-actions {
    position: absolute;
    top: 100%;
    right: 18px;
    left: 18px;
    align-items: stretch;
    display: grid;
    gap: 12px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.98);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
  }

  .legal-page .header-actions.is-open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .legal-page .site-nav {
    display: grid;
    gap: 0;
    color: var(--blue-900);
  }

  .legal-page .site-nav a {
    padding: 13px 12px;
  }

  .legal-page .language-switcher {
    justify-content: center;
    border-color: var(--line);
    background: var(--soft);
  }

  .legal-page .language-switcher button {
    color: var(--blue-900);
  }

  .legal-page .language-switcher button.is-active {
    color: #ffffff;
    background: var(--blue-900);
  }
}

@media (max-width: 1024px) {
  .menu-toggle {
    color: #ffffff;
  }

  .site-header.is-scrolled .menu-toggle,
  .site-header.is-open .menu-toggle {
    color: var(--blue-900);
  }

  .language-switcher button {
    color: var(--blue-900);
  }

  .language-switcher button.is-active {
    color: var(--blue-900);
    background: rgba(25, 48, 90, 0.08);
  }

  .site-header.is-scrolled .language-switcher button,
  .site-header.is-open .language-switcher button {
    color: var(--blue-900);
  }

  .site-header.is-scrolled .language-switcher button.is-active,
  .site-header.is-open .language-switcher button.is-active {
    color: var(--blue-900);
    background: rgba(25, 48, 90, 0.12);
  }

  .value-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .value-item {
    grid-column: auto;
    grid-template-columns: 82px minmax(0, 1fr);
    min-height: 176px;
    padding: 22px;
  }

  .value-item--top,
  .value-item--bottom {
    grid-column: auto;
    min-height: 0;
    padding: 22px;
  }

  .value-icon {
    width: 82px;
    height: 82px;
  }

  .value-icon svg {
    width: 40px;
    height: 40px;
  }

  .service-card,
  .service-wide {
    grid-column: span 3;
  }

  .team-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .contact-grid {
    grid-template-columns: minmax(280px, 0.88fr) minmax(0, 1.12fr);
    gap: 28px;
  }

  .contact-panel {
    padding: 8px;
    gap: 12px;
  }

  .contact-box {
    padding: 20px;
  }

  .contact-box h3 {
    font-size: 1.35rem;
  }

  .map {
    min-height: 300px;
  }

  .office-photo {
    min-height: 420px;
  }

  /* Tablet: reduce logo size so header doesn't break layout */

  /* Tablet: show hamburger and hide inline language buttons so
     the hamburger opens the language popover (three bars -> idiomas) */
  @media (min-width: 821px) and (max-width: 1024px) {
    .menu-toggle {
      display: block;
      color: #ffffff;
    }

    .language-switcher {
      display: none;
    }

    /* ensure the popover styles apply when opened by the toggle */
    .language-switcher.is-open {
      display: flex;
      position: absolute;
      top: calc(100% + 8px);
      right: 18px;
      background: #ffffff;
      color: var(--blue-900);
      padding: 8px;
      border-radius: 10px;
      box-shadow: 0 10px 30px rgba(16,34,65,0.12);
      z-index: 60;
      flex-direction: column;
    }
  }

  /* Tablet: place menu-toggle at the extreme right and let the brand expand */
  .site-header {
    padding-right: 18px; /* keep compact padding; toggle will be absolute */
    padding-left: 18px; /* ensure balanced spacing so logo sits correctly */
  }

  .site-header .header-actions {
    margin-right: 72px; /* give space for the absolute toggle */
  }

  .menu-toggle {
    display: block;
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 70;
    color: #ffffff;
  }

.brand {
  display: inline-flex;
  align-items: center;
  min-width: 122px;
  position: relative;
  width: clamp(126px, 14vw, 188px);
  height: 58px;
  flex: 0 0 auto;
  overflow: visible;
}

.brand img {
  position: absolute;
  left: 0;
  top: 50%;
  width: 100%;
  height: auto;
  max-width: none;
  transform: translateY(-50%);
  transition: opacity 180ms ease;
}

/* Ensure logo is vertically centered inside the fixed header */
.brand {
  height: 58px;
}

  .footer-main {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 821px) and (max-width: 1024px) {
  .site-header {
    align-items: center;
  }

  .brand {
    align-items: center;
  }
}

@media (max-width: 820px) {
  .site-header {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    width: 100%;
    align-items: center;
    z-index: 120;
    min-height: 72px;
  }

   .brand img {
    width: 100%;
    max-width: none;
    height: auto;
  }

  .site-header .header-actions {
    margin-right: 0;
  }

  .menu-toggle {
    display: block;
    position: relative;
    right: auto;
    top: auto;
    transform: none;
    margin-left: auto;
    flex: 0 0 auto;
  }

  .site-header.is-scrolled .menu-toggle,
  .site-header.is-open .menu-toggle {
    color: var(--blue-900);
  }

  .header-actions {
    position: absolute;
    top: 100%;
    right: max(12px, env(safe-area-inset-right));
    left: max(12px, env(safe-area-inset-left));
    align-items: stretch;
    display: grid;
    gap: 12px;
    padding: 12px;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-right: 0;
    max-width: calc(100vw - 24px);
    width: auto;
    overflow: hidden;
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    z-index: 80;
  }

  .header-actions.is-open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .site-nav {
    display: grid;
    gap: 0;
    color: var(--blue-900);
    min-width: 0;
    width: 100%;
  }

  .site-nav a {
    display: block;
    width: 100%;
    min-width: 0;
    padding: 13px 12px;
    border-radius: 12px;
    white-space: normal;
  }

  .site-nav a.is-active {
    box-shadow: none;
  }

  .language-switcher {
    width: 100%;
    min-width: 0;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: center;
    justify-content: stretch;
    border-color: var(--line);
    background: var(--soft);
    gap: 4px;
  }

  .language-switcher button {
    min-width: 0;
    width: 100%;
    padding: 0 8px;
    font-size: 0.88rem;
    white-space: nowrap;
    color: var(--blue-900);
  }

  .language-switcher button.is-active {
    color: #ffffff;
    background: var(--blue-900);
  }

  .two-columns,
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .contact-stack {
    gap: 18px;
  }

  .office-photo {
    min-height: 320px;
  }

  .contact-panel {
    padding: 10px;
    gap: 10px;
  }

  /* Mobile: make contact box visually compact and rounded */
  .contact-box {
    padding: 18px;
    border-radius: 14px;
    margin: 0 12px;
    box-shadow: 0 10px 30px rgba(16,34,65,0.12);
  }

  .contact-stack .office-photo {
    min-height: 220px;
    border-radius: 12px;
  }

  .contact-stack .contact-box {
    min-height: auto;
    margin-bottom: 8px;
  }

  .contact-panel .map {
    border-radius: 14px;
    box-shadow: var(--shadow);
    overflow: hidden;
  }

  /* Ensure header stays usable on tablet sizes by keeping language visible */
  .language-switcher {
    display: flex;
    gap: 8px;
  }

  /* Tablet: position language switcher as a small popover when opened via the menu-toggle */
  .language-switcher.is-open {
    position: absolute;
    top: calc(100% + 8px);
    right: 18px;
    background: #ffffff;
    color: var(--blue-900);
    padding: 8px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(16,34,65,0.12);
    z-index: 60;
    display: flex;
    flex-direction: column;
  }

  .language-switcher.is-open button {
    color: var(--blue-900);
    background: transparent;
    padding: 6px 10px;
    border-radius: 8px;
    text-align: left;
  }

  .contact-grid {
    grid-template-columns: 1fr;
  }

  .contact-box h3 {
    font-size: 1.2rem;
  }

  .map {
    min-height: 280px;
  }

  .value-grid {
    grid-template-columns: 1fr;
  }

  .value-item {
    grid-template-columns: 70px minmax(0, 1fr);
    min-height: 0;
    padding: 20px;
  }

  .value-item--top,
  .value-item--bottom {
    grid-column: auto;
  }

  .value-icon {
    width: 70px;
    height: 70px;
  }

  .value-icon svg {
    width: 34px;
    height: 34px;
  }

  .service-card,
  .service-wide {
    grid-column: 1 / -1;
  }

  .section-services .service-grid {
      display:flex;
      gap:14px;
      overflow-x:auto;
      scroll-snap-type:x mandatory;
      padding: 10px 20px;
  }

  /* Carousel visual polish */
  :root {
    --card-radius: 12px;
    --card-shadow: 0 6px 20px rgba(17, 24, 39, 0.08);
    --card-shadow-active: 0 12px 36px rgba(17, 24, 39, 0.12);
    --accent: #243b6b;
  }

  .section-services .service-card {
    background: #fff;
    border-radius: var(--card-radius);
    overflow: hidden;
    box-shadow: var(--card-shadow);
    transition: transform 300ms cubic-bezier(.2,.8,.2,1), box-shadow 300ms;
    will-change: transform;
    display:flex;
    flex-direction:column;
  }

  .section-services .service-card img {
    width:100%;
    height:200px;
    object-fit:cover;
    display:block;
  }

  .section-services .service-card .card-content {
    padding: 18px;
    flex:1;
  }

  .section-services .service-card.active {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--card-shadow-active);
  }

  @media (prefers-reduced-motion: reduce) {
    .section-services .service-card,
    .service-carousel-dot,
    .service-carousel-prev,
    .service-carousel-next {
      transition: none !important;
      transform: none !important;
    }
  }

  .service-carousel-arrows button {
    width:44px;
    height:44px;
    border-radius:50%;
    background: rgba(255,255,255,0.95);
    border: none;
    display:flex;
    align-items:center;
    justify-content:center;
    box-shadow: 0 6px 18px rgba(17,24,39,0.12);
    transition: transform 180ms, opacity 180ms;
    opacity: 0.95;
  }
  .service-carousel-arrows button:hover {
    transform: translateY(-2px);
    opacity:1;
  }
  .service-carousel-prev { left: 18px; }
  .service-carousel-next { right: 18px; }

  .service-carousel-dots {
    display:flex;
    gap:8px;
    justify-content:center;
    align-items:center;
    margin-top:12px;
  }
  .service-carousel-dot {
    width:9px;
    height:9px;
    border-radius:50%;
    background: rgba(36,59,107,0.18);
    transition: transform 220ms, background 220ms, opacity 220ms;
    opacity:0.9;
  }
  .service-carousel-dot[aria-current="true"] {
    background: var(--accent);
    transform: scale(1.45);
    opacity:1;
  }
  .section-services .service-grid::before,
  .section-services .service-grid::after {
    content: "";
    flex: 0 0 calc((100% - min(68vw, 280px)) / 2);
  }

  .section-services .service-grid::-webkit-scrollbar {
    display: none;
  }

  .section-services .service-card,
  .section-services .service-wide {
    flex: 0 0 min(68vw, 280px);
    max-width: 280px;
    grid-column: auto;
    scroll-snap-align: center;
    scroll-snap-stop: always;
  }

  .section-services .service-card div {
    padding: 16px;
  }

  .section-services .service-card h3 {
    font-size: 1.08rem;
  }

  .section-services .service-card p {
    font-size: 0.96rem;
    line-height: 1.5;
  }

  .section-services {
    overflow-x: clip;
  }

  .service-carousel-arrows {
    position: absolute;
    inset: 0;
    display: block;
    pointer-events: none;
  }

  .service-carousel-arrow {
    position: absolute;
    top: calc(50% - 17px);
    z-index: 2;
    pointer-events: auto;
  }

  .service-carousel-prev {
    left: 8px;
  }

  .service-carousel-next {
    right: 8px;
  }

  .service-carousel-dots {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 6px 0 0;
  }

  .service-carousel-dot {
    width: 10px;
    height: 10px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(25, 48, 90, 0.2);
    cursor: pointer;
    transition: transform 160ms ease, background 160ms ease, width 160ms ease;
  }

  .service-carousel-dot.is-active {
    width: 26px;
    border-radius: 999px;
    background: var(--blue-900);
  }

  .service-carousel-dot:focus-visible {
    outline: 2px solid var(--blue-600);
    outline-offset: 2px;
  }

  .service-carousel-arrow {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid rgba(25, 48, 90, 0.14);
    border-radius: 999px;
    color: var(--blue-900);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 8px 20px rgba(25, 48, 90, 0.08);
    cursor: pointer;
    font-size: 22px;
    line-height: 1;
    transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
  }

  .service-carousel-arrow:hover {
    transform: translateY(-1px);
    background: #ffffff;
    border-color: rgba(25, 48, 90, 0.22);
  }

  .service-carousel-arrow:focus-visible {
    outline: 2px solid var(--blue-600);
    outline-offset: 2px;
  }

  .footer-main,
  .site-footer {
    grid-template-columns: 1fr;
  }

  .footer-bottom,
  .cookie-banner {
    grid-template-columns: 1fr;
  }

  .footer-bottom {
    display: grid;
  }

  .cookie-actions,
  .modal-actions {
    flex-wrap: wrap;
  }
}

@media (max-width: 540px) {
  .site-header {
    min-height: 72px;
    padding-inline: 18px;
  }

  .header-actions {
    right: max(10px, env(safe-area-inset-right));
    left: max(10px, env(safe-area-inset-left));
    max-width: calc(100vw - 20px);
    padding: 10px;
    gap: 10px;
  }

  .site-nav a {
    padding: 11px 10px;
    font-size: 0.95rem;
  }

  .language-switcher {
    gap: 4px;
    padding: 6px;
  }

  .language-switcher button {
    min-height: 34px;
    padding: 0 6px;
    font-size: 0.8rem;
  }

  .brand img {
    width: 100%;
    max-width: none;
    height: auto;
  }
  .hero-content {
    padding-inline: 18px;
  }

  .hero h1 {
    font-size: 2rem;
    line-height: 1.28;
  }

  .value-grid,
  .team-grid {
    grid-template-columns: 1fr;
  }

  .value-item {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
    min-height: auto;
    padding: 24px 20px 22px;
  }

  .value-item img {
    width: 96px;
    height: 96px;
  }

  .service-card div,
  .cookie-modal-panel {
    padding: 22px;
  }

  .map {
    min-height: 300px;
  }

  .contact-panel .map {
    min-height: 280px;
  }

  .contact-box {
    padding: 18px 16px;
    border-radius: 16px;
    box-shadow: 0 16px 34px rgba(16, 34, 65, 0.2);
  }

  .contact-panel .contact-box {
    border-radius: 16px;
  }

  .office-photo {
    min-height: 280px;
  }

  .cookie-banner {
    right: 12px;
    bottom: 12px;
    width: calc(100% - 24px);
  }

  .button {
    width: 100%;
  }
}
.value-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.value-icon i {
  font-size: 30px;
  color: currentColor;
  line-height: 1;
}
.custom-icon {
  width: 32px;
  height: 32px;
  fill: none;
  stroke: currentColor;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}