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

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

body {
    font-family: var(--font-sans);
    background: var(--bg-page);
    color: var(--text-primary);
    min-height: 100dvh;
    /* Keeps .app-shell's top margin (the fixed top nav's room) inside the body: let it
       collapse through and the page is 60px taller than the screen, so every page could
       scroll by that much and drag a full-height page (the blackjack table) off screen. */
    display: flow-root;
    line-height: 1.6;
    transition: background var(--transition), color var(--transition);
    overflow-x: hidden;
}

h1, h2, h3, h4 {
    font-family: var(--font-title);
    line-height: 1.2;
    letter-spacing: 0.02em;
}

h1 { font-size: var(--font-size-4xl);  font-weight: 600; }
h2 { font-size: var(--font-size-3xl); font-weight: 600; }
h3 { font-size: var(--font-size-xl); font-weight: 500; }
h4 { font-size: var(--font-size-base);    font-weight: 500; }

p {
    color: var(--text-secondary);
    line-height: 1.7;
}

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

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

/* Keyboard focus is always visible; pointer focus never draws a ring. Inputs
   that restyle their border on focus still get the ring for keyboard users. */
:focus-visible {
    outline: 2px solid var(--focus-ring);
    outline-offset: 2px;
}

:focus:not(:focus-visible) { outline: none; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        transition-duration: 0ms !important;
        animation-duration: 0ms !important;
    }
}

code, .mono {
    font-family: var(--font-mono);
    font-size: 0.875em;
}

.text-muted  { color: var(--text-muted); }
.text-sm     { font-size: var(--font-size-sm); }
.text-xs     { font-size: var(--font-size-xs); }
.font-mono   { font-family: var(--font-mono); }
.font-title  { font-family: var(--font-title); }
.font-display { font-family: var(--font-display); }

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-6);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
}
