:root {
  --bg: #fafafa;
  --bg-elevated: #ffffff;
  --text: #1a1a1a;
  --text-muted: #5c5c5c;
  --border: #e8e8e8;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --timeline-line: #d4d4d4;
  --navbar-bg: rgba(250, 250, 250, 0.92);
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

body.dark-theme {
  --bg: #0f1419;
  --bg-elevated: #1a222c;
  --text: #f0f4f8;
  --text-muted: #9ca8b4;
  --border: #2d3748;
  --accent: #60a5fa;
  --accent-hover: #93c5fd;
  --timeline-line: #3d4f63;
  --navbar-bg: rgba(15, 20, 25, 0.92);
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  transition: background-color 0.25s ease, color 0.25s ease;
}

.navbar {
  background-color: var(--navbar-bg) !important;
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.navbar .nav-link {
  color: var(--text-muted) !important;
  font-weight: 500;
}

.navbar .nav-link:hover,
.navbar .nav-link:focus {
  color: var(--accent) !important;
}

.section-title {
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 1.5rem;
  color: var(--text);
}

.hero-section {
  position: relative;
  padding-top: 5.5rem;
  padding-bottom: 4rem;
  min-height: 85vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  isolation: isolate;
}

.hero-section::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("assets/images/fondo/FondoPorta.png");
  background-size: cover;
  background-position: center;
  opacity: 0.18;
  transform: scale(1.05);
  z-index: -2;
}

.hero-section::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top left, rgba(37, 99, 235, 0.22), transparent 55%);
  z-index: -1;
}

.hero-photo-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 2rem;
}

@media (min-width: 768px) {
  .hero-photo-wrap {
    justify-content: flex-start;
    margin-bottom: 0;
  }
}

.hero-photo {
  width: 220px;
  height: 220px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--border);
  box-shadow: var(--shadow);
}

.hero-greeting {
  color: var(--accent);
  font-weight: 600;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.5rem;
}

.hero-title {
  font-size: clamp(1.85rem, 4vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 1rem;
}

.hero-lead {
  color: var(--text-muted);
  font-size: 1.1rem;
  line-height: 1.65;
  max-width: 32rem;
  margin-bottom: 1.75rem;
}

.btn-accent {
  background-color: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
  padding: 0.55rem 1.25rem;
}

.btn-accent:hover {
  background-color: var(--accent-hover);
  border-color: var(--accent-hover);
  color: #fff;
}

.btn-outline-theme {
  border: 2px solid var(--border);
  color: var(--text);
  background: transparent;
  font-weight: 600;
}

.btn-outline-theme:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: transparent;
}

section {
  padding-top: 4rem;
  padding-bottom: 4rem;
  border-top: 1px solid var(--border);
}

.about-text {
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1.75;
  max-width: 42rem;
}

/* Contacto (enlaces rápidos) */
.section-contact .contact-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  max-width: 40rem;
}

@media (min-width: 576px) {
  .section-contact .contact-grid {
    grid-template-columns: repeat(4, 1fr);
    max-width: none;
  }
}

.contact-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem 0.75rem;
  text-align: center;
  text-decoration: none;
  color: var(--text);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  transition: border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
  word-break: break-word;
}

.contact-item:hover {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: var(--shadow);
}

.contact-item .contact-icon {
  font-size: 1.5rem;
  line-height: 1;
}

.contact-item span {
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.25;
}

@media (max-width: 575.98px) {
  .contact-item span {
    font-size: 0.75rem;
  }
}

/* Contacto: Tel + WhatsApp juntos */
.contact-item-callgroup {
  cursor: pointer;
}

.contact-item-callgroup .contact-callgroup-icons {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.9rem;
}

.contact-item-callgroup .contact-callgroup-label {
  margin-top: 0.1rem;
}

/* Habilidades */
.section-skills .skills-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 1.25rem 1rem;
  box-shadow: var(--shadow);
  height: 100%;
}

.skills-heading {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 1rem;
  color: var(--text);
  line-height: 1.3;
}

.skills-heading-icon {
  flex-shrink: 0;
  font-size: 1.25rem;
  color: var(--accent);
}

.skills-list {
  margin: 0;
  padding: 0;
}

.skills-list li {
  position: relative;
  padding-left: 0.95rem;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.skills-list li:last-child {
  margin-bottom: 0;
}

.skills-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.7;
}

/* Timeline */
.timeline {
  position: relative;
  padding-left: 0;
  list-style: none;
  max-width: 48rem;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 11px;
  top: 0.35rem;
  bottom: 0.35rem;
  width: 2px;
  background: var(--timeline-line);
}

.timeline-item {
  position: relative;
  padding-left: 2.75rem;
  padding-bottom: 2rem;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 0.35rem;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 3px solid var(--accent);
  z-index: 1;
}

.timeline-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 1.25rem 1.35rem;
  box-shadow: var(--shadow);
}

.timeline-role {
  font-weight: 600;
  font-size: 1.05rem;
  margin-bottom: 0.25rem;
}

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

.timeline-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0;
}

/* Experiencia: dos columnas + listas de logros */
.experience-cols .experience-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 1.25rem 1.35rem;
  box-shadow: var(--shadow);
}

.experience-cols .timeline-role {
  font-size: 1.05rem;
}

.experience-duties li {
  position: relative;
  padding-left: 1.1rem;
  margin-bottom: 0.45rem;
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.experience-duties li:last-child {
  margin-bottom: 0;
}

.experience-duties li::before {
  content: "–";
  position: absolute;
  left: 0;
  font-weight: 600;
  color: var(--accent);
}

@media (max-width: 575.98px) {
  .timeline::before {
    left: 8px;
  }

  .timeline-item {
    padding-left: 2.25rem;
  }

  .timeline-item::before {
    left: 1px;
    width: 14px;
    height: 14px;
  }
}

/* Cards */
.card.project-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  height: 100%;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card.project-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

body.dark-theme .card.project-card:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.project-card .card-img-top {
  height: 160px;
  object-fit: cover;
}

.badge-tech {
  font-weight: 500;
  font-size: 0.7rem;
  padding: 0.35em 0.55em;
  background: var(--border);
  color: var(--text);
}

body.dark-theme .badge-tech {
  background: #2d3748;
  color: var(--text-muted);
}

.footer-bar {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.btn-lang,
.btn-theme-toggle {
  font-size: 0.875rem;
  border: 1px solid var(--border);
  color: var(--text);
  background: var(--bg-elevated);
}

.btn-theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  line-height: 1;
}

.btn-theme-toggle .bi {
  font-size: 1.1rem;
}

.btn-lang:hover,
.btn-theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-lang.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.navbar-toggler {
  border-color: var(--border);
}

body.dark-theme .navbar-toggler-icon {
  filter: invert(1);
}
