/* ================================
   BASE.CSS - OPTIMIZADO
   Variables, Reset, Tipografía, Layout, Utilities
   ================================ */

/* ================================
   VARIABLES CSS
   ================================ */
:root {
  /* Colores principales */
  --primary: #5b2c6f;
  --primary-hover: #7b4c9f;
  --primary-dark: #4a1f5c;
  --secondary: #14b8a6;
  --secondary-hover: #0d9488;

  /* Colores por categoría de proyecto */
  --frontend: #5b2c6f;
  --frontend-accent: #14b8a6;
  --uxui: #3b82f6;
  --uxui-accent: #06b6d4;
  --service: #6366f1;
  --service-accent: #475569;

  /* Colores semánticos */
  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;
  --info: #6366f1;

  /* 🌸 Color Journey */
  --journey: #ff6b9d;
  --journey-light: rgba(255, 107, 157, 0.08);
  --journey-medium: rgba(255, 107, 157, 0.15);
  --journey-dark: #e5568a;

  /* Escala de grises */
  --slate-50: #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-700: #334155;
  --slate-900: #0f172a;

  /* Backgrounds */
  --bg-primary: #ffffff;
  --bg-secondary: var(--slate-50);
  --bg-dark: var(--slate-900);

  /* Borders */
  --border: var(--slate-200);
  --border-hover: var(--slate-300);

  /* Sombras */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);

  /* Espaciado */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-12: 3rem;
  --space-16: 4rem;

  /* Border radius */
  --radius-sm: 0.25rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.5rem;
  --radius-full: 9999px;

  /* Transiciones */
  --transition-fast: 0.15s ease;
  --transition-base: 0.3s ease;
  --transition-slow: 0.6s ease;

  /* Z-index */
  --z-base: 1;
  --z-sticky: 1020;
  --z-modal: 1050;
  --z-tooltip: 1100;

  /* Layout */
  --container-width: 1280px;
  --container-padding: 1.5rem;
  --header-height: 73px;
}

/* Colores dinámicos por categoría de proyecto */
body[data-category="ux-ui"] {
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --primary-dark: #1e40af;
  --secondary: #06b6d4;
}

body[data-category="service-design"] {
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-dark: #4338ca;
  --secondary: #475569;
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
  color: var(--slate-700);
  background: var(--bg-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

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

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

a {
  text-decoration: none;
  color: inherit;
  transition: color var(--transition-fast);
}

ul,
ol {
  list-style: none;
}

/* ================================
   TIPOGRAFÍA
   ================================ */
h1,
h2,
h3,
h4,
h5,
h6 {
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--slate-900);
  margin-bottom: 0;
}

h1 {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
}
h2 {
  font-size: clamp(2rem, 4vw, 3rem);
}
h3 {
  font-size: clamp(1.5rem, 3vw, 2rem);
}
h4 {
  font-size: 1.25rem;
}
h5 {
  font-size: 1.125rem;
}
h6 {
  font-size: 1rem;
}

p {
  margin-bottom: 1rem;
  line-height: 1.7;
}

p:last-child {
  margin-bottom: 0;
}

strong {
  font-weight: 700;
}

/* ================================
   LAYOUT
   ================================ */
.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 var(--container-padding);
  width: 100%;
}

.section {
  padding: 4rem 0;
}

.section-header {
  max-width: 50rem;
  margin: 0 auto 5rem;
  text-align: center;
}

.section-title {
  font-size: clamp(2rem, 4vw, 3rem);
  margin: 2rem 0 1.25rem 0;
}

.section-description {
  font-size: 1.125rem;
  color: var(--slate-500);
  line-height: 1.7;
}

/* ================================
   UTILITIES
   ================================ */
.hidden {
  display: none !important;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Scroll reveal animations */
.scroll-reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity var(--transition-slow), transform var(--transition-slow);
}

.scroll-reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Animaciones base */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInUp {
  from {
    transform: translateY(100px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.animate-fadeInUp {
  animation: fadeInUp var(--transition-slow) ease forwards;
}

.animate-pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Delays para animaciones en cadena */
.delay-1 {
  animation-delay: 0.1s;
  opacity: 0;
}
.delay-2 {
  animation-delay: 0.2s;
  opacity: 0;
}
.delay-3 {
  animation-delay: 0.3s;
  opacity: 0;
}
.delay-4 {
  animation-delay: 0.4s;
  opacity: 0;
}

/* ================================
   RESPONSIVE BREAKPOINTS
   ================================ */
@media (max-width: 1024px) {
  :root {
    --container-padding: 1.5rem;
  }
}

@media (max-width: 768px) {
  :root {
    --container-padding: 1.25rem;
  }

  .section {
    padding: 5rem 0;
  }

  .section-header {
    margin-bottom: 3rem;
  }
}

@media (max-width: 480px) {
  :root {
    --container-padding: 1rem;
  }

  .section {
    padding: 4rem 0;
  }
}

/* Asegurar que las animaciones se ejecuten */
.animate-fadeInUp.delay-1,
.animate-fadeInUp.delay-2,
.animate-fadeInUp.delay-3,
.animate-fadeInUp.delay-4 {
  animation: fadeInUp 0.6s ease forwards;
}

/* Hacer visible el contenido mientras cargan las animaciones */
.hero__left,
.hero__photo,
.hero__bottom {
  opacity: 1;
}
