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

:root {
  --bg: #07070c;
  --white: #f0f0f8;
  --gold: #c8a84b;
  --muted: rgba(255, 255, 255, 0.35);
}

body {
  background: var(--bg);
  color: var(--white);
  font-family: "DM Sans", sans-serif;
  overflow: hidden;
}
body.ready {
  overflow-y: auto;
}

/* ══════════════════════════
   PRELOADER
══════════════════════════ */
#preloader {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 36px;
  transition: opacity 0.7s ease, visibility 0.7s ease;
}

#preloader.hide {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* — Corner brackets — */
.bracket {
  position: absolute;
  width: 36px;
  height: 36px;
}
.bracket::before,
.bracket::after {
  content: "";
  position: absolute;
  background: rgba(200, 168, 75, 0.5);
}
.bracket::before {
  width: 100%;
  height: 1px;
  top: 0;
  left: 0;
}
.bracket::after {
  width: 1px;
  height: 100%;
  top: 0;
  left: 0;
}
.bracket.tl {
  top: 28px;
  left: 28px;
}
.bracket.tr {
  top: 28px;
  right: 28px;
  transform: scaleX(-1);
}
.bracket.bl {
  bottom: 28px;
  left: 28px;
  transform: scaleY(-1);
}
.bracket.br {
  bottom: 28px;
  right: 28px;
  transform: scale(-1, -1);
}

/* — Logo — */
.pre-logo {
  display: inline-block;
  width: 100%;
  text-align: center;
  font-family: "Bebas Neue", sans-serif;
  font-size: clamp(3.5rem, 12vw, 7rem);
  letter-spacing: 0.25em;
  color: transparent;
  -webkit-text-stroke: 1px rgba(255, 255, 255, 0.12);
  position: relative;
  line-height: 1;
  user-select: none;
}
.pre-logo-fill {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  font-family: "Bebas Neue", sans-serif;
  font-size: inherit;
  letter-spacing: inherit;
  line-height: inherit;
  color: var(--white);
  white-space: nowrap;
  clip-path: inset(100% 0 0 0);
  transition: clip-path 1.2s cubic-bezier(0.76, 0, 0.24, 1);
}
.pre-logo-fill.reveal {
  clip-path: inset(0% 0 0 0);
}

/* — Unique loader: Morphing liquid ring — */
.loader-ring {
  position: relative;
  width: 72px;
  height: 72px;
}

.loader-ring svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  animation: ring-spin 2s linear infinite;
}

.ring-track {
  fill: none;
  stroke: rgba(255, 255, 255, 0.05);
  stroke-width: 2;
}

.ring-arc {
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-dasharray: 180 226;
  stroke-dashoffset: 0;
  animation: arc-chase 2s ease-in-out infinite;
}

.ring-arc.a1 {
  stroke: var(--gold);
  filter: drop-shadow(0 0 5px var(--gold));
}
.ring-arc.a2 {
  stroke: rgba(200, 168, 75, 0.3);
  stroke-dasharray: 60 346;
  animation: arc-chase2 2s ease-in-out infinite;
}

.ring-center-dot {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 6px;
  height: 6px;
  background: var(--gold);
  border-radius: 50%;
  box-shadow: 0 0 14px var(--gold), 0 0 28px rgba(200, 168, 75, 0.3);
  animation: dot-breathe 2s ease-in-out infinite;
}

@keyframes ring-spin {
  to {
    transform: rotate(360deg);
  }
}
@keyframes arc-chase {
  0% {
    stroke-dashoffset: 0;
  }
  50% {
    stroke-dashoffset: -180;
  }
  100% {
    stroke-dashoffset: -406;
  }
}
@keyframes arc-chase2 {
  0% {
    stroke-dashoffset: 0;
  }
  50% {
    stroke-dashoffset: -80;
  }
  100% {
    stroke-dashoffset: -406;
  }
}
@keyframes dot-breathe {
  0%,
  100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.7;
  }
  50% {
    transform: translate(-50%, -50%) scale(1.5);
    opacity: 1;
  }
}

/* — Counter — */
.pre-count {
  font-family: "Space Mono", monospace;
  font-size: 0.7rem;
  letter-spacing: 0.3em;
  color: rgba(255, 255, 255, 0.2);
}
.pre-count span {
  color: var(--gold);
  font-weight: 700;
}

/* ══════════════════════════
   PAGE
══════════════════════════ */
#page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 40px;
  position: relative;
  overflow: hidden;
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.9s ease 0.2s, transform 0.9s ease 0.2s;
}
#page.visible {
  opacity: 1;
  transform: translateY(0);
}

/* subtle grid bg */
#page::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(
      rgba(255, 255, 255, 0.022) 1px,
      transparent 1px
    ),
    linear-gradient(90deg, rgba(255, 255, 255, 0.022) 1px, transparent 1px);
  background-size: 56px 56px;
  pointer-events: none;
}

/* glow blob */
#page::after {
  content: "";
  position: absolute;
  top: 20%;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 400px;
  background: radial-gradient(
    ellipse,
    rgba(200, 168, 75, 0.06) 0%,
    transparent 70%
  );
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 780px;
}

.logo {
  margin-bottom: 20px;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.7s ease 0.3s, transform 0.7s ease 0.3s;
}
#page.visible .logo {
  opacity: 1;
  transform: translateY(0);
}

.logo img {
  width: 205px;
  height: auto;
  max-width: 100%;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: "Space Mono", monospace;
  font-size: 0.62rem;
  letter-spacing: 0.45em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 28px;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.7s ease 0.5s, transform 0.7s ease 0.5s;
}
.eyebrow::before,
.eyebrow::after {
  content: "";
  width: 24px;
  height: 1px;
  background: var(--gold);
  opacity: 0.5;
}
#page.visible .eyebrow {
  opacity: 1;
  transform: translateY(0);
}

h1 {
  font-family: "Bebas Neue", sans-serif;
  font-size: clamp(4rem, 11vw, 9rem);
  line-height: 0.92;
  letter-spacing: 0.04em;
  margin-bottom: 28px;
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.8s ease 0.65s, transform 0.8s ease 0.65s;
}
h1 em {
  font-style: normal;
  color: transparent;
  -webkit-text-stroke: 1.5px rgba(255, 255, 255, 0.2);
}
#page.visible h1 {
  opacity: 1;
  transform: translateY(0);
}

p.sub {
  font-size: 1rem;
  font-weight: 300;
  line-height: 1.35;
  color: var(--muted);
  max-width: 480px;
  margin: 0 auto 44px;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.7s ease 0.85s, transform 0.7s ease 0.85s;
}
#page.visible p.sub {
  opacity: 1;
  transform: translateY(0);
}

.cta-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  justify-content: center;
  align-items: start;
  width: 100%;
  max-width: 520px;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.7s ease 1s, transform 0.7s ease 1s;
  margin: 0 auto;
}
#page.visible .cta-row {
  opacity: 1;
  transform: translateY(0);
}

/* Tercer botón (Contactanos) centrado en nueva fila */
.cta-row .btn:nth-child(3) {
  grid-column: 1 / -1;
  justify-self: center;
  margin-top: 8px;
  width: auto;
}

.btn {
  font-family: "Space Mono", monospace;
  font-size: 0.65rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 14px 32px;
  cursor: pointer;
  border-radius: 7px;
  transition: transform 0.2s;
}
.btn:hover {
  transform: translateY(-2px);
}
.btn-fill {
  text-decoration: none;
  background: var(--gold);
  color: #07070c;
  font-weight: 700;
}
.btn-fill:hover {
  background: #dfc06a;
}
.btn-outline {
  position: relative;
  overflow: hidden;
  background: transparent;
  color: rgba(255, 255, 255, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.12);
  text-decoration: none;
  transition: color 0.3s ease, border-color 0.3s ease, transform 0.2s ease;
}
.btn-outline::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    120deg,
    rgba(200, 168, 75, 0.16),
    rgba(255, 255, 255, 0.04),
    rgba(200, 168, 75, 0.08)
  );
  opacity: 1;
  transform: scale(1);
  transition: opacity 0.35s ease, transform 0.35s ease;
  pointer-events: none;
}
.btn-outline::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  background: linear-gradient(45deg, transparent, rgba(200, 168, 75, 0.8), transparent);
  filter: blur(8px);
  opacity: 0.28;
  animation: glow-slide 2.6s ease-in-out infinite;
  pointer-events: none;
}
.btn-outline:hover {
  border-color: rgba(200, 168, 75, 0.75);
  color: var(--white);
}
.btn-outline:hover::before {
  opacity: 1;
  transform: scale(1.02);
}
.btn-outline:hover::after {
  opacity: 0.6;
}
@keyframes glow-slide {
  0%,
  100% {
    transform: translateX(-100%);
  }
  50% {
    transform: translateX(100%);
  }
}

/* scroll cue */
.scroll-cue {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  opacity: 0;
  transition: opacity 0.6s ease 1.4s;
  z-index: 1;
}
#page.visible .scroll-cue {
  opacity: 1;
}
.scroll-cue-line {
  width: 1px;
  height: 36px;
  background: linear-gradient(to bottom, var(--gold), transparent);
  animation: line-bounce 2s ease-in-out infinite;
}
.scroll-cue-label {
  font-family: "Space Mono", monospace;
  font-size: 0.52rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.15);
}
@keyframes line-bounce {
  0%,
  100% {
    transform: scaleY(1);
    opacity: 0.5;
  }
  50% {
    transform: scaleY(1.3);
    opacity: 1;
  }
}

/* ══════════════════════════
   MEDIA QUERIES - RESPONSIVE
══════════════════════════ */

/* Tablets y dispositivos medianos (768px y superior) */
@media (min-width: 768px) {
  .cta-row {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    max-width: 520px;
  }
  
  .cta-row .btn:nth-child(3) {
    grid-column: 1 / -1;
    justify-self: center;
    margin-top: 12px;
  }
}

/* Móviles pequeños (hasta 767px) */
@media (max-width: 767px) {
  .cta-row {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    width: 100%;
  }
  
  .cta-row .btn {
    padding: 12px 24px;
    font-size: 0.6rem;
  }
  
  .cta-row .btn:nth-child(3) {
    grid-column: 1 / -1;
    justify-self: center;
    margin-top: 8px;
    width: auto;
  }
}

/* Móviles muy pequeños (hasta 480px) */
@media (max-width: 480px) {
  .cta-row {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  
  .cta-row .btn {
    padding: 10px 16px;
    font-size: 0.65rem;
    letter-spacing: 0.15em;
  }
  
  .cta-row .btn:nth-child(3) {
    margin-top: 6px;
  }
}
