/* =====================================================================
   MARCO AVILA — PORTFOLIO
   Sistemas · Redes · Cloud & Arquitectura AWS
   CSS puro, mobile-first. Sin frameworks.
   ===================================================================== */

/* ---------------------------------------------------------------------
   1. VARIABLES GLOBALES
   --------------------------------------------------------------------- */
:root {
  /* Superficies */
  --bg-primary:    #0A0E14;
  --bg-secondary:  #10151D;
  --bg-tertiary:   #161C27;

  /* Bordes */
  --border-subtle: #202836;
  --border-strong: #2E3849;

  /* Texto */
  --text-primary:   #EAEEF5;
  --text-secondary: #94A0B4;
  --text-tertiary:  #5B6678;

  /* Acentos — el naranja es la acción principal, el azul es soporte/información,
     el verde se reserva exclusivamente para estados "activo / online". */
  --accent-orange:      #FF9900;
  --accent-orange-dim:  #C97600;
  --accent-blue:         #4C9EFF;
  --accent-blue-dim:     #2E6BB8;
  --accent-green:        #3ECF8E;

  /* Tipografía */
  --font-display: 'Space Grotesk', 'Segoe UI', sans-serif;
  --font-body:    'Inter', 'Segoe UI', sans-serif;
  --font-mono:    'JetBrains Mono', 'SFMono-Regular', Consolas, monospace;

  /* Layout */
  --container-w: 1160px;
  --section-space: clamp(3.5rem, 6vw, 6rem);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;

  /* Movimiento */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------------------------------------------------------------------
   2. RESET
   --------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-align: center;
}

img { max-width: 100%; display: block; }
svg { display: block; }
ul, ol { margin: 0; padding: 0; list-style: none; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; font-family: var(--font-display); font-weight: 600; }
code {
  font-family: var(--font-mono);
  background: var(--bg-tertiary);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  font-size: 0.9em;
  color: var(--accent-blue);
}

::selection { background: var(--accent-orange); color: var(--bg-primary); }

/* Foco visible accesible en toda la web */
a:focus-visible,
button:focus-visible,
.nav-toggle-input:focus-visible ~ .nav-toggle,
input:focus-visible {
  outline: 2px solid var(--accent-orange);
  outline-offset: 3px;
  border-radius: 4px;
}

@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;
    scroll-behavior: auto !important;
  }
}

/* ---------------------------------------------------------------------
   3. UTILIDADES
   --------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container-w);
  margin-inline: auto;
  padding-inline: 1.25rem;
}

.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  background: var(--accent-orange);
  color: var(--bg-primary);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  z-index: 999;
  transition: top 0.2s var(--ease);
}
.skip-link:focus { top: 1rem; }

.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.text-accent { color: var(--accent-orange); }

/* Cursor parpadeante de terminal — un único acento reutilizado con moderación */
.cursor {
  display: inline-block;
  width: 0.5em;
  height: 1em;
  margin-left: 2px;
  background: var(--accent-orange);
  vertical-align: -0.15em;
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* Etiqueta tipo terminal usada como "kicker" antes de cada título de sección */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent-blue);
  margin: 0 0 0.75rem;
  letter-spacing: 0.02em;
}
.eyebrow__accent { color: var(--text-primary); }

/* Revelado en scroll — visible por defecto; solo se anima si hay JS activo */
.reveal { opacity: 1; transform: none; }
.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.js .reveal.is-visible { opacity: 1; transform: none; }

/* ---------------------------------------------------------------------
   4. BOTONES
   --------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.8rem 1.4rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s var(--ease), background 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease);
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn--primary {
  background: var(--accent-orange);
  color: var(--bg-primary);
}
.btn--primary:hover { background: #FFA826; }

.btn--outline {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--text-primary);
}
.btn--outline:hover {
  border-color: var(--accent-blue);
  color: var(--accent-blue);
  background: var(--bg-tertiary);
}

/* Píldora de estado (disponibilidad / status del sistema) */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-secondary);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  margin: 1.4rem 0;
}
.status-pill__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-green);
  box-shadow: 0 0 0 0 rgba(62, 207, 142, 0.55);
  animation: pulse-dot 2.2s infinite;
}
@keyframes pulse-dot {
  0%   { box-shadow: 0 0 0 0 rgba(62, 207, 142, 0.5); }
  70%  { box-shadow: 0 0 0 6px rgba(62, 207, 142, 0); }
  100% { box-shadow: 0 0 0 0 rgba(62, 207, 142, 0); }
}
.status-pill--sm { margin: 0; }

/* ---------------------------------------------------------------------
   5. HEADER / NAVEGACIÓN
   --------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 14, 20, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-subtle);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  position: relative;
}

.nav-brand {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 1rem;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}
.nav-brand__accent { color: var(--accent-orange); }

/* Toggle móvil — checkbox accesible (funciona sin JavaScript) */
.nav-toggle-input {
  position: absolute;
  top: 12px;
  right: 0;
  width: 40px;
  height: 40px;
  opacity: 0;
  cursor: pointer;
  z-index: 20;
  margin: 0;
}
.nav-toggle {
  position: absolute;
  top: 12px;
  right: 0;
  width: 40px;
  height: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border-radius: var(--radius-sm);
  pointer-events: none;
}
.nav-toggle__bar {
  width: 20px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: transform 0.25s var(--ease), opacity 0.2s var(--ease);
}
.nav-toggle-input:checked ~ .nav-toggle .nav-toggle__bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-toggle-input:checked ~ .nav-toggle .nav-toggle__bar:nth-child(2) { opacity: 0; }
.nav-toggle-input:checked ~ .nav-toggle .nav-toggle__bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.nav-menu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-top: none;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  padding: 0.5rem;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.3s var(--ease), opacity 0.25s var(--ease);
}
.nav-toggle-input:checked ~ .nav-menu {
  max-height: 20rem;
  opacity: 1;
}

.nav-link {
  padding: 0.85rem 1rem;
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  transition: color 0.2s var(--ease), background 0.2s var(--ease);
}
.nav-link:hover { color: var(--text-primary); background: var(--bg-tertiary); }
.nav-link--cta { color: var(--accent-orange); }

/* ---------------------------------------------------------------------
   6. HERO
   --------------------------------------------------------------------- */
.hero {
  position: relative;
  padding-block: 3rem 4rem;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: -20% -10% auto auto;
  width: 60vw;
  height: 60vw;
  max-width: 620px;
  max-height: 620px;
  background: radial-gradient(circle, rgba(255, 153, 0, 0.10) 0%, rgba(76, 158, 255, 0.06) 45%, transparent 70%);
  pointer-events: none;
}

.hero__grid {
  position: relative;
  display: grid;
  gap: 2.5rem;
}

.hero__eyebrow { margin-bottom: 1.25rem; }

.hero__title {
  font-size: clamp(2.1rem, 5vw + 1rem, 3.4rem);
  line-height: 1.12;
  letter-spacing: -0.01em;
  margin-bottom: 0.9rem;
}

.hero__subtitle {
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 1.4vw + 1rem, 1.5rem);
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.hero__lede {
  color: var(--text-secondary);
  max-width: 46ch;
  font-size: 1rem;
  margin-bottom: 0.25rem;
  margin-inline: auto;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.85rem;
  margin-top: 1.75rem;
}

.hero__photo {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--border-strong);
  margin-inline: auto;
  margin-bottom: 1.25rem;
  display: block;
}

/* ---------------------------------------------------------------------
   7. SECCIONES GENÉRICAS
   --------------------------------------------------------------------- */
.section { padding-block: var(--section-space); }
.section--alt { background: var(--bg-secondary); }

.section__title {
  font-size: clamp(1.6rem, 2.4vw + 1rem, 2.25rem);
  margin-bottom: 0.85rem;
}
.section__intro {
  color: var(--text-secondary);
  max-width: 60ch;
  margin-bottom: 2.5rem;
  margin-inline: auto;
}

/* ---------------------------------------------------------------------
   8. SOBRE MÍ
   --------------------------------------------------------------------- */
.about { display: grid; gap: 1.75rem; }
.about__text {
  color: var(--text-secondary);
  max-width: 68ch;
  font-size: 1.02rem;
  margin-inline: auto;
}
.about__text strong { color: var(--text-primary); font-weight: 600; }

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent-blue);
  justify-content: center;
}
.meta-row li { display: flex; align-items: center; gap: 1rem; }
.meta-row li:not(:last-child)::after {
  content: "";
  display: inline-block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--border-strong);
  margin-left: 1rem;
}

/* ---------------------------------------------------------------------
   9. SKILLS
   --------------------------------------------------------------------- */
.skills {
  display: grid;
  gap: 2rem;
}
.skills__group-title {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
  margin-bottom: 1rem;
}
.skill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: center;
}
.skill-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.9rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  font-size: 0.88rem;
  color: var(--text-secondary);
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease), color 0.2s var(--ease);
}
.skill-tag .icon { width: 16px; height: 16px; color: var(--accent-blue); }
.skill-tag:hover {
  border-color: var(--accent-blue-dim);
  color: var(--text-primary);
  transform: translateY(-2px);
}

/* ---------------------------------------------------------------------
   10. PROYECTOS — TIMELINE
   --------------------------------------------------------------------- */

/* Contenedor principal: línea vertical izquierda */
.proj-timeline {
  position: relative;
  display: grid;
  gap: 0;
  max-width: 820px;
  margin-inline: auto;
  text-align: left;
}

/* La línea vertical continua */
.proj-timeline::before {
  content: "";
  position: absolute;
  left: 18px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(
    to bottom,
    transparent,
    var(--border-strong) 8%,
    var(--border-strong) 92%,
    transparent
  );
}

/* Cada fila de la timeline */
.proj-timeline__item {
  position: relative;
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 0 1.5rem;
  padding-bottom: 2.5rem;
}
.proj-timeline__item:last-child { padding-bottom: 0; }

/* Nodo (punto) sobre la línea */
.proj-timeline__node {
  position: relative;
  top: 1.6rem;         /* alineado con el título de la tarjeta */
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--bg-primary);
  border: 2px solid var(--accent-blue);
  box-shadow: 0 0 0 4px rgba(76, 158, 255, 0.12);
  margin: 0 auto;
  flex-shrink: 0;
  z-index: 1;
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

/* La tarjeta */
.proj-timeline__card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.6rem 1.75rem;
  transition: border-color 0.25s var(--ease), transform 0.25s var(--ease),
              box-shadow 0.25s var(--ease);
}
.proj-timeline__card:hover {
  border-color: var(--border-strong);
  transform: translateX(4px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* Al hacer hover en la tarjeta, resalta el nodo */
.proj-timeline__item:hover .proj-timeline__node {
  border-color: var(--accent-orange);
  box-shadow: 0 0 0 5px rgba(255, 153, 0, 0.15);
}

/* Cabecera de la tarjeta: icono + título/subtítulo */
.proj-timeline__card-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}

.proj-timeline__icon {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  padding: 0.5rem;
  background: rgba(76, 158, 255, 0.08);
  border: 1px solid rgba(76, 158, 255, 0.18);
  border-radius: var(--radius-sm);
  color: var(--accent-blue);
  stroke-width: 1.75;
}

.proj-timeline__title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
  margin-bottom: 0.2rem;
}

.proj-timeline__subtitle {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-tertiary);
  letter-spacing: 0.02em;
}

/* Descripción */
.proj-timeline__desc {
  color: var(--text-secondary);
  font-size: 0.94rem;
  line-height: 1.7;
  margin-bottom: 1.2rem;
}

/* Píldoras de tecnologías */
.proj-timeline__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.proj-timeline__tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--accent-blue);
  background: rgba(76, 158, 255, 0.08);
  border: 1px solid rgba(76, 158, 255, 0.2);
  padding: 0.3rem 0.65rem;
  border-radius: 6px;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease);
}
.proj-timeline__tag:hover {
  background: rgba(76, 158, 255, 0.14);
  border-color: rgba(76, 158, 255, 0.4);
  color: var(--text-primary);
}

/* ---------------------------------------------------------------------
   11. EDUCACIÓN — TIMELINE
   --------------------------------------------------------------------- */
.timeline {
  position: relative;
  display: grid;
  gap: 2.25rem;
  align-items: center;
}

.timeline__item { position: relative; }

.timeline__marker {
  display: none;
}
.timeline__marker--accent { border-color: var(--accent-orange); }

.timeline__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  justify-content: center;
}
.timeline__type,
.timeline__status {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  letter-spacing: 0.02em;
}
.timeline__type {
  color: var(--accent-blue);
  background: rgba(76, 158, 255, 0.08);
  border: 1px solid rgba(76, 158, 255, 0.2);
}
.timeline__type--cert {
  color: var(--accent-orange);
  background: rgba(255, 153, 0, 0.08);
  border: 1px solid rgba(255, 153, 0, 0.22);
}
.timeline__status {
  color: var(--text-secondary);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
}
/* Clase preparada para cuando una formación quede completada */
.timeline__status--done {
  color: var(--accent-green);
  background: rgba(62, 207, 142, 0.08);
  border-color: rgba(62, 207, 142, 0.22);
}

.timeline__title {
  font-size: 1.1rem;
  line-height: 1.4;
  margin-bottom: 0.4rem;
  max-width: 52ch;
  margin-inline: auto;
}
.timeline__meta {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* ---------------------------------------------------------------------
   12. FOOTER
   --------------------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-secondary);
  padding-block: 2.5rem 1.5rem;
}
.footer__inner {
  display: grid;
  gap: 1.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 1.5rem;
}
.footer__logo {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
}
.footer__tagline { color: var(--text-tertiary); font-size: 0.9rem; }

.footer__links { display: flex; flex-direction: column; gap: 0.85rem; align-items: center; }
.footer__link {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--text-secondary);
  font-size: 0.92rem;
  transition: color 0.2s var(--ease);
  width: fit-content;
}
.footer__link .icon { color: var(--accent-blue); }
.footer__link:hover { color: var(--text-primary); }

.footer__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.82rem;
  color: var(--text-tertiary);
}
.back-to-top {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease), transform 0.2s var(--ease);
}
.back-to-top:hover {
  border-color: var(--accent-orange);
  color: var(--accent-orange);
  transform: translateY(-2px);
}

/* =====================================================================
   BREAKPOINTS — mobile-first: se añade complejidad a partir de aquí
   ===================================================================== */

/* ---- ≥ 640px : tablets pequeñas / móvil grande ----------------------- */
@media (min-width: 640px) {
  .container { padding-inline: 2rem; }

  .hero__actions { flex-wrap: nowrap; }

  .skills { grid-template-columns: repeat(2, 1fr); }

  .footer__inner {
    grid-template-columns: 1fr;
    align-items: center;
  }
  .footer__links { align-items: center; }
  .footer__link { width: auto; }
}

/* ---- ≥ 900px : nav horizontal + hero en dos columnas ------------------ */
@media (min-width: 900px) {
  .nav-toggle,
  .nav-toggle-input { display: none; }

  .nav-menu {
    position: static;
    flex-direction: row;
    align-items: center;
    gap: 0.25rem;
    max-height: none;
    opacity: 1;
    overflow: visible;
    background: transparent;
    border: none;
    padding: 0;
  }
  .nav-link--cta {
    border: 1px solid rgba(255, 153, 0, 0.35);
    border-radius: var(--radius-sm);
  }

  .hero__grid {
    grid-template-columns: 1fr;
    align-items: center;
    gap: 2rem;
  }
  .hero__visual { justify-content: center; }
  .arch-diagram { max-width: 380px; }

  .skills { grid-template-columns: repeat(3, 1fr); }


}

/* ---- ≥ 1180px : escritorio amplio -------------------------------------- */
@media (min-width: 1180px) {
  .hero { padding-block: 5rem 6rem; }
  .hero__title { margin-bottom: 1.1rem; }
  .arch-diagram { max-width: 420px; }
}
