/* Modern Data Engineer Portfolio Stylesheet for Marta Espinosa */
@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;500;600&family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
  --bg-dark: #090d16;
  --bg-card: rgba(15, 23, 42, 0.65);
  --bg-card-hover: rgba(23, 32, 54, 0.85);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(6, 182, 212, 0.4);
  
  --cyan: #06b6d4;
  --cyan-glow: rgba(6, 182, 212, 0.25);
  --blue: #3b82f6;
  --purple: #8b5cf6;
  --emerald: #10b981;
  --amber: #f59e0b;
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  --font-head: 'Outfit', -apple-system, sans-serif;
  --font-body: 'Inter', -apple-system, sans-serif;
  --font-mono: 'Fira Code', monospace;

  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
  color-scheme: dark;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-body);
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
}

/* Canvas Background */
#bg-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  pointer-events: none;
  opacity: 0.4;
}

/* Typography Defaults */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-head);
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

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

a:hover {
  color: #38bdf8;
}

/* Container */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Glassmorphic Panel */
.glass-panel {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
  transition: transform var(--transition-normal), border-color var(--transition-normal), box-shadow var(--transition-normal);
}

.glass-panel:hover {
  border-color: rgba(6, 182, 212, 0.3);
  box-shadow: 0 15px 35px -10px rgba(6, 182, 212, 0.15);
}

/* Gradient Text */
.gradient-text {
  background: linear-gradient(135deg, #38bdf8 0%, #818cf8 50%, #c084fc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.gradient-text-alt {
  background: linear-gradient(135deg, #34d399 0%, #38bdf8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Navbar */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  padding: 18px 0;
  transition: all var(--transition-normal);
}

.navbar.scrolled {
  padding: 12px 0;
  background: rgba(9, 13, 22, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
}

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

.brand-logo {
  font-family: var(--font-head);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-logo .dot {
  color: var(--cyan);
}

.brand-badge {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 20px;
  background: rgba(6, 182, 212, 0.1);
  color: var(--cyan);
  border: 1px solid rgba(6, 182, 212, 0.2);
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 32px;
  align-items: center;
}

.nav-link {
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: all var(--transition-fast);
  position: relative;
}

.nav-link:hover, .nav-link.active {
  color: var(--text-main);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 0;
  width: 0%;
  height: 2px;
  background: var(--cyan);
  transition: width var(--transition-fast);
  border-radius: 2px;
}

.nav-link:hover::after, .nav-link.active::after {
  width: 100%;
}

.nav-actions {
  display: flex;
  gap: 16px;
  align-items: center;
}

.mobile-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-main);
  font-size: 1.5rem;
  cursor: pointer;
}

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

.btn-primary {
  background: linear-gradient(135deg, var(--cyan) 0%, #2563eb 100%);
  color: #fff;
  box-shadow: 0 4px 14px 0 rgba(6, 182, 212, 0.35);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px 0 rgba(6, 182, 212, 0.5);
  color: #fff;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--text-main);
  transform: translateY(-2px);
}

.btn-emerald {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #fff;
  box-shadow: 0 4px 14px 0 rgba(16, 185, 129, 0.35);
}

.btn-emerald:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px 0 rgba(16, 185, 129, 0.5);
  color: #fff;
}

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

/* Hero Section */
.hero-section {
  padding: 160px 0 100px;
  position: relative;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 60px;
  align-items: center;
}

.hero-avatar-wrapper {
  position: relative;
  display: flex;
  justify-content: center;
}

.hero-avatar-glow {
  position: absolute;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--cyan), var(--purple));
  filter: blur(50px);
  opacity: 0.35;
  animation: pulse-glow 6s infinite alternate;
}

@keyframes pulse-glow {
  0% { transform: scale(0.9); opacity: 0.25; }
  100% { transform: scale(1.1); opacity: 0.45; }
}

.hero-img {
  width: 280px;
  height: 280px;
  object-fit: cover;
  border-radius: 50%;
  border: 3px solid rgba(6, 182, 212, 0.5);
  position: relative;
  z-index: 2;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.hero-status-pill {
  position: absolute;
  bottom: 10px;
  z-index: 3;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid var(--border-glow);
  padding: 6px 16px;
  border-radius: 30px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--emerald);
  display: flex;
  align-items: center;
  gap: 8px;
  backdrop-filter: blur(8px);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 10px var(--emerald);
  animation: blink 2s infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.hero-content .subtitle {
  font-family: var(--font-mono);
  color: var(--cyan);
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 12px;
  display: block;
}

.hero-content h1 {
  font-size: 3.5rem;
  line-height: 1.1;
  margin-bottom: 16px;
}

.typewriter-text {
  border-right: 2px solid var(--cyan);
  animation: caret 0.8s infinite;
}

@keyframes caret {
  50% { border-color: transparent; }
}

.hero-description {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-bottom: 32px;
  max-width: 600px;
}

.hero-actions {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.hero-actions-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: center;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 40px;
  padding-top: 30px;
  border-top: 1px solid var(--border-color);
}

.stat-item h3 {
  font-size: 2rem;
  color: var(--text-main);
  font-family: var(--font-mono);
}

.stat-item p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Section Header */
.section-header {
  text-align: center;
  max-width: 700px;
  margin: 0 auto 60px;
}

.section-tag {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--cyan);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 8px;
  display: inline-block;
}

.section-title {
  font-size: 2.5rem;
  margin-bottom: 16px;
}

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

/* Skills & Architecture Section */
.skills-section {
  padding: 100px 0;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.skill-card {
  padding: 30px;
}

.skill-icon {
  width: 54px;
  height: 54px;
  border-radius: 12px;
  background: rgba(6, 182, 212, 0.1);
  color: var(--cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 20px;
  border: 1px solid rgba(6, 182, 212, 0.2);
}

.skill-card h3 {
  font-size: 1.25rem;
  margin-bottom: 12px;
}

.skill-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 20px;
}

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

.tag {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
  transition: all var(--transition-fast);
}

.tag:hover {
  background: rgba(6, 182, 212, 0.15);
  color: var(--cyan);
  border-color: rgba(6, 182, 212, 0.3);
}

/* Architecture Pipeline Interactive Section */
.pipeline-section {
  padding: 60px 0 100px;
}

.pipeline-card {
  padding: 40px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(6, 182, 212, 0.2);
}

.pipeline-flow {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  position: relative;
  margin-top: 30px;
}

@media (max-width: 900px) {
  .pipeline-flow {
    grid-template-columns: 1fr;
  }
}

.pipeline-step {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 24px;
  text-align: center;
  position: relative;
  transition: all var(--transition-normal);
}

.pipeline-step:hover {
  background: rgba(6, 182, 212, 0.08);
  border-color: var(--cyan);
  transform: translateY(-4px);
}

.step-num {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--cyan);
  background: rgba(6, 182, 212, 0.15);
  padding: 2px 8px;
  border-radius: 4px;
  display: inline-block;
  margin-bottom: 12px;
}

.pipeline-step h4 {
  font-size: 1.1rem;
  margin-bottom: 8px;
}

.pipeline-step p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Portfolio Section */
.portfolio-section {
  padding: 100px 0;
}

.portfolio-filter {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.filter-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 8px 18px;
  border-radius: 20px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.filter-btn:hover, .filter-btn.active {
  background: rgba(6, 182, 212, 0.15);
  color: var(--cyan);
  border-color: rgba(6, 182, 212, 0.4);
}

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 30px;
}

.portfolio-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  border-radius: 16px;
}

.portfolio-img-wrapper {
  position: relative;
  width: 100%;
  height: 220px;
  overflow: hidden;
}

.portfolio-img-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.portfolio-card:hover .portfolio-img-wrapper img {
  transform: scale(1.06);
}

.portfolio-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(9, 13, 22, 0.95), transparent 70%);
  display: flex;
  align-items: flex-end;
  padding: 20px;
  opacity: 0.9;
}

.portfolio-content {
  padding: 24px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.portfolio-category {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--cyan);
  margin-bottom: 8px;
  text-transform: uppercase;
}

.portfolio-title {
  font-size: 1.35rem;
  margin-bottom: 12px;
  line-height: 1.3;
}

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

.portfolio-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 20px;
}

.portfolio-footer {
  display: flex;
  gap: 12px;
  align-items: center;
}

/* Contact Section */
.contact-section {
  padding: 100px 0 140px;
}

.contact-card {
  padding: 50px;
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 50px;
}

@media (max-width: 900px) {
  .contact-card {
    grid-template-columns: 1fr;
    padding: 30px;
  }
}

.contact-info h3 {
  font-size: 1.8rem;
  margin-bottom: 16px;
}

.contact-info p {
  color: var(--text-muted);
  margin-bottom: 30px;
}

.contact-method {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.contact-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: rgba(6, 182, 212, 0.1);
  color: var(--cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.contact-details span {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.contact-details a, .contact-details strong {
  font-size: 1rem;
  color: var(--text-main);
  font-weight: 600;
}

.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.form-input, .form-textarea {
  width: 100%;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 0.95rem;
  transition: all var(--transition-fast);
}

.form-input:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.15);
  background: rgba(255, 255, 255, 0.06);
}

.form-textarea {
  resize: vertical;
  min-height: 120px;
}

/* Footer */
footer {
  border-top: 1px solid var(--border-color);
  padding: 40px 0;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.9rem;
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.social-links {
  display: flex;
  gap: 16px;
}

.social-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.social-icon:hover {
  background: rgba(6, 182, 212, 0.2);
  color: var(--cyan);
  transform: translateY(-3px);
}

/* Responsive Rules */
@media (max-width: 992px) {
  .hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero-avatar-wrapper {
    margin-bottom: 20px;
  }

  .hero-description {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-stats {
    justify-content: center;
  }

  .nav-links {
    display: none;
  }

  .nav-links.mobile-open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: rgba(9, 13, 22, 0.98);
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
  }

  .mobile-toggle {
    display: block;
  }
}

@media (max-width: 576px) {
  .hero-content h1 {
    font-size: 2.5rem;
  }

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