/**
 * base.css - Layout, Resets, Typography Scale & Accessibility Foundations
 */

@import url('https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');
@import url('./tokens.css?v=6');

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background-color: var(--canvas);
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.6;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    transition: background-color 200ms ease, color 200ms ease;
}

/* Keyboard Focus Ring (WCAG AA) */
:focus-visible {
    outline: 2px solid var(--brand-green);
    outline-offset: 2px;
}

/* Typography Scale */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
    font-weight: var(--font-semibold);
    line-height: 1.24;
    letter-spacing: -0.022em;
    text-wrap: balance;
}

h1 {
    font-size: var(--text-4xl);
    letter-spacing: -0.032em;
}

h2 {
    font-size: var(--text-3xl);
    letter-spacing: -0.026em;
}

h3 {
    font-size: var(--text-2xl);
}

h4 {
    font-size: var(--text-xl);
}

p {
    color: var(--text-secondary);
    line-height: 1.65;
    max-width: 65ch;
    text-wrap: pretty;
}

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

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

/* Tabular Numbers for Prices, SKU, Inventory & Specs */
.tabular-nums, .price-display, .sku-text, .mono-spec {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.01em;
}

/* Skeleton Shimmer Loader */
.skeleton {
    position: relative;
    overflow: hidden;
    background: var(--surface-subtle);
    border-radius: var(--radius-xs);
}

.skeleton::after {
    content: '';
    position: absolute;
    inset: 0;
    transform: translateX(-100%);
    background: linear-gradient(90deg, transparent 0%, rgba(148, 163, 184, 0.14) 50%, transparent 100%);
    animation: hk-shimmer 1.4s infinite;
}

@keyframes hk-shimmer {
    100% {
        transform: translateX(100%);
    }
}

@media (prefers-reduced-motion: reduce) {
    .skeleton::after {
        animation: none;
    }
    html {
        scroll-behavior: auto;
    }
}

/* Container & Macro-Whitespace */
.container {
    width: 100%;
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 24px;
}

@media (max-width: 640px) {
    .container {
        padding: 0 16px;
    }
}

.section {
    padding: 64px 0;
}

.section-lg {
    padding: 96px 0;
}

/* Scrollbar Minimal */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: var(--radius-pill);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}
