/* Apóstrofe · Versión B — dirección "informe técnico industrial" */
:root {
  --navy: #0e1c36;
  --navy-2: #16294b;
  --steel: #3d5a86;
  --ink: #0e1c36;
  --ink-2: #4a5872;
  --paper: #ffffff;
  --mist: #f1f3f7;
  --line: #dde2ea;
  --line-dark: rgba(255,255,255,.16);
  --red: #c8202a;
  --red-2: #a8171f;
  --sans: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", monospace;
  --ease-out: cubic-bezier(.23, 1, .32, 1);
  --wrap: 1240px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; font-family: var(--sans); font-size: 1.0625rem; line-height: 1.6; color: var(--ink); background: var(--paper); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -.02em; line-height: 1.08; text-wrap: balance; }
p { margin: 0; }
::selection { background: var(--red); color: #fff; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; border-radius: 2px; }

.wrap { width: min(100% - 48px, var(--wrap)); margin-inline: auto; }
.mono { font-family: var(--mono); font-weight: 500; letter-spacing: .02em; }
.skip { position: absolute; left: 16px; top: -60px; z-index: 100; background: var(--red); color: #fff; padding: 10px 16px; text-decoration: none; }
.skip:focus { top: 12px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 22px; font: 600 .98rem/1 var(--sans); text-decoration: none; border: 1.5px solid transparent; border-radius: 2px; cursor: pointer; transition: background-color .2s ease, border-color .2s ease, color .2s ease, transform .16s var(--ease-out); }
.btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s var(--ease-out); }
.btn:active { transform: scale(.97); }
.btn-red { background: var(--red); color: #fff; }
.btn-red:hover { background: var(--red-2); }
.btn-line { border-color: rgba(255,255,255,.55); color: #fff; }
.btn-line:hover { border-color: #fff; background: rgba(255,255,255,.08); }
.btn-small { min-height: 40px; padding: 0 16px; font-size: .9rem; }
.btn-block { width: 100%; justify-content: center; }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 60; background: var(--navy); color: #fff; transition: box-shadow .25s ease; }
.site-header.scrolled { box-shadow: 0 1px 0 var(--line-dark), 0 8px 24px rgba(6,14,30,.25); }
.header-inner { height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: #fff; position: relative; z-index: 61; }
.brand-mark { --w: 22px; width: var(--w); height: calc(var(--w) * 206 / 122); position: relative; overflow: hidden; flex: none; }
.brand-mark img { position: absolute; max-width: none; width: calc(var(--w) * 567 / 122); height: auto; left: calc(var(--w) * -211 / 122); top: calc(var(--w) * -178 / 122); }
.brand-name { font-weight: 800; font-size: 1.25rem; letter-spacing: .08em; line-height: 1; display: flex; flex-direction: column; gap: 5px; font-stretch: 90%; }
.brand-name small { font: 500 .66rem/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: rgba(255,255,255,.66); }
.nav { display: flex; align-items: center; gap: 28px; }
.nav a:not(.btn) { color: rgba(255,255,255,.8); text-decoration: none; font-size: .95rem; font-weight: 500; position: relative; padding: 6px 0; transition: color .2s ease; }
.nav a:not(.btn)::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--red); transform: scaleX(0); transform-origin: left; transition: transform .25s var(--ease-out); }
.nav a:not(.btn):hover, .nav a.active { color: #fff; }
.nav a.active::after { transform: scaleX(1); }
.menu-toggle { display: none; }

/* Hero */
.hero { position: relative; color: #fff; background: var(--navy); overflow: hidden; display: flex; flex-direction: column; min-height: min(calc(100svh - 72px), 820px); }
.hero-media { position: absolute; inset: 0; margin: 0; }
.hero-media img { width: 100%; height: 100%; object-fit: cover; object-position: 70% 50%; opacity: 0; transform: scale(1.04); transition: opacity .9s ease, transform 1.4s var(--ease-out); }
.loaded .hero-media img, html:not(.js) .hero-media img { opacity: 1; transform: none; }
.hero-media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(14,28,54,.96) 0%, rgba(14,28,54,.88) 38%, rgba(14,28,54,.35) 72%, rgba(14,28,54,.15) 100%); }
.hero-inner { position: relative; flex: 1; display: flex; flex-direction: column; justify-content: center; padding-block: clamp(56px, 9vw, 112px); max-width: var(--wrap); }
.hero-tag { font-size: .82rem; color: rgba(255,255,255,.72); margin-bottom: 22px; display: flex; align-items: center; gap: 10px; }
.hero-tag::before { content: ""; width: 28px; height: 2px; background: var(--red); }
.hero-tag .mono { text-transform: uppercase; letter-spacing: .14em; }
.hero h1 { font-size: clamp(2.3rem, 5.2vw, 4.4rem); font-weight: 750; font-stretch: 88%; max-width: 15ch; }
.comma { color: var(--red); }
.hero .lead { margin-top: 24px; max-width: 46ch; font-size: clamp(1.05rem, 1.4vw, 1.2rem); color: rgba(255,255,255,.84); }
.hero-actions { margin-top: 36px; display: flex; flex-wrap: wrap; gap: 12px; }
.hero-bar { position: relative; border-top: 1px solid var(--line-dark); background: rgba(10,21,42,.72); backdrop-filter: blur(6px); }
.hero-bar-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px 32px; flex-wrap: wrap; padding-block: 18px; }
.hero-services { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 28px; font-size: .95rem; font-weight: 500; }
.hero-services .mono { color: var(--red); font-size: .78rem; margin-right: 6px; }
.hero-phones { display: flex; gap: 6px 22px; flex-wrap: wrap; font: 500 .92rem var(--mono); }
.hero-phones a { text-decoration: none; color: #fff; }
.hero-phones a:hover { color: #ff9aa0; }

/* Sections */
.section { padding-block: clamp(72px, 9vw, 128px); }
.sec-label { display: flex; align-items: center; gap: 12px; font: 500 .8rem var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2); padding-bottom: 14px; border-bottom: 1px solid var(--line); margin-bottom: clamp(32px, 4vw, 56px); }
.sec-label .mono { color: var(--red); }
.sec-label-light { color: rgba(255,255,255,.7); border-color: var(--line-dark); }
.sec-head { display: grid; grid-template-columns: 1fr 1fr; gap: 24px 64px; align-items: end; margin-bottom: clamp(36px, 4vw, 56px); }
.sec-head h2 { font-size: clamp(1.9rem, 3.4vw, 2.9rem); font-stretch: 90%; }
.sec-head p { color: var(--ink-2); max-width: 52ch; }

/* About */
.about-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(32px, 6vw, 88px); align-items: center; }
.about-main h2 { font-size: clamp(1.9rem, 3.6vw, 3rem); font-stretch: 90%; }
.about-main p { margin-top: 24px; color: var(--ink-2); max-width: 58ch; }
.about-media { margin: 0; aspect-ratio: 4 / 5; overflow: hidden; background: var(--mist); }
.about-media img { width: 100%; height: 100%; object-fit: cover; }
.vm { display: grid; grid-template-columns: 1fr 1fr; margin-top: clamp(48px, 6vw, 80px); border-top: 2px solid var(--navy); }
.vm article { padding: 28px 32px 0 0; }
.vm article + article { padding-left: 32px; border-left: 1px solid var(--line); }
.vm h3 { font-size: 1.05rem; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 12px; display: flex; align-items: center; gap: 10px; }
.vm h3::before { content: ","; color: var(--red); font-size: 1.8rem; line-height: 0; transform: translateY(-4px); }
.vm p { color: var(--ink-2); }

/* Services */
.services { background: var(--mist); }
.service-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); background: #fff; border: 1px solid var(--line); }
.service-grid li { padding: 32px 28px 36px; position: relative; display: flex; flex-direction: column; gap: 14px; }
.service-grid li + li { border-left: 1px solid var(--line); }
.service-grid li::before { content: ""; position: absolute; left: 0; right: 0; top: -1px; height: 3px; background: var(--red); transform: scaleX(0); transform-origin: left; transition: transform .3s var(--ease-out); }
.service-grid .mono { font-size: .82rem; color: var(--steel); }
.service-grid h3 { font-size: 1.35rem; font-stretch: 92%; }
.service-grid p { color: var(--ink-2); font-size: .98rem; }

/* Values */
.values { background: var(--navy); color: #fff; }
.value-list { margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 40px; }
.value-list dt { font-size: 1.3rem; font-weight: 700; font-stretch: 92%; margin-bottom: 10px; display: flex; align-items: baseline; gap: 8px; }
.value-list dt::before { content: ","; color: var(--red); font-size: 1.9rem; line-height: 0; }
.value-list dd { margin: 0; color: rgba(255,255,255,.74); font-size: .98rem; }

/* Field gallery: horizontal filmstrip */
.gallery { display: grid; grid-auto-flow: column; grid-auto-columns: clamp(240px, 30vw, 380px); gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px max(24px, calc((100vw - var(--wrap)) / 2)) 20px; scroll-padding-inline: max(24px, calc((100vw - var(--wrap)) / 2)); scrollbar-color: var(--steel) var(--mist); }
.g { scroll-snap-align: start; aspect-ratio: 3 / 4; padding: 0; border: 0; background: var(--mist); cursor: zoom-in; overflow: hidden; transition: transform .16s var(--ease-out); }
.g img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease-out); }
.g:active { transform: scale(.985); }

/* Clients */
.clients { background: var(--mist); }
.logo-wall { background: #fff; border: 1px solid var(--line); padding: clamp(20px, 3vw, 40px); display: grid; gap: 16px; }
.logo-wall img { width: 100%; height: auto; }

/* Blog */
.posts { display: grid; gap: 0; border-top: 1px solid var(--line); }
.post { display: grid; grid-template-columns: 280px 1fr; gap: 32px; padding-block: 32px; border-bottom: 1px solid var(--line); text-decoration: none; }
.post-img { aspect-ratio: 16 / 10; overflow: hidden; background: var(--mist); }
.post-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease-out); }
.post-meta { font-size: .8rem; color: var(--steel); margin-bottom: 10px; }
.post h3 { font-size: clamp(1.25rem, 2vw, 1.6rem); font-stretch: 92%; margin-bottom: 12px; transition: color .2s ease; }
.post-body > p:not(.post-meta) { color: var(--ink-2); max-width: 64ch; }
.read { margin-top: 16px; display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--red); }
.read svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s var(--ease-out); }

/* Contact */
.contact { background: var(--navy); color: #fff; }
.contact-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: clamp(36px, 6vw, 88px); align-items: start; }
.contact-copy h2 { font-size: clamp(1.9rem, 3.4vw, 2.9rem); font-stretch: 90%; }
.contact-copy > p { margin-top: 20px; color: rgba(255,255,255,.78); max-width: 46ch; }
.contact-lines { list-style: none; margin: 32px 0 0; padding: 0; border-top: 1px solid var(--line-dark); }
.contact-lines li { border-bottom: 1px solid var(--line-dark); }
.contact-lines a { display: flex; align-items: center; gap: 14px; min-height: 60px; text-decoration: none; font-weight: 500; transition: color .2s ease; }
.contact-lines a:hover { color: #ff9aa0; }
.contact-lines svg { width: 20px; height: 20px; fill: none; stroke: var(--red); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.form { background: #fff; color: var(--ink); padding: clamp(24px, 3.5vw, 44px); border-top: 4px solid var(--red); display: grid; gap: 18px; }
.field { display: grid; gap: 6px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field label { font-size: .9rem; font-weight: 600; }
.opt { font-weight: 400; color: var(--ink-2); }
.field input, .field select, .field textarea { width: 100%; font: inherit; font-size: 1rem; color: var(--ink); background: var(--mist); border: 1px solid var(--line); border-bottom: 2px solid #b9c2d0; border-radius: 0; padding: 12px 14px; transition: border-color .2s ease, background-color .2s ease; }
.field textarea { resize: vertical; min-height: 120px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; background: #fff; border-bottom-color: var(--navy); }
.field.invalid input, .field.invalid select, .field.invalid textarea { border-bottom-color: var(--red); background: #fdf3f3; }
.err { font-size: .85rem; color: var(--red); min-height: 0; }
.err:empty { display: none; }
.check { grid-template-columns: auto 1fr; align-items: start; column-gap: 10px; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--red); }
.check .err { grid-column: 1 / -1; }
.form-success { background: #eef6f0; border-left: 3px solid #1f8f4e; padding: 14px 16px; font-size: .95rem; }
.form-success a { color: #1f6f3e; font-weight: 600; }

/* Footer */
.footer { background: #0a1529; color: rgba(255,255,255,.76); padding-top: 64px; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 48px; padding-bottom: 48px; }
.footer-brand p { margin-top: 20px; max-width: 44ch; font-size: .95rem; }
.footer h3 { font: 500 .78rem var(--mono); letter-spacing: .14em; text-transform: uppercase; color: #fff; margin-bottom: 16px; }
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.to-top { display: inline-block; padding-block: 8px; }
.footer a, .footer .linklike { text-decoration: none; font-size: .95rem; transition: color .2s ease; }
.footer a:hover, .footer .linklike:hover { color: #fff; }
.socials { display: flex; gap: 8px; margin-top: 20px; }
.socials a { width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid var(--line-dark); transition: background-color .2s ease, border-color .2s ease, transform .16s var(--ease-out); }
.socials a:hover { background: var(--red); border-color: var(--red); }
.socials a:active { transform: scale(.94); }
.socials svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.footer-base { padding-right: 84px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-block: 22px; border-top: 1px solid var(--line-dark); font-size: .85rem; }

/* WhatsApp float */
.wa-float { position: fixed; right: 20px; bottom: 20px; z-index: 50; width: 56px; height: 56px; border-radius: 50%; background: #1f8f4e; color: #fff; display: grid; place-items: center; box-shadow: 0 8px 24px rgba(6,14,30,.28); transition: transform .2s var(--ease-out), background-color .2s ease; }
.wa-float:hover { background: #18773f; }
.wa-float:active { transform: scale(.94); }
.wa-float svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* Dialogs */
dialog { border: 0; padding: 0; max-width: min(92vw, 680px); background: #fff; color: var(--ink); }
dialog::backdrop { background: rgba(6,14,30,.72); }
dialog[open] { animation: dlgIn .28s var(--ease-out); }
dialog[open]::backdrop { animation: fadeIn .28s ease; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes dlgIn { from { opacity: 0; transform: translateY(10px) scale(.97); } }
.policy-inner { padding: clamp(28px, 4vw, 48px); display: grid; gap: 16px; position: relative; border-top: 4px solid var(--red); }
.policy h2 { font-size: 1.7rem; padding-right: 40px; }
.policy p { color: var(--ink-2); }
.policy .btn { justify-self: start; margin-top: 8px; }
.dialog-close { position: absolute; top: 14px; right: 14px; width: 44px; height: 44px; border: 0; background: var(--mist); color: var(--ink); cursor: pointer; display: grid; place-items: center; transition: background-color .15s ease, transform .16s var(--ease-out); z-index: 2; }
.dialog-close:hover { background: var(--line); }
.dialog-close:active, .lb-nav:active { transform: scale(.94); }
.dialog-close svg, .lb-nav svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.lightbox { max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; background: transparent; display: none; }
.lightbox[open] { display: grid; place-items: center; }
.lightbox::backdrop { background: rgba(6,14,30,.94); }
.lightbox figure { margin: 0; display: grid; gap: 12px; justify-items: center; }
.lightbox img { max-width: 88vw; max-height: 80vh; object-fit: contain; }
.lightbox figcaption { color: rgba(255,255,255,.82); font: .85rem var(--mono); text-align: center; }
.lightbox .dialog-close { position: fixed; }
.lb-nav { position: fixed; top: calc(50% - 26px); width: 52px; height: 52px; border: 1px solid rgba(255,255,255,.3); background: rgba(14,28,54,.6); color: #fff; cursor: pointer; display: grid; place-items: center; transition: background-color .15s ease, transform .16s var(--ease-out); }
.lb-nav:hover { background: var(--red); border-color: var(--red); }
.lb-prev { left: 20px; } .lb-next { right: 20px; }

/* Scroll reveal (activated by app.js only when motion is welcome) */
.reveal-on .rv { opacity: 0; transform: translateY(16px); transition: opacity .7s var(--ease-out), transform .7s var(--ease-out); }
.reveal-on .rv.in { opacity: 1; transform: none; }

/* Hover motion only with a real pointer */
@media (hover: hover) and (pointer: fine) {
  .btn:hover svg { transform: translateX(3px); }
  .service-grid li:hover::before { transform: scaleX(1); }
  .g:hover img { transform: scale(1.04); }
  .post:hover h3 { color: var(--red); }
  .post:hover .post-img img { transform: scale(1.03); }
  .post:hover .read svg { transform: translateX(4px); }
}

/* Tablet */
@media (max-width: 1080px) {
  .service-grid { grid-template-columns: 1fr 1fr; }
  .service-grid li:nth-child(3) { border-left: 0; }
  .service-grid li:nth-child(n+3) { border-top: 1px solid var(--line); }
  .value-list { grid-template-columns: 1fr 1fr; gap: 36px 48px; }
}

/* Mobile */
@media (max-width: 900px) {
  .menu-toggle { display: flex; flex-direction: column; justify-content: center; gap: 6px; width: 44px; height: 44px; border: 0; background: transparent; cursor: pointer; position: relative; z-index: 61; padding: 0 10px; }
  .menu-toggle span { display: block; height: 2px; background: #fff; transition: transform .25s var(--ease-out); }
  .menu-toggle[aria-expanded="true"] span:first-child { transform: translateY(4px) rotate(45deg); }
  .menu-toggle[aria-expanded="true"] span:last-child { transform: translateY(-4px) rotate(-45deg); }
  .nav { position: fixed; inset: 0; background: var(--navy); flex-direction: column; align-items: flex-start; justify-content: center; gap: 8px; padding: 96px 32px 40px; visibility: hidden; opacity: 0; transition: opacity .18s ease, visibility 0s .18s; }
  .nav.open { visibility: visible; opacity: 1; transition: opacity .25s var(--ease-out); }
  .nav a:not(.btn) { font-size: 1.6rem; font-weight: 700; color: #fff; padding: 8px 0; }
  .nav-cta { margin-top: 24px; }
  .header-inner { height: 64px; }
  .hero { min-height: auto; }
  .hero-media { position: relative; height: 260px; }
  .hero-media::after { background: linear-gradient(180deg, rgba(14,28,54,0) 55%, rgba(14,28,54,1) 100%); }
  .hero-media img { object-position: 60% 70%; }
  .hero-inner { padding-top: 8px; }
  .sec-head, .about-grid, .contact-grid { grid-template-columns: 1fr; }
  .about-media { aspect-ratio: 16 / 11; }
  .vm { grid-template-columns: 1fr; }
  .vm article { padding-right: 0; }
  .vm article + article { padding-left: 0; border-left: 0; border-top: 1px solid var(--line); margin-top: 28px; }
  .post { grid-template-columns: 1fr; gap: 18px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .wrap { width: min(100% - 36px, var(--wrap)); }
  .service-grid { grid-template-columns: 1fr; }
  .service-grid li + li { border-left: 0; border-top: 1px solid var(--line); }
  .value-list { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr; }
  .hero-actions .btn { width: 100%; justify-content: center; }
  .hero-bar-inner { padding-bottom: 84px; }
  .lb-nav { top: auto; bottom: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .hero-media img { opacity: 1; transform: none; }
}

/* Footer touch targets + alignment */
.footer .linklike { text-align: left; }
.footer ul a, .footer ul .linklike { display: inline-block; padding-block: 6px; }
.footer ul { gap: 2px; }
