*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --cream: #f2ede6;
  --cream-dark: #e8e0d5;
  --white: #ffffff;
  --navy: #1a2f6e;
  --navy-light: #2d4499;
  --blue-accent: #2563eb;
  --text-dark: #0f1f3d;
  --text-mid: #4a5568;
  --text-light: #8a96a8;
  --tag-bg: #edf0f7;
  --card-shadow: 0 2px 16px rgba(0,0,0,0.07);
  --radius: 14px;
  --bg: #f2ede6; --bg-alt: #e8e0d5; --bg-card: #ffffff;
  --text: #0f1f3d; --text-secondary: #4a5568;
  --nav-bg: rgba(242,237,230,0.95); --border: rgba(0,0,0,0.06);
}
html { scroll-behavior: smooth; }
body { font-family: 'DM Sans', sans-serif; background: var(--cream); color: var(--text-dark); font-size: 16px; line-height: 1.6; padding-top: 64px; }

/* NAV */
nav { position: fixed; top: 0; left: 0; right: 0; z-index: 10001; background: var(--nav-bg); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); padding: 0 48px; height: 64px; }
.nav-inner { max-width: 1080px; margin: 0 auto; width: 100%; display: flex; align-items: center; justify-content: space-between; height: 100%; }
.nav-logo-link { display: flex; align-items: center; text-decoration: none; flex-shrink: 0; }
@media (min-width: 769px) { .nav-logo-link { margin-left: 60px; } }
.nav-logo { height: 36px; width: auto; object-fit: contain; display: block; }
.nav-links { display: flex; align-items: center; gap: 24px; }
.nav-links a { font-size: 0.9rem; font-weight: 400; color: var(--navy); text-decoration: none; transition: color .2s; white-space: nowrap; }
.nav-links a:hover { color: var(--navy-light); }
.nav-controls { display: flex; align-items: center; gap: 8px; justify-self: end; }
.btn-tour { position: relative; z-index: 10001; background: var(--navy); color: #fff; border: none; border-radius: 8px; padding: 6px 12px; font-size: 0.85rem; font-weight: 500; font-family: inherit; cursor: pointer; display: flex; align-items: center; gap: 4px; transition: background .2s; white-space: nowrap; }
.btn-tour:hover { background: var(--navy-light); }
.btn-toggle { background: transparent; color: var(--text-dark); border: 1.5px solid rgba(0,0,0,0.18); border-radius: 8px; padding: 6px 12px; font-size: 0.85rem; font-weight: 500; font-family: inherit; cursor: pointer; transition: border-color .2s; white-space: nowrap; }
.btn-toggle:hover { border-color: var(--navy); }
.nav-hamburger { display: none; background: transparent; color: var(--text-dark); border: 1.5px solid rgba(0,0,0,0.18); border-radius: 8px; padding: 6px 10px; font-size: 1.1rem; cursor: pointer; line-height: 1; }
.nav-mobile-dropdown { display: none; position: fixed; top: 56px; left: 0; right: 0; z-index: 9999; background: var(--nav-bg); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); padding: 8px 16px 16px; flex-direction: column; }
.nav-mobile-dropdown.open { display: flex; }
.nav-mobile-dropdown a { font-size: 0.9rem; font-weight: 400; color: var(--navy); text-decoration: none; padding: 10px 8px; border-radius: 6px; transition: background .2s; }
.nav-mobile-dropdown a:hover { background: rgba(0,0,0,0.04); }

/* SECTIONS */
section { padding: 96px 0; }
.container { max-width: 1080px; margin: 0 auto; padding: 0 48px; }

/* HERO */
#hero { padding: 80px 0 96px; background: var(--cream); }
.hero-inner { max-width: 1080px; margin: 0 auto; padding: 0 48px; display: grid; grid-template-columns: 1fr 380px; gap: 64px; align-items: center; }
.hero-label { font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--blue-accent); margin-bottom: 12px; }
.hero-name { font-family: 'Instrument Serif', serif; font-size: clamp(44px, 5vw, 64px); line-height: 1.08; color: var(--text-dark); margin-bottom: 12px; }
.hero-title { font-size: 18px; font-weight: 500; color: var(--blue-accent); margin-bottom: 24px; }
.hero-bio { font-size: 15.5px; color: var(--text-mid); line-height: 1.75; max-width: 520px; }
.hero-photo-wrap { border-radius: 20px; overflow: hidden; aspect-ratio: 4/5; box-shadow: 0 8px 40px rgba(0,0,0,0.12); }
.hero-photo-wrap img { width: 100%; height: 100%; object-fit: cover; object-position: top; }

/* EXPERIENCE */
#experience { background: var(--cream); }
.section-label { font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--blue-accent); margin-bottom: 8px; }
.section-title { font-family: 'Instrument Serif', serif; font-size: clamp(32px, 4vw, 48px); color: var(--text-dark); margin-bottom: 48px; line-height: 1.1; }
.exp-company { background: var(--white); border-radius: var(--radius); box-shadow: var(--card-shadow); overflow: hidden; margin-bottom: 24px; }
.exp-company-header { padding: 28px 32px 20px; border-bottom: 1px solid #f0f0f0; display: flex; align-items: center; gap: 14px; }
.company-icon { width: 40px; height: 40px; border-radius: 8px; background: #edf2ff; display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
.company-name { font-size: 18px; font-weight: 700; color: var(--text-dark); }
.company-period { font-size: 13px; color: var(--text-light); margin-top: 2px; }
.exp-role { padding: 24px 32px; border-bottom: 1px solid #f7f7f7; }
.exp-role:last-child { border-bottom: none; }
.role-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 4px; }
.role-title { font-size: 16px; font-weight: 600; color: var(--blue-accent); }
.role-date { font-size: 12px; color: var(--text-light); display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.role-desc { font-size: 14.5px; color: var(--text-mid); line-height: 1.7; margin: 10px 0 14px; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag { background: var(--tag-bg); color: var(--text-mid); font-size: 12px; font-weight: 500; padding: 5px 12px; border-radius: 20px; }

/* SKILLS */
#skills { background: var(--cream); }
.skills-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; margin-top: 48px; }
.skill-card { background: var(--white); border-radius: var(--radius); box-shadow: var(--card-shadow); padding: 32px; }
.skill-icon { width: 48px; height: 48px; border-radius: 10px; background: #edf2ff; display: flex; align-items: center; justify-content: center; font-size: 22px; margin-bottom: 20px; }
.skill-card h3 { font-size: 17px; font-weight: 700; color: var(--text-dark); margin-bottom: 16px; }
.skill-list { list-style: none; }
.skill-list li { font-size: 14px; color: var(--text-mid); padding: 5px 0; display: flex; align-items: center; gap: 8px; }
.skill-list li::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #c7d2f0; flex-shrink: 0; }

/* SOBRE MI */
#sobre-mi { background: var(--cream-dark); }
.sobre-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 48px; }
.sobre-card { background: var(--white); border-radius: var(--radius); box-shadow: var(--card-shadow); padding: 32px; }
.sobre-card h3 { font-size: 15px; font-weight: 700; color: var(--text-dark); margin-bottom: 16px; display: flex; align-items: center; gap: 10px; }
.sobre-card h3 span.card-icon { font-size: 20px; }
.sobre-card p { font-size: 14.5px; color: var(--text-mid); line-height: 1.75; margin-bottom: 12px; }
.sobre-card p:last-child { margin-bottom: 0; }
.edu-item { margin-bottom: 18px; }
.edu-item:last-child { margin-bottom: 0; }
.edu-school { font-size: 14px; font-weight: 600; color: var(--text-dark); }
.edu-degree { font-size: 13.5px; color: var(--blue-accent); font-weight: 500; }
.edu-year { font-size: 12px; color: var(--text-light); margin-bottom: 4px; }
.edu-desc { font-size: 13.5px; color: var(--text-mid); line-height: 1.65; }
.cert-section-label { font-size: 13px; color: var(--blue-accent); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 10px; margin-top: 20px; }
.cert-item { font-size: 13.5px; color: var(--text-mid); padding: 6px 0; border-bottom: 1px solid #f3f3f3; display: flex; align-items: center; gap: 8px; }
.cert-item:last-child { border-bottom: none; }
.cert-item::before { content: '✓'; color: var(--blue-accent); font-weight: 700; font-size: 12px; }
.hobby-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.hobby-tag { background: #edf2ff; color: var(--navy); font-size: 12.5px; font-weight: 500; padding: 6px 14px; border-radius: 20px; }

/* CONTACT */
#contact { background: var(--cream-dark); text-align: center; }
.contact-title { font-family: 'Instrument Serif', serif; font-size: clamp(36px, 5vw, 60px); color: var(--text-dark); margin-bottom: 16px; }
.contact-sub { font-size: 16px; color: var(--text-mid); max-width: 460px; margin: 0 auto 40px; }
.contact-buttons { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; }
.btn-contact { display: inline-flex; align-items: center; gap: 8px; padding: 14px 26px; border-radius: 10px; font-size: 15px; font-weight: 500; font-family: inherit; text-decoration: none; cursor: pointer; border: none; transition: all .2s; }
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-light); }
.btn-secondary { background: var(--white); color: var(--text-dark); border: 1.5px solid #dde1ea; }
.btn-secondary:hover { border-color: var(--navy); color: var(--navy); }
.btn-disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }

/* FOOTER */
footer { background: #1a2f6e; padding: 24px 48px; display: flex; justify-content: space-between; align-items: center; }
footer p { font-size: 0.8rem; color: rgba(255,255,255,0.7); margin: 0; line-height: 1; }
footer a { display: flex; align-items: center; flex-shrink: 0; }
footer img { height: 32px; width: auto; object-fit: contain; display: block; }

/* ANIMATIONS */
.fade-in { opacity: 0; transform: translateY(24px); transition: opacity .6s ease, transform .6s ease; }
.fade-in.visible { opacity: 1; transform: translateY(0); }

#scroll-progress {
  display: none;
  position: fixed;
  top: 56px;
  left: 0;
  width: 100%;
  height: 3px;
  z-index: 999;
  background: rgba(0,0,0,0.1);
}
#scroll-progress-fill { height: 100%; width: 0%; background: #1a2f6e; }

@media (max-width: 768px) {
  body { padding-top: 56px; }
  nav { padding: 0 16px; height: 56px; }
  .nav-logo-link { margin-left: 32px; }
  .nav-links { display: none; }
  .nav-hamburger { display: block; }
  #scroll-progress { display: block; }
  #hero { padding-top: 16px; }
  .hero-inner { grid-template-columns: 1fr; gap: 32px; }
  .hero-photo-wrap { max-width: 260px; margin: 0 auto; }
  .container { padding: 0 20px; }
  .skills-grid, .sobre-grid { grid-template-columns: 1fr; }
  section { padding: 64px 0; }
  footer { padding: 20px 16px; flex-direction: column; gap: 12px; text-align: center; }
}

/* DARK MODE */
[data-theme="dark"] {
  --bg: #0f1d3a; --bg-alt: #0c1830; --bg-card: #1a2f6e;
  --text: #f2ede6; --text-secondary: #93c5fd; --navy: #93c5fd;
  --nav-bg: rgba(15,29,58,0.95); --border: rgba(255,255,255,0.08);
  --cream: #0f1d3a; --cream-dark: #0c1830; --white: #162448;
  --text-dark: #f2ede6; --text-mid: #a0b4d6; --text-light: rgba(160,180,214,0.6);
  --tag-bg: rgba(147,197,253,0.1); --card-shadow: 0 2px 20px rgba(0,0,0,0.4);
  --blue-accent: #60a5fa;
}
[data-theme="dark"] body { background: var(--bg); }
[data-theme="dark"] nav { background: var(--nav-bg); border-color: var(--border); }
[data-theme="dark"] .nav-mobile-dropdown { background: var(--nav-bg); border-color: var(--border); }
[data-theme="dark"] .nav-mobile-dropdown a:hover { background: rgba(255,255,255,0.06); }
[data-theme="dark"] .btn-toggle { border-color: rgba(255,255,255,0.2); color: #f2ede6; }
[data-theme="dark"] .nav-hamburger { border-color: rgba(255,255,255,0.2); color: #f2ede6; }
[data-theme="dark"] .btn-tour { background: #93c5fd; color: #0f1d3a; }
[data-theme="dark"] .btn-tour:hover { background: #bfdbfe; }
[data-theme="dark"] .btn-primary { background: #93c5fd; color: #0f1d3a; }
[data-theme="dark"] .btn-primary:hover { background: #bfdbfe; }
[data-theme="dark"] .exp-company-header { border-color: rgba(255,255,255,0.07); }
[data-theme="dark"] .exp-role { border-color: rgba(255,255,255,0.04); }
[data-theme="dark"] .cert-item { border-color: rgba(255,255,255,0.08); }
[data-theme="dark"] .skill-icon, [data-theme="dark"] .company-icon,
[data-theme="dark"] .msg-avatar { background: rgba(147,197,253,0.1); }
[data-theme="dark"] .skill-list li::before { background: rgba(147,197,253,0.3); }
[data-theme="dark"] .btn-secondary { background: rgba(255,255,255,0.05); border-color: rgba(255,255,255,0.15); color: #f2ede6; }
[data-theme="dark"] .btn-secondary:hover { border-color: #93c5fd; color: #93c5fd; }
[data-theme="dark"] footer { background: #0a1628; }

/* TOUR GUIDE */
#tour-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.45); z-index: 9000; display: none; }
#tour-tooltip { position: fixed; z-index: 10000; left: 50%; transform: translateX(-50%); bottom: 20px; width: 90%; max-width: 380px; background: #fff; border-radius: 16px; padding: 24px; box-shadow: 0 8px 48px rgba(0,0,0,0.22); display: none; }
.tour-counter { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--blue-accent); margin-bottom: 8px; }
.tour-title { font-family: 'Instrument Serif', serif; font-size: 20px; color: var(--text-dark); margin-bottom: 8px; }
.tour-desc { font-size: 14px; color: var(--text-mid); line-height: 1.65; margin-bottom: 20px; }
.tour-actions { display: flex; justify-content: space-between; align-items: center; }
.btn-tour-exit { background: transparent; border: 1.5px solid #dde1ea; color: var(--text-mid); border-radius: 8px; padding: 8px 16px; font-size: 13px; font-family: inherit; cursor: pointer; transition: border-color .2s, color .2s; }
.btn-tour-exit:hover { border-color: var(--navy); color: var(--navy); }
.btn-tour-next { background: var(--navy); color: #fff; border: none; border-radius: 8px; padding: 8px 22px; font-size: 13px; font-weight: 600; font-family: inherit; cursor: pointer; transition: background .2s; }
.btn-tour-next:hover { background: var(--navy-light); }
[data-theme="dark"] #tour-tooltip { background: #162448; }
[data-theme="dark"] .tour-title { color: #f2ede6; }
[data-theme="dark"] .tour-desc { color: #a0b4d6; }
[data-theme="dark"] .btn-tour-exit { border-color: rgba(255,255,255,0.15); color: #a0b4d6; }
[data-theme="dark"] .btn-tour-exit:hover { border-color: #93c5fd; color: #93c5fd; }
[data-theme="dark"] .btn-tour-next { background: #93c5fd; color: #0f1d3a; }
[data-theme="dark"] .btn-tour-next:hover { background: #bfdbfe; }

/* CHAT BUBBLE */
#chat-bubble { position: fixed; bottom: 48px; right: 24px; z-index: 200; width: 54px; height: 54px; border-radius: 50%; background: #1a2f6e; color: #fff; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 22px; box-shadow: 0 4px 20px rgba(26,47,110,0.35); transition: transform .2s, box-shadow .2s; }
#chat-bubble:hover { transform: scale(1.08); box-shadow: 0 6px 28px rgba(26,47,110,0.45); }
#chat-panel-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.3); backdrop-filter: blur(4px); z-index: 200; display: none; }
#chat-panel-overlay.open { display: block; }
#chat-panel { position: fixed; bottom: 90px; right: 24px; z-index: 201; width: 380px; height: 520px; background: #fff; border-radius: 16px; box-shadow: 0 8px 40px rgba(0,0,0,0.18); display: none; flex-direction: column; overflow: hidden; }
#chat-panel.open { display: flex; }
#chat-panel.expanded { width: 70vw; height: 80vh; top: 50%; left: 50%; right: auto; bottom: auto; transform: translate(-50%, -50%); }
.chat-panel-header { background: #1a2f6e; padding: 14px 16px; display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.chat-panel-avatar { width: 38px; height: 38px; border-radius: 50%; background: rgba(255,255,255,0.18); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; color: #fff; flex-shrink: 0; }
.chat-panel-info { flex: 1; min-width: 0; }
.chat-panel-name { font-size: 14px; font-weight: 600; color: #fff; }
.chat-panel-status { font-size: 12px; color: rgba(255,255,255,0.75); display: flex; align-items: center; gap: 4px; }
.chat-panel-status-dot { width: 7px; height: 7px; border-radius: 50%; background: #4ade80; flex-shrink: 0; }
.chat-panel-ai-chip { font-size: 10px; font-weight: 700; letter-spacing: .06em; color: rgba(255,255,255,0.9); background: rgba(255,255,255,0.15); border-radius: 20px; padding: 3px 8px; white-space: nowrap; }
.chat-panel-controls { display: flex; align-items: center; gap: 4px; }
.chat-panel-btn { background: transparent; border: none; color: rgba(255,255,255,0.65); cursor: pointer; font-size: 15px; padding: 4px 6px; transition: color .2s, background .2s; line-height: 1; border-radius: 4px; }
.chat-panel-btn:hover { color: #fff; background: rgba(255,255,255,0.1); }
.chat-panel-messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.chat-panel-input-area { padding: 12px 14px; border-top: 1px solid #f0f0f0; display: flex; gap: 8px; flex-shrink: 0; }
.chat-panel-input { flex: 1; border: 1.5px solid #e5e7eb; border-radius: 8px; padding: 8px 12px; font-size: 14px; font-family: inherit; outline: none; transition: border-color .2s; }
.chat-panel-input:focus { border-color: #1a2f6e; }
.chat-panel-send { background: #1a2f6e; color: #fff; border: none; border-radius: 8px; padding: 8px 12px; cursor: pointer; transition: background .2s; display: flex; align-items: center; }
.chat-panel-send:hover { background: #2d4499; }
.chat-panel-send:disabled { background: #c0c7d6; cursor: not-allowed; }
.msg { display: flex; gap: 10px; align-items: flex-start; }
.msg.user { flex-direction: row-reverse; }
.msg-avatar { width: 30px; height: 30px; border-radius: 50%; background: #edf2ff; display: flex; align-items: center; justify-content: center; font-size: 14px; flex-shrink: 0; }
.msg.user .msg-avatar { background: var(--navy); color: #fff; font-size: 12px; font-weight: 700; }
.msg-bubble { background: #f4f6fa; border-radius: 12px; padding: 12px 16px; font-size: 14px; color: var(--text-dark); max-width: 80%; line-height: 1.65; }
.msg.user .msg-bubble { background: var(--navy); color: #fff; }
.typing { display: flex; gap: 4px; align-items: center; padding: 4px 0; }
.typing span { width: 7px; height: 7px; background: var(--text-light); border-radius: 50%; animation: bounce .8s infinite; }
.typing span:nth-child(2) { animation-delay: .15s; }
.typing span:nth-child(3) { animation-delay: .3s; }
@keyframes bounce { 0%,60%,100%{transform:translateY(0)} 30%{transform:translateY(-6px)} }
.chat-faq-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chat-faq-chip { background: #edf2ff; color: #1a2f6e; font-size: 12px; font-weight: 500; padding: 5px 12px; border-radius: 20px; border: none; cursor: pointer; font-family: inherit; transition: background .2s; }
.chat-faq-chip:hover { background: #dce4ff; }
[data-theme="dark"] #chat-panel { background: #162448; }
[data-theme="dark"] .chat-panel-input-area { border-color: rgba(255,255,255,0.08); }
[data-theme="dark"] .chat-panel-input { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.12); color: #f2ede6; }
[data-theme="dark"] .chat-panel-input:focus { border-color: #93c5fd; }
[data-theme="dark"] .chat-faq-chip { background: rgba(147,197,253,0.12); color: #93c5fd; }
[data-theme="dark"] .chat-faq-chip:hover { background: rgba(147,197,253,0.2); }
[data-theme="dark"] .msg-bubble { background: rgba(255,255,255,0.07); color: #f2ede6; }
[data-theme="dark"] .msg.user .msg-bubble { background: #93c5fd; color: #0f1d3a; }
[data-theme="dark"] .msg.user .msg-avatar { background: #93c5fd; color: #0f1d3a; }
@media (max-width: 768px) {
  #chat-bubble { right: 16px; bottom: 20px; }
  #chat-panel { width: 92vw; right: 4vw; bottom: 84px; height: 75vh; max-height: 520px; }
  #chat-panel.expanded { width: 92vw; height: 85vh; top: 50%; left: 50%; right: auto; bottom: auto; transform: translate(-50%, -50%); }
}
