/* ===========================
   RESET & BASE
=========================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: #0d1117;
  color: #c9d1d9;
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  line-height: 1.7;
}

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

ul {
  list-style: none;
}

/* ===========================
   LAYOUT
=========================== */
.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ===========================
   ACCENT COLOR
=========================== */
.accent {
  color: #00d4aa;
}

/* ===========================
   HERO
=========================== */
.hero {
  background: linear-gradient(160deg, #161b22 0%, #0d1117 60%);
  border-bottom: 1px solid #21262d;
  padding: 5rem 0 4rem;
  text-align: center;
}

.hero-tag {
  display: inline-block;
  background-color: #00d4aa18;
  border: 1px solid #00d4aa55;
  color: #00d4aa;
  font-size: 0.75rem;
  font-family: 'Fira Code', monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.3rem 0.9rem;
  border-radius: 100px;
  margin-bottom: 1.5rem;
}

.hero-name {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 700;
  color: #e6edf3;
  line-height: 1.2;
  margin-bottom: 0.6rem;
}

.hero-title {
  font-size: 1.1rem;
  font-family: 'Fira Code', monospace;
  color: #8b949e;
  margin-bottom: 0.4rem;
}

.hero-location {
  font-size: 0.9rem;
  color: #6e7681;
  margin-bottom: 2rem;
}

.hero-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
}

/* Hero avatar */
.hero-avatar {
  position: relative;
  width: 180px;
  height: 180px;
  margin: 0 auto 1.75rem;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid #00d4aa88;
  background-color: #161b22;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 4px #00d4aa18, 0 8px 32px rgba(0, 212, 170, 0.12);
}

.hero-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  border-radius: 0;
  display: block;
}

.hero-avatar-initials {
  position: absolute;
  font-size: 1.6rem;
  font-weight: 700;
  font-family: 'Fira Code', monospace;
  color: #00d4aa;
  pointer-events: none;
  /* visible only when image loads (img oculta las iniciales visualmente) */
}

/* When image loads successfully, hide initials */
.hero-avatar img + .hero-avatar-initials {
  display: none;
}

/* When image fails (class added via JS), show initials */
.hero-avatar--empty .hero-avatar-initials {
  display: block;
}

/* ===========================
   BUTTONS
=========================== */
.btn {
  display: inline-block;
  padding: 0.5rem 1.2rem;
  border-radius: 6px;
  font-size: 0.875rem;
  font-family: 'Fira Code', monospace;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  white-space: nowrap;
}

.btn-primary {
  background-color: #00d4aa;
  color: #0d1117;
  font-weight: 600;
}

.btn-primary:hover {
  background-color: #00b891;
}

.btn-outline {
  border: 1px solid #30363d;
  color: #8b949e;
  background-color: transparent;
}

.btn-outline:hover {
  border-color: #00d4aa;
  color: #00d4aa;
}

/* ===========================
   SECTIONS
=========================== */
.section {
  padding: 4rem 0;
  border-bottom: 1px solid #21262d;
}

.section:last-of-type {
  border-bottom: none;
}

.section-title {
  font-size: 1.4rem;
  font-weight: 600;
  color: #e6edf3;
  margin-bottom: 2rem;
  font-family: 'Fira Code', monospace;
}

/* ===========================
   CARDS
=========================== */
.card {
  background-color: #161b22;
  border: 1px solid #21262d;
  border-radius: 10px;
  padding: 1.5rem;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.card:hover {
  border-color: #00d4aa55;
  transform: translateY(-2px);
}

.card-title {
  font-size: 0.85rem;
  font-family: 'Fira Code', monospace;
  color: #00d4aa;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
}

/* ===========================
   PORTFOLIO
=========================== */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.portfolio-card {
  background-color: #161b22;
  border: 1px solid #21262d;
  border-radius: 10px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.portfolio-card:hover {
  border-color: #00d4aa55;
  transform: translateY(-2px);
}

.portfolio-header {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.portfolio-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.4rem;
}

.portfolio-type {
  font-size: 0.72rem;
  font-family: 'Fira Code', monospace;
  color: #6e7681;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.portfolio-link {
  font-size: 0.8rem;
  font-family: 'Fira Code', monospace;
  color: #00d4aa;
  border: 1px solid #00d4aa44;
  padding: 0.15rem 0.6rem;
  border-radius: 4px;
  transition: background-color 0.2s ease;
}

.portfolio-link:hover {
  background-color: #00d4aa18;
}

.portfolio-title {
  font-size: 1.1rem;
  color: #e6edf3;
  font-weight: 600;
}

.portfolio-url {
  font-size: 0.78rem;
  font-family: 'Fira Code', monospace;
  color: #00d4aa;
  opacity: 0.7;
}

.portfolio-desc {
  font-size: 0.9rem;
  color: #8b949e;
  line-height: 1.6;
  flex: 1;
}

.portfolio-desc em {
  color: #c9d1d9;
  font-style: normal;
  font-weight: 500;
}

.portfolio-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

/* Portfolio thumbnail */
.portfolio-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 6px;
  overflow: hidden;
  background-color: #0d1117;
  border: 1px solid #21262d;
  margin-bottom: 0.25rem;
}

.portfolio-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.portfolio-card:hover .portfolio-thumb img {
  transform: scale(1.03);
}

.portfolio-thumb-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Fira Code', monospace;
  font-size: 0.8rem;
  color: #484f58;
  background: repeating-linear-gradient(
    45deg,
    #0d1117,
    #0d1117 6px,
    #161b22 6px,
    #161b22 12px
  );
  /* Only visible when image fails */
  z-index: 0;
}

/* When image loads, label stays behind */
.portfolio-thumb img:not([src=""]) {
  position: relative;
  z-index: 1;
}

/* When image fails, label becomes visible */
.portfolio-thumb--empty .portfolio-thumb-label {
  color: #6e7681;
}

/* ===========================
   MODULES
=========================== */
.modules-intro {
  font-size: 0.9rem;
  color: #6e7681;
  margin-bottom: 1.5rem;
  font-family: 'Fira Code', monospace;
}

.modules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.modules-career {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: 0;
  overflow: hidden;
}

/* Image block at the top of each career card */
.modules-career-img {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 7;
  overflow: hidden;
  background-color: #0d1117;
  flex-shrink: 0;
}

.modules-career-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: transform 0.35s ease;
}

.modules-career:hover .modules-career-img img {
  transform: scale(1.04);
}

.modules-career-img-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Fira Code', monospace;
  font-size: 0.85rem;
  color: #484f58;
  letter-spacing: 0.04em;
  background: repeating-linear-gradient(
    45deg,
    #0d1117,
    #0d1117 6px,
    #161b22 6px,
    #161b22 12px
  );
  z-index: 0;
  border-bottom: 1px solid #21262d;
}

/* When image loads, push label to back */
.modules-career-img img:not([src=""]) {
  position: relative;
  z-index: 1;
}

/* Visible label text when image is missing */
.modules-career-img--empty .modules-career-img-label {
  color: #6e7681;
}

/* Padding for card content below the image */
.modules-career > :not(.modules-career-img) {
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

.modules-career > .modules-career-header {
  padding-top: 1.25rem;
}

.modules-career > .modules-list:last-child {
  padding-bottom: 1.5rem;
}

.modules-career-header {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.modules-career-icon {
  font-size: 1.8rem;
  line-height: 1;
  flex-shrink: 0;
}

.modules-career-title {
  font-size: 1rem;
  color: #e6edf3;
  font-weight: 600;
  margin-bottom: 0.2rem;
}

.modules-career-sub {
  font-size: 0.75rem;
  font-family: 'Fira Code', monospace;
  color: #00d4aa;
}

.modules-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0;
  counter-reset: none;
}

.modules-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.module-num {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border: 1px solid #00d4aa44;
  background-color: #00d4aa12;
  color: #00d4aa;
  font-size: 0.7rem;
  font-family: 'Fira Code', monospace;
  font-weight: 600;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.module-name {
  font-size: 0.9rem;
  color: #c9d1d9;
  line-height: 1.5;
  padding-top: 0.2rem;
}

.teaching-subsection {
  margin-top: 3rem;
  padding-top: 2.5rem;
  border-top: 1px solid #21262d;
}

.teaching-heading {
  max-width: 760px;
  margin-bottom: 1.75rem;
}

.teaching-eyebrow {
  display: block;
  color: #00d4aa;
  font-family: 'Fira Code', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
}

.teaching-subsection-title {
  color: #e6edf3;
  font-family: 'Fira Code', monospace;
  font-size: clamp(1.25rem, 3vw, 1.65rem);
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: 0.65rem;
}

.teaching-intro {
  color: #8b949e;
  font-size: 0.95rem;
  line-height: 1.7;
}

.teaching-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}

.teaching-card {
  position: relative;
  overflow: hidden;
}

.teaching-card::after {
  content: '';
  position: absolute;
  width: 120px;
  height: 120px;
  top: -60px;
  right: -60px;
  border-radius: 50%;
  background-color: #00d4aa0a;
  border: 1px solid #00d4aa18;
}

.teaching-card-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.teaching-symbol {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  color: #00d4aa;
  background-color: #00d4aa12;
  border: 1px solid #00d4aa44;
  border-radius: 8px;
  font-family: 'Fira Code', monospace;
  font-size: 1.4rem;
}

.teaching-card-label {
  display: block;
  color: #6e7681;
  font-family: 'Fira Code', monospace;
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.teaching-card-title {
  color: #e6edf3;
  font-size: 1rem;
  font-weight: 600;
}

.teaching-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.teaching-list li {
  color: #8b949e;
  font-size: 0.9rem;
  padding-left: 1rem;
  position: relative;
}

.teaching-list li::before {
  color: #00d4aa;
  content: '›';
  left: 0;
  position: absolute;
}

/* ===========================
   SKILLS GRID
=========================== */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1.25rem;
}

.skill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag {
  display: inline-block;
  background-color: #00d4aa18;
  border: 1px solid #00d4aa33;
  color: #00d4aa;
  font-size: 0.8rem;
  font-family: 'Fira Code', monospace;
  padding: 0.2rem 0.65rem;
  border-radius: 4px;
}

.skill-list.soft li {
  font-size: 0.9rem;
  color: #8b949e;
  padding-left: 1rem;
  position: relative;
}

.skill-list.soft li::before {
  content: '›';
  color: #00d4aa;
  position: absolute;
  left: 0;
}

/* ===========================
   TIMELINE
=========================== */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.timeline-item {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 1.25rem;
  align-items: start;
}

.timeline-date {
  font-size: 0.78rem;
  font-family: 'Fira Code', monospace;
  color: #00d4aa;
  padding-top: 1.5rem;
  text-align: right;
  line-height: 1.4;
}

.timeline-content h3 {
  font-size: 1rem;
  color: #e6edf3;
  margin-bottom: 0.4rem;
}

.timeline-full {
  font-size: 0.9rem;
  color: #8b949e;
  margin-bottom: 0.75rem;
}

.badge {
  display: inline-block;
  background-color: #21262d;
  border: 1px solid #30363d;
  color: #8b949e;
  font-size: 0.75rem;
  font-family: 'Fira Code', monospace;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
}

.company {
  font-size: 0.85rem;
  color: #00d4aa;
  margin-bottom: 0.75rem;
  font-family: 'Fira Code', monospace;
}

.exp-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.exp-list li {
  font-size: 0.9rem;
  color: #8b949e;
  padding-left: 1rem;
  position: relative;
}

.exp-list li::before {
  content: '›';
  color: #00d4aa;
  position: absolute;
  left: 0;
}

/* ===========================
   EDUCATION GRID
=========================== */
.edu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
}

.edu-year {
  display: block;
  font-size: 0.75rem;
  font-family: 'Fira Code', monospace;
  color: #00d4aa;
  margin-bottom: 0.5rem;
}

.edu-grid .card h3 {
  font-size: 0.95rem;
  color: #e6edf3;
  margin-bottom: 0.3rem;
}

/* ===========================
   CERTIFICATIONS
=========================== */
.certs-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}

.cert-item {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.cert-year {
  font-size: 0.75rem;
  font-family: 'Fira Code', monospace;
  color: #00d4aa;
}

.cert-item p {
  font-size: 0.875rem;
  color: #8b949e;
}

/* ===========================
   LANGUAGES
=========================== */
.lang-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
}

.lang-card {
  flex: 1 1 140px;
  text-align: center;
  max-width: 180px;
}

.lang-icon {
  font-size: 2rem;
  display: block;
  margin-bottom: 0.5rem;
}

.lang-card h3 {
  font-size: 0.95rem;
  color: #e6edf3;
  margin-bottom: 0.2rem;
}

.lang-card p {
  font-size: 0.8rem;
  color: #6e7681;
  font-family: 'Fira Code', monospace;
}

/* ===========================
   FOOTER
=========================== */
.footer {
  background-color: #010409;
  border-top: 1px solid #21262d;
  padding: 1.5rem 0;
  text-align: center;
  font-size: 0.8rem;
  font-family: 'Fira Code', monospace;
  color: #484f58;
}

/* ===========================
   RESPONSIVE
=========================== */
@media (max-width: 640px) {
  .hero {
    padding: 3.5rem 0 3rem;
  }

  .hero-name {
    font-size: 2rem;
  }

  .hero-avatar {
    width: 140px;
    height: 140px;
  }

  .timeline-item {
    grid-template-columns: 1fr;
  }

  .timeline-date {
    text-align: left;
    padding-top: 0;
  }

  .lang-grid {
    justify-content: center;
  }

  .modules-grid {
    grid-template-columns: 1fr;
  }
}
