@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&family=Manrope:wght@300;400;500;600;700;800&display=swap');

:root {
  --primary:          #81ecff;
  --primary-dim:      #00d4ec;
  --secondary:        #b9f61d;
  --secondary-dim:    #ace700;
  --tertiary:         #ffbd5c;

  --bg:               #0e0e0e;
  --surface:          #0e0e0e;
  --surface-low:      #131313;
  --surface-mid:      #1a1a1a;
  --surface-high:     #20201f;
  --surface-highest:  #262626;
  --surface-bright:   #2c2c2c;

  --on-surface:       #ffffff;
  --on-surface-dim:   #adaaaa;
  --outline:          #767575;
  --outline-variant:  #484847;

  --yellow:   #f0c040;
  --orange:   #e06c2a;
  --blue:     #3b82f6;
  --darkblue: #1d4ed8;
  --green:    #22c55e;
  --darkgreen:#166534;
  --cyan:     #06b6d4;
  --darkgray: #1f2937;

  --font-headline: 'Space Grotesk', sans-serif;
  --font-body:     'Manrope', sans-serif;

  --radius-sm:  2px;
  --radius-md:  4px;
  --radius-lg:  8px;
  --radius-xl:  12px;
  --radius-full: 12px;

  --nav-h: 68px;
  --max-w: 1120px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at 0% 0%,   #131313 0%, transparent 50%),
    radial-gradient(circle at 100% 100%, #1a1a1a 0%, transparent 50%);
  background-attachment: fixed;
  color: var(--on-surface);
  line-height: 1.6;
  min-height: 100vh;
}

img  { display: block; max-width: 100%; }
a    { color: inherit; text-decoration: none; }
ul   { list-style: none; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }

/* ── Background blur orb ───────────────────────────────────── */
.fondo {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 60% 40% at 15% 20%, rgba(0, 212, 236, 0.06) 0%, transparent 70%),
    radial-gradient(ellipse 50% 35% at 85% 75%, rgba(185, 246, 29, 0.04) 0%, transparent 70%);
}

/* ── Skip link ─────────────────────────────────────────────── */
.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 200;
  padding: 0.6rem 1rem;
  background: var(--primary);
  color: var(--bg);
  font-family: var(--font-headline);
  font-weight: 700;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
  transition: top 0.2s;
}
.skip-link:focus {
  top: 1rem;
}

/* ── Focus visibility (keyboard) ───────────────────────────── */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ── Header / Nav ──────────────────────────────────────────── */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(9, 9, 9, 0.65);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(72, 72, 71, 0.3);
  height: var(--nav-h);
}

.nav {
  display: flex;
  align-items: center;
  gap: 2rem;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 2rem;
  height: 100%;
  font-family: var(--font-headline);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.nav a,
.nav button {
  color: var(--on-surface-dim);
  transition: color 0.2s;
  white-space: nowrap;
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
}

.nav a:first-child { color: var(--primary); font-weight: 600; }
.nav a:hover,
.nav button:hover { color: var(--on-surface); }

/* push Contacto to the right */
.nav a:last-child,
.nav .nav-mail-btn { margin-left: auto; color: var(--primary); font-weight: 600; }

/* ── Shared layout utility ─────────────────────────────────── */
section,
.technologies {
  position: relative;
  z-index: 1;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 5rem 2rem;
}

/* ── Section headings ──────────────────────────────────────── */
.section-heading {
  font-family: var(--font-headline);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--on-surface);
}

.section-heading::after {
  content: '';
  display: block;
  height: 3px;
  width: 3rem;
  background: var(--secondary);
  margin-left: 0.75rem;
  border-radius: 2px;
  flex-shrink: 0;
}

/* ── Hero / Presentación ───────────────────────────────────── */
.presentacion {
  padding-top: calc(var(--nav-h) + 5rem);
  padding-bottom: 5rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.5rem;
}

.my-picture {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  object-fit: cover;
  object-position: 50% 20%;
  border: 2px solid var(--outline-variant);
  filter: grayscale(20%) contrast(1.1);
  transition: filter 0.3s;
}
.my-picture:hover { filter: grayscale(0%) contrast(1.1); }

/* Availability badge */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.65rem;
  font-family: var(--font-body);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 0.25rem 0.7rem;
  border-radius: var(--radius-full);
  background: var(--surface-high);
  border: 1px solid rgba(72, 72, 71, 0.4);
  color: var(--secondary);
  vertical-align: middle;
  margin-left: 0.6rem;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.badge::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--secondary);
  animation: pulse 2s infinite;
  transition: background 0.2s;
}

.badge:hover {
  background: var(--secondary);
  color: var(--surface-high);
  border-color: var(--secondary);
}

.badge:hover::before {
  background: var(--surface-high);
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.5; transform: scale(0.8); }
}

.linkedin-link { text-decoration: none; }

/* Main heading */
.titulo {
  font-family: var(--font-headline);
  font-size: clamp(2.25rem, 7vw, 5.5rem);
  font-weight: 700;
  letter-spacing: -0.05em;
  line-height: 1.0;
  color: var(--on-surface);
}

/* Sub-heading */
.subtitulo {
  font-size: clamp(0.95rem, 2vw, 1.15rem);
  font-weight: 400;
  line-height: 1.75;
  max-width: 680px;
  color: var(--on-surface-dim);
}

.texto-destacado { color: var(--on-surface); font-weight: 600; }
.texto-opaco     { opacity: 0.55; }

/* ── CTA / Link buttons ─────────────────────────────────────── */
.link-botones {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.link-boton {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.25rem;
  font-family: var(--font-headline);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  border-radius: var(--radius-sm);
  background: var(--surface-high);
  color: var(--on-surface-dim);
  border: 1px solid rgba(72, 72, 71, 0.45);
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.1s;
  white-space: nowrap;
}
.link-boton:hover {
  background: var(--surface-bright);
  color: var(--on-surface);
  border-color: var(--outline);
}
.link-boton:active { transform: scale(0.97); }

/* ── academic-background / Timeline ─────────────────────────────────── */
#academic-background { padding-bottom: 4rem; }

.timeline {
  position: relative;
  padding-left: 2rem;
  margin-top: 2.5rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0; bottom: 0;
  width: 1px;
  background: linear-gradient(to bottom, var(--primary), transparent);
  opacity: 0.25;
}

.timeline-item {
  position: relative;
  margin-bottom: 2.5rem;
  padding: 1.5rem;
  background: var(--surface-low);
  border: 1px solid rgba(72, 72, 71, 0.35);
  border-radius: var(--radius-lg);
  transition: background 0.25s, border-color 0.25s;
}
.timeline-item:hover {
  background: var(--surface-mid);
  border-color: rgba(129, 236, 255, 0.18);
}

.timeline-point {
  position: absolute;
  left: -2.4rem;
  top: 1.6rem;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--primary);
  border: 3px solid var(--bg);
  box-shadow: 0 0 0 1px rgba(129, 236, 255, 0.35);
}

.timeline-item time {
  display: block;
  font-family: var(--font-headline);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--secondary);
  margin-bottom: 0.4rem;
}

.timeline-item h3 {
  font-family: var(--font-headline);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 0.5rem;
}

.timeline-item p {
  font-size: 0.9rem;
  color: var(--on-surface-dim);
  line-height: 1.7;
  margin-bottom: 0.75rem;
}

.timeline-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-headline);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--primary);
  transition: gap 0.2s;
}
.timeline-link:hover { gap: 0.65rem; }

.timeline-link-invertido {
  color: var(--primary);
  border: 1px solid rgba(129, 236, 255, 0.25);
  padding: 0.3rem 0.8rem;
  border-radius: var(--radius-sm);
}
.timeline-link-invertido:hover { background: rgba(129, 236, 255, 0.07); }

.arrow-icon { width: 14px; height: 10px; }

/* ── Technology filter buttons ─────────────────────────────── */
.technologies {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
  padding: 1.5rem 2rem 2.5rem;
}

.technologies button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px; height: 52px;
  background: var(--surface-high);
  border: 1px solid rgba(72, 72, 71, 0.45);
  border-radius: var(--radius-md);
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
  overflow: hidden;
  padding: 10px;
}
.technologies button img {
  width: 28px; height: 28px;
  object-fit: contain;
  transition: filter 0.2s;
}
.technologies button:hover {
  background: var(--surface-bright);
  border-color: var(--outline);
  transform: translateY(-2px);
}
.technologies button:hover img { filter: grayscale(0%); }
.technologies button.active {
  background: rgba(129, 236, 255, 0.10);
  border-color: rgba(129, 236, 255, 0.50);
  box-shadow: 0 0 12px rgba(129, 236, 255, 0.12);
}
.technologies button.active img { filter: grayscale(0%); }

/* ── Projects grid ─────────────────────────────────────────── */
.projects { padding-top: 1rem; }

#projects-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.project-card {
  display: flex;
  flex-direction: column;
  background: var(--surface-low);
  border: 1px solid rgba(72, 72, 71, 0.35);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: background 0.3s, border-color 0.3s, transform 0.3s;
}
.project-card:hover {
  background: var(--surface-mid);
  border-color: rgba(129, 236, 255, 0.20);
  transform: translateY(-3px);
}

/* Two-column layout inside each card */
.project-img-col {
  width: 100%;
}
.project-image-wrapper {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--surface-mid);
}
.project-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(30%) contrast(1.05);
  transition: filter 0.4s, transform 0.4s;
}
.project-card:hover .project-image {
  filter: grayscale(0%) contrast(1.05);
  transform: scale(1.04);
}

.project-info-col {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 0.75rem;
}

.project-info-col h3 {
  font-family: var(--font-headline);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--on-surface);
  transition: color 0.2s;
}
.project-card:hover .project-info-col h3 { color: var(--primary); }

.project-description {
  font-size: 0.875rem;
  color: var(--on-surface-dim);
  line-height: 1.65;
  flex: 1;
}

/* ── Tag badges ────────────────────────────────────────────── */
.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tag-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.55rem;
  font-size: 0.68rem;
  font-family: var(--font-headline);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-radius: var(--radius-sm);
  line-height: 1.4;
  white-space: nowrap;
}
.tag-badge .icon,
.tag-badge svg { width: 14px; height: 14px; flex-shrink: 0; }

/* Tag color classes */
.bg-yellow {
  background: #f7e025;
}
.text-darkgray {
  color: #383836;
}
.bg-orange {
  background: #e44b20;
}
.bg-red {
  background: #e42020;
}
.bg-green {
  background: #6DB33F;
}
.bg-darkgreen {
  background: #215732;
}
.bg-blue {
  background: #00589d;
}
.bg-cyan {
  background-color: #00ADD8; 
}
.text-white {
  color: #fff;
}
.text-darkgray { color: #111827 !important; }

/* ── Project footer (links) ────────────────────────────────── */
.project-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0;
  padding-top: 0;
  border-top: none;
  background: transparent;
}

.project-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-headline);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--primary);
  padding: 0.3rem 0.7rem;
  border: 1px solid rgba(129, 236, 255, 0.25);
  border-radius: var(--radius-sm);
  transition: background 0.2s, border-color 0.2s;
}
.project-link-btn:hover {
  background: rgba(129, 236, 255, 0.08);
  border-color: rgba(129, 236, 255, 0.5);
}

/* ── About Me ──────────────────────────────────────────────── */
#about-me {
  border-top: 1px solid rgba(72, 72, 71, 0.25);
}

#about-me h2 {
  font-family: var(--font-headline);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  margin-bottom: 1.75rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.about-me-img {
  width: 140px;
  height: 160px;
  object-fit: cover;
  object-position: 50% 15%;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(72, 72, 71, 0.4);
  filter: grayscale(20%) contrast(1.1);
  flex-shrink: 0;
  transition: filter 0.3s;
}
.about-me-img:hover { filter: grayscale(0%); }

#about-me p {
  font-size: 0.95rem;
  color: var(--on-surface-dim);
  line-height: 1.8;
}
#about-me strong { color: var(--on-surface); font-weight: 600; }

/* ── Footer ────────────────────────────────────────────────── */
footer {
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(12px);
  border-top: 1px solid rgba(72, 72, 71, 0.25);
}

footer .w-full { max-width: var(--max-w); margin: 0 auto; padding: 1.5rem 2rem; }

footer span a,
footer .text-sm { font-size: 0.8rem; color: var(--on-surface-dim); }
footer span a:hover { color: var(--primary); }

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.footer-links .link-boton {
  font-size: 0.75rem;
  padding: 0.4rem 0.9rem;
}

/* ── Toast ─────────────────────────────────────────────────── */
#toast-mail {
  background: var(--surface-highest) !important;
  color: var(--primary) !important;
  border: 1px solid rgba(129, 236, 255, 0.25);
  border-radius: var(--radius-lg) !important;
  font-family: var(--font-headline);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  padding: 0.75rem 1.5rem;
  box-shadow: 0 0 30px rgba(129, 236, 255, 0.10);
  backdrop-filter: blur(16px);
}

/* ── Icon utility ──────────────────────────────────────────── */
.icon {
  width: 18px; height: 18px;
  flex-shrink: 0;
  vertical-align: middle;
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 768px) {
  .nav { gap: 1.2rem; font-size: 0.8rem; }

  .presentacion { padding-top: calc(var(--nav-h) + 3rem); }

  #projects-list { grid-template-columns: 1fr; }

  .about-me-img { width: 100px; height: 120px; }

  .timeline { padding-left: 1.5rem; }
  .timeline-point { left: -1.9rem; }

  .footer-links { display: none; }

  footer .w-full {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
}

@media (max-width: 480px) {
  section,
  .technologies { padding-left: 1.25rem; padding-right: 1.25rem; }

  .nav { padding: 0 1.25rem; gap: 0.8rem; }
  .nav a:not(:first-child):not(:last-child) { display: none; }
}

.technologies button[data-tech="JavaScript"]:hover,
.technologies button[data-tech="JavaScript"].active {
  border-color: #f7df1e;
  box-shadow: 0 0 10px #f7df1e80;
}

.technologies button[data-tech="NodeJS"]:hover,
.technologies button[data-tech="NodeJS"].active {
  border-color: #215732;
  box-shadow: 0 0 10px #194226;
}

.technologies button[data-tech="HTML"]:hover,
.technologies button[data-tech="HTML"].active {
  border-color: #e34c26;
  box-shadow: 0 0 10px #e34c2680;
}

.technologies button[data-tech="C_LANGUAGE"]:hover,
.technologies button[data-tech="C_LANGUAGE"].active {
  border-color: #007bff;
  box-shadow: 0 0 10px #007bff80;
}

.technologies button[data-tech="Java"]:hover,
.technologies button[data-tech="Java"].active {
  border-color: #f89820;
  box-shadow: 0 0 10px #f8982080;
}

.technologies button[data-tech="Python"]:hover,
.technologies button[data-tech="Python"].active {
  border-color: #ffd43b;
  box-shadow: 0 0 10px #ffd43b80;
}
.technologies button[data-tech="Go"]:hover,
.technologies button[data-tech="Go"].active {
  border-color: #00ADD8;
  box-shadow: 0 0 10px #00ADD880;
}

.technologies button[data-tech="POSTGRES"]:hover,
.technologies button[data-tech="POSTGRES"].active {
  border-color: #336791;
  box-shadow: 0 0 10px #33679180;
}

/* ── Reduced motion ────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}