:root {
  --navy-deep:   #050d1a;
  --navy:        #0b1a2e;
  --navy-mid:    #0f2340;
  --navy-light:  #163050;
  --gold:        #c9a84c;
  --gold-light:  #e8c96a;
  --gold-dark:   #9a7a2e;
  --gold-glow:   rgba(201,168,76,0.22);
  --white:       #f0eeea;
  --gray:        #8899aa;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; overflow-x: hidden; }

body {
  font-family: 'Lato', sans-serif;
  background-color: var(--navy-deep);
  background-image: var(--bg-img);
  background-size: cover;
  background-attachment: fixed;
  background-position: center;
  color: var(--white);
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: rgba(5, 13, 26, 0.80);
  pointer-events: none;
  z-index: 0;
}

nav, section, footer, .cta-banner { position: relative; z-index: 1; }

/* ─── NAV ─────────────────────────── */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex; align-items: center; justify-content: center;
  padding: 0 5%;
  height: 74px;
  background: rgba(5,13,26,0.88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(201,168,76,0.18);
  transition: box-shadow .3s;
}
nav.scrolled { box-shadow: 0 4px 30px rgba(0,0,0,.6); }

/* Logo: oculto por defecto en desktop, posición absoluta izquierda */
.nav-logo {
  display: flex; align-items: center; gap: .85rem;
  position: absolute; left: 5%;
  opacity: 0;
  pointer-events: none;
  transition: opacity .45s ease;
}
.nav-logo img { height: 46px; }

/* Cuando el hero logo sale del viewport → clase show-brand en nav */
nav.show-brand .nav-logo {
  opacity: 1;
  pointer-events: auto;
}
nav.show-brand .nav-links {
  margin-left: auto;
}

.nav-brand-text {
  font-family: 'Cinzel', serif;
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .18em;
  color: var(--white);
  text-transform: uppercase;
  white-space: nowrap;
  opacity: 0;
  transform: translateX(-8px);
  transition: opacity .45s ease, transform .45s ease;
  pointer-events: none;
  user-select: none;
}
.nav-brand-text span { color: var(--gold); }
nav.show-brand .nav-brand-text {
  opacity: 1;
  transform: translateX(0);
}

.nav-links {
  display: flex; gap: 2.2rem; list-style: none;
  transition: margin-left .45s ease;
}
.nav-links a {
  font-family: 'Cinzel', serif;
  font-size: .73rem;
  letter-spacing: .14em;
  color: var(--gray);
  text-decoration: none;
  text-transform: uppercase;
  transition: color .25s;
  position: relative;
}
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px; left: 0; right: 100%;
  height: 1px; background: var(--gold);
  transition: right .3s;
}
.nav-links a:hover { color: var(--gold); }
.nav-links a:hover::after { right: 0; }
.hamburger { display: none; flex-direction: column; gap: 5px; cursor: pointer; }
.hamburger span { width: 26px; height: 2px; background: var(--gold); transition: .3s; }


/* ─── HERO ────────────────────────── */
#inicio {
  min-height: 100vh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center;
  padding: 100px 5% 80px;
  position: relative;
}
#heroParticles {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
}
#inicio > *:not(#heroParticles) { position: relative; z-index: 1; }


.hero-logo {
  width: clamp(180px, 28vw, 320px);
  margin-bottom: 2.5rem;
  opacity: 0;
  transform: translateY(-20px);
  animation: fadeDown .9s .2s forwards;
  filter: drop-shadow(0 0 30px rgba(201,168,76,.25));
}

.hero-divider {
  display: flex; align-items: center; gap: 1.2rem;
  margin-bottom: 2rem;
  opacity: 0;
  animation: fadeIn .8s .7s forwards;
}
.hero-divider::before, .hero-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-dark));
}
.hero-divider::after { background: linear-gradient(90deg, var(--gold-dark), transparent); }
.hero-divider span {
  font-family: 'Cinzel', serif;
  font-size: .68rem;
  letter-spacing: .3em;
  color: var(--gold);
  text-transform: uppercase;
  white-space: nowrap;
}

.hero-title {
  font-family: 'Cinzel', serif;
  font-size: clamp(2.2rem, 5.5vw, 5rem);
  font-weight: 900;
  line-height: 1.1;
  color: var(--white);
  opacity: 0;
  transform: translateY(30px);
  animation: fadeUp .9s .9s forwards;
}
.hero-title .gold { color: var(--gold); }

.hero-sub {
  font-size: clamp(.95rem, 1.8vw, 1.2rem);
  color: rgba(240,238,234,.6);
  margin-top: 1.2rem;
  font-weight: 300;
  letter-spacing: .06em;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeUp .8s 1.1s forwards;
  min-height: 1.6em;
}
.hero-sub::after {
  content: '|';
  color: var(--gold);
  animation: cursorBlink .75s step-end infinite;
  margin-left: 2px;
}
.hero-sub.typing-done::after { display: none; }
@keyframes cursorBlink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

.hero-badges {
  display: flex; flex-wrap: wrap; gap: .7rem; justify-content: center;
  margin-top: 2.4rem;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeUp .8s 1.3s forwards;
}
.hero-badge-item {
  display: flex; align-items: center; gap: .55rem;
  border: 1px solid rgba(201,168,76,.35);
  background: rgba(201,168,76,.07);
  padding: .5rem 1.1rem;
  font-family: 'Cinzel', serif;
  font-size: .68rem;
  letter-spacing: .1em;
  color: var(--gold-light);
  text-transform: uppercase;
  backdrop-filter: blur(4px);
  transition: background .25s, border-color .25s;
}
.hero-badge-item:hover { background: rgba(201,168,76,.15); border-color: var(--gold); }
.hero-badge-item i { color: var(--gold); font-size: .9rem; }

.hero-ctas {
  display: flex; gap: 1.2rem; flex-wrap: wrap; justify-content: center;
  margin-top: 2.8rem;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeUp .8s 1.5s forwards;
}

.scroll-hint {
  margin-top: 4rem;
  opacity: 0;
  animation: fadeIn .8s 2s forwards;
  display: flex; flex-direction: column; align-items: center; gap: .5rem;
}
.scroll-hint span {
  font-family: 'Cinzel', serif; font-size: .6rem;
  letter-spacing: .2em; color: rgba(201,168,76,.5);
  text-transform: uppercase;
}
.scroll-arrow {
  width: 24px; height: 24px;
  border-right: 1px solid var(--gold-dark);
  border-bottom: 1px solid var(--gold-dark);
  transform: rotate(45deg);
  animation: bounce 1.6s infinite;
}
@keyframes bounce {
  0%,100% { transform: rotate(45deg) translateY(0); }
  50% { transform: rotate(45deg) translateY(6px); }
}

/* ─── BUTTONS ─────────────────────── */
.btn-gold {
  font-family: 'Cinzel', serif; font-size: .78rem;
  letter-spacing: .14em; text-transform: uppercase;
  padding: .9rem 2.2rem;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: var(--navy-deep); border: none; cursor: pointer;
  text-decoration: none; font-weight: 700;
  clip-path: polygon(8px 0%,100% 0%,calc(100% - 8px) 100%,0% 100%);
  transition: filter .25s, transform .2s;
  display: inline-block;
}
.btn-gold:hover { filter: brightness(1.15); transform: translateY(-2px); }
.btn-outline {
  font-family: 'Cinzel', serif; font-size: .78rem;
  letter-spacing: .14em; text-transform: uppercase;
  padding: .9rem 2.2rem;
  background: transparent; color: var(--gold);
  border: 1px solid var(--gold); cursor: pointer;
  text-decoration: none; display: inline-block;
  clip-path: polygon(8px 0%,100% 0%,calc(100% - 8px) 100%,0% 100%);
  transition: background .25s, transform .2s;
}
.btn-outline:hover { background: var(--gold-glow); transform: translateY(-2px); }

/* ─── SECTION COMMONS ─────────────── */
.section-inner { max-width: 1200px; margin: 0 auto; }
.section-header { text-align: center; margin-bottom: 3.5rem; }
.section-tag {
  font-family: 'Cinzel', serif; font-size: .67rem;
  letter-spacing: .28em; color: var(--gold);
  text-transform: uppercase; display: block; margin-bottom: .6rem;
}
.section-title {
  font-family: 'Cinzel', serif;
  font-size: clamp(1.7rem, 3.2vw, 2.6rem);
  font-weight: 700; color: var(--white); line-height: 1.2;
}
.section-title span { color: var(--gold); }
.gold-line {
  width: 60px; height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  margin: 1rem auto 0;
}

/* ─── ABOUT ───────────────────────── */
#acerca {
  padding: 7rem 5%;
  background: rgba(11,26,46,0.55);
  border-top: 1px solid rgba(201,168,76,.12);
  overflow-x: clip;
}
.about-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 5rem; align-items: center; max-width: 1000px; margin: 0 auto;
}
.about-img-wrap { position: relative; }
.about-img-wrap::before {
  content: ''; position: absolute;
  top: -14px; left: -14px; right: 14px; bottom: 14px;
  border: 1px solid var(--gold-dark); z-index: 0;
}
.about-img-wrap img {
  position: relative; z-index: 2; width: 100%;
  display: block;
}
.about-years {
  position: absolute; bottom: -16px; right: -16px; z-index: 3;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: var(--navy-deep); padding: 1.2rem 1.5rem; text-align: center;
  font-family: 'Cinzel', serif;
}
.about-years strong { font-size: 2.4rem; font-weight: 900; display: block; line-height: 1; }
.about-years span { font-size: .68rem; letter-spacing: .12em; font-weight: 700; }
.about-text h2 {
  font-family: 'Cinzel', serif;
  font-size: clamp(1.5rem, 2.5vw, 2.1rem);
  font-weight: 700; margin-bottom: 1.2rem; color: var(--white);
}
.about-text h2 span { color: var(--gold); }
.about-text p {
  font-size: .97rem; line-height: 1.88;
  color: rgba(240,238,234,.72); margin-bottom: 1rem;
}
.about-text p strong { color: var(--gold); }
.about-tags { display: flex; flex-wrap: wrap; gap: .55rem; margin-top: 1.8rem; }
.tag {
  font-family: 'Cinzel', serif; font-size: .63rem;
  letter-spacing: .1em; padding: .35rem .85rem;
  border: 1px solid var(--gold-dark); color: var(--gold-light);
}

/* ─── SERVICES ────────────────────── */
#servicios {
  padding: 7rem 5%;
  background: rgba(5,13,26,0.6);
}
.services-grid {
  display: grid; grid-template-columns: repeat(3,1fr);
  gap: 1.6rem; max-width: 1200px; margin: 0 auto;
}
.service-card {
  background: linear-gradient(145deg, rgba(15,35,64,0.85), rgba(11,26,46,0.85));
  backdrop-filter: blur(8px);
  border: 1px solid rgba(201,168,76,.14);
  padding: 2.2rem 1.8rem; position: relative; overflow: hidden;
  opacity: 0;
  transform: translateY(32px);
  transition: border-color .3s, transform .5s, box-shadow .3s, opacity .5s;
}
.service-card.visible { opacity: 1; transform: translateY(0); }
.service-card:hover { transform: translateY(-6px); }
.service-card:nth-child(1) { transition-delay: 0ms; }
.service-card:nth-child(2) { transition-delay: 80ms; }
.service-card:nth-child(3) { transition-delay: 160ms; }
.service-card:nth-child(4) { transition-delay: 240ms; }
.service-card:nth-child(5) { transition-delay: 320ms; }
.service-card:nth-child(6) { transition-delay: 400ms; }
.service-card:nth-child(7) { transition-delay: 480ms; }
.service-card:nth-child(8) { transition-delay: 560ms; }
.service-card:nth-child(9) { transition-delay: 640ms; }
.service-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: 0; transition: opacity .3s;
}
.service-card:hover {
  border-color: rgba(201,168,76,.45);
  transform: translateY(-6px) !important;
  box-shadow: 0 20px 50px rgba(0,0,0,.5), 0 0 30px rgba(201,168,76,.07);
}
.service-card:hover::before { opacity: 1; }
.service-icon {
  width: 54px; height: 54px;
  border: 1px solid var(--gold-dark);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 1.3rem; color: var(--gold); font-size: 1.35rem;
  background: rgba(201,168,76,.06); transition: background .3s;
}
.service-card:hover .service-icon {
  background: rgba(201,168,76,.14);
  box-shadow: 0 0 18px rgba(201,168,76,.35);
  animation: iconPulse 1.4s ease-in-out infinite;
}
@keyframes iconPulse {
  0%, 100% { box-shadow: 0 0 10px rgba(201,168,76,.25); }
  50%       { box-shadow: 0 0 24px rgba(201,168,76,.55); }
}
.service-card h3 {
  font-family: 'Cinzel', serif; font-size: .97rem;
  font-weight: 700; color: var(--gold-light); margin-bottom: .65rem; line-height: 1.3;
}
.service-card p { font-size: .86rem; line-height: 1.75; color: rgba(240,238,234,.58); }
.service-num {
  position: absolute; bottom: .8rem; right: 1rem;
  font-family: 'Cinzel', serif; font-size: 2.4rem;
  font-weight: 900; color: rgba(201,168,76,.05); user-select: none;
}

/* ─── CTA BANNER ──────────────────── */
.cta-banner {
  padding: 5.5rem 5%; text-align: center;
  background: linear-gradient(135deg, rgba(22,48,80,0.85), rgba(15,35,64,0.85));
  backdrop-filter: blur(10px);
  border-top: 1px solid rgba(201,168,76,.2);
  border-bottom: 1px solid rgba(201,168,76,.2);
}
.cta-banner h2 {
  font-family: 'Cinzel', serif;
  font-size: clamp(1.8rem, 3.5vw, 3rem); font-weight: 900;
  color: var(--gold); margin-bottom: .8rem;
}
.cta-banner p { font-size: 1.05rem; color: rgba(240,238,234,.7); margin-bottom: 2.2rem; }

/* ─── CONTACT ─────────────────────── */
#contacto {
  padding: 7rem 5%;
  background: rgba(11,26,46,0.55);
}
.contact-wrap {
  display: grid; grid-template-columns: 1fr 1.55fr;
  gap: 5rem; max-width: 1200px; margin: 0 auto;
}
.contact-wrap p { margin-bottom: 2rem; }
.contact-info h3 {
  font-family: 'Cinzel', serif; font-size: 1.05rem;
  color: var(--gold); margin-bottom: 1rem;
}
.contact-info p { font-size: .93rem; color: rgba(240,238,234,.62); line-height: 1.85; margin-bottom: 2rem; }
.contact-item { display: flex; align-items: flex-start; gap: 1rem; margin-bottom: 1.5rem; }
.ci-icon {
  width: 42px; height: 42px; border: 1px solid var(--gold-dark);
  display: flex; align-items: center; justify-content: center;
  color: var(--gold); font-size: .95rem; flex-shrink: 0;
  background: rgba(201,168,76,.05);
}
.contact-item span { font-size: .86rem; color: rgba(240,238,234,.6); line-height: 1.65; }
.contact-item a { color: var(--gold-light); text-decoration: none; transition: color .2s; }
.contact-item a:hover { color: var(--gold); }
.contact-form {
  background: rgba(15,35,64,0.82);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(201,168,76,.15); padding: 2.5rem;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }
.form-group { margin-bottom: 1.2rem; }
.form-group label {
  display: block; font-family: 'Cinzel', serif;
  font-size: .63rem; letter-spacing: .15em;
  color: var(--gold); margin-bottom: .5rem; text-transform: uppercase;
}
.form-group input, .form-group textarea {
  width: 100%; background: rgba(5,13,26,.7);
  border: 1px solid rgba(201,168,76,.2); color: var(--white);
  padding: .8rem 1rem; font-family: 'Lato', sans-serif;
  font-size: .9rem; outline: none; transition: border-color .25s; resize: vertical;
}
.form-group input:focus, .form-group textarea:focus { border-color: var(--gold); }
.form-group input::placeholder, .form-group textarea::placeholder { color: rgba(240,238,234,.28); }
.form-group textarea { min-height: 120px; }
.form-msg {
  display: none; padding: 1.2rem 1.5rem; border-radius: 10px;
  font-size: .97rem; margin-top: 1rem; text-align: center;
  font-family: 'Lato', sans-serif;
}
.form-msg.success {
  display: block; background: rgba(100,200,120,0.12);
  border: 1px solid rgba(100,200,120,0.4); color: #7ed99a;
}
.form-msg.error {
  display: block; background: rgba(220,80,80,0.12);
  border: 1px solid rgba(220,80,80,0.4); color: #f08080;
}
.btn-submit:disabled { opacity: .7; cursor: not-allowed; filter: none; transform: none; }
.grecaptcha-badge { visibility: hidden !important; }
.btn-submit {
  font-family: 'Cinzel', serif; font-size: .78rem;
  letter-spacing: .14em; text-transform: uppercase;
  padding: .95rem 2.5rem;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: var(--navy-deep); border: none; cursor: pointer;
  font-weight: 700; width: 100%; transition: filter .25s;
  clip-path: polygon(10px 0%,100% 0%,calc(100% - 10px) 100%,0% 100%);
}
.btn-submit:hover { filter: brightness(1.15); }

/* ─── FOOTER ──────────────────────── */
footer {
  background: rgba(5,13,26,0.92);
  border-top: 1px solid rgba(201,168,76,.18);
  padding: 3rem 5%; text-align: center;
}
footer img { height: 42px; margin-bottom: 1.5rem; }
.footer-links {
  display: flex; justify-content: center; gap: 2rem;
  list-style: none; flex-wrap: wrap; margin-bottom: 1.5rem;
}
.footer-links a {
  font-family: 'Cinzel', serif; font-size: .63rem;
  letter-spacing: .15em; color: var(--gray);
  text-decoration: none; text-transform: uppercase; transition: color .25s;
}
.footer-links a:hover { color: var(--gold); }
footer p { font-size: .78rem; color: rgba(136,153,170,.5); }
footer p span { color: var(--gold-dark); }

/* ─── STAGGER SERVICE CARDS ──────────────────────────────────────── */
.service-card.reveal { transition-delay: 0s; }
.service-card.reveal:nth-child(1) { transition-delay: 0s; }
.service-card.reveal:nth-child(2) { transition-delay: .08s; }
.service-card.reveal:nth-child(3) { transition-delay: .16s; }
.service-card.reveal:nth-child(4) { transition-delay: .24s; }
.service-card.reveal:nth-child(5) { transition-delay: .32s; }
.service-card.reveal:nth-child(6) { transition-delay: .40s; }
.service-card.reveal:nth-child(7) { transition-delay: .48s; }
.service-card.reveal:nth-child(8) { transition-delay: .56s; }
.service-card.reveal:nth-child(9) { transition-delay: .64s; }

/* ─── REVEAL ──────────────────────── */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .7s, transform .7s; }
.reveal.visible { opacity: 1; transform: none; }

/* ─── ANIMATIONS ──────────────────── */
@keyframes fadeUp   { to { opacity:1; transform:translateY(0); } }
@keyframes fadeDown { to { opacity:1; transform:translateY(0); } }
@keyframes fadeIn   { to { opacity:1; } }

/* ─── MOBILE ──────────────────────── */
@media (max-width: 1024px) {
  body { background-attachment: scroll; }
}
@media (max-width: 900px) {
  nav { justify-content: space-between; }
  /* Ocultar logo sin que ocupe espacio hasta que haga scroll */
  .nav-logo {
    position: static;
    opacity: 0;
    pointer-events: none;
    width: 0;
    overflow: hidden;
    transition: opacity .45s ease, width .45s ease;
  }
  nav.show-brand .nav-logo {
    opacity: 1;
    pointer-events: auto;
    width: auto;
  }
  nav.show-brand .nav-links { margin-left: 0; }
  /* Hamburger centrado cuando no hay logo visible */
  .hamburger { display:flex; margin: 0 auto; }
  nav.show-brand .hamburger { margin: 0; }
  .nav-links { display:none; flex-direction:column; position:absolute; top:74px; left:0; right:0; background:rgba(5,13,26,.97); padding:1.5rem; gap:1.2rem; }
  .nav-links.open { display:flex; }
  .about-grid, .contact-wrap { grid-template-columns:1fr; gap:3rem; justify-items: center; }
  .about-grid > *, .contact-wrap > * { width: 100%; }
  .services-grid { grid-template-columns: 1fr 1fr; }
  .about-img-wrap { max-width:380px; margin:0 auto; padding:18px 18px 30px 18px; }
  .about-img-wrap::before { top:2px; left:2px; right:18px; bottom:18px; }
  .about-years { bottom:0; right:0; }
  .form-row { grid-template-columns:1fr; }
  #acerca, #servicios, #contacto { padding: 5rem 5%; }
  .cta-banner { padding: 4rem 5%; }
  .contact-form { padding: 2rem 1.5rem; }
}
@media (max-width: 580px) {
  .services-grid { grid-template-columns:1fr; }
  .hero-badges { flex-direction: column; align-items: center; }
  .hero-ctas { flex-direction: column; align-items: center; }
  .hero-ctas a { width: 100%; text-align: center; }
  #inicio { padding: 90px 5% 60px; }
  #acerca, #servicios, #contacto { padding: 4rem 5%; }
  .cta-banner { padding: 3.5rem 5%; }
  .about-img-wrap { max-width:100%; padding:0 0 30px 0; }
  .about-img-wrap::before { display:none; }
  .about-years { bottom:0; right:0; }
  .contact-form { padding: 1.5rem 1rem; }
  .footer-links { gap: 1rem; }
  .hero-divider::before, .hero-divider::after { display: none; }
  .hero-divider { justify-content: center; }
  .hero-divider span { white-space: normal; text-align: center; font-size: .62rem; letter-spacing: .1em; line-height: 1.6; }
}
@media (max-width: 380px) {
  nav { padding: 0 4%; }
  #inicio { padding: 85px 4% 50px; }
  #acerca, #servicios, #contacto { padding: 3.5rem 4%; }
  .cta-banner { padding: 3rem 4%; }
  .contact-form { padding: 1.2rem .85rem; }
  .hero-badge-item { font-size: .62rem; padding: .45rem .9rem; }
  .service-card { padding: 1.8rem 1.4rem; }
}
