/* Mohamed Ben Ahmed — portfolio
   Hecho a mano. Sin framework, sin build. */

:root {
  --paper: #fbf8f2;
  --paper-2: #f3ede2;
  --card: #fffdf9;
  --ink: #3a332c;
  --ink-2: #625a50;
  --muted: #958b7d;
  --rule: #e8e0d2;
  --accent: #c2562f;     /* backend · terracota */
  --sec: #3e8a5c;        /* ciberseguridad · verde */
  --ai: #2f7a94;         /* IA · azul petróleo */
  --accent-soft: #c2562f14;
  --serif: "Newsreader", "Iowan Old Style", Georgia, serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, monospace;
  --max: 1180px;
  --shadow: 0 1px 0 #00000008, 0 12px 32px -12px #5a3a2026;
}

:root[data-theme="dark"] {
  --paper: #22201d;
  --paper-2: #2a2724;
  --card: #2d2a26;
  --ink: #efe9de;
  --ink-2: #cfc7b8;
  --muted: #9c9383;
  --rule: #3a3631;
  --accent: #e8906c;
  --sec: #7cc597;
  --ai: #7cc0d6;
  --accent-soft: #e8906c1f;
  --shadow: 0 12px 32px -12px #0008;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 1.125rem/1.6 var(--serif); font-optical-sizing: auto;
  overflow-x: hidden;
}
::selection { background: var(--accent); color: var(--paper); }
a { color: inherit; text-decoration-color: var(--accent); text-underline-offset: .2em; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 3px; }
img { max-width: 100%; height: auto; display: block; }
.ar { font-family: "Noto Naskh Arabic", serif; }
.tfng { font-family: "Noto Sans Tifinagh", var(--mono); }
.mono { font-family: var(--mono); font-size: .8rem; }
.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: var(--paper); padding: .5rem 1rem; z-index: 50; }
.skip:focus { left: 1rem; top: 1rem; }
.container { max-width: var(--max); margin: 0 auto; padding: 0 1rem; }
@media (min-width: 760px) { .container { padding: 0 2rem; } }

/* progreso de lectura */
.progress { position: fixed; inset: 0 0 auto 0; height: 2px; z-index: 40;
  background: linear-gradient(90deg, var(--accent), var(--sec), var(--ai));
  transform-origin: 0 50%; transform: scaleX(0); }

/* ---------- barra superior ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent; transition: border-color .3s;
}
.topbar.scrolled { border-bottom-color: var(--rule); }
.topbar .container { display: flex; align-items: center; gap: 1rem; height: 60px; }
.logo { font-family: var(--mono); font-weight: 500; text-decoration: none; font-size: .95rem; }
.logo b { color: var(--accent); font-weight: 500; }
.logo .cursor { display: inline-block; width: .55em; height: 2px; background: var(--accent); margin-left: 1px; animation: blink 1s steps(1) infinite; vertical-align: -1px; }
.topnav { display: none; gap: 1.5rem; margin-left: auto; font-family: var(--mono); font-size: .78rem; }
.topnav a { text-decoration: none; color: var(--ink-2); }
.topnav a:hover { color: var(--accent); }
.topnav a::before { content: "./"; color: var(--muted); }
@media (min-width: 860px) { .topnav { display: flex; } }
.top-tools { margin-left: auto; display: flex; gap: .5rem; align-items: center; font-family: var(--mono); font-size: .75rem; }
@media (min-width: 860px) { .top-tools { margin-left: 1.5rem; } }
.top-tools a { color: var(--muted); text-decoration: none; }
.chip-btn {
  font-family: var(--mono); font-size: .72rem; color: var(--muted);
  background: none; border: 1px solid var(--rule); border-radius: 999px;
  padding: .3rem .7rem; cursor: pointer;
}
.chip-btn:hover { color: var(--accent); border-color: var(--accent); }

@keyframes blink { 50% { opacity: 0; } }

/* ---------- hero ---------- */
.hero { position: relative; min-height: calc(100vh - 60px); display: flex; align-items: center; padding: 3rem 0 4rem; }
#net { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.hero .container { position: relative; z-index: 1; display: grid; gap: 3rem; align-items: center; width: 100%; }
@media (min-width: 980px) { .hero .container { grid-template-columns: 1.1fr .9fr; } }

.greet { font-family: var(--mono); font-size: .85rem; color: var(--muted); margin: 0 0 1.25rem; }
.greet .p { color: var(--sec); }
.hello-id { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.25rem; }
.hello-id img { width: 72px; height: 72px; border-radius: 50%; border: 3px solid var(--card); box-shadow: 0 0 0 1px var(--rule), var(--shadow); }
.hello-id .ar { font-size: 1.4rem; color: var(--muted); }

h1 {
  font-weight: 400; font-size: clamp(3rem, 9vw, 6rem);
  line-height: .95; letter-spacing: -.035em; margin: 0 0 1.25rem;
}
h1 em { font-style: italic; color: var(--accent); }
h1 .scramble-char { color: var(--sec); font-family: var(--mono); font-style: normal; font-size: .8em; }

.typed { font-family: var(--mono); font-size: clamp(.95rem, 2.2vw, 1.15rem); color: var(--ink-2); min-height: 1.6em; margin: 0 0 1.5rem; }
.typed .k { color: var(--muted); }
.typed .caret { display: inline-block; width: .6ch; height: 1.15em; background: var(--accent); vertical-align: -.2em; animation: blink 1s steps(1) infinite; margin-left: 2px; }
.hero .intro { font-size: 1.25rem; line-height: 1.5; max-width: 34ch; margin: 0 0 2rem; color: var(--ink-2); }
.cta { display: flex; flex-wrap: wrap; gap: .75rem; }
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: var(--mono); font-size: .82rem; text-decoration: none;
  padding: .8rem 1.1rem; border-radius: 8px; border: 1px solid var(--accent);
  color: var(--accent); background: var(--card); transition: transform .2s, background .2s, color .2s;
}
.btn:hover { transform: translateY(-2px); }
.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:hover { color: #fff; filter: brightness(1.05); }
.status { font-family: var(--mono); font-size: .75rem; color: var(--muted); margin-top: 1.75rem; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.status .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--sec); animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--sec) 50%, transparent); } 70% { box-shadow: 0 0 0 8px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

/* ---------- terminal ---------- */
.term {
  background: var(--card); border: 1px solid var(--rule); border-radius: 12px;
  box-shadow: var(--shadow); overflow: hidden; font-family: var(--mono); font-size: .82rem;
}
.term-bar { display: flex; align-items: center; gap: .4rem; padding: .65rem .9rem; border-bottom: 1px solid var(--rule); background: var(--paper-2); }
.term-bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--rule); }
.term-bar i:nth-child(1) { background: #e3836a; } .term-bar i:nth-child(2) { background: #e8c16a; } .term-bar i:nth-child(3) { background: #8cc48a; }
.term-bar span { margin-left: auto; color: var(--muted); font-size: .72rem; }
.term-body { height: 330px; overflow-y: auto; padding: 1rem; line-height: 1.65; color: var(--ink-2); cursor: text; }
.term-body p { margin: 0; white-space: pre-wrap; word-break: break-word; }
.term-body .pr { color: var(--sec); }
.term-body .pr b { color: var(--ai); font-weight: 400; }
.term-body .c { color: var(--accent); }
.term-body .m { color: var(--muted); }
.term-body .g { color: var(--sec); }
.term-body .a { color: var(--ai); }
.term-line { display: flex; gap: .5ch; }
.term-line input { flex: 1; border: 0; outline: 0; background: transparent; font: inherit; color: var(--ink); padding: 0; caret-color: var(--accent); min-width: 0; }
.term-hints { display: flex; flex-wrap: wrap; gap: .4rem; padding: .75rem .9rem; border-top: 1px solid var(--rule); }
.term-hints button { font: inherit; font-size: .72rem; border: 1px solid var(--rule); background: var(--paper); color: var(--ink-2); border-radius: 6px; padding: .25rem .55rem; cursor: pointer; }
.term-hints button:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- secciones ---------- */
section.block { padding: 6rem 0; position: relative; }
.eyebrow { font-family: var(--mono); font-size: .78rem; color: var(--accent); margin: 0 0 .75rem; letter-spacing: .02em; }
.eyebrow::before { content: "// "; color: var(--muted); }
h2 { font-weight: 400; font-size: clamp(2rem, 5vw, 3.25rem); line-height: 1.05; letter-spacing: -.025em; margin: 0 0 1rem; max-width: 20ch; }
h2 em { color: var(--accent); }
.sub { color: var(--ink-2); max-width: 58ch; margin: 0 0 3rem; font-size: 1.15rem; }

/* tres frentes */
.pillars { display: grid; gap: 1.25rem; grid-template-columns: 1fr; }
@media (min-width: 900px) { .pillars { grid-template-columns: repeat(3, 1fr); } }
.pillar {
  --c: var(--accent);
  background: var(--card); border: 1px solid var(--rule); border-radius: 14px;
  padding: 1.5rem; display: flex; flex-direction: column; gap: .75rem;
  box-shadow: var(--shadow); transition: transform .3s, border-color .3s;
  position: relative; overflow: hidden;
}
.pillar:hover { transform: translateY(-4px); border-color: var(--c); }
.pillar.sec { --c: var(--sec); } .pillar.ai { --c: var(--ai); }
.pillar .tagline { font-family: var(--mono); font-size: .72rem; color: var(--c); }
.pillar h3 { font-weight: 500; font-size: 1.55rem; margin: 0; letter-spacing: -.01em; }
.pillar p { margin: 0; color: var(--ink-2); font-size: 1.02rem; }
.pillar .viz { background: var(--paper); border: 1px solid var(--rule); border-radius: 10px; height: 170px; display: grid; place-items: center; overflow: hidden; }
.pillar ul { list-style: none; padding: 0; margin: .25rem 0 0; display: flex; flex-wrap: wrap; gap: .35rem; }
.pillar li { font-family: var(--mono); font-size: .7rem; padding: .2rem .5rem; border-radius: 5px; background: color-mix(in srgb, var(--c) 10%, transparent); color: var(--c); }

/* viz: backend flow */
.flow text { font-family: var(--mono); font-size: 10px; fill: var(--ink-2); }
.flow rect { fill: var(--card); stroke: var(--rule); }
.flow .wire { stroke: var(--rule); stroke-dasharray: 3 4; fill: none; }
.flow .pkt { fill: var(--accent); }
.flow .pkt.back { fill: var(--sec); }

/* viz: hash */
.hashbox { width: 100%; height: 100%; padding: .9rem; display: flex; flex-direction: column; gap: .5rem; font-family: var(--mono); font-size: .72rem; }
.hashbox label { color: var(--muted); }
.hashbox input { font: inherit; font-size: .8rem; border: 1px solid var(--rule); background: var(--card); color: var(--ink); border-radius: 6px; padding: .45rem .6rem; outline: none; }
.hashbox input:focus { border-color: var(--sec); }
.hashbox output { color: var(--sec); word-break: break-all; line-height: 1.45; }

/* viz: neural net */
.nn line { stroke: var(--rule); stroke-width: 1; transition: stroke .4s, stroke-width .4s; }
.nn line.on { stroke: var(--ai); stroke-width: 1.6; }
.nn circle { fill: var(--card); stroke: var(--ai); stroke-width: 1.4; transition: fill .4s; }
.nn circle.on { fill: var(--ai); }

/* proyectos */
.projects { display: grid; gap: 1.25rem; grid-template-columns: 1fr; }
@media (min-width: 820px) { .projects { grid-template-columns: repeat(2, 1fr); } }
.project {
  background: var(--card); border: 1px solid var(--rule); border-radius: 14px;
  overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow);
  transition: transform .3s, border-color .3s;
}
.project:hover { transform: translateY(-4px); border-color: var(--accent); }
.project pre {
  margin: 0; padding: 1.1rem 1.25rem; background: var(--paper-2); border-bottom: 1px solid var(--rule);
  font-family: var(--mono); font-size: .74rem; line-height: 1.6; color: var(--ink-2); overflow-x: auto;
}
.project pre .k { color: var(--accent); } .project pre .s { color: var(--sec); } .project pre .f { color: var(--ai); } .project pre .c { color: var(--muted); }
.project .body { padding: 1.25rem 1.25rem 1.4rem; }
.project h3 { margin: 0 0 .4rem; font-weight: 500; font-size: 1.35rem; display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; }
.project h3 small { font-family: var(--mono); font-size: .72rem; color: var(--muted); font-weight: 400; }
.project p { margin: 0 0 .9rem; color: var(--ink-2); font-size: 1.02rem; }
.tags { display: flex; flex-wrap: wrap; gap: .3rem .8rem; list-style: none; padding: 0; margin: 0; font-family: var(--mono); font-size: .72rem; color: var(--muted); }
.tags li::before { content: "#"; color: var(--accent); }

/* git log */
.gitlog { font-family: var(--mono); font-size: .85rem; max-width: 860px; }
.commit { position: relative; padding-left: 2.25rem; }
.commit::before { content: ""; position: absolute; left: .55rem; top: 0; bottom: 0; width: 2px; background: var(--rule); }
.commit:first-child::before { top: 1.1rem; }
.commit:last-child::before { bottom: auto; height: 1.1rem; }
.commit .node { position: absolute; left: .17rem; top: .8rem; width: 14px; height: 14px; border-radius: 50%; background: var(--paper); border: 2px solid var(--accent); }
.commit.head .node { background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.commit details { border-bottom: 1px dashed var(--rule); }
.commit summary { list-style: none; cursor: pointer; padding: .7rem 0; display: grid; grid-template-columns: auto 1fr; gap: .25rem 1rem; align-items: baseline; }
.commit summary::-webkit-details-marker { display: none; }
.commit summary:hover .msg { color: var(--accent); }
.commit .hash { color: var(--accent); }
.commit .ref { color: var(--sec); }
.commit .msg { font-family: var(--serif); font-size: 1.15rem; color: var(--ink); transition: color .2s; grid-column: 1 / -1; }
@media (min-width: 640px) { .commit .msg { grid-column: auto; } }
.commit .date { color: var(--muted); font-size: .75rem; grid-column: 1 / -1; }
.commit summary::after { content: "+ ver diff"; color: var(--muted); font-size: .72rem; grid-column: 1 / -1; }
html[lang="en"] .commit summary::after { content: "+ show diff"; }
.commit details[open] summary::after { content: "− ocultar"; }
html[lang="en"] .commit details[open] summary::after { content: "− hide"; }
.commit .diff { margin: 0 0 1rem; padding: .75rem 1rem; background: var(--card); border: 1px solid var(--rule); border-radius: 8px; font-size: .8rem; line-height: 1.7; }
.commit .diff p { margin: 0; color: var(--ink-2); }
.commit .diff .add { color: var(--sec); }
.commit .diff .add::before { content: "+ "; }

.branch { margin-top: 3.5rem; display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 760px) { .branch { grid-template-columns: repeat(3, 1fr); } }
.learn { border: 1px solid var(--rule); border-radius: 12px; padding: 1.1rem 1.2rem; background: var(--card); }
.learn .mono { color: var(--muted); }
.learn h3 { font-weight: 500; font-size: 1.15rem; margin: .3rem 0 .2rem; }
.learn p { margin: 0; color: var(--ink-2); font-size: .98rem; }
.learn.now { border-color: var(--ai); }
.learn.now .mono { color: var(--ai); }

/* stack marquee */
.marquee { overflow: hidden; border-block: 1px solid var(--rule); padding: 1.1rem 0; mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.marquee + .marquee { border-top: 0; }
.track { display: flex; gap: 2.5rem; width: max-content; animation: slide 40s linear infinite; font-family: var(--mono); font-size: 1rem; color: var(--ink-2); }
.marquee.rev .track { animation-direction: reverse; animation-duration: 48s; }
.track span::before { content: "◆"; color: var(--accent); margin-right: 2.5rem; font-size: .6rem; vertical-align: .2em; }
.marquee:hover .track { animation-play-state: paused; }
@keyframes slide { to { transform: translateX(-50%); } }

/* idiomas */
.langs { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 3rem; }
.lang { border: 1px solid var(--rule); border-radius: 999px; padding: .5rem 1rem; background: var(--card); display: flex; align-items: baseline; gap: .6rem; }
.lang b { font-weight: 400; font-size: 1.2rem; }
.lang span { font-family: var(--mono); font-size: .7rem; color: var(--muted); }

/* contacto */
.contact-card {
  background: var(--card); border: 1px solid var(--rule); border-radius: 18px; box-shadow: var(--shadow);
  padding: clamp(1.5rem, 5vw, 3.5rem); text-align: left; position: relative; overflow: hidden;
}
.contact-card .cmd { font-family: var(--mono); font-size: .85rem; color: var(--sec); margin: 0 0 1rem; }
.contact-card .big { display: inline-block; font-size: clamp(1.6rem, 6vw, 3.4rem); letter-spacing: -.02em; text-decoration: none; border-bottom: 2px solid var(--accent); overflow-wrap: anywhere; margin: .25rem 0 2rem; line-height: 1.15; }
.contact-card .cta { margin-top: .5rem; }

footer.foot { padding: 3rem 0 4rem; font-family: var(--mono); font-size: .72rem; color: var(--muted); }
footer.foot .container { display: flex; flex-wrap: wrap; gap: .5rem 2rem; justify-content: space-between; }

/* aparición al hacer scroll (solo si hay JS) */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity .8s cubic-bezier(.2,.7,.2,1), transform .8s cubic-bezier(.2,.7,.2,1); }
.js .reveal.in { opacity: 1; transform: none; }
.js .reveal.d1 { transition-delay: .1s; } .js .reveal.d2 { transition-delay: .2s; } .js .reveal.d3 { transition-delay: .3s; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal { opacity: 1; transform: none; }
}
@media print { #net, .topbar, .term, .progress { display: none; } }

/* ajustes */
.pillar h3 { line-height: 1.2; }
.commit summary { display: flex; flex-wrap: wrap; gap: .15rem .75rem; align-items: baseline; }
.commit .msg, .commit .date, .commit summary::after { flex-basis: 100%; }
.commit .ref:empty { display: none; }

/* consulta SQL de la portada (guiño al banner de LinkedIn) */
:root { --kw: #9a3fb0; }
:root[data-theme="dark"] { --kw: #d394e6; }
.query { font-family: var(--mono); font-size: clamp(.82rem, 2.3vw, 1rem); line-height: 1.75; color: var(--ink-2); margin: 0 0 1.5rem; }
.q-line { display: block; overflow: hidden; white-space: nowrap; width: 0; animation: type var(--d, .8s) steps(var(--n)) var(--delay, 0s) forwards; }
.query .kw { color: var(--kw); font-weight: 500; }
.query .str { color: var(--accent); }
.q-res { display: block; color: var(--sec); font-size: .85em; opacity: 0; animation: fadein .4s 2.1s forwards; }
@keyframes type { to { width: calc(var(--n) * 1ch); } }
@keyframes fadein { to { opacity: 1; } }
.id-text { display: flex; flex-direction: column; gap: .15rem; }
.id-text .hi { font-family: var(--mono); font-size: .75rem; color: var(--muted); }
.term-body .k { color: var(--kw); }
@media (prefers-reduced-motion: reduce) { .q-line { width: auto; } .q-res { opacity: 1; } }
.no-anim .q-line { width: auto; } .no-anim .q-res { opacity: 1; }

/* ---- consulta a todo el ancho, como una barra de búsqueda ---- */
.hero .container { align-items: start; }
.query-wrap { grid-column: 1 / -1; margin-bottom: .5rem; }
.query {
  display: flex; align-items: center; flex-wrap: wrap;
  width: 100%; margin: 0;
  font-size: clamp(.85rem, 2.15vw, 1.8rem); line-height: 1.5;
  padding: .8em 1.1em; border: 1px solid var(--rule); border-radius: 999px;
  background: color-mix(in srgb, var(--card) 88%, transparent);
  box-shadow: var(--shadow); backdrop-filter: blur(4px);
}
.query .q-line { display: inline-block; vertical-align: bottom; }
.q-ico {
  width: .8em; height: .8em; border: 2px solid var(--muted); border-radius: 50%;
  position: relative; margin-right: .8em; flex: none;
}
.q-ico::after { content: ""; position: absolute; width: .4em; height: 2px; background: var(--muted); right: -.38em; bottom: -.12em; transform: rotate(45deg); }
.q-caret { display: inline-block; width: .55ch; height: 1.1em; background: var(--accent); margin-left: 2px; animation: blink 1s steps(1) infinite; }
.query-wrap .q-res { margin: .7rem 0 0 1.4rem; font-family: var(--mono); font-size: .85rem; }
@media (max-width: 759px) {
  .query { border-radius: 16px; font-size: .9rem; }
  .query .q2 { display: block; width: 0; }
  @keyframes type { to { width: calc(var(--n) * 1ch); } }
}
@media (prefers-reduced-motion: reduce) { .query .q-line { width: auto !important; } }

/* foto en contacto */
.contact-photo { width: 88px; height: 88px; border-radius: 50%; margin-bottom: 1.25rem; border: 4px solid var(--paper); box-shadow: 0 0 0 1px var(--rule), var(--shadow); }
@media (min-width: 860px) {
  .contact-photo { position: absolute; top: clamp(1.5rem, 5vw, 3.5rem); right: clamp(1.5rem, 5vw, 3.5rem); width: 168px; height: 168px; margin: 0; }
}
@media (max-width: 759px) {
  .query { display: block; }
  .q-ico { display: inline-block; vertical-align: -.1em; }
}
@media (max-width: 759px) { .q-caret { display: none; } }

/* sobre mí (página de entidad para Google) */
.about { display: grid; gap: 2.5rem; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 980px) { .about { grid-template-columns: 1.35fr .9fr; gap: 4rem; } }
.about-text { max-width: 62ch; }
.about-text p { color: var(--ink-2); font-size: 1.15rem; margin: 0 0 1.1rem; }
.about-text strong { color: var(--ink); font-weight: 500; }
.profile-card {
  margin: 0; padding: 1.4rem 1.5rem; background: var(--card); border: 1px solid var(--rule);
  border-radius: 14px; box-shadow: var(--shadow); font-family: var(--mono); font-size: .84rem;
  line-height: 1.85; color: var(--ink-2); overflow-x: auto;
}
.profile-card .k { color: var(--kw); } .profile-card .s { color: var(--sec); } .profile-card .c { color: var(--muted); }
@media (min-width: 980px) { .profile-card { margin-top: 5.5rem; } }

.foot-query { flex-basis: 100%; margin: 1rem 0 0; padding-top: 1rem; border-top: 1px solid var(--rule); color: var(--muted); overflow-wrap: anywhere; }

/* resultado de búsqueda que aparece al terminar la consulta */
.query-wrap .q-res {
  display: flex; flex-direction: column; gap: .6rem; align-items: flex-start;
  margin: 1rem 0 0 1.4rem; font-family: var(--mono); font-size: .85rem; color: inherit;
  opacity: 0; transform: translateY(8px);
  animation: hit-in .6s cubic-bezier(.2,.7,.2,1) 2.05s forwards;
}
@keyframes hit-in { to { opacity: 1; transform: none; } }
.q-meta { color: var(--sec); }
.q-hit {
  display: grid; grid-template-columns: auto 1fr; column-gap: .85rem; row-gap: .1rem; align-items: center;
  max-width: 100%; padding: .8rem 1.1rem .85rem .9rem; text-decoration: none;
  background: var(--card); border: 1px solid var(--rule); border-radius: 12px; box-shadow: var(--shadow);
  transition: border-color .2s, transform .2s;
}
.q-hit:hover { border-color: var(--accent); transform: translateY(-2px); }
.q-fav {
  grid-row: 1 / 3; width: 32px; height: 32px; border-radius: 50%;
  background: var(--accent); color: #fff; display: grid; place-items: center;
  font-family: var(--serif); font-style: italic; font-size: 1rem; line-height: 1;
}
.q-url { color: var(--sec); font-size: .8rem; }
.q-title { font-family: var(--serif); font-size: clamp(1rem, 2vw, 1.25rem); color: var(--ai); line-height: 1.3; }
.q-hit:hover .q-title { text-decoration: underline; text-underline-offset: .2em; }
@media (max-width: 759px) { .query-wrap .q-res { margin-left: 0; } }
@media (prefers-reduced-motion: reduce) { .query-wrap .q-res { opacity: 1; transform: none; } }

/* resumen para reclutadores (--tldr) */
html:not(.js) [data-tldr-open], html:not(.js) [data-copy-mail] { display: none; }
button.btn { cursor: pointer; font: inherit; font-family: var(--mono); font-size: .82rem; }
.tldr {
  width: min(640px, calc(100vw - 2rem)); max-height: calc(100vh - 2rem); padding: 0;
  border: 1px solid var(--rule); border-radius: 16px; background: var(--card); color: var(--ink);
  box-shadow: 0 30px 80px -20px #3a2a1a55;
}
.tldr[open] { animation: tldr-in .35s cubic-bezier(.2,.7,.2,1); }
@keyframes tldr-in { from { opacity: 0; transform: translateY(16px) scale(.98); } }
.tldr::backdrop { background: color-mix(in srgb, var(--paper) 55%, transparent); backdrop-filter: blur(6px); }
.tldr-head { display: flex; align-items: center; justify-content: space-between; padding: .8rem 1.25rem; border-bottom: 1px solid var(--rule); background: var(--paper-2); font-family: var(--mono); font-size: .8rem; color: var(--sec); }
.tldr-close { background: none; border: 0; font-size: 1rem; color: var(--muted); cursor: pointer; padding: .2rem .4rem; border-radius: 6px; }
.tldr-close:hover { color: var(--accent); }
.tldr h2 { font-size: clamp(1.6rem, 4vw, 2.2rem); margin: 1.25rem 1.5rem .75rem; }
.tldr-list { margin: 0 1.5rem 1.25rem; }
.tldr-list div { display: grid; grid-template-columns: 1fr; gap: .1rem; padding: .6rem 0; border-bottom: 1px dashed var(--rule); }
@media (min-width: 560px) { .tldr-list div { grid-template-columns: 8.5rem 1fr; gap: 1rem; } }
.tldr-list dt { font-family: var(--mono); font-size: .75rem; color: var(--kw); padding-top: .2rem; }
.tldr-list dd { margin: 0; font-size: 1.02rem; color: var(--ink-2); }
.tldr-list dd.ok { color: var(--sec); font-weight: 500; }
.tldr .cta { padding: 0 1.5rem 1.5rem; }
.btn.copied { background: var(--sec); border-color: var(--sec); color: #fff; }
