/* =========================================================
   ORCERTIFICACIONES — Rediseño interactivo
   ========================================================= */
:root {
  --ink: #0d1214;
  --ink-2: #151d21;
  --ink-3: #1f2a2f;
  --paper: #f6f3ec;
  --paper-2: #ece7db;
  --white: #ffffff;
  --line: rgba(13, 18, 20, .12);
  --line-dark: rgba(255, 255, 255, .12);
  --muted: #5b6669;
  --muted-dark: #a9b4b6;
  /* Color de marca: verde petróleo */
  --brand: #1e4d54;        /* rellenos (texto blanco 9.4:1) y texto sobre fondos claros */
  --brand-ink: #1e4d54;    /* texto, enlaces y foco sobre fondos claros (9.4:1 sobre blanco) */
  --brand-light: #7fb5bc;  /* texto e íconos sobre fondos oscuros (8.3:1 sobre tinta) */
  --q: #3d6ef5;   /* ISO 9001 calidad */
  --e: #2c9e5f;   /* ISO 14001 ambiente */
  --s: #f07a1a;   /* ISO 45001 seguridad */
  --radius: 22px;
  --radius-sm: 14px;
  --shadow: 0 1px 2px rgba(13,18,20,.06), 0 12px 32px -12px rgba(13,18,20,.22);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  /* Tipografía de marca: títulos EB Garamond (la entregada por el cliente; se sirve desde
     Google Fonts en woff2 recortado, mucho más liviano que los TTF), texto Poppins. */
  --serif: "EB Garamond", Garamond, Georgia, serif;
  --sans: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
  --wrap: min(1200px, 100% - 32px);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; border-radius: 8px; }
.wrap { width: var(--wrap); margin-inline: auto; }
[hidden] { display: none !important; }
/* Marca: todo el texto en estilo regular, sin itálicas (pedido del cliente) */
em, i, cite, dfn, var, address { font-style: normal; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -.02em;
  margin: 0;
}
h2 { font-size: clamp(2rem, 4.6vw, 3.4rem); }
.section-head { max-width: 720px; margin-bottom: clamp(28px, 5vw, 48px); }
.section-head p { color: var(--muted); font-size: 1.1rem; margin: 14px 0 0; }
.dark .section-head p { color: var(--muted-dark); }
section { position: relative; }
.pad { padding: clamp(72px, 11vw, 130px) 0; }
.dark { background: var(--ink); color: var(--white); }

/* ---------- Botones ---------- */
.btn {
  --bg: var(--white); --fg: var(--ink);
  position: relative; display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 22px; border-radius: 999px; border: 0;
  background: var(--bg); color: var(--fg);
  font-weight: 700; font-size: .98rem; text-decoration: none; white-space: nowrap;
  transition: transform .35s var(--spring), box-shadow .3s var(--ease), background .3s;
  will-change: transform;
}
.btn:hover { box-shadow: 0 10px 30px -10px rgba(30,77,84,.45); }
.btn:active { transform: scale(.96) !important; }
.btn svg { width: 18px; height: 18px; transition: transform .3s var(--ease); }
.btn:hover svg { transform: translateX(4px); }
.btn--brand { --bg: var(--brand); --fg: var(--white); }
/* Sobre fondos oscuros el petróleo necesita un filo claro para no hundirse */
.hero .btn--brand, .nav .btn--brand, .dark .btn--brand { box-shadow: inset 0 0 0 1.5px rgba(127,181,188,.65); }
.hero .btn--brand:hover, .nav .btn--brand:hover, .dark .btn--brand:hover { box-shadow: inset 0 0 0 1.5px rgba(127,181,188,.95), 0 10px 30px -10px rgba(0,0,0,.6); }
/* En el hero, el botón secundario cede jerarquía al principal */
.hero .btn--ghost { box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.4); }
.hero .btn--ghost:hover { box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.75); }
.btn--ink { --bg: var(--ink); --fg: var(--white); }
.btn--ghost { --bg: transparent; --fg: currentColor; box-shadow: inset 0 0 0 1.5px currentColor; }
.btn--ghost:hover { box-shadow: inset 0 0 0 1.5px currentColor, 0 10px 30px -14px rgba(255,255,255,.4); }
.btn--sm { padding: 10px 18px; font-size: .9rem; }

.link-arrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 700; color: var(--brand-ink); text-decoration: none;
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 2px no-repeat;
  transition: background-size .35s var(--ease);
}
.link-arrow:hover { background-size: 100% 2px; }
.link-arrow svg { width: 16px; height: 16px; transition: transform .3s var(--ease); }
.link-arrow:hover svg { transform: translateX(4px); }

/* ---------- Barra de progreso ---------- */
.progress {
  position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 100;
  background: linear-gradient(90deg, var(--q), var(--e), var(--s));
  transform-origin: 0 50%; transform: scaleX(0);
}

/* ---------- Navegación ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 90;
  padding: 14px 0; color: var(--white);
  transition: background .35s, padding .35s, box-shadow .35s, transform .4s var(--ease);
}
.nav.is-scrolled {
  background: rgba(13,18,20,.78);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  padding: 8px 0; box-shadow: 0 1px 0 var(--line-dark);
}
.nav.is-hidden { transform: translateY(-110%); }
.nav__inner { display: flex; align-items: center; gap: 28px; }
.brand {
  display: inline-flex; align-items: center; gap: 12px; text-decoration: none;
  font-family: "Barlow Condensed", var(--sans); font-weight: 600; font-size: 1.45rem; letter-spacing: .07em; line-height: 1;
}
.brand svg { width: 40px; height: 40px; overflow: visible; --logo-fill: url(#logo-silver-light); }
.brand span { background: linear-gradient(180deg, #e4e4e4 10%, #a3a3a3 90%); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* Isotipo: los segmentos del anillo se separan (--sp) y vuelven a su sitio */
.lg-seg {
  transform: translate(calc(var(--sp, 0) * var(--dx) * 1px), calc(var(--sp, 0) * var(--dy) * 1px));
  transition: transform .6s var(--spring);
}
.lg-r { transform-box: fill-box; transform-origin: center; transition: transform .6s var(--spring); }
.brand:hover { --sp: 22; }
.brand:hover .lg-r { transform: scale(.92); }
.js body:not(.is-loaded) .nav .brand { --sp: 140; }
.dropdown { position: relative; }
.dropdown svg { width: 14px; height: 14px; transition: transform .3s; }
.dropdown[data-open="true"] > button svg { transform: rotate(180deg); }
.dropdown__menu {
  position: absolute; top: calc(100% + 10px); left: 50%; width: 300px;
  padding: 8px; border-radius: 18px; list-style: none; margin: 0;
  background: var(--white); color: var(--ink); box-shadow: var(--shadow);
  opacity: 0; visibility: hidden; transform: translate(-50%, -8px) scale(.97);
  transition: opacity .25s, transform .3s var(--ease), visibility .25s;
}
.dropdown[data-open="true"] .dropdown__menu { opacity: 1; visibility: visible; transform: translate(-50%, 0) scale(1); }
.dropdown__menu a { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 12px; text-decoration: none; }
.dropdown__menu a:hover { background: var(--paper); }
.dropdown__menu b { display: block; font-size: .95rem; }
.dropdown__menu small { color: var(--muted); font-size: .82rem; }
.dot { width: 12px; height: 12px; border-radius: 50%; flex: none; background: var(--c); box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 18%, transparent); }
.nav__burger { display: none; margin-left: auto; width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255,255,255,.1); position: relative; }
.nav__burger span { position: absolute; left: 13px; right: 13px; height: 2px; background: currentColor; border-radius: 2px; transition: transform .35s var(--ease), opacity .2s; }
.nav__burger span:nth-child(1) { top: 16px; } .nav__burger span:nth-child(2) { top: 21px; } .nav__burger span:nth-child(3) { top: 26px; }
.nav.is-open .nav__burger span:nth-child(1) { transform: translateY(5px) rotate(45deg); }
.nav.is-open .nav__burger span:nth-child(2) { opacity: 0; }
.nav.is-open .nav__burger span:nth-child(3) { transform: translateY(-5px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  --mx: 70%; --my: 40%;
  min-height: 100svh; display: grid; align-items: center;
  padding: 120px 0 80px; overflow: hidden; isolation: isolate;
  background: var(--ink);
  color: var(--white);
}
/* Foto de fondo con fundido hacia el texto */
.hero__bg { position: absolute; inset: 0; z-index: -2; overflow: hidden; }
/* Foto panorámica que ya trae su fundido negro a la izquierda: ocupa todo el ancho, anclada a la derecha */
.hero__bg img {
  position: absolute; right: 0; top: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: 100% 30%;
  animation: heroZoom 1.8s var(--ease) both;
}
@keyframes heroZoom { from { scale: 1.14; opacity: 0; } to { scale: 1; opacity: 1; } }
/* Laptops: la foto se desplaza a la derecha para que el casco no quede detrás del título */
@media (min-width: 861px) and (max-width: 1500px) {
  .hero__bg img { width: 114%; right: -14%; }
}
.hero__bg::after {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(90deg, var(--ink) 0%, var(--ink) 36%, rgba(13,18,20,.82) 46%, rgba(13,18,20,.35) 62%, rgba(13,18,20,.08) 80%, rgba(13,18,20,.3) 100%),
    linear-gradient(0deg, var(--ink) 0%, rgba(13,18,20,0) 24%),
    linear-gradient(180deg, rgba(13,18,20,.7) 0%, rgba(13,18,20,0) 18%);
}
/* Foco de luz que sigue al cursor */
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(520px circle at var(--mx) var(--my), rgba(127,181,188,.12), transparent 60%);
}
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background-image:
    linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 50% 75% at 18% 50%, #000 20%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse 50% 75% at 18% 50%, #000 20%, transparent 70%);
}
.hero__grid { display: grid; grid-template-columns: minmax(0, 680px); align-items: center; }
.hero h1 { font-size: clamp(2.6rem, 6.4vw, 5.2rem); font-weight: 400; }
.hero h1 em { font-style: normal; }
.rotator { display: block; position: relative; height: 1.12em; overflow: hidden; }
.rotator span {
  position: absolute; left: 0; top: 0; white-space: nowrap;
  font-style: normal;
  color: var(--c, var(--brand-light));
  transform: translateY(110%); opacity: 0;
  transition: transform .7s var(--ease), opacity .5s;
}
.rotator span.is-in { transform: translateY(0); opacity: 1; }
.rotator span.is-out { transform: translateY(-110%); opacity: 0; }
.hero__lead { font-size: clamp(1.05rem, 1.6vw, 1.25rem); color: var(--muted-dark); max-width: 540px; margin: 26px 0 34px; }
.hero__ctas { display: flex; flex-wrap: wrap; gap: 12px; }
.hero__meta { display: flex; flex-wrap: wrap; gap: 10px 22px; margin-top: 44px; padding: 0; list-style: none; color: var(--muted-dark); font-size: .92rem; }
.hero__meta li { display: inline-flex; align-items: center; gap: 8px; }
.hero__meta svg { width: 18px; height: 18px; color: var(--brand-light); }

/* Sello flotante sobre la foto */
.hero__visual {
  position: absolute; z-index: 1; right: clamp(16px, 6vw, 110px); bottom: clamp(120px, 24vh, 220px);
  aspect-ratio: 1; width: clamp(120px, 10.5vw, 160px); perspective: 900px;
}
@media (max-width: 860px) {
  .hero { padding: 44svh 0 64px; align-items: end; }
  .hero__bg img { width: 100%; height: 60%; object-position: 86% 30%; }
  .hero__bg::after { background: linear-gradient(180deg, rgba(13,18,20,.55) 0%, rgba(13,18,20,.05) 18%, rgba(13,18,20,.55) 34%, rgba(13,18,20,.92) 46%, var(--ink) 56%); }
  .hero::before { mask-image: linear-gradient(180deg, transparent 40%, #000 80%); -webkit-mask-image: linear-gradient(180deg, transparent 40%, #000 80%); }
  .hero__visual { display: none; }
}
/* Moneda metálica del isotipo (PNG con transparencia); se inclina siguiendo al cursor (app.js) */
.seal-wrap { position: absolute; inset: 4%; transform-style: preserve-3d; transition: transform .25s ease-out; }
.seal-coin {
  display: block; width: 100%; height: 100%;
  filter: drop-shadow(0 22px 32px rgba(0,0,0,.55)) drop-shadow(0 2px 4px rgba(0,0,0,.35));
}
.hero__scroll {
  position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%);
  width: 26px; height: 42px; border-radius: 20px; border: 2px solid rgba(255,255,255,.35);
}
.hero__scroll::after {
  content: ""; position: absolute; left: 50%; top: 8px; width: 4px; height: 8px; margin-left: -2px;
  border-radius: 4px; background: var(--white); animation: wheel 1.8s var(--ease) infinite;
}
@keyframes wheel { 0% { opacity: 0; transform: translateY(0); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(14px); } }
