/* =========================================================
   rejillagalvanizada.com.mx — Hoja de estilos
   Paleta: negro, grafito, gris, blanco + plata como énfasis
   ========================================================= */

:root {
  --black: #000000;
  --graphite: #1d1f22;
  --steel: #3a3d41;
  --gray: #e4e6e8;
  --gray-soft: #f1f2f3;
  --muted: #5c6166;
  --silver: #c0c4c8;
  --silver-light: #e9ebed;
  --silver-deep: #8d9297;
  --white: #ffffff;
  --ink: #1d1f22;

  --metal: linear-gradient(180deg, #f4f5f6 0%, #d3d6d9 45%, #b3b8bd 55%, #d8dbde 100%);

  --font: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --wrap: 1180px;
  --gutter: max(1.25rem, env(safe-area-inset-left, 0px));
  --gutter-r: max(1.25rem, env(safe-area-inset-right, 0px));
  --header-h: 68px;
  --section-y: clamp(3.5rem, 8vw, 6.5rem);
}

/* ---------- Base ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + env(safe-area-inset-top, 0px) + 12px);
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--white);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  overflow-x: hidden;
}

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

h1, h2, h3 {
  font-family: var(--font);
  line-height: 1.1;
  margin: 0 0 0.6em;
  text-wrap: balance;
}

h2 {
  font-size: clamp(1.75rem, 3.6vw, 2.6rem);
  font-weight: 700;
  font-stretch: 112%;
  letter-spacing: -0.01em;
}

h3 {
  font-size: 1.2rem;
  font-weight: 700;
  font-stretch: 105%;
}

p { margin: 0 0 1.1em; }

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }

.prose a:not(.btn),
.section-note a {
  color: var(--ink);
  text-decoration-color: var(--silver-deep);
  text-decoration-thickness: 2px;
  font-weight: 600;
}
.prose a:not(.btn):hover,
.section-note a:hover { text-decoration-color: var(--ink); }

:focus-visible {
  outline: 3px solid var(--silver);
  outline-offset: 3px;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter-r);
}

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -100px;
  z-index: 100;
  padding: 0.6rem 1rem;
  background: var(--white);
  color: var(--black);
  font-weight: 700;
}
.skip-link:focus { top: calc(0.5rem + env(safe-area-inset-top, 0px)); }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.75rem 1.4rem;
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.2;
  text-decoration: none;
  text-align: center;
  border-radius: 2px;
  border: 1px solid transparent;
  transition: filter 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.btn-silver {
  background: var(--metal);
  color: var(--black);
  border-color: #f4f5f6;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.18);
}
.btn-silver:hover { filter: brightness(1.08); }

.btn-ghost {
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.55);
  background: rgba(0, 0, 0, 0.25);
}
.btn-ghost:hover { border-color: var(--silver); background: rgba(0, 0, 0, 0.5); }

.btn-dark {
  background: var(--graphite);
  color: var(--white);
  border-color: var(--graphite);
}
.btn-dark:hover { background: var(--black); }

.btn-lg { min-height: 56px; padding: 1rem 2rem; font-size: 1.1rem; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--graphite);
  color: var(--white);
  border-bottom: 1px solid var(--steel);
  padding-top: env(safe-area-inset-top, 0px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--header-h);
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--silver);
}
.brand-mark { width: 38px; height: 38px; }
.brand-name {
  color: var(--silver-light);
  font-size: 1.12rem;
  font-weight: 400;
  font-stretch: 110%;
  letter-spacing: -0.01em;
}
.brand-strong { font-weight: 800; color: var(--white); }

.main-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.main-nav a {
  display: block;
  padding: 0.55rem 0.8rem;
  color: #cfd2d5;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.97rem;
}
.main-nav a:hover { color: var(--white); }
.main-nav .nav-cta {
  margin-left: 0.5rem;
  background: var(--metal);
  color: var(--black);
  font-weight: 700;
  border-radius: 2px;
  padding: 0.55rem 1rem;
}
.main-nav .nav-cta:hover { filter: brightness(1.08); color: var(--black); }

/* Menú móvil sin JavaScript (checkbox) */
.nav-toggle {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}
.nav-burger {
  display: none;
  width: 48px;
  height: 48px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: 1px solid var(--steel);
  border-radius: 2px;
}
.nav-toggle:focus-visible + .nav-burger { outline: 3px solid var(--silver); outline-offset: 2px; }

.nav-burger-lines,
.nav-burger-lines::before,
.nav-burger-lines::after {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--silver-light);
  position: relative;
  transition: transform 0.2s ease, background-color 0.2s ease;
}
.nav-burger-lines::before,
.nav-burger-lines::after { content: ""; position: absolute; left: 0; }
.nav-burger-lines::before { top: -7px; }
.nav-burger-lines::after { top: 7px; }

.nav-toggle:checked + .nav-burger .nav-burger-lines { background: transparent; }
.nav-toggle:checked + .nav-burger .nav-burger-lines::before { transform: translateY(7px) rotate(45deg); }
.nav-toggle:checked + .nav-burger .nav-burger-lines::after { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 920px) {
  .nav-burger { display: inline-flex; }
  .main-nav {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    background: var(--graphite);
    border-bottom: 1px solid var(--steel);
    padding: 0.5rem var(--gutter-r) 1.25rem var(--gutter);
    max-height: calc(100vh - var(--header-h));
    overflow-y: auto;
  }
  .nav-toggle:checked ~ .main-nav { display: block; }
  .main-nav ul { flex-direction: column; align-items: stretch; gap: 0; }
  .main-nav a { padding: 0.9rem 0.25rem; border-bottom: 1px solid var(--steel); font-size: 1.05rem; }
  .main-nav .nav-cta { margin: 1rem 0 0; text-align: center; border-bottom: 0; padding: 0.9rem 1rem; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  color: var(--white);
  background-color: var(--black);
  background-image:
    linear-gradient(90deg, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.72) 50%, rgba(0, 0, 0, 0.35) 100%),
    url("../img/hero-zinc.svg");
  background-size: cover;
  background-position: center;
  min-height: min(88vh, 820px);
  display: flex;
  align-items: center;
  border-bottom: 4px solid var(--silver);
}

.hero-inner { padding-block: clamp(4rem, 12vw, 8rem); }

.hero h1 {
  font-size: clamp(2.5rem, 7.2vw, 5.6rem);
  font-weight: 800;
  font-stretch: 118%;
  letter-spacing: -0.025em;
  line-height: 0.98;
  max-width: 13ch;
  margin-bottom: 0.45em;
  color: var(--white);
}

@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  @media (prefers-reduced-motion: no-preference) {
    .hero h1 {
      background: linear-gradient(100deg, #ffffff 38%, #9aa0a6 50%, #ffffff 62%);
      background-size: 260% 100%;
      background-position: 100% 0;
      -webkit-background-clip: text;
      background-clip: text;
      color: transparent;
      animation: zinc-sheen 1.8s ease-out 0.3s 1 both;
    }
  }
}

@keyframes zinc-sheen {
  from { background-position: 100% 0; }
  to { background-position: 0% 0; }
}

.hero-lead {
  font-size: clamp(1.25rem, 2.4vw, 1.7rem);
  font-weight: 600;
  font-stretch: 100%;
  line-height: 1.3;
  color: var(--silver);
  max-width: 34ch;
  margin-bottom: 1rem;
}

.hero-sub {
  font-size: 1.08rem;
  color: #d5d8db;
  max-width: 60ch;
  margin-bottom: 2rem;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }

/* ---------- Secciones ---------- */
.section { padding-block: var(--section-y); }
.section-white { background: var(--white); }
.section-gray { background: var(--gray); }
.section-black { background: var(--black); color: #d9dcdf; }
.section-black h2 { color: var(--white); }

.wrap.prose > * { max-width: 68ch; }

.section h2 {
  padding-bottom: 0.5rem;
  background: linear-gradient(var(--silver-deep), var(--silver-deep)) left bottom / 56px 3px no-repeat;
}
.section-black h2 {
  background: linear-gradient(var(--silver), var(--silver)) left bottom / 56px 3px no-repeat;
}

.section-head { max-width: 68ch; margin-bottom: 2.5rem; }
.section-head p { color: var(--muted); font-size: 1.1rem; }

.section-note {
  margin: 2.5rem 0 0;
  padding-top: 1.25rem;
  border-top: 1px solid #c9cdd1;
  max-width: 72ch;
}

/* ---------- Proceso (secuencia real, numerada) ---------- */
.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: paso;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  border-top: 2px solid var(--silver-deep);
}

.step {
  counter-increment: paso;
  position: relative;
  padding: 1.75rem 1.5rem 1.75rem 0;
  border-bottom: 1px solid #c9cdd1;
}
.step:not(:nth-child(3n + 1)) { padding-left: 1.5rem; border-left: 1px solid #c9cdd1; }

.step::before {
  content: counter(paso, decimal-leading-zero);
  display: block;
  font-size: 2.6rem;
  font-weight: 800;
  font-stretch: 75%;
  line-height: 1;
  color: var(--silver-deep);
  margin-bottom: 0.75rem;
}
.step p { margin: 0; color: #3a3d41; }

.step-key { background: var(--black); color: var(--white); }
.step-key.step { padding-left: 1.5rem; padding-right: 1.5rem; }
.step-key::before { color: var(--silver); }
.step-key p { color: #d9dcdf; }

@media (max-width: 900px) {
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .step:not(:nth-child(3n + 1)) { padding-left: 0; border-left: 0; }
  .step:nth-child(2n) { padding-left: 1.5rem; border-left: 1px solid #c9cdd1; }
}
@media (max-width: 600px) {
  .steps { grid-template-columns: 1fr; }
  .step:nth-child(2n) { padding-left: 0; border-left: 0; }
  .step { padding-right: 0; }
  .step-key.step { padding-left: 1.25rem; padding-right: 1.25rem; }
}

/* ---------- Capas (elemento protagonista) ---------- */
.layers-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}
.layers-text p { max-width: 58ch; }

.layers { margin: 0; }

.layers-stack {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid #4a4e53;
}

.layer {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1.1rem;
  line-height: 1.35;
}
.layer-name { font-weight: 800; font-stretch: 112%; font-size: 1.05rem; }
.layer-data { font-size: 0.95rem; }

.layer-eta {
  min-height: 76px;
  background: linear-gradient(180deg, #f7f8f9, #dfe2e5);
  color: var(--black);
}
.layer-zeta {
  min-height: 96px;
  color: var(--black);
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.35) 0 3px, rgba(0, 0, 0, 0.06) 3px 9px),
    linear-gradient(180deg, #cfd3d6, #b8bdc1);
}
.layer-delta {
  min-height: 76px;
  color: var(--black);
  background: linear-gradient(180deg, #a9aeb3, #979ca1);
}
.layer-gamma {
  min-height: 52px;
  color: var(--white);
  background: #6d7277;
}
.layer-steel {
  min-height: 104px;
  color: var(--silver-light);
  background:
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.04) 0 2px, transparent 2px 7px),
    #2b2e32;
}

.layers figcaption {
  margin-top: 0.8rem;
  font-size: 0.88rem;
  color: #9ea3a8;
}

@media (max-width: 900px) {
  .layers-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .layer { grid-template-columns: 1fr; gap: 0.2rem; }
}

/* ---------- Pilares de protección ---------- */
.pillars {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1.5rem, 3vw, 2.5rem);
}
.pillar {
  border-top: 3px solid var(--silver);
  padding-top: 1.25rem;
}
.pillar p { color: #3a3d41; margin: 0; }

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

/* ---------- Rejilla ---------- */
.split {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}
.split .prose { max-width: 64ch; }

.checks {
  list-style: none;
  padding: 0;
  margin: 0 0 2rem;
}
.checks li {
  position: relative;
  padding: 0.45rem 0 0.45rem 1.9rem;
  border-bottom: 1px solid #c9cdd1;
}
.checks li::before {
  content: "";
  position: absolute;
  left: 0.2rem;
  top: 0.95rem;
  width: 0.7rem;
  height: 0.7rem;
  background: var(--metal);
  border: 1px solid var(--silver-deep);
  transform: rotate(45deg);
}

.grating-figure {
  margin: 0;
  background: var(--graphite);
  padding: clamp(1rem, 3vw, 1.75rem);
  border-bottom: 4px solid var(--silver);
}
.grating-figure figcaption {
  color: #b7bbc0;
  font-size: 0.9rem;
  margin-top: 0.9rem;
}

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

/* ---------- Tabla comparativa ---------- */
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid #c9cdd1;
}
.compare {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  font-size: 0.98rem;
}
.compare th,
.compare td {
  text-align: left;
  vertical-align: top;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid #d6d9dc;
}
.compare thead th {
  background: var(--graphite);
  color: var(--white);
  font-weight: 700;
  border-bottom: 3px solid var(--silver);
}
.compare tbody th { font-weight: 700; background: var(--gray-soft); width: 24%; }
.compare td:nth-child(2) { background: #eceef0; font-weight: 600; }
.compare tbody tr:last-child th,
.compare tbody tr:last-child td { border-bottom: 0; }

/* ---------- FAQ ---------- */
.faq-wrap > * { max-width: 860px; }
.faq { border-top: 2px solid var(--ink); }

.faq details { border-bottom: 1px solid #c9cdd1; }

.faq summary {
  list-style: none;
  cursor: pointer;
  position: relative;
  padding: 1.2rem 3rem 1.2rem 0;
  font-weight: 700;
  font-size: 1.1rem;
  line-height: 1.35;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  position: absolute;
  right: 0.25rem;
  top: 50%;
  transform: translateY(-50%);
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  font-size: 1.4rem;
  font-weight: 500;
  border: 1px solid var(--silver-deep);
  border-radius: 50%;
}
.faq details[open] summary::after { content: "\2212"; background: var(--graphite); color: var(--white); border-color: var(--graphite); }
.faq summary:hover { color: #000; }
.faq details p { margin: 0 0 1.4rem; color: #3a3d41; max-width: 68ch; }

/* ---------- CTA ---------- */
.cta {
  background:
    radial-gradient(ellipse at 50% 120%, rgba(192, 196, 200, 0.28), transparent 60%),
    var(--black);
  color: var(--white);
  padding-block: clamp(4rem, 9vw, 6.5rem);
  text-align: center;
  border-top: 4px solid var(--silver);
}
.cta-inner { max-width: calc(760px + var(--gutter) + var(--gutter-r)); }
.cta h2 {
  font-size: clamp(1.9rem, 4.2vw, 3rem);
  font-weight: 800;
  font-stretch: 115%;
}
.cta p { color: #c7cbcf; font-size: 1.1rem; margin-bottom: 2rem; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--graphite);
  color: #b7bbc0;
  padding-top: 3.5rem;
  font-size: 0.97rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 2rem;
  padding-bottom: 2.5rem;
}
.footer-brand {
  font-size: 1.2rem;
  font-stretch: 110%;
  color: var(--silver-light);
  margin-bottom: 0.6rem;
}
.footer-title {
  color: var(--white);
  font-weight: 700;
  margin-bottom: 0.6rem;
}
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li a {
  display: inline-block;
  padding: 0.3rem 0;
  color: #b7bbc0;
  text-decoration: none;
}
.site-footer li a:hover { color: var(--white); text-decoration: underline; }

.footer-bottom {
  border-top: 1px solid var(--steel);
  padding-top: 1.25rem;
  padding-bottom: 1.5rem;
  font-size: 0.88rem;
  color: #8d9297;
}
.footer-bottom p { margin: 0; }

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

/* ---------- Página 404 ---------- */
.notfound {
  min-height: 70vh;
  display: flex;
  align-items: center;
  background: var(--gray);
}
.notfound h1 { font-size: clamp(2rem, 5vw, 3.2rem); font-stretch: 112%; }

/* ---------- Impresión ---------- */
@media print {
  .site-header, .cta, .hero-actions { display: none; }
  .hero { background: none; color: #000; min-height: 0; border: 0; }
  .hero h1, .hero-lead, .hero-sub { color: #000; background: none; }
  .faq details { display: block; }
}
