/* base.css — BOOTSTRAP LAYER
 * Responsibility: resets, body, background layers, typography hierarchy, utilities.
 * Inputs: css/tokens.css (must load first). Outputs: global base styles only.
 * Side effects: none (no components, no page rules).
 * Rules for extension: NEVER add component (nav/button/card) or page selectors here — see components.css / pages/*.css.
 */
/* ============================================================
   GTA 6 NEWS DAILY — SHARED DESIGN SYSTEM
   "Vice City Sunset" Color Palette
   Built for top-tier, premium web experiences
   ============================================================ */

/* ===== DESIGN TOKENS ===== */

/* ===== TYPOGRAPHY SYSTEM (Premium) ===== */
/* Fonts: Oswald (display) · Inter (body) · Rajdhani (accent) · JetBrains Mono (code)
   Modular scale: Major Third (1.25) on a 16px base, expressed in rem so user
   font-size preferences and accessibility zoom are respected. Fluid display sizes
   use clamp() for responsive scaling without breakpoint jumps. */
/* Design tokens (incl. themes) live in css/tokens.css — loaded before this file. */

/* ===== BASE STYLES ===== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    overflow-y: scroll; /* fallback for scrollbar-gutter (Chrome 94+/FF 97+; Safari 17+) */
    scrollbar-gutter: stable;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent; /* no grey flash on iOS taps */
    scroll-padding-top: 88px;
}

body {
    font-family: var(--font-body);
    font-feature-settings: "cv01", "ss03", "liga", "calt";
    font-optical-sizing: auto;
    font-kerning: normal;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-size: var(--type-body);
    min-height: 100vh; min-height: 100dvh; /* vh fallback: Safari <15.4 ignores dvh */
    display: flex;
    flex-direction: column;
    line-height: 1.7;
    letter-spacing: 0.005em;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    position: relative;
    overflow-x: hidden;
}

main { flex: 1 0 auto; width: 100%; }

/* ===== BACKGROUND LAYERS ===== */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: 
        radial-gradient(ellipse 80% 50% at 20% 20%, rgba(255, 77, 138, 0.06) 0%, transparent 60%),
        radial-gradient(ellipse 60% 40% at 80% 80%, rgba(0, 212, 255, 0.04) 0%, transparent 60%),
        radial-gradient(ellipse 50% 30% at 50% 50%, rgba(255, 138, 61, 0.02) 0%, transparent 70%);
    pointer-events: none;
    z-index: var(--z-base);
    animation: bgPulse 25s ease-in-out infinite alternate;
}

@keyframes bgPulse {
    0% { opacity: 0.8; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.05); }
    100% { opacity: 0.9; transform: scale(1.02); }
}

body::after {
    content: '';
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.025'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: var(--z-base);
    opacity: 0.5;
    mix-blend-mode: overlay;
}

/* ===== TYPOGRAPHY — GTA 6 Premium Stack ===== */
/* Syne (display) · Anton (headlines) · Oswald (sub-headlines) · DM Sans (body) · JetBrains Mono (code) */


/* ===== PREMIUM TYPOGRAPHY HIERARCHY — Larger, More Readable ===== */

/* Display / Hero — Syne 800, MASSIVE sizes */
h1, .hero-title, .text-hero {
    font-family: var(--font-display);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.05;
    color: var(--text-primary);
    text-wrap: balance;
    font-optical-sizing: auto;
}
.hero-title { font-size: var(--type-hero); }
h1:not(.hero-title) { font-size: var(--type-h1); }
.text-hero { font-size: var(--type-display); }

/* Headlines / Section Titles — Anton, bold condensed like Pricedown */
h2, .section-title, .featured-title, .game-title, .guide-card-title, .text-h2 {
    font-family: var(--font-headline);
    font-weight: 400;
    letter-spacing: 0.02em;
    line-height: 1.15;
    text-transform: uppercase;
    color: var(--text-primary);
    text-wrap: balance;
    font-optical-sizing: auto;
}
.section-title { font-size: var(--type-h2); }
.featured-title { font-size: var(--type-featured); }
.guide-card-title { font-size: var(--type-card-title); }
.text-h2 { font-size: var(--type-h2-display); }

/* Sub-headlines — Oswald */
h3, h4, .queue-title, .newsletter-title, .footer-column h4, .text-h3, .text-h4 {
    font-family: var(--font-subheadline);
    font-weight: 600;
    letter-spacing: 0.01em;
    line-height: 1.25;
    color: var(--text-primary);
    text-wrap: balance;
    font-optical-sizing: auto;
}
h3, .text-h3 { font-size: var(--type-h3); }
h4, .text-h4 { font-size: var(--type-h4); }

/* H5-H6 */
h5 { font-size: var(--type-h5); font-weight: 600; line-height: 1.3; }
h6 { font-family: var(--font-headline); font-size: var(--type-h6); font-weight: 400; letter-spacing: 0.15em; line-height: 1.2; text-transform: uppercase; }

/* Body — DM Sans, SIGNIFICANTLY LARGER, more readable */
p, .hero-subtitle, .section-subtitle, .featured-excerpt,
.story-deck, .guide-card-desc, .newsletter-desc,
.footer-desc, .queue-intro, .dropdown-content p, .prose {
    font-family: var(--font-body);
    font-size: var(--type-body); /* 18-20px */
    font-weight: 400;
    line-height: 1.7;
    letter-spacing: 0.005em;
    color: var(--text-secondary);
    max-width: var(--measure-normal);
    text-wrap: wrap; /* fallback first: text-wrap:pretty is unsupported in Firefox 147 (verified: computed 'wrap'), so pretty must not be the only declaration */
    text-wrap: pretty;
    text-align: left;
}

/* Lead paragraphs — larger */
.lead, .hero-subtitle, .section-subtitle {
    font-size: var(--type-lead); /* 20-24px */
    font-weight: 500;
    line-height: 1.6;
}

/* Small text / captions */
small, .caption, .meta, .dropdown-content small {
    font-family: var(--font-body);
    font-size: var(--type-caption); /* 15-16px */
    font-weight: 400;
    line-height: 1.6;
    color: var(--text-muted);
}

strong { color: var(--text-primary); font-weight: 600; }
em { font-style: italic; }

p + p { margin-top: 1rem; }

/* Editorial prose — hanging punctuation */
.prose, blockquote, article p {
    hanging-punctuation: first allow-end last;
    hyphens: auto;
}

/* Data / numbers — tabular nums */
.data-table, .price, .stat-value, code, kbd {
    font-variant-numeric: tabular-nums lining-nums slashed-zero;
}

a { color: var(--accent-primary); text-decoration: none; transition: color var(--duration-fast) var(--ease-out-quart); }
a:hover { color: var(--accent-secondary); }
a:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; border-radius: 2px; }

/* Accent type (Anton) — eyebrows, labels, stats, badges */
.eyebrow, .label, .badge, .stat-value, .featured-badge, .game-meta, .tag, .reading-time {
    font-family: var(--font-accent);
    font-weight: 400;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    font-size: var(--type-overline); /* 12-14px */
    line-height: 1.2;
    color: var(--text-primary);
}
/* Kicker: single theme-aware source (dark=white, light=black) */
.section-kicker {
    font-family: var(--font-accent);
    font-weight: 400;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    font-size: var(--type-overline);
    line-height: 1.2;
    color: var(--text-primary);
}
html[data-theme="light"] .section-kicker { color: #000000; }

/* Code / monospace */
code, pre, kbd, samp {
    font-family: var(--font-mono);
    font-size: 0.9em;
}
pre {
    line-height: 1.6;
    padding: 1rem;
    overflow-x: auto;
    border-radius: var(--radius-md, 8px);
}

/* Lists */
ul, ol { padding-left: 1.5rem; }
li { line-height: 1.7; }
li + li { margin-top: 0.25rem; }

/* Blockquote */
blockquote {
    font-family: var(--font-body);
    font-style: italic;
    font-size: clamp(1.25rem, 2.5vw, 1.5rem);
    line-height: 1.6;
    border-left: 3px solid var(--accent-primary);
    padding-left: 1.25rem;
    color: var(--text-secondary);
}

/* Utility type classes — updated for new scale */
.text-display { font-family: var(--font-display); font-size: var(--text-fluid-display); font-weight: 800; line-height: 1.05; letter-spacing: -0.03em; }
.text-h1 { font-family: var(--font-display); font-size: var(--text-fluid-3xl); font-weight: 800; line-height: 1.1; letter-spacing: -0.02em; }
.text-body-lg { font-size: var(--text-lg); line-height: 1.7; }
.text-body { font-size: var(--text-base); line-height: 1.7; }
.text-body-sm { font-size: var(--text-sm); line-height: 1.6; }
.text-caption { font-family: var(--font-body); font-size: var(--text-xs); line-height: 1.6; letter-spacing: 0.02em; color: var(--text-muted); }
.text-overline { font-family: var(--font-accent); font-size: var(--text-2xs); font-weight: 400; letter-spacing: 0.15em; text-transform: uppercase; color: var(--text-muted); }

.font-display { font-family: var(--font-display); }
.font-headline { font-family: var(--font-headline); }
.font-subheadline { font-family: var(--font-subheadline); }
.font-body { font-family: var(--font-body); }
.font-accent { font-family: var(--font-accent); }
.font-mono { font-family: var(--font-mono); }

.tracking-tighter { letter-spacing: var(--tracking-tighter); }
.tracking-tight { letter-spacing: var(--tracking-tight); }
.tracking-normal { letter-spacing: var(--tracking-normal); }
.tracking-wide { letter-spacing: var(--tracking-wide); }
.tracking-widest { letter-spacing: var(--tracking-widest); }


/* ===== VECTOR ICONOGRAPHY (crisp SVG support) ===== */
/* All icons must be inline SVG (stroke=currentColor, stroke-width=var(--icon-stroke),
   fill=none, viewBox=0 0 24 24). Emoji are legacy — see inventory in PR report.
   SVG inherits text color so dark #FFF / light #000 contrast is automatic. */
.icon, .dropdown-item-icon .icon, .guide-card-icon .icon, .feature-icon .icon, .social-link .icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: var(--icon-size-md); height: var(--icon-size-md); flex: 0 0 auto;
}
.icon svg, .dropdown-item-icon svg, .guide-card-icon svg, .feature-icon svg, .social-link svg {
    width: 1em; height: 1em; max-width: var(--icon-size-md); max-height: var(--icon-size-md);
    stroke: currentColor; stroke-width: var(--icon-stroke); fill: none;
    stroke-linecap: round; stroke-linejoin: round;
    display: block;
}
.dropdown-item-icon, .guide-card-icon, .feature-icon { line-height: 0; font-size: var(--icon-size-md); }
.dropdown-item-icon svg { width: var(--icon-size-md); height: var(--icon-size-md); }
.social-link svg { width: var(--icon-size-sm); height: var(--icon-size-sm); }
.icon--sm svg { width: var(--icon-size-sm); height: var(--icon-size-sm); }
.icon--lg svg { width: var(--icon-size-lg); height: var(--icon-size-lg); }
/* Swiss-grid editorial helpers (typographic, not component layout) */
.container-wide { max-width: var(--container-wide); margin-inline: auto; padding-inline: var(--grid-margin); }
.container-content { max-width: var(--container-content); margin-inline: auto; padding-inline: var(--grid-margin); }

/* ===== UTILITY CLASSES ===== */
.text-gradient {
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 50%, var(--accent-tertiary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    background-size: 200% 200%;
}

.text-gradient-animated {
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 25%, var(--accent-tertiary) 50%, var(--accent-primary) 75%, var(--accent-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    background-size: 300% 300%;
    animation: gradientFlow 8s ease-in-out infinite;
}

@keyframes gradientFlow {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.neon-text {
    color: var(--text-primary);
    text-shadow: 0 0 20px var(--accent-primary-glow), 0 0 40px var(--accent-primary-glow);
}

.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(16px) saturate(140%);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.10);
}

.glass-strong {
    background: var(--glass-bg-strong);
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    border: 1px solid var(--glass-border-strong);
    box-shadow: var(--glass-shadow-lg), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .glass { background: var(--bg-secondary); }
    .glass-strong { background: var(--bg-elevated); }
}

@media (prefers-reduced-transparency: reduce) {
    .glass { background: var(--bg-secondary); }
    .glass-strong { background: var(--bg-elevated); }
    .glass, .glass-strong {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }
}


@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; } /* smooth scroll (Chrome 61/FF 36/Safari 14+) must not animate for reduced-motion */
}

/* :focus-visible fallback (Chrome 86+/FF 85+/Safari 15.4+): older browsers get :focus outline instead of none */
@supports not selector(:focus-visible) {
    *:focus { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
}

/* Programmatic focus targets must not paint a ring.
   The age gate closes by moving focus to the <h1> (tabindex="-1") so screen
   readers start at the headline; Chrome then matches :focus-visible on it and
   draws a gold rectangle around the 60px hero title for one paint on first
   load. tabindex="-1" is never tab-reachable, so the ring is pure noise. */
[tabindex="-1"]:focus,
[tabindex="-1"]:focus-visible {
    outline: none;
}

