/* ============================================================================
   core/reset.css — Browser Resets & Base Styles

   Minimal reset for consistent cross-browser behavior.
   ============================================================================ */

/* Hidden attribute should always hide elements */
[hidden] {
    display: none !important;
}

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

/* Form elements: inherit font to prevent iOS sizing differences */
input,
textarea,
select,
button {
    font: inherit;
}

/* Prevent iOS auto-zoom on input focus.
   iOS Safari zooms in when an input's effective font-size is < 16px.
   Since inputs use font:inherit, any input inside a container with a smaller
   font-size (e.g. --text-sm = 14px) would trigger unwanted zoom. */
@media (--mobile) {
    input,
    textarea,
    select {
        font-size: var(--text-base);
    }
}

/* Document resets */
html,
body {
    margin: 0;
    padding: 0;
    height: 100%;
}

/* iOS safe areas: ensures background color extends to status bar and home indicator.
   Uses squared-paper pattern so the grid is visible during app loading
   instead of a white flash. Fallback color matches the default warm theme. */
html {
    background: var(--default-background, var(--color-bg, #f5f4f2)) repeat;
    background-color: var(--bg-squared-paper-color, var(--color-bg, #f5f4f2));
}

body {
    background: var(--default-background, var(--color-bg, #f5f4f2)) repeat;
    background-color: var(--bg-squared-paper-color, var(--color-bg, #f5f4f2));
    /* Fill entire viewport including safe areas */
    min-height: 100dvh;
}

/* ============================================================================
   Reduced Motion — Global catch-all

   Disables all animations and transitions for users who prefer reduced motion.
   Individual component files may provide more targeted overrides above this.
   ============================================================================ */

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