/* ===== DESIGN TOKENS ===== */
:root {
  --teal-dark: #0d2b3a;
  --teal-mid: #163c50;
  --teal-light: #1a4e68;
  --gold: #e8a020;
  --gold-light: #f0b840;
  --white: #ffffff;
  --off-white: #f4f6f8;
  --text-dark: #1a2535;
  --text-mid: #3d5166;
  --text-light: #6b8299;
  --ai-purple: #6c63ff;
  --ai-blue: #00d4ff;
  --ai-gradient: linear-gradient(135deg, #6c63ff 0%, #00d4ff 100%);
  --sidebar-width: 290px;
  --border-radius: 12px;
  --shadow: 0 4px 24px rgba(0,0,0,0.10);
  --shadow-hover: 0 8px 32px rgba(0,0,0,0.16);
}

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

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

body {
  font-family: 'Inter', sans-serif;
  background: var(--off-white);
  color: var(--text-dark);
  display: flex;
  min-height: 100vh;
}

a { color: var(--gold); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--gold-light); }
ul { list-style: none; }
p { line-height: 1.7; }
strong { font-weight: 600; }

/* ===== SIDEBAR ===== */
.sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  background: var(--teal-dark);
  color: var(--white);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  padding: 36px 24px 40px;
  display: flex;
  flex-direction: column;
  gap: 0;
  scrollbar-width: thin;
  scrollbar-color: var(--teal-light) transparent;
}

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--teal-light); border-radius: 4px; }

/* Photo */
.sidebar-photo {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 20px;
  position: relative;
}

.photo-ring {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  border: 4px solid var(--gold);
  padding: 4px;
  background: var(--teal-mid);
  overflow: hidden;
  box-shadow: 0 0 0 6px rgba(232,160,32,0.2), 0 8px 32px rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: pulse-ring 3s infinite ease-in-out;
}

@keyframes pulse-ring {
  0%, 100% { box-shadow: 0 0 0 6px rgba(232,160,32,0.2), 0 8px 32px rgba(0,0,0,0.4); }
  50% { box-shadow: 0 0 0 10px rgba(232,160,32,0.08), 0 8px 32px rgba(0,0,0,0.4); }
}

.photo-ring img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  filter: grayscale(20%);
}

.photo-initials {
  display: none;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  font-family: 'Outfit', sans-serif;
  font-size: 3rem;
  font-weight: 800;
  color: var(--gold);
  background: var(--teal-mid);
}

.sidebar-badge {
  margin-top: 10px;
  background: var(--gold);
  color: var(--teal-dark);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 4px 14px;
  border-radius: 20px;
}

/* Name in sidebar */
.sidebar-name {
  text-align: center;
  margin-bottom: 24px;
}

.sidebar-name h1 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0.02em;
}

.name-last { color: var(--gold); }

.sidebar-title {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.65);
  margin-top: 6px;
  min-height: 18px;
  font-style: italic;
  letter-spacing: 0.03em;
}

.sidebar-title::after {
  content: '|';
  animation: blink 1s step-end infinite;
  color: var(--gold);
}

@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

/* Sidebar sections */
.sidebar-section {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding: 20px 0;
}

.sidebar-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Outfit', sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 14px;
}

.sidebar-heading svg { width: 14px; height: 14px; flex-shrink: 0; }

/* Contact */
.contact-list { display: flex; flex-direction: column; gap: 10px; }

.contact-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.82rem;
  color: rgba(255,255,255,0.82);
  line-height: 1.4;
}

.contact-list li svg { width: 14px; height: 14px; flex-shrink: 0; margin-top: 2px; color: var(--gold); }
.contact-list a { color: rgba(255,255,255,0.82); font-size: 0.82rem; word-break: break-all; }
.contact-list a:hover { color: var(--gold); }

/* Languages */
.language-item { margin-bottom: 12px; }
.lang-header { display: flex; justify-content: space-between; font-size: 0.82rem; margin-bottom: 5px; }
.lang-name { color: rgba(255,255,255,0.9); }
.lang-level { color: var(--gold); font-size: 0.74rem; font-weight: 600; }
.lang-bar { background: rgba(255,255,255,0.1); border-radius: 4px; height: 5px; overflow: hidden; }
.lang-bar-fill { height: 100%; width: 0; background: var(--gold); border-radius: 4px; transition: width 1.4s ease; }

/* Education */
.edu-item { margin-bottom: 14px; }
.edu-degree { font-size: 0.82rem; font-weight: 600; color: var(--white); line-height: 1.4; }
.edu-sub { font-size: 0.77rem; color: rgba(255,255,255,0.65); font-style: italic; }
.edu-school { font-size: 0.77rem; color: var(--gold); margin-top: 2px; }
.edu-note { font-size: 0.72rem; color: rgba(255,255,255,0.45); margin-top: 2px; font-style: italic; }

/* References */
.ref-item { margin-bottom: 12px; }
.ref-name { font-size: 0.84rem; font-weight: 600; color: var(--white); }
.ref-company { font-size: 0.77rem; color: var(--gold); }
.ref-contact { font-size: 0.73rem; color: rgba(255,255,255,0.55); margin-top: 2px; line-height: 1.5; }

/* ===== MAIN CONTENT ===== */
.main-content {
  flex: 1;
  padding: 40px 44px;
  max-width: 820px;
  display: flex;
  flex-direction: column;
  gap: 36px;
}

/* ===== SECTIONS ===== */
.cv-section {
  background: var(--white);
  border-radius: var(--border-radius);
  padding: 32px 36px;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.cv-section.visible {
  opacity: 1;
  transform: translateY(0);
}

.section-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--off-white);
}

.section-header h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--teal-dark);
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-icon {
  width: 40px;
  height: 40px;
  background: var(--teal-dark);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.section-icon svg { width: 18px; height: 18px; color: var(--gold); }

/* ===== RESUMEN ===== */
.summary-text {
  color: var(--text-mid);
  font-size: 0.93rem;
  line-height: 1.8;
  margin-bottom: 12px;
}

.summary-text:last-child { margin-bottom: 0; }

/* ===== AI SECTION ===== */
.ai-section {
  background: linear-gradient(135deg, var(--teal-dark) 0%, #102030 100%);
  color: var(--white);
  border: 1px solid rgba(108,99,255,0.3);
  position: relative;
  overflow: hidden;
}

.ai-section::before {
  content: '';
  position: absolute;
  top: -80px; right: -80px;
  width: 280px; height: 280px;
  background: radial-gradient(circle, rgba(108,99,255,0.15) 0%, transparent 70%);
  pointer-events: none;
}

.ai-section::after {
  content: '';
  position: absolute;
  bottom: -60px; left: -60px;
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(0,212,255,0.1) 0%, transparent 70%);
  pointer-events: none;
}

.ai-section .section-header {
  border-bottom-color: rgba(255,255,255,0.1);
}

.ai-section .section-header h2 {
  color: var(--white);
}

.ai-icon {
  background: var(--ai-gradient) !important;
  box-shadow: 0 4px 16px rgba(108,99,255,0.4);
}

.ai-icon svg { color: var(--white) !important; }

.ai-badge {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  background: var(--ai-gradient);
  color: white;
  padding: 3px 10px;
  border-radius: 20px;
  vertical-align: middle;
}

/* AI Cards */
.ai-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

.ai-card {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  padding: 20px 18px;
  backdrop-filter: blur(10px);
  transition: transform 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
}

.ai-card:hover {
  transform: translateY(-4px);
  background: rgba(255,255,255,0.1);
  box-shadow: 0 12px 32px rgba(0,0,0,0.3);
}

.ai-card-icon { font-size: 1.8rem; margin-bottom: 10px; }

.ai-card h4 {
  font-family: 'Outfit', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--gold-light);
  margin-bottom: 8px;
}

.ai-card p {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.75);
  line-height: 1.6;
  margin-bottom: 12px;
}

.ai-card-tags { display: flex; flex-wrap: wrap; gap: 5px; }

.ai-card-tags span {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 3px 9px;
  border-radius: 20px;
  background: rgba(108,99,255,0.25);
  color: var(--ai-blue);
  border: 1px solid rgba(108,99,255,0.3);
}

/* Certifications */
.cert-title {
  font-family: 'Outfit', sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
  margin-bottom: 12px;
}

.cert-list { display: flex; flex-direction: column; gap: 10px; }

.cert-item {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  padding: 12px 16px;
}

.cert-icon { font-size: 1.2rem; flex-shrink: 0; }

.cert-name {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--white);
}

.cert-provider {
  font-size: 0.76rem;
  color: rgba(255,255,255,0.5);
  margin-top: 2px;
}

/* ===== SKILLS ===== */
.skills-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
}

.skill-group-title {
  font-family: 'Outfit', sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--teal-dark);
  margin-bottom: 14px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--gold);
  display: inline-block;
}

.skill-item { margin-bottom: 12px; }

.skill-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.83rem;
  color: var(--text-mid);
  margin-bottom: 5px;
}

.skill-pct { font-weight: 600; color: var(--text-light); font-size: 0.78rem; }

.skill-bar {
  background: var(--off-white);
  border-radius: 4px;
  height: 7px;
  overflow: hidden;
}

.skill-bar-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--teal-dark), var(--teal-light));
  border-radius: 4px;
  transition: width 1.4s ease;
}

.skill-bar-fill.ai-bar {
  background: var(--ai-gradient);
}

/* Soft skills */
.soft-skills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }

.soft-tag {
  font-size: 0.77rem;
  font-weight: 500;
  padding: 5px 12px;
  background: var(--off-white);
  color: var(--teal-dark);
  border-radius: 20px;
  border: 1px solid rgba(13,43,58,0.15);
  transition: background 0.2s, color 0.2s;
}

.soft-tag:hover {
  background: var(--teal-dark);
  color: var(--white);
}

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

.timeline-item {
  display: flex;
  gap: 20px;
  position: relative;
  padding-bottom: 32px;
}

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

.timeline-item:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 20px;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--gold), transparent);
}

.timeline-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--gold);
  border: 3px solid var(--white);
  box-shadow: 0 0 0 2px var(--gold);
  flex-shrink: 0;
  margin-top: 4px;
}

.timeline-content { flex: 1; }

.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 8px;
}

.timeline-role {
  font-family: 'Outfit', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--teal-dark);
}

.timeline-company {
  font-size: 0.85rem;
  color: var(--gold);
  font-weight: 600;
  margin-top: 2px;
}

.timeline-date {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--white);
  background: var(--teal-dark);
  padding: 4px 12px;
  border-radius: 20px;
  white-space: nowrap;
  flex-shrink: 0;
}

.timeline-desc {
  font-size: 0.87rem;
  color: var(--text-mid);
  margin-bottom: 10px;
  line-height: 1.6;
}

.client-logos {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.client-logos span {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 9px;
  background: rgba(13,43,58,0.07);
  color: var(--teal-dark);
  border-radius: 4px;
  letter-spacing: 0.05em;
}

.timeline-achievements {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.timeline-achievements li {
  font-size: 0.84rem;
  color: var(--text-mid);
  padding-left: 16px;
  position: relative;
  line-height: 1.5;
}

.timeline-achievements li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: var(--gold);
  font-size: 0.8rem;
}

/* ===== PROJECTS ===== */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.project-card {
  border: 1px solid rgba(13,43,58,0.1);
  border-radius: 10px;
  padding: 18px;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s;
  background: var(--white);
  position: relative;
  overflow: hidden;
}

.project-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--teal-dark), var(--gold));
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.project-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
  border-color: rgba(13,43,58,0.2);
}

.project-card:hover::before { transform: scaleX(1); }

.project-category {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gold);
  margin-bottom: 6px;
}

.project-card h4 {
  font-family: 'Outfit', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--teal-dark);
  margin-bottom: 8px;
}

.project-card p {
  font-size: 0.8rem;
  color: var(--text-light);
  line-height: 1.6;
  margin-bottom: 10px;
}

.project-link {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--teal-light);
  transition: color 0.2s;
}

.project-link:hover { color: var(--gold); }

/* ===== RESPONSIVE ===== */
@media (max-width: 960px) {
  body { flex-direction: column; }
  .sidebar {
    width: 100%;
    height: auto;
    position: relative;
    padding: 30px 24px;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 20px;
    align-items: flex-start;
  }
  .sidebar-photo { margin-bottom: 0; }
  .sidebar-name { text-align: left; }
  .sidebar-section { width: calc(50% - 10px); border-top: none; padding: 0; }
  .main-content { padding: 24px 20px; max-width: 100%; }
  .ai-cards { grid-template-columns: 1fr; }
  .skills-grid { grid-template-columns: 1fr; }
  .projects-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
  .sidebar-section { width: 100%; }
  .projects-grid { grid-template-columns: 1fr; }
  .timeline-header { flex-direction: column; }
  .main-content { padding: 16px; }
  .cv-section { padding: 22px 18px; }
}

/* ===== PRINT OPTIMIZATIONS ===== */
@media print {
  .sidebar { position: relative; height: auto; }
  body { background: white; }
  .cv-section { box-shadow: none; opacity: 1 !important; transform: none !important; }
}
