/* =========================================================================
   base.css — Estilos de elementos HTML generales, ya con identidad REBLE.
   Fondo Cal, texto Carbón, tipografía del sistema, foco y selección.
   ========================================================================= */

:root {
    color-scheme: light;
}

html {
    font-family: var(--font-primary);
    font-size: 100%;
    line-height: var(--lh-base);
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    tab-size: 4;
}

@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}

body {
    min-height: 100vh;
    background-color: var(--bg-page);
    color: var(--text-strong);
    font-size: var(--fs-200);
    font-weight: var(--fw-regular);
}

/* --- Titulares ----------------------------------------------------- */

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-primary);
    font-weight: var(--fw-semibold);
    line-height: var(--lh-tight);
    letter-spacing: var(--tracking-tight);
    text-wrap: balance;
}

h1 { font-size: var(--fs-600); }
h2 { font-size: var(--fs-500); }
h3 { font-size: var(--fs-400); }
h4 { font-size: var(--fs-300); }
h5 { font-size: var(--fs-200); }
h6 { font-size: var(--fs-100); }

/* --- Texto -------------------------------------------------------- */

p {
    line-height: var(--lh-base);
    text-wrap: pretty;
}

strong,
b {
    font-weight: var(--fw-semibold);
}

small {
    font-size: var(--fs-100);
}

:where(code, kbd, samp, pre) {
    font-family: var(--font-mono);
    font-size: 0.9em;
}

/* --- Enlaces ---------------------------------------------------- */

a {
    color: var(--accent);
    text-decoration: underline;
    text-decoration-thickness: from-font;
    text-underline-offset: 0.15em;
    transition: color var(--dur-fast) var(--ease-out);
}

a:hover {
    color: var(--accent-hover);
}

/* --- Multimedia ---------------------------------------------- */

img,
svg,
video {
    height: auto;
}

svg {
    fill: currentColor;
}

/* --- Formularios: normalización mínima --------------------------
   El estilo definitivo de los campos llegará como componente. */

input,
textarea,
select {
    color: inherit;
    background-color: transparent;
    max-width: 100%;
}

textarea {
    resize: vertical;
}

::placeholder {
    color: var(--text-muted);
    opacity: 1;
}

:where(:disabled) {
    cursor: not-allowed;
}

/* --- Otros elementos --------------------------------------- */

hr {
    border: 0;
    height: var(--border-width);
    background-color: var(--border);
    margin-block: var(--space-lg);
}

/* Separación al saltar a un ancla (previendo un header fijo) */
:target {
    scroll-margin-top: var(--space-xl);
}

/* --- Selección de texto REBLE ----------------------------- */

::selection {
    background-color: var(--selection-bg);
    color: var(--selection-text);
}

/* --- Foco visible por teclado ---------------------------- */

:focus-visible {
    outline: 2px solid var(--focus-ring);
    outline-offset: 2px;
}

:focus:not(:focus-visible) {
    outline: none;
}

/* --- Movimiento reducido (CLAUDE.md §10 / §15) ---------- */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
