/* ==========================================================================
   LM² - Estilo Moderno y Sobrio
   ========================================================================== */

:root {
  /* Paleta Sobria: Dark Graphite, Slate & Electric Cyan accents */
  --bg-main: #0c0e12;
  --bg-card: #13171f;
  --bg-card-hover: #181d27;
  --bg-surface: #1b202c;
  
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-medium: rgba(255, 255, 255, 0.16);
  --border-focus: #3b82f6;

  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --text-faint: #6b7280;

  /* Acentos de sobriedad */
  --accent-primary: #3b82f6;     /* Azul tecnológico */
  --accent-primary-hover: #2563eb;
  --accent-glow: rgba(59, 130, 246, 0.15);
  
  --accent-cyan: #06b6d4;
  --accent-amber: #f59e0b;
  --accent-emerald: #10b981;

  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;

  --transition-fast: 0.18s ease;
  --transition-normal: 0.28s ease;
  --container-max: 1140px;
}

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

html {
  scroll-behavior: smooth;
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--text-main);
  -webkit-font-smoothing: antialiased;
}

body {
  line-height: 1.6;
  position: relative;
  overflow-x: hidden;
  min-height: 100vh;
}

/* Ambient glow & backdrop decor */
.ambient-glow {
  position: absolute;
  pointer-events: none;
  border-radius: 50%;
  filter: blur(120px);
  z-index: -1;
  opacity: 0.45;
}

.glow-top {
  top: -150px;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 400px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.3) 0%, rgba(6, 182, 212, 0.1) 60%, transparent 80%);
}

.glow-bottom {
  top: 1400px;
  right: -100px;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.15) 0%, transparent 70%);
}

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

/* Typography Helpers */
h1, h2, h3, h4 {
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.02em;
}

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

.text-gradient {
  background: linear-gradient(135deg, #ffffff 30%, #93c5fd 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.exponent {
  font-size: 0.65em;
  vertical-align: super;
  color: var(--accent-cyan);
}

/* Badges & Tags */
.section-tag {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-cyan);
  margin-bottom: 12px;
}

.tag {
  display: inline-flex;
  align-items: center;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.tag-blue {
  background: rgba(59, 130, 246, 0.12);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.tag-amber {
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.tag-emerald {
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  border: 1px solid transparent;
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
}

.btn-primary {
  background-color: var(--accent-primary);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
  background-color: var(--accent-primary-hover);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.45);
  transform: translateY(-1px);
}

.btn-outline {
  border-color: var(--border-medium);
  color: var(--text-main);
  background: transparent;
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: #ffffff;
}

.btn-ghost {
  color: var(--text-muted);
  background: transparent;
}

.btn-ghost:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.05);
}

.btn-block {
  width: 100%;
}

/* Navbar */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: rgba(12, 14, 18, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-subtle);
  transition: padding var(--transition-normal);
}

.nav-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  font-weight: 800;
  font-size: 1.45rem;
  color: #ffffff;
}

.logo-img {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
  transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.brand-logo:hover .logo-img {
  transform: scale(1.05);
  border-color: var(--accent-primary);
}

.logo-symbol {
  letter-spacing: -0.04em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  transition: color var(--transition-fast);
}

.nav-link:hover {
  color: #ffffff;
}

.mobile-toggle {
  display: none;
  background: transparent;
  border: none;
  cursor: pointer;
  flex-direction: column;
  gap: 6px;
}

.mobile-toggle span {
  width: 24px;
  height: 2px;
  background: #ffffff;
  transition: transform var(--transition-fast);
}

/* Hero Section */
.hero-section {
  padding: 120px 0 90px;
  text-align: center;
  position: relative;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--accent-cyan);
  box-shadow: 0 0 10px var(--accent-cyan);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.9); }
}

.hero-title {
  font-size: clamp(2.4rem, 5vw, 4.2rem);
  line-height: 1.15;
  margin-bottom: 24px;
}

.hero-description {
  max-width: 680px;
  margin: 0 auto 36px;
  font-size: 1.15rem;
  color: var(--text-muted);
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 64px;
}

.hero-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 36px;
  padding-top: 36px;
  border-top: 1px solid var(--border-subtle);
  max-width: 760px;
  margin: 0 auto;
}

.stat-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-num {
  font-size: 1.6rem;
  font-weight: 800;
  color: #ffffff;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-divider {
  width: 1px;
  height: 38px;
  background: var(--border-subtle);
}

/* Sections Common */
.section {
  padding: 100px 0;
}

.section-header {
  margin-bottom: 60px;
}

.section-header.text-center {
  text-align: center;
  max-width: 680px;
  margin-left: auto;
  margin-right: auto;
}

.section-title {
  font-size: 2.3rem;
  margin-bottom: 14px;
}

.section-subtitle {
  font-size: 1.08rem;
  color: var(--text-muted);
}

/* Projects Section */
.projects-list {
  display: flex;
  flex-direction: column;
  gap: 60px;
}

.project-card {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 40px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 44px;
  position: relative;
  overflow: hidden;
  transition: border-color var(--transition-normal), transform var(--transition-normal);
}

.project-card:hover {
  border-color: var(--border-medium);
  transform: translateY(-2px);
}

.project-card.reverse {
  grid-template-columns: 1fr 1.1fr;
}

.project-card.reverse .project-info {
  order: 2;
}

.project-card.reverse .project-media-wrap {
  order: 1;
}

.project-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.project-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.project-client {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.project-title {
  font-size: 1.75rem;
  line-height: 1.25;
  margin-bottom: 14px;
}

.project-desc {
  font-size: 1rem;
  margin-bottom: 20px;
  color: var(--text-muted);
}

.project-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 26px;
}

.project-features li {
  position: relative;
  padding-left: 20px;
  font-size: 0.94rem;
  color: #d1d5db;
}

.project-features li::before {
  content: "→";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--accent-cyan);
  font-family: var(--font-mono);
}

.project-features strong {
  color: #ffffff;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.project-tags span {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
}

/* Media Wrap & Skeleton Placeholder */
.project-media-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
}

.media-container {
  width: 100%;
  aspect-ratio: 16 / 11;
  background: #0f1319;
  border: 1px dashed rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color var(--transition-fast);
}

.media-container:hover {
  border-color: rgba(59, 130, 246, 0.4);
}

/* Cuando tenga video o imagen real */
.media-container:has(video),
.media-container:has(img) {
  border-style: solid;
  border-color: var(--border-subtle);
  background: #000000;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.4);
}

.media-container img,
.media-container video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background-color: #000000;
}

/* Phone Mockup Frame (Vertical Smartphone) */
.phone-mockup {
  position: relative;
  width: 310px;
  max-width: 100%;
  aspect-ratio: 9 / 16;
  background: #0d1117;
  border-radius: 40px;
  padding: 10px;
  border: 3px solid #232936;
  box-shadow: 
    0 0 0 1px rgba(255, 255, 255, 0.08),
    0 25px 50px -12px rgba(0, 0, 0, 0.7),
    0 0 40px rgba(59, 130, 246, 0.12);
  display: flex;
  flex-direction: column;
  margin: 0 auto;
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.phone-mockup:hover {
  transform: translateY(-4px);
  box-shadow: 
    0 0 0 1px rgba(59, 130, 246, 0.3),
    0 30px 60px -12px rgba(0, 0, 0, 0.85),
    0 0 50px rgba(59, 130, 246, 0.22);
}

/* Dynamic island / speaker */
.phone-speaker {
  position: absolute;
  top: 15px;
  left: 50%;
  transform: translateX(-50%);
  width: 70px;
  height: 14px;
  background: #050608;
  border-radius: 10px;
  z-index: 10;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.phone-screen {
  width: 100%;
  height: 100%;
  border-radius: 30px;
  overflow: hidden;
  background: #000000;
  position: relative;
  display: flex;
}

.phone-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background-color: #000000;
}

/* Phone Carousel */
.phone-carousel {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000000;
}

.carousel-track {
  position: relative;
  width: 100%;
  height: 100%;
}

.carousel-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transform: scale(0.97);
  transition: opacity 0.6s ease, transform 0.6s ease;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #0b0e14;
}

.carousel-slide.active {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

.carousel-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: #0b0e14;
}

.carousel-dots {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 12;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(8px);
  padding: 5px 10px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.dot-indicator {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  transition: all 0.3s ease;
  cursor: pointer;
}

.dot-indicator.active {
  width: 18px;
  border-radius: 4px;
  background: var(--accent-cyan);
  box-shadow: 0 0 8px var(--accent-cyan);
}

.media-placeholder {
  text-align: center;
  padding: 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.placeholder-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-cyan);
  margin-bottom: 4px;
}

.placeholder-badge {
  font-size: 0.7rem;
  font-family: var(--font-mono);
  text-transform: uppercase;
  background: rgba(59, 130, 246, 0.1);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.25);
  padding: 3px 8px;
  border-radius: 4px;
}

.placeholder-text {
  font-size: 0.95rem;
  font-weight: 600;
  color: #ffffff;
  max-width: 240px;
}

.placeholder-hint {
  font-size: 0.78rem;
  color: var(--text-faint);
}

/* Services / Capacidades */
.services-section {
  background: linear-gradient(180deg, transparent 0%, rgba(255,255,255,0.015) 50%, transparent 100%);
}

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

.service-box {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 32px;
  transition: transform var(--transition-normal), border-color var(--transition-normal);
}

.service-box:hover {
  transform: translateY(-4px);
  border-color: var(--border-medium);
}

.service-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-cyan);
  margin-bottom: 20px;
}

.service-box h3 {
  font-size: 1.25rem;
  margin-bottom: 12px;
}

.service-box p {
  font-size: 0.94rem;
  line-height: 1.6;
}

/* About / Equipo */
.about-card {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 40px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 48px;
  align-items: center;
}

.about-title {
  font-size: 2.1rem;
  margin-bottom: 18px;
}

.about-content p {
  margin-bottom: 16px;
  font-size: 1.02rem;
}

.about-highlights {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.highlight-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.95rem;
  color: #e5e7eb;
}

.check-icon {
  color: var(--accent-emerald);
  font-weight: 800;
}

/* Code Terminal Mockup */
.code-terminal {
  background: #090c10;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
  overflow: hidden;
}

.terminal-bar {
  background: #161b22;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--border-subtle);
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.dot.red { background: #ff5f56; }
.dot.yellow { background: #ffbd2e; }
.dot.green { background: #27c93f; }

.terminal-title {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-left: auto;
}

.code-terminal pre {
  padding: 22px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.7;
  overflow-x: auto;
}

.kwd { color: #ff7b72; }
.var { color: #79c0ff; }
.prop { color: #d2a8ff; }
.str { color: #a5d6ff; }
.bool { color: #79c0ff; }

/* Contact Section */
.contact-box {
  background: linear-gradient(180deg, var(--bg-card) 0%, #11151d 100%);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 60px 40px;
  max-width: 760px;
  margin: 0 auto;
  text-align: center;
}

.contact-title {
  font-size: 2.2rem;
  margin-bottom: 14px;
}

.contact-subtitle {
  max-width: 540px;
  margin: 0 auto 36px;
  font-size: 1.05rem;
}

.contact-form {
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #e5e7eb;
}

.form-group input,
.form-group select,
.form-group textarea {
  background: #090c10;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  color: #ffffff;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.form-feedback {
  padding: 14px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  text-align: center;
}

.form-feedback.success {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34d399;
}

.direct-contact {
  margin-top: 36px;
  font-size: 0.9rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.direct-email {
  color: #ffffff;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--accent-primary);
  text-underline-offset: 4px;
}

/* Footer */
.footer {
  border-top: 1px solid var(--border-subtle);
  padding: 40px 0;
  background: #090b0f;
}

.footer-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-left {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.footer-logo-img {
  width: 26px;
  height: 26px;
  border-radius: 4px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-logo {
  font-weight: 800;
  font-size: 1.25rem;
  color: #ffffff;
}

.footer-copy {
  font-size: 0.85rem;
  color: var(--text-faint);
  margin-top: 4px;
}

.footer-right {
  display: flex;
  gap: 24px;
}

.footer-right a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.88rem;
  transition: color var(--transition-fast);
}

.footer-right a:hover {
  color: #ffffff;
}

/* Responsive */
@media (max-width: 900px) {
  .project-card,
  .project-card.reverse {
    grid-template-columns: 1fr;
    padding: 30px;
  }

  .project-card.reverse .project-info {
    order: 1;
  }
  .project-card.reverse .project-media-wrap {
    order: 2;
  }

  .services-grid {
    grid-template-columns: 1fr;
  }

  .about-card {
    grid-template-columns: 1fr;
    padding: 30px;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    background: #0f131a;
    border-bottom: 1px solid var(--border-subtle);
    flex-direction: column;
    padding: 24px;
    gap: 16px;
  }

  .nav-links.active {
    display: flex;
  }

  .mobile-toggle {
    display: flex;
  }

  .hero-stats {
    flex-direction: column;
    gap: 20px;
  }

  .stat-divider {
    display: none;
  }

  .footer-content {
    flex-direction: column;
    gap: 20px;
    text-align: center;
  }
}
