/* ==========================================================
   Javier Foriscot — Web CV · v2 "Sobria"
   Mobile-first. Breakpoints: 640px · 860px · 1080px
   ========================================================== */

/* ---------- Fuentes (autoalojadas, subset latin · licencia OFL en /fonts) ---------- */
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 300 700;
  font-stretch: 100%;
  font-display: swap;
  src: url("../fonts/ibm-plex-sans-var.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/ibm-plex-mono-400.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/ibm-plex-mono-500.woff2") format("woff2");
}

:root {
  --bg: #0b0d11;
  --bg-elev: #11151b;
  --bg-elev-2: #161b23;
  --line: rgba(255, 255, 255, 0.07);
  --line-strong: rgba(255, 255, 255, 0.14);
  --text: #e7eaee;
  --text-2: #b4bcc8;
  --muted: #7f8a99;
  --accent: #4f8cff;          /* azul acero */
  --accent-soft: rgba(79, 140, 255, 0.12);
  --ok: #3ddc97;              /* verde estado */

  --font: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", monospace;

  --container: 1120px;
  --gutter: 20px;
  --radius: 10px;
  --nav-h: 64px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 16px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
::selection { background: var(--accent); color: #fff; }
a { color: inherit; text-decoration: none; }
strong { color: var(--text); font-weight: 600; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
.mono { font-family: var(--mono); }
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }

/* Indicador de estado (punto verde) */
.status {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--ok); box-shadow: 0 0 0 3px rgba(61, 220, 151, .15);
  flex: none;
}

/* ---------- Nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  height: var(--nav-h);
}
/* El fondo va en un pseudo-elemento: backdrop-filter en .nav rompería el menú móvil (position: fixed) */
.nav::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: rgba(11, 13, 17, .86);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--line);
  opacity: 0; transition: opacity .25s;
}
.nav.scrolled::before, .nav.menu-open::before { opacity: 1; }
.nav__inner {
  height: 100%; max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand__mark {
  display: grid; place-items: center; width: 34px; height: 34px;
  border: 1px solid var(--accent); border-radius: 6px;
  font-family: var(--mono); font-size: 13px; font-weight: 500;
}
.brand__name { font-weight: 500; font-size: 15px; display: none; }

.nav__tools { display: flex; align-items: center; gap: 10px; }

.lang {
  display: flex; padding: 3px; gap: 2px;
  border: 1px solid var(--line-strong); border-radius: 7px;
}
.lang button {
  font: 500 12px/1 var(--mono); letter-spacing: .04em;
  color: var(--muted); background: none; border: 0; border-radius: 4px;
  padding: 7px 9px; cursor: pointer; transition: color .2s, background .2s;
}
.lang button:hover { color: var(--text); }
.lang button[aria-pressed="true"] { background: var(--accent); color: #fff; }

.nav__toggle {
  display: flex; flex-direction: column; justify-content: center; gap: 6px;
  width: 40px; height: 40px; padding: 0 11px;
  background: none; border: 1px solid var(--line-strong); border-radius: 7px; cursor: pointer;
}
.nav__toggle span { display: block; height: 1.5px; background: var(--text); transition: transform .25s; }
.nav__toggle[aria-expanded="true"] span:first-child { transform: translateY(3.75px) rotate(45deg); }
.nav__toggle[aria-expanded="true"] span:last-child { transform: translateY(-3.75px) rotate(-45deg); }

/* Menú móvil: pantalla completa bajo la barra */
.nav__links {
  position: fixed; top: var(--nav-h); left: 0; right: 0; bottom: 0;
  display: flex; flex-direction: column; padding: 24px var(--gutter);
  background: var(--bg);
  opacity: 0; visibility: hidden; transform: translateY(-8px);
  transition: opacity .25s, transform .25s, visibility .25s;
}
.nav__links.open { opacity: 1; visibility: visible; transform: none; }
.nav__links a {
  font-size: 22px; font-weight: 500; color: var(--text-2);
  padding: 16px 0; border-bottom: 1px solid var(--line);
}
.nav__links a.active { color: var(--text); }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 500;
  padding: 12px 20px; border-radius: 7px; border: 1px solid transparent;
  transition: background .2s, border-color .2s, color .2s;
}
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: #6a9dff; }
.btn--ghost { border-color: var(--line-strong); color: var(--text); }
.btn--ghost:hover { border-color: var(--text-2); }
.btn--big { font-family: var(--mono); font-size: 15px; padding: 16px 24px; word-break: break-all; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: calc(var(--nav-h) + 48px) 0 64px;
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  isolation: isolate;
}
/* Rejilla técnica muy sutil */
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 80% 70% at 70% 30%, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 70% 30%, #000 20%, transparent 75%);
  opacity: .6;
}
.hero__grid { display: grid; gap: 48px; }
.eyebrow { font-size: 12px; color: var(--accent); letter-spacing: .06em; text-transform: uppercase; margin: 0 0 20px; }
h1 { font-size: clamp(44px, 12vw, 88px); line-height: .98; letter-spacing: -0.035em; font-weight: 600; margin-bottom: 20px; }
.hero__role { font-size: clamp(18px, 4.6vw, 22px); font-weight: 400; color: var(--text); margin: 0 0 16px; }
.hero__lead { color: var(--text-2); font-size: 16px; max-width: 540px; margin: 0 0 32px; font-weight: 300; }
.hero__lead strong { font-weight: 500; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 36px; }
.hero__cta .btn { flex: 1 1 160px; }
.hero__meta {
  list-style: none; margin: 0; padding: 20px 0 0; border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; gap: 10px 24px; font-size: 12.5px; color: var(--muted);
}
.hero__meta li { display: inline-flex; align-items: center; gap: 8px; }

/* Panel del proyecto actual */
.panel {
  background: var(--bg-elev);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: 0 24px 60px -24px rgba(0, 0, 0, .6);
}
.panel__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--line);
  font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em;
}
.panel__live { display: inline-flex; align-items: center; gap: 8px; color: var(--text-2); text-transform: none; letter-spacing: 0; }

.flow { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; padding: 22px 18px; }
.flow__node {
  border: 1px solid var(--line-strong); border-radius: 8px; padding: 12px;
  background: var(--bg-elev-2);
}
.flow__node small { display: block; font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 2px; }
.flow__node b { font-size: 14px; font-weight: 500; }
.flow__node--to { border-color: rgba(79, 140, 255, .5); background: var(--accent-soft); }
.flow__line { position: relative; width: 36px; height: 2px; background: var(--line-strong); overflow: hidden; }
.flow__line i {
  position: absolute; top: 0; left: -8px; width: 8px; height: 2px; background: var(--accent);
  animation: packet 2.4s linear infinite;
}
.flow__line i:nth-child(2) { animation-delay: .8s; }
.flow__line i:nth-child(3) { animation-delay: 1.6s; }

.panel__rows { margin: 0; padding: 0 18px 10px; }
.panel__rows div {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 12px 0; border-top: 1px solid var(--line); font-size: 14px;
}
.panel__rows dt { color: var(--text-2); }
.panel__rows dd { margin: 0; color: var(--text); font-size: 14px; }
.check { width: 16px; height: 16px; fill: none; stroke: var(--ok); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; display: block; }

/* ---------- Secciones ---------- */
.section { padding: 72px 0; border-bottom: 1px solid var(--line); }
.section__grid { display: grid; gap: 28px; }
.section__label { display: flex; align-items: baseline; gap: 14px; }
.section__label .mono { font-size: 13px; color: var(--accent); }
.section__label h2 { font-size: clamp(26px, 6vw, 32px); }

/* ---------- Puesto actual (destacado) ---------- */
.featured {
  position: relative;
  background: var(--bg-elev);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 24px 20px;
  overflow: hidden;
}
.featured::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 2px;
  background: linear-gradient(90deg, var(--accent), transparent 80%);
}
.featured__head { display: flex; flex-direction: column; gap: 14px; margin-bottom: 20px; }
.featured__company { margin: 0 0 4px; font-size: clamp(30px, 8vw, 40px); font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; }
.featured__role { font-size: 17px; font-weight: 400; color: var(--accent); }
.featured__when { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font-size: 13px; color: var(--text-2); }
.featured__dur {
  font-size: 11.5px; color: var(--ok);
  border: 1px solid rgba(61, 220, 151, .35); border-radius: 999px; padding: 2px 10px;
}
.featured__dur:empty { display: none; }
.featured__intro { color: var(--text-2); margin: 0 0 24px; max-width: 720px; font-weight: 300; font-size: 16.5px; }

.featured__cols { display: grid; gap: 28px; margin-bottom: 28px; padding-top: 24px; border-top: 1px solid var(--line); }
.block h4 { display: flex; align-items: center; gap: 12px; font-size: 16.5px; margin-bottom: 14px; }
.block h4 .mono {
  display: grid; place-items: center; flex: none; width: 26px; height: 26px; border-radius: 6px;
  font-size: 12px; font-weight: 500; color: var(--accent); background: var(--accent-soft);
}

.ticks { list-style: none; margin: 0; padding: 0; }
.ticks li { position: relative; padding-left: 20px; margin-bottom: 8px; color: var(--text-2); font-size: 15px; }
.ticks li::before {
  content: ""; position: absolute; left: 2px; top: .7em; width: 8px; height: 1px; background: var(--accent);
}

.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li {
  font-family: var(--mono); font-size: 12px; color: var(--text-2);
  padding: 5px 10px; border-radius: 5px; border: 1px solid var(--line-strong); background: var(--bg);
}
.chips--sm li { font-size: 11.5px; padding: 3px 8px; }

/* ---------- Perfil ---------- */
.profile { display: grid; gap: 36px; }
.profile__text p { margin: 0 0 18px; color: var(--text-2); font-weight: 300; font-size: 16.5px; }
.profile__text p:last-child { margin-bottom: 0; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); margin: 0; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.stats div { padding: 20px 16px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.stats dt { font-size: 30px; font-weight: 500; line-height: 1.1; color: var(--text); }
.stats dd { margin: 6px 0 0; font-size: 13px; color: var(--muted); line-height: 1.4; }

/* ---------- Trayectoria ---------- */
.timeline { list-style: none; margin: 0; padding: 0; }
.job {
  display: grid; gap: 6px;
  padding: 24px 0; border-top: 1px solid var(--line);
}
.job:first-child { border-top: 0; padding-top: 0; }
.job time { font-size: 12.5px; color: var(--muted); }
.job h3 { font-size: 19px; }
.job h3 small { font-size: 13px; font-weight: 400; color: var(--muted); margin-left: 4px; }
.job__role { margin: 2px 0 12px; color: var(--accent); font-size: 14.5px; }
.job p { margin: 0 0 12px; color: var(--text-2); font-size: 15px; }
.job p a { color: var(--accent); white-space: nowrap; }
.job p a:hover { text-decoration: underline; }
.job--current time { color: var(--ok); }
.job--past h3, .job--past .job__role { opacity: .85; }

/* ---------- Competencias ---------- */
.skills { margin: 0; border-top: 1px solid var(--line); }
.skills__row { display: grid; gap: 4px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.skills__row dt { font-size: 13px; font-family: var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.skills__row dd { margin: 0; color: var(--text-2); font-size: 15px; }
.skills__row--key dt { color: var(--accent); }
.skills__row--key dd { color: var(--text); }
/* Fila destacada: especialidad QRadar */
.skills__row--main {
  position: relative;
  margin: 16px 0 8px; padding: 20px;
  border: 1px solid rgba(79, 140, 255, .45); border-radius: var(--radius);
  background: linear-gradient(90deg, var(--accent-soft), transparent 85%);
}
.skills__row--main dt { color: var(--accent); }
.skills__row--main dd { display: flex; flex-direction: column; gap: 4px; }
.skills__main { font-size: 22px; font-weight: 600; color: var(--text); letter-spacing: -0.01em; line-height: 1.2; }
.skills__main-desc { color: var(--text-2); font-size: 14.5px; }

/* ---------- Formación ---------- */
.edu { display: grid; gap: 14px; }
.edu__item {
  background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px;
}
.edu__item--cert { border-color: rgba(79, 140, 255, .45); background: linear-gradient(180deg, var(--accent-soft), var(--bg-elev) 70%); }
.edu__item time { font-size: 12.5px; color: var(--muted); }
.edu__item h3 { font-size: 17px; margin: 4px 0 4px; }
.edu__item .edu__org { color: var(--accent); font-size: 14px; margin: 0 0 10px; }
.edu__item p { margin: 0; color: var(--text-2); font-size: 14.5px; }
.edu__item p + p { margin-top: 0; }
.badge {
  display: inline-block; font-size: 11px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--accent); border: 1px solid rgba(79, 140, 255, .5); border-radius: 4px; padding: 2px 8px;
}

/* ---------- Contacto ---------- */
.section--contact { border-bottom: 0; padding: 88px 0; }
.contact { text-align: center; }
.contact__kicker { font-size: 13px; color: var(--accent); }
.contact h2 { font-size: clamp(34px, 9vw, 56px); letter-spacing: -0.03em; margin: 10px 0 14px; }
.contact p { color: var(--text-2); margin: 0 auto 32px; max-width: 480px; font-weight: 300; font-size: 17px; }
.downloads { margin-top: 36px; }
.contact .downloads__label { font-size: 12px; font-weight: 400; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin: 0 0 12px; max-width: none; }
.downloads__links { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px 28px; }
.dl-group { display: flex; align-items: center; gap: 8px; }
.dl-group__lang { font-size: 14px; color: var(--text-2); min-width: 64px; text-align: right; }
.contact .downloads__note { font-size: 13px; color: var(--muted); margin: 14px auto 0; max-width: 420px; }
.dl {
  min-width: 96px; justify-content: center;
  display: inline-flex; align-items: center; gap: 10px;
  padding: 12px 18px; border: 1px solid var(--line-strong); border-radius: 7px;
  background: var(--bg-elev); font-size: 15px; color: var(--text);
  transition: border-color .2s, background .2s;
}
.dl:hover { border-color: var(--accent); background: var(--accent-soft); }
.dl svg, .btn__icon { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.dl svg { color: var(--accent); }
.dl small { font-size: 11px; color: var(--muted); border-left: 1px solid var(--line-strong); padding-left: 10px; }
.btn__icon { margin-right: 8px; }

.socials { list-style: none; padding: 0; margin: 28px 0 0; display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; }
.socials a {
  display: inline-flex; align-items: center; gap: 9px;
  font-size: 14px; color: var(--text-2);
  padding: 10px 16px; border: 1px solid var(--line-strong); border-radius: 7px;
  transition: color .2s, border-color .2s;
}
.socials a:hover { color: var(--text); border-color: var(--text-2); }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); padding: 22px 0 28px; }
.footer__inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; font-size: 12px; color: var(--muted); }
.footer__status { display: inline-flex; align-items: center; gap: 8px; }

/* ---------- 404 ---------- */
.notfound { min-height: 100svh; display: grid; align-items: center; }
.notfound__code { font-size: 13px; color: var(--accent); letter-spacing: .06em; margin: 0 0 16px; }
.notfound h1 { font-size: clamp(36px, 9vw, 64px); margin-bottom: 16px; }
.notfound__text { color: var(--text-2); margin: 0 0 32px; font-weight: 300; }

/* ---------- Aparición ---------- */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s ease, transform .6s ease; }
.reveal.visible { opacity: 1; transform: none; }

@keyframes packet { to { left: 100%; } }

/* ==========================================================
   ≥ 640px
   ========================================================== */
@media (min-width: 640px) {
  :root { --gutter: 32px; }
  .brand__name { display: inline; }
  .hero__cta .btn { flex: 0 0 auto; }
  .featured { padding: 32px; }
  .featured__head { flex-direction: row; justify-content: space-between; align-items: flex-start; }
  .featured__when { flex-direction: column; align-items: flex-end; text-align: right; }
  .edu { grid-template-columns: 1fr 1fr; }
  .job { grid-template-columns: 140px 1fr; gap: 24px; }
  .job time { padding-top: 4px; }
  .skills__row { grid-template-columns: 220px 1fr; gap: 24px; }
  .skills__row dt { padding-top: 2px; }
  .btn--big { font-size: 17px; padding: 18px 32px; }
}

/* ==========================================================
   ≥ 860px — menú horizontal
   ========================================================== */
@media (min-width: 860px) {
  .nav__toggle { display: none; }
  .nav__links {
    position: static; flex-direction: row; gap: 26px; padding: 0;
    background: none; opacity: 1; visibility: visible; transform: none;
    margin-left: auto; margin-right: 8px;
  }
  .nav__links a {
    font-size: 14px; padding: 0; border: 0; color: var(--muted); position: relative;
    transition: color .2s;
  }
  .nav__links a:hover, .nav__links a.active { color: var(--text); }
  .nav__links a.active::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: -22px; height: 1.5px; background: var(--accent);
  }
  .featured__cols { grid-template-columns: 1fr 1fr; gap: 40px; }
  .profile { grid-template-columns: 1.4fr 1fr; gap: 48px; align-items: start; }
  .stats { grid-template-columns: 1fr; }
  .stats div { display: flex; align-items: baseline; gap: 16px; }
  .stats dt { min-width: 64px; }
  .stats dd { margin: 0; }
}

/* ==========================================================
   ≥ 1080px — escritorio
   ========================================================== */
@media (min-width: 1080px) {
  .hero { padding: calc(var(--nav-h) + 88px) 0 104px; }
  .hero__grid { grid-template-columns: 1.15fr .85fr; align-items: center; gap: 64px; }
  .hero__lead { font-size: 18px; }
  .section { padding: 104px 0; }
  .section__grid { grid-template-columns: 220px 1fr; gap: 48px; }
  .section__label { flex-direction: column; gap: 8px; position: sticky; top: calc(var(--nav-h) + 32px); align-self: start; }
  .section__label h2 { font-size: 26px; }
  .featured { padding: 40px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}
