/* ==========================================================================
   VARIABLES / TOKENS DE DISEÑO — versión oscura de alto contraste
   ========================================================================== */
:root {
  --bg-main: #05080F;
  --bg-panel: #0B111D;
  --bg-panel-alt: #101828;
  --navy: #0E2145;
  --navy-light: #1B3868;
  --gold: #D6A34E;
  --gold-bright: #F3C878;
  --text-primary: #EDEFF4;
  --text-secondary: #9BA6BA;
  --border-line: rgba(255, 255, 255, 0.10);
  --white: #FFFFFF;

  --font-head: 'Sora', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, sans-serif;

  --radius: 6px;
  --shadow-soft: 0 4px 18px rgba(0, 0, 0, 0.45);
  --shadow-strong: 0 16px 42px rgba(0, 0, 0, 0.6);
  --glow-gold: 0 0 0 1px rgba(214, 163, 78, 0.35), 0 0 26px rgba(214, 163, 78, 0.18);
  --transition: 220ms ease;
}

/* ==========================================================================
   RESET BÁSICO
   ========================================================================== */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text-secondary);
  background: var(--bg-main);
  line-height: 1.6;
}
h1, h2, h3 { font-family: var(--font-head); color: var(--white); margin: 0 0 .5rem; letter-spacing: -0.01em; }
p { margin: 0 0 1rem; }
ul { padding-left: 1.2rem; }
a { color: var(--gold-bright); }
img, svg { max-width: 100%; display: block; }

:focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

/* ==========================================================================
   MODAL DE CONFIDENCIALIDAD
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 5, 10, 0.82);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1.25rem;
  opacity: 1;
  transition: opacity var(--transition);
}
.modal-overlay.is-hidden {
  opacity: 0;
  pointer-events: none;
}
.modal-box {
  background: var(--bg-panel);
  max-width: 460px;
  width: 100%;
  padding: 2rem 2rem 1.75rem;
  border-radius: var(--radius);
  border-top: 3px solid var(--gold);
  border: 1px solid var(--border-line);
  border-top: 3px solid var(--gold);
  box-shadow: var(--shadow-strong);
  text-align: left;
  animation: modalRise 340ms ease;
}
@keyframes modalRise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
.modal-seal { color: var(--gold); margin-bottom: .75rem; }
.modal-box h2 { font-size: 1.3rem; }
.modal-box p { font-size: .93rem; color: var(--text-secondary); }
.modal-note {
  border-left: 3px solid var(--gold);
  padding-left: .75rem;
  font-style: italic;
  color: var(--text-primary);
}
.btn-primary {
  background: var(--gold);
  color: #1A1204;
  border: none;
  padding: .7rem 1.4rem;
  font-family: var(--font-body);
  font-size: .95rem;
  font-weight: 700;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
}
.btn-primary:hover { background: var(--gold-bright); transform: translateY(-1px); box-shadow: var(--glow-gold); }

/* ==========================================================================
   HERO / BANNER
   ========================================================================== */
.hero {
  position: relative;
  background: radial-gradient(circle at 12% 18%, var(--navy-light), var(--bg-main) 68%);
  overflow: hidden;
  padding: 3.5rem 1.5rem;
  border-bottom: 1px solid var(--border-line);
}
.hero-texture {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(214,163,78,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(214,163,78,0.06) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(circle at 20% 30%, black, transparent 70%);
}
.hero-inner {
  position: relative;
  max-width: 980px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 2.5rem;
  flex-wrap: wrap;
}
.hero-photo { flex: 0 0 auto; }
.photo-frame {
  width: 148px;
  height: 148px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid var(--gold);
  box-shadow: var(--glow-gold), var(--shadow-strong);
  animation: fadeIn 700ms ease;
}
.photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
}
.hero-info { flex: 1 1 320px; color: var(--white); animation: fadeIn 700ms ease 120ms both; }
.hero-eyebrow {
  color: var(--gold-bright);
  font-size: .82rem;
  letter-spacing: .04em;
  margin-bottom: .3rem;
}
.hero-name {
  color: var(--white);
  font-size: clamp(1.6rem, 3.4vw, 2.3rem);
  margin-bottom: .25rem;
}
.hero-role {
  color: var(--gold-bright);
  font-size: 1.05rem;
  font-weight: 500;
  margin-bottom: .6rem;
}
.hero-tagline {
  max-width: 46ch;
  color: rgba(237,239,244,0.82);
  font-size: .95rem;
}
.hero-contact {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.6rem;
}
.hero-contact li {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .88rem;
  color: var(--text-primary);
}
.hero-contact a { color: var(--white); text-decoration: none; }
.hero-contact a:hover { color: var(--gold-bright); text-decoration: underline; }
.hero-contact svg { color: var(--gold); flex-shrink: 0; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   INTRODUCCIÓN
   ========================================================================== */
.intro {
  background: var(--bg-panel);
  padding: 2.75rem 1.5rem;
  border-bottom: 1px solid var(--border-line);
}
.intro-inner {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  gap: 1.25rem;
}
.intro-rule {
  flex: 0 0 3px;
  background: var(--gold);
  border-radius: 2px;
  box-shadow: var(--glow-gold);
}
.intro-text {
  font-size: 1.02rem;
  color: var(--text-primary);
  margin: 0;
}

/* ==========================================================================
   TABS
   ========================================================================== */
.tabs-section {
  max-width: 980px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
  background: var(--bg-main);
}
.tabs-nav {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  border-bottom: 1px solid var(--border-line);
  margin-bottom: 2rem;
}
.tab-btn {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: .7rem .3rem;
  margin-right: 1rem;
  font-family: var(--font-body);
  font-size: .92rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition);
}
.tab-btn:hover { color: var(--gold-bright); }
.tab-btn.is-active {
  color: var(--gold-bright);
  border-bottom-color: var(--gold);
}

.tabs-panels { position: relative; }
.tab-panel {
  display: none;
}
.tab-panel.is-active {
  display: block;
  animation: panelIn 320ms ease;
}
@keyframes panelIn {
  from { opacity: 0; transform: translateX(10px); }
  to   { opacity: 1; transform: translateX(0); }
}
.tab-panel h2 {
  font-size: 1.5rem;
  border-bottom: 1px solid var(--border-line);
  padding-bottom: .6rem;
  margin-bottom: 1.25rem;
}
.section-subhead {
  font-size: 1.05rem;
  margin-top: 1.75rem;
}

.btn-back {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  margin-top: 2rem;
  background: none;
  border: 1px solid var(--border-line);
  color: var(--gold-bright);
  padding: .55rem 1.1rem;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: .88rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), box-shadow var(--transition);
}
.btn-back:hover { background: var(--bg-panel-alt); border-color: var(--gold); box-shadow: var(--glow-gold); }

/* ---- Timeline (Experiencia) ---- */
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline-item {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 1.25rem;
  padding: 1.1rem 0;
  border-top: 1px solid var(--border-line);
}
.timeline-item:first-child { border-top: none; }
.timeline-date {
  font-size: .82rem;
  font-weight: 700;
  color: var(--gold-bright);
  padding-top: .2rem;
}
.timeline-content h3 { font-size: 1.05rem; margin-bottom: .15rem; color: var(--text-primary); }
.timeline-org { font-size: .88rem; color: var(--gold); font-weight: 600; margin-bottom: .5rem; }
.timeline-content ul { margin: 0; padding-left: 1.1rem; font-size: .93rem; color: var(--text-secondary); }
.timeline-content li { margin-bottom: .25rem; }

/* ---- Educación ---- */
.edu-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-line);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius);
  padding: 1.1rem 1.4rem;
  margin-bottom: 1.5rem;
}
.edu-card h3 { color: var(--text-primary); }
.edu-date { font-size: .85rem; color: var(--text-secondary); margin: 0; }
.plain-list { font-size: .95rem; color: var(--text-secondary); }
.plain-list li { margin-bottom: .4rem; }
.plain-list strong { color: var(--text-primary); }
.highlight-note {
  margin-top: 1.25rem;
  font-weight: 700;
  color: var(--gold-bright);
  font-size: .95rem;
}

/* ---- Habilidades ---- */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem 1.75rem;
  margin-bottom: 1rem;
}
.skill-item span { font-size: .9rem; font-weight: 600; color: var(--text-primary); }
.skill-bar {
  height: 6px;
  background: var(--bg-panel-alt);
  border: 1px solid var(--border-line);
  border-radius: 4px;
  margin-top: .4rem;
  overflow: hidden;
}
.skill-bar span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--gold), var(--gold-bright));
  border-radius: 4px;
  transition: width 900ms ease;
}
.skill-bar span.filled { width: var(--level); }

/* ---- Proyectos ---- */
.project-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-line);
  border-radius: var(--radius);
  padding: 1.2rem 1.4rem;
  margin-bottom: 1rem;
  transition: box-shadow var(--transition), border-color var(--transition);
}
.project-card:hover { box-shadow: var(--glow-gold); border-color: var(--gold); }
.project-card h3 { font-size: 1.02rem; margin-bottom: .2rem; color: var(--text-primary); }
.project-card p:last-child { margin-bottom: 0; font-size: .93rem; color: var(--text-secondary); }

/* ---- Certificaciones ---- */
.medal-list { list-style: none; padding: 0; }
.medal-list li {
  display: flex;
  gap: .75rem;
  align-items: flex-start;
  padding: .75rem 0;
  border-top: 1px solid var(--border-line);
}
.medal-list li:first-child { border-top: none; }
.medal-list li strong { color: var(--text-primary); }
.medal-icon { color: var(--gold-bright); font-size: 1.1rem; line-height: 1.4; text-shadow: 0 0 12px rgba(243,200,120,0.5); }
.medal-meta { display: block; font-size: .85rem; color: var(--text-secondary); margin-top: .1rem; }

/* ---- Idiomas ---- */
.lang-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
}
.lang-item h3 { font-size: 1rem; margin-bottom: .5rem; color: var(--text-primary); }
.lang-level { font-size: .85rem; color: var(--gold-bright); display: block; margin-top: .35rem; }

/* ---- Contacto ---- */
.contact-list { list-style: none; padding: 0; margin-top: 1.25rem; }
.contact-list li {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .6rem 0;
  border-top: 1px solid var(--border-line);
  font-size: .95rem;
  color: var(--text-primary);
}
.contact-list li:first-child { border-top: none; }
.contact-list svg { color: var(--gold); flex-shrink: 0; }
.contact-list a { text-decoration: none; }
.contact-list a:hover { text-decoration: underline; }

/* ==========================================================================
   FOOTER
   ========================================================================== */
.site-footer {
  background: #030509;
  color: var(--text-secondary);
  text-align: center;
  padding: 1.5rem;
  font-size: .82rem;
  border-top: 1px solid var(--border-line);
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 640px) {
  .hero-inner { flex-direction: column; text-align: center; }
  .hero-contact { justify-content: center; }
  .intro-inner { flex-direction: column; }
  .intro-rule { width: 40px; height: 3px; flex: none; }
  .timeline-item { grid-template-columns: 1fr; }
  .timeline-date { padding-top: 0; }
  .tabs-nav { gap: .2rem; }
  .tab-btn { margin-right: .6rem; font-size: .85rem; }
}
