/* ── VARIABLES Y BASE (INDEX) ── */
:root {
  --bg: #0a0a0c; --bg2: #111116; --bg3: #18181f;
  --accent: #00e5ff; --accent2: #ff6b35;
  --text: #e8e8ec; --muted: #7a7a8a; --border: rgba(255,255,255,0.07);
  --font-display: 'Syne', sans-serif; --font-mono: 'JetBrains Mono', monospace;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg); color: var(--text);
  font-family: var(--font-mono); font-size: 15px; line-height: 1.7; overflow-x: hidden;
}

body::before {
  content: ''; position: fixed; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.035'/%3E%3C/svg%3E");
  pointer-events: none; z-index: 0; opacity: 0.6;
}

/* ── NAVEGACIÓN Y FOOTER ── */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100; display: flex;
  align-items: center; justify-content: space-between; padding: 1.2rem 4rem;
  background: rgba(10,10,12,0.85); backdrop-filter: blur(16px); border-bottom: 0.5px solid var(--border);
}
.nav-logo { font-family: var(--font-display); font-weight: 800; font-size: 1.1rem; color: var(--text); text-decoration: none; }
.nav-logo span { color: var(--accent); }
.nav-links { display: flex; gap: 2.5rem; list-style: none; }
.nav-links a { font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); text-decoration: none; transition: color 0.2s; }
.nav-links a:hover { color: var(--accent); }

/* Botón hamburguesa — solo visible en móvil */
.nav-toggle {
  display: none; background: none; border: none; cursor: pointer;
  flex-direction: column; gap: 5px; padding: 4px; z-index: 250; position: relative;
}
.nav-toggle span {
  display: block; width: 22px; height: 1.5px; background: var(--text);
  transition: all 0.3s; transform-origin: center;
}
.nav-toggle.active span:nth-child(1) { transform: rotate(45deg) translate(4px, 5px); }
.nav-toggle.active span:nth-child(2) { opacity: 0; }
.nav-toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(4px, -5px); }

footer {
  padding: 2rem 4rem; border-top: 0.5px solid var(--border); display: flex;
  justify-content: space-between; align-items: center; font-size: 0.68rem;
  color: var(--muted); letter-spacing: 0.08em; position: relative; z-index: 1;
}

/* ── COMPONENTES GLOBALES ── */
h1 { font-family: var(--font-display); font-weight: 800; font-size: clamp(2.8rem, 5vw, 4.5rem); line-height: 1.0; margin-bottom: 1rem; }
h2 { font-family: var(--font-display); font-weight: 700; font-size: clamp(1.8rem, 3vw, 2.8rem); margin-bottom: 3rem; line-height: 1.1; }
.section-tag { font-size: 0.65rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--accent); margin-bottom: 0.75rem; display: flex; align-items: center; gap: 0.75rem; }
.section-tag::before { content: ''; width: 24px; height: 0.5px; background: var(--accent); }
section { padding: 6rem 4rem; position: relative; z-index: 1; }

/* ── HERO ── */
#hero { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; align-items: center; padding: 0 4rem; padding-top: 5rem; gap: 4rem; }
.hero-grid-line { position: absolute; inset: 0; background-image: linear-gradient(rgba(0,229,255,0.03) 1px, transparent 1px), linear-gradient(90deg, rgba(0,229,255,0.03) 1px, transparent 1px); background-size: 60px 60px; pointer-events: none; }
.hero-content, .hero-visual { position: relative; z-index: 1; }
.hero-tag { display: inline-flex; align-items: center; gap: 0.5rem; font-size: 0.7rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--accent); border: 0.5px solid rgba(0,229,255,0.3); padding: 0.35rem 0.85rem; border-radius: 2px; margin-bottom: 2rem; }
.hero-tag::before { content: ''; width: 6px; height: 6px; background: var(--accent); border-radius: 50%; animation: pulse 2s ease-in-out infinite; }
h1 .line2 { color: transparent; -webkit-text-stroke: 1px rgba(232,232,236,0.35); }
.hero-subtitle { font-size: 0.85rem; color: var(--muted); max-width: 420px; margin-bottom: 2.5rem; line-height: 1.8; }
.hero-subtitle strong { color: var(--text); font-weight: 500; }
.hero-buttons { display: flex; gap: 1rem; flex-wrap: wrap; }
.btn-primary, .btn-secondary { display: inline-flex; align-items: center; padding: 0.8rem 1.8rem; font-family: var(--font-mono); font-size: 0.78rem; text-transform: uppercase; text-decoration: none; border-radius: 2px; transition: all 0.2s; }
.btn-primary { background: var(--accent); color: #000; font-weight: 500; }
.btn-primary:hover { background: #fff; transform: translateY(-2px); }
.btn-secondary { background: transparent; color: var(--text); border: 0.5px solid var(--border); }
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }
.hero-visual { display: flex; justify-content: center; align-items: center; }
.photo-frame { 
  position: relative;
  width: 420px; 
  height: 480px; 

}
.photo-frame::before {
  display: none;
}
.photo-placeholder {
 width: 100%;
  height: 100%;
  background: transparent;
  border: none;
  border-radius: 0;
  overflow: visible;
  position: relative;
}

.photo-placeholder img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
  border-radius: 4px;
  mask-image: linear-gradient(to bottom, black 80%, transparent );
}

.card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.hero-stats { display: flex; gap: 2rem; margin-top: 2.5rem; }
.stat-item { display: flex; flex-direction: column; gap: 0.2rem; }
.stat-number { font-family: var(--font-display); font-size: 1.8rem; font-weight: 800; color: var(--accent); line-height: 1; }
.stat-label { font-size: 0.65rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }

/* ── SOBRE MÍ ── */
#sobre { background: var(--bg2); border-top: 0.5px solid var(--border); border-bottom: 0.5px solid var(--border); }
.timeline { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; position: relative; margin-bottom: 3rem; }
.timeline::before { content: ''; position: absolute; top: 28px; left: 0; right: 0; height: 0.5px; background: linear-gradient(90deg, var(--accent) 0%, rgba(0,229,255,0.1) 100%); }
.timeline-item { padding: 0 1.5rem; position: relative; }
.timeline-dot { width: 10px; height: 10px; border: 2px solid var(--accent); border-radius: 50%; background: var(--bg2); margin-bottom: 1.5rem; position: relative; z-index: 1; transition: background 0.2s; }
.timeline-item:hover .timeline-dot { background: var(--accent); }
.timeline-step { font-size: 0.65rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); margin-bottom: 0.4rem; }
.timeline-title { font-family: var(--font-display); font-weight: 700; font-size: 1rem; margin-bottom: 0.5rem; }
.timeline-desc, .sobre-text { font-size: 0.75rem; color: var(--muted); line-height: 1.7; }
.sobre-text { max-width: 680px; font-size: 0.875rem; line-height: 1.9; }

/* ── HABILIDADES ── */
.skills-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
.skill-column { background: var(--bg2); border: 0.5px solid var(--border); border-radius: 4px; padding: 2rem; position: relative; overflow: hidden; transition: border-color 0.3s; }
.skill-column:hover { border-color: rgba(0,229,255,0.25); }
.skill-column::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: linear-gradient(90deg, var(--accent), transparent); }
.skill-column.software::before { background: linear-gradient(90deg, var(--accent2), transparent); }
.skill-col-title { font-family: var(--font-display); font-weight: 700; font-size: 0.9rem; margin-bottom: 1.5rem; display: flex; align-items: center; gap: 0.75rem; }
.skill-col-icon { width: 28px; height: 28px; border-radius: 4px; display: flex; align-items: center; justify-content: center; font-size: 14px; }
.icon-auto { background: rgba(0,229,255,0.1); } .icon-sw { background: rgba(255,107,53,0.1); }
.skill-list { display: flex; flex-direction: column; gap: 0.75rem; }
.skill-item { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.skill-name { font-size: 0.78rem; color: var(--text); }
.skill-bar-track { flex: 1; height: 2px; background: var(--border); border-radius: 2px; overflow: hidden; }
.skill-bar-fill { height: 100%; background: var(--accent); border-radius: 2px; transform-origin: left; animation: barGrow 1s ease-out forwards; transform: scaleX(0); }
.skill-column.software .skill-bar-fill { background: var(--accent2); }

/* ── PROYECTOS DESTACADOS ── */
#proyectos-dest { background: var(--bg2); border-top: 0.5px solid var(--border); border-bottom: 0.5px solid var(--border); }
.cards-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; margin-bottom: 2.5rem; }
.project-card { background: var(--bg3); border: 0.5px solid var(--border); border-radius: 4px; overflow: hidden; transition: all 0.3s; display: flex; flex-direction: column; text-decoration: none; color: inherit; position: relative; }
.project-card:hover { border-color: rgba(0,229,255,0.3); transform: translateY(-4px); }
.card-thumb { height: 160px; background: var(--bg); display: flex; align-items: center; justify-content: center; border-bottom: 0.5px solid var(--border); font-size: 2.5rem; position: relative; }
.card-thumb::after { content: ''; position: absolute; inset: 0; background: linear-gradient(135deg, rgba(0,229,255,0.05), transparent); }
.card-body { padding: 1.25rem; flex: 1; display: flex; flex-direction: column; gap: 0.75rem; }
.card-title { font-family: var(--font-display); font-weight: 700; font-size: 0.95rem; }
.card-desc { font-size: 0.73rem; color: var(--muted); line-height: 1.7; flex: 1; }
.card-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: auto; }
.tag { font-size: 0.62rem; letter-spacing: 0.08em; text-transform: uppercase; padding: 0.2rem 0.6rem; border: 0.5px solid var(--border); border-radius: 2px; color: var(--muted); }
.card-arrow { position: absolute; top: 1rem; right: 1rem; font-size: 0.8rem; opacity: 0; transition: all 0.2s; color: var(--accent); }
.project-card:hover .card-arrow { opacity: 1; transform: translate(2px, -2px); }
.view-all { display: inline-flex; align-items: center; gap: 0.5rem; font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); text-decoration: none; border-bottom: 0.5px solid rgba(0,229,255,0.3); padding-bottom: 2px; transition: gap 0.2s; }
.view-all:hover { gap: 0.9rem; }

/* ── CONTACTO ── */
#contacto { text-align: center; }
.contact-intro { color: var(--muted); font-size: 0.85rem; max-width: 420px; margin: 0 auto; }
.contact-links { display: flex; justify-content: center; gap: 1.5rem; flex-wrap: wrap; margin-top: 2.5rem; }
.contact-link { display: flex; align-items: center; gap: 0.75rem; padding: 1rem 2rem; background: var(--bg2); border: 0.5px solid var(--border); border-radius: 4px; text-decoration: none; color: var(--text); font-size: 0.78rem; transition: all 0.2s; }
.contact-link:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }

/* ── ANIMACIONES Y RESPONSIVE ── */
.fade-in { opacity: 0; transform: translateY(20px); animation: fadeUp 0.7s ease forwards; }
@keyframes fadeUp { to { opacity: 1; transform: translateY(0); } }
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.4; transform: scale(0.7); } }
@keyframes barGrow { to { transform: scaleX(1); } }
.delay-1 { animation-delay: 0.1s; } .delay-2 { animation-delay: 0.25s; } .delay-3 { animation-delay: 0.4s; } .delay-4 { animation-delay: 0.55s; }

/* ─── MENÚ MÓVIL YOUTUBE-STYLE ─── */
.mobile-menu-backdrop {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.6); z-index: 150;
  opacity: 0; transition: opacity 0.25s;
}
.mobile-menu-backdrop.open { opacity: 1; }

@media (max-width: 900px) {
  nav { padding: 1rem 1.5rem; }
  .nav-toggle { display: flex; }
  .mobile-menu-backdrop { display: block; }

  /* Panel lateral */
  .nav-links {
    display: flex;
    position: fixed; top: 0; right: 0; bottom: 0;
    width: 280px;
    background: var(--bg); border-left: 0.5px solid var(--border);
    flex-direction: column; gap: 0; padding: 4.5rem 1.5rem 2rem;
    transform: translateX(100%); transition: transform 0.3s ease;
    z-index: 200; overflow-y: auto; list-style: none;
  }
  .nav-links.open { transform: translateX(0); }
  .nav-links li { }
  .nav-links a { display: block; padding: 1rem 0; font-size: 1rem; color: var(--text); border-bottom: 0.5px solid var(--border); }
  .nav-links a:hover, .nav-links a.active { color: var(--accent); }

  #hero {
    grid-template-columns: 1fr;
    padding: 6rem 1.5rem 3rem;
    text-align: center;
  }
  .hero-visual {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
    order: -1;
  }
  .photo-frame {
    width: 200px;
    height: 240px;
  }
  .hero-subtitle { max-width: 100%; }
  .hero-buttons, .hero-stats { justify-content: center; }
  section { padding: 4rem 1.5rem; }
  .timeline { grid-template-columns: 1fr 1fr; gap: 2rem; }
  .skills-grid, .cards-grid { grid-template-columns: 1fr; }
  footer { flex-direction: column; gap: 0.5rem; text-align: center; }
}