/* COFAN — Construcciones y Fabricaciones Industriales
   Hoja de estilos independiente y sin dependencias externas. */
:root {
  --ink: #2e3b41;
  --ink-deep: #17242a;
  --ink-mid: #425159;
  --gold: #e3ad19;
  --gold-soft: #f7eac5;
  --white: #fff;
  --paper: #f5f6f4;
  --line: #dce2e1;
  --muted: #58666b;
  --font: Arial, Helvetica, sans-serif;
  --container: 1200px;
}
*, *::before, *::after {box-sizing: border-box;}
html {scroll-behavior: smooth;scroll-padding-top: 96px;}
body {margin: 0;overflow-x: hidden;background: var(--white);color: var(--ink);font-family: var(--font);line-height: 1.65;-webkit-font-smoothing: antialiased;}
a {text-decoration: none;color: inherit;}
img {display: block;max-width: 100%;}
button {font: inherit;cursor: pointer;}
button:disabled {opacity: .4;cursor: not-allowed;}
h1, h2, h3, p {margin-top: 0;}
h1, h2, h3 {overflow-wrap: anywhere;}
:focus-visible {outline: 3px solid var(--gold);outline-offset: 4px;}
::selection {background: var(--gold);color: var(--ink-deep);}
.shell {width: min(var(--container), calc(100% - 64px));margin-inline: auto;}
.skip {position: absolute;top: -100px;left: 16px;background: var(--gold);color: var(--ink);padding: 10px 14px;z-index: 90;}
.skip:focus {top: 10px;}
/* Navegación */
.site-header {position: sticky;top: 0;z-index: 40;background: rgba(255,255,255,.98);border-bottom: 1px solid var(--line);backdrop-filter: blur(16px);}
.site-header::after {content: '';position: absolute;bottom: -1px;left: 0;display: block;width: var(--scroll-percent, 0%);height: 2px;background: var(--gold);pointer-events: none;}
.nav {height: 90px;display: flex;align-items: center;justify-content: space-between;gap: 24px;}
.brand {display: flex;align-items: center;min-width: 0;gap: 13px;}
.brand img {width: 54px;height: 56px;object-fit: contain;flex: none;}
.brand span {display: block;min-width: 0;}
.brand strong {display: block;font-size: 29px;font-weight: 800;line-height: 1;letter-spacing: -.04em;}
.brand small {display: block;margin-top: 5px;font-size: 8px;font-weight: 700;line-height: 1.4;max-width: 235px;letter-spacing: .085em;}
.main-nav {display: flex;align-items: center;gap: clamp(16px,2.5vw,36px);}
.main-nav a {position: relative;padding: 12px 0;font-size: 13px;font-weight: 700;white-space: nowrap;}
.main-nav a::after {content: '';position: absolute;bottom: 7px;left: 0;width: 0;height: 2px;background: var(--gold);transition: width .25s ease;}
.main-nav a:hover::after, .main-nav a:focus-visible::after, .main-nav a.is-active::after {width: 100%;}
.menu-toggle {display: none;}
/* Portada */
.hero {position: relative;isolation: isolate;min-height: min(790px,calc(100svh - 90px));background: var(--ink-deep);color: var(--white);display: flex;align-items: center;}
.hero-image, .hero-shade {position: absolute;inset: 0;pointer-events: none;}
.hero-image {z-index: -2;background-image: url('../assets/proyectos/proyecto-06-02.jpg');background-position: 70% center;background-size: cover;}
.hero-shade {z-index: -1;background: linear-gradient(90deg,rgba(17,32,38,.98) 0%,rgba(17,32,38,.92) 36%,rgba(17,32,38,.40) 80%,rgba(17,32,38,.23) 100%), linear-gradient(0deg,rgba(17,32,38,.42),transparent 35%);}
.hero::before {content: '';position: absolute;top: 0;bottom: 0;left: max(32px,calc((100vw - var(--container))/2));width: 1px;background: linear-gradient(var(--gold),transparent 36%);opacity: .65;pointer-events: none;}
.hero-content {padding-block: 105px 138px;position: relative;}
.hero-tag {display: flex;align-items: center;gap: 12px;font-size: 11px;font-weight: 800;letter-spacing: .19em;line-height: 1.5;color: var(--gold-soft);}
.dash {display: inline-block;width: 32px;height: 2px;background: var(--gold);flex: none;}
.hero h1 {font-family: var(--font);font-size: clamp(48px,6.4vw,91px);font-weight: 800;line-height: 1.08;letter-spacing: -.064em;margin: 31px 0 25px;max-width: 970px;}
.hero h1 em {font-style: normal;color: var(--gold);}
.hero-content > p {font-size: clamp(15px,1.5vw,18px);line-height: 1.75;max-width: 625px;color: #edf0ef;margin-bottom: 0;}
.actions {display: flex;flex-wrap: wrap;gap: 12px;margin-top: 36px;}
.btn {display: inline-flex;align-items: center;justify-content: center;gap: 24px;min-height: 54px;padding: 14px 24px;font-size: 13px;font-weight: 800;line-height: 1.1;transition: background .22s,border-color .22s,color .22s,transform .22s;}
.btn:hover {transform: translateY(-3px);}
.btn-gold {background: var(--gold);color: var(--ink-deep);border: 1px solid var(--gold);}
.btn-gold:hover {background: #f0c44b;border-color: #f0c44b;}
.btn-outline {border: 1px solid rgba(255,255,255,.7);color: var(--white);}
.btn-outline:hover {background: rgba(255,255,255,.12);border-color: var(--white);}
.hero-bottom {position: absolute;bottom: 28px;left: 0;right: 0;display: flex;align-items: center;justify-content: space-between;gap: 24px;font-size: 11px;font-weight: 700;letter-spacing: .065em;color: #e4e8e6;}
.hero-bottom::before {content: '';position: absolute;top: -16px;left: 0;right: 0;border-top: 1px solid rgba(255,255,255,.25);}
/* Secciones corporativas */
.section {padding-block: clamp(74px,8vw,120px);}
.section-head {margin-bottom: 52px;max-width: 910px;}
.eyebrow {display: block;color: #a57b09;font-size: 11px;font-weight: 800;letter-spacing: .18em;margin-bottom: 16px;line-height: 1.5;}
.section-head h2 {font-size: clamp(41px,5.4vw,74px);font-weight: 800;letter-spacing: -.055em;line-height: 1.09;margin-bottom: 0;}
.section-head h2 em {font-style: normal;color: #c5920d;}
.section-head > p {margin: 22px 0 0;color: var(--muted);font-size: 15px;line-height: 1.8;max-width: 730px;}
.about {position: relative;}
.about-grid {display: grid;grid-template-columns: minmax(0,1.02fr) minmax(0,.98fr);gap: clamp(36px,7vw,108px);align-items: start;}
.about-lead > p {font-size: clamp(22px,2.6vw,32px);font-weight: 700;line-height: 1.45;letter-spacing: -.03em;max-width: 575px;}
.about-lead img {margin-top: 34px;width: 100%;height: 350px;object-fit: cover;object-position: center 42%;border: 1px solid var(--line);}
.about-details article {border-top: 1px solid var(--line);padding: 24px 0 28px;}
.about-details article:last-child {border-bottom: 1px solid var(--line);}
.detail-num {display: inline-block;color: #a57b09;font-size: 11px;font-weight: 800;letter-spacing: .14em;}
.about-details h3 {font-size: clamp(26px,2.7vw,36px);font-weight: 800;letter-spacing: -.045em;line-height: 1.15;margin: 8px 0 15px;}
.about-details p {font-size: 14px;line-height: 1.82;color: var(--muted);margin: 0;}
.purpose {background: var(--ink);color: var(--white);position: relative;}
.purpose::before {content: '';position: absolute;top: 0;right: 0;width: 32%;height: 100%;background: repeating-linear-gradient(135deg,transparent 0 34px,rgba(255,255,255,.027) 35px,transparent 36px);pointer-events: none;}
.purpose-grid {position: relative;display: grid;grid-template-columns: repeat(2,minmax(0,1fr));gap: clamp(32px,7vw,110px);}
.purpose article {border-top: 3px solid var(--gold);padding-top: 25px;}
.purpose .eyebrow {color: #f4d77f;}
.purpose h2 {font-size: clamp(33px,4vw,53px);letter-spacing: -.05em;line-height: 1.15;margin-bottom: 24px;}
.purpose p {color: #e2e8e8;font-size: 15px;line-height: 1.9;margin: 0;max-width: 560px;}
/* Servicios */
.services {background: var(--paper);}
.service-block {display: grid;grid-template-columns: 1fr 1fr;background: var(--white);box-shadow: 0 14px 38px rgba(18,35,43,.045);margin-bottom: 28px;min-height: 540px;}
.service-block:last-child {margin-bottom: 0;}
.service-block.reverse .service-image {order: 2;}
.service-image {position: relative;overflow: hidden;min-height: 440px;}
.service-image::before {content: '';position: absolute;left: 0;bottom: 0;width: 100px;height: 5px;background: var(--gold);z-index: 2;}
.service-image img {width: 100%;height: 100%;object-fit: cover;transition: transform .65s ease;}
.service-block:hover .service-image img {transform: scale(1.045);}
.service-info {padding: clamp(30px,4vw,58px);}
.service-index {color: #a57b09;font-size: 11px;font-weight: 800;letter-spacing: .15em;}
.service-info h3 {font-size: clamp(34px,4.2vw,57px);line-height: 1.12;font-weight: 800;letter-spacing: -.055em;margin: 18px 0 30px;}
.service-info ul {margin: 0;padding: 0;list-style: none;}
.service-info li {display: flex;flex-direction: column;gap: 2px;padding: 12px 0;border-top: 1px solid #e4e9e6;font-size: 13px;line-height: 1.6;}
.service-info li strong {font-size: 14px;font-weight: 800;line-height: 1.5;}
.service-info li span {color: var(--muted);}
/* Proyectos */
.portfolio {background: #fff;}
.project-grid {display: grid;grid-template-columns: repeat(3,minmax(0,1fr));gap: 28px 24px;}
.project {min-width: 0;background: var(--paper);border: 1px solid #e4e9e8;transition: box-shadow .25s,transform .25s;}
.project:hover {box-shadow: 0 16px 35px rgba(15,31,37,.12);transform: translateY(-3px);}
.project-photo {position: relative;display: block;width: 100%;padding: 0;border: 0;background: #d6dedc;overflow: hidden;text-align: left;}
.project-photo img {width: 100%;aspect-ratio: 1.35 / 1;height: auto;object-fit: cover;object-position: center;transition: transform .48s ease;}
.project-photo:hover img {transform: scale(1.055);}
.photo-action {position: absolute;left: 0;right: 0;bottom: 0;display: flex;justify-content: space-between;align-items: center;gap: 15px;color: white;font-size: 12px;font-weight: 700;padding: 44px 18px 16px;background: linear-gradient(0deg,rgba(17,31,36,.88),transparent);}
.project-copy {padding: 20px 21px 22px;min-height: 180px;display: flex;flex-direction: column;}
.project-copy .eyebrow {margin-bottom: 9px;}
.project-copy h3 {font-size: 15px;font-weight: 700;line-height: 1.55;letter-spacing: -.01em;margin-bottom: 14px;}
.photo-count {display: block;margin-top: auto;color: var(--muted);font-size: 11px;}
/* Pie */
.footer {background: var(--ink-deep);color: var(--white);padding: 56px 0;}
.footer-inner {display: flex;justify-content: space-between;align-items: center;gap: 24px;}
.footer-brand {display: flex;align-items: center;gap: 15px;}
.footer-brand img {width: 55px;height: 57px;padding: 5px;object-fit: contain;background: var(--white);}
.footer-brand strong {display: block;font-size: 30px;font-weight: 800;letter-spacing: -.03em;line-height: 1.1;}
.footer-brand span {display: block;margin-top: 3px;max-width: 240px;font-size: 8px;letter-spacing: .08em;font-weight: 700;line-height: 1.5;}
.footer nav {display: flex;flex-wrap: wrap;gap: 14px 24px;font-size: 12px;font-weight: 700;}
.footer a:hover {color: var(--gold);}
/* Galería modal */
.gallery {width: min(1080px,96vw);max-width: 96vw;max-height: 94dvh;border: 1px solid #657279;padding: 0;background: var(--ink-deep);color: var(--white);box-shadow: 0 30px 100px rgba(0,0,0,.45);}
.gallery::backdrop {background: rgba(7,16,20,.91);}
.gallery-inner {padding: 16px clamp(12px,3vw,32px) 24px;}
.gallery-top {display: flex;justify-content: space-between;align-items: center;gap: 16px;border-bottom: 1px solid rgba(255,255,255,.23);padding-bottom: 13px;font-size: 12px;letter-spacing: .13em;font-weight: 800;}
.gallery-top button {color: var(--white);background: transparent;border: 1px solid #748389;padding: 9px 14px;font-size: 13px;}
.gallery-top button:hover {border-color: var(--gold);}
.gallery-stage {display: grid;grid-template-columns: 44px minmax(0,1fr) 44px;align-items: center;justify-items: center;gap: 12px;margin: 14px 0 10px;min-height: 200px;}
.gallery-stage img {width: auto;height: auto;max-width: 100%;max-height: min(59dvh,650px);object-fit: contain;}
.gallery-arrow {background: #3a4c54;border: 1px solid #667a82;color: var(--white);font-size: 32px;width: 42px;height: 66px;line-height: 1;}
.gallery-arrow:hover {background: #52646b;}
.gallery-caption {font-size: 13px;line-height: 1.65;margin: 8px 0;color: #e3e7e8;}
.gallery-count {font-size: 12px;font-weight: 700;color: var(--gold);}
.gallery-thumbs {display: flex;justify-content: center;flex-wrap: wrap;gap: 9px;margin-top: 12px;}
.gallery-thumbs button {width: 52px;height: 52px;background: #33474e;border: 2px solid transparent;padding: 0;opacity: .65;}
.gallery-thumbs button[aria-current="true"] {opacity: 1;border-color: var(--gold);}
.gallery-thumbs img {width: 100%;height: 100%;object-fit: cover;}
/* Entradas sin ocultar información si JavaScript está desactivado */
.section-head, .about-lead, .about-details, .purpose-grid article, .service-block, .project {animation: rise-in .42s ease both;}
@keyframes rise-in {from {opacity: .94;transform: translateY(9px);}to {opacity: 1;transform: translateY(0);}}
@media (max-width: 980px) {
  .shell {width: min(var(--container),calc(100% - 42px));}
  .about-grid {gap: 40px;}
  .main-nav {gap: 18px;}
  .service-info {padding: 32px;}
  .project-grid {grid-template-columns: repeat(2,minmax(0,1fr));}
  .project-copy {min-height: 162px;}
}
@media (max-width: 740px) {
  html {scroll-padding-top: 74px;}
  .nav {height: 74px;}
  .brand {gap: 10px;}
  .brand img {width: 44px;height: 47px;}
  .brand strong {font-size: 26px;}
  .brand small {font-size: 7px;max-width: 185px;}
  .menu-toggle {display: flex;flex-direction: column;align-items: center;justify-content: center;gap: 5px;width: 44px;height: 44px;flex: none;border: 1px solid #c9d1cf;background: var(--white);}
  .menu-toggle span {display: block;width: 20px;height: 2px;background: var(--ink);transition: transform .22s ease,opacity .22s ease;}
  .menu-toggle[aria-expanded="true"] span:nth-child(1) {transform: translateY(7px) rotate(45deg);}
  .menu-toggle[aria-expanded="true"] span:nth-child(2) {opacity: 0;}
  .menu-toggle[aria-expanded="true"] span:nth-child(3) {transform: translateY(-7px) rotate(-45deg);}
  .main-nav {display: none;position: absolute;top: 74px;left: 0;right: 0;padding: 12px 22px 24px;gap: 0;align-items: stretch;flex-direction: column;background: var(--white);box-shadow: 0 16px 28px rgba(13,28,34,.13);border-top: 1px solid var(--line);}
  .main-nav.open {display: flex;}
  .main-nav a {padding: 14px 3px;border-bottom: 1px solid var(--line);}
  .main-nav a::after {bottom: 0;}
  .hero {min-height: 660px;min-height: max(650px,calc(100svh - 74px));}
  .hero-image {background-position: 62% center;}
  .hero-shade {background: linear-gradient(90deg,rgba(16,29,35,.94),rgba(16,29,35,.76));}
  .hero::before {left: 21px;}
  .hero-content {padding-block: 100px 142px;}
  .hero h1 {font-size: clamp(40px,8.6vw,63px);letter-spacing: -.06em;margin: 26px 0;}
  .hero-tag {font-size: 9px;letter-spacing: .13em;}
  .hero-content > p {font-size: 15px;line-height: 1.7;}
  .hero-bottom {bottom: 22px;font-size: 9px;}
  .hero-bottom span:last-child {text-align: right;max-width: 200px;}
  .section {padding-block: 78px;}
  .section-head {margin-bottom: 34px;}
  .about-grid, .purpose-grid, .service-block {grid-template-columns: 1fr;}
  .about-lead img {height: 300px;}
  .service-block.reverse .service-image {order: 0;}
  .service-image {min-height: 300px;height: 300px;}
  .service-info {padding: 35px;}
  .purpose-grid {gap: 40px;}
  .footer-inner {flex-direction: column;align-items: flex-start;gap: 32px;}
}
@media (max-width: 530px) {
  .shell {width: calc(100% - 36px);}
  .brand img {width: 39px;height: 43px;}
  .brand strong {font-size: 24px;}
  .brand small {font-size: 6.7px;max-width: 178px;}
  .hero h1 {font-size: clamp(37px,9vw,48px);}
  .hero-content {padding-block: 78px 134px;}
  .hero-tag {gap: 9px;}
  .dash {width: 20px;}
  .hero-bottom {align-items: flex-end;}
  .section {padding-block: 64px;}
  .section-head h2 {font-size: clamp(37px,9vw,48px);}
  .about-lead > p {font-size: 23px;}
  .about-lead img {height: 235px;}
  .service-image {height: 260px;min-height: 260px;}
  .service-info {padding: 28px 23px;}
  .service-info h3 {font-size: 39px;}
  .project-grid {grid-template-columns: 1fr;gap: 20px;}
  .project-photo img {aspect-ratio: 1.45 / 1;}
  .project-copy {min-height: auto;}
  .project-copy h3 {margin-bottom: 17px;}
  .gallery-stage {grid-template-columns: 32px minmax(0,1fr) 32px;gap: 5px;}
  .gallery-arrow {width: 31px;height: 53px;font-size: 26px;}
  .gallery-stage img {max-height: 54dvh;}
  .gallery-thumbs button {height: 44px;width: 44px;}
  .footer nav {gap: 14px 18px;}
}
@media (max-width: 360px) {
  .brand small {max-width: 150px;letter-spacing: 0;}
  .hero h1 {font-size: 35px;}
  .btn {width: 100%;}
  .hero {min-height: 700px;}
}
@media (prefers-reduced-motion: reduce) {
  html {scroll-behavior: auto;}
  *,*::before,*::after {animation: none !important;transition: none !important;}
}
