/* SESA Ingeniería Hidráulica — colores y tipografía del brandbook */
@font-face { font-family: "Nexa"; src: url("assets/fonts/Nexa-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Nexa"; src: url("assets/fonts/Nexa-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Nexa"; src: url("assets/fonts/Nexa-Heavy.ttf") format("truetype"); font-weight: 800; font-display: swap; }

:root {
  --navy: #142d4c;
  --navy-2: #0d2038;
  --blue: #007cc3;
  --blue-light: #7cc8f2;
  --sky: #b8e2f2;
  --steel: #b8cdd8;
  --ink: #1b2430;
  --muted: #5b6878;
  --line: #e3e9ef;
  --bg: #ffffff;
  --bg-alt: #f3f7fa;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(20, 45, 76, .08);
  --font-head: "Nexa", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-body: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body { margin: 0; font-family: var(--font-body); color: var(--ink); background: var(--bg); line-height: 1.6; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--font-head); color: var(--navy); line-height: 1.15; margin: 0 0 .5em; }
h1 { font-size: clamp(2.1rem, 5vw, 3.6rem); font-weight: 800; }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); font-weight: 700; }
h3 { font-size: 1.15rem; font-weight: 700; }
p { margin: 0 0 1em; }

.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.eyebrow { font-family: var(--font-head); font-weight: 700; font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; color: var(--blue); margin-bottom: .8em; }

/* Botones */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5em; font-family: var(--font-head); font-weight: 700; font-size: 1rem; padding: .95em 1.6em; border-radius: 999px; border: 2px solid transparent; cursor: pointer; transition: transform .15s, background .2s, border-color .2s, color .2s; }
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-sm { padding: .6em 1.2em; font-size: .9rem; }
.btn-accent { background: var(--blue); color: #fff; }
.btn-accent:hover { background: #0069a6; }
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-2); }
.btn-ghost { border-color: rgba(255,255,255,.5); color: #fff; }
.btn-ghost:hover { border-color: #fff; background: rgba(255,255,255,.08); }
.btn-whatsapp { background: #1fa855; color: #fff; margin-top: 8px; }
.btn-whatsapp:hover { background: #188c46; }
.btn-whatsapp svg { width: 20px; height: 20px; fill: currentColor; }
.btn-block { width: 100%; }

/* Encabezado */
.site-header { position: fixed; inset: 0 0 auto 0; z-index: 50; transition: background .25s, box-shadow .25s; }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 76px; }
.brand { display: flex; align-items: center; }
.logo { height: 46px; width: auto; }
.logo-dark { display: none; }
.site-header.scrolled { background: rgba(255,255,255,.97); box-shadow: 0 2px 16px rgba(20,45,76,.1); }
.site-header.scrolled .logo-light { display: none; }
.site-header.scrolled .logo-dark { display: block; }
.nav { display: flex; align-items: center; gap: 28px; }
.nav a:not(.btn) { color: #fff; font-family: var(--font-head); font-weight: 700; font-size: .95rem; }
.site-header.scrolled .nav a:not(.btn) { color: var(--navy); }
.nav a:not(.btn):hover { color: var(--blue-light); text-decoration: none; }
.site-header.scrolled .nav a:not(.btn):hover { color: var(--blue); }
.nav-toggle { display: none; background: none; border: 0; padding: 10px; cursor: pointer; }
.nav-toggle span { display: block; width: 24px; height: 2px; background: #fff; margin: 5px 0; transition: transform .2s, opacity .2s; }
.site-header.scrolled .nav-toggle span { background: var(--navy); }

/* Hero */
.hero { position: relative; overflow: hidden; color: #fff; background: radial-gradient(1200px 600px at 85% 10%, #1d5a8c 0%, transparent 60%), linear-gradient(160deg, var(--navy) 0%, var(--navy-2) 100%); padding: 160px 0 90px; }
.hero-pattern { position: absolute; inset: 0; background: url("assets/img/pattern.png") center / 520px auto repeat; opacity: .045; filter: brightness(0) invert(1); }
.hero::after { content: ""; position: absolute; right: -120px; bottom: -160px; width: 520px; height: 520px; background: linear-gradient(135deg, rgba(124,200,242,.35), rgba(124,200,242,0)); transform: rotate(45deg); }
.hero-inner { position: relative; z-index: 1; }
.hero .eyebrow { color: var(--blue-light); }
.hero h1 { color: #fff; max-width: 15ch; }
.lead { font-size: clamp(1.05rem, 1.6vw, 1.25rem); max-width: 60ch; color: rgba(255,255,255,.85); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin: 32px 0 64px; }
.stats { list-style: none; margin: 0; padding: 28px 0 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; border-top: 1px solid rgba(255,255,255,.15); }
.stats strong { display: block; font-family: var(--font-head); font-weight: 800; font-size: clamp(2rem, 4vw, 2.8rem); color: var(--blue-light); line-height: 1; margin-bottom: 6px; }
.stats span { font-size: .95rem; color: rgba(255,255,255,.8); }

/* Secciones */
.section { padding: 96px 0; }
.section-alt { background: var(--bg-alt); }
.section-head { max-width: 680px; margin-bottom: 48px; }
.section-lead { color: var(--muted); font-size: 1.05rem; }

/* Nosotros */
.about { display: grid; grid-template-columns: 1fr 1.3fr; gap: 56px; align-items: start; }
.about-body p { font-size: 1.08rem; color: #33404f; }
.about-body strong { color: var(--navy); }
.values { list-style: none; padding: 0; margin: 28px 0 0; display: flex; flex-wrap: wrap; gap: 12px; }
.values li { display: flex; align-items: center; gap: 10px; padding: 10px 18px; border: 1px solid var(--line); border-radius: 999px; font-family: var(--font-head); font-weight: 700; color: var(--navy); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--blue); }

/* Servicios */
.services { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.service { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: transform .2s, box-shadow .2s; }
.service-media { aspect-ratio: 16 / 10; overflow: hidden; background: #e8eef3; }
.service-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.service:hover .service-media img { transform: scale(1.04); }
.service-body { position: relative; padding: 38px 28px 30px; }
.service-body .service-icon { position: absolute; top: -26px; left: 28px; box-shadow: 0 6px 16px rgba(20,45,76,.25); border: 3px solid #fff; }
.service:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.service-icon { width: 52px; height: 52px; border-radius: 12px; display: grid; place-items: center; background: linear-gradient(135deg, var(--navy), var(--blue)); }
.service-icon svg { width: 26px; height: 26px; fill: none; stroke: #fff; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.service ul { list-style: none; padding: 0; margin: 0; }
.service li { position: relative; padding-left: 18px; margin-bottom: 8px; color: #3f4b59; font-size: .97rem; }
.service li::before { content: ""; position: absolute; left: 0; top: .62em; width: 7px; height: 7px; border-radius: 2px; background: var(--blue); transform: rotate(45deg); }
.service p { color: #3f4b59; font-size: .97rem; margin: 0; }

/* Portafolio con pestañas */
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; border-bottom: 1px solid var(--line); }
.tabs button { background: none; border: 0; border-bottom: 3px solid transparent; padding: 12px 16px; font-family: var(--font-head); font-weight: 700; font-size: .95rem; color: var(--muted); cursor: pointer; margin-bottom: -1px; }
.tabs button[aria-selected="true"] { color: var(--navy); border-bottom-color: var(--blue); }
.tabs button:hover { color: var(--navy); }
.panel-lead { color: var(--muted); margin-bottom: 20px; }
.chips { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.chips li { background: var(--bg-alt); border: 1px solid var(--line); color: var(--navy); padding: 8px 16px; border-radius: 999px; font-size: .93rem; }
.ext-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.ext-list li { border: 1px solid var(--line); border-left: 4px solid var(--blue); border-radius: 10px; padding: 20px 22px; }
.ext-list strong { display: block; font-family: var(--font-head); color: var(--navy); margin-bottom: 6px; }
.ext-list span { color: var(--muted); font-size: .95rem; }

/* CTA */
.cta { background: linear-gradient(120deg, var(--navy) 0%, #0f4f86 60%, var(--blue) 100%); color: #fff; padding: 80px 0; text-align: center; }
.cta h2 { color: #fff; }
.cta p { color: rgba(255,255,255,.85); max-width: 56ch; margin: 0 auto 28px; font-size: 1.1rem; }
.cta .btn-accent { background: #fff; color: var(--navy); }
.cta .btn-accent:hover { background: var(--sky); }

/* Contacto */
.contact { display: grid; grid-template-columns: 1fr 1.1fr; gap: 56px; align-items: start; }
.contact-info > p { color: var(--muted); }
.contact-list { list-style: none; padding: 0; margin: 28px 0; display: grid; gap: 22px; }
.contact-list li { display: flex; gap: 16px; align-items: flex-start; }
.contact-list strong { display: block; font-family: var(--font-head); color: var(--navy); font-size: .95rem; }
.contact-list a { display: block; color: #33404f; }
.contact-list a:hover { color: var(--blue); }
.ci { flex: none; width: 44px; height: 44px; border-radius: 50%; background: var(--blue); display: grid; place-items: center; }
.ci svg { width: 22px; height: 22px; fill: none; stroke: #fff; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.contact-form { background: var(--bg-alt); border: 1px solid var(--line); border-radius: var(--radius); padding: 34px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
label { font-family: var(--font-head); font-weight: 700; font-size: .88rem; color: var(--navy); }
input, select, textarea { font: inherit; color: var(--ink); background: #fff; border: 1px solid #cfd9e2; border-radius: 10px; padding: 12px 14px; width: 100%; transition: border-color .2s, box-shadow .2s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0,124,195,.15); }
.field.invalid input, .field.invalid textarea { border-color: #d14343; }
textarea { resize: vertical; min-height: 120px; }
.form-note { font-size: .9rem; color: var(--muted); margin: 12px 0 0; text-align: center; }
.form-note:empty { display: none; }
.form-note.success { color: #157a3c; background: #e7f6ec; padding: 12px; border-radius: 10px; }
.form-note.error { color: #b42318; background: #fdecea; padding: 12px; border-radius: 10px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
button:disabled { opacity: .65; cursor: wait; }

/* Pie */
.site-footer { background: var(--navy-2); color: rgba(255,255,255,.7); padding: 48px 0; text-align: center; }
.footer-inner { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.footer-logo { height: 54px; width: auto; margin-bottom: 10px; }
.site-footer p { margin: 0; }
.copy { font-size: .85rem; color: rgba(255,255,255,.5); }

/* Responsivo */
@media (max-width: 1024px) {
  .services { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 820px) {
  .nav-toggle { display: block; }
  .nav { position: fixed; top: 76px; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0; background: #fff; padding: 8px 24px 24px; box-shadow: 0 12px 24px rgba(20,45,76,.12); transform: translateY(-120%); visibility: hidden; transition: transform .25s, visibility .25s; }
  .nav.open { transform: none; visibility: visible; }
  .nav a:not(.btn) { color: var(--navy); padding: 14px 0; border-bottom: 1px solid var(--line); }
  .nav .btn { margin-top: 16px; }
  .site-header.menu-open { background: #fff; }
  .site-header.menu-open .logo-light { display: none; }
  .site-header.menu-open .logo-dark { display: block; }
  .site-header.menu-open .nav-toggle span { background: var(--navy); }
  .nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .about, .contact { grid-template-columns: 1fr; gap: 32px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .ext-list { grid-template-columns: 1fr; }
  .section { padding: 72px 0; }
}
@media (max-width: 560px) {
  .container { padding: 0 16px; }
  .logo { height: 38px; }
  .hero { padding: 130px 0 64px; }
  .services { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr; gap: 0; }
  .contact-form { padding: 24px 18px; }
  .tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .tabs button { white-space: nowrap; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
