:root {
  --primary-color: #0a192f;
  --secondary-color: #112240;
  --accent-color: #64ffda;
  --text-primary: #ccd6f6;
  --text-secondary: #8892b0;
  --text-white: #e6f1ff;
  --transition: all 0.25s cubic-bezier(0.645, 0.045, 0.355, 1);
  --font-mono: 'SF Mono', 'Fira Code', 'Fira Mono', 'Roboto Mono', monospace;
  --font-sans: 'Calibre', 'Inter', 'San Francisco', 'SF Pro Text', -apple-system, system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

body,
html {
  margin: 0;
  padding: 0;
  height: 100vh;
  overflow-x: hidden;
  font-family: 'Segoe UI', sans-serif;
  /*   background-color: #0a192f; */
  /*   background-color: #112240; */
  background-color: #223a5e;
  color: #ccd6f6;
  scroll-behavior: smooth;
}

/* --- Mobile-first improvements (overrides) --- */
.site-title {
  font-size: clamp(1rem, 1.5vw + 0.6rem, 1.2rem);
}

.email-link {
  font-size: clamp(0.95rem, 1.2vw + 0.5rem, 1rem);
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
}

.cv-link {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.project-tile img {
  display: block;
  aspect-ratio: 16/9;
  object-fit: cover;
}

.section-heading {
  font-size: clamp(1.25rem, 2.5vw + 0.75rem, 2rem);
}

.contact-button {
  min-height: 44px;
}

.modal-content {
  max-height: 90vh;
  overflow-y: auto;
}

@media (max-width: 1024px) {
  .header {
    padding: 0.75rem 1rem;
  }
  .projects-section {
    padding: 1.25rem;
  }
}

@media (max-width: 768px) {
  main { padding-top: 6rem; }
  .projects { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1.25rem; }
}

@media (max-width: 480px) {
  .projects-section {
    padding: 1rem;
  }
  .projects {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  /* Header fine-tune for very small screens */
  .header { grid-template-columns: auto 1fr auto; padding: 0.45rem 0.6rem; min-height: 52px; }
  .site-title { max-width: 22vw; font-size: 0.85rem; }
  .header-center { justify-content: flex-start; }
  .email-link { font-size: 0.95rem; }
  .cv-link { font-size: 0.8rem; padding: 0.3rem 0.5rem; min-height: 34px; }
}

main {
  padding-top: 5rem;
}


footer {
  text-align: center;
  color: #8892b0;
  font-size: 0.9rem;
  margin-top: 2rem;
  padding: 1rem;
  background-color: rgba(10, 25, 47, 0.9);
}

#bg-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}

.header {
  position: fixed;
  top: 0;
  width: 100%;
  /*   background-color: #0a192f; */
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  z-index: 1000;
  gap: 1rem;
  margin: 0 auto;

  background-color: rgba(10, 25, 47, 0.85);
  /* mismo color con transparencia */
  backdrop-filter: blur(8px);
  /* suaviza lo de detrás */
  -webkit-backdrop-filter: blur(8px);
  /* soporte Safari */
  border-bottom: 1px solid rgba(100, 255, 218, 0.1);
  /* línea separadora sutil */
}

.header-left,
.header-center,
.header-right {
  display: flex;
  align-items: center;
}

.header-left {
  flex-shrink: 0;
}

.header-center {
  margin: 0 auto;
}

.header-right {
  flex-shrink: 0;
}

.site-title {
  font-size: 1.2rem;
  font-weight: bold;
}

.email-link {
  color: #64ffda;
  font-size: 1rem;
  text-decoration: none;
  font-weight: 500;
}

.email-link:hover {
  text-decoration: underline;
}

.cv-link {
  background-color: #64ffda;
  color: #0a192f;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  text-decoration: none;
  font-weight: bold;
  transition: background 0.2s ease;
}

.cv-link:hover {
  background-color: #52e0c4;
}


.container {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 0px;
  /* espacio para el header */
  padding-left: 2rem;
  padding-right: 2rem;
  box-sizing: border-box;
  gap: clamp(2rem, 8vh, 4rem);
}

.projects-section {
  width: 100%;
  max-width: 1200px;
  /* antes 1000px */
  padding: 2rem;
  margin: 0 auto;
  box-sizing: border-box;
}

.section-divider {
  border: none;
  /*   border-top: 2px solid #233554; */
  border-top: 2px solid #4a6592;
  margin: 0;
  margin-bottom: 0.5rem;
  width: 100%;
}

  .projects {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    justify-content: center;
    justify-items: center;
  }


  .project-tile {
    background: #0a192f;
    border-radius: 8px;
    text-align: center;
    text-decoration: none;
    color: inherit;
    width: 100%;
    max-width: 350px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
  }

  .project-tile:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
  }

.project-tile img {
  width: 100%;
  height: auto;
  border-radius: 8px 8px 0 0;
}

  .project-tile h3 {
    padding: 1rem;
  }

.about {
  text-align: center;
  max-width: 600px;
}

.section-heading {
  font-size: 2rem;
  color: #64ffda;
  margin-bottom: 0.5rem;
}


.section-header {
  text-align: left;
}

.number {
  font-weight: bold;
  color: #8892b0;
  margin-right: 0.5rem;
}

.highlight-title {
  margin-top: 1rem;
  font-weight: bold;
  color: #ccd6f6;
}

.highlight-list {
  list-style: none;
  padding-left: 0;
  margin-top: 0.5rem;
}

.highlight-label {
  font-weight: bold;
  color: #64ffda;
}

.skills-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin-top: 1rem;
  list-style: none;
  padding: 0;
  color: #8892b0;
}

.skills-list li {
  background: #112240;
  padding: 0.4rem 0.8rem;
  border-radius: 4px;
}

#contact {
  width: 100%;
  max-width: 1000px;
  margin: 4rem auto;
  padding: 2rem;
  box-sizing: border-box;
  text-align: left;
}

.contact-text p {
  max-width: 600px;
  margin-bottom: 1rem;
}

.contact-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 2rem;
}

.contact-button {

  display: inline-block;
  margin-top: 1rem;
  padding: 0.75rem 1.5rem;
  background-color: #64ffda;
  color: #0a192f;
  font-weight: bold;
  text-decoration: none;
  border-radius: 5px;
  transition: background 0.2s ease;

}

.contact-button:hover {
  background-color: #52e0c4;
}

.contact-links {
  margin-top: 1.5rem;
  display: flex;
  justify-content: center;
  gap: 2rem;
  font-size: 1.5rem;
}

.contact-links a {
  color: #ccd6f6;
  transition: color 0.2s;
}

.contact-links a:hover {
  color: #64ffda;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin: 2rem auto;
  max-width: 500px;
  width: 100%;
}

.contact-form input,
.contact-form textarea {
  padding: 0.75rem;
  border: none;
  border-radius: 5px;
  background-color: #112240;
  color: #ccd6f6;
  font-size: 1rem;
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
  color: #8892b0;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: 2px solid #64ffda;
}

.contact-form .contact-button {
  background-color: #64ffda;
  color: #0a192f;
  font-weight: bold;
  padding: 0.75rem;
  border: none;
  cursor: pointer;
  border-radius: 5px;
  transition: background 0.2s ease;
}

.contact-form .contact-button:hover {
  background-color: #52e0c4;
}

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(10, 25, 47, 0.85);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 50;
}

.modal-content {
  background-color: #112240;
  padding: 2rem;
  border-radius: 8px;
  width: 90%;
  max-width: 500px;
  position: relative;
}

.close {
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  font-size: 1.5rem;
  color: #64ffda;
  cursor: pointer;
}

.hidden {
  display: none;
}

/* projects.css */
.project-detail {
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  padding: 2rem;
  text-align: left;
  box-sizing: border-box;
}

.project-description {
  font-size: 1.1rem;
  color: var(--text-primary);
  margin-bottom: 2rem;
}

.gallery {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 2rem;
}

.gallery img {
  width: 300px;
  border-radius: 8px;
  transition: transform 0.3s ease;
}

.gallery img:hover {
  transform: scale(1.05);
}

.video-section {
  display: flex;
  justify-content: center;
  margin-bottom: 2rem;
}

.external-link {
  display: flex;
  justify-content: center;
  margin-top: 2rem;
}

.external-link .cv-link {
  background-color: #64ffda;
  color: #0a192f;
  padding: 0.75rem 1.5rem;
  border-radius: 5px;
  text-decoration: none;
  font-weight: bold;
  transition: background 0.2s ease;
}

.external-link .cv-link:hover {
  background-color: #52e0c4;
}

.github-icon-link {
  float: right;
  font-size: 2rem;
  margin-top: 0.2rem;
  margin-bottom: 1.5rem;
  color: #ccd6f6;
  transition: color 0.2s;
}

.github-icon-link:hover {
  color: #64ffda;
}

/**/

.download-section {
  text-align: center;
  margin: 2rem 0;
}

.download-section .cv-link {
  background-color: #64ffda;
  color: #0a192f;
  padding: 0.75rem 1.5rem;
  border-radius: 5px;
  text-decoration: none;
  font-weight: bold;
  transition: background 0.2s ease;
}

.download-section .cv-link:hover {
  background-color: #52e0c4;
}

.spacer {}

/* Responsive Styles */
@media (max-width: 1024px) {
  .spacer {
    height: clamp(2rem, 12vh, 4rem);
  }

  .container {
    padding: 1rem;
  }

  .section-heading {
    font-size: 1.5rem;
  }

  .project-tile img {
    width: 100%;
    height: auto;
  }

  .project-tile h3 {
    font-size: 1.2rem;
    text-align: center;
  }

  .gallery {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  }

  .highlight-list li,
  .skills-list li {
    font-size: 0.9rem;
  }

  .header {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.5rem;
  }

  .header-left,
  .header-center,
  .header-right {
    width: 100%;
    justify-content: center;
  }

  .contact-links {
    flex-direction: row;
    justify-content: center;
    gap: 1rem;
  }
}

@media (max-width: 768px) {
  .section-heading {
    font-size: 1.3rem;
  }

  .highlight-title {
    font-size: 1.1rem;
  }

  .email-link,
  .cv-link {
    font-size: 0.9rem;
  }

  .skills-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
  }

  .skills-list li {
    font-size: 0.8rem;
    padding: 0.3rem 0.6rem;
  }

  .project-content {
    padding: 0 0.5rem;
  }

  .contact-button {
    font-size: 0.9rem;
    padding: 0.6rem 1.2rem;
  }

  .contact-form input,
  .contact-form textarea {
    font-size: 0.9rem;
  }
}

@media (max-width: 480px) {
  .section-heading {
    font-size: 1.1rem;
  }

  .project-tile h3 {
    font-size: 1rem;
  }

  .site-title {
    font-size: 1rem;
  }
}
/* ===== Mobile header improvements ===== */
.header {
  transition: transform 0.3s ease;
  will-change: transform;
}

.header--hidden {
  transform: translateY(-100%);
}

  @media (max-width: 768px) {
    .header {
      position: sticky !important;
      top: 0;
      display: grid !important;
      grid-template-columns: 1fr min-content; /* email | resume tight */
      align-items: center;
      gap: 0.5rem;
      padding: 0.5rem 0.5rem 0.5rem 0.75rem; /* tighter right */
      min-height: 56px;
      width: 100%;
    }

    .header-left { display: none !important; }
    .site-title { display: none !important; }
    .header-center { min-width: 0; display: flex; justify-content: flex-start; }
    .header-right { justify-self: end; }

    .email-link { display: inline-block; white-space: nowrap; border: none; background: transparent; padding: 0; font-size: 0.95rem; }
    .header-right .cv-link { justify-self: end; place-self: center end; margin-right: 0; }
    .cv-link { font-size: 0.85rem; padding: 0.35rem 0.55rem; min-height: 36px; border-radius: 8px; }

    /* Reduce extra space at top on mobile */
    main { padding-top: 0 !important; }
    .spacer { height: 0 !important; margin: 0 !important; }
  }
/* =============================
   Theme Refresh (Colors & Style)
   Non-breaking visual overrides
   ============================= */

/* Background with subtle gradients */
body, html {
  background: radial-gradient(1200px 800px at 10% -10%, rgba(100,255,218,0.06), rgba(0,0,0,0) 60%),
              radial-gradient(1000px 700px at 110% 10%, rgba(100,149,237,0.06), rgba(0,0,0,0) 55%),
              linear-gradient(180deg, #0b1020 0%, #0f1b2d 60%, #0b1020 100%);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: rgba(100,255,218,0.25);
  color: #e6f1ff;
}

/* Header glass + border and shadow */
.header {
  background: linear-gradient(180deg, rgba(10,25,47,0.9), rgba(10,25,47,0.75));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(100, 255, 218, 0.12);
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
}

.site-title {
  font-size: clamp(1.05rem, 1.5vw + 0.5rem, 1.3rem);
  letter-spacing: 0.3px;
}

.email-link {
  color: #64ffda;
  padding: 0.4rem 0.65rem;
  border-radius: 999px;
  border: 1px solid rgba(100, 255, 218, 0.12);
  background: linear-gradient(180deg, rgba(15,26,43,0.6), rgba(15,26,43,0.35));
}

.email-link:hover {
  box-shadow: 0 0 0 3px rgba(100,255,218,0.08), 0 6px 18px rgba(100,255,218,0.35);
}

.cv-link {
  background: linear-gradient(180deg, #64ffda, #34d3b2);
  color: #072a22;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  font-weight: 700;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  box-shadow: 0 10px 24px rgba(100,255,218,0.25);
}

.cv-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(100,255,218,0.32);
  background: linear-gradient(180deg, #72ffe2, #3edbb9);
}

/* Section visuals */
.section-divider {
  height: 2px;
  background: linear-gradient(90deg, rgba(100,255,218,0), rgba(100,255,218,0.6), rgba(100,255,218,0));
}

.section-heading {
  text-shadow: 0 2px 18px rgba(100,255,218,0.15);
}

.number {
  color: #7fa6b9;
}

/* Project tiles: glass cards */
.project-tile {
  background: linear-gradient(180deg, rgba(15,26,43,0.9), rgba(17,34,64,0.75));
  border: 1px solid rgba(100, 255, 218, 0.12);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  overflow: hidden;
}

.project-tile:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35), 0 0 0 3px rgba(100,255,218,0.05) inset;
  border-color: rgba(100, 255, 218, 0.22);
}

.project-tile img {
  border-radius: 10px 10px 0 0;
}

.project-tile h3 {
  padding: 1rem 1rem 1.2rem;
  color: #e6f1ff;
  letter-spacing: 0.2px;
}

/* Skill chips */
.skills-list li {
  background: linear-gradient(180deg, #0f213a, #0e1b30);
  border: 1px solid rgba(100, 255, 218, 0.12);
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}

/* Contact CTA and inputs */
.contact-button {
  background: linear-gradient(180deg, #64ffda, #34d3b2);
  color: #072a22;
  padding: 0.8rem 1.6rem;
  border-radius: 10px;
  font-weight: 700;
  box-shadow: 0 12px 28px rgba(100,255,218,0.28);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.contact-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 36px rgba(100,255,218,0.34);
}

.contact-links a {
  transition: color 0.2s, transform 0.2s ease, text-shadow 0.2s ease;
}

.contact-links a:hover {
  color: #64ffda;
  transform: translateY(-2px);
  text-shadow: 0 6px 18px rgba(100,255,218,0.25);
}

.contact-form input,
.contact-form textarea {
  border: 1px solid rgba(100, 255, 218, 0.12);
  border-radius: 10px;
  background-color: #0f213a;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.contact-form input:focus,
.contact-form textarea:focus {
  border-color: rgba(100, 255, 218, 0.22);
  box-shadow: 0 0 0 4px rgba(100,255,218,0.08);
}

/* Modal surface */
.modal-content {
  background: linear-gradient(180deg, rgba(15,26,43,1), rgba(17,34,64,0.85));
}

/* Gallery polish */
.gallery img {
  box-shadow: 0 10px 28px rgba(0,0,0,0.25);
}

.gallery img:hover {
  transform: scale(1.04);
  box-shadow: 0 16px 40px rgba(0,0,0,0.35);
}

/* Footer line */
footer {
  background-color: rgba(10, 25, 47, 0.75);
  border-top: 1px solid rgba(100, 255, 218, 0.12);
}

/* Final mobile header overrides to ensure layout and visibility */
@media (max-width: 768px) {
  .header { display: grid !important; grid-template-columns: auto 1fr auto; }
  .header .email-link { background: transparent !important; border: 0 !important; padding: 0 !important; box-shadow: none !important; }
  .header .cv-link { justify-self: end; }
}

@media (max-width: 480px) {
  .header .site-title { max-width: 22vw !important; }
  .header .email-link { font-size: 0.95rem !important; }
  .header .cv-link { font-size: 0.8rem !important; padding: 0.3rem 0.5rem !important; }
}
