feat(andamiaje): fase 1, tokens, fuentes, layouts, Header/Footer e Inicio

- BRIEF.md y CLAUDE.md como fuente de verdad y reglas del repositorio
- Astro 7 estático con Tailwind 4; tokens en src/styles/tokens.css (claro/oscuro)
- Fuentes propias en public/fonts (Fraunces, Instrument Sans, JetBrains Mono)
- Layout Base con SEO y Open Graph; Header con menú accesible; Footer
- Componentes Stat (cifra con método) y Video (fondo/captura/externo)
- Colección cifras con esquema zod; esquemas de proyectos y equipo
- Página de inicio; referencia/ con el borrador y los chats originales

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
Collina SystemsandClaude Fable 5.1 committed 2026-11-04 11:57:35 -06:00
commit aa0fcc5691
40 files changed
+12854

No files matched your search

+46
View File
@@ -0,0 +1,46 @@
---
import { SITIO } from '../lib/sitio';
---
<footer class="pie">
<div class="wrap">
<div>
<span>{SITIO.nombre} · {SITIO.anio}</span>
<span class="sep" aria-hidden="true">·</span>
<span>Nombre comercial de Collina LLC (Wyoming), con operación en Puebla, México</span>
</div>
<ul>
<li><a href="/curriculum">Currículum empresarial</a></li>
<li><a href="/contacto">Contacto</a></li>
<li><a href={`mailto:${SITIO.correo}`} class="mono">{SITIO.correo}</a></li>
</ul>
</div>
</footer>
<style>
.pie {
border-top: 1px solid var(--line);
padding-block: 2.5rem;
padding-bottom: calc(2.5rem + env(safe-area-inset-bottom, 0px));
font-size: 0.85rem;
color: var(--fg-3);
}
.pie .wrap {
display: flex;
justify-content: space-between;
gap: 1rem 2rem;
flex-wrap: wrap;
}
.sep {
margin-inline: 0.5rem;
}
ul {
display: flex;
gap: 1.4rem;
flex-wrap: wrap;
list-style: none;
}
.pie a:hover {
color: var(--accent);
}
</style>
+127
View File
@@ -0,0 +1,127 @@
---
import { NAV, SITIO, esActual } from '../lib/sitio';
const ruta = Astro.url.pathname;
---
<header class="cabecera">
<div class="wrap nav">
<a class="marca" href="/" aria-label={`${SITIO.nombre}, inicio`}>Collina <small>Systems</small></a>
<button class="burger" type="button" aria-expanded="false" aria-controls="menu" data-burger>Menú</button>
<nav aria-label="Principal">
<ul class="menu" id="menu" data-menu>
{
NAV.map((item) => (
<li>
<a href={item.href} aria-current={esActual(item.href, ruta) ? 'page' : undefined}>
{item.texto}
</a>
</li>
))
}
</ul>
</nav>
</div>
</header>
<style>
.cabecera {
position: sticky;
top: 0;
z-index: 9;
background: var(--bg);
border-bottom: 1px solid var(--line);
padding-top: env(safe-area-inset-top, 0px);
}
.nav {
display: flex;
align-items: center;
justify-content: space-between;
gap: 1rem;
padding-block: 0.9rem;
position: relative;
}
.marca {
font-family: var(--font-display);
font-weight: 700;
font-size: 1.3rem;
letter-spacing: 0.02em;
display: flex;
align-items: baseline;
gap: 0.5rem;
font-variation-settings: 'opsz' 48;
}
.marca small {
font-family: var(--font-body);
font-weight: 600;
font-size: 0.62rem;
letter-spacing: 0.2em;
text-transform: uppercase;
color: var(--fg-3);
}
.menu {
display: flex;
gap: 1.6rem;
list-style: none;
margin: 0;
padding: 0;
font-size: 0.95rem;
font-weight: 500;
}
.menu a[aria-current='page'] {
color: var(--accent);
box-shadow: inset 0 -2px 0 var(--accent);
}
.burger {
display: none;
background: none;
border: 1px solid var(--line);
border-radius: 4px;
padding: 0.4rem 0.7rem;
color: var(--fg);
font: inherit;
cursor: pointer;
}
@media (max-width: 759px) {
.menu {
display: none;
position: absolute;
left: 0;
right: 0;
top: 100%;
background: var(--bg);
border-bottom: 1px solid var(--line);
flex-direction: column;
gap: 0;
padding: 0.5rem var(--gutter-r) 0.5rem var(--gutter-l);
}
.menu.abierto {
display: flex;
}
.menu li a {
display: block;
padding: 0.75rem 0;
border-top: 1px solid var(--line);
}
.burger {
display: inline-block;
}
}
</style>
<script>
const boton = document.querySelector<HTMLButtonElement>('[data-burger]');
const menu = document.querySelector<HTMLElement>('[data-menu]');
if (boton && menu) {
const fijar = (abierto: boolean) => {
menu.classList.toggle('abierto', abierto);
boton.setAttribute('aria-expanded', String(abierto));
};
boton.addEventListener('click', () => fijar(!menu.classList.contains('abierto')));
document.addEventListener('keydown', (e) => {
if (e.key === 'Escape' && menu.classList.contains('abierto')) {
fijar(false);
boton.focus();
}
});
}
</script>
+46
View File
@@ -0,0 +1,46 @@
---
/* Cifra con método. Nunca se muestra un valor sin su método; un valor null se
presenta como "por medir". */
interface Props {
valor: string | null;
texto: string;
metodo: string;
periodo?: string | null;
}
const { valor, texto, metodo, periodo = null } = Astro.props;
---
<div class="stat">
<strong class="mono">{valor ?? 'por medir'}</strong>
<span>{texto}</span>
<small>{metodo}{periodo && <> · {periodo}</>}</small>
</div>
<style>
.stat {
border-top: 2px solid var(--fg);
padding-top: 1rem;
}
.stat strong {
display: block;
font-family: var(--font-mono);
font-size: clamp(2rem, 4vw, 3rem);
font-weight: 500;
line-height: 1;
font-variant-numeric: tabular-nums;
letter-spacing: -0.02em;
}
.stat span {
display: block;
margin-top: 0.5rem;
color: var(--fg-2);
font-size: 0.95rem;
}
.stat small {
display: block;
margin-top: 0.35rem;
color: var(--fg-3);
font-size: 0.8rem;
line-height: 1.4;
}
</style>
+186
View File
@@ -0,0 +1,186 @@
---
/* Componente único de video. Reglas incorporadas (BRIEF §8):
- fondo: silencioso, en bucle, con poster; solo poster en celular, con ahorro de
datos o con prefers-reduced-motion; se reproduce solo mientras está en pantalla.
- captura: MP4 corto en lugar de GIF; carga diferida al entrar en pantalla;
controles visibles; sin autoplay con prefers-reduced-motion.
- externo: demostración alojada fuera; solo se carga el iframe al pulsar.
Nunca audio automático. Una sola instancia de `fondo` por página. */
interface Props {
modo: 'fondo' | 'captura' | 'externo';
/** Imagen fija que se muestra antes del video o en su lugar. */
poster: string;
/** Descripción del contenido para lectores de pantalla (vacía si es decorativo). */
descripcion: string;
mp4?: string;
webm?: string;
/** URL del reproductor externo (modo externo). */
src?: string;
/** Relación de aspecto CSS, p. ej. "21 / 9". */
aspecto?: string;
/** Texto que acompaña al poster mientras no hay video real. */
nota?: string;
}
const {
modo,
poster,
descripcion,
mp4,
webm,
src,
aspecto = modo === 'captura' ? '9 / 16' : '16 / 9',
nota,
} = Astro.props;
const decorativo = descripcion.trim() === '';
const hayFuente = Boolean(mp4 || webm);
---
<figure class:list={['video', `video--${modo}`]} style={`aspect-ratio:${aspecto}`}>
{
modo === 'externo' ? (
<div class="externo" data-video="externo" data-src={src}>
<img src={poster} alt={descripcion} loading="lazy" decoding="async" />
<button type="button" class="reproducir" data-reproducir>
Reproducir demostración
</button>
</div>
) : (
<video
data-video={modo}
data-mp4={mp4}
data-webm={webm}
poster={poster}
muted
playsinline
loop
preload="none"
disablepictureinpicture
aria-hidden={decorativo ? 'true' : undefined}
aria-label={decorativo ? undefined : descripcion}
controls={modo === 'captura' && hayFuente}
tabindex={decorativo ? -1 : undefined}
/>
)
}
{nota && <figcaption class="nota mono">{nota}</figcaption>}
</figure>
<style>
.video {
margin: 0;
position: relative;
width: 100%;
max-width: 100%;
overflow: hidden;
background: var(--bg-2);
border: 1px solid var(--line);
}
.video--captura {
max-width: 320px;
}
.video video,
.video img,
.video :global(iframe) {
display: block;
width: 100%;
height: 100%;
object-fit: cover;
border: 0;
background: var(--bg-2);
}
.externo {
position: relative;
height: 100%;
}
.reproducir {
position: absolute;
inset: auto auto 1rem 1rem;
background: var(--ink);
color: var(--ink-fg);
border: 0;
padding: 0.6rem 1rem;
font: inherit;
font-weight: 600;
cursor: pointer;
}
.nota {
position: absolute;
left: 0;
right: 0;
bottom: 0;
padding: 0.4rem 0.8rem;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
font-size: 0.72rem;
color: var(--fg-3);
background: color-mix(in srgb, var(--bg) 85%, transparent);
border-top: 1px solid var(--line);
}
</style>
<script>
type Conexion = { saveData?: boolean };
const reduceMovimiento = matchMedia('(prefers-reduced-motion: reduce)').matches;
const ahorroDatos = Boolean((navigator as Navigator & { connection?: Conexion }).connection?.saveData);
const esCelular = matchMedia('(max-width: 759px)').matches;
function montarFuentes(video: HTMLVideoElement): boolean {
if (video.dataset.montado === '1') return true;
const { mp4, webm } = video.dataset;
if (!mp4 && !webm) return false;
for (const [src, type] of [
[webm, 'video/webm'],
[mp4, 'video/mp4'],
] as const) {
if (!src) continue;
const s = document.createElement('source');
s.src = src;
s.type = type;
video.append(s);
}
video.dataset.montado = '1';
video.load();
return true;
}
const observador = new IntersectionObserver(
(entradas) => {
for (const e of entradas) {
const video = e.target as HTMLVideoElement;
if (e.isIntersecting) {
if (!montarFuentes(video)) continue;
if (!reduceMovimiento) video.play().catch(() => {});
} else if (!video.paused) {
video.pause();
}
}
},
{ threshold: 0.25 },
);
for (const video of document.querySelectorAll<HTMLVideoElement>('video[data-video="fondo"]')) {
// En celular, con ahorro de datos o sin movimiento: solo el poster.
if (esCelular || ahorroDatos || reduceMovimiento) continue;
observador.observe(video);
}
for (const video of document.querySelectorAll<HTMLVideoElement>('video[data-video="captura"]')) {
if (ahorroDatos) continue;
observador.observe(video);
}
for (const caja of document.querySelectorAll<HTMLElement>('[data-video="externo"]')) {
caja.querySelector('[data-reproducir]')?.addEventListener('click', () => {
const src = caja.dataset.src;
if (!src) return;
const iframe = document.createElement('iframe');
iframe.src = src;
iframe.title = caja.querySelector('img')?.alt || 'Demostración en video';
iframe.allow = 'fullscreen; picture-in-picture';
iframe.setAttribute('allowfullscreen', '');
iframe.loading = 'lazy';
caja.replaceChildren(iframe);
iframe.focus();
});
}
</script>