/* Fragox Ingeniería — hoja de estilos */
:root {
  --paper: #F3F5F4;
  --surface: #FFFFFF;
  --ink: #1C2228;
  --muted: #56616B;
  --rule: #CDD4D9;
  --grid: #E1E6E9;
  --red: #B3263A;
  --red-dark: #8F1C2D;
  --navy: #173B5E;
  --navy-ink: #E8EEF4;
  --focus: #1F6FD1;
  --radius-s: 4px;
  --radius-m: 10px;
  --wrap: 1160px;
  --font: "Archivo", "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--font); font-size: 1.0625rem; line-height: 1.6;
  font-variation-settings: "wdth" 100;
}
img, svg { max-width: 100%; }
a { color: var(--red); text-underline-offset: 3px; }
a:hover { color: var(--red-dark); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 2px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 14px; z-index: 100; }
.skip:focus { left: 16px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 32px; } }
.narrow { max-width: var(--wrap); }
.narrow > *, .prose > * { max-width: 760px; }

h1, h2, h3 { line-height: 1.12; margin: 0 0 .5em; font-weight: 700; letter-spacing: -0.01em; }
h1 { font-size: clamp(2.1rem, 5.2vw, 3.6rem); font-variation-settings: "wdth" 112; font-weight: 750; letter-spacing: -0.02em; }
h2 { font-size: clamp(1.45rem, 2.6vw, 1.9rem); font-variation-settings: "wdth" 108; }
h3 { font-size: 1.2rem; font-variation-settings: "wdth" 104; }
p { margin: 0 0 1em; }
.lead { font-size: clamp(1.1rem, 1.7vw, 1.3rem); color: var(--muted); max-width: 62ch; }
.muted { color: var(--muted); }

/* Cabecera */
.site-header { background: var(--surface); border-bottom: 1px solid var(--rule); position: sticky; top: 0; z-index: 50; }
.header-row { display: flex; align-items: center; justify-content: space-between; min-height: 68px; gap: 16px; }
.brand { display: flex; align-items: center; text-decoration: none; padding: 6px 0; }
.brand img { display: block; height: 48px; width: auto; }
@media (max-width: 520px) { .brand img { height: 40px; } }
.site-nav { display: flex; gap: 4px; }
.site-nav a { color: var(--ink); text-decoration: none; padding: 8px 10px; border-radius: var(--radius-s); font-size: .98rem; }
.site-nav a:hover { background: var(--paper); color: var(--ink); }
.site-nav a[aria-current="page"] { color: var(--red); box-shadow: inset 0 -2px 0 var(--red); border-radius: 0; }
.nav-toggle { display: none; font: inherit; background: none; border: 1px solid var(--rule); border-radius: var(--radius-s); padding: 6px 12px; color: var(--ink); cursor: pointer; }
@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .site-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--surface); border-bottom: 1px solid var(--rule); flex-direction: column; padding: 8px 16px 16px; }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 12px 8px; border-bottom: 1px solid var(--grid); }
  .site-nav a[aria-current="page"] { box-shadow: none; }
}

/* Botones */
.btns { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 22px; border-radius: var(--radius-s); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; border: 2px solid transparent; transition: background-color .15s, color .15s; }
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-dark); color: #fff; }
.btn-ghost { border-color: var(--ink); color: var(--ink); background: transparent; }
.btn-ghost:hover { background: var(--ink); color: #fff; }
.btn-light { background: #fff; color: var(--navy); }
.btn-light:hover { background: var(--navy-ink); color: var(--navy); }

/* Portada */
.hero { background: var(--surface); border-bottom: 1px solid var(--rule); overflow: hidden; }
.hero-grid { padding-top: clamp(48px, 8vw, 96px); }
.hero-copy { max-width: 820px; }
.hero h1 { max-width: 17ch; }
.profile-wrap { margin-top: clamp(16px, 3vw, 32px); position: relative; }
.profile { display: block; width: 100%; height: auto; }
.pf-m { display: none; }
@media (max-width: 900px) { .pf-d { display: none; } .pf-m { display: block; max-width: 560px; margin: 0 auto; } }
.profile .grid { stroke: var(--grid); stroke-width: 1; fill: none; }
.profile .earth { fill: var(--paper); }
.profile .hatch { stroke: var(--rule); stroke-width: 1; }
.profile .terrain { fill: none; stroke: var(--ink); stroke-width: 2.2; stroke-linejoin: round; }
.profile .tw { fill: none; stroke: var(--ink); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.profile .cond { fill: none; stroke: var(--red); stroke-width: 2; stroke-dasharray: 1; stroke-dashoffset: 0; }
.profile .cond-leg { stroke: var(--red); stroke-width: 2; }
.profile .opgw { fill: none; stroke: var(--ink); stroke-width: 1.4; stroke-dasharray: 1; stroke-dashoffset: 0; }
.profile .opgw-leg { stroke: var(--ink); stroke-width: 1.4; }
.profile .clear { fill: none; stroke: var(--navy); stroke-width: 1.3; stroke-dasharray: 7 6; }
.profile .ref { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 2 4; opacity: .55; }
.profile .dimline { stroke: var(--muted); stroke-width: 1.1; fill: none; }
.profile .arrow { fill: none; stroke: var(--muted); stroke-width: 1.4; stroke-linejoin: round; }
.profile .lbl { font-family: var(--font); font-size: 15px; font-weight: 500; fill: var(--muted); }
.profile .lbl-span { fill: var(--ink); font-weight: 600; }
.profile .lbl-bg { fill: var(--paper); }
.profile .lbl-dim { fill: var(--navy); font-weight: 600; }
.profile .lbl { paint-order: stroke; stroke: var(--surface); stroke-width: 5px; stroke-linejoin: round; }
.profile .tag circle { fill: var(--surface); stroke: var(--ink); stroke-width: 1.4; }
.profile .tag text { font-family: var(--font); font-size: 14px; font-weight: 700; fill: var(--ink); }
.pf-m .lbl { font-size: 22px; }
.pf-m .tag text { font-size: 20px; }
@media (prefers-reduced-motion: no-preference) {
  .js .profile .cond, .js .profile .opgw { stroke-dashoffset: 1; animation: draw 1.1s cubic-bezier(.45,0,.2,1) var(--d, .3s) forwards; }
  .js .profile .clear, .js .profile .dimline, .js .profile .lbl-dim, .js .profile .lbl-bg, .js .profile .lbl-span { opacity: 0; animation: fadein .6s ease 1.7s forwards; }
  @keyframes draw { to { stroke-dashoffset: 0; } }
  @keyframes fadein { to { opacity: 1; } }
}

/* Secciones */
.section { padding: clamp(48px, 7vw, 88px) 0; }
.section-alt { background: var(--surface); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.section-title { margin-bottom: 20px; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.more { font-weight: 600; }

.svc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); border-top: 2px solid var(--ink); }
.svc { display: block; padding: 28px 24px 28px 0; color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--rule); }
.svc + .svc { padding-left: 24px; border-left: 1px solid var(--rule); }
@media (max-width: 860px) { .svc + .svc { padding-left: 0; border-left: 0; } }
.svc:hover h3 { color: var(--red); }
.svc p { color: var(--muted); margin: 0; }
.icon { width: 44px; height: 44px; fill: none; stroke: var(--red); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; margin-bottom: 14px; }

.band-navy { background: var(--navy); color: var(--navy-ink); padding: 48px 0; }
.band-navy h2 { color: #fff; }
.band-navy p { margin: 0; max-width: 60ch; }
.band-row { display: flex; gap: 32px; align-items: center; justify-content: space-between; flex-wrap: wrap; }

.two-col { display: grid; grid-template-columns: 1fr; gap: 32px; }
@media (min-width: 900px) { .two-col { grid-template-columns: 5fr 7fr; gap: 64px; } }
.partners { margin-top: 56px; }
.names { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); column-gap: 24px; border-top: 1px solid var(--rule); }
.names li { padding: 14px 0; border-bottom: 1px solid var(--rule); font-weight: 600; font-variation-settings: "wdth" 106; font-size: 1.05rem; }
.names-sm li { font-weight: 500; font-size: 1rem; }

/* Artículos */
.post-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 32px; }
.post-grid.two { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.post-card { border-top: 2px solid var(--ink); padding-top: 16px; }
.post-card h3 a { color: var(--ink); text-decoration: none; }
.post-card h3 a:hover { color: var(--red); text-decoration: underline; }
.post-card p:last-child { color: var(--muted); margin: 0; }
.post-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--muted); font-size: .92rem; margin-bottom: 10px; }
.post-meta span { color: var(--red); }
.post-list { display: grid; gap: 40px; max-width: 820px; }
.post-list [hidden] { display: none; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 40px; }
.chip { font: inherit; font-size: .92rem; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--rule); background: var(--surface); color: var(--ink); cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }

.page-head { padding: clamp(40px, 7vw, 80px) 0 clamp(24px, 4vw, 40px); background: var(--surface); border-bottom: 1px solid var(--rule); }
.article .page-head h1 { font-size: clamp(1.9rem, 4.2vw, 3rem); }
.article .post-meta a { color: var(--ink); font-weight: 600; }

.prose { padding-top: 40px; padding-bottom: 56px; font-size: 1.1rem; }
.section .prose { padding-top: 0; padding-bottom: 0; }
.prose p, .prose li { max-width: 68ch; }
.prose h2 { margin-top: 1.8em; }
.prose h3 { margin-top: 1.4em; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1.2em; }
.prose li { margin-bottom: .35em; }
.prose li::marker { color: var(--red); }
.pillars li { margin-bottom: .8em; }

/* Servicios */
.svc-list { padding-top: 24px; padding-bottom: 24px; }
.svc-block { display: grid; grid-template-columns: 1fr; gap: 8px 48px; padding: 40px 0; border-bottom: 1px solid var(--rule); scroll-margin-top: 90px; }
@media (min-width: 860px) { .svc-block { grid-template-columns: 4fr 7fr; } }
.svc-head h2 { font-size: 1.5rem; }
.svc-body > p { font-size: 1.1rem; }
.ticks { list-style: none; padding: 0; margin: 0 0 1em; }
.ticks li { position: relative; padding-left: 24px; margin-bottom: .5em; }
.ticks li::before { content: ""; position: absolute; left: 0; top: .62em; width: 12px; height: 2px; background: var(--red); }
.values { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 24px; margin: 0; }
.values dt { font-weight: 700; font-size: 1.15rem; margin-bottom: 4px; }
.values dd { margin: 0; color: var(--muted); }
.values > div { border-top: 2px solid var(--ink); padding-top: 14px; }

.cta-band { background: var(--ink); color: #DDE3E7; padding: 56px 0; }
.cta-band h2 { color: #fff; }
.cta-band p { margin: 0; }
.cta-row { display: flex; flex-wrap: wrap; gap: 24px; align-items: center; justify-content: space-between; }
.cta-band .btns { margin-top: 0; }
.cta-band .btn-ghost { border-color: #fff; color: #fff; }
.cta-band .btn-ghost:hover { background: #fff; color: var(--ink); }

/* Energía */
.tariffs { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.tariff { display: block; padding: 22px; background: var(--paper); border: 1px solid var(--rule); border-radius: var(--radius-m); color: var(--ink); text-decoration: none; }
.tariff:hover { border-color: var(--red); }
.tariff:hover h3 { color: var(--red); }
.tariff p { margin: 0; color: var(--muted); font-size: .98rem; }

/* Formularios */
.card { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-m); padding: clamp(20px, 3vw, 32px); }
.form h2, .form h3 { margin-bottom: 18px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; min-width: 0; }
.field-row { display: grid; grid-template-columns: 1fr; gap: 0 16px; }
@media (min-width: 560px) { .field-row { grid-template-columns: 1fr 1fr; } }
label { font-weight: 600; font-size: .95rem; }
input, select, textarea { font: inherit; font-size: 1rem; color: var(--ink); background: #fff; border: 1px solid #A9B3BB; border-radius: var(--radius-s); padding: 11px 12px; width: 100%; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--focus); outline: 2px solid var(--focus); outline-offset: 0; }
[aria-invalid="true"] { border-color: var(--red); }
.check { flex-direction: row; align-items: flex-start; gap: 10px; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; flex: none; accent-color: var(--red); }
.check label { font-weight: 400; }
.hp { position: absolute; left: -9999px; }
.form-status { margin: 12px 0 0; font-weight: 600; min-height: 1.6em; }
.form-status.ok { color: #1F6B3A; }
.form-status.err { color: var(--red); }

.contact-info .kv { margin: 0; }
.kv > div { padding: 14px 0; border-bottom: 1px solid var(--rule); }
.kv dt { font-size: .9rem; color: var(--muted); }
.kv dd { margin: 2px 0 0; font-size: 1.1rem; font-weight: 600; }
.map-link { display: inline-block; margin-top: 20px; font-weight: 600; }

.faq details { border-bottom: 1px solid var(--rule); }
.faq summary { cursor: pointer; padding: 18px 32px 18px 0; font-weight: 600; font-size: 1.08rem; list-style: none; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 4px; top: 14px; font-size: 1.5rem; color: var(--red); font-weight: 400; }
.faq details[open] summary::after { content: "–"; }
.faq details p { color: var(--muted); margin: 0 0 18px; max-width: 68ch; }

/* Talento */
.jobs { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px; }
.job h2 { font-size: 1.4rem; }
.apply { margin-top: 56px; }

/* Pie: cajetín de plano */
.site-footer { background: var(--surface); border-top: 2px solid var(--ink); padding: 32px 0 40px; font-size: .95rem; }
.titleblock { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 2px solid var(--ink); }
@media (min-width: 900px) { .titleblock { grid-template-columns: 2fr 2fr 1.3fr 1.9fr 1.1fr; } }
.tb-cell { padding: 14px 16px; border-right: 1px solid var(--ink); border-bottom: 1px solid var(--ink); display: flex; flex-direction: column; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.tb-k { font-size: .8rem; color: var(--muted); margin-bottom: 4px; }
.tb-cell a { color: var(--ink); }
.tb-cell a:hover { color: var(--red); }
.tb-brand { flex-direction: column; align-items: flex-start; gap: 8px; grid-column: 1 / -1; }
.tb-brand img { height: 48px; width: auto; max-width: 100%; }
.tb-brand span { color: var(--muted); }
@media (min-width: 900px) { .tb-brand { grid-column: auto; } }
.tb-links { display: flex; flex-direction: column; gap: 2px; }
.tb-legal { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; gap: 8px 20px; border-bottom: 0; border-right: 0; color: var(--muted); }

/* Fotos */
.ph { margin: 0; position: relative; overflow: hidden; background: var(--grid); border-radius: var(--radius-s); }
.ph img { display: block; width: 100%; height: 100%; object-fit: cover; }
.ph figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 28px 14px 10px; font-size: .9rem; font-weight: 600; color: #fff; background: linear-gradient(transparent, rgba(16, 22, 28, .78)); }
.section-head p { margin: 0; }
.mosaic { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 220px; }
.mosaic .m-a { grid-column: span 2; grid-row: span 2; }
.mosaic .m-a img { object-position: center 40%; }
@media (min-width: 860px) {
  .mosaic { grid-template-columns: 1.4fr 1fr; grid-auto-rows: 230px; }
  .mosaic .m-a { grid-column: auto; grid-row: span 2; }
}
.svc-ph { margin-top: 20px; aspect-ratio: 4 / 3; max-width: 100%; }
@media (max-width: 859px) { .svc-ph { max-width: 420px; } }
.ph-tall { margin-top: 24px; aspect-ratio: 4 / 3; max-width: 100%; }
.ph-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 2em 0; max-width: 760px; }
.ph-pair .ph { aspect-ratio: 3 / 4; }

/* Logos de clientes */
.logos { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.logos li { flex: 0 1 145px; min-width: 0; }
@media (max-width: 520px) { .logos li { flex-basis: calc(50% - 5px); } }
.logos li { background: #fff; border: 1px solid var(--rule); border-radius: var(--radius-s); height: 92px; display: flex; align-items: center; justify-content: center; padding: 14px 18px; }
.logos img { max-width: 100%; max-height: 56px; width: auto; height: auto; object-fit: contain; filter: grayscale(1); opacity: .78; transition: filter .2s, opacity .2s; }
.logos li:hover img { filter: none; opacity: 1; }
.logos-sm li { height: 84px; }
@media (prefers-reduced-motion: reduce) { .logos img { transition: none; } }

/* Calculadora CEE */
.calc h3 { margin-bottom: 18px; }
.calc [hidden] { display: none !important; }
.calc-result { margin-top: 24px; border-top: 2px solid var(--ink); padding-top: 18px; }
.calc-total { display: flex; flex-direction: column; gap: 2px; margin-bottom: 14px; }
.calc-total span { color: var(--muted); font-size: .92rem; }
.calc-total strong { font-size: 2.4rem; line-height: 1.1; font-variation-settings: "wdth" 112; font-variant-numeric: tabular-nums; }
.calc-total small { color: var(--muted); }
.calc-lines { margin: 0 0 18px; }
.calc-lines > div { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; border-bottom: 1px solid var(--rule); }
.calc-lines dt { color: var(--muted); }
.calc-lines dd { margin: 0; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.calc-order { margin-top: 24px; border-top: 1px solid var(--rule); padding-top: 18px; }
.calc-order h4 { margin: 0 0 14px; font-size: 1.08rem; }
.field-work { padding-top: 0; }
#certificado .two-col { align-items: start; }
.trust { display: flex; flex-direction: column; gap: 24px; }
.trust-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 24px; }
.trust-head .section-title, .trust-head p { margin: 0; }
.trust .logos-sm { margin-top: 0; }
.trust-head:not(:first-child) { margin-top: 32px; }
