/* ============================================================
   FELIX DELGADO-FERRO — Academic Personal Website
   Fonts: DM Serif Display + DM Sans
   Palette: Navy / Slate / Amber accent
============================================================ */

/* ---- Variables ---- */
:root {
  --navy:         #0f2340;
  --navy-mid:     #1a3a5c;
  --navy-light:   #2356a0;
  --accent:       #c8860a;
  --accent-bg:    rgba(200,134,10,0.08);
  --bg:           #f7f8fa;
  --surface:      #ffffff;
  --border:       #dde3ed;
  --text:         #1c2333;
  --text-muted:   #64748b;
  --navbar-h:     62px;
  --content-w:    800px;
  --radius:       7px;
  --shadow:       0 1px 4px rgba(0,0,0,0.08);
  --shadow-md:    0 4px 18px rgba(0,0,0,0.10);
  --ease:         0.22s ease;
}

/* Dark mode por defecto desde head.html */
html[style*="color-scheme: dark"] body {
  background: #0d1117;
  color: #cdd5e0;
}

/* Dark mode aplicado desde <html> para evitar flash en cualquier página */
html.dark-mode body {
  background: var(--bg);
  color: var(--text);
}

/* Dark mode */
:root.dark-mode-pre,
body.dark-mode, html.dark-mode body {
  --navy:         #0c1a2e;
  --navy-mid:     #112240;
  --navy-light:   #3a6fd8;
  --accent:       #e8a020;
  --accent-bg:    rgba(232,160,32,0.09);
  --bg:           #0d1117;
  --surface:      #161c27;
  --border:       #2a3347;
  --text:         #cdd5e0;
  --text-muted:   #7c8fa8;
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.72;
  transition: background var(--ease), color var(--ease);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--navy-light); text-decoration: none; transition: color var(--ease); }
a:hover { color: var(--accent); }

h1, h2, h3, h4 {
  font-family: 'DM Serif Display', Georgia, serif;
  color: var(--navy);
  line-height: 1.25;
  transition: color var(--ease);
}
body.dark-mode h1, html.dark-mode h1,
body.dark-mode h2,
body.dark-mode h3,
body.dark-mode h4 { color: #e2e8f5; }

h1 { font-size: clamp(1.75rem, 4vw, 2.35rem); margin-bottom: 0.6rem; }
h2 { font-size: clamp(1.15rem, 2.5vw, 1.5rem); margin-bottom: 0.5rem; }
h3 { font-size: 1.05rem; }

p { margin-bottom: 1rem; }
ul { padding-left: 1.4rem; margin-bottom: 1rem; }
ul li { margin-bottom: 0.35rem; }
hr { border: none; border-top: 1px solid var(--border); margin: 2.5rem 0; transition: border-color var(--ease); }

/* ============================================================
   NAVBAR (horizontal, top)
============================================================ */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--navbar-h);
  background: var(--navy);
  z-index: 1000;
  transition: background var(--ease);
  box-shadow: 0 2px 12px rgba(0,0,0,0.18);
}
body.dark-mode .navbar, html.dark-mode .navbar { background: #0c1a2e; }

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0 1.5rem;
}

.nav-brand {
  font-family: 'DM Serif Display', serif;
  font-size: 1.05rem;
  color: #ffffff !important;
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: 0.01em;
}
.nav-brand:hover { color: var(--accent) !important; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  flex: 1;
  justify-content: flex-end;
}

.nav-links a {
  color: rgba(255,255,255,0.7);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.4rem 0.75rem;
  border-radius: 5px;
  transition: all var(--ease);
  white-space: nowrap;
}

.nav-links a:hover {
  color: #ffffff;
  background: rgba(255,255,255,0.08);
}

.nav-links a.active {
  color: var(--accent);
  background: rgba(200,134,10,0.12);
}
body.dark-mode .nav-links a.active {
  color: #f0b429;
  background: rgba(240,180,41,0.1);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

/* Dark mode toggle button */
.dm-btn {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 5px;
  color: rgba(255,255,255,0.7);
  cursor: pointer;
  font-size: 0.9rem;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--ease);
  line-height: 1;
}
.dm-btn:hover { background: rgba(255,255,255,0.14); color: #fff; }

/* Hamburger — hidden on desktop */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px;
}
.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: rgba(255,255,255,0.8);
  border-radius: 2px;
  transition: all var(--ease);
}

/* Mobile dropdown */
.nav-mobile {
  display: none;
  flex-direction: column;
  background: var(--navy-mid);
  padding: 0.5rem 0;
  border-top: 1px solid rgba(255,255,255,0.07);
  position: fixed;
  top: var(--navbar-h);
  left: 0; right: 0;
  z-index: 999;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.nav-mobile.open { display: flex; }

.nav-mobile a {
  color: rgba(255,255,255,0.75);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.75rem 1.5rem;
  border-left: 3px solid transparent;
  transition: all var(--ease);
}
.nav-mobile a:hover { color: #fff; background: rgba(255,255,255,0.05); }
.nav-mobile a.active { color: var(--accent); border-left-color: var(--accent); }

/* ============================================================
   MAIN CONTENT
============================================================ */
.main-content {
  max-width: var(--content-w);
  margin: 0 auto;
  padding: calc(var(--navbar-h) + 3rem) 2rem 4rem;
}

.main-home {
  max-width: 100%;
  padding: 0;
  margin: 0;
}

/* ============================================================
   HERO / HOME
============================================================ */
.home-hero {
  margin-bottom: 3rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--border);
}

.home-hero h1 { margin-bottom: 0.5rem; }

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.85rem 0 1.2rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.22rem 0.7rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
  box-shadow: var(--shadow);
}
.badge i { font-size: 0.7rem; color: var(--accent); }

/* ============================================================
   SECTION LABEL
============================================================ */
.section-label {
  font-size: 0.7rem;
  font-family: 'DM Sans', sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin-bottom: 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.home-section { margin-bottom: 2.5rem; }

/* ============================================================
   TIMELINE (education / experience)
============================================================ */
.timeline { list-style: none; padding: 0; margin: 0; }

.timeline li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 1.1rem;
}
.timeline li::before {
  content: '';
  position: absolute;
  left: 0; top: 0.5rem;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-bg);
}
.timeline li::after {
  content: '';
  position: absolute;
  left: 3.5px; top: 1.1rem;
  width: 1px;
  height: calc(100% + 0.3rem);
  background: var(--border);
}
.timeline li:last-child::after { display: none; }

.tl-degree { font-weight: 600; font-size: 0.92rem; color: var(--text); }
.tl-meta { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.1rem; }

/* ============================================================
   INTEREST TAGS
============================================================ */
.interests-list {
  list-style: none;
  padding: 0; margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.interests-list li {
  margin: 0;
  padding: 0.3rem 0.85rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 0.82rem;
  color: var(--text-muted);
  transition: all var(--ease);
  cursor: default;
}
.interests-list li:hover {
  border-color: var(--accent);
  color: var(--navy);
  background: var(--accent-bg);
}
body.dark-mode .interests-list li:hover { color: #f0b429; }

/* ============================================================
   PUBLICATION CARDS
============================================================ */
.pub-year-group { margin-bottom: 2rem; }

.publication-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--navy-mid);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  margin-bottom: 0.7rem;
  box-shadow: var(--shadow);
  transition: all var(--ease);
}
.publication-card:hover {
  border-left-color: var(--accent);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.pub-title {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.45;
  margin-bottom: 0.3rem;
}
.pub-authors {
  font-size: 0.81rem;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 0.3rem;
}
.pub-venue {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.pub-quartile {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.07rem 0.4rem;
  border-radius: 3px;
  background: rgba(200,134,10,0.1);
  color: var(--accent);
  border: 1px solid rgba(200,134,10,0.25);
  font-style: normal;
}
body.dark-mode .pub-quartile, html.dark-mode .pub-quartile{
  background: rgba(240,180,41,0.12);
  color: #f0b429;
  border-color: rgba(240,180,41,0.3);
}

.pub-if {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-style: normal;
}

.conf-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.07rem 0.4rem;
  border-radius: 3px;
  background: rgba(60,100,180,0.08);
  color: #3a6fd8;
  border: 1px solid rgba(60,100,180,0.2);
}
body.dark-mode .conf-badge {
  background: rgba(100,140,220,0.1);
  color: #7eaaf5;
  border-color: rgba(100,140,220,0.25);
}

.pub-links {
  margin-top: 0.5rem;
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.pub-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.17rem 0.55rem;
  font-size: 0.73rem;
  font-weight: 500;
  border-radius: 4px;
  background: var(--navy-mid);
  color: #fff;
  transition: all var(--ease);
}
.pub-link-btn:hover { background: var(--accent); color: #fff; }

/* ============================================================
   FILTER BAR
============================================================ */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
.filter-bar label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
}
.filter-bar select {
  padding: 0.38rem 0.75rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  transition: border-color var(--ease);
}
.filter-bar select:focus { outline: none; border-color: var(--navy-light); }

/* ============================================================
   PROJECT LIST
============================================================ */
.project-list { list-style: none; padding: 0; margin: 0 0 1rem; }
.project-list li {
  padding: 0.6rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-bottom: 0.45rem;
  font-size: 0.9rem;
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  transition: all var(--ease);
}
.project-list li::before {
  content: '›';
  color: var(--accent);
  font-weight: 700;
  font-size: 1.1rem;
  line-height: 1.3;
  flex-shrink: 0;
}
.project-list li:hover { border-color: var(--navy-light); box-shadow: var(--shadow); }

/* ============================================================
   CONTACT GRID
============================================================ */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.1rem;
  margin-bottom: 2rem;
}
.contact-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem;
  box-shadow: var(--shadow);
}
.card-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--accent);
  margin-bottom: 0.5rem;
}
.contact-card p { margin: 0; font-size: 0.9rem; }

.social-links-contact {
  list-style: none;
  padding: 0; margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}
.social-links-contact li a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.42rem 1rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.84rem;
  font-weight: 500;
  background: var(--surface);
  color: var(--text);
  transition: all var(--ease);
  box-shadow: var(--shadow);
}
.social-links-contact li a:hover {
  border-color: var(--accent);
  background: var(--accent-bg);
  color: var(--navy);
}
body.dark-mode .social-links-contact li a:hover { color: #f0b429; }
.social-links-contact li a i { color: var(--accent); }

/* ============================================================
   FOOTER
============================================================ */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 2rem;
  transition: border-color var(--ease);
}
.footer-inner {
  max-width: var(--content-w);
  margin: 0 auto;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.footer-sep { opacity: 0.4; }
.footer-social { display: flex; gap: 0.5rem; }
.footer-social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px; height: 26px;
  border-radius: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  transition: all var(--ease);
}
.footer-social a:hover { border-color: var(--accent); color: var(--accent); }

/* ============================================================
   FADE-IN ANIMATIONS
============================================================ */
.fade-in {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}
.fade-in.visible { opacity: 1; transform: none; }

/* ============================================================
   RESPONSIVE — MOBILE
============================================================ */
@media (max-width: 820px) {
  .nav-links { display: none; }
  .hamburger { display: flex; }

  .main-content {
    padding: calc(var(--navbar-h) + 1.5rem) 1.25rem 3rem;
  }

  .contact-grid { grid-template-columns: 1fr; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 480px) {
  h1 { font-size: 1.6rem; }
  .hero-meta { gap: 0.4rem; }
  .pub-venue { flex-direction: column; align-items: flex-start; }
}


/* ============================================================
   HERO SECTION
============================================================ */
.hero-section {
  min-height: 100vh;
  width: 100vw;
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
  background: var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 1.5rem;
}

.hero-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
}

.hero-avatar {
  width: 220px;
  height: 220px;
  border-radius: 50%;
  overflow: hidden;
  margin: 0 auto 1.25rem;
  border: 3px solid rgba(255,255,255,0.15);
  box-shadow: 0 4px 24px rgba(0,0,0,0.3);
}

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

body.dark-mode .hero-section {
  background: #0a1220;
}

.hero-inner {
  max-width: 760px;
  width: 100%;
  text-align: center;
  position: relative;
  z-index: 1;
}

.hero-greeting {
  font-size: 1.1rem;
  color: rgba(255,255,255,0.55);
  margin-bottom: 0.25rem;
  letter-spacing: 0.04em;
}

.hero-name {
  font-family: 'DM Serif Display', serif;
  font-size: clamp(1.8rem, 5vw, 2.8rem);
  color: #ffffff;
  margin-bottom: 0.6rem;
  line-height: 1.1;
}

.hero-typewriter {
  font-size: clamp(1rem, 2.5vw, 1.3rem);
  color: var(--accent);
  margin-bottom: 2.5rem;
  min-height: 2rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.typewriter-cursor {
  animation: blink 0.9s step-end infinite;
  color: var(--accent);
}

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

.hero-social {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  margin-bottom: 3rem;
  flex-wrap: wrap;
}

.hero-social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.05);
  color: rgba(255,255,255,0.65);
  font-size: 1rem;
  transition: all var(--ease);
}

.hero-social a:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(200,134,10,0.12);
  transform: translateY(-2px);
}

.hero-scroll-hint {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.3);
  font-size: 1.1rem;
  animation: bounce 2s ease-in-out infinite;
  transition: color var(--ease);
}
.hero-scroll-hint:hover { color: rgba(255,255,255,0.7); }

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(6px); }
}

/* ============================================================
   ABOUT SECTION
============================================================ */
.about-section {
  width: 100%;
  padding: 4rem 0;
  background: var(--bg);
  transition: background var(--ease);
  box-sizing: border-box;
}

.about-inner {
  max-width: 760px;
  margin: 0 auto;
  width: 100%;
  padding: 0 2rem;
}

.about-photo {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid var(--border);
  box-shadow: var(--shadow-md);
  flex-shrink: 0;
}

.about-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}

.about-text h2 {
  margin-bottom: 0.2rem;
}

.about-role {
  font-size: 0.95rem;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 1.2rem;
}

.about-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.5rem;
}

.about-links a {
  padding: 0.35rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 0.83rem;
  font-weight: 500;
  color: var(--text);
  background: var(--surface);
  transition: all var(--ease);
  box-shadow: var(--shadow);
}

.about-links a:hover {
  border-color: var(--accent);
  color: var(--navy);
  background: var(--accent-bg);
}
body.dark-mode .about-links a:hover { color: var(--accent); }

@media (max-width: 640px) {
  .about-inner {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .about-photo {
    margin: 0 auto;
  }
  .about-text { text-align: center; }
  .about-links { justify-content: center; }
}


/* Navbar transparente en home — se fusiona con el hero */
body.page-home .navbar {
  background: transparent;
  box-shadow: none;
}

body.page-home .navbar:hover {
  background: rgba(15, 35, 64, 0.6);
  backdrop-filter: blur(8px);
}

/* Fix section-label en todas las páginas */
.home-section,
.pub-year-group,
.about-text,
.cv-section,
.fade-in {
  overflow: visible;
}


/* ============================================================
   PROJECT CARDS (expandibles)
============================================================ */
.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--navy-mid);
  border-radius: var(--radius);
  margin-bottom: 0.6rem;
  transition: all var(--ease);
}

.project-card:hover {
  border-left-color: var(--accent);
  box-shadow: var(--shadow-md);
}

.project-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.1rem;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: background var(--ease);
}

.project-header:hover {
  background: var(--accent-bg);
}

.project-header-left {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  flex: 1;
  flex-wrap: wrap;
}

.project-acronym {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--accent);
  white-space: nowrap;
  flex-shrink: 0;
}

.project-title-short {
  font-size: 0.85rem;
  color: var(--text);
  line-height: 1.4;
}

.project-toggle-icon {
  color: var(--text-muted);
  font-size: 0.75rem;
  flex-shrink: 0;
  transition: transform var(--ease);
}

.project-header.open .project-toggle-icon {
  transform: rotate(180deg);
}

.project-body {
  display: none;
  padding: 0.75rem 1.1rem 1rem;
  border-top: 1px solid var(--border);
}

.project-body.open {
  display: block;
}

.project-detail {
  display: flex;
  gap: 0.6rem;
  font-size: 0.84rem;
  color: var(--text);
  margin-bottom: 0.35rem;
  flex-wrap: wrap;
}

.detail-label {
  font-weight: 600;
  color: var(--text-muted);
  min-width: 120px;
  flex-shrink: 0;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.pdf-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.8rem;
  color: var(--navy-light);
  transition: color var(--ease);
}
.pdf-btn:hover { color: var(--accent); }
.pdf-btn i { color: #e53e3e; }

.pdf-placeholder {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-style: italic;
}

/* ============================================================
   PUBLICATIONS TIMELINE
============================================================ */
.pub-section {
  margin-bottom: 2rem;
}

.pub-timeline {
  position: relative;
  padding-left: 2.5rem;
}

/* Línea vertical naranja */
.pub-timeline::before {
  content: '';
  position: absolute;
  left: 0.6rem;
  top: 0.6rem;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--accent), rgba(200,134,10,0.1));
}

.pub-year-marker {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 1.5rem 0 0.75rem;
  position: relative;
}

.pub-year-dot {
  position: absolute;
  left: -2.5rem;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg);
  box-shadow: 0 0 0 2px var(--accent);
  flex-shrink: 0;
}

.pub-year-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* ============================================================
   TRAINING CARDS (no expandibles)
============================================================ */
.training-grid {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.training-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--navy-mid);
  border-radius: var(--radius);
  padding: 0.85rem 1.1rem;
  transition: all var(--ease);
  box-shadow: var(--shadow);
}

.training-card:hover {
  border-left-color: var(--accent);
  box-shadow: var(--shadow-md);
}

.training-title {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
  margin-bottom: 0.4rem;
}

.training-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.training-meta i {
  color: var(--accent);
  margin-right: 0.25rem;
}

@media (max-width: 480px) {
  .training-meta { flex-direction: column; gap: 0.3rem; }
}

/* ============================================================
   CURRICULUM VITAE
============================================================ */

/* Hero personal data */
.cv-hero {
  display: flex;
  flex-direction: row;
  gap: 2.5rem;
  align-items: center;
  margin-bottom: 0.5rem;
}

.cv-hero-photo {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid rgba(255,255,255,0.15);
  box-shadow: 0 4px 24px rgba(0,0,0,0.25);
  flex-shrink: 0;
  display: block;
  background: var(--navy);
}

.cv-hero-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}

.cv-hero-info h1 { margin-bottom: 0.2rem; }

.cv-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0.1rem;
}

.cv-personal-grid {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin: 1rem 0;
}

.cv-personal-item {
  display: flex;
  gap: 0.75rem;
  font-size: 0.88rem;
  align-items: baseline;
}

.cv-personal-label {
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  min-width: 120px;
  flex-shrink: 0;
}
.cv-personal-label i { color: var(--accent); margin-right: 0.3rem; }

.cv-profiles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.cv-profile-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text);
  background: var(--surface);
  transition: all var(--ease);
  box-shadow: var(--shadow);
}
.cv-profile-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-bg);
}
.cv-profile-btn i { color: var(--accent); font-size: 0.85rem; }

/* Education cards */
.cv-edu-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--navy-mid);
  border-radius: var(--radius);
  padding: 1.1rem 1.3rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow);
  transition: all var(--ease);
}
.cv-edu-card:hover {
  border-left-color: var(--accent);
  box-shadow: var(--shadow-md);
}

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

.cv-edu-degree {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
}

.cv-edu-institution {
  font-size: 0.83rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
}

.cv-edu-dates {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.cv-edu-meta {
  font-size: 0.83rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.cv-edu-thesis {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 0.75rem 1rem;
  margin-top: 0.5rem;
}

.cv-edu-thesis-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--accent);
  margin-bottom: 0.3rem;
}

.cv-edu-thesis-title {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text);
  margin-bottom: 0.3rem;
}

.cv-edu-thesis-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
}

.cv-edu-thesis-sup {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-style: italic;
}

/* Experience & volunteering cards */
.cv-exp-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--navy-mid);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  margin-bottom: 0.6rem;
  box-shadow: var(--shadow);
  transition: all var(--ease);
}
.cv-exp-card:hover {
  border-left-color: var(--accent);
  box-shadow: var(--shadow-md);
}

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

.cv-exp-role {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--text);
}

.cv-exp-employer {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
}

.cv-exp-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.25rem;
  flex-shrink: 0;
}

.cv-exp-type {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.1rem 0.5rem;
  border-radius: 3px;
  background: var(--accent-bg);
  color: var(--accent);
  border: 1px solid rgba(200,134,10,0.25);
}

.cv-exp-dates {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
}

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

/* Languages */
.lang-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
}

.lang-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  box-shadow: var(--shadow);
  transition: all var(--ease);
}
.lang-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
}

.lang-name {
  font-weight: 700;
  font-size: 1rem;
  font-family: 'DM Serif Display', serif;
  color: var(--text);
  margin-bottom: 0.2rem;
}

.lang-level {
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 0.2rem;
}

.lang-cert {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-style: italic;
}

/* Responsive CV */
@media (max-width: 640px) {
  .cv-hero {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .cv-hero-photo {
    margin: 0 auto;
  }
  .cv-personal-item {
    flex-direction: column;
    gap: 0.1rem;
  }
  .cv-personal-label { min-width: unset; }
  .cv-profiles { justify-content: center; }
  .cv-exp-header { flex-direction: column; }
  .cv-exp-meta { align-items: flex-start; }
  .cv-edu-header { flex-direction: column; }
}