/* ===========================================================================
   Sistema visual — inspirado en devexpert.io
   Fondo crema · tipografía geométrica grande · acentos naranja/coral · pills
   =========================================================================== */
:root {
  --bg: #faf7f0;
  --bg-soft: #f3ede1;
  --card: #ffffff;
  --ink: #1e1e1e;
  --ink-soft: #4a4a4a;
  --muted: #7c7568;
  --orange: #ff8800;
  --coral: #e95f54;
  --yellow: #ffd84d;
  --yellow-soft: #ffe9a8;
  --line: #eae2d3;
  --line-strong: #ded4c0;
  --shadow: 0 18px 50px rgba(40, 30, 10, 0.10);
  --radius: 22px;
  --radius-sm: 14px;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Space Grotesk", "Inter", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 { font-family: var(--display); font-weight: 700; line-height: 1.08; letter-spacing: -0.02em; }

.accent { color: var(--orange); }
.accent-2 { color: var(--coral); }
.hl { background: linear-gradient(transparent 55%, var(--yellow-soft) 55%); padding: 0 2px; }

.container { max-width: 960px; margin: 0 auto; padding: 0 22px; }

/* ---------- Header / nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 40;
  backdrop-filter: saturate(1.4) blur(10px);
  background: rgba(250, 247, 240, 0.82);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: 960px; margin: 0 auto; padding: 14px 22px;
  display: flex; align-items: center; gap: 18px;
}
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 700; font-size: 19px; }
.brand .logo {
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center; color: #fff; font-size: 15px; font-weight: 700;
  background: linear-gradient(135deg, var(--ink), #3a3a3a);
}
.nav-links { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.nav-links a {
  padding: 8px 14px; border-radius: 999px; font-weight: 500; font-size: 15px; color: var(--ink-soft);
  transition: background .15s ease, color .15s ease;
}
.nav-links a:hover { background: var(--bg-soft); color: var(--ink); }
.nav-links a.active { color: var(--ink); font-weight: 600; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 13px 22px; border-radius: 999px;
  font-family: var(--sans); font-weight: 600; font-size: 15.5px;
  border: 1px solid transparent; cursor: pointer;
  transition: transform .12s ease, box-shadow .15s ease, background .15s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--yellow); color: var(--ink); box-shadow: 0 10px 26px rgba(255, 180, 20, .35); }
.btn-primary:hover { box-shadow: 0 14px 32px rgba(255, 180, 20, .45); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover { background: var(--bg-soft); }

/* ---------- Hero ---------- */
.hero { position: relative; padding: 70px 0 48px; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; z-index: 0;
  left: -8%; top: 8%; width: 520px; height: 520px;
  background: radial-gradient(circle, rgba(255, 216, 77, .55), rgba(255, 216, 77, 0) 62%);
  filter: blur(8px); pointer-events: none;
}
.hero-inner { position: relative; z-index: 1; display: flex; gap: 40px; align-items: center; flex-wrap: wrap; }
.hero-text { flex: 1 1 420px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  color: var(--muted); background: var(--card); border: 1px solid var(--line);
  padding: 6px 13px; border-radius: 999px; margin-bottom: 22px;
}
.eyebrow .pulse { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 4px rgba(34,197,94,.18); }
.hero h1 { font-size: clamp(38px, 7vw, 64px); margin: 0 0 8px; }
.hero .role { font-size: clamp(19px, 3vw, 24px); color: var(--orange); font-family: var(--display); font-weight: 600; margin: 0 0 20px; }
.hero .lead { font-size: 17.5px; color: var(--ink-soft); max-width: 560px; margin: 0 0 28px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; }

.hero-photo { flex: 0 0 auto; }
.hero-photo .ring {
  width: 190px; height: 190px; border-radius: 50%;
  display: grid; place-items: center; color: #fff; font-size: 58px; font-weight: 700; font-family: var(--display);
  background: linear-gradient(135deg, var(--orange), var(--coral));
  box-shadow: 0 24px 60px rgba(233, 95, 84, .35);
}

.contacto { list-style: none; margin: 26px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 20px; color: var(--muted); font-size: 14.5px; }
.contacto li { display: inline-flex; align-items: center; gap: 7px; }
.contacto a:hover { color: var(--orange); }

/* ---------- Secciones ---------- */
.section { padding: 30px 0; }
.section-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 22px; }
.section-head h2 { font-size: clamp(26px, 4vw, 34px); margin: 0; }
.section-head .idx { font-family: var(--display); color: var(--orange); font-weight: 700; font-size: 18px; }

.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 26px; box-shadow: 0 6px 22px rgba(40,30,10,.04);
}

.resumen { font-size: 17px; line-height: 1.7; color: var(--ink-soft); margin: 0; }

/* ---------- Habilidades ---------- */
.skills { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; }
.skill-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 20px; }
.skill-card h3 { margin: 0 0 14px; font-size: 15px; color: var(--coral); display: flex; align-items: center; gap: 9px; }
.skill-card h3::before { content: ""; width: 10px; height: 10px; border-radius: 3px; background: linear-gradient(var(--orange), var(--coral)); }
.chips-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag { background: var(--bg-soft); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; font-size: 13.5px; color: var(--ink-soft); }

/* ---------- Timeline experiencia ---------- */
.timeline { position: relative; padding-left: 26px; }
.timeline::before { content: ""; position: absolute; left: 6px; top: 8px; bottom: 8px; width: 2px; background: var(--line-strong); }
.tl-item { position: relative; padding-bottom: 28px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-dot { position: absolute; left: -25px; top: 4px; width: 14px; height: 14px; border-radius: 50%; background: var(--orange); border: 3px solid var(--bg); box-shadow: 0 0 0 2px var(--orange); }
.tl-period { display: inline-block; font-size: 12.5px; color: #fff; background: var(--ink); padding: 3px 10px; border-radius: 999px; font-weight: 600; letter-spacing: .02em; }
.tl-body h3 { margin: 10px 0 2px; font-size: 19px; }
.tl-emp { color: var(--coral); font-weight: 600; font-family: var(--sans); font-size: 15px; }
.tl-sub { margin: 2px 0 10px; color: var(--muted); font-size: 14px; }
.tl-body ul { margin: 0; padding-left: 18px; }
.tl-body li { margin: 7px 0; font-size: 15px; line-height: 1.55; color: var(--ink-soft); }

/* ---------- Educación ---------- */
.edu-item h3 { margin: 10px 0 2px; font-size: 18px; }
.edu-detalle { margin: 6px 0 0; color: var(--muted); font-size: 14px; }

/* ---------- Footer ---------- */
.foot { border-top: 1px solid var(--line); margin-top: 40px; padding: 34px 0; text-align: center; color: var(--muted); font-size: 14px; }
.foot .social { display: flex; justify-content: center; gap: 16px; margin-bottom: 16px; }
.foot .social a { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: var(--card); border: 1px solid var(--line); transition: transform .12s ease, border-color .15s; }
.foot .social a:hover { transform: translateY(-2px); border-color: var(--orange); }

/* ===========================================================================
   Chat flotante (escondido, se abre con el botón)
   =========================================================================== */
.chat-fab {
  position: fixed; right: 22px; bottom: 22px; z-index: 60;
  display: inline-flex; align-items: center; gap: 10px;
  padding: 12px 20px 12px 14px; border: none; border-radius: 999px; cursor: pointer;
  background: var(--ink); color: #fff; font-family: var(--sans); font-weight: 600; font-size: 15px;
  box-shadow: 0 16px 40px rgba(0,0,0,.28); transition: transform .15s ease, box-shadow .15s ease;
}
.chat-fab:hover { transform: translateY(-3px); box-shadow: 0 20px 46px rgba(0,0,0,.34); }
.chat-fab .fab-ava { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: 18px; background: linear-gradient(135deg, var(--orange), var(--coral)); }
.chat-fab .fab-ping { position: absolute; top: 8px; left: 34px; width: 10px; height: 10px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 0 rgba(34,197,94,.6); animation: ping 2s infinite; }
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(34,197,94,.5); } 70% { box-shadow: 0 0 0 10px rgba(34,197,94,0); } 100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); } }

.chat-overlay { position: fixed; inset: 0; z-index: 55; background: rgba(20,15,5,.28); opacity: 0; pointer-events: none; transition: opacity .2s ease; }
.chat-overlay.open { opacity: 1; pointer-events: auto; }

.chat-panel {
  position: fixed; right: 22px; bottom: 22px; z-index: 61;
  width: min(400px, calc(100vw - 32px)); max-height: min(640px, calc(100vh - 44px));
  display: flex; flex-direction: column;
  background: var(--card); border: 1px solid var(--line); border-radius: 24px;
  box-shadow: var(--shadow);
  transform: translateY(24px) scale(.98); opacity: 0; pointer-events: none;
  transition: transform .22s cubic-bezier(.2,.8,.2,1), opacity .18s ease;
}
.chat-panel.open { transform: translateY(0) scale(1); opacity: 1; pointer-events: auto; }

.chat-head { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.chat-head .ava { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-size: 20px; color: #fff; background: linear-gradient(135deg, var(--orange), var(--coral)); }
.chat-head .who { flex: 1; }
.chat-head .who strong { display: block; font-family: var(--display); font-size: 15.5px; }
.chat-head .who span { font-size: 12.5px; color: #22a558; }
.chat-close { background: none; border: none; cursor: pointer; font-size: 22px; color: var(--muted); line-height: 1; padding: 4px 8px; border-radius: 8px; }
.chat-close:hover { background: var(--bg-soft); color: var(--ink); }

.chat { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 11px; min-height: 200px; }
.msg { display: flex; }
.msg.user { justify-content: flex-end; }
.bubble { max-width: 84%; padding: 10px 14px; border-radius: 16px; line-height: 1.5; font-size: 14.5px; white-space: pre-wrap; word-wrap: break-word; }
.msg.bot .bubble { background: var(--bg-soft); border: 1px solid var(--line); border-top-left-radius: 5px; color: var(--ink); }
.msg.user .bubble { background: var(--ink); color: #fff; border-top-right-radius: 5px; }
.typing .bubble { color: var(--muted); font-style: italic; }
.dots::after { content: "…"; animation: dots 1.2s steps(4, end) infinite; }
@keyframes dots { 0% { content: "."; } 33% { content: ".."; } 66% { content: "..."; } }

.chat-chips { display: flex; flex-wrap: wrap; gap: 7px; padding: 0 16px 12px; }
.chip { background: var(--bg-soft); border: 1px solid var(--line); border-radius: 999px; padding: 7px 12px; font-size: 12.5px; cursor: pointer; color: var(--ink-soft); transition: border-color .15s, color .15s; }
.chip:hover { border-color: var(--orange); color: var(--ink); }

.composer { display: flex; gap: 8px; padding: 12px 14px; border-top: 1px solid var(--line); }
.composer input { flex: 1; border: 1px solid var(--line); background: var(--bg); border-radius: 999px; padding: 11px 16px; font-size: 14.5px; font-family: var(--sans); color: var(--ink); outline: none; }
.composer input:focus { border-color: var(--orange); }
.composer button { width: 44px; height: 44px; flex: 0 0 auto; border: none; border-radius: 50%; background: var(--orange); color: #fff; font-size: 17px; cursor: pointer; display: grid; place-items: center; }
.composer button:disabled { opacity: .5; cursor: not-allowed; }

/* ===========================================================================
   Blog
   =========================================================================== */
.page-head { padding: 60px 0 20px; }
.page-head h1 { font-size: clamp(34px, 6vw, 54px); margin: 0 0 10px; }
.page-head p { font-size: 18px; color: var(--muted); margin: 0; max-width: 600px; }

.posts { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; padding: 20px 0 20px; }
.post-card { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: transform .14s ease, box-shadow .16s ease; }
.post-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.post-card .cover { height: 120px; background: linear-gradient(135deg, var(--yellow-soft), #ffd0a3); display: grid; place-items: center; font-size: 42px; }
.post-card .body { padding: 20px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.post-card .meta { font-size: 12.5px; color: var(--muted); }
.post-card h3 { margin: 0; font-size: 20px; }
.post-card p { margin: 0; color: var(--ink-soft); font-size: 14.5px; flex: 1; }
.post-card .tags { display: flex; flex-wrap: wrap; gap: 6px; }
.read-more { color: var(--orange); font-weight: 600; font-size: 14.5px; }

/* Post individual */
.article { max-width: 720px; margin: 0 auto; padding: 40px 0; }
.article .kicker { color: var(--orange); font-weight: 600; font-size: 14px; }
.article h1 { font-size: clamp(30px, 5vw, 46px); margin: 10px 0 12px; }
.article .meta { color: var(--muted); font-size: 14px; margin-bottom: 30px; }
.article .content { font-size: 17px; line-height: 1.75; color: var(--ink-soft); }
.article .content h2 { font-size: 26px; margin: 34px 0 12px; color: var(--ink); }
.article .content h3 { font-size: 20px; margin: 26px 0 10px; color: var(--ink); }
.article .content p { margin: 0 0 16px; }
.article .content ul { padding-left: 22px; }
.article .content li { margin: 8px 0; }
.article .content code { background: var(--bg-soft); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; font-size: 15px; }
.article .content pre { background: #1e1e1e; color: #f5f5f5; padding: 16px 18px; border-radius: 12px; overflow-x: auto; }
.article .content pre code { background: none; border: none; color: inherit; }
.article .content a { color: var(--orange); font-weight: 500; text-decoration: underline; }
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 14.5px; margin-bottom: 20px; }
.back-link:hover { color: var(--orange); }

@media (max-width: 640px) {
  .hero { padding: 40px 0 30px; }
  .hero-photo .ring { width: 130px; height: 130px; font-size: 42px; }
  .nav-links a { padding: 7px 10px; font-size: 14px; }
  .card, .skill-card { padding: 18px; }
}
