/* ============================================
   PLASMA LABS — "Lab Noir" Theme
   Modern Biotech Hybrid aesthetic
   ============================================ */

/* --- Custom Properties --- */
:root {
  /* Base */
  --bg-primary: #0b0f1a;
  --bg-secondary: #111827;
  --bg-card: #151d2e;
  --bg-card-hover: #1a2540;
  --bg-elevated: #1e293b;

  /* Accents */
  --accent-magenta: #e94560;
  --accent-purple: #7c3aed;
  --accent-teal: #2dd4bf;
  --gradient-brand: linear-gradient(135deg, #e94560, #7c3aed);

  /* Text */
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-accent: #e94560;

  /* Borders */
  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-accent: rgba(233, 69, 96, 0.3);

  /* Spacing */
  --section-gap: 6rem;
  --container-max: 1140px;
  --nav-height: 72px;

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --transition-base: 0.3s var(--ease-out);
}

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

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

body {
  font-family: 'Source Sans 3', sans-serif;
  background: var(--bg-primary);
  color: var(--text-secondary);
  line-height: 1.7;
  font-size: 16px;
  overflow-x: hidden;
}

::selection {
  background: var(--accent-magenta);
  color: white;
}

a {
  color: var(--accent-magenta);
  text-decoration: none;
  transition: color var(--transition-base);
}
a:hover {
  color: var(--accent-purple);
}

img {
  max-width: 100%;
  display: block;
}

/* --- Typography --- */
h1, h2, h3, h4, h5 {
  font-family: 'Instrument Sans', sans-serif;
  color: var(--text-primary);
  font-weight: 700;
  line-height: 1.2;
}
h1 { font-size: clamp(2.2rem, 5vw, 3.5rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); letter-spacing: -0.01em; }
h3 { font-size: clamp(1.2rem, 2.5vw, 1.5rem); }
h4 { font-size: 1.1rem; }

.label {
  font-family: 'Instrument Sans', sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent-teal);
}

.subtitle {
  font-size: 1.15rem;
  color: var(--text-secondary);
  max-width: 600px;
  line-height: 1.7;
}

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

/* --- Navigation --- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  z-index: 1000;
  background: rgba(11, 15, 26, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  transition: background var(--transition-base);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
}

.nav-logo-text {
  font-family: 'Instrument Sans', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.08em;
}

.nav-logo-bar {
  width: 24px;
  height: 2px;
  background: var(--gradient-brand);
  border-radius: 1px;
}

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

.nav-links a {
  font-family: 'Instrument Sans', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  letter-spacing: 0.03em;
  transition: color var(--transition-base);
  position: relative;
}
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1.5px;
  background: var(--gradient-brand);
  transition: width var(--transition-base);
}
.nav-links a:hover,
.nav-links a.active {
  color: var(--text-primary);
}
.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

.nav-lang {
  font-family: 'Instrument Sans', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid var(--border-subtle);
  padding: 0.35rem 0.75rem;
  border-radius: 4px;
  cursor: pointer;
  letter-spacing: 0.05em;
  transition: all var(--transition-base);
}
.nav-lang:hover {
  border-color: var(--accent-magenta);
  color: var(--text-primary);
}

/* Mobile menu */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.nav-toggle span {
  width: 22px;
  height: 2px;
  background: var(--text-secondary);
  border-radius: 1px;
  transition: all var(--transition-base);
}

/* --- Sections --- */
section {
  padding: var(--section-gap) 0;
}

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

.section-header .label {
  margin-bottom: 0.75rem;
  display: block;
}

/* --- Hero --- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  padding-top: var(--nav-height);
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-bg canvas {
  width: 100%;
  height: 100%;
}

.hero-gradient {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(233, 69, 96, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(124, 58, 237, 0.06) 0%, transparent 50%),
    linear-gradient(to bottom, transparent 70%, var(--bg-primary) 100%);
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 720px;
}

.hero h1 {
  margin-bottom: 1.25rem;
}

.hero .subtitle {
  margin-bottom: 2rem;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'Instrument Sans', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.75rem 1.75rem;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: all var(--transition-base);
  text-decoration: none;
  letter-spacing: 0.02em;
}

.btn-primary {
  background: var(--accent-magenta);
  color: white;
}
.btn-primary:hover {
  background: #d63b54;
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 8px 30px rgba(233, 69, 96, 0.25);
}

.btn-outline {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}
.btn-outline:hover {
  border-color: var(--accent-purple);
  color: var(--text-primary);
  transform: translateY(-1px);
}

.btn-group {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* --- Cards --- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 1.75rem;
  transition: all var(--transition-base);
}
.card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-accent);
  transform: translateY(-2px);
}

.card-accent-left {
  border-left: 3px solid var(--accent-magenta);
}
.card-accent-left-purple {
  border-left: 3px solid var(--accent-purple);
}

/* --- Featured Block --- */
.featured {
  background: linear-gradient(135deg, rgba(17, 24, 39, 0.8), rgba(21, 29, 46, 0.9));
  border: 1px solid rgba(233, 69, 96, 0.15);
  border-radius: 16px;
  padding: 2.5rem;
  position: relative;
  overflow: hidden;
}

.featured::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gradient-brand);
}

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

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

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

/* --- Badge --- */
.badge {
  display: inline-flex;
  align-items: center;
  font-family: 'Instrument Sans', sans-serif;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.3rem 0.75rem;
  border-radius: 4px;
  background: var(--accent-magenta);
  color: white;
}

.badge-purple {
  background: var(--accent-purple);
}

.badge-outline {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
}

/* --- Species Bar --- */
.species-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.species-tag {
  font-size: 0.8rem;
  color: var(--text-muted);
  padding: 0.25rem 0.75rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 20px;
  border: 1px solid var(--border-subtle);
}

/* --- Divider --- */
.divider {
  border: none;
  height: 1px;
  background: var(--border-subtle);
  margin: 3rem 0;
}

/* --- Stats --- */
.stat {
  text-align: center;
  padding: 1.5rem;
}

.stat-value {
  font-family: 'Instrument Sans', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-top: 0.25rem;
}

/* --- News Cards --- */
.news-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 1.5rem;
  transition: all var(--transition-base);
  text-decoration: none;
  display: block;
}
.news-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-accent);
  transform: translateY(-2px);
}

.news-date {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.news-title {
  font-family: 'Instrument Sans', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.news-excerpt {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* --- Footer --- */
.footer {
  border-top: 1px solid var(--border-subtle);
  padding: 3rem 0 2rem;
  margin-top: var(--section-gap);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
  flex-wrap: wrap;
}

.footer-col h4 {
  font-family: 'Instrument Sans', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.footer-col a {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}
.footer-col a:hover {
  color: var(--text-primary);
}

.footer-bottom {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* --- Contact Form --- */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-family: 'Instrument Sans', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
  letter-spacing: 0.03em;
}

.form-input,
.form-textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  color: var(--text-primary);
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.9rem;
  transition: border-color var(--transition-base);
}
.form-input:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--accent-magenta);
}

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

/* --- Animations --- */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.animate-in {
  opacity: 0;
  animation: fadeInUp 0.8s var(--ease-out) forwards;
}

.animate-in-delay-1 { animation-delay: 0.1s; }
.animate-in-delay-2 { animation-delay: 0.2s; }
.animate-in-delay-3 { animation-delay: 0.3s; }
.animate-in-delay-4 { animation-delay: 0.4s; }
.animate-in-delay-5 { animation-delay: 0.5s; }

/* --- Scroll reveal --- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- Language toggle (hide/show) --- */
[lang="es"] { display: none; }
body.lang-es [lang="es"] { display: revert; }
body.lang-es [lang="en"] { display: none; }

/* --- Responsive --- */
@media (max-width: 768px) {
  :root {
    --section-gap: 4rem;
  }

  .nav-links {
    display: none;
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(11, 15, 26, 0.97);
    backdrop-filter: blur(20px);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2.5rem;
  }
  .nav-links.open {
    display: flex;
  }
  .nav-links a {
    font-size: 1.2rem;
  }

  .nav-toggle {
    display: flex;
  }

  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
    padding-top: calc(var(--nav-height) + 3rem);
    padding-bottom: 3rem;
  }

  .featured {
    padding: 1.5rem;
  }

  .footer-inner {
    flex-direction: column;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }
}

@media (max-width: 480px) {
  h1 { font-size: 1.8rem; }
  h2 { font-size: 1.5rem; }
}
