/* Importar fuente Inter desde Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;500;700&display=swap');

:root {
  --bg: #0a0a0a;
  --text: #f0f0f0;
  --primary: #ff66cc;
  --accent: #cc66ff;
  --card-bg: rgba(255, 255, 255, 0.05);
  --nav-h: 64px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  padding-top: calc(var(--nav-h) + 20px);
}

canvas#bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
}

header {
  text-align: center;
  padding: 3rem 2rem 2rem;
}

.cta {
  margin-top: 1rem;
}

.cta .btn {
  font-size: 1rem;
}

h1 {
  font-size: 3rem;
  color: var(--primary);
  font-weight: 700;
}

h2 {
  font-size: 2rem;
  border-bottom: 2px solid var(--primary);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  transition: border-color 0.3s ease;
}

p {
  font-size: 1rem;
  max-width: 800px;
  margin: 0 auto;
}

nav {
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  background: rgba(10, 10, 10, 0.85);
  /* fallback */
  backdrop-filter: blur(8px);
  padding: 0.5rem 0;
  z-index: 100;
  border-bottom: 1px solid #1a1a1a;
}

.nav-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: calc(var(--nav-h) - 2px);
}

nav ul {
  display: flex;
  flex-wrap: wrap;
  list-style: none;
  gap: 1.5rem;
}

nav .nav-left {
  justify-content: flex-start;
}

nav .nav-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

nav .nav-right #lang-select {
  background: transparent;
  color: var(--primary);
  border: 1px solid #333;
  border-radius: 6px;
  padding: 0.25rem 0.5rem;
}

/* Align CV and language to the right on wide screens */
@media (min-width: 900px) {
  nav ul {
    justify-content: space-between;
    align-items: center;
  }

  nav ul::before {
    content: "";
    flex: 1;
  }

  nav ul li.cv-item {
    margin-left: auto;
  }
}

.btn {
  display: inline-block;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #0a0a0a;
  font-weight: 700;
  text-decoration: none;
  padding: 0.5rem 0.9rem;
  border-radius: 10px;
  border: none;
}

/* Make CV button float on all viewports */
#cv-button {
  box-shadow: none;
}

.btn:hover,
.btn:focus-visible {
  filter: brightness(1.1);
  color: #0a0a0a;
}

nav a {
  text-decoration: none;
  color: var(--primary);
  font-weight: 500;
  transition: color 0.2s ease;
}

nav a:hover {
  color: var(--accent);
  text-decoration: underline;
}

/* Focus styles for accessibility */
a:focus-visible,
button:focus-visible,
select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Skip link */
.skip-link {
  position: absolute;
  left: -9999px;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
  background: #000;
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  z-index: 200;
}

/* Visually hidden utility */
.visually-hidden {
  position: absolute !important;
  height: 1px;
  width: 1px;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
  white-space: nowrap;
}

main {
  max-width: 900px;
  margin: auto;
  padding: 2rem;
}

section {
  margin-bottom: 4rem;
  backdrop-filter: blur(2px);
  scroll-margin-top: calc(var(--nav-h) + 24px);
}

.about-container {
  max-width: 800px;
  margin: 0 auto;
  line-height: 1.8;
  font-size: 1rem;
  text-align: justify;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.experience-block {
  margin-bottom: 2.5rem;
}

.experience-block h3 {
  color: var(--accent);
  font-size: 1.25rem;
  margin-bottom: 0.3rem;
}

.experience-block p {
  font-style: italic;
  color: #ccc;
  margin-bottom: 0.5rem;
}

.experience-block ul {
  padding-left: 1.5rem;
  list-style: disc;
  line-height: 1.8;
}


.proyecto {
  background-color: var(--card-bg);
  padding: 1.2rem 1.5rem;
  border-radius: 12px;
  box-shadow: 0 0 10px rgba(255, 102, 255, 0.15);
  margin-bottom: 1.5rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.proyecto:hover {
  transform: translateY(-5px);
  box-shadow: 0 0 16px rgba(204, 102, 255, 0.3);
}

.proyecto h3 a {
  color: var(--primary);
  text-decoration: none;
  font-size: 1.25rem;
}

.proyecto p {
  margin-top: 0.5rem;
  font-size: 0.95rem;
}

ul {
  list-style: disc;
  padding-left: 1.5rem;
}

a {
  color: var(--primary);
  transition: color 0.2s ease;
}

a:hover {
  color: var(--accent);
}

footer {
  text-align: center;
  padding: 2rem 1rem;
  font-size: 0.85rem;
  color: #888;
}

.skills-block {
  margin-bottom: 2.5rem;
}

.skills-block h3 {
  color: var(--accent);
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.skills-block ul {
  padding-left: 1.5rem;
  list-style: disc;
  line-height: 1.8;
}

nav ul li:last-child select {
  background: transparent;
  color: var(--primary);
  border: 1px solid #333;
  border-radius: 6px;
  padding: 0.25rem 0.5rem;
}

/* Responsive design */
@media (max-width: 768px) {
  :root {
    --nav-h: 56px;
  }

  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  .nav-container {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  nav ul {
    justify-content: center;
    gap: 1rem;
  }

  .nav-right {
    justify-content: center;
  }

  main {
    padding: 1rem;
  }

  /* CV button behaves as inline within nav on mobile */
}