/* ============================================================
   Root Energy México — Design System
   Palette derived from the corporate logo (ember / brick / amber)
   Type: Fraunces (display) · IBM Plex Sans (body) · IBM Plex Mono (labels)
   ============================================================ */

:root {
  /* Brand palette */
  --ember:   #E85D34;   /* coral-orange, the "ROOT" mark, primary accent */
  --ember-d: #D14a24;
  --brick:   #B23222;   /* deep brick red, the "ENERGY" mark */
  --brick-d: #8f271b;
  --amber:   #EEA320;   /* the sun rays, secondary accent */
  --amber-l: #F4B740;
  --label:   #B23222;   /* color for small labels / eyebrows / kickers (tunable knob) */

  /* Neutrals */
  --midnight: #141922;  /* dusk blue-charcoal, dark sections */
  --midnight-2: #1c2530;
  --ink:     #221C18;   /* primary text */
  --stone:   #2E2924;   /* body copy — kept dark/legible, close to ink */
  --stone-l: #8d847c;
  --sand:    #FAF6F0;   /* warm base */
  --sand-2:  #F1E9DE;   /* warm panel */
  --line:    #E4D8CB;   /* hairline on light */
  --line-d:  rgba(255,255,255,.14);
  --white:   #ffffff;

  /* Type — unified on a single family (IBM Plex Sans) across the whole site.
     --f-mono kept as a name for labels/eyebrows/buttons but points to the same face. */
  --f-display: "IBM Plex Sans", system-ui, sans-serif;
  --f-body: "IBM Plex Sans", system-ui, sans-serif;
  --f-mono: "IBM Plex Sans", system-ui, sans-serif;

  /* Rhythm */
  --pad-x: clamp(1.25rem, 5vw, 5rem);
  --sec-y: clamp(4.5rem, 9vw, 8.5rem);
  --maxw: 1240px;
  --radius: 4px;

  --ease: cubic-bezier(.22,.61,.36,1);
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  font-family: var(--f-body);
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  line-height: 1.65;
  color: var(--ink);
  background: var(--sand);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }

::selection { background: var(--ember); color: #fff; }

/* ---------- Typography ---------- */
h1, h2, h3, h4 {
  font-family: var(--f-body);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-wrap: balance;
}
.display {
  font-size: clamp(2.55rem, 1.6rem + 4.4vw, 5.1rem);
  line-height: 1.02;
  letter-spacing: -0.022em;
}
h2 { font-size: clamp(1.95rem, 1.3rem + 2.6vw, 3.25rem); }
h3 { font-size: clamp(1.28rem, 1.05rem + 1vw, 1.7rem); }
p { text-wrap: pretty; }
strong { font-weight: 600; color: var(--ink); }

.eyebrow {
  font-family: var(--f-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--label);
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}

.eyebrow::before {
  content: "";
  width: 1.6rem; height: 2px;
  background: var(--label);
  display: inline-block;
}
.eyebrow.on-dark { color: var(--amber-l); }
.eyebrow.on-dark::before { background: var(--amber); }

.lead {
  font-size: clamp(1.15rem, 1.02rem + 0.7vw, 1.5rem);
  line-height: 1.45;
  font-weight: 400;
  color: var(--ink);
  font-family: var(--f-display);
  font-style: italic;
}

/* ---------- Layout helpers ---------- */
.wrap { max-width: var(--maxw); margin-inline: auto; padding-inline: var(--pad-x); }
.section { padding-block: var(--sec-y); }
.muted { color: var(--stone); }
.stack > * + * { margin-top: 1.1rem; }
/* Inline text link (within body copy) */
.ilink { color: var(--label); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; transition: color .2s var(--ease); }
.ilink:hover { color: var(--ember); }

/* Justified body copy. No hyphenation: never split words across lines. */
.split__body p, .stack p, .value p, .eng p, .feature p, .pillar p, .card p,
.hero__sub, .phero__sub, .intro-p {
  text-align: justify;
  -webkit-hyphens: manual;
  hyphens: manual;
}

/* ============================================================
   Navigation
   ============================================================ */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem var(--pad-x);
  transition: background .4s var(--ease), box-shadow .4s var(--ease), padding .4s var(--ease);
}
.nav__logo img { height: 64px; width: auto; transition: height .4s var(--ease); }
.nav__links { display: flex; align-items: center; gap: 0.35rem; }
.nav__link {
  font-family: var(--f-mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  padding: 0.55rem 0.85rem;
  border-radius: var(--radius);
  position: relative;
  transition: color .2s var(--ease);
  white-space: nowrap;
}
.nav__link::after {
  content: "";
  position: absolute;
  left: 0.85rem; right: 0.85rem; bottom: 0.35rem;
  height: 1.5px;
  background: var(--ember);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .3s var(--ease);
}
.nav__link:hover::after, .nav__link[aria-current="page"]::after { transform: scaleX(1); }
.nav__link:hover, .nav__link[aria-current="page"] { color: var(--ember); }

/* transparent over hero -> solid on scroll */
.nav--over { --nav-fg: #fff; }
.nav--over .nav__link { color: rgba(255,255,255,.92); }
.nav--over .nav__link:hover { color: #fff; }
.nav--over .nav__logo img { filter: brightness(0) invert(1); }
.nav--over .nav__toggle span { background: #fff; }
.nav.is-solid {
  background: color-mix(in srgb, var(--sand) 88%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: 0 1px 0 var(--line);
  padding-block: 0.5rem;
}
.nav.is-solid .nav__link { color: var(--ink); }
.nav.is-solid .nav__link:hover, .nav.is-solid .nav__link[aria-current="page"] { color: var(--ember); }
.nav.is-solid .nav__logo img { filter: none; height: 56px; }
.nav.is-solid .nav__toggle span { background: var(--ink); }

/* Dropdown */
.nav__item { position: relative; display: inline-flex; align-items: center; }
.nav__dropdown {
  position: absolute;
  top: calc(100% + 0.4rem);
  left: 0;
  min-width: 250px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: 0 18px 40px -18px rgba(30,20,15,.35);
  padding: 0.5rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity .22s var(--ease), transform .22s var(--ease), visibility .22s;
}
.nav__item:hover .nav__dropdown,
.nav__item:focus-within .nav__dropdown { opacity: 1; visibility: visible; transform: translateY(0); }
.nav__dropdown a {
  display: block;
  padding: 0.7rem 0.85rem;
  border-radius: var(--radius);
  color: var(--ink) !important;
  transition: background .18s var(--ease);
}
.nav__dropdown a small {
  display: block;
  font-family: var(--f-mono);
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  color: var(--stone);
  text-transform: none;
  margin-top: 0.1rem;
}
.nav__dropdown a strong { font-family: var(--f-body); font-size: 0.95rem; font-weight: 600; }
.nav__dropdown a:hover { background: var(--sand-2); }
.nav__dropdown a:hover strong { color: var(--ember); }
.nav__caret { display: inline-block; margin-left: 0.3rem; transition: transform .2s var(--ease); }
.nav__item:hover .nav__caret { transform: rotate(180deg); }

.nav__toggle { display: none; background: none; border: 0; width: 44px; height: 44px; padding: 10px; position: relative; z-index: 120; }
.nav__toggle span { display: block; height: 2px; width: 100%; background: var(--ink); border-radius: 2px; transition: transform .3s var(--ease), opacity .3s var(--ease); }
.nav__toggle span + span { margin-top: 5px; }

/* Language toggle (ES / EN) */
.lang-toggle {
  display: inline-flex; align-items: center; gap: 0.1rem;
  margin-left: 0.6rem;
  font-family: var(--f-mono); font-size: 0.74rem; font-weight: 700; letter-spacing: 0.05em;
}
.lang-toggle > svg { width: 15px; height: 15px; margin-right: 0.35rem; opacity: .75; }
.lang-toggle a, .lang-toggle .sep { padding: 0.35rem 0.3rem; color: inherit; line-height: 1; border-radius: 4px; }
.lang-toggle a[href] { opacity: .55; transition: opacity .2s var(--ease), color .2s var(--ease); }
.lang-toggle a[href]:hover { opacity: 1; color: var(--label); }
.lang-toggle a.is-active { color: var(--label); cursor: default; }
.lang-toggle .sep { opacity: .35; padding: 0 0.05rem; }
.nav--over .lang-toggle { color: #fff; }
.nav--over .lang-toggle a.is-active { color: #fff; }
.nav--over .lang-toggle a[href]:hover { color: #fff; }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-family: var(--f-mono);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.95rem 1.6rem;
  border-radius: var(--radius);
  border: 1.5px solid transparent;
  transition: transform .25s var(--ease), background .25s var(--ease), color .25s var(--ease), border-color .25s var(--ease);
  will-change: transform;
}
.btn svg { width: 1em; height: 1em; transition: transform .25s var(--ease); }
.btn:hover svg { transform: translateX(4px); }
.btn--primary { background: var(--ember); color: #fff; }
.btn--primary:hover { background: var(--brick); transform: translateY(-2px); }
.btn--ghost { border-color: currentColor; color: var(--ink); }
.btn--ghost:hover { background: var(--ink); color: var(--sand); transform: translateY(-2px); }
.btn--on-dark { border-color: rgba(255,255,255,.5); color: #fff; }
.btn--on-dark:hover { background: #fff; color: var(--midnight); border-color: #fff; }
.btn--wa { background: #2b333c; color: #fff; }
.btn--wa:hover { background: var(--brick); transform: translateY(-2px); }
.btn--wa svg { width: 1.15em; height: 1.15em; }

/* ============================================================
   Hero
   ============================================================ */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  color: #fff;
}
.hero__media { position: absolute; inset: 0; z-index: 0; }
.hero__media img {
  width: 100%; height: 100%; object-fit: cover;
  animation: kenburns 22s var(--ease) both;
}
.hero__media video {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
@keyframes kenburns {
  from { transform: scale(1.12); }
  to   { transform: scale(1); }
}
.hero__scrim {
  position: absolute; inset: 0; z-index: 1;
  background:
    linear-gradient(to top, rgba(14,14,18,.86) 0%, rgba(14,14,18,.30) 42%, rgba(14,14,18,.15) 100%),
    linear-gradient(105deg, rgba(20,16,14,.55) 0%, rgba(20,16,14,0) 55%);
}
/* Stronger scrim over the (brighter) hero video so the copy stays legible */
.hero__scrim--video {
  background:
    linear-gradient(to top, rgba(12,12,16,.92) 0%, rgba(12,12,16,.55) 34%, rgba(12,12,16,.30) 62%, rgba(12,12,16,.22) 100%),
    linear-gradient(105deg, rgba(16,14,12,.62) 0%, rgba(16,14,12,0) 58%);
}
.hero__inner {
  position: relative; z-index: 2;
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding: 0 var(--pad-x) clamp(3rem, 7vh, 6rem);
}
.hero__inner .eyebrow, .phero__inner .eyebrow { color: var(--amber-l); }
.hero__inner .eyebrow::before, .phero__inner .eyebrow::before { background: var(--amber); }
.hero h1 { color: #fff; max-width: 16ch; margin-top: 1.1rem; }
.hero__sub {
  max-width: 46ch;
  margin-top: 1.6rem;
  font-size: clamp(1.05rem, 0.98rem + 0.5vw, 1.3rem);
  color: rgba(255,255,255,.9);
  line-height: 1.5;
}
.hero__cta { margin-top: 2.2rem; display: flex; flex-wrap: wrap; gap: 0.9rem; }
.hero__scroll {
  position: absolute; z-index: 2; bottom: 1.6rem; right: var(--pad-x);
  font-family: var(--f-mono); font-size: 0.66rem; letter-spacing: 0.2em; text-transform: uppercase;
  color: rgba(255,255,255,.7); display: flex; align-items: center; gap: 0.6rem;
}
.hero__scroll::after { content:""; width: 1px; height: 42px; background: linear-gradient(rgba(255,255,255,.7), transparent); animation: scrolldrop 2s var(--ease) infinite; }
@keyframes scrolldrop { 0%{transform:scaleY(.3);transform-origin:top;opacity:0} 40%{opacity:1} 100%{transform:scaleY(1);transform-origin:top;opacity:0} }

/* Page hero (interior, shorter) */
.phero {
  position: relative;
  min-height: 62vh;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  color: #fff;
}
.phero__media { position: absolute; inset: 0; z-index: 0; }
.phero__media img { width: 100%; height: 100%; object-fit: cover; animation: kenburns 20s var(--ease) both; }
.phero__scrim { position: absolute; inset: 0; z-index: 1; background: linear-gradient(to top, rgba(14,14,18,.85), rgba(14,14,18,.30) 60%, rgba(14,14,18,.35)); }
.phero__inner { position: relative; z-index: 2; width: 100%; max-width: var(--maxw); margin-inline: auto; padding: 0 var(--pad-x) clamp(2.4rem, 6vh, 4.5rem); }
.phero h1 { color: #fff; max-width: 18ch; margin-top: 1rem; }
.phero__sub { max-width: 52ch; margin-top: 1.2rem; color: rgba(255,255,255,.9); font-size: clamp(1.02rem,.98rem + .4vw,1.2rem); }

/* ============================================================
   Editorial split sections
   ============================================================ */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 5.5rem);
  align-items: center;
}
.split--reverse .split__media { order: 2; }
.split__body { max-width: 46ch; }
.split__body h2 { margin: 0.7rem 0 1.2rem; }
.split__media { position: relative; }
.split__media img { width: 100%; border-radius: 6px; aspect-ratio: 4/5; object-fit: cover; }
.split__media.is-wide img { aspect-ratio: 5/4; }
.split__tag {
  position: absolute; bottom: 1rem; left: 1rem;
  background: rgba(20,16,14,.72); color: #fff;
  font-family: var(--f-mono); font-size: 0.66rem; letter-spacing: 0.12em; text-transform: uppercase;
  padding: 0.5rem 0.85rem; border-radius: 3px;
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}

/* Editorial two-column intro (heading left, paragraph right) — fills the row instead of leaving the right side empty */
.intro-split { display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(1.5rem, 5vw, 4rem); align-items: end; }
.intro-split > div .eyebrow { margin-bottom: 0.2rem; }
@media (max-width: 820px){ .intro-split { grid-template-columns: 1fr; gap: 1.1rem; align-items: start; } }

/* Checklist */
.checklist { list-style: none; padding: 0; display: grid; gap: 0.85rem; margin-top: 0.5rem; }
.checklist li { display: grid; grid-template-columns: auto 1fr; gap: 0.85rem; align-items: start; line-height: 1.5; }
.checklist li::before {
  content: "";
  width: 1.35rem; height: 1.35rem; margin-top: 0.15rem;
  background: var(--ember);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M9.55 17.6 4 12.05l1.4-1.4 4.15 4.14L18.6 5.4 20 6.8z'/%3E%3C/svg%3E") center/contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M9.55 17.6 4 12.05l1.4-1.4 4.15 4.14L18.6 5.4 20 6.8z'/%3E%3C/svg%3E") center/contain no-repeat;
  flex: none;
}
.checklist.on-dark li::before { background: var(--amber); }

/* ============================================================
   Value band (seguridad / eficiencia / honestidad)
   ============================================================ */
.values { background: var(--sand-2); }
.values__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(1.5rem,3vw,3rem); }
.value { position: relative; padding-top: 1.5rem; border-top: 1.5px solid var(--ink); }
.value__n { font-family: var(--f-mono); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.15em; color: var(--ember); }
.value h3 { margin: 0 0 0.7rem; }
.value p { color: var(--stone); font-size: 0.98rem; }

/* Two-up pillars (e.g. Equipo / Tecnología) */
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 4.5rem); }
.pillar { border-top: 1.5px solid var(--ink); padding-top: 1.5rem; }
.pillar h3 { margin: 0.8rem 0 0.8rem; }
.pillar p { color: var(--stone); }
@media (max-width: 820px){ .duo { grid-template-columns: 1fr; gap: 2.2rem; } }

/* ============================================================
   Service cards
   ============================================================ */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(1.25rem, 2.5vw, 2rem); }
.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform .35s var(--ease), box-shadow .35s var(--ease);
}
.card:hover { transform: translateY(-6px); box-shadow: 0 26px 48px -26px rgba(30,20,15,.4); }
.card__media { aspect-ratio: 16/11; overflow: hidden; }
.card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.card:hover .card__media img { transform: scale(1.06); }
.card__body { padding: 1.5rem 1.5rem 1.7rem; display: flex; flex-direction: column; flex: 1; }
.card__n { font-family: var(--f-mono); font-size: 0.7rem; font-weight: 700; letter-spacing: 0.15em; color: var(--label); }
.card h3 { margin: 0.6rem 0 0.7rem; }
.card p { color: var(--stone); font-size: 0.96rem; }

/* Feature list (services detail) */
.feature { border-top: 1px solid var(--line); padding-top: 1.8rem; }
.feature + .feature { margin-top: 2.4rem; }
.feature__k { font-family: var(--f-mono); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.15em; text-transform: uppercase; color: var(--label); }
.feature h3 { margin: 0.5rem 0 0.8rem; }
.feature p { color: var(--stone); }
.feature ol { margin: 0.8rem 0 0 1.1rem; color: var(--stone); }
.feature ol li { margin-top: 0.35rem; }

/* Detailed engineering grid */
.eng-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(1.5rem,3vw,2.6rem); }
.eng { background: var(--white); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
/* Center the card content vertically (balances short cards' whitespace) */
.eng--center { display: flex; flex-direction: column; justify-content: center; }
.eng__media { aspect-ratio: 16/9; overflow: hidden; }
.eng__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.eng:hover .eng__media img { transform: scale(1.05); }
.eng__body { padding: 1.6rem 1.7rem 1.9rem; }
.eng h3 { color: var(--brick); margin-bottom: 0.7rem; }
.eng p { color: var(--stone); font-size: 0.96rem; }
.eng ol, .eng ul { color: var(--stone); font-size: 0.96rem; }
.eng ol li, .eng ul li { line-height: 1.5; }

/* ============================================================
   Alianzas / strategic partners
   ============================================================ */
.allies { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1.4rem, 3vw, 2.2rem); align-items: start; margin-top: clamp(2.5rem, 5vw, 3.5rem); }
.ally { background: var(--white); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; transition: transform .35s var(--ease), box-shadow .35s var(--ease); }
.ally:hover { transform: translateY(-5px); box-shadow: 0 30px 55px -30px rgba(30,20,15,.42); }
.ally__logo { display: grid; place-items: center; min-height: 128px; padding: 1.5rem 2rem; background: #fff; border-bottom: 1px solid var(--line); }
.ally__logo img { max-height: 50px; width: auto; transition: transform .4s var(--ease); }
.ally:hover .ally__logo img { transform: scale(1.04); }
.ally--navy .ally__logo { background: #132D6A; border-bottom-color: #132D6A; }
.ally--navy .ally__logo img { max-height: 72px; }
.ally__body { padding: clamp(1.4rem, 3vw, 1.9rem); display: flex; flex-direction: column; flex: 1; }
.ally__desc { color: var(--stone); font-size: 0.96rem; margin-bottom: 1.3rem; }
.ally__k { font-family: var(--f-mono); font-size: 0.7rem; font-weight: 700; letter-spacing: 0.15em; text-transform: uppercase; color: var(--label); }
.ally__services { grid-template-columns: 1fr 1fr; column-gap: 1.6rem; row-gap: 0.7rem; margin-top: 1rem; }
.ally__services li { font-size: 0.95rem; color: var(--stone); line-height: 1.35; }
@media (max-width: 560px){ .ally__services { grid-template-columns: 1fr; } }
.ally__visit { margin-top: 1.5rem; align-self: flex-start; display: inline-flex; align-items: center; gap: 0.45rem; font-family: var(--f-mono); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--label); }
.ally__visit svg { width: 0.9em; height: 0.9em; transition: transform .25s var(--ease); }
.ally__visit:hover { color: var(--ember); }
.ally__visit:hover svg { transform: translate(2px, -2px); }
@media (max-width: 820px){ .allies { grid-template-columns: 1fr; } }

/* ============================================================
   Dark section
   ============================================================ */
.dark { background: var(--midnight); color: rgba(255,255,255,.82); position: relative; overflow: hidden; }
.dark h2, .dark h3 { color: #fff; }
.dark .split__body strong { color: #fff; }
.dark--media { position: relative; }
.dark--media .dark__bg { position: absolute; inset: 0; z-index: 0; }
.dark--media .dark__bg img { width: 100%; height: 100%; object-fit: cover; opacity: .28; }
.dark--media .dark__bg::after { content:""; position:absolute; inset:0; background: linear-gradient(120deg, var(--midnight) 20%, rgba(20,25,34,.6) 100%); }
.dark--media .wrap { position: relative; z-index: 1; }

/* Rotating isotype signature */
.ray {
  position: absolute;
  width: min(52vw, 640px); aspect-ratio: 1;
  opacity: .07;
  pointer-events: none;
  animation: spin 90s linear infinite;
}
.ray--tr { top: -14%; right: -10%; }
.ray--bl { bottom: -18%; left: -12%; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Certifications strip */
.certs { display: flex; flex-wrap: wrap; align-items: center; gap: clamp(1rem,3vw,2.5rem); }
.certs__label { font-family: var(--f-mono); font-size: 0.72rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--stone); }
.cert {
  font-family: var(--f-body); font-weight: 600; font-size: clamp(1.4rem, 3vw, 2rem);
  letter-spacing: -0.02em;
  color: var(--ink); display: inline-flex; align-items: baseline; gap: 0.5rem;
}
.cert span { font-family: var(--f-mono); font-weight: 700; font-size: 0.7rem; letter-spacing: 0.1em; color: var(--label); }

/* Clickable certificate cards */
.cert-card { display: block; color: inherit; transition: transform .3s var(--ease), box-shadow .3s var(--ease); }
.cert-card:hover { transform: translateY(-4px); }
.cert-card:hover .cert { color: var(--brick); }
.cert-card p { text-align: left; }
.cert-link {
  display: inline-flex; align-items: center; gap: 0.45rem; margin-top: 1rem;
  font-family: var(--f-mono); font-size: 0.7rem; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--label);
}
.cert-link svg { width: 0.9em; height: 0.9em; transition: transform .25s var(--ease); }
.cert-card:hover .cert-link svg { transform: translateX(3px); }

/* Hecho en México badge */
.hecho { margin-top: clamp(2.5rem, 5vw, 4rem); display: flex; justify-content: center; }
.hecho img { width: clamp(118px, 14vw, 152px); height: auto; }

/* ============================================================
   Careers / Bolsa de trabajo
   ============================================================ */
.vacancy-empty {
  text-align: center;
  border: 1.5px dashed var(--line);
  border-radius: 14px;
  padding: clamp(2.5rem, 6vw, 4.5rem) clamp(1.5rem, 4vw, 3rem);
  background: var(--sand-2);
  max-width: 760px;
  margin-inline: auto;
}
.vacancy-empty img { width: 150px; height: auto; opacity: .85; margin: 0 auto 1.3rem; }
.vacancy-empty h3 { margin-bottom: 0.8rem; }
.vacancy-empty p { color: var(--stone); max-width: 54ch; margin-inline: auto; }
.vacancy-empty a { color: var(--label); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }

.notice {
  border: 1px solid var(--line);
  border-left: 4px solid var(--brick);
  background: var(--white);
  border-radius: 10px;
  padding: clamp(1.6rem, 3.5vw, 2.7rem);
  max-width: 840px;
  margin-inline: auto;
  box-shadow: 0 18px 44px -30px rgba(30,20,15,.4);
}
.notice__head { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1.1rem; }
.notice__head svg { width: 1.7rem; height: 1.7rem; color: var(--brick); flex: none; }
.notice__head h2 { color: var(--brick); font-size: clamp(1.3rem, 2.4vw, 1.75rem); margin: 0; }
.notice p { margin-top: 0.95rem; text-align: justify; }
.notice p:first-of-type { margin-top: 0; }
.notice strong { color: var(--ink); }
.notice a { color: var(--brick); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; word-break: break-word; }

/* Big CTA band */
.cta-band { background: var(--brick); color: #fff; position: relative; overflow: hidden; }
.cta-band h2 { color: #fff; max-width: 20ch; }
.cta-band .ray { opacity: .1; }
.cta-band__inner { display: grid; grid-template-columns: 1.4fr 1fr; gap: 2.5rem; align-items: center; position: relative; z-index: 1; }
.cta-band__actions { display: flex; flex-direction: column; gap: 0.9rem; align-items: flex-start; }
@media (max-width: 820px){ .cta-band__inner { grid-template-columns: 1fr; } }

/* ============================================================
   Renewable projects carousel (track record)
   ============================================================ */
.rp { position: relative; }
.rp .wrap { position: relative; z-index: 1; }
.rp__head { display: grid; grid-template-columns: 1fr auto; gap: 1.6rem 2.5rem; align-items: end; }
.rp__intro { max-width: 56ch; }
.rp__intro .eyebrow { color: var(--amber-l); }
.rp__intro h2 { margin-top: 0.9rem; }
.rp__intro p { margin-top: 1rem; color: rgba(255,255,255,.78); }

/* honest aggregate figures */
.rp__stats { display: flex; flex-wrap: wrap; gap: 1.1rem 2.4rem; margin-top: 1.6rem; }
.rp__stat { display: flex; flex-direction: column; gap: 0.15rem; }
.rp__stat b { font-family: var(--f-body); font-weight: 600; font-size: clamp(1.5rem, 1.1rem + 1.3vw, 2rem); letter-spacing: -0.02em; color: #fff; line-height: 1; }
.rp__stat span { font-family: var(--f-mono); font-size: 0.68rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--amber-l); }

/* controls: counter + arrows */
.rp__controls { display: inline-flex; align-items: center; gap: 1.1rem; }
.rp__count { font-family: var(--f-mono); font-size: 0.8rem; font-weight: 700; letter-spacing: 0.12em; color: rgba(255,255,255,.6); white-space: nowrap; }
.rp__count b { color: var(--amber-l); font-size: 1.35rem; letter-spacing: -0.01em; }
.rp__arrows { display: inline-flex; gap: 0.6rem; }
.rp__btn {
  width: 3rem; height: 3rem; border-radius: 50%;
  display: grid; place-items: center;
  background: transparent; color: var(--ember);
  border: 1.5px solid var(--ember);
  transition: background .25s var(--ease), color .25s var(--ease), transform .25s var(--ease), border-color .25s var(--ease), opacity .25s var(--ease);
}
.rp__btn svg { width: 1.25rem; height: 1.25rem; }
.rp__btn:hover { background: var(--ember); color: #fff; transform: translateY(-2px); }
.rp__btn:active { transform: translateY(0); }
.rp__btn:disabled { opacity: 0.32; cursor: default; }
.rp__btn:disabled:hover { background: transparent; color: var(--ember); transform: none; }

/* horizontal snap track */
.rp__viewport { margin-top: clamp(2rem, 4vw, 3rem); overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.rp__viewport::-webkit-scrollbar { display: none; }
.rp__track { display: flex; gap: 1.4rem; padding-bottom: 0.25rem; }
.rp-card {
  flex: 0 0 clamp(280px, 78vw, 384px);
  scroll-snap-align: start;
  display: flex; flex-direction: column;
  background: var(--midnight-2);
  border: 1px solid var(--line-d);
  border-top: 3px solid var(--ember);
  border-radius: var(--radius);
  padding: clamp(1.5rem, 3vw, 2rem);
  transition: transform .35s var(--ease), border-color .35s var(--ease), box-shadow .35s var(--ease);
}
.rp-card:hover { transform: translateY(-6px); box-shadow: 0 30px 55px -30px rgba(0,0,0,.6); }
.rp-card__country { font-family: var(--f-mono); font-size: 0.68rem; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--amber-l); }
.rp-card__name { color: #fff; margin-top: 0.8rem; }
.rp-card__loc { display: flex; align-items: center; gap: 0.4rem; margin-top: 0.55rem; font-size: 0.9rem; color: rgba(255,255,255,.62); }
.rp-card__loc svg { width: 0.95em; height: 0.95em; color: var(--ember); flex: none; }
.rp-card__desc { margin-top: 1.1rem; flex: 1; font-size: 0.95rem; line-height: 1.6; color: rgba(255,255,255,.72); }
.rp-card__data { display: flex; gap: 1.6rem; margin-top: 1.5rem; padding-top: 1.3rem; border-top: 1px solid var(--line-d); }
.rp-card__fig { display: flex; flex-direction: column; gap: 0.25rem; }
.rp-card__fig b { font-family: var(--f-body); font-weight: 600; letter-spacing: -0.03em; line-height: 1; font-size: clamp(1.9rem, 1.4rem + 1.6vw, 2.5rem); color: var(--amber); }
.rp-card__fig b small { font-size: 0.42em; font-weight: 700; letter-spacing: 0.06em; color: rgba(255,255,255,.55); margin-left: 0.25em; }
.rp-card__fig--tests b { color: #fff; }
.rp-card__fig span { font-family: var(--f-mono); font-size: 0.64rem; font-weight: 700; letter-spacing: 0.11em; text-transform: uppercase; color: rgba(255,255,255,.5); }

/* progress bar */
.rp__progress { margin-top: 1.8rem; height: 3px; background: var(--line-d); border-radius: 3px; overflow: hidden; }
.rp__progress i { display: block; height: 100%; width: 20%; background: var(--ember); border-radius: 3px; transition: width .35s var(--ease), transform .35s var(--ease); transform-origin: left; }

@media (max-width: 720px){
  .rp__head { grid-template-columns: 1fr; }
  .rp__controls { display: flex; width: 100%; justify-content: space-between; }
}
@media (prefers-reduced-motion: reduce){
  .rp__viewport { scroll-behavior: auto; }
}

/* ============================================================
   Presence globe (Nosotros)
   ============================================================ */
.globe-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(2rem, 5vw, 4.5rem); align-items: center; }
.globe-copy .globe-legend { list-style: none; padding: 0; margin-top: 1.7rem; display: grid; gap: 0.7rem; }
.g-item { display: inline-flex; align-items: center; gap: 0.7rem; font-size: 1.02rem; color: var(--ink); }
.g-item .dot { width: 0.66rem; height: 0.66rem; border-radius: 50%; background: #ff3a2f; box-shadow: 0 0 0 3px rgba(255,58,47,0.16); flex: none; }
a.g-item { transition: color 0.2s var(--ease); }
a.g-item:hover { color: var(--ember); }
a.g-item:hover .dot { box-shadow: 0 0 0 4px rgba(255,58,47,0.24); }
.g-item .kox { font-family: var(--f-mono); font-size: 0.7rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--label); margin-left: 0.1rem; }
a.g-item:hover .kox { color: var(--ember); }
.globe-hint { margin-top: 1.4rem; font-size: 0.85rem; color: var(--stone-l); }

.globe-stage { position: relative; width: 100%; aspect-ratio: 1 / 1; background: #000; border-radius: 14px; overflow: hidden; border: 1px solid rgba(255,255,255,0.08); box-shadow: 0 34px 66px -34px rgba(0,0,0,0.55); }
#globe { width: 100%; height: 100%; display: block; touch-action: none; }

@media (max-width: 900px){
  .globe-grid { grid-template-columns: 1fr; }
  .globe-stage { max-width: 440px; margin-inline: auto; }
}

/* ============================================================
   Contact
   ============================================================ */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem,5vw,5rem); align-items: start; }
.form { display: grid; gap: 1.1rem; }
.field { display: grid; gap: 0.45rem; }
.field label { font-family: var(--f-mono); font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--stone); }
.field label .req { color: var(--ember); }
.field input, .field textarea {
  font: inherit;
  padding: 0.9rem 1rem;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--ink);
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.field textarea { resize: vertical; min-height: 150px; }
.field input:focus, .field textarea:focus {
  outline: none;
  border-color: var(--ember);
  box-shadow: 0 0 0 3px rgba(232,93,52,.15);
}
.form__note { font-size: 0.8rem; color: var(--stone-l); }
.form__note a { color: var(--ember); text-decoration: underline; text-underline-offset: 2px; }

.contact-aside { border-left: 2px solid var(--ember); padding-left: clamp(1.2rem, 3vw, 2rem); }
.contact-aside h3 { color: var(--brick); }
.contact-item { margin-top: 1.6rem; }
.contact-item .k { font-family: var(--f-mono); font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--stone); }
.contact-item .v { font-size: 1.05rem; margin-top: 0.2rem; }
.contact-item a.v:hover { color: var(--ember); }
.social { display: inline-flex; gap: 0.7rem; margin-top: 0.6rem; }
.social a {
  width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--ink); color: #fff;
  transition: transform .25s var(--ease), background .25s var(--ease);
}
.social a:hover { background: var(--ember); transform: translateY(-3px); }
.social svg { width: 20px; height: 20px; }

/* ============================================================
   Footer
   ============================================================ */
.footer { background: var(--midnight); color: rgba(255,255,255,.72); position: relative; overflow: hidden; }
.footer__top { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2.5rem; padding-block: clamp(3rem,6vw,5rem) 2.5rem; position: relative; z-index: 1; }
.footer__brand img { height: 46px; }
.footer__brand p { margin-top: 1.1rem; max-width: 34ch; font-size: 0.95rem; }
.footer h4 { font-family: var(--f-mono); font-weight: 500; font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--amber-l); margin-bottom: 1.1rem; }
.footer__nav { display: grid; gap: 0.6rem; }
.footer__nav a { color: rgba(255,255,255,.72); font-size: 0.95rem; width: fit-content; transition: color .2s var(--ease); }
.footer__nav a:hover { color: #fff; }
.footer__loc { font-size: 0.95rem; line-height: 1.7; }
.footer__loc strong { color: #fff; }
.footer__bottom {
  border-top: 1px solid var(--line-d);
  padding-block: 1.5rem 2.2rem;
  display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; align-items: center;
  font-size: 0.8rem; color: rgba(255,255,255,.5);
  position: relative; z-index: 1;
}
.footer__bottom .social a { width: 38px; height: 38px; background: rgba(255,255,255,.1); }
.footer__bottom .social a:hover { background: var(--ember); }

/* Legal notice link — sits under the contact column in the footer */
.legal-link {
  display: inline-block;
  margin-top: 1.1rem;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 0.95rem;
  color: rgba(255,255,255,.72);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color .2s var(--ease);
}
.legal-link:hover { color: #fff; }
.legal-link:focus-visible { outline: 2px solid var(--amber-l); outline-offset: 3px; border-radius: 2px; }

/* ============================================================
   Legal disclaimer modal (native <dialog>)
   ============================================================ */
.disclaimer {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 1.25rem;
  border: 0;
  background: transparent;
  color: var(--ink);
  display: none;
  place-items: center;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.disclaimer[open] { display: grid; }
.disclaimer::backdrop { background: rgba(10,12,16,.72); }
.disclaimer[open]::backdrop { backdrop-filter: blur(2px); }

.disclaimer__card {
  position: relative;
  width: 100%;
  max-width: 680px;
  max-height: calc(100vh - 2.5rem);
  overflow-y: auto;
  background: var(--sand);
  border-radius: 20px;
  padding: clamp(1.9rem, 4vw, 3.4rem);
  box-shadow: 0 30px 80px -20px rgba(0,0,0,.55);
}

.disclaimer__close {
  position: absolute;
  top: clamp(1.1rem, 2.5vw, 1.6rem);
  right: clamp(1.1rem, 2.5vw, 1.6rem);
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  transition: background .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease);
}
.disclaimer__close svg { width: 20px; height: 20px; }
.disclaimer__close:hover { background: var(--ember); border-color: var(--ember); color: #fff; }
.disclaimer__close:focus-visible { outline: 2px solid var(--ember); outline-offset: 2px; }

.disclaimer__eyebrow {
  display: block;
  padding-right: 3.2rem;
  font-family: var(--f-mono);
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--label);
}
.disclaimer__title {
  margin-top: 0.7rem;
  font-size: clamp(1.9rem, 4.4vw, 2.7rem);
  line-height: 1.08;
  color: var(--ink);
}
.disclaimer__body {
  margin-top: 1.3rem;
  max-width: 62ch;
  color: var(--stone);
  text-align: justify;
  hyphens: manual;
}

@keyframes disclaimer-in { from { opacity: 0; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes disclaimer-fade { from { opacity: 0; } to { opacity: 1; } }
.disclaimer[open] .disclaimer__card { animation: disclaimer-in .32s var(--ease); }
.disclaimer[open]::backdrop { animation: disclaimer-fade .32s var(--ease); }
@media (prefers-reduced-motion: reduce) {
  .disclaimer[open] .disclaimer__card,
  .disclaimer[open]::backdrop { animation: none; }
}

/* lock background scroll while the dialog is open */
.dialog-open, .dialog-open body { overflow: hidden; }

/* ============================================================
   Scroll-reveal animation
   ============================================================ */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .8s var(--ease), transform .8s var(--ease); transition-delay: calc(var(--i, 0) * 90ms); }
.reveal.is-visible { opacity: 1; transform: none; }
.reveal-img { clip-path: inset(0 0 8% 0); opacity: 0; transform: scale(1.04); transition: clip-path 1s var(--ease), opacity 1s var(--ease), transform 1.2s var(--ease); }
.reveal-img.is-visible { clip-path: inset(0 0 0 0); opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal-img { opacity: 1 !important; transform: none !important; clip-path: none !important; transition: none !important; }
  .hero__media img, .phero__media img, .ray, .hero__scroll::after { animation: none !important; }
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 940px) {
  .split, .contact-grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .split--reverse .split__media { order: 0; }
  .split__body { max-width: 60ch; }
  .split__media img, .split__media.is-wide img { aspect-ratio: 16/10; }
  .cards, .eng-grid { grid-template-columns: 1fr; }
  .values__grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .footer__top { grid-template-columns: 1fr 1fr; }
  .footer__brand { grid-column: 1 / -1; }
}

@media (max-width: 780px) {
  .nav__toggle { display: block; }
  .nav__links {
    position: fixed;
    inset: 0 0 0 auto;
    width: min(82vw, 340px);
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0.2rem;
    background: var(--sand);
    padding: 5.5rem 1.5rem 2rem;
    box-shadow: -20px 0 50px -20px rgba(20,15,10,.4);
    transform: translateX(100%);
    transition: transform .4s var(--ease);
    overflow-y: auto;
  }
  .nav__links.is-open { transform: translateX(0); }
  .nav__link { color: var(--ink) !important; font-size: 0.92rem; padding: 0.9rem 0.5rem; border-bottom: 1px solid var(--line); border-radius: 0; }
  .nav__link::after { display: none; }
  .nav--over .nav__link { color: var(--ink) !important; }
  .nav__dropdown {
    position: static; opacity: 1; visibility: visible; transform: none;
    box-shadow: none; border: 0; border-bottom: 1px solid var(--line); border-radius: 0;
    background: transparent; padding: 0 0 0.5rem;
  }
  .nav__dropdown a { padding: 0.7rem 0.9rem; }
  .nav__caret { display: none; }
  .nav__toggle.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav__toggle.is-open span:nth-child(2) { opacity: 0; }
  .nav__toggle.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  body.menu-open { overflow: hidden; }
  /* While the menu is open, drop the solid nav's backdrop-filter: it creates a
     containing block that would clip the fixed slide-in panel to the bar height. */
  body.menu-open .nav.is-solid { -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--sand); }
  .nav__links .lang-toggle { margin: 1.1rem 0.5rem 0; font-size: 0.95rem; }
  .lang-toggle a, .lang-toggle .sep { padding: 0.5rem 0.5rem; }
  /* Language toggle sits on the light menu panel: force dark colors so it's
     visible even when the bar is in its over-hero (white) state. */
  .nav__links .lang-toggle { color: var(--ink); }
  .nav__links .lang-toggle > svg { opacity: 0.7; }
  .nav__links .lang-toggle a[href] { color: var(--ink); opacity: 0.6; }
  .nav__links .lang-toggle a.is-active { color: var(--label); opacity: 1; }
  .nav__links .lang-toggle .sep { color: var(--ink); opacity: 0.4; }
}

@media (max-width: 560px) {
  .footer__top { grid-template-columns: 1fr; }
  .certs { gap: 1.2rem 2rem; }
  .hero__cta .btn { width: 100%; justify-content: center; }
}

/* Focus visibility */
:focus-visible { outline: 2px solid var(--ember); outline-offset: 3px; border-radius: 2px; }
.nav--over :focus-visible { outline-color: #fff; }
