/* ============================================
   Oscar Baldenebro - Resume
   Modern single-page resume
   ============================================ */

/* --- Reset & Base --- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --color-bg: #0a0a0b;
  --color-surface: #111113;
  --color-surface-hover: #1a1a1d;
  --color-border: #222225;
  --color-text: #e4e4e7;
  --color-text-muted: #8b8b94;
  --color-text-dim: #5a5a63;
  --color-accent: #3b82f6;
  --color-accent-soft: rgba(59, 130, 246, 0.12);
  --color-accent-glow: rgba(59, 130, 246, 0.25);
  --color-green: #22c55e;
  --sidebar-width: 260px;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: #60a5fa;
}

/* --- Sidebar --- */
#sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
  z-index: 100;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease;
}

.sidebar-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 2rem 1.25rem;
}

.profile {
  text-align: center;
  margin-bottom: 2.5rem;
}

.profile-img {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--color-border);
  margin-bottom: 1rem;
}

.profile-name {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--color-text);
}

.nav-links {
  list-style: none;
  flex: 1;
}

.nav-links li {
  margin-bottom: 0.25rem;
}

.nav-links a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.85rem;
  border-radius: 8px;
  color: var(--color-text-muted);
  font-size: 0.875rem;
  font-weight: 450;
  transition: all 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
  background: var(--color-accent-soft);
  color: var(--color-accent);
}

.nav-links a i {
  width: 18px;
  text-align: center;
  font-size: 0.8rem;
}

.sidebar-social {
  display: flex;
  justify-content: center;
  gap: 1rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border);
}

.sidebar-social a {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: var(--color-text-muted);
  transition: all 0.2s;
  font-size: 0.95rem;
}

.sidebar-social a:hover {
  background: var(--color-accent-soft);
  color: var(--color-accent);
}

/* --- Mobile Header --- */
#mobile-header {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  z-index: 90;
  align-items: center;
  padding: 0 1rem;
  gap: 0.75rem;
}

.menu-toggle {
  background: none;
  border: none;
  color: var(--color-text);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.4rem;
}

.mobile-name {
  font-weight: 600;
  font-size: 0.95rem;
}

/* --- Main Content --- */
#content {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
}

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

.section:last-child {
  padding-bottom: 4rem;
}

.section-content {
  width: 100%;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 2.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.section-number {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-accent);
  background: var(--color-accent-soft);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}

/* --- Hero / About --- */
.hero-name {
  font-size: 4rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.05;
  margin-bottom: 0.75rem;
}

.hero-name .accent {
  color: var(--color-accent);
}

.hero-title {
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--color-text-muted);
  margin-bottom: 0.25rem;
}

.hero-tagline {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--color-text-dim);
  margin-bottom: 2rem;
  letter-spacing: 0.02em;
}

.hero-summary {
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--color-text-muted);
  max-width: 680px;
  margin-bottom: 2rem;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.hero-meta span {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.hero-meta i {
  color: var(--color-accent);
  font-size: 0.8rem;
}

/* --- Expertise Grid --- */
.expertise-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1rem;
}

.expertise-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 1.5rem;
  transition: all 0.2s;
}

.expertise-card:hover {
  border-color: var(--color-accent);
  box-shadow: 0 0 20px var(--color-accent-soft);
}

.expertise-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--color-accent-soft);
  color: var(--color-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
}

.expertise-card h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  letter-spacing: -0.01em;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tag {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  font-size: 0.75rem;
  color: var(--color-text-muted);
  font-weight: 450;
}

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

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

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

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

.timeline-marker {
  position: absolute;
  left: -2rem;
  top: 6px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--color-border);
  border: 2px solid var(--color-bg);
}

.timeline-item.current .timeline-marker {
  background: var(--color-green);
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.4);
}

.timeline-content {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 1.75rem;
  transition: border-color 0.2s;
}

.timeline-content:hover {
  border-color: rgba(255, 255, 255, 0.08);
}

.timeline-item.current .timeline-content {
  border-color: rgba(34, 197, 94, 0.2);
}

.job-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.job-title {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.job-subtitle {
  font-size: 0.85rem;
  color: var(--color-accent);
  font-weight: 500;
  margin-top: 0.15rem;
}

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

.job-company i {
  margin-right: 0.25rem;
  font-size: 0.75rem;
}

.job-date {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--color-text-dim);
  white-space: nowrap;
  padding-top: 0.2rem;
}

.job-date i {
  margin-right: 0.25rem;
}

.job-highlights {
  list-style: none;
  margin-bottom: 1.25rem;
}

.job-highlights li {
  position: relative;
  padding-left: 1.25rem;
  font-size: 0.875rem;
  color: var(--color-text-muted);
  line-height: 1.65;
  margin-bottom: 0.5rem;
}

.job-highlights li::before {
  content: '›';
  position: absolute;
  left: 0;
  color: var(--color-accent);
  font-weight: 700;
  font-size: 1rem;
}

.job-highlights strong {
  color: var(--color-text);
  font-weight: 600;
}

.job-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.tag-sm {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--color-accent);
  background: var(--color-accent-soft);
  border-radius: 4px;
}

/* Earlier roles */
.timeline-item.earlier .timeline-content {
  background: transparent;
  border: 1px dashed var(--color-border);
  padding: 1.25rem 1.75rem;
}

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

.earlier-roles li {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin-bottom: 0.4rem;
}

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

/* --- Education --- */
.education-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1rem;
}

.education-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 1.75rem;
  transition: border-color 0.2s;
}

.education-card:hover {
  border-color: rgba(255, 255, 255, 0.08);
}

.education-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--color-accent-soft);
  color: var(--color-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
}

.education-card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  letter-spacing: -0.01em;
}

.education-school {
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

/* --- Certifications --- */
.cert-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.cert-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 1.5rem;
  transition: border-color 0.2s;
}

.cert-card:hover {
  border-color: rgba(255, 255, 255, 0.08);
}

.cert-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--color-accent-soft);
  color: var(--color-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
}

.cert-card h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

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

/* --- Footer --- */
.site-footer {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--color-border);
  text-align: center;
}

.site-footer p {
  font-size: 0.8rem;
  color: var(--color-text-dim);
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--color-bg);
}

::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-dim);
}

/* --- Responsive --- */

/* Prevent horizontal overflow at any size */
html, body {
  overflow-x: hidden;
}

/* Tablet */
@media (max-width: 1024px) {
  #sidebar {
    transform: translateX(-100%);
  }

  #sidebar.open {
    transform: translateX(0);
  }

  #mobile-header {
    display: flex;
  }

  #content {
    margin-left: 0;
    padding-top: 56px;
  }

  .section {
    padding: 3rem 2rem 2rem;
    min-height: auto;
  }

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

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

/* Mobile */
@media (max-width: 640px) {
  .section {
    padding: 2.5rem 1.25rem 2rem;
  }

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

  .hero-meta {
    flex-direction: column;
    gap: 0.75rem;
  }

  .job-header {
    flex-direction: column;
    gap: 0.25rem;
  }

  .expertise-grid,
  .education-grid,
  .cert-grid {
    grid-template-columns: 1fr;
  }
}

/* Small mobile */
@media (max-width: 480px) {
  .hero-name {
    font-size: 2rem;
  }

  .section {
    padding: 2rem 1rem 1.5rem;
  }
}

/* Overlay for mobile */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 95;
}

.sidebar-overlay.active {
  display: block;
}
