/* ==========================================================================
   G&D - Electrical & Telecommunications Engineering
   Design System & Main Stylesheet (V3 - Ultra-Clean & Luxury Tech Aesthetic)
   ========================================================================== */

:root {
  /* Color Palette - Deep Pitch Charcoal & Energetic Spark Orange */
  --bg-darkest: #030406;
  --bg-main: #07090d;
  --bg-surface: #0c1017;
  --bg-surface-elevated: #111722;
  --bg-card: rgba(14, 19, 28, 0.6);
  
  --accent-orange: #ff6b00;
  --accent-orange-hover: #ff8522;
  --accent-orange-bright: #ffa347;
  --accent-orange-glow: rgba(255, 107, 0, 0.45);
  --accent-orange-subtle: rgba(255, 107, 0, 0.1);
  --accent-orange-border: rgba(255, 107, 0, 0.28);

  --accent-cyan: #00d2ff;
  --accent-cyan-subtle: rgba(0, 210, 255, 0.1);
  --accent-cyan-border: rgba(0, 210, 255, 0.28);
  
  --text-primary: #ffffff;
  --text-secondary: #94a3b8;
  /* #7f8ea3: text-muted aclarado para cumplir WCAG AA (>=4.5:1) sobre todos
     los fondos oscuros del theme (antes #64748b daba 3.8-4.3). */
  --text-muted: #7f8ea3;
  --text-inverse: #030406;
  
  /* Refined Glassmorphism */
  --glass-bg: rgba(12, 16, 24, 0.55);
  --glass-bg-hover: rgba(18, 24, 36, 0.75);
  --glass-border: rgba(255, 255, 255, 0.07);
  --glass-border-hover: rgba(255, 107, 0, 0.35);
  --glass-blur: blur(16px);
  --glass-shadow: 0 12px 30px -10px rgba(0, 0, 0, 0.6);
  
  /* Typography */
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Space Grotesk', var(--font-sans);
  
  /* Transitions */
  --transition-fast: 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.55s cubic-bezier(0.16, 1, 0.3, 1);
  
  /* Spacing & Layout */
  --container-max: 1280px;
  --header-height: 76px;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
}

/* Reset & Box Sizing */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Guard against accidental horizontal overflow: los medios nunca superan el ancho del contenedor. */
img, svg, video, canvas {
  max-width: 100%;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  background-color: var(--bg-darkest);
  color: var(--text-primary);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
  overflow-x: hidden;
  background-color: var(--bg-main);
  background-image: 
    radial-gradient(circle at 50% 0%, rgba(255, 107, 0, 0.05) 0%, transparent 50%),
    radial-gradient(circle at 10% 35%, rgba(0, 210, 255, 0.025) 0%, transparent 45%),
    radial-gradient(circle at 90% 70%, rgba(255, 107, 0, 0.035) 0%, transparent 45%);
  background-attachment: fixed;
  line-height: 1.6;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-darkest);
}

::-webkit-scrollbar-thumb {
  background: #18202c;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-orange);
}

/* Typography Utilities */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

p {
  color: var(--text-secondary);
}

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

/* Container */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: 24px;
  padding-right: 24px;
}

/* Section Common Styling */
.section {
  padding: 95px 0;
  position: relative;
  z-index: 2;
}

.section-header {
  text-align: center;
  max-width: 760px;
  margin: 0 auto 55px auto;
}

.section-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-radius: var(--radius-full);
  background: var(--accent-orange-subtle);
  border: 1px solid var(--accent-orange-border);
  color: var(--accent-orange-bright);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 16px;
}

.section-badge.cyan {
  background: var(--accent-cyan-subtle);
  border-color: var(--accent-cyan-border);
  color: var(--accent-cyan);
}

.section-title {
  font-size: clamp(2rem, 3.4vw, 2.8rem);
  margin-bottom: 16px;
  background: linear-gradient(180deg, #ffffff 40%, #94a3b8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.18;
}

.section-subtitle {
  font-size: clamp(0.98rem, 1.2vw, 1.12rem);
  color: var(--text-secondary);
  line-height: 1.65;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 26px;
  /* Tap target mínimo 44px (WCAG 2.5.8 / UX móvil). */
  min-height: 44px;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 0.92rem;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all var(--transition-normal);
  text-align: center;
  position: relative;
  overflow: hidden;
  user-select: none;
}

.btn-primary {
  /* Naranja de marca oscurecido para que el texto blanco cumpla WCAG AA (>=4.5:1).
     Endpoints #cf4a00 (4.53) y #b53f00 (5.71) vs el #ff7a18/#ff5200 original (2.6-3.3). */
  background: linear-gradient(135deg, #cf4a00 0%, #b53f00 100%);
  color: #ffffff;
  box-shadow: 0 4px 20px var(--accent-orange-glow), inset 0 1px 1px rgba(255, 255, 255, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(255, 107, 0, 0.65), inset 0 1px 1px rgba(255, 255, 255, 0.6);
  background: linear-gradient(135deg, #d14a00 0%, #b53f00 100%);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
  color: #ffffff;
}

.btn-outline-orange {
  background: transparent;
  color: var(--accent-orange-bright);
  border: 1px solid var(--accent-orange-border);
}

.btn-outline-orange:hover {
  background: var(--accent-orange-subtle);
  border-color: var(--accent-orange);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 0 15px rgba(255, 107, 0, 0.25);
}

.btn-sm {
  padding: 9px 18px;
  font-size: 0.84rem;
}

.btn-lg {
  padding: 16px 34px;
  font-size: 1.02rem;
  border-radius: var(--radius-md);
}

/* Glass Card */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--glass-shadow);
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.glass-card:hover {
  border-color: var(--glass-border-hover);
  background: var(--glass-bg-hover);
  transform: translateY(-4px);
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.7), 0 0 25px rgba(255, 107, 0, 0.1);
}

/* Spotlight Card Effect */
.spotlight-card {
  position: relative;
}

.spotlight-card::before {
  content: '';
  position: absolute;
  top: var(--mouse-y, -100px);
  left: var(--mouse-x, -100px);
  width: 260px;
  height: 260px;
  background: radial-gradient(circle, rgba(255, 107, 0, 0.15) 0%, transparent 70%);
  transform: translate(-50%, -50%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
  z-index: 1;
}

.spotlight-card:hover::before {
  opacity: 1;
}

/* Grid Utilities */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
}

@media (max-width: 1024px) {
  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 720px) {
  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr;
  }
  .section {
    padding: 70px 0;
  }
}

/* Pulse Dot */
.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  position: relative;
}

.pulse-dot::after {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  border-radius: 50%;
  background: #10b981;
  animation: pulse-ring 2s cubic-bezier(0.45, 0, 0.55, 1) infinite;
}

.pulse-dot.orange {
  background: var(--accent-orange);
}
.pulse-dot.orange::after {
  background: var(--accent-orange);
}

@keyframes pulse-ring {
  0% { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(2.8); opacity: 0; }
}

button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent-orange);
  outline-offset: 2px;
}
