* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg-dark: #0a0a0f;
  --bg-card: #16161f;
  --bg-secondary: #1f1f2e;
  --text-primary: #f5f5f7;
  --text-muted: #a1a1aa;
  --color-primary: #00d4ff;
  --color-accent: #d946ef;
  --border-color: #2a2a3e;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Fondo animado con c¨Ždigo Python */
.code-background {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  opacity: 0.3;
  z-index: 0;
}

.code-snippet {
  position: absolute;
  font-family: "Courier New", monospace;
  white-space: pre;
}

.code-1 {
  top: 10%;
  left: 10%;
  color: var(--color-primary);
  font-size: 14px;
  animation: float-code 10s ease-in-out infinite;
}

.code-2 {
  top: 20%;
  right: 10%;
  color: var(--color-accent);
  font-size: 12px;
  animation: float-code-slow 15s ease-in-out infinite;
}

.code-3 {
  bottom: 40%;
  left: 25%;
  color: var(--color-primary);
  font-size: 14px;
  animation: float-code-fast 7s ease-in-out infinite;
}

.code-4 {
  top: 50%;
  right: 10%;
  color: var(--color-accent);
  font-size: 12px;
  animation: float-code-slow 15s ease-in-out infinite 2s;
}

.code-5 {
  bottom: 20%;
  right: 33%;
  color: var(--color-primary);
  font-size: 14px;
  animation: float-code 10s ease-in-out infinite 3s;
}

.code-6 {
  top: 25%;
  left: 33%;
  color: var(--color-accent);
  font-size: 12px;
  animation: float-code-fast 7s ease-in-out infinite 1s;
}

.code-7 {
  bottom: 33%;
  left: 10%;
  color: var(--color-primary);
  font-size: 14px;
  animation: float-code-slow 15s ease-in-out infinite 4s;
}

.code-8 {
  top: 66%;
  right: 25%;
  color: var(--color-accent);
  font-size: 12px;
  animation: float-code 10s ease-in-out infinite 2s;
}

@keyframes float-code {
  0%,
  100% {
    transform: translateY(0) translateX(0);
    opacity: 0.4;
  }
  50% {
    transform: translateY(-25px) translateX(15px);
    opacity: 0.7;
  }
}

@keyframes float-code-slow {
  0%,
  100% {
    transform: translateY(0) translateX(0) rotate(0deg);
    opacity: 0.3;
  }
  50% {
    transform: translateY(-35px) translateX(-20px) rotate(2deg);
    opacity: 0.6;
  }
}

@keyframes float-code-fast {
  0%,
  100% {
    transform: translateY(0) translateX(0);
    opacity: 0.5;
  }
  50% {
    transform: translateY(-15px) translateX(10px);
    opacity: 0.8;
  }
}

/* Hero Section */
.hero-section {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  z-index: 1;
}

.hero-content {
  text-align: center;
  margin-bottom: 60px;
}

.hero-title {
  font-size: clamp(2.5rem, 7vw, 5rem);
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 24px;
}

.highlight {
  color: var(--color-primary);
}

.hero-subtitle {
  font-size: clamp(1.125rem, 2vw, 1.5rem);
  color: var(--text-muted);
  max-width: 800px;
  margin: 0 auto 48px;
}

/* Formulario de Contacto */
.contact-card {
  max-width: 700px;
  margin: 0 auto;
  background: rgba(22, 22, 31, 0.8);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 48px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.form-group {
  margin-bottom: 24px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--text-primary);
}

.form-group input {
  width: 100%;
  padding: 14px 16px;
  background: rgba(31, 31, 46, 0.5);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 16px;
  transition: all 0.3s ease;
}

.form-group input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1);
}

.form-group input::placeholder {
  color: var(--text-muted);
}

.submit-btn {
  width: 100%;
  padding: 18px 32px;
  background: var(--color-primary);
  color: var(--bg-dark);
  border: none;
  border-radius: 8px;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 20px rgba(0, 212, 255, 0.3);
}

.submit-btn:hover {
  background: #00b8e6;
  box-shadow: 0 6px 30px rgba(0, 212, 255, 0.5);
  transform: translateY(-2px);
}

.submit-btn:active {
  transform: translateY(0);
}

.submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Portfolio Section */
.portfolio-section {
  position: relative;
  padding: 80px 20px;
  z-index: 1;
}

.section-title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  text-align: center;
  margin-bottom: 16px;
}

.section-subtitle {
  text-align: center;
  color: var(--text-muted);
  font-size: 1.125rem;
  margin-bottom: 60px;
}

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.portfolio-item {
  background: rgba(22, 22, 31, 0.8);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s ease;
  cursor: pointer;
}

.portfolio-item:hover {
  border-color: var(--color-primary);
  box-shadow: 0 10px 40px rgba(0, 212, 255, 0.2);
  transform: translateY(-4px);
}

.portfolio-image {
  aspect-ratio: 4 / 3;
  overflow: hidden;
}

.portfolio-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.portfolio-item:hover .portfolio-image img {
  transform: scale(1.1);
}

.portfolio-content {
  padding: 24px;
}

.portfolio-content h3 {
  font-size: 1.25rem;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.portfolio-content p {
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* Footer */
.footer {
  position: relative;
  padding: 48px 20px;
  border-top: 1px solid var(--border-color);
  text-align: center;
  z-index: 1;
}

.footer p {
  color: var(--text-muted);
}

/* Toast Notification */
.toast {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: var(--bg-card);
  border: 1px solid var(--color-primary);
  border-radius: 12px;
  padding: 20px 24px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  transform: translateX(400px);
  transition: transform 0.3s ease;
  z-index: 1000;
  max-width: 350px;
}

.toast.show {
  transform: translateX(0);
}

.toast-content strong {
  display: block;
  color: var(--color-primary);
  margin-bottom: 4px;
  font-size: 1.125rem;
}

.toast-content p {
  color: var(--text-muted);
  margin: 0;
  margin-bottom: 12px;
}

.whatsapp-button-container {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
}

.whatsapp-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 20px;
  background: #25d366;
  color: white;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
}

.whatsapp-btn:hover {
  background: #20ba5a;
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.5);
  transform: translateY(-2px);
}

.whatsapp-btn svg {
  flex-shrink: 0;
}

/* Responsive */
@media (max-width: 768px) {
  .contact-card {
    padding: 32px 24px;
  }

  .portfolio-grid {
    grid-template-columns: 1fr;
  }

  .toast {
    right: 20px;
    left: 20px;
    max-width: none;
  }
}
