/**
 * THE DIGI GHOST - Base Typography, Accessibility & Resets
 */

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    background-color: var(--color-bg);
}

body {
    background-color: var(--color-bg);
    color: var(--color-text-primary);
    font-family: var(--font-body);
    font-size: var(--text-base);
    font-weight: 400;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* User Selection */
::selection {
    background-color: var(--color-brand-red);
    color: var(--color-brand-white);
}

/* Accessibility Focus States - High Contrast Dual Ring */
:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: 3px;
    box-shadow: 0 0 0 5px var(--color-brand-red);
    border-radius: var(--radius-xs);
}

/* Typography Hierarchy */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--color-text-primary);
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: -0.025em;
    text-wrap: balance;
    overflow-wrap: break-word;
    word-break: break-word;
}

.site-section {
    padding-top: var(--space-3xl);
    padding-bottom: var(--space-3xl);
    position: relative;
}

.site-section-alt {
    background-color: var(--color-surface-base);
    border-top: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
}

@media (max-width: 640px) {
    .site-section {
        padding-top: var(--space-2xl);
        padding-bottom: var(--space-2xl);
    }
}

h1 {
    font-size: var(--text-5xl);
    font-weight: 800;
    letter-spacing: -0.035em;
    line-height: 1.1;
}

h2 {
    font-size: var(--text-4xl);
    font-weight: 700;
    line-height: 1.15;
}

h3 {
    font-size: var(--text-3xl);
    font-weight: 600;
}

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

h5 {
    font-size: var(--text-xl);
    font-weight: 600;
}

h6 {
    font-size: var(--text-lg);
    font-weight: 600;
}

p {
    margin-bottom: var(--space-md);
    color: var(--color-text-secondary);
    max-width: 72ch;
}

p:last-child {
    margin-bottom: 0;
}

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

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

strong, b {
    color: var(--color-text-primary);
    font-weight: 600;
}

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

ul, ol {
    list-style: none;
}

/* Section Header Standards */
.section-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-heading);
    font-size: var(--text-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-brand-red);
    background: var(--color-brand-red-subtle);
    padding: 0.35rem 0.9rem;
    border-radius: var(--radius-pill);
    margin-bottom: var(--space-md);
    border: 1px solid rgba(230, 25, 25, 0.28);
}

.section-tag::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--color-brand-red);
    box-shadow: 0 0 6px var(--color-brand-red);
}

.section-header {
    text-align: center;
    max-width: 780px;
    margin: 0 auto var(--space-2xl);
}

.section-header p {
    font-size: var(--text-lg);
    margin: var(--space-sm) auto 0;
}

/* Reduced Motion Support for Accessibility */
@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;
    }
}
