@font-face { font-family: "Orbitron"; src: url("../assets/fonts/orbitron-800.woff2") format("woff2"); font-weight: 800; font-display: swap; }
@font-face { font-family: "Share Tech Mono"; src: url("../assets/fonts/share-tech-mono-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }

:root {
  --bg: #1a1a1f;
  --c: #b8b3ff;
  --dim: #6d68a8;
  --dim-text: #8f8ad0;
  --txt: #dcd9ff;
  --led: #7dffb0;
  --purple: #a98fff;
  --fill: rgba(90, 80, 255, .55);
  --glow: 0 0 8px rgba(184, 179, 255, .25), inset 0 0 8px rgba(184, 179, 255, .08);
  --mono: "Share Tech Mono", ui-monospace, monospace;
  --display: "Orbitron", var(--mono);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--c); font-family: var(--mono); font-size: 15px; line-height: 1.5; }
a { color: var(--c); }
a:focus-visible, button:focus-visible { outline: 2px solid var(--led); outline-offset: 3px; }

.mesh { position: fixed; inset: 0; width: 100%; height: 100%; opacity: .1; pointer-events: none; z-index: 0; }
.mesh path { fill: none; stroke: var(--c); stroke-width: .6; }

.page { position: relative; z-index: 1; max-width: 1040px; margin: 0 auto; padding: 24px 20px 32px; }
.box { border: 1.5px solid var(--c); box-shadow: var(--glow); background: rgba(26, 26, 31, .85); }
.title { font-family: var(--display); font-weight: 800; letter-spacing: .04em; margin: 0; }
.glow { text-shadow: 0 0 10px rgba(184, 179, 255, .6); }
.slashes { letter-spacing: -2px; font-weight: 800; font-size: 18px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.noscript { color: var(--txt); font-size: 13px; }

/* LED */
.led { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--led); box-shadow: 0 0 6px var(--led); animation: blink 1.4s infinite; vertical-align: middle; }
.led--off { background: var(--dim); box-shadow: none; animation: none; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: .2; } }

/* Iconos */
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ico { width: 15px; height: 15px; flex: none; fill: currentColor; }
.ico--stroke { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ico-link { display: inline-flex; align-items: center; gap: 6px; }
.contact-btn { border: 1.5px solid var(--c); box-shadow: var(--glow); padding: 7px 14px; text-decoration: none; transition: background .15s; }
.contact-btn:hover { background: rgba(90, 80, 255, .2); text-shadow: 0 0 8px var(--c); }
.contact-btn .ico { width: 17px; height: 17px; }
.links .ico-link { color: var(--purple); filter: drop-shadow(0 0 3px rgba(169, 143, 255, .45)); padding: 4px; transition: color .15s, filter .15s; }
.links .ico-link:hover { color: var(--c); filter: drop-shadow(0 0 6px var(--purple)); text-shadow: none; }
.links .ico { width: 22px; height: 22px; }
.links .ico--stroke { stroke-width: 2.2; }

/* Barra superior */
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.topbar__label { font-size: 13px; letter-spacing: .1em; }
.topbar__nav { display: flex; gap: 20px; align-items: center; font-size: 12px; }
.topbar__nav a { text-decoration: none; }
.topbar__nav a:hover { text-shadow: 0 0 8px var(--c); }
.lang { font: inherit; color: var(--dim-text); padding: 3px 8px; cursor: pointer; box-shadow: none; }
.lang [data-l] { color: var(--dim-text); }
.lang[data-lang="es"] [data-l="es"], .lang[data-lang="en"] [data-l="en"] { color: var(--c); }

/* Ficha */
.dossier { display: grid; grid-template-columns: 3fr 1fr; gap: 16px; margin-top: 14px; }
.dossier__head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1.5px solid var(--c); }
.dossier__head .title { font-size: clamp(22px, 3.6vw, 32px); }
.dossier__id { font-size: 14px; }
.dossier__row { display: grid; grid-template-columns: 1fr 1.2fr; }
.dossier__row + .dossier__row { border-top: 1.5px solid var(--c); }
.dossier__row > :first-child { border-right: 1.5px solid var(--c); }
.dossier__photo { display: flex; flex-direction: column; }
.photo { flex: 1; min-height: 200px; display: grid; place-items: center; background: radial-gradient(circle, #2b2850, var(--bg)); font-family: var(--display); font-size: 42px; color: var(--dim-text); overflow: hidden; }
.photo img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(.3) contrast(1.05); }
.links { display: flex; flex-wrap: wrap; justify-content: space-around; gap: 6px 10px; padding: 8px; border-top: 1.5px solid var(--c); font-size: 12px; }
.links a { text-decoration: none; }
.links a:hover { text-shadow: 0 0 8px var(--c); }
.dossier__radar { display: grid; place-items: center; padding: 10px; }
#radar svg { width: 100%; max-width: 280px; display: block; }
.radar__grid { fill: none; stroke: var(--dim); stroke-width: .8; }
.radar__area { fill: var(--fill); stroke: var(--c); stroke-width: 1.5; }
.radar__label { fill: var(--c); font-family: var(--mono); font-size: 8px; text-anchor: middle; dominant-baseline: middle; }

.specs-wrap { padding: 12px 16px; }
.specs { width: 100%; border-collapse: collapse; font-size: 13px; }
.specs th, .specs td { border-bottom: 1px solid var(--dim); padding: 5px 2px; font-weight: 400; }
.specs th { text-align: left; color: var(--c); }
.specs td { text-align: right; color: #e6e4ff; }
.bio { margin: 0; padding: 14px 16px; font-size: 14.5px; line-height: 1.65; color: var(--txt); }

.dossier__side { display: flex; flex-direction: column; gap: 16px; }
.side-box { flex: 1; min-height: 120px; padding: 12px; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 8px; text-decoration: none; }
.side-box svg { width: 90%; }
.side-box svg path { fill: none; stroke: var(--c); stroke-width: 2; stroke-linecap: round; }
.side-box__label { font-size: 10px; letter-spacing: .12em; }
.side-box__label--top { align-self: flex-start; color: var(--dim-text); }
.side-box__text { margin: 0; font-size: 13px; color: var(--txt); align-self: flex-start; }
.side-box--cv { position: relative; cursor: pointer; gap: 10px; transition: background .2s; }
.side-box--cv::before, .side-box--cv::after { content: ""; position: absolute; width: 14px; height: 14px; border: 0 solid var(--c); transition: all .2s; }
.side-box--cv::before { top: 7px; left: 7px; border-top-width: 2px; border-left-width: 2px; }
.side-box--cv::after { bottom: 7px; right: 7px; border-bottom-width: 2px; border-right-width: 2px; }
.side-box--cv:hover { background: rgba(90, 80, 255, .16); }
.side-box--cv:hover::before, .side-box--cv:hover::after { width: 22px; height: 22px; border-color: var(--led); }
.cv-doc { width: 56px; height: 56px; stroke-width: 1.3; filter: drop-shadow(0 0 8px rgba(184, 179, 255, .55)); transition: transform .2s; }
.side-box--cv:hover .cv-doc { transform: translateY(-3px); }
.side-box--cv .side-box__label { font-family: var(--display); font-weight: 800; font-size: 12px; letter-spacing: .08em; }
.cv-meta { display: inline-flex; align-items: center; gap: 5px; font-size: 10px; letter-spacing: .15em; color: var(--dim-text); }
.cv-meta .ico { width: 12px; height: 12px; }
.side-box--now { justify-content: flex-start; align-items: stretch; }
.now-list { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.now-list a { font-family: var(--display); font-weight: 800; font-size: 13px; text-decoration: none; display: inline-flex; align-items: center; gap: 7px; }
.now-list a:hover { text-shadow: 0 0 8px var(--c); }
.now-list p { margin: 3px 0 0; font-size: 12px; line-height: 1.45; color: var(--txt); }

/* Secciones */
.sec { display: flex; align-items: center; gap: 12px; margin: 36px 0 14px; font-size: inherit; font-weight: inherit; }
.sec .title { font-size: 20px; }
.sec__line { flex: 1; height: 1px; background: var(--dim); }

/* Proyectos */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.proj { padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.proj__media { display: block; width: calc(100% + 28px); height: 190px; margin: -14px -14px 4px; border-bottom: 1.5px solid var(--c); }
img.proj__media { object-fit: cover; object-position: top left; }
.proj__code { box-sizing: border-box; margin-top: -14px; padding: 12px 14px; background: #121217; font-family: var(--mono); font-size: 11.5px; line-height: 1.55; color: var(--led); white-space: pre; overflow: auto; }
.proj__learned { margin: 0; padding-left: 10px; border-left: 2px solid var(--purple); font-size: 12px; line-height: 1.5; color: var(--dim-text); }
.proj__cat { font-size: 10px; letter-spacing: .15em; color: var(--dim-text); }
.proj__title { font-family: var(--display); font-weight: 800; font-size: 16px; margin: 0; }
.proj__desc { margin: 0; font-size: 13px; line-height: 1.5; color: var(--txt); flex: 1; }
.proj__tags { display: flex; gap: 5px; flex-wrap: wrap; list-style: none; margin: 0; padding: 0; }
.tag { border: 1px solid var(--dim); padding: 1px 7px; font-size: 10px; }
.proj__link { font-size: 11px; align-self: flex-start; }

/* Foto + disponibilidad */
.photo-wrap { position: relative; flex: 1; display: flex; }
.photo-wrap .photo { flex: 1; }
.badge-available { position: absolute; top: 10px; left: 10px; z-index: 1; display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; font-size: 11px; letter-spacing: .1em; color: var(--led); background: rgba(16, 20, 18, .82); border: 1.5px solid var(--led); box-shadow: 0 0 10px rgba(125, 255, 176, .35); }
.badge-available .ico { width: 14px; height: 14px; }

/* Stack */
.grid--stack { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.stack-group { padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.stack-group__name { margin: 0; font-family: var(--display); font-weight: 800; font-size: 12px; letter-spacing: .06em; }
.stack-group .tag { font-size: 11px; color: var(--txt); }

/* CTA de contacto */
.cta { margin-top: 40px; padding: 26px 28px; display: grid; grid-template-columns: 1.6fr 1fr; gap: 24px; align-items: center; position: relative; }
.cta::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 90% 0%, rgba(90, 80, 255, .22), transparent 60%); pointer-events: none; }
.cta__title { font-size: clamp(22px, 3.2vw, 30px); margin: 6px 0 10px; }
.cta__text { margin: 0 0 12px; color: var(--txt); font-size: 14px; line-height: 1.6; }
.cta__status { margin: 0; font-size: 12px; letter-spacing: .1em; color: var(--led); }
.cta__actions { display: flex; flex-direction: column; gap: 10px; position: relative; }
.cta-btn { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 16px; border: 1.5px solid var(--c); box-shadow: var(--glow); text-decoration: none; font-size: 13px; letter-spacing: .08em; transition: background .15s, transform .15s; }
.cta-btn:hover { background: rgba(90, 80, 255, .2); transform: translateY(-1px); }
.cta-btn--primary { background: var(--c); color: var(--bg); font-family: var(--display); font-weight: 800; box-shadow: 0 0 16px rgba(184, 179, 255, .5); }
.cta-btn--primary:hover { background: #d4d0ff; }
.cta-btn .ico { width: 17px; height: 17px; }

/* Cabecera: rol */
.dossier__who { display: flex; flex-direction: column; gap: 2px; }
.dossier__role { font-size: 13px; letter-spacing: .2em; color: var(--led); }
.dossier__alias { font-size: 14px; color: var(--dim-text); letter-spacing: .05em; }
.radar__caption { margin: 4px 0 0; font-size: 10px; letter-spacing: .2em; color: var(--dim-text); text-align: center; }

/* Homelab */
.sec__intro { margin: -4px 0 14px; color: var(--txt); font-size: 14px; max-width: 760px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 0 0 14px; }
.chips .tag { font-size: 11px; padding: 2px 9px; color: var(--c); }
.grid--svc { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.svc { padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.svc__role { font-size: 10px; letter-spacing: .15em; color: var(--dim-text); }
.svc__name { margin: 0; font-family: var(--display); font-weight: 800; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.svc__desc { margin: 0; font-size: 12.5px; line-height: 1.5; color: var(--txt); }

/* Pichaflix */
.steps { list-style: none; margin: 0 0 14px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; counter-reset: step; }
.step { position: relative; padding: 14px 14px 14px 58px; }
.step__num { position: absolute; left: 14px; top: 12px; font-family: var(--display); font-weight: 800; font-size: 22px; color: var(--purple); text-shadow: 0 0 10px rgba(169, 143, 255, .5); }
.step__title { margin: 0 0 4px; font-family: var(--display); font-weight: 800; font-size: 13px; letter-spacing: .04em; }
.step__text { margin: 0; font-size: 12.5px; line-height: 1.5; color: var(--txt); }
.storage { padding: 12px 16px; }
.storage table { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 6px; }
.storage td { border-bottom: 1px solid var(--dim); padding: 6px 2px; }
.storage tr:last-child td { border-bottom: 0; }
.storage__name { color: var(--c); white-space: nowrap; width: 40%; }
.storage__use { color: var(--txt); }

/* Trayectoria */
.timeline { padding: 4px 16px; }
.timeline table { width: 100%; border-collapse: collapse; font-size: 13px; }
.timeline td { border-bottom: 1px solid var(--dim); padding: 7px 2px; }
.timeline tr:last-child td { border-bottom: 0; }
.timeline__period { color: var(--dim-text); width: 100px; white-space: nowrap; }
.timeline__text { color: var(--txt); }
.timeline__title { display: block; }
.timeline__detail { display: block; margin-top: 3px; font-size: 12px; line-height: 1.5; color: var(--dim-text); }
.timeline td { vertical-align: top; }
.timeline__type { text-align: right; white-space: nowrap; }

/* Pie */
.footer { margin-top: 36px; }
.footer__links { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; font-size: 13px; }
.footer__label { color: var(--dim-text); letter-spacing: .12em; }
.footer__bar { display: flex; justify-content: space-between; align-items: center; margin-top: 18px; }
.footer__domain { font-size: 11px; letter-spacing: .2em; }

/* Móvil */
@media (max-width: 760px) {
  .dossier { grid-template-columns: 1fr; }
  .dossier__row { grid-template-columns: 1fr; }
  .dossier__row > :first-child { border-right: 0; border-bottom: 1.5px solid var(--c); }
  .dossier__side { flex-direction: row; flex-wrap: wrap; }
  .side-box { flex: 1 1 140px; }
  .topbar__nav { gap: 14px; }
  .timeline__period { width: auto; }
  .dossier__head { flex-direction: column; align-items: flex-start; gap: 4px; }
  .cta { grid-template-columns: 1fr; padding: 20px; }
  .timeline tr { display: grid; grid-template-columns: 1fr auto; column-gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--dim); }
  .timeline tr:last-child { border-bottom: 0; }
  .timeline td { border-bottom: 0; padding: 0; }
  .timeline__period { grid-column: 1; grid-row: 1; }
  .timeline__type { grid-column: 2; grid-row: 1; }
  .timeline__text { grid-column: 1 / -1; margin-top: 4px; }
}

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