/* ============================================================================
   Reset + kieu chu nen tang
   ========================================================================= */

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

* { margin: 0; padding: 0; }

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.5;
    background: var(--bg-body);
    color: var(--text-primary);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* Noi dung rong (bang, bieu do) phai tu cuon trong khung cua no,
       than trang khong bao gio duoc cuon ngang. */
    overflow-x: hidden;
}

img, svg, video { display: block; max-width: 100%; }

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

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

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

h1, h2, h3, h4 { font-weight: 600; line-height: 1.25; }

h1 { font-size: 40px; letter-spacing: -0.02em; }
h2 { font-size: 24px; }
h3 { font-size: 18px; }

/* Moi con so tien te / gia deu dung font mono va tabular-nums de khong nhay
   chieu rong khi gia doi lien tuc. */
.num {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
    font-feature-settings: 'tnum';
}

.up   { color: var(--up); }
.down { color: var(--down); }
.muted { color: var(--text-secondary); }

.container {
    width: 100%;
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 0 24px;
}

/* Vien focus phai nhin thay duoc - dieu huong ban phim can no */
:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

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

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

@media (max-width: 768px) {
    h1 { font-size: 30px; }
    h2 { font-size: 20px; }
    .container { padding: 0 16px; }
}
