:root {
  --primary: #2563eb;
  --primary-light: #93c5fd;
  --bg-dark: #1e293b;
  --bg-light: #f8fafc;
  --text-dark: #1e293b;
  --text-light: #f8fafc;
  --gray-light: #eee;
  --gray-mid: #bbb;
  --gray-dark: #444;
  --radius: 0.6rem;
  --transition: all 0.4s ease;
  --header-h: 90px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

*::selection,
*::-moz-selection {
  background-color: transparent;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', sans-serif;
  color: var(--text-light);
  line-height: 1.6;
  background-image: linear-gradient(180deg,
      rgba(28, 30, 33, 0) 0%,
      rgba(28, 30, 33, 0) 50%,
      rgba(28, 30, 33, 0.9) 100%,
      #232526 100%),
    url("/assets/img/fondo.png");
  background-size: contain;
}

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


a {
  color: inherit;
  text-decoration: none;
}


.reveal-on-scroll {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal-on-scroll.show {
  opacity: 1;
  transform: translateY(0);
}

nav a.active {
  font-weight: 600;
  text-decoration: underline;
}

.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 2rem;
  background: transparent;
  z-index: 100;
  transition: 0.3s;
  backdrop-filter: blur(4px);
}

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

.logo img {
  height: 33px;
  display: block;
}

.nav {
  display: flex;
  align-items: center;
  margin-right: 1.5rem;
}

.nav_menu {
  display: flex;
  gap: 3rem;
  list-style: none;
  align-items: center;
}

.nav_item a {
  color: var(--text-light);
  font-size: 1rem;
  font-weight: 500;
  transition: .3s;
}

.nav_item a:hover,
.nav_item a.active {
  color: var(--primary-light);
}

main {
  padding-top: 80px;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

main>section {
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

#home,
#about,
#projects,
#contact {
  scroll-margin-top: var(--header-h);
}

.home {
  min-height: calc(100vh - var(--header-h));
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 0 3rem;
  position: relative;
}

#home_content h1 {
  font-size: clamp(2rem, 6vw, 5em);
}

#home_content h2 {
  font-size: clamp(1.5rem, 4vw, 3em);
}

#home_content h3 {
  font-size: clamp(1.2rem, 3vw, 2em);
}

.btn {
  display: inline-block;
  padding: 0.75rem 2rem;
  background: var(--primary);
  color: var(--text-light);
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  transition: background 0.3s, color 0.3s;
  margin: 1rem 1rem 1rem 0;
  border: none;
  cursor: pointer;
  white-space: normal;
  text-align: center;
}

.btn:hover {
  background: var(--primary-light);
  color: var(--bg-dark);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}

.btn-outline:hover {
  background: var(--primary);
  color: var(--text-light);
}

.btn-contact {
  background: linear-gradient(90deg, #00c6ff 0%, #0072ff 100%);
  color: #fff;
}

.btn-contact:hover {
  background: linear-gradient(90deg, #0072ff 0%, #00c6ff 100%);
  transform: translateY(-2px) scale(1.03);
}

.btn-send {
  background: linear-gradient(to right, #6a11cb, #2575fc);
  color: white;
  border: none;
  padding: 16px 35px;
  border-radius: 50px;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.btn-send:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.btn-send:active {
  transform: translateY(0);
}

.btn-sending {
  background: linear-gradient(to right, #4CAF50, #8BC34A);
  pointer-events: none;
}

.home_icon {
  position: absolute;
  bottom: 2rem;
  display: flex;
  gap: 1rem;
  padding: 2.5rem;
}

.home_icon a {
  color: var(--primary);
  font-size: 2rem;
  transition: color 0.3s;
}

.home_icon a:hover {
  color: var(--primary-light);
}

#home_content,
#home_picture {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 3rem;
}

#home_picture img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.3;
  filter: brightness(0.7) blur(1px);
}

.about {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0 3.5rem;
}

.about h2 {
  font-size: 2.5em;
  margin-bottom: 1rem;
}

.about h3 {
  margin-bottom: 2rem;
}

.about_content {
  display: flex;
  width: 100%;
  justify-content: flex-start;
  align-items: flex-start;
  gap: 2rem;
  margin-bottom: 2rem;
}

.about_image img {
  max-width: 320px;
  border-radius: 10%;
  box-shadow: 0 8px 32px rgba(37, 99, 235, 0.25);
  border: 4px solid var(--primary-light);
  object-fit: cover;
  background: var(--bg-light);
}

.about_info {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.about_container {
  display: flex;
  gap: 2rem;
  text-align: left;
}

.about_container p {
  flex: 1;
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--text-light);
  max-width: 350px;
  margin: 0 1rem;
}

.about_icons {
  display: flex;
  flex-wrap: wrap;
  gap: 2.5rem;
}

.skill-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 2rem;
  color: var(--primary);
}

.skill-icon p {
  margin-top: 0.5rem;
  font-size: 1rem;
  color: var(--text-light);
}

.projects {
  padding: 1rem 3.5rem;
  margin-top: 3rem;
}

.projects h2 {
  text-align: center;
  color: var(--primary-light);
  font-size: 2.5rem;
  margin-bottom: 2rem;
  letter-spacing: 1px;
}

.projects_grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2.5rem;
  max-width: 1200px;
  margin: 0 auto;
}

.project_card {
  background: rgba(24, 33, 54, 0.95);
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(37, 99, 235, 0.15);
  overflow: hidden;
  transition: transform 0.3s, box-shadow 0.3s;
}

.project_card:hover {
  transform: translateY(-10px) scale(1.03);
  box-shadow: 0 16px 40px rgba(37, 99, 235, 0.25);
}

.project_card img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  filter: grayscale(20%) brightness(0.95);
  transition: filter 0.3s;
}

.project_card:hover img {
  filter: grayscale(0%) brightness(1.05);
}

.project_info {
  height: 45%;
  padding: 1.5rem 1.2rem;
  background: linear-gradient(0deg, rgba(30, 41, 59, 0.95) 80%, rgba(30, 41, 59, 0.7) 100%);
}

.project_info h3 {
  margin: 0 0 0.7rem;
  color: var(--primary);
  font-size: 1.3rem;
  font-weight: 700;
}

.project_info p {
  color: var(--text-light);
  font-size: 1rem;
  line-height: 1.5;
}

.form_contact {
  width: 100%;
  padding: 1rem;
  display: flex;
  justify-content: center;
}

.contact_container {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 20px;
  padding: 10px 35px;
  max-width: 460px;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.contact_container h2 {
  text-align: center;
  font-size: 2.4rem;
  margin-bottom: 8px;
  color: #fff;
}

.contact_subtitle {
  color: var(--gray-mid);
  text-align: center;
  margin-bottom: 18px;
}

.contact_form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

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

.field label {
  color: var(--gray-light);
}

.field input,
.field textarea {
  background: rgba(255, 255, 255, 0.08);
  border: 1.5px solid var(--gray-dark);
  border-radius: 8px;
  padding: 12px 14px;
  color: #fff;
  font-size: 1rem;
  transition: border 0.2s, box-shadow 0.2s;
  resize: none;
}

.field input:focus,
.field textarea:focus {
  border-color: #00c6ff;
  box-shadow: 0 0 0 2px #00c6ff44;
}

.form_error {
  font-size: 0.9rem;
  color: red;
  height: 1em;
  margin-top: 4px;
}

.alert {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 20px;
  border-radius: 10px;
  background: white;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  gap: 15px;
  transform: translateX(150%);
  transition: transform 0.5s ease-in-out;
  z-index: 1000;
}

.alert.show {
  transform: translateX(0);
}

.alert-success {
  border-left: 5px solid #4CAF50;
}

.alert-error {
  border-left: 5px solid #F44336;
}

.alert-icon {
  font-size: 24px;
}

.success-icon {
  color: #4CAF50;
}

.error-icon {
  color: #F44336;
}

.alert-content h3 {
  margin-bottom: 5px;
  color: #333;
}

.alert-content p {
  color: #666;
}

.close-btn {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: #999;
  margin-left: 20px;
}

.footer {
  color: #f8fafc;
  padding: 20px 1rem;
  font-size: 1.05rem;
  width: 100vw;
}

.footer_container {
  max-width: 1100px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.5rem;
  padding: 0 1rem;
  margin: 0 auto;
}

.footer_left,
.footer_right {
  opacity: 0.85;
  font-weight: 500;
}

.footer_center {
  display: flex;
  gap: 1.2rem;
}

.footer_center a {
  color: #f8fafc;
  font-size: 1.5rem;
  transition: color 0.2s, transform 0.2s;
  opacity: 0.85;
}

.footer_center a:hover {
  color: #93c5fd;
  transform: translateY(-2px) scale(1.15);
  opacity: 1;
}

.footer_right i {
  color: #93c5fd;
  margin: 0 2px;
}

@media (min-width: 769px) {
  .home {
    min-height: calc(100vh - var(--header-h));
  }
  #home_content {
    height: 60vh;
    justify-content: space-evenly;
  }
  #home_picture {
    height: 90vh;
  }
}

@media (max-width: 768px) {
  .header {
    padding: 0.8rem 1rem;
  }

  .header .container {
    flex-direction: column;
    gap: 0.5rem;
  }

  main {
    padding-top: 120px;
  }

  .nav_menu {
    flex-wrap: wrap;
    gap: 0.8rem;
    justify-content: center;
  }

  .logo {
    display: none;
  }

  .home_icon {
    margin: 2rem 0;
    position: static;
    padding: 1rem;
    justify-content: center;
    width: 100%;
  }

  .home {
    min-height: (calc(100vh - var(--header-h)));
    padding: 1rem;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
  }

  #home_content {
    gap: 2rem;
    padding: 1rem;
    flex: 0 0 69%;
  }

  #home_picture {
    height: 50vh;
    flex: 0 0 31%;
    padding: 1rem;
  } 

  .form_contact {
    padding: 3rem 1rem;
  }

  .about_container {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .about_container p {
    max-width: 90%;
    margin: 0 auto;
  }

  .about_image img {
    max-width: 250px;
  }
}

@media (max-width: 700px) {
  .projects_grid {
    grid-template-columns: 1fr;
  }

  .projects {
    padding: 2rem 0.5rem;
  }

  .footer_container {
    flex-direction: column;
    text-align: center;
  }
}

@media (max-width: 600px) {
  .contact_container {
    padding: 24px 8px;
    max-width: 98vw;
  }
}

@media (max-width: 576px) {
  .container {
    margin: 10px;
  }

  
  #home_picture {
    display: none;
  }
  
  .home {
    padding: 2rem;
    text-align: center;
    align-items: center;
  }

  .form-container {
    padding: 20px;
  }

  .btn-send {
    width: 100%;
    justify-content: center;
  }

  .alert {
    left: 20px;
    right: 20px;
    transform: translateY(-150%);
  }

  .alert.show {
    transform: translateY(0);
  }
}

@media (max-width: 480px) {

  #home_content{
    align-items: center;
    text-align: center;
  }

  #home_content h1 {
    font-size: 2.5rem;
  }

  #home_content h2 {
    font-size: 1.8rem;
  }

  #home_content h3 {
    font-size: 1.3rem;
  }

  .home {
    flex-direction: column;
    padding: 0 1rem;
    text-align: center;
    height: 90vh;
  }

  .about_content {
    flex-direction: column;
    align-items: center;
  }

  .projects_grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .form_contact {
    padding: 0 1rem;
  }
}