:root{
  /* Marca Totbits: navy #1A3B5D · cian #00D0D0 · fondo calido hsl(40 20% 98%) */
  --bg:#FAF9F6;
  --surface:#FFFFFF;
  --surface-2:#F1F5F9;
  --ink:#0F172A;
  --ink-2:#334155;
  --muted:#64748B;
  --rule:#E2E8F0;
  --rule-strong:#C3CEDB;
  --e:#00797B;
  --p:#1A3B5D;
  --e-wash:rgba(0,208,208,.16);
  --p-wash:rgba(26,59,93,.10);
  --shadow-card:0 0 0 1px rgba(15,23,42,.05), 0 2px 4px rgba(15,23,42,.02), 0 12px 24px -12px rgba(15,23,42,.08);

  --serif:"Source Serif 4",Charter,Georgia,"Times New Roman",serif;
  --sans:"Archivo","Helvetica Neue",Helvetica,Arial,sans-serif;
  --mono:"IBM Plex Mono",ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
}
@media (prefers-color-scheme:dark){
  :root:not([data-theme="light"]){
    --bg:#050A14;
    --surface:#0A1120;
    --surface-2:#131E2E;
    --ink:#F8FAFC;
    --ink-2:#CBD5E1;
    --muted:#94A3B8;
    --rule:#1D293D;
    --rule-strong:#33445E;
    --e:#00D0D0;
    --p:#8FB4D9;
    --e-wash:rgba(0,208,208,.14);
    --p-wash:rgba(143,180,217,.14);
    --shadow-card:0 0 0 1px rgba(255,255,255,.05), 0 12px 24px -12px rgba(0,0,0,.5);
  }
}
:root[data-theme="dark"]{
  --bg:#050A14;
  --surface:#0A1120;
  --surface-2:#131E2E;
  --ink:#F8FAFC;
  --ink-2:#CBD5E1;
  --muted:#94A3B8;
  --rule:#1D293D;
  --rule-strong:#33445E;
  --e:#00D0D0;
  --p:#8FB4D9;
  --e-wash:rgba(0,208,208,.14);
  --p-wash:rgba(143,180,217,.14);
  --shadow-card:0 0 0 1px rgba(255,255,255,.05), 0 12px 24px -12px rgba(0,0,0,.5);
}

*{box-sizing:border-box}
body{
  background:var(--bg);
  color:var(--ink);
  font-family:var(--serif);
  font-size:16.5px;
  line-height:1.6;
  -webkit-font-smoothing:antialiased;
}
.wrap{max-width:1080px;margin:0 auto;padding:clamp(2rem,5vw,4.5rem) clamp(1.1rem,4vw,2.5rem) 4rem}

/* ── masthead ─────────────────────────────────────────────── */
.mast{display:flex;flex-direction:column;gap:1.1rem}
.eyebrow{
  font-family:var(--mono);font-size:.70rem;letter-spacing:.14em;
  text-transform:uppercase;color:var(--muted);
}
.mast h1{
  font-family:var(--sans);font-weight:700;
  font-size:clamp(2.6rem,7vw,4.4rem);line-height:.98;letter-spacing:-.035em;
  margin:0;text-wrap:balance;
}
.duobar{display:flex;height:5px;width:100%;max-width:520px;border-radius:2px;overflow:hidden}
.duobar span:first-child{flex:1;background:var(--p)}
.duobar span:last-child{flex:1;background:var(--e)}
.lead{
  font-size:clamp(1.1rem,2.2vw,1.32rem);line-height:1.48;color:var(--ink-2);
  max-width:36ch;margin:0;
}

.facts{
  margin-top:2.4rem;display:grid;gap:0;
  grid-template-columns:repeat(auto-fit,minmax(215px,1fr));
  border-top:1px solid var(--rule);
}
.fact{padding:.95rem 1.1rem .95rem 0;border-bottom:1px solid var(--rule)}
.fact dt{
  font-family:var(--mono);font-size:.66rem;letter-spacing:.13em;text-transform:uppercase;
  color:var(--muted);margin:0 0 .28rem;
}
.fact dd{margin:0;font-size:.95rem;line-height:1.42;color:var(--ink)}
.fact a{color:inherit;text-decoration:none;border-bottom:1px solid var(--rule-strong)}
.fact a:hover{border-bottom-color:currentColor}

/* ── sections ─────────────────────────────────────────────── */
.sections{display:flex;flex-direction:column;gap:clamp(2.6rem,5vw,3.9rem);margin-top:clamp(2.6rem,5vw,3.9rem)}
.sec{
  display:grid;grid-template-columns:9.5rem 1fr;gap:2rem;
  border-top:2px solid var(--ink);padding-top:1rem;
}
.sec > h2{
  grid-column:1;grid-row:1;
  font-family:var(--mono);font-weight:500;font-size:.72rem;letter-spacing:.15em;
  text-transform:uppercase;color:var(--ink);margin:.15rem 0 0;
}
.sec-body{grid-column:2;grid-row:1 / -1;min-width:0}

/* ── capacidades ──────────────────────────────────────────── */
.caps{display:grid;gap:0;grid-template-columns:repeat(auto-fit,minmax(270px,1fr))}
.cap{padding:0 1.4rem 1.3rem 0}
.cap h3{
  font-family:var(--sans);font-weight:600;font-size:1.02rem;letter-spacing:-.012em;
  margin:0 0 .3rem;
}
.cap p{margin:0;color:var(--ink-2);font-size:.94rem;line-height:1.5}

/* ── perfiles ─────────────────────────────────────────────── */
.profiles{display:grid;gap:1.6rem;grid-template-columns:repeat(auto-fit,minmax(310px,1fr))}
.profile{
  background:var(--surface);border:1px solid var(--rule);border-radius:12px;
  box-shadow:var(--shadow-card);
  padding:1.5rem 1.5rem 1.7rem;position:relative;overflow:hidden;
}
.profile::before{content:"";position:absolute;inset:0 0 auto 0;height:4px;background:var(--own)}
.p-head{display:flex;align-items:baseline;gap:.7rem;margin-bottom:.15rem}
.p-mark{
  font-family:var(--mono);font-size:.72rem;font-weight:500;letter-spacing:.06em;
  color:var(--own);border:1px solid var(--own);border-radius:5px;
  padding:.1rem .38rem;flex:none;
}
.profile h3{
  font-family:var(--sans);font-weight:700;font-size:1.42rem;letter-spacing:-.025em;
  margin:0;line-height:1.15;
}
.p-role{
  font-family:var(--mono);font-size:.72rem;letter-spacing:.06em;color:var(--own);
  margin:.45rem 0 1rem;
}
.p-bio{margin:0 0 1.35rem;font-size:.96rem;line-height:1.55;color:var(--ink-2)}
.p-sub{
  font-family:var(--mono);font-size:.65rem;letter-spacing:.14em;text-transform:uppercase;
  color:var(--muted);margin:0 0 .6rem;padding-top:.9rem;border-top:1px solid var(--rule);
}
.track{list-style:none;margin:0 0 1.4rem;padding:0;display:flex;flex-direction:column;gap:.72rem}
.track li{display:grid;grid-template-columns:7rem 1fr;gap:.7rem;align-items:baseline}
.track time{
  font-family:var(--mono);font-size:.7rem;color:var(--muted);
  font-variant-numeric:tabular-nums;white-space:nowrap;
}
.track b{font-family:var(--sans);font-weight:600;font-size:.93rem;letter-spacing:-.005em}
.track span{display:block;font-size:.88rem;color:var(--ink-2);line-height:1.42}
.hits{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:.42rem}
.hits li{font-size:.9rem;color:var(--ink-2);padding-left:.95rem;position:relative;line-height:1.45}
.hits li::before{content:"—";position:absolute;left:0;color:var(--own)}
.p-contact{
  font-family:var(--mono);font-size:.72rem;color:var(--muted);
  margin:1.35rem 0 0;padding-top:.9rem;border-top:1px solid var(--rule);line-height:1.7;
}
.p-contact a{color:var(--ink-2);text-decoration:none;border-bottom:1px solid var(--rule-strong)}
.p-contact a:hover{color:var(--own);border-bottom-color:currentColor}

/* ── proyectos ────────────────────────────────────────────── */
.projects{display:flex;flex-direction:column;gap:0}
.proj{padding:1.35rem 0;border-bottom:1px solid var(--rule)}
.proj:first-child{padding-top:0}
.proj-top{display:flex;flex-wrap:wrap;align-items:baseline;gap:.55rem .8rem;margin-bottom:.45rem}
.proj h3{font-family:var(--sans);font-weight:600;font-size:1.12rem;letter-spacing:-.018em;margin:0}
.tag{
  font-family:var(--mono);font-size:.62rem;letter-spacing:.1em;text-transform:uppercase;
  padding:.16rem .42rem;border-radius:5px;white-space:nowrap;
}
.tag-e{color:var(--e);background:var(--e-wash)}
.tag-p{color:var(--p);background:var(--p-wash)}
.proj p{margin:0 0 .7rem;color:var(--ink-2);font-size:.96rem;line-height:1.55;max-width:68ch}
.meta{display:flex;flex-direction:column;gap:.22rem}
.meta div{display:grid;grid-template-columns:5.2rem 1fr;gap:.7rem;align-items:baseline}
.meta dt{
  font-family:var(--mono);font-size:.64rem;letter-spacing:.11em;text-transform:uppercase;
  color:var(--muted);
}
.meta dd{margin:0;font-family:var(--mono);font-size:.75rem;line-height:1.55;color:var(--ink-2)}

/* ── skills ───────────────────────────────────────────────── */
.legend{
  display:flex;flex-wrap:wrap;gap:1.2rem;align-items:center;
  font-family:var(--mono);font-size:.7rem;color:var(--muted);
  padding-bottom:1.2rem;margin-bottom:1.4rem;border-bottom:1px solid var(--rule);
}
.legend span{display:inline-flex;align-items:center;gap:.42rem}
.grid-skills{display:grid;gap:1.6rem;grid-template-columns:repeat(auto-fit,minmax(260px,1fr))}
.grp h3{
  font-family:var(--mono);font-weight:500;font-size:.66rem;letter-spacing:.14em;
  text-transform:uppercase;color:var(--muted);margin:0 0 .7rem;
}
.chips{display:flex;flex-wrap:wrap;gap:.35rem}
.chip{
  display:inline-flex;align-items:center;gap:.4rem;
  background:var(--surface);border:1px solid var(--rule);border-radius:6px;
  padding:.26rem .5rem;font-size:.83rem;line-height:1.25;color:var(--ink);
}
.own{display:inline-flex;gap:2px;flex:none}
.own i{width:9px;height:4px;border-radius:1px;background:var(--rule-strong);opacity:.35}
.own i.on-e{background:var(--e);opacity:1}
.own i.on-p{background:var(--p);opacity:1}

/* ── footer ───────────────────────────────────────────────── */
footer{
  margin-top:3.4rem;padding-top:1.3rem;border-top:2px solid var(--ink);
  display:flex;flex-wrap:wrap;gap:.7rem 2rem;justify-content:space-between;
  font-family:var(--mono);font-size:.7rem;letter-spacing:.05em;color:var(--muted);
}
footer a{color:var(--ink-2);text-decoration:none;border-bottom:1px solid var(--rule-strong)}
footer a:hover{border-bottom-color:currentColor}
a:focus-visible,.chip:focus-visible{outline:2px solid var(--e);outline-offset:2px}

@media (max-width:840px){
  .sec{grid-template-columns:1fr;gap:.85rem}
  .sec > h2,.sec-body{grid-column:1;grid-row:auto}
  .sec > h2{margin-bottom:0}
}
@media (max-width:460px){
  .track li{grid-template-columns:1fr;gap:.1rem}
  .meta div{grid-template-columns:1fr;gap:.05rem}
}

/* ── barra de sitio (solo en las paginas de totbits.es) ───── */
.sitebar{
  position:sticky;top:0;z-index:20;background:var(--surface);
  border-bottom:1px solid var(--rule);
}
.sitebar-inner{
  max-width:1080px;margin:0 auto;height:56px;
  padding:0 clamp(1.1rem,4vw,2.5rem);
  display:flex;align-items:center;justify-content:space-between;gap:1rem;
}
.sitebar-home{
  display:inline-flex;align-items:center;gap:.55rem;
  font-family:var(--sans);font-weight:600;font-size:.92rem;letter-spacing:-.01em;
  color:var(--ink);text-decoration:none;
}
.sitebar-home img{width:26px;height:26px;border-radius:50%}
.sitebar-links{display:flex;align-items:center;gap:1.1rem}
.sitebar-links a{
  font-family:var(--mono);font-size:.72rem;letter-spacing:.06em;
  color:var(--muted);text-decoration:none;
}
.sitebar-links a:hover{color:var(--e)}
.sitebar-links a.lang{
  text-transform:uppercase;border:1px solid var(--rule-strong);
  border-radius:5px;padding:.15rem .4rem;color:var(--ink-2);
}
.sitebar-links a.lang:hover{border-color:var(--e);color:var(--e)}
@media (max-width:420px){ .sitebar-home span{display:none} }
