/* ══════════════════════════════════════════════
   Syntarq — Base styles
   Reset, tipografia, elementi HTML di base.
   ══════════════════════════════════════════════ */

/* ── Reset ── */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: var(--font-size-base);
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-primary);
    font-weight: var(--font-weight-normal);
    line-height: var(--line-height-base);
    color: var(--color-text);
    background-color: var(--color-white);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* ── Tipografia ── */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-primary);
    color: var(--color-primary);
    line-height: var(--line-height-heading);
    font-weight: var(--font-weight-semibold);
}

h1 {
    font-size: var(--font-size-h1);
    letter-spacing: -0.02em;
}

h2 {
    font-size: var(--font-size-h2);
    letter-spacing: -0.01em;
}

h3 {
    font-size: var(--font-size-h3);
    font-weight: var(--font-weight-medium);
    line-height: var(--line-height-h3);
}

p {
    margin-bottom: var(--space-sm);
    line-height: var(--line-height-base);
}

p:last-child {
    margin-bottom: 0;
}

small,
.text-small {
    font-size: var(--font-size-small);
    line-height: var(--line-height-small);
    color: var(--color-grey-dark);
}

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

/* ── Link ── */
a {
    color: var(--color-cyan);
    text-decoration: none;
    transition: color var(--transition-base);
}

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

a:focus-visible {
    outline: 2px solid var(--color-cyan);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

/* ── Immagini ── */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ── Liste ── */
ul, ol {
    padding-left: var(--space-md);
}

li {
    margin-bottom: var(--space-xs);
}

/* ── Form elements base ── */
input,
textarea,
select,
button {
    font-family: var(--font-primary);
    font-size: inherit;
}

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

/* ── Utilities ── */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

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

/* ── Animazioni scroll (data-animate) ── */
[data-animate] {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

[data-animate].is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Ritardo progressivo per elementi in griglia */
[data-animate-delay="1"] { transition-delay: 0.1s; }
[data-animate-delay="2"] { transition-delay: 0.2s; }
[data-animate-delay="3"] { transition-delay: 0.3s; }
[data-animate-delay="4"] { transition-delay: 0.4s; }
[data-animate-delay="5"] { transition-delay: 0.5s; }

/* Rispetta preferenze utente: nessuna animazione se richiesto */
@media (prefers-reduced-motion: reduce) {
    [data-animate] {
        opacity: 1;
        transform: none;
        transition: none;
    }
}
