:root {
  --graphite: #1c2321;
  --steel: #54605d;
  --coat: #ffffff;
  --glass: #e9efed;
  --brick: #8e2c27; /* fachada del Laboratorio Central de Luanda */
  --line: #cdd8d5;
  --display: "Marcellus", "Trajan Pro", Georgia, serif;
  --body: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
  --gap: clamp(1.5rem, 4vw, 4rem);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 5.5rem; }
body { margin: 0; font: 1.125rem/1.6 var(--body); color: var(--graphite); background: var(--coat); }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--brick); text-underline-offset: .2em; }
a:focus-visible, button:focus-visible { outline: 3px solid var(--brick); outline-offset: 3px; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; line-height: 1.15; margin: 0 0 .6em; text-wrap: balance; }
h1 { font-size: clamp(2.6rem, 7vw, 5.5rem); }
h2 { font-size: clamp(1.8rem, 3.5vw, 2.7rem); }
h3 { font-size: 1.35rem; }
p { margin: 0 0 1em; }
ul { margin: 0; padding: 0; list-style: none; }
address { font-style: normal; }

.wrap { width: min(74rem, 100% - 2.5rem); margin-inline: auto; }
.prose { max-width: 68ch; }
.link { font-weight: 600; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; z-index: 20; background: var(--coat); padding: .5rem 1rem; }

/* Cabecera */
.top { position: sticky; top: 0; z-index: 10; background: var(--graphite); color: var(--coat); }
.top-in { display: flex; align-items: center; gap: 1.5rem; min-height: 4.75rem; }
.brand { margin-right: auto; }
.brand img { height: 3.5rem; width: auto; }
.menu, .langs, .siblings { display: flex; flex-wrap: wrap; }
.menu { gap: 1.5rem; }
.top a { color: var(--coat); text-decoration: none; }
.menu a:hover { text-decoration: underline; }
.langs { gap: .25rem; font-size: .95rem; font-weight: 600; }
.langs a { display: block; padding: .15rem .45rem; border: 1px solid transparent; }
.langs a:hover { border-color: var(--steel); }
.langs a[aria-current] { background: var(--coat); color: var(--graphite); }
.top a:focus-visible, .burger:focus-visible, .hero a:focus-visible, .page-head a:focus-visible, .contact a:focus-visible { outline-color: var(--coat); }
.burger { display: none; font: 600 1rem var(--body); color: var(--coat); background: none; border: 1px solid var(--steel); padding: .35rem .8rem; cursor: pointer; }

/* Portada: el árbol es el protagonista */
.hero { background: var(--graphite); color: var(--coat); overflow: hidden; }
.hero-in { display: grid; grid-template-columns: 1.1fr 1fr; align-items: center; gap: var(--gap); padding-block: clamp(2rem, 5vw, 4rem); }
.hero h1 { letter-spacing: .01em; }
.hero p { font-size: clamp(1.25rem, 2.2vw, 1.7rem); line-height: 1.4; max-width: 26ch; margin-bottom: 2rem; }
.button { display: inline-block; padding: .75rem 1.6rem; background: var(--brick); color: var(--coat); font-weight: 600; text-decoration: none; }
.button:hover { background: #a8352f; }
.tree { width: min(38rem, 100%); justify-self: end; animation: grow 1.4s ease-out both; }
@keyframes grow { from { clip-path: inset(100% 0 0 0); } to { clip-path: inset(0 0 0 0); } }

/* Secciones */
.band { padding-block: clamp(3.5rem, 8vw, 6.5rem); }
.tint { background: var(--glass); }
.split { display: grid; grid-template-columns: 1fr 2fr; gap: 0 var(--gap); margin-bottom: 2.5rem; }
.lead p:first-child { font-size: 1.35rem; line-height: 1.5; }
.wide { width: 100%; margin-bottom: 2.5rem; border-bottom: 1px solid var(--line); }

.companies { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap); margin-top: 2rem; }
.companies img { height: 9rem; width: 100%; object-fit: contain; margin-bottom: 1.25rem; }
.companies h3 { border-top: 2px solid var(--brick); padding-top: .75rem; }

.areas li { border-top: 1px solid var(--line); }
.areas a { display: grid; grid-template-columns: 17rem 1fr; gap: var(--gap); align-items: center; padding-block: 1.5rem; color: inherit; text-decoration: none; }
.areas img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; background: var(--coat); }
.areas strong { display: block; font: 400 clamp(1.7rem, 3.5vw, 2.6rem)/1.15 var(--display); margin-bottom: .5rem; }
.areas span span { display: block; max-width: 62ch; color: var(--steel); }
.areas em { display: inline-block; margin-top: .6rem; font-style: normal; font-weight: 600; color: var(--brick); text-decoration: underline; text-underline-offset: .2em; }
.areas a:hover strong { color: var(--brick); }

.social { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); align-items: center; }

.projects { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); }
.projects a:has(img) { color: inherit; text-decoration: none; }
.projects img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; margin-bottom: 1.25rem; }
.projects h3 { font-size: 2rem; }

/* Páginas interiores */
.page-head { background: var(--graphite) url("../images/nexarglobal/header1.png") no-repeat right 4% top -2rem / 22rem; color: var(--coat); padding-top: clamp(3rem, 8vw, 6rem); }
.page-head h1 { margin-bottom: .3em; }
.page-head p { font-size: 1.35rem; max-width: 36ch; }
.siblings { gap: 0 1.75rem; margin-top: 2.5rem; }
.siblings a { display: block; padding-block: .8rem; color: var(--coat); text-decoration: none; border-bottom: 3px solid transparent; }
.siblings a:hover { border-color: var(--steel); }
.siblings a[aria-current] { border-color: var(--coat); }

article h2 { margin-top: 1.5em; }
.item { display: grid; grid-template-columns: 1fr 24rem; gap: var(--gap); align-items: start; padding-block: 2.5rem; border-top: 1px solid var(--line); }
.item h2 { margin-top: 0; }
.item img { width: 100%; }
.item + p { margin-top: 2rem; }
.sub { padding-left: clamp(0rem, 3vw, 2.5rem); }
.figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); gap: 1.5rem; margin-block: 2rem; max-width: 60rem; }
.figures img { width: 100%; height: 100%; object-fit: cover; }
.bullets { padding-left: 1.2rem; list-style: disc; }
.bullets li { margin-bottom: 1rem; }
.bullets li::marker { color: var(--brick); }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: .75rem; margin-bottom: 2.5rem; }
.gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.lightbox { border: 0; padding: .75rem; background: var(--graphite); max-width: min(70rem, 95vw); }
.lightbox::backdrop { background: rgb(12 16 15 / .85); }
.lightbox img { max-height: 78vh; margin-inline: auto; }
.lightbox form { display: flex; justify-content: center; gap: .75rem; margin-top: .75rem; }
.lightbox button { font: 600 1rem var(--body); padding: .45rem 1rem; background: var(--coat); color: var(--graphite); border: 0; cursor: pointer; }

/* Contacto y pie */
.contact { background: var(--brick); color: var(--coat); padding-block: clamp(3.5rem, 8vw, 6rem); }
.contact a { color: var(--coat); }
.mail { font: 400 clamp(1.7rem, 6vw, 4rem)/1.2 var(--display); margin-block: .5em .9em; overflow-wrap: anywhere; }
.contact-data { display: flex; flex-wrap: wrap; gap: var(--gap); border-top: 1px solid rgb(255 255 255 / .35); padding-top: 1.75rem; }
.contact-data h3 { font-size: 1.15rem; }
.foot { background: var(--graphite); color: var(--coat); font-size: 1rem; padding-block: 1.5rem; }
.foot-in { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; }
.foot p { margin: 0; }
.foot a { color: var(--coat); }

/* Selector de idioma de la raíz */
.chooser { background: var(--graphite); min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 2rem; }
.chooser ul { display: flex; gap: 1.5rem; }
.chooser a { color: var(--coat); }

@media (max-width: 62rem) {
  .burger { display: block; order: 3; }
  .top-in { flex-wrap: wrap; row-gap: 0; column-gap: .75rem; }
  .langs { order: 2; }
  #nav { order: 4; width: 100%; }
  .js #nav { display: none; }
  .js #nav.open { display: block; }
  .menu { flex-direction: column; gap: 0; padding-bottom: .75rem; }
  .menu a { display: block; padding-block: .55rem; border-top: 1px solid var(--steel); }
  .hero-in, .split, .social, .item, .projects { grid-template-columns: 1fr; }
  .tree { justify-self: center; width: min(26rem, 90%); }
  .companies { grid-template-columns: 1fr; }
  .item img { max-width: 30rem; }
  .areas a { grid-template-columns: 1fr; gap: 1rem; }
  .areas img { max-width: 30rem; }
  .page-head { background-size: 12rem; }
}

@media (max-width: 40rem) {
  .page-head { background-image: none; padding-top: 2rem; }
  .siblings { margin-top: 1.25rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .tree { animation: none; }
}
