/* ==========================================================================
   MYCLOUD.UNO — CSS BASE & COMPARTIDO
   Variables, Reset, Tipografía, Botones, Nav Flotante, Cortina y Footer
   ========================================================================== */

:root {
  /* Paleta cromática extraída del sitio */
  --ink: #0f1033;
  --ink-soft: #1f2347;
  --bg: #faf9ff;
  --bg-pure: #ffffff;
  --grid: #ebe8fa;
  
  --indigo: #4f46e5;
  --indigo-hover: #4338ca;
  --indigo-soft: #c7cdff;
  --indigo-subtle: #eef2ff;
  
  --navy: #1f2347;
  --navy-deep: #161a40;
  --navy-dark: #0f1222;
  
  --mint: #10b981;
  --mint-bright: #34d399;
  --mint-soft: #a7f3d0;
  
  --amber: #fbbf24;
  --amber-soft: #fde68a;
  
  --pink: #4f46e5;
  --pink-soft: #c7cdff;
  --blue-sky: #38bdf8;
  --blue-bright: #3b82f6;
  
  --muted: #464a7a;
  --muted-light: #6b7280;
  --on-navy: #e7e8ff;
  
  /* Tipografías */
  --font-display: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
  
  /* Neobrutalismo */
  --border-thick: 2px solid var(--ink);
  --border-radius-card: 18px;
  --border-radius-pill: 999px;
  --shadow-hard: 4px 4px 0 var(--ink);
  --shadow-hover: 6px 6px 0 var(--ink);
  
  color-scheme: light;
}

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

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

body {
  background-color: var(--bg);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 16px;
  line-height: 1.55;
  font-weight: 500;
  background-image: 
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 80px 80px;
  overflow-x: clip;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

main {
  flex: 1;
}

h1, h2, h3, h4, p {
  margin: 0;
}

h1, h2, h3 {
  text-wrap: balance;
  letter-spacing: -0.04em;
  line-height: 1.05;
  font-weight: 800;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

img, picture, svg {
  display: block;
  max-width: 100%;
}

:focus-visible {
  outline: 3px solid var(--amber);
  outline-offset: 3px;
}

.wrap {
  width: 100%;
  max-width: 1180px;
  margin-inline: auto;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
}

.mono {
  font-family: var(--font-mono);
}

/* ==========================================================================
   KICKER / EYEBROW
   ========================================================================== */
.eyebrow {
  display: flex;
  align-items: center;
  gap: 16px;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--indigo);
}

.eyebrow::after {
  content: "";
  flex: 1;
  border-top: 2px solid var(--ink);
  order: 1;
}

.eyebrow em {
  order: 2;
  font-style: normal;
  color: var(--muted);
  letter-spacing: 0.16em;
}

/* ==========================================================================
   BOTONES NEOBRUTALISTAS & MAGNÉTICOS
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  padding: 0.9em 1.5em;
  border: var(--border-thick);
  border-radius: 14px;
  background: #ffffff;
  color: var(--ink);
  font-weight: 800;
  font-size: 0.98rem;
  box-shadow: var(--shadow-hard);
  transform: translate(var(--mx, 0), var(--my, 0));
  transition: transform 0.12s ease-out, box-shadow 0.12s ease-out, background 0.2s;
  user-select: none;
  touch-action: manipulation;
}

.btn:hover {
  transform: translate(calc(var(--mx, 0) - 2px), calc(var(--my, 0) - 2px));
  box-shadow: var(--shadow-hover);
}

.btn:active {
  transform: translate(calc(var(--mx, 0) + 3px), calc(var(--my, 0) + 3px));
  box-shadow: 1px 1px 0 var(--ink);
}

.btn.primary {
  background: var(--indigo);
  color: #ffffff;
}

.btn.primary:hover {
  background: var(--indigo-hover);
}

.btn.amber {
  background: var(--amber);
  color: var(--ink);
}

.btn.mint {
  background: var(--mint-bright);
  color: var(--ink);
}

/* ==========================================================================
   REVEAL ON SCROLL
   ========================================================================== */
.rv {
  transform: translateY(28px);
  opacity: 0;
  transition: transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.6s ease;
  transition-delay: calc(var(--d, 0) * 80ms);
}

.rv.in {
  transform: none;
  opacity: 1;
}

.outline {
  font-weight: 800;
  letter-spacing: -0.04em;
  color: transparent;
  -webkit-text-stroke: 2px var(--indigo);
  line-height: 0.9;
}

/* ==========================================================================
   NAV FLOTANTE CON BARRA DE PROGRESO
   ========================================================================== */
.nav-wrap {
  position: sticky;
  top: calc(env(safe-area-inset-top, 0px) + 12px);
  z-index: 90;
  width: 100%;
  pointer-events: none;
}

.nav {
  pointer-events: auto;
  position: relative;
  width: min(980px, calc(100% - 32px));
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px 10px 16px;
  border-radius: var(--border-radius-pill);
  background: var(--navy);
  color: #ffffff;
  border: 2px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 14px 30px rgba(15, 16, 51, 0.28);
  overflow: hidden;
}

/* Barra de progreso de lectura */
.nav::after {
  content: "";
  position: absolute;
  left: 20px;
  bottom: 0;
  height: 3px;
  width: calc((100% - 40px) * var(--p, 0));
  background: linear-gradient(90deg, var(--indigo), var(--mint-bright), var(--amber));
  border-radius: 3px;
  transition: width 0.05s linear;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.04em;
  color: #ffffff;
}

.brand i {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--indigo);
  border: 1.5px solid rgba(255, 255, 255, 0.25);
}

.brand i svg {
  width: 20px;
  height: 20px;
}

.brand span {
  font-weight: 500;
  color: var(--indigo-soft);
}

.links {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border-radius: var(--border-radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
}

.links a {
  padding: 8px 18px;
  border-radius: var(--border-radius-pill);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--indigo-soft);
  transition: background 0.2s, color 0.2s, transform 0.15s;
  white-space: nowrap;
}

.links a:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
}

.links a.on {
  background: var(--indigo);
  color: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25);
}

@media (max-width: 600px) {
  .nav {
    padding: 8px 12px;
    width: calc(100% - 24px);
  }
  .brand b {
    display: none;
  }
  .brand i {
    width: 32px;
    height: 32px;
  }
  .brand i svg {
    width: 18px;
    height: 18px;
  }
  .links {
    gap: 3px;
    padding: 3px;
  }
  .links a {
    padding: 6px 13px;
    font-size: 0.85rem;
  }
}

/* ==========================================================================
   CORTINA DE TRANSICIÓN ENTRE PÁGINAS (PANELES CON IMÁGENES TÉCNICAS)
   Programación, Redes, Servidores, Terminal y Hardware
   ========================================================================== */
.page-curtain {
  position: fixed;
  inset: 0;
  z-index: 99999;
  pointer-events: none;
  display: flex;
  visibility: hidden;
  background: rgba(10, 12, 35, 0.4);
}

.page-curtain.is-active {
  pointer-events: auto;
  visibility: visible;
}

.curtain-stripe {
  position: relative;
  flex: 1;
  height: 100%;
  transform: translateY(-100%);
  transition: transform 0.5s cubic-bezier(0.7, 0, 0.2, 1);
  overflow: hidden;
  border-right: 2px solid rgba(15, 16, 51, 0.9);
  box-shadow: 0 0 25px rgba(0, 0, 0, 0.5);
  background-size: cover;
  background-position: center;
}

.curtain-stripe:last-child {
  border-right: none;
}

/* Capa oscura cinematográfica sobre las imágenes */
.curtain-stripe::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(15, 18, 48, 0.45) 0%,
    rgba(15, 18, 48, 0.6) 40%,
    rgba(11, 13, 36, 0.88) 100%
  );
  z-index: 1;
}

/* Línea luminosa inferior */
.curtain-stripe::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4px;
  background: var(--stripe-glow, var(--indigo));
  box-shadow: 0 0 14px var(--stripe-glow, var(--indigo));
  z-index: 2;
}

.curtain-stripe .stripe-tag {
  position: absolute;
  left: 50%;
  bottom: 32px;
  transform: translateX(-50%);
  z-index: 3;
  padding: 6px 14px;
  border: 1.5px solid rgba(255, 255, 255, 0.4);
  border-radius: var(--border-radius-pill);
  background: rgba(15, 18, 48, 0.85);
  backdrop-filter: blur(8px);
  color: #ffffff;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
}

@media (max-width: 680px) {
  .curtain-stripe .stripe-tag {
    display: none;
  }
}

/* Fondos específicos y delays de entrada */
.curtain-stripe.s-code {
  background-image: url('../assets/img/curtain-code.jpg');
  --stripe-glow: var(--indigo);
  transition-delay: 0s;
}

.curtain-stripe.s-network {
  background-image: url('../assets/img/curtain-network.jpg');
  --stripe-glow: var(--mint-bright);
  transition-delay: 0.06s;
}

.curtain-stripe.s-servers {
  background-image: url('../assets/img/curtain-servers.jpg');
  --stripe-glow: var(--amber);
  transition-delay: 0.12s;
}

.curtain-stripe.s-terminal {
  background-image: url('../assets/img/curtain-terminal.jpg');
  --stripe-glow: #38bdf8;
  transition-delay: 0.18s;
}

.curtain-stripe.s-hardware {
  background-image: url('../assets/img/curtain-hardware.jpg');
  --stripe-glow: #38bdf8;
  transition-delay: 0.24s;
}

/* Entrada: cubren la pantalla */
.page-curtain.entering .curtain-stripe {
  transform: translateY(0%);
}

/* Cubierta al iniciar página nueva */
.page-curtain.covered .curtain-stripe {
  transform: translateY(0%);
  transition: none;
}

/* Salida: bajan hacia afuera */
.page-curtain.leaving .curtain-stripe {
  transform: translateY(100%);
  transition: transform 0.5s cubic-bezier(0.7, 0, 0.2, 1);
}

.page-curtain.leaving .curtain-stripe.s-code { transition-delay: 0s; }
.page-curtain.leaving .curtain-stripe.s-network { transition-delay: 0.06s; }
.page-curtain.leaving .curtain-stripe.s-servers { transition-delay: 0.12s; }
.page-curtain.leaving .curtain-stripe.s-terminal { transition-delay: 0.18s; }
.page-curtain.leaving .curtain-stripe.s-hardware { transition-delay: 0.24s; }

/* ==========================================================================
   MASCOTA MICLÓ
   ========================================================================== */
.mascot {
  position: fixed;
  right: max(16px, env(safe-area-inset-right, 0px));
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  width: 58px;
  height: 58px;
  z-index: 85;
  pointer-events: auto;
  cursor: pointer;
  filter: drop-shadow(3px 3px 0 var(--ink));
  transition: transform 0.2s cubic-bezier(0.3, 1.4, 0.5, 1);
}

.mascot:hover {
  transform: scale(1.1) translateY(-2px);
}

.mascot:active {
  transform: scale(0.95) translateY(2px);
}

.mascot .body {
  position: relative;
  width: 100%;
  height: 100%;
  background: #6d5be6;
  border: 2px solid var(--ink);
  border-radius: 50% 50% 46% 46% / 56% 56% 44% 44%;
  box-shadow: inset -6px -8px 0 rgba(15, 16, 51, 0.2);
  animation: mascot-bob 3s ease-in-out infinite;
}

.mascot .body::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -12px;
  width: 3px;
  height: 12px;
  margin-left: -1.5px;
  background: var(--ink);
}

.mascot .body::after {
  content: "";
  position: absolute;
  left: 50%;
  top: -21px;
  width: 13px;
  height: 13px;
  margin-left: -6.5px;
  border-radius: 50%;
  background: var(--amber);
  border: 2px solid var(--ink);
  box-shadow: 0 0 10px var(--amber);
}

.mascot .eye {
  position: absolute;
  top: 20px;
  width: 7px;
  height: 10px;
  border-radius: 50%;
  background: var(--ink);
  transition: height 0.2s, transform 0.2s;
}

.mascot .eye.l { left: 15px; }
.mascot .eye.r { right: 15px; }

.mascot .mouth {
  position: absolute;
  left: 50%;
  top: 34px;
  width: 14px;
  height: 7px;
  margin-left: -7px;
  border: 2.5px solid var(--ink);
  border-top: 0;
  border-radius: 0 0 14px 14px;
  transition: all 0.2s;
}

/* Ánimos */
.mascot[data-mood="wow"] .mouth {
  width: 10px;
  height: 10px;
  margin-left: -5px;
  border-radius: 50%;
  border-top: 2.5px solid var(--ink);
  background: var(--ink);
}
.mascot[data-mood="wow"] .eye {
  height: 13px;
}

.mascot[data-mood="think"] .mouth {
  width: 12px;
  height: 0;
  margin-left: -6px;
  border: 0;
  border-top: 2.5px solid var(--ink);
  border-radius: 2px;
  transform: rotate(4deg);
}
.mascot[data-mood="think"] .eye.r {
  transform: scaleY(0.4);
}

@keyframes mascot-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}

/* ==========================================================================
   CIERRE & FOOTER COMPARTIDO
   ========================================================================== */
.footer-cta {
  position: relative;
  background: var(--navy);
  color: #ffffff;
  background-image: 
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 80px 80px;
  clip-path: polygon(0 4vw, 100% 0, 100% 100%, 0 100%);
  margin-top: -3vw;
  padding-top: calc(4vw + 72px);
  overflow: hidden;
  border-top: 2px solid var(--ink);
}

.banner-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 38px 40px;
  border: 2px solid #ffffff;
  border-radius: 18px;
  background: var(--indigo);
  transform: rotate(-0.5deg);
  box-shadow: 8px 8px 0 var(--ink);
}

.banner-cta h2 {
  font-size: clamp(1.8rem, 3.8vw, 2.9rem);
  color: #ffffff;
}

.wm-wrap {
  position: relative;
  margin-top: 60px;
  margin-bottom: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: visible;
}

.wm {
  position: relative;
  white-space: nowrap;
  text-align: center;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 0.95;
  font-size: clamp(2rem, 9.2vw, 8.8rem);
  color: transparent;
  -webkit-text-stroke: 2px rgba(129, 140, 248, 0.45);
  user-select: none;
  cursor: default;
  max-width: 100%;
}

.wm::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  color: transparent;
  -webkit-text-stroke: 0;
  background: radial-gradient(
    circle 260px at var(--gx, 50%) var(--gy, 50%),
    var(--mint-bright) 0%,
    var(--amber) 40%,
    rgba(251, 191, 36, 0) 72%
  );
  -webkit-background-clip: text;
  background-clip: text;
  opacity: 0.85;
  pointer-events: none;
}

.footer-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding-block: 28px calc(36px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--on-navy);
}

.footer-bar .legal {
  opacity: 0.8;
}

.footer-bar a:hover {
  color: var(--amber);
  text-decoration: underline;
}

/* ==========================================================================
   ACCESIBILIDAD: PREFERS-REDUCED-MOTION
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
  .rv {
    transform: none !important;
    opacity: 1 !important;
  }
  .curtain-stripe {
    display: none !important;
  }
  .mascot .body {
    animation: none !important;
  }
}
