/* =====================================================================
   RM Packaging — Base Reset & Typography
   ===================================================================== */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: var(--font-sans);
    font-size: var(--fs-base);
    line-height: var(--lh-normal);
    color: var(--color-text);
    background: var(--color-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

img,
video,
svg {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--color-primary-hover);
}

h1,
h2,
h3,
h4,
h5,
h6 {
    margin: 0 0 var(--space-3);
    font-weight: var(--fw-bold);
    line-height: var(--lh-tight);
    color: var(--color-text);
    letter-spacing: -0.015em;
}

h1 {
    font-size: clamp(2rem, 4.5vw, 3rem);
}

h2 {
    font-size: clamp(1.6rem, 3.5vw, 2.25rem);
}

h3 {
    font-size: clamp(1.3rem, 2.5vw, 1.6rem);
}

h4 {
    font-size: var(--fs-xl);
}

h5 {
    font-size: var(--fs-lg);
}

h6 {
    font-size: var(--fs-base);
}

p {
    margin: 0 0 var(--space-4);
    color: var(--color-text);
}

small,
.text-sm {
    font-size: var(--fs-sm);
}

.text-xs {
    font-size: var(--fs-xs);
}

.text-muted {
    color: var(--color-text-muted) !important;
}

.text-primary {
    color: var(--color-primary) !important;
}

/* --- Container --- */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--space-5);
}

.container-narrow {
    max-width: var(--container-narrow);
}

/* --- Utility spacing --- */
.mt-0 {
    margin-top: 0 !important;
}

.mt-2 {
    margin-top: var(--space-2) !important;
}

.mt-4 {
    margin-top: var(--space-4) !important;
}

.mt-6 {
    margin-top: var(--space-6) !important;
}

.mt-8 {
    margin-top: var(--space-8) !important;
}

.mb-0 {
    margin-bottom: 0 !important;
}

.mb-2 {
    margin-bottom: var(--space-2) !important;
}

.mb-4 {
    margin-bottom: var(--space-4) !important;
}

.mb-6 {
    margin-bottom: var(--space-6) !important;
}

.mb-8 {
    margin-bottom: var(--space-8) !important;
}

/* --- Misc helpers --- */
.section {
    padding: var(--space-16) 0;
}

.section-sm {
    padding: var(--space-10) 0;
}

.section-header {
    text-align: center;
    margin-bottom: var(--space-10);
}

.section-header .eyebrow {
    display: inline-block;
    font-size: var(--fs-sm);
    font-weight: var(--fw-semibold);
    color: var(--color-primary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: var(--space-3);
}

.section-header p {
    color: var(--color-text-muted);
    max-width: 640px;
    margin: 0 auto;
}

.divider {
    height: 1px;
    background: var(--color-border);
    border: 0;
    margin: var(--space-6) 0;
}

/* Focus visible */
:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* Selection */
::selection {
    background: var(--color-primary-light);
    color: var(--color-text);
}

/* Custom scrollbar (desktop) */
@media (hover: hover) {
    ::-webkit-scrollbar {
        width: 10px;
        height: 10px;
    }

    ::-webkit-scrollbar-track {
        background: var(--color-bg-soft);
    }

    ::-webkit-scrollbar-thumb {
        background: var(--color-border);
        border-radius: var(--radius-full);
    }

    ::-webkit-scrollbar-thumb:hover {
        background: var(--color-text-light);
    }
}
