/* ── CSS Custom Properties ── */
/* Variables CSS para colores, tipografía y transiciones, incluyendo modo oscuro */
:root {
  --color-bg:       #f5f0e8;
  --color-surface:  #ede8df;
  --color-card:     #ffffff;
  --color-border:   #ddd8ce;
  --color-accent:   #2563eb;
  --color-accent2:  #d97706;
  --color-text:     #1c1917;
  --color-muted:    #78716c;
  --color-soft:     #f9f6f1;
  --font-display:   'DM Serif Display', serif;
  --font-body:      'DM Sans', sans-serif;
  --radius:         12px;
  --transition:     0.26s cubic-bezier(.4,0,.2,1);
  --max-width:      880px;
  --shadow-sm:      0 1px 4px rgba(0,0,0,.07), 0 2px 8px rgba(0,0,0,.05);
  --shadow-md:      0 4px 16px rgba(0,0,0,.08), 0 2px 6px rgba(0,0,0,.05);

  /* Dark mode variables */
  --color-bg-dark:       #1a1a1a;
  --color-surface-dark:  #2a2a2a;
  --color-card-dark:     #333333;
  --color-border-dark:   #444444;
  --color-text-dark:     #e0e0e0;
  --color-muted-dark:    #b0b0b0;
  --color-soft-dark:     #222222;
}

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

body {
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-weight: 300;
  line-height: 1.7;
  min-height: 100vh;
}

/* Dark mode styles */
.dark-mode {
  --color-bg: var(--color-bg-dark);
  --color-surface: var(--color-surface-dark);
  --color-card: var(--color-card-dark);
  --color-border: var(--color-border-dark);
  --color-text: var(--color-text-dark);
  --color-muted: var(--color-muted-dark);
  --color-soft: var(--color-soft-dark);
}

/* Fondo cálido: textura suave de papel con manchas de acuarela */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(ellipse 80% 60% at 10% 20%, rgba(251,191,36,.12) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 90% 80%, rgba(37,99,235,.07) 0%, transparent 55%),
    radial-gradient(ellipse 50% 40% at 50% 50%, rgba(217,119,6,.06) 0%, transparent 60%),
    url("data:image/svg+xml,%3Csvg width='300' height='300' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.025'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
}

/* ── Layout ── */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

section { padding: 80px 0; }
section + section { border-top: 1px solid var(--color-border); }

/* ── Nav ── */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(245,240,232,.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--color-border);
  box-shadow: 0 1px 8px rgba(0,0,0,.05);
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-logo {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--color-accent);
  text-decoration: none;
  margin-right: auto;
}

.nav-links { display: flex; gap: 24px; list-style: none; }

.nav-links a {
  color: var(--color-muted);
  text-decoration: none;
  font-size: .78rem;
  font-weight: 500;
  letter-spacing: .06em;
  text-transform: uppercase;
  transition: color var(--transition);
}

.nav-links a:hover { color: var(--color-text); }

.btn-theme {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  color: var(--color-muted);
  transition: color var(--transition);
}

.btn-theme:hover { color: var(--color-text); }

/* ── Botón PDF ── */
.btn-pdf {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--color-accent);
  color: #fff;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: .76rem;
  letter-spacing: .04em;
  padding: 9px 16px;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  white-space: nowrap;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
  box-shadow: 0 2px 10px rgba(37,99,235,.25);
}

.btn-pdf:hover {
  background: #1d4ed8;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(37,99,235,.35);
}

/* ── Hero ── */
#inicio {
  padding: 96px 0 80px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 56px;
  align-items: center;
}

.hero-eyebrow {
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.hero-eyebrow::before {
  content: '';
  width: 28px;
  height: 2px;
  background: var(--color-accent);
  border-radius: 2px;
  flex-shrink: 0;
}

h1 {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 6vw, 4.2rem);
  line-height: 1.08;
  color: var(--color-text);
  margin-bottom: 12px;
}

h1 em {
  font-style: italic;
  color: var(--color-accent);
}

.hero-subtitle {
  font-size: .97rem;
  font-weight: 400;
  color: var(--color-muted);
  margin-bottom: 28px;
}

/* ── Social links (hero) ── */
.social-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

.social-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-body);
  font-size: .8rem;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 50px;
  text-decoration: none;
  transition: transform var(--transition), box-shadow var(--transition);
}

.social-btn {
  background: #0a66c2;
  color: #fff;
  box-shadow: 0 2px 8px rgba(10,102,194,.2);
}

.social-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(10,102,194,.3);
}

.social-btn--ghost {
  background: var(--color-text);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
}

.social-btn--ghost:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(0,0,0,.22);
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--color-accent2);
  color: #fff;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: .88rem;
  padding: 13px 26px;
  border-radius: 50px;
  text-decoration: none;
  letter-spacing: .02em;
  transition: transform var(--transition), box-shadow var(--transition);
  box-shadow: 0 3px 12px rgba(217,119,6,.25);
}

.hero-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 22px rgba(217,119,6,.35);
}

.hero-cta svg { transition: transform var(--transition); }
.hero-cta:hover svg { transform: translateX(4px); }

/* Profile photo */
.profile-wrap { position: relative; flex-shrink: 0; }

.profile-img {
  width: 220px;
  height: 220px;
  border-radius: var(--radius);
  object-fit: cover;
  display: block;
  border: 3px solid var(--color-border);
  box-shadow: var(--shadow-md);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.profile-img:hover {
  border-color: var(--color-accent);
  box-shadow: 0 6px 24px rgba(37,99,235,.18);
}

.profile-badge {
  position: absolute;
  bottom: -12px;
  right: -12px;
  background: #4CAF50;
  color: #fff;
  font-size: .66rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 7px 13px;
  border-radius: 50px;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(76,175,80,.3);
}

/* ── Secciones ── */
.section-label {
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 10px;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 4vw, 2.5rem);
  line-height: 1.14;
  margin-bottom: 44px;
  color: var(--color-text);
}

/* ── Sobre mí ── */
.about-text {
  max-width: 600px;
  font-size: 1.04rem;
  color: #57534e;
  line-height: 1.82;
}

.about-text strong { color: var(--color-text); font-weight: 500; }

.stats-row { display: flex; gap: 36px; margin-top: 44px; flex-wrap: wrap; }

.stat-number {
  font-family: var(--font-display);
  font-size: 2.2rem;
  color: var(--color-accent);
  line-height: 1;
  margin-bottom: 4px;
}

.stat-label {
  font-size: .74rem;
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: .08em;
}

/* ── Experiencia ── */
.exp-list { display: flex; flex-direction: column; gap: 18px; }

.exp-card {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 30px;
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 22px;
  align-items: start;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}

.exp-card:hover {
  border-color: var(--color-accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.exp-logo {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  background: var(--color-soft);
  border: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

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

.exp-role {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--color-text);
}

.exp-period {
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--color-muted);
  background: var(--color-soft);
  border: 1px solid var(--color-border);
  padding: 4px 11px;
  border-radius: 50px;
  white-space: nowrap;
}

.exp-company {
  font-size: .88rem;
  color: var(--color-accent2);
  margin-bottom: 10px;
  font-weight: 600;
}

.exp-company a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color var(--transition);
}

.exp-company a:hover { border-color: var(--color-accent2); }

.exp-desc {
  color: #78716c;
  font-size: .92rem;
  line-height: 1.72;
  margin-bottom: 14px;
}

.exp-email {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: .8rem;
  color: var(--color-accent);
  text-decoration: none;
  border: 1px solid rgba(37,99,235,.25);
  padding: 6px 13px;
  border-radius: 50px;
  transition: background var(--transition), border-color var(--transition);
}

.exp-email:hover {
  background: rgba(37,99,235,.06);
  border-color: var(--color-accent);
}

/* ── Formación ── */
.edu-subheading {
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-top: 48px;
  margin-bottom: 16px;
}

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

.edu-item {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  padding: 18px 22px;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.edu-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--color-accent);
  margin-top: 7px;
  flex-shrink: 0;
}

.edu-year {
  font-size: .72rem;
  font-weight: 600;
  color: var(--color-muted);
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-bottom: 3px;
}

.edu-name {
  font-weight: 500;
  color: var(--color-text);
  font-size: .95rem;
  margin-bottom: 2px;
}

.edu-inst { font-size: .84rem; color: var(--color-muted); }

/* ── Habilidades ── */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.skill-card {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 26px 22px;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}

.skill-card:hover {
  border-color: var(--color-accent);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.skill-icon {
  font-size: 1.9rem;
  display: block;
  margin-bottom: 12px;
}

.skill-name {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--color-text);
  margin-bottom: 5px;
}

.skill-level {
  font-size: .7rem;
  color: var(--color-accent);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .1em;
  margin-bottom: 10px;
}

.skill-desc {
  font-size: .86rem;
  color: var(--color-muted);
  line-height: 1.65;
  margin-bottom: 16px;
}

.skill-bar {
  height: 4px;
  background: var(--color-border);
  border-radius: 2px;
  overflow: hidden;
}

.skill-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-accent), var(--color-accent2));
  border-radius: 2px;
  width: 0;
  transition: width 1.2s cubic-bezier(.4,0,.2,1);
}

/* ── Contacto ── */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: start;
}

.contact-info-text {
  color: #78716c;
  font-size: .94rem;
  line-height: 1.78;
  margin-bottom: 24px;
}

.contact-detail {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  font-size: .88rem;
  color: #57534e;
}

.contact-detail a {
  color: var(--color-accent);
  text-decoration: none;
  transition: opacity var(--transition);
}

.contact-detail a:hover { opacity: .75; }

.contact-icon {
  width: 34px;
  height: 34px;
  background: var(--color-soft);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .95rem;
  flex-shrink: 0;
}

form { display: flex; flex-direction: column; gap: 14px; }

.form-group { display: flex; flex-direction: column; gap: 5px; }

label {
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--color-muted);
}

input, textarea {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: 9px;
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: .92rem;
  padding: 13px 16px;
  outline: none;
  resize: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

input:focus, textarea:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}

input::placeholder, textarea::placeholder { color: #c4b9b0; }

textarea { min-height: 120px; }

.btn-submit {
  align-self: flex-start;
  background: var(--color-accent);
  color: #fff;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: .88rem;
  padding: 13px 26px;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  letter-spacing: .02em;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
  box-shadow: 0 2px 10px rgba(37,99,235,.25);
}

.btn-submit:hover {
  background: #1d4ed8;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(37,99,235,.3);
}

.form-success {
  display: none;
  background: rgba(37,99,235,.06);
  border: 1px solid rgba(37,99,235,.2);
  color: var(--color-accent);
  padding: 13px 18px;
  border-radius: 9px;
  font-size: .88rem;
  font-weight: 500;
}

/* ── Botón volver arriba ── */
#btn-top {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 200;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--color-accent);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity var(--transition), transform var(--transition), box-shadow var(--transition);
  box-shadow: 0 4px 14px rgba(37,99,235,.3);
}

#btn-top.visible {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0);
}

#btn-top:hover { box-shadow: 0 6px 22px rgba(37,99,235,.42); }

/* ── Footer ── */
footer {
  padding: 32px 0;
  border-top: 1px solid var(--color-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.footer-text { font-size: .8rem; color: var(--color-muted); }
.footer-accent { color: var(--color-accent); font-weight: 500; }

.footer-socials { display: flex; align-items: center; gap: 8px; }

.footer-social {
  font-size: .8rem;
  color: var(--color-muted);
  text-decoration: none;
  transition: color var(--transition);
}

.footer-social:hover { color: var(--color-accent); }
.footer-sep { color: var(--color-border); }

/* ── Fade-in ── */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .62s ease, transform .62s ease;
}

.fade-in.visible { opacity: 1; transform: translateY(0); }

/* ── Print / PDF ── */
@media print {
  nav, #btn-top, .btn-pdf, .hero-cta { display: none !important; }
  body { background: #fff !important; }
  body::before { display: none; }
  .container { max-width: 100%; }
  section { padding: 32px 0; }
  .exp-card, .edu-item, .skill-card { box-shadow: none; border-color: #ddd; }
  .fade-in { opacity: 1 !important; transform: none !important; }
  .skill-fill { transition: none; }
  a { color: inherit !important; text-decoration: none; }
}

/* ── Responsive ── */
@media (max-width: 680px) {
  #inicio { grid-template-columns: 1fr; text-align: center; gap: 36px; }
  .profile-wrap { order: -1; margin: 0 auto; }
  .hero-eyebrow { justify-content: center; }
  .social-links { justify-content: center; }
  .skills-grid { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; gap: 36px; }
  .nav-links { display: none; }
  .stats-row { gap: 20px; }
  .btn-pdf span { display: none; }
}

@media (max-width: 860px) and (min-width: 681px) {
  .skills-grid { grid-template-columns: 1fr 1fr; }
}
