/* ============================================================
   SPACEMAN TECHNOLOGIES — Base Styles
   Reset, body, typography, utilities
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@700&family=Playfair+Display:wght@400;500&family=Source+Sans+3:wght@300;400;600;700&display=swap');

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

section[id] {
  scroll-margin-top: 80px;
}

body {
  font-family: var(--font-source);
  font-size: var(--text-body);
  font-weight: var(--fw-regular);
  line-height: var(--lh-body);
  letter-spacing: var(--ls-body);
  color: var(--color-pure-white);
  background-color: var(--color-deep-space);
  background-image:
    radial-gradient(ellipse 90% 60% at 50% 0%, rgba(56, 189, 248, 0.12), transparent 70%),
    radial-gradient(ellipse 70% 50% at 85% 45%, rgba(168, 85, 247, 0.1), transparent 60%),
    radial-gradient(ellipse 65% 55% at 15% 75%, rgba(0, 240, 255, 0.08), transparent 60%),
    radial-gradient(ellipse 80% 60% at 50% 100%, rgba(168, 85, 247, 0.12), transparent 70%);
  background-attachment: fixed;
  overflow-x: hidden;
  cursor: none; /* Custom cursor active */
}

@media (min-width: 768px) {
  body, a, button, .pres-card, .service-card, .project-card, .obj-card, .filter-btn {
    cursor: none !important;
  }
}

/* ── CUSTOM CURSOR (Ultra-Luminous Cosmic Pointer) ───────────── */
.cursor-dot {
  width: 10px;
  height: 10px;
  background: #00f0ff;
  border-radius: 50%;
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 9999999;
  box-shadow: 0 0 12px #00f0ff, 0 0 24px rgba(0, 240, 255, 0.85);
  will-change: transform;
  transition: width 0.2s ease, height 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.cursor-ring {
  width: 40px;
  height: 40px;
  border: 2px solid rgba(0, 240, 255, 0.85);
  background: rgba(0, 240, 255, 0.06);
  box-shadow: 0 0 18px rgba(0, 240, 255, 0.45), inset 0 0 12px rgba(139, 92, 246, 0.25);
  border-radius: 50%;
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 9999998;
  will-change: transform;
  transition: width 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), height 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), border-color 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
}

.cursor-dot.cursor-hover {
  width: 14px;
  height: 14px;
  background: #ffd166;
  box-shadow: 0 0 18px #ffd166, 0 0 35px rgba(255, 209, 102, 0.9);
}

.cursor-ring.cursor-hover {
  width: 60px;
  height: 60px;
  border-color: #ffd166;
  background: rgba(255, 209, 102, 0.14);
  box-shadow: 0 0 25px rgba(255, 209, 102, 0.65), inset 0 0 15px rgba(0, 240, 255, 0.3);
}

/* ── HYPERSPACE LOADER & SCI-FI COCKPIT HUD ─────────────────── */
#loader {
  position: fixed;
  inset: 0;
  background: #02020a;
  z-index: var(--z-loader);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

#hyperspace-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

.loader-hud {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  user-select: none;
}

/* Reactor rings around ST logo */
.loader-reactor {
  position: relative;
  width: 140px;
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
}

.reactor-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  pointer-events: none;
}

.reactor-ring-1 {
  border: 1px dashed rgba(0, 240, 255, 0.6);
  box-shadow: 0 0 25px rgba(0, 240, 255, 0.35);
  animation: reactorSpin 12s linear infinite;
}

.reactor-ring-2 {
  inset: 8px;
  border: 1.5px solid rgba(139, 92, 246, 0.45);
  border-top-color: rgba(0, 240, 255, 0.95);
  border-bottom-color: rgba(255, 209, 102, 0.85);
  animation: reactorSpinReverse 6s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes reactorSpin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

@keyframes reactorSpinReverse {
  from { transform: rotate(360deg); }
  to   { transform: rotate(0deg); }
}

.loader-astronaut-badge {
  width: 82px;
  height: 82px;
  border-radius: 50%;
  overflow: hidden;
  position: relative;
  z-index: 2;
  border: 2px solid rgba(0, 240, 255, 0.7);
  box-shadow:
    0 0 24px rgba(0, 240, 255, 0.65),
    0 0 45px rgba(168, 85, 247, 0.4),
    inset 0 0 15px rgba(0, 240, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  background: #05060f;
  animation: emblemPulse 3s ease-in-out infinite alternate;
}

.loader-astronaut-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 6px;
  display: block;
  filter: contrast(1.1) brightness(1.05);
}

@keyframes emblemPulse {
  0% {
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.5), 0 0 35px rgba(168, 85, 247, 0.3);
    transform: scale(0.98);
  }
  100% {
    box-shadow: 0 0 32px rgba(0, 240, 255, 0.9), 0 0 55px rgba(168, 85, 247, 0.6), 0 0 20px rgba(255, 209, 102, 0.4);
    transform: scale(1.02);
  }
}


/* ── SCROLL PROGRESS ─────────────────────────────────────────── */
#scroll-progress {
  position: fixed;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
  width: 1px;
  height: 120px;
  background: rgba(255, 255, 255, 0.08);
  z-index: var(--z-nav);
}

#scroll-progress-fill {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 0%;
  background: var(--color-lagoon-teal);
  transition: height 0.1s linear;
}

/* ── SECTION BASE ────────────────────────────────────────────── */
section {
  position: relative;
  overflow: hidden;
}

.section-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--sp-120) var(--sp-40);
}

/* ── SECTION LABELS (Iridescent 'otra dimensión' chromatic styling) ── */
.section-label {
  display: inline-block;
  font-family: var(--font-source);
  font-size: var(--text-caption);
  font-weight: var(--fw-bold);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  background: linear-gradient(135deg, #00f0ff 0%, #38bdf8 35%, #a855f7 70%, #ffd166 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 16px rgba(0, 240, 255, 0.45));
  margin-bottom: var(--sp-16);
}

.section-label::before {
  content: '—  ';
}

/* ── HEADINGS ────────────────────────────────────────────────── */
.heading-display {
  font-family: var(--font-playfair);
  font-size: clamp(40px, 6vw, var(--text-display));
  font-weight: var(--fw-regular);
  line-height: var(--lh-display);
  color: var(--color-pure-white);
}

.heading-main {
  font-family: var(--font-playfair);
  font-size: clamp(32px, 4vw, var(--text-heading));
  font-weight: var(--fw-regular);
  line-height: var(--lh-heading);
  color: var(--color-pure-white);
}

.heading-sm {
  font-family: var(--font-source);
  font-size: var(--text-heading-sm);
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-heading-sm);
  color: var(--color-pure-white);
}

/* ── BODY TEXT & DESCRIPTIVE PARAGRAPHS ──────────────────────── */
p {
  line-height: var(--lh-body);
  text-wrap: pretty;
}

/* Párrafos descriptivos con justificación tipográfica natural (sin huecos excesivos entre palabras) */
.mv-block p,
.obj-card p,
.about-intro-text p,
.service-card p,
.project-desc,
.project-modal-desc,
.card-body p,
.text-justified {
  text-align: justify;
  text-justify: auto;
  text-align-last: left;
  hyphens: auto;
  -webkit-hyphens: auto;
  -ms-hyphens: auto;
  text-wrap: pretty;
  word-spacing: -0.01em;
}

/* Centrado explícito para encabezados y subtítulos de sección */
.hero-content,
.hero-sub,
.services-header,
.services-header p,
.projects-header,
.projects-header p,
.contact-header,
.contact-header p,
.about-cards-title,
.objectives-title {
  text-align: center !important;
}

.services-header p,
.projects-header p,
.contact-header p {
  margin-left: auto !important;
  margin-right: auto !important;
}

.text-body {
  font-family: var(--font-source);
  font-size: var(--text-body);
  line-height: var(--lh-body);
  color: var(--color-fog);
}

.text-caption {
  font-family: var(--font-source);
  font-size: var(--text-caption);
  line-height: var(--lh-caption);
  color: var(--color-steel);
}

/* ── GHOST BUTTON ────────────────────────────────────────────── */
.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-8);
  padding: var(--sp-12) var(--sp-24);
  border: 1px solid var(--color-slate-blue);
  border-radius: var(--radius-buttons);
  background: transparent;
  color: var(--color-slate-blue);
  font-family: var(--font-source);
  font-size: var(--text-caption);
  font-weight: var(--fw-bold);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: none;
  transition: border-color var(--transition-base), color var(--transition-base), box-shadow var(--transition-base);
}

.btn-ghost:hover {
  border-color: var(--color-lagoon-teal);
  color: var(--color-lagoon-teal);
  box-shadow: var(--shadow-teal);
}

.btn-ghost-teal {
  border-color: var(--color-lagoon-teal);
  color: var(--color-lagoon-teal);
}

.btn-ghost-teal:hover {
  background: var(--color-lagoon-teal-dim);
  box-shadow: var(--shadow-teal);
}

/* ── DIVIDER ─────────────────────────────────────────────────── */
.divider {
  width: 100%;
  height: 1px;
  background: rgba(191, 191, 191, 0.12);
  border: none;
}

/* ── LINK ────────────────────────────────────────────────────── */
a {
  color: inherit;
  text-decoration: none;
  cursor: none;
}

.link-teal {
  color: var(--color-fog);
  border-bottom: 1px solid transparent;
  transition: color var(--transition-base), border-color var(--transition-base);
}

.link-teal:hover {
  color: var(--color-pure-white);
  border-bottom-color: var(--color-lagoon-teal);
}

/* ── GLASSMORPHISM CARD ──────────────────────────────────────── */
.glass-card {
  background: var(--glass-surface);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-cards);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: background var(--transition-base), border-color var(--transition-base), box-shadow var(--transition-base);
}

.glass-card:hover {
  background: var(--glass-surface-hover);
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow: var(--shadow-card);
}

/* ── ANIMATION HELPERS ───────────────────────────────────────── */
.will-animate {
  opacity: 0;
  transform: translateY(30px);
}

.will-animate-left {
  opacity: 0;
  transform: translateX(-40px);
}

.will-animate-right {
  opacity: 0;
  transform: translateX(40px);
}

/* ── VISUALS ─────────────────────────────────────────────────── */
.teal-glow {
  text-shadow: 0 0 40px rgba(0, 164, 166, 0.5);
}

/* ── RESPONSIVE ──────────────────────────────────────────────── */
@media (max-width: 768px) {
  .section-inner {
    padding: var(--sp-80) var(--sp-24);
  }
  body { cursor: auto; }
  .cursor-dot, .cursor-ring { display: none; }
}
