/* ============================================================
   CEDECOSA — Dark architectural editorial
   ============================================================ */

:root {
  --bg:        #0c0e11;   /* grafito casi negro, tibio-frío */
  --bg-2:      #111418;
  --bg-3:      #171b20;   /* card */
  --line:      rgba(232, 236, 240, 0.10);
  --line-soft: rgba(232, 236, 240, 0.06);

  --text:      #e9edf1;   /* nunca blanco puro */
  --text-2:    #aeb6bf;
  --text-3:    #6f7882;   /* metadata */

  --accent:    #f2a900;   /* ámbar / casco de obra */
  --accent-2:  #ff7a18;   /* naranja construcción */
  --accent-deep:#b87c00;

  --ease:      cubic-bezier(.22,.61,.36,1);
  --ease-out:  cubic-bezier(.16,1,.3,1);

  --maxw:      1280px;
  --pad:       clamp(1.2rem, 5vw, 5rem);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html {
  overflow-x: clip;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  font-weight: 400;
  line-height: 1.6;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }

.mono {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
}

em { font-style: italic; color: var(--accent); }

/* ----- rejilla de fondo tipo plano ----- */
.grid-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(var(--line-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-soft) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(ellipse 120% 90% at 50% 0%, #000 30%, transparent 90%);
          mask-image: radial-gradient(ellipse 120% 90% at 50% 0%, #000 30%, transparent 90%);
}

main, .nav, .footer { position: relative; z-index: 1; }

/* ============================================================
   SPLASH
   ============================================================ */
.splash {
  position: fixed; inset: 0; z-index: 999;
  background: var(--bg);
  display: grid; place-items: center;
  transition: opacity .7s var(--ease-out), clip-path .8s var(--ease-out);
  animation: splashSafety .01s 4.5s forwards;
}
.splash.is-out {
  opacity: 0; pointer-events: none;
  clip-path: inset(0 0 100% 0);
}
@keyframes splashSafety {
  to { opacity: 0; pointer-events: none; clip-path: inset(0 0 100% 0); }
}
.splash-inner { text-align: center; }
.splash-logo {
  width: clamp(180px, 34vw, 300px); height: auto; margin: 0 auto;
  filter: drop-shadow(0 10px 30px rgba(0,0,0,.5));
  animation: logoIn 1s var(--ease-out) both;
}
@keyframes logoIn { from { opacity: 0; transform: translateY(12px) scale(.96); } to { opacity: 1; transform: none; } }
.splash-line {
  display: block; height: 2px; margin: 1.6rem auto 0; width: 0;
  background: var(--accent);
  animation: splashGrow 1.6s var(--ease-out) forwards;
}
@keyframes splashGrow { to { width: 180px; } }

/* ============================================================
   NAV
   ============================================================ */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.1rem var(--pad);
  transition: background .35s var(--ease), border-color .35s var(--ease), padding .35s var(--ease);
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled {
  background: rgba(12,14,17,0.82);
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  border-bottom: 1px solid var(--line);
  padding-block: 0.8rem;
}
.nav-brand {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700; letter-spacing: 0.14em; font-size: 0.98rem;
  display: inline-flex; align-items: center; gap: 0.6rem;
}
.nav-logo { height: 40px; width: auto; transition: height .35s var(--ease); }
.nav.is-scrolled .nav-logo { height: 32px; }
.nav-brand-txt { color: var(--text); }
.nav-links { display: flex; align-items: center; gap: clamp(1rem, 2.4vw, 2.2rem); }
.nav-links a {
  font-size: 0.86rem; color: var(--text-2); letter-spacing: 0.02em;
  position: relative; transition: color .25s var(--ease);
}
.nav-links a:not(.nav-cta)::after {
  content: ""; position: absolute; left: 0; bottom: -5px; height: 1px; width: 0;
  background: var(--accent); transition: width .3s var(--ease);
}
.nav-links a:not(.nav-cta):hover { color: var(--text); }
.nav-links a:not(.nav-cta):hover::after { width: 100%; }
.nav-cta {
  border: 1px solid var(--line); padding: 0.5rem 1rem; border-radius: 2px;
  color: var(--text); transition: border-color .25s, background .25s, color .25s;
}
.nav-cta:hover { background: var(--accent); border-color: var(--accent); color: #1a1205; }

@media (max-width: 620px) {
  .nav-links a:not(.nav-cta):not([href="#contacto"]) { display: none; }
}

/* ============================================================
   BOTONES
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-size: 0.92rem; font-weight: 500; letter-spacing: 0.01em;
  padding: 0.85rem 1.5rem; border-radius: 2px;
  border: 1px solid transparent; cursor: pointer;
  transition: transform .25s var(--ease), background .25s, border-color .25s, color .25s;
}
.btn-primary { background: var(--accent); color: #1a1205; font-weight: 600; }
.btn-primary:hover { background: var(--accent-2); transform: translateY(-2px); }
.btn-ghost { border-color: var(--line); color: var(--text); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }

/* ============================================================
   REVEAL
   ============================================================ */
.reveal { opacity: 0; transform: translateY(34px); transition: opacity .8s var(--ease-out), transform .8s var(--ease-out); }
.reveal.is-visible { opacity: 1; transform: none; }
.reveal[data-split] { opacity: 1; transform: none; } /* defensa A.4.5 */

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative;
  min-height: 100vh; min-height: 100svh;
  display: flex; flex-direction: column; justify-content: center;
  padding: 7rem var(--pad) 3rem;
  overflow: hidden;
}
.hero-media { position: absolute; inset: 0; z-index: -1; }
.hero-img {
  width: 100%; height: 100%; object-fit: cover;
  opacity: 0.62; filter: saturate(0.95) contrast(1.06);
  transform: scale(1.06);
}
.hero-tint {
  position: absolute; inset: 0;
  background:
    radial-gradient(120% 80% at 75% 18%, rgba(242,169,0,0.12), transparent 55%),
    linear-gradient(180deg, rgba(12,14,17,0.42) 0%, rgba(12,14,17,0.62) 50%, rgba(12,14,17,0.92) 82%, var(--bg) 100%);
}
.hero-inner { max-width: var(--maxw); margin: 0 auto; width: 100%; }
.kicker {
  display: inline-flex; align-items: center; gap: 0.6rem;
  font-family: "JetBrains Mono", monospace; font-size: 0.74rem;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-2);
  margin-bottom: 1.6rem;
}
.kicker .dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 0 rgba(242,169,0,.6); animation: pulse 2.4s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(242,169,0,.5); }
  70% { box-shadow: 0 0 0 9px rgba(242,169,0,0); }
  100% { box-shadow: 0 0 0 0 rgba(242,169,0,0); }
}
.hero-title {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 600; line-height: 0.96;
  font-size: clamp(2.8rem, 9.5vw, 7.6rem);
  letter-spacing: -0.02em; text-wrap: balance;
  margin-bottom: 1.8rem;
}
.hero-sub {
  max-width: 50ch; font-size: clamp(1rem, 1.6vw, 1.18rem);
  color: var(--text-2); margin-bottom: 2.4rem;
}
.hero-sub strong, .nos-text strong { color: var(--text); font-weight: 600; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.9rem; }
.hero-foot {
  position: absolute; left: var(--pad); right: var(--pad); bottom: 1.6rem;
  display: flex; justify-content: space-between; align-items: center;
  max-width: var(--maxw); margin: 0 auto;
}
.hero-scroll { animation: bob 2.6s var(--ease) infinite; }
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(5px); } }

/* ============================================================
   STATS
   ============================================================ */
.stats {
  border-block: 1px solid var(--line);
  background: var(--bg-2);
}
.stats-grid {
  max-width: var(--maxw); margin: 0 auto;
  display: grid; grid-template-columns: repeat(3, 1fr);
}
.stat {
  padding: clamp(2rem, 5vw, 3.4rem) var(--pad);
  display: flex; flex-direction: column; gap: 0.3rem;
  border-left: 1px solid var(--line);
}
.stat:first-child { border-left: none; }
.stat-n {
  font-family: "Space Grotesk", sans-serif; font-weight: 700;
  font-size: clamp(2.4rem, 5vw, 3.8rem); line-height: 1;
  color: var(--text); display: inline;
}
.stat-suf {
  font-family: "Space Grotesk", sans-serif; font-weight: 700;
  font-size: clamp(1.4rem, 3vw, 2rem); color: var(--accent); margin-left: 2px;
}
.stat-label { font-size: 0.84rem; color: var(--text-3); letter-spacing: 0.04em; margin-top: 0.5rem; }
@media (max-width: 720px) {
  .stats-grid { grid-template-columns: 1fr; }
  .stat { border-left: none; border-top: 1px solid var(--line); }
  .stat:first-child { border-top: none; }
}

/* ============================================================
   SECTION genérico
   ============================================================ */
.section { padding: clamp(4.5rem, 10vw, 9rem) var(--pad); max-width: var(--maxw); margin: 0 auto; }
.section-head { margin-bottom: clamp(2.4rem, 5vw, 4rem); }
.section-idx { display: block; margin-bottom: 1rem; color: var(--accent-deep); }
.section-title {
  font-family: "Space Grotesk", sans-serif; font-weight: 600;
  font-size: clamp(2rem, 6vw, 4.2rem); line-height: 0.98;
  letter-spacing: -0.02em; text-wrap: balance;
}
.section-note { margin-top: 1rem; color: var(--text-3); font-size: 0.92rem; }

/* ============================================================
   SERVICIOS
   ============================================================ */
.serv-list { border-top: 1px solid var(--line); }
.serv {
  display: grid; grid-template-columns: 80px 1fr; gap: clamp(1rem, 4vw, 3rem);
  align-items: start;
  padding: clamp(1.8rem, 4vw, 2.8rem) 0;
  border-bottom: 1px solid var(--line);
  transition: background .35s var(--ease), padding-left .35s var(--ease);
}
.serv:hover { background: linear-gradient(90deg, rgba(242,169,0,0.05), transparent 60%); padding-left: 1rem; }
.serv-id { font-size: 0.9rem; color: var(--accent); padding-top: 0.4rem; }
.serv-title {
  font-family: "Space Grotesk", sans-serif; font-weight: 600;
  font-size: clamp(1.3rem, 3vw, 2rem); letter-spacing: -0.01em; margin-bottom: 0.6rem;
  transition: color .3s var(--ease);
}
.serv:hover .serv-title { color: var(--accent); }
.serv-desc { color: var(--text-2); max-width: 60ch; font-size: 1rem; }
@media (max-width: 560px) {
  .serv { grid-template-columns: 1fr; gap: 0.5rem; }
  .serv-id { padding-top: 0; }
}

/* ============================================================
   OBRA (showcase)
   ============================================================ */
.obra-grid {
  display: grid; grid-template-columns: repeat(12, 1fr);
  gap: clamp(0.8rem, 1.6vw, 1.2rem);
}
.obra-card {
  position: relative; overflow: hidden; border-radius: 3px;
  background: var(--bg-3); border: 1px solid var(--line);
  grid-column: span 4; aspect-ratio: 4 / 3.4;
}
.obra-card:nth-child(1) { grid-column: span 8; aspect-ratio: 16 / 9.2; }
.obra-card:nth-child(2) { grid-column: span 4; }
.obra-card:nth-child(5) { grid-column: span 8; aspect-ratio: 16 / 8; }
.obra-card:nth-child(6) { grid-column: span 4; }
.obra-card img {
  width: 100%; height: 100%; object-fit: cover;
  filter: grayscale(0.35) brightness(0.78) contrast(1.05);
  transition: transform .8s var(--ease-out), filter .6s var(--ease);
}
.obra-card:hover img { transform: scale(1.07); filter: grayscale(0) brightness(0.92) contrast(1.05); }
.obra-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 30%, rgba(8,9,11,0.55) 70%, rgba(8,9,11,0.92) 100%);
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: clamp(1rem, 2vw, 1.6rem);
}
.obra-cat {
  font-family: "JetBrains Mono", monospace; font-size: 0.68rem;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent);
  margin-bottom: 0.4rem;
}
.obra-title {
  font-family: "Space Grotesk", sans-serif; font-weight: 600;
  font-size: clamp(1.05rem, 2vw, 1.5rem); line-height: 1.05; color: var(--text);
}
.obra-meta { font-size: 0.8rem; color: var(--text-2); margin-top: 0.25rem; }
@media (max-width: 760px) {
  .obra-card,
  .obra-card:nth-child(1),
  .obra-card:nth-child(2),
  .obra-card:nth-child(5),
  .obra-card:nth-child(6) { grid-column: span 6; aspect-ratio: 4/3.4; }
}
@media (max-width: 480px) {
  .obra-card,
  .obra-card:nth-child(n) { grid-column: span 12; aspect-ratio: 16/10; }
}

/* ============================================================
   NOSOTROS
   ============================================================ */
.nos-grid { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: clamp(2rem, 5vw, 4.5rem); align-items: center; }
.nos-media { position: relative; border-radius: 3px; overflow: hidden; border: 1px solid var(--line); }
.nos-media img { width: 100%; aspect-ratio: 4/4.6; object-fit: cover; filter: grayscale(0.3) brightness(0.82) contrast(1.05); }
.nos-badge { position: absolute; top: 1rem; left: 1rem; background: rgba(12,14,17,0.7); padding: 0.4rem 0.7rem; border: 1px solid var(--line); border-radius: 2px; color: var(--accent); }
.nos-text { color: var(--text-2); font-size: 1.05rem; margin: 1.6rem 0 2rem; max-width: 56ch; }
.nos-points { list-style: none; display: flex; flex-direction: column; gap: 0.9rem; }
.nos-points li { display: flex; gap: 0.8rem; align-items: baseline; font-size: 1rem; color: var(--text); border-bottom: 1px solid var(--line-soft); padding-bottom: 0.9rem; }
.nos-points li .mono { color: var(--accent); }
@media (max-width: 820px) { .nos-grid { grid-template-columns: 1fr; } .nos-media { max-width: 420px; } }

/* ============================================================
   CONTACTO
   ============================================================ */
.cont-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1.4rem, 3vw, 2.4rem); align-items: stretch; }
.cont-info { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.cont-row {
  display: grid; grid-template-columns: 130px 1fr auto; gap: 1rem; align-items: center;
  padding: 1.5rem 0.4rem; border-bottom: 1px solid var(--line);
  transition: background .3s var(--ease), padding-left .3s var(--ease);
}
.cont-row.cont-static { align-items: start; }
a.cont-row:hover { background: linear-gradient(90deg, rgba(242,169,0,0.06), transparent); padding-left: 1rem; }
.cont-label { align-self: start; padding-top: 0.2rem; }
.cont-val { font-family: "Space Grotesk", sans-serif; font-size: clamp(1.05rem, 2vw, 1.5rem); color: var(--text); line-height: 1.3; }
.cont-static .cont-val { font-size: 1rem; color: var(--text-2); font-family: "Inter", sans-serif; }
.cont-arrow { color: var(--accent); font-size: 1.3rem; transition: transform .3s var(--ease); }
a.cont-row:hover .cont-arrow { transform: translateX(6px); }
.cont-wa .cont-val { color: var(--accent); }
.cont-map { border: 1px solid var(--line); border-radius: 3px; overflow: hidden; min-height: 340px; filter: grayscale(0.4) contrast(1.05); }
.cont-map iframe { width: 100%; height: 100%; min-height: 340px; border: 0; display: block; }
@media (max-width: 820px) { .cont-grid { grid-template-columns: 1fr; } }
@media (max-width: 480px) { .cont-row { grid-template-columns: 1fr auto; } .cont-label { grid-column: 1 / -1; } }

/* ============================================================
   FOOTER
   ============================================================ */
.footer { border-top: 1px solid var(--line); background: var(--bg-2); padding: clamp(2.5rem, 5vw, 4rem) var(--pad) 2rem; }
.footer-top { max-width: var(--maxw); margin: 0 auto; display: flex; flex-wrap: wrap; gap: 1.4rem 2.5rem; align-items: center; justify-content: space-between; padding-bottom: 2rem; border-bottom: 1px solid var(--line); }
.footer-logo { height: 84px; width: auto; }
.footer-tag { color: var(--text-3); font-size: 0.9rem; max-width: 40ch; }
.footer-bottom { max-width: var(--maxw); margin: 1.4rem auto 0; display: flex; flex-wrap: wrap; gap: 0.6rem 1.5rem; justify-content: space-between; }

/* ============================================================
   WHATSAPP FLOTANTE
   ============================================================ */
.wa-float {
  position: fixed; right: clamp(1rem, 3vw, 2rem); bottom: clamp(1rem, 3vw, 2rem); z-index: 60;
  width: 58px; height: 58px; border-radius: 50%;
  background: #25d366; color: #062b13;
  display: grid; place-items: center;
  box-shadow: 0 10px 30px rgba(0,0,0,0.45);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease);
}
.wa-float:hover { transform: translateY(-3px) scale(1.05); box-shadow: 0 14px 38px rgba(37,211,102,0.4); }

/* ============================================================
   ACCESIBILIDAD MOVIMIENTO
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .kicker .dot { animation: none; }
  .hero-scroll { animation: none; }
  .splash-line { animation: splashGrow .01s forwards; }
}
