
:root{
  --bg:#f2f4f5;
  --panel:#ffffff;
  --panel-2:#f7f8f9;
  --text:#1c1c1c;
  --muted:#555;
  --brand:#2a3b47;
  --accent:#5f7a87;
  --border:#d6d9db;
  --link:#2a3b47;
  --shadow:0 3px 12px rgba(0,0,0,.05);
  --radius:12px;
  --focus: 0 0 0 3px rgba(42,59,71,.25);
}

*{box-sizing:border-box}
html{scroll-behavior:smooth}
html,body{overflow-x:hidden} /* evita desbordes horizontales en móvil y desktop */
body{
  margin:0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif;
  background:var(--bg); color:var(--text); line-height:1.6;
  -webkit-font-smoothing:antialiased; text-rendering:optimizeLegibility;
}
a{color:var(--link);text-decoration:none}
/* Hover sin cambiar ancho (no padding extra) */
a:hover{
  color:#fff;
  background:var(--accent);
  border-radius:6px;
  transition:.2s;
}
img{max-width:100%;height:auto;display:block}

/* Utilities */
.wrap{max-width:1100px;margin:0 auto;padding:24px}
.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}
.btn{display:inline-block;border:1px solid var(--border);padding:.6rem .9rem;border-radius:8px;font-weight:600;background:var(--panel-2);color:var(--brand)}
.btn:hover{background:var(--accent);color:#fff}
.btn-row{display:flex;gap:10px;flex-wrap:wrap}
.card{border:1px solid var(--border);border-radius:var(--radius);background:var(--panel);padding:18px;box-shadow:var(--shadow)}
.muted{color:var(--muted)}
.list{list-style:none;margin:0;padding:0;display:grid;gap:14px}
.item h4{margin:0 0 4px;font-size:1rem;color:var(--brand)}
.item .when{font-size:.85rem;color:var(--muted)}
.tag{display:inline-block;padding:.2rem .55rem;border-radius:999px;border:1px solid var(--border);font-size:.78rem;color:var(--muted);background:var(--panel-2)}
.tags{display:flex;flex-wrap:wrap;gap:8px}
.section{margin:26px 0}
.section h2{font-size:1.25rem;margin:0 0 12px;color:var(--brand)}
.cols{display:grid;grid-template-columns:repeat(3,1fr);gap:16px}
@media (max-width:900px){.cols{grid-template-columns:1fr}}


/* Header & nav — fixed */
:root{ --head-h: 120px; } /* valor por defecto, el JS lo actualiza */

header.site{
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 9990; /* debajo del sheet (9999) y overlay (9998), pero encima del contenido */
  backdrop-filter: saturate(180%) blur(8px);
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  border-bottom: 1px solid var(--border);
}

/* Compensar la altura del header fijo y corregir anclajes */
body{ padding-top: var(--head-h); }
html{ scroll-padding-top: var(--head-h); }
[id]{ scroll-margin-top: var(--head-h); }



.site-inner{
  display:flex;
  gap:18px;
  align-items:center;
  padding:18px 0; /* más alto */
}
/* avatar más grande */
.avatar{
  width:84px; height:84px;
  border-radius:999px; object-fit:cover; flex-shrink:0;
  box-shadow: var(--shadow);
}
@media (min-width:900px){
  .site-inner{padding:22px 0}
  .avatar{width:96px;height:96px}
}
.brand{display:flex;gap:12px;align-items:center; flex-shrink: 1; flex:1; min-width:0;}
.brand h1{font-size:clamp(1.4rem, 2.2vw, 2rem);line-height:1.1;margin:0;font-weight:800;color:var(--brand)}
.brand .subtitle{font-size:clamp(.95rem, 1.4vw, 1.05rem);color:var(--accent);margin-top:4px;white-space:normal;}

nav.desktop{display:flex;gap:16px;align-items:center; margin-left: auto;}
nav.desktop a{font-weight:600}

/* Hero */
.hero{margin:16px 0;padding:20px;border:1px solid var(--border);border-radius:var(--radius);background:var(--panel);box-shadow:var(--shadow)}
.hero h2{font-size:1.6rem;margin:0 0 10px;color:var(--brand)}
.hero p{color:var(--muted);margin:0;font-size:1rem}

/* Main layout */
.grid{display:grid;grid-template-columns:1.3fr .9fr;gap:22px}
@media (max-width:900px){.grid{grid-template-columns:1fr}}

/* Tables */
table{width:100%;border-collapse:collapse}
th,td{padding:8px 10px;border-bottom:1px solid var(--border)}
th{text-align:left;color:var(--muted);font-weight:600}

/* Footer */
.footer{border-top:1px solid var(--border);margin-top:30px;padding:18px 0;color:var(--muted);font-size:.95rem;text-align:center}

/* Mobile menu (hamburger + bottom sheet) */
.hamburger{
  display:none; border:1px solid var(--border); background:var(--panel);
  width:42px;height:42px;border-radius:10px;align-items:center;justify-content:center;
  box-shadow:var(--shadow);
  margin-left: auto;
}
.hamburger:focus{outline:none; box-shadow:var(--focus)}
.hamburger svg{width:22px;height:22px}

@media (max-width:900px){
  nav.desktop{display:none}
  .hamburger{display:inline-flex}
}

.overlay{
  position:fixed; inset:0; background:rgba(0,0,0,.45);
  opacity:0; pointer-events:none; transition:opacity .25s ease;
  z-index:9998;
}
.overlay.show{opacity:1; pointer-events:auto}

/* Bottom sheet centrado y del ancho del contenido (no de toda la pantalla) */
.sheet{
  position:fixed;
  left:50%; right:auto; bottom:0;
  width:min(92vw, 420px); /* evita que se extienda más que el cuerpo */
  height:min(86dvh, 520px);
  background:var(--panel);
  border-top:1px solid var(--border);
  transform:translate(-50%, 110%);
  transition:transform .28s cubic-bezier(.22,.61,.36,1);
  z-index:9999;
  padding:14px 16px calc(18px + env(safe-area-inset-bottom));
  box-shadow:0 -12px 30px rgba(0,0,0,.18);
  display:flex; flex-direction:column; gap:8px;
  border-top-left-radius:16px; border-top-right-radius:16px;
  will-change:transform;
  overscroll-behavior:contain;
  -webkit-overflow-scrolling:touch;
  max-width:100%;
}
.sheet.show{transform:translate(-50%, 0)}
.sheet a{display:block;padding:14px 10px;border-radius:10px;font-weight:650}
.sheet a:hover{background:var(--panel-2);color:var(--brand)}
.sheet .grab{
  width:56px; height:5px; border-radius:999px; background:#dcdfe3;
  margin:6px auto 10px;
}
.sheet .close{
  align-self:flex-end; border:1px solid var(--border); background:var(--panel);
  width:38px;height:38px;border-radius:10px;display:inline-flex;align-items:center;justify-content:center;
}
.sheet .close:focus{outline:none; box-shadow:var(--focus)}

/* Lock body when sheet is open */
.body-lock{
  overflow:hidden;
  touch-action:none;
}


/* === Compact bottom sheet menu (overrides) === */
.sheet{
  height:auto;                         /* shrink to content */
  max-height:min(78dvh, 480px);        /* but allow scrolling if long */
  overflow:auto;
  gap:0 !important;                    /* remove large gaps between items */
  padding:16px 12px calc(14px + env(safe-area-inset-bottom));
  /* leave width and transform as defined above */
}
.sheet .grab{ margin:6px auto 6px; }
.sheet a{
  padding:10px 12px;                   /* tighter rows */
  font-size:.98rem;
  border-radius:8px;
}
.sheet a + a{
  border-top:1px solid var(--border);  /* subtle separator instead of big gap */
}
.sheet .close{
  position:absolute; top:10px; right:12px;
  width:34px; height:34px; border-radius:8px;
}
.sheet{ padding-top:48px; }            /* space for the close button */
