/* G5Fighters - Obsidian Arena base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

.g5-body {
    font-family: var(--g5-font);
    background: var(--g5-bg-deep);
    color: var(--g5-text);
    min-height: 100vh;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

a { color: var(--g5-accent); text-decoration: none; transition: color var(--g5-transition); }
a:hover { color: var(--g5-accent-bright); }

img { max-width: 100%; display: block; }
ul, ol { list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
code { font-family: var(--g5-mono); }

/* ── Ambient scene ── */
.g5-bg-scene {
    position: fixed;
    inset: 0;
    z-index: var(--g5-z-bg);
    pointer-events: none;
    overflow: hidden;
    background:
        radial-gradient(ellipse 90% 55% at 12% -8%, rgba(61, 255, 181, 0.11) 0%, transparent 55%),
        radial-gradient(ellipse 70% 45% at 92% 8%, rgba(245, 197, 66, 0.07) 0%, transparent 50%),
        radial-gradient(ellipse 55% 40% at 70% 95%, rgba(91, 157, 255, 0.06) 0%, transparent 45%),
        linear-gradient(180deg, #04060a 0%, var(--g5-bg) 40%, #030508 100%);
}

.g5-bg-scene::after {
    content: "";
    position: absolute;
    inset: 0;
    opacity: 0.35;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.45'/%3E%3C/svg%3E");
    mix-blend-mode: soft-light;
}

.g5-bg-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 64px 64px;
    mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, #000 20%, transparent 75%);
    opacity: 0.5;
}

.g5-bg-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    will-change: transform;
    animation: g5OrbFloat 22s ease-in-out infinite;
}

.g5-bg-orb--1 {
    width: 440px; height: 440px;
    top: -140px; left: -100px;
    background: rgba(61, 255, 181, 0.1);
}

.g5-bg-orb--2 {
    width: 380px; height: 380px;
    top: 35%; right: -120px;
    background: rgba(245, 197, 66, 0.07);
    animation-delay: -7s;
}

.g5-bg-orb--3 {
    width: 300px; height: 300px;
    bottom: 5%; left: 40%;
    background: rgba(91, 157, 255, 0.06);
    animation-delay: -14s;
}

@keyframes g5OrbFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -20px) scale(1.05); }
    66% { transform: translate(-20px, 25px) scale(0.96); }
}

/* legacy class aliases for old bg markup */
.mc-bg-scene { display: none; }

.g5-main {
    position: relative;
    z-index: var(--g5-z-content);
    width: 100%;
    max-width: var(--g5-max);
    margin: 0 auto;
    padding: calc(var(--g5-nav-h) + 12px) 20px 120px;
}

.g5-main--wide { max-width: var(--g5-max-wide); }

/* ── Typography helpers ── */
.g5-title {
    font-family: var(--g5-display);
    font-weight: 700;
    font-size: clamp(1.75rem, 4vw, 2.6rem);
    line-height: 1.15;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--g5-text);
    margin-bottom: 12px;
}

.g5-title-sm {
    font-family: var(--g5-display);
    font-weight: 600;
    font-size: 1.15rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.g5-lead {
    font-size: 1.05rem;
    color: var(--g5-text-secondary);
    max-width: 42rem;
    line-height: 1.7;
}

.g5-center { text-align: center; }
.g5-center .g5-lead { margin-left: auto; margin-right: auto; }

.g5-section-label {
    display: inline-block;
    font-family: var(--g5-display);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--g5-accent);
    margin-bottom: 12px;
}

.g5-muted { color: var(--g5-muted); }
.g5-text-accent { color: var(--g5-accent); }
.g5-gradient-text {
    background: linear-gradient(135deg, #fff 10%, var(--g5-accent) 90%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ── Reveal ── */
.g5-reveal {
    opacity: 0;
    transform: translateY(22px);
    transition: opacity 0.55s ease, transform 0.55s ease;
}
.g5-reveal.g5-visible {
    opacity: 1;
    transform: none;
}
@keyframes g5-reveal-fallback {
    to { opacity: 1; transform: none; }
}
.g5-reveal:not(.g5-visible) {
    animation: g5-reveal-fallback 0.01s ease 1.2s forwards;
}
.g5-reveal-delay-1 { transition-delay: 0.1s; }
.g5-reveal-delay-2 { transition-delay: 0.2s; }
.g5-reveal-delay-3 { transition-delay: 0.3s; }

/* ── A11y ── */
.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 2000;
    padding: 12px 20px;
    background: var(--g5-accent);
    color: #042a1f;
    font-weight: 700;
}
.skip-link:focus { left: 16px; top: 16px; }

.sr-only, .sr-live-region:not(:focus):not(:active) {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0,0,0,0);
    white-space: nowrap; border: 0;
}

*:focus-visible {
    outline: 2px solid var(--g5-accent);
    outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .g5-reveal { opacity: 1; transform: none; }
}

@media (max-width: 768px) {
    .g5-main { padding: 24px 16px 110px; }
    :root { --g5-nav-h: 24px; }
}
