/* =============================================================
   MantizIS — Base
   Reset moderno y estilos fundacionales
   ============================================================= */

*, *::before, *::after {
    box-sizing: border-box;
}

* {
    margin: 0;
}

html {
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-size: var(--fs-body);
    line-height: var(--lh-normal);
    color: var(--ink);
    background: var(--surface);
    overflow-x: hidden;
    min-height: 100vh;
    font-feature-settings: "ss01", "cv11";  /* Estilos opentype refinados */
}

img, picture, svg, video, canvas {
    display: block;
    max-width: 100%;
    height: auto;
}

img {
    font-style: italic;       /* Para alt text si la imagen no carga */
    background-repeat: no-repeat;
    background-size: cover;
    shape-margin: 1rem;
}

input, button, textarea, select {
    font: inherit;
    color: inherit;
}

button {
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color var(--duration-fast) var(--ease);
}

a:hover {
    color: var(--brand-deep);
}

ul, ol {
    list-style: none;
    padding: 0;
}

/* ============= Tipografía base ============= */

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: var(--fw-medium);
    line-height: var(--lh-tight);
    letter-spacing: var(--ls-tight);
    color: var(--ink);
    text-wrap: balance;
}

h1 { font-size: var(--fs-display-1); }
h2 { font-size: var(--fs-display-2); }
h3 { font-size: var(--fs-display-3); }
h4 { font-size: var(--fs-headline); }

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

p + p {
    margin-top: var(--sp-4);
}

strong {
    font-weight: var(--fw-semibold);
    color: var(--ink);
}

/* ============= Utilidades de selección y foco ============= */

::selection {
    background: var(--brand);
    color: white;
}

:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 3px;
    border-radius: 2px;
}

/* ============= Scrollbar discreta (webkit) ============= */

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--surface-stone);
}

::-webkit-scrollbar-thumb {
    background: var(--ink-faint);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--ink-mute);
}

/* ============= Reduced motion ============= */

@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;
    }
}

/* ============= Helpers de accesibilidad ============= */

.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;
}

.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--ink);
    color: white;
    padding: 8px 16px;
    z-index: var(--z-modal);
}

.skip-link:focus {
    top: 0;
}
