:root {
  --bg: #0c0f14;
  --bg-alt: #12161e;
  --surface: #1a1f2b;
  --surface-hover: #222836;
  --border: #2a3142;
  --text: #e8eaef;
  --text-muted: #8b93a7;
  --accent: #f59e42;
  --accent-soft: rgba(245, 158, 66, 0.12);
  --accent-glow: rgba(245, 158, 66, 0.35);
  --font: 'Outfit', system-ui, sans-serif;
  --mono: 'JetBrains Mono', monospace;
  --radius: 12px;
  --radius-lg: 20px;
  --header-h: 72px;
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-h);
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}

.container {
  width: min(1120px, 92vw);
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  z-index: 9999;
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: var(--bg);
  border-radius: var(--radius);
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus { top: 1rem; }

/* Header */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--header-h);
  background: rgba(12, 15, 20, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.header.scrolled {
  border-bottom-color: var(--border);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  gap: 1.5rem;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.logo-dot { color: var(--accent); }

.nav-links {
  display: flex;
  list-style: none;
  gap: 2rem;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.925rem;
  font-weight: 500;
  transition: color var(--transition);
}

.nav-links a:hover { color: var(--accent); }

.nav-actions { display: flex; align-items: center; gap: 0.75rem; }

.lang-toggle {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}

.lang-toggle:hover {
  border-color: var(--accent);
  background: var(--surface-hover);
}

.lang-toggle .lang-active { color: var(--accent); font-weight: 600; }
.lang-toggle .lang-sep { margin: 0 0.15rem; opacity: 0.4; }

.lang-toggle[data-lang="es"] .lang-active { color: var(--text-muted); font-weight: 500; }
.lang-toggle[data-lang="es"] .lang-inactive { color: var(--accent); font-weight: 600; }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: var(--transition);
}

/* Hero */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: var(--header-h);
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% -10%, var(--accent-soft), transparent),
    radial-gradient(circle at 80% 80%, rgba(59, 130, 246, 0.06), transparent);
  pointer-events: none;
}

.hero-content {
  position: relative;
  padding: 4rem 0 5rem;
}

.hero-layout {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 3rem;
  align-items: center;
  position: relative;
}

.hero-photo {
  display: flex;
  justify-content: center;
  padding: 4rem 0 5rem;
}

.hero-photo-frame {
  position: relative;
  padding: 6px;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--accent), #9050e9, #0176d3);
  box-shadow: 0 16px 48px rgba(245, 158, 66, 0.2);
}

.hero-photo-frame img {
  display: block;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--bg);
}

/* Profile photo section */
.profile-section {
  padding-top: 0;
  margin-top: -2rem;
}

.profile-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
}

.profile-photo-wrap {
  flex-shrink: 0;
  padding: 4px;
  border-radius: var(--radius-lg);
  background: linear-gradient(145deg, var(--accent-soft), rgba(144, 80, 233, 0.15));
  border: 1px solid var(--border);
}

.profile-photo-wrap img {
  display: block;
  width: 200px;
  height: 200px;
  border-radius: calc(var(--radius-lg) - 4px);
  object-fit: cover;
}

.profile-details {
  flex: 1;
  min-width: 240px;
}

.profile-name {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
  letter-spacing: -0.02em;
}

.profile-role {
  color: var(--accent);
  font-weight: 500;
  font-size: 1rem;
  margin-bottom: 0.35rem;
}

.profile-org {
  color: var(--text-muted);
  font-size: 0.925rem;
  margin-bottom: 1.25rem;
}

.profile-tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.profile-tags li {
  font-family: var(--mono);
  font-size: 0.72rem;
  padding: 0.35rem 0.75rem;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 999px;
}

.profile-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.profile-links a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  padding-bottom: 2px;
  border-bottom: 1px solid var(--border);
  transition: color var(--transition), border-color var(--transition);
}

.profile-links a:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.hero-greeting {
  font-family: var(--mono);
  font-size: 0.9rem;
  color: var(--accent);
  margin-bottom: 0.75rem;
  letter-spacing: 0.05em;
}

.hero-name {
  font-size: clamp(2.75rem, 8vw, 4.5rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 0.75rem;
}

.hero-title {
  font-size: clamp(1.15rem, 3vw, 1.5rem);
  color: var(--text-muted);
  font-weight: 400;
  margin-bottom: 1.25rem;
}

.hero-desc {
  max-width: 540px;
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-bottom: 2rem;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 3.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  padding: 0.85rem 1.75rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
}

.btn-primary {
  background: var(--accent);
  color: var(--bg);
  box-shadow: 0 4px 20px var(--accent-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px var(--accent-glow);
}

.btn-outline {
  border: 1px solid var(--border);
  color: var(--text);
  background: transparent;
}

.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

.hero-stats {
  display: flex;
  gap: 3rem;
  flex-wrap: wrap;
}

.stat-num {
  display: block;
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.badge {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid rgba(245, 158, 66, 0.25);
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  margin-bottom: 1.25rem;
  letter-spacing: 0.02em;
}

/* Sections */
.section {
  padding: 5rem 0;
}

.section-alt { background: var(--bg-alt); }

.section-header { margin-bottom: 3rem; }

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

.section-tag {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.75rem;
}

.section-title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.section-sub {
  color: var(--text-muted);
  margin-top: 0.5rem;
  font-size: 1rem;
}

/* About */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  align-items: start;
}

.about-text p {
  color: var(--text-muted);
  margin-bottom: 1rem;
  font-size: 1.05rem;
}

.about-meta {
  font-size: 0.925rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.roles-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
}

.roles-card h3 {
  font-size: 1.1rem;
  margin-bottom: 1.25rem;
}

.roles-list {
  list-style: none;
}

.roles-list li {
  font-size: 0.925rem;
  color: var(--text-muted);
  margin-bottom: 0.85rem;
  line-height: 1.5;
}

.roles-list strong { color: var(--text); }

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

.skills-grid .skills-card p {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

.cert-badges-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1.75rem;
}

.cert-badge-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: transform var(--transition);
}

.cert-badge-item:hover {
  transform: translateY(-6px);
}

.cert-badge-link {
  display: block;
  line-height: 0;
}

.cert-badge-link img {
  width: 120px;
  height: auto;
  filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.35));
  transition: filter var(--transition), transform var(--transition);
}

.cert-badge-item:hover .cert-badge-link img {
  filter: drop-shadow(0 12px 28px rgba(245, 158, 66, 0.25));
  transform: scale(1.04);
}

.cert-badge-name {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text);
  line-height: 1.35;
  max-width: 150px;
  margin-top: 0.75rem;
}

.certs-source {
  text-align: center;
  margin-top: 2rem;
}

.certs-source a {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--accent);
  text-decoration: none;
}

.certs-source a:hover {
  text-decoration: underline;
}

.exp-group-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  color: var(--text);
}

.exp-group-title:not(:first-of-type) {
  margin-top: 3rem;
}

.timeline-role {
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 0.75rem;
}

.exp-bullets {
  list-style: none;
  padding: 0;
}

.exp-bullets li {
  color: var(--text-muted);
  font-size: 0.9rem;
  padding-left: 1rem;
  margin-bottom: 0.5rem;
  position: relative;
  line-height: 1.55;
}

.exp-bullets li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--accent);
}

.timeline-compact .timeline-content { padding: 1.25rem 1.5rem; }
.timeline-compact .timeline-item { margin-bottom: 1rem; }

.skills-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
}

.skills-card h3 {
  font-size: 1.1rem;
  margin-bottom: 1.25rem;
}

.skills-list {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}

.skills-list li {
  font-size: 0.925rem;
  color: var(--text-muted);
  padding-left: 1.25rem;
  position: relative;
}

.skills-list li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: var(--accent);
}

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

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.card:hover {
  transform: translateY(-4px);
  border-color: rgba(245, 158, 66, 0.3);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

.card-icon {
  font-size: 2rem;
  margin-bottom: 1rem;
}

.project-card h3 {
  font-size: 1.15rem;
  margin-bottom: 0.65rem;
}

.project-card p {
  color: var(--text-muted);
  font-size: 0.925rem;
  margin-bottom: 1.25rem;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.card-tags span {
  font-family: var(--mono);
  font-size: 0.72rem;
  padding: 0.25rem 0.65rem;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 999px;
}

/* Timeline */
.timeline {
  position: relative;
  padding-left: 2rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border);
}

.timeline-item {
  position: relative;
  margin-bottom: 2rem;
}

.timeline-marker {
  position: absolute;
  left: -2rem;
  top: 1.5rem;
  width: 12px;
  height: 12px;
  background: var(--accent);
  border-radius: 50%;
  transform: translateX(-5px);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.timeline-date {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--accent);
}

.timeline-content h3 {
  font-size: 1.15rem;
  margin: 0.35rem 0 0.25rem;
}

.timeline-org {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 0.65rem;
}

.timeline-content p:last-child {
  color: var(--text-muted);
  font-size: 0.925rem;
}

/* Certifications */
.cert-card { text-align: center; }

.cert-badge {
  width: 48px;
  height: 48px;
  margin: 0 auto 1rem;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.25rem;
}

.cert-card h3 { font-size: 1.05rem; margin-bottom: 0.35rem; }

.cert-issuer {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.cert-date {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--accent);
  margin-top: 0.5rem;
}

/* Contact */
.contact-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 3rem 2rem;
}

.contact-desc {
  color: var(--text-muted);
  max-width: 480px;
  margin: 0.75rem auto 0;
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  margin-top: 2rem;
}

.contact-link {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.85rem 1.5rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  text-decoration: none;
  font-size: 0.925rem;
  transition: border-color var(--transition), color var(--transition);
}

.contact-link:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.contact-link-icon { font-size: 1.1rem; }

/* Footer */
.footer {
  padding: 2rem 0;
  border-top: 1px solid var(--border);
}

.footer-inner {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* Responsive */
@media (max-width: 768px) {
  .nav-toggle { display: flex; }

  .nav-links {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: rgba(12, 15, 20, 0.97);
    backdrop-filter: blur(12px);
    flex-direction: column;
    padding: 1.5rem 2rem 2rem;
    gap: 0;
    border-bottom: 1px solid var(--border);
    transform: translateY(-120%);
    opacity: 0;
    pointer-events: none;
    transition: transform var(--transition), opacity var(--transition);
  }

  .nav-links.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .nav-links li { padding: 0.75rem 0; border-bottom: 1px solid var(--border); }
  .nav-links li:last-child { border-bottom: none; }

  .nav-toggle.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
  .nav-toggle.open span:nth-child(2) { opacity: 0; }
  .nav-toggle.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

  .about-grid { grid-template-columns: 1fr; }
  .hero-layout {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .hero-photo { order: -1; padding: 2rem 0 0; }
  .hero-photo-frame img { width: 200px; height: 200px; }
  .hero-cta { justify-content: center; }
  .hero-stats { justify-content: center; }
  .profile-card { flex-direction: column; text-align: center; }
  .profile-tags { justify-content: center; }
  .profile-links { justify-content: center; }
  .skills-list { grid-template-columns: 1fr; }
  .skills-grid { grid-template-columns: 1fr; }
  .certs-list { grid-template-columns: 1fr; }
  .cert-badges-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 1.25rem; }
  .hero-stats { gap: 2rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
