/* ============================================================
   Freedom Sports Academy — Global Base Styles
   global.css — Resets, Typography, Utilities
   ============================================================ */

/* ─── Google Fonts are loaded via head.php link tags ─── */

/* ─── Box Sizing & Reset ─── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    margin: 0 !important;
    padding: 0 !important;
}

body {
    font-family: 'Geist', 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--color-background);
    color: var(--color-on-background);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.5;
    margin: 0 !important;
    padding: 0 !important;
    transition: background-color 0.5s cubic-bezier(0.2, 0.8, 0.2, 1),
                color 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ─── Full-page Background ─── */
/* DARK theme: animated lime/teal mesh orbs (unchanged) */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -20;
    pointer-events: none;
    background-image:
        radial-gradient(ellipse 60% 50% at 10% 15%,  var(--mesh-lime)  0%, transparent 60%),
        radial-gradient(ellipse 50% 40% at 85% 8%,   var(--mesh-teal)  0%, transparent 55%),
        radial-gradient(ellipse 55% 45% at 95% 75%,  var(--mesh-lime)  0%, transparent 60%),
        radial-gradient(ellipse 50% 40% at 5%  85%,  var(--mesh-cyan)  0%, transparent 55%),
        radial-gradient(ellipse 40% 35% at 50% 50%,  var(--mesh-teal)  0%, transparent 65%),
        radial-gradient(ellipse 35% 30% at 70% 35%,  var(--mesh-lime)  0%, transparent 50%),
        radial-gradient(ellipse 30% 25% at 30% 65%,  var(--mesh-cyan)  0%, transparent 50%);
    animation: mesh-drift 25s ease-in-out infinite;
}

/* LIGHT theme: Sports turf-inspired mesh —
   Deep grass greens + electric lime highlights + clean whites.
   Evokes a top-down view of a sports field under stadium lights. */
html.light body::before {
    background-image:
        /* Top-left: grass base orb */
        radial-gradient(ellipse 70% 55% at 0% 0%,    rgba(130, 10, 10, 0.18)   0%, transparent 65%),
        /* Top-right: lime highlight (stadium light spill) */
        radial-gradient(ellipse 50% 45% at 100% 5%,  rgba(200, 30, 30, 0.16)  0%, transparent 60%),
        /* Center: turf midfield glow */
        radial-gradient(ellipse 55% 40% at 50% 50%,  rgba(150, 20, 20, 0.12)  0%, transparent 65%),
        /* Bottom-right: deep field shadow */
        radial-gradient(ellipse 65% 50% at 100% 100%, rgba(100, 10, 10, 0.14)  0%, transparent 60%),
        /* Bottom-left: lime corner accent */
        radial-gradient(ellipse 45% 40% at 0% 100%,  rgba(210, 40, 40, 0.13)  0%, transparent 55%),
        /* Subtle diagonal turf lines via repeating-linear */
        repeating-linear-gradient(
            135deg,
            transparent 0px,
            transparent 80px,
            rgba(140, 30, 30, 0.04) 80px,
            rgba(140, 30, 30, 0.04) 82px
        );
    background-color: #fef5f5;
    animation: mesh-drift-light 30s ease-in-out infinite;
}

@keyframes mesh-drift {
    0%   { opacity: 1; }
    50%  { opacity: 0.75; }
    100% { opacity: 1; }
}

@keyframes mesh-drift-light {
    0%   { opacity: 1; }
    50%  { opacity: 0.82; }
    100% { opacity: 1; }
}

/* ─── Global HUD Viewport Frame ───
   Four fixed corner brackets frame the entire site like a sports HUD.
   Content scrolls inside them. z-index 998 = above all content, below modals. */
.hud-frame-corner {
    position: fixed;
    width: 36px;
    height: 36px;
    z-index: 998;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

/* Top-left */
.hud-frame-tl {
    top: 88px;
    left: 14px;
    border-top: 2px solid rgba(255, 45, 45, 0.70);
    border-left: 2px solid rgba(255, 45, 45, 0.70);
}

/* Top-right */
.hud-frame-tr {
    top: 88px;
    right: 14px;
    border-top: 2px solid rgba(255, 45, 45, 0.70);
    border-right: 2px solid rgba(255, 45, 45, 0.70);
}

/* Bottom-left */
.hud-frame-bl {
    bottom: 110px;
    left: 14px;
    border-bottom: 2px solid rgba(255, 45, 45, 0.40);
    border-left: 2px solid rgba(255, 45, 45, 0.40);
}

/* Bottom-right */
.hud-frame-br {
    bottom: 110px;
    right: 14px;
    border-bottom: 2px solid rgba(255, 45, 45, 0.40);
    border-right: 2px solid rgba(255, 45, 45, 0.40);
}

/* Slightly smaller on mobile */
@media (max-width: 600px) {
    .hud-frame-corner { width: 22px; height: 22px; }
    .hud-frame-tl, .hud-frame-tr { top: 76px; }
    .hud-frame-tl, .hud-frame-bl { left: 10px; }
    .hud-frame-tr, .hud-frame-br { right: 10px; }
    .hud-frame-bl, .hud-frame-br { bottom: 95px; }
}

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

a {
    color: inherit;
    text-decoration: none;
}

button {
    cursor: pointer;
    font-family: inherit;
    border: none;
    background: none;
}

/* ─── Typography Scale ─── */
.text-display-lg {
    font-size: clamp(40px, 6vw, 64px);
    line-height: 1.1;
    letter-spacing: -0.04em;
    font-weight: 800;
    font-family: 'Geist', sans-serif;
}

.text-display-lg-mobile {
    font-size: 40px;
    line-height: 1.1;
    letter-spacing: -0.02em;
    font-weight: 800;
    font-family: 'Geist', sans-serif;
}

.text-headline-lg {
    font-size: 32px;
    line-height: 1.2;
    letter-spacing: -0.02em;
    font-weight: 700;
    font-family: 'Geist', sans-serif;
}

.text-headline-md {
    font-size: 28px;
    line-height: 1.2;
    letter-spacing: -0.01em;
    font-weight: 700;
    font-family: 'Geist', sans-serif;
}

.text-headline-sm {
    font-size: 22px;
    line-height: 1.3;
    font-weight: 600;
    font-family: 'Geist', sans-serif;
}

.text-body-lg {
    font-size: 18px;
    line-height: 1.6;
    font-weight: 400;
    font-family: 'Geist', sans-serif;
}

.text-body-md {
    font-size: 16px;
    line-height: 1.5;
    font-weight: 400;
    font-family: 'Geist', sans-serif;
}

.text-body-sm {
    font-size: 14px;
    line-height: 1.5;
    font-weight: 400;
    font-family: 'Geist', sans-serif;
}

.text-label-caps {
    font-size: 12px;
    line-height: 1;
    letter-spacing: 0.1em;
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
    text-transform: uppercase;
}

.text-label-sm {
    font-size: 11px;
    line-height: 1;
    letter-spacing: 0.08em;
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
    text-transform: uppercase;
}

/* ─── Color Utilities ─── */
.text-primary            { color: var(--color-primary); }
.text-on-primary         { color: var(--color-on-primary); }
.text-primary-container  { color: var(--color-primary-container); }
.text-on-primary-container { color: var(--color-on-primary-container); }
.text-on-background      { color: var(--color-on-background); }
.text-on-surface         { color: var(--color-on-surface); }
.text-on-surface-variant { color: var(--color-on-surface-variant); }

.bg-primary              { background-color: var(--color-primary); }
.bg-primary-container    { background-color: var(--color-primary-container); }
.bg-surface              { background-color: var(--color-surface); }
.bg-surface-container    { background-color: var(--color-surface-container); }
.bg-surface-container-high { background-color: var(--color-surface-container-high); }

/* ─── Glass Morphism Utilities ─── */
.glass-card {
    position: relative;
    background:
        /* Top-left corner H-line */
        linear-gradient(#ff2d2d, #ff2d2d) 0 0 / 20px 2.5px no-repeat,
        /* Top-left corner V-line */
        linear-gradient(#ff2d2d, #ff2d2d) 0 0 / 2.5px 20px no-repeat,
        /* Bottom-right corner H-line */
        linear-gradient(#ff2d2d, #ff2d2d) 100% 100% / 20px 2.5px no-repeat,
        /* Bottom-right corner V-line */
        linear-gradient(#ff2d2d, #ff2d2d) 100% 100% / 2.5px 20px no-repeat,
        /* Card background */
        rgba(255, 255, 255, 0.45);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
                box-shadow 0.25s ease,
                background-size 0.3s ease;
}

/* ─── Light theme: left + right lime borders (corner gradients don't show on white) ─── */
html.light .glass-card {
    background: rgba(255, 255, 255, 0.90);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    border-left: 2px solid #ff2d2d;
    border-right: 2px solid #ff2d2d;
    box-shadow:
        0 2px 0 rgba(255, 255, 255, 0.88) inset,
        0 4px 20px rgba(0, 0, 0, 0.09);
}

html.dark .glass-card {
    background:
        linear-gradient(#ff2d2d, #ff2d2d) 0 0 / 20px 2.5px no-repeat,
        linear-gradient(#ff2d2d, #ff2d2d) 0 0 / 2.5px 20px no-repeat,
        linear-gradient(#ff2d2d, #ff2d2d) 100% 100% / 20px 2.5px no-repeat,
        linear-gradient(#ff2d2d, #ff2d2d) 100% 100% / 2.5px 20px no-repeat,
        rgba(15, 22, 24, 0.55);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.30);
}

/* On hover: corners grow to 28px, card lifts */
.glass-card:hover {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.14);
    transform: translateY(-4px);
    background-size: 28px 2.5px, 2.5px 28px, 28px 2.5px, 2.5px 28px, auto;
}

html.light .glass-card:hover {
    box-shadow:
        0 2px 0 rgba(255, 255, 255, 0.88) inset,
        0 8px 28px rgba(0, 0, 0, 0.12);
    transform: translateY(-4px);
    border-left: 2.5px solid #ff2d2d;
    border-right: 2.5px solid #ff2d2d;
}

html.dark .glass-card:hover {
    box-shadow: 0 8px 36px rgba(0, 0, 0, 0.40);
    transform: translateY(-4px);
    background-size: 28px 2.5px, 2.5px 28px, 28px 2.5px, 2.5px 28px, auto;
}

.glass-panel {
    background: rgba(255, 255, 255, 0.40);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 45, 45, 0.18);
    border-top: 1px solid rgba(255, 255, 255, 0.65);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

html.dark .glass-panel {
    background: rgba(13, 21, 22, 0.50);
    border: 1px solid rgba(255, 45, 45, 0.15);
    border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.backdrop-blur-20 {
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.backdrop-blur-40 {
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
}

/* ─── Fluid Transition ─── */
.transition-fluid {
    transition: all 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.transition-performance {
    transition: all 400ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* ─── Layout Utilities ─── */
.container-xl {
    max-width: 1280px;
    margin-inline: auto;
    padding-inline: clamp(16px, 5vw, 64px);
}

.container-lg {
    max-width: 1024px;
    margin-inline: auto;
    padding-inline: clamp(16px, 4vw, 48px);
}

.page-content {
    padding-top: 110px; /* offset for fixed header */
    padding-bottom: 120px; /* offset for fixed dock */
}

/* ─── Selection ─── */
::selection {
    background-color: var(--color-primary-container);
    color: var(--color-on-primary-container);
}

/* ─── Scrollbar ─── */
::-webkit-scrollbar {
    display: none;
    width: 0;
}
html {
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}

/* ─── Living Background ─── */
.living-bg {
    position: fixed;
    inset: 0;
    z-index: -10;
    pointer-events: none;
    overflow: hidden;
}

.living-bg .orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    pointer-events: none;
}

.living-bg .orb-1 {
    top: -10%;
    left: -10%;
    width: 40%;
    height: 40%;
    background: var(--orb1-color);
    animation: orb-drift1 18s ease-in-out infinite;
}

.living-bg .orb-2 {
    bottom: -10%;
    right: -10%;
    width: 40%;
    height: 40%;
    background: var(--orb2-color);
    animation: orb-drift2 22s ease-in-out infinite;
}

.living-bg .orb-3 {
    top: 40%;
    left: 50%;
    width: 30%;
    height: 30%;
    background: var(--orb3-color);
    opacity: 0.6;
    animation: orb-drift3 15s ease-in-out infinite;
}

@keyframes orb-drift1 {
    0%   { transform: translate(0, 0) scale(1); }
    33%  { transform: translate(5%, 8%) scale(1.08); }
    66%  { transform: translate(-3%, 4%) scale(0.96); }
    100% { transform: translate(0, 0) scale(1); }
}

@keyframes orb-drift2 {
    0%   { transform: translate(0, 0) scale(1); }
    40%  { transform: translate(-6%, -5%) scale(1.10); }
    70%  { transform: translate(3%, -8%) scale(0.95); }
    100% { transform: translate(0, 0) scale(1); }
}

@keyframes orb-drift3 {
    0%   { transform: translate(-50%, -50%) scale(1); }
    50%  { transform: translate(-55%, -45%) scale(1.12); }
    100% { transform: translate(-50%, -50%) scale(1); }
}

/* Floating geometric shapes */
.floating-shape {
    position: absolute;
    border-radius: 30%;
    animation: float-shape 7s ease-in-out infinite;
    pointer-events: none;
}

@keyframes float-shape {
    0%   { transform: translateY(0) rotate(0deg); }
    50%  { transform: translateY(-18px) rotate(6deg); }
    100% { transform: translateY(0) rotate(0deg); }
}

/* ─── Hover Tilt 3D Card ─── */
.hover-tilt {
    transform-style: preserve-3d;
    transition: transform 400ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.hover-tilt:hover {
    transform: translateY(-8px) rotateX(2deg) rotateY(1deg);
}

/* ─── Primary Button ─── */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 32px;
    background-color: var(--color-primary-container);
    color: var(--color-on-primary-container);
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    letter-spacing: 0.1em;
    font-weight: 700;
    text-transform: uppercase;
    border-radius: 9999px;
    transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    box-shadow: 0 8px 24px var(--glow-primary-strong);
}

.btn-primary:hover {
    transform: scale(1.05) translateY(-2px);
    box-shadow: 0 12px 32px var(--glow-primary);
    background-color: #ff4444;
}

.btn-primary:active { transform: scale(0.96); }

/* ─── Ghost Button ─── */
.btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 32px;
    background: var(--glass-card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-card-border);
    color: var(--color-on-background);
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    letter-spacing: 0.1em;
    font-weight: 600;
    text-transform: uppercase;
    border-radius: 9999px;
    transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.btn-ghost:hover {
    transform: scale(1.03);
    background: var(--glass-bg);
}

.btn-ghost:active { transform: scale(0.97); }

/* ─── Badge Pill ─── */
.badge-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    border-radius: 9999px;
    background: var(--glass-card-bg);
    border: 1px solid var(--glass-card-border);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.1em;
    color: var(--color-primary);
    font-weight: 600;
    text-transform: uppercase;
}

.badge-pulse {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--color-primary-container);
    animation: pulse-dot 2s ease infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%  { opacity: 0.6; transform: scale(1.4); }
}

/* ─── Section Headings ─── */
.section-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.12em;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--color-primary);
    margin-bottom: 8px;
}

/* ─── Responsive ─── */
@media (max-width: 768px) {
    .text-display-lg { font-size: 36px; }
    .text-headline-lg { font-size: 26px; }
    .text-headline-md { font-size: 22px; }
    .page-content { padding-top: 90px; }
}

/* ═══════════════════════════════════════════
   MOBILE: Disable backdrop-filter — keep corner brackets
═══════════════════════════════════════════ */
@media (max-width: 700px) {
    /* Base dark mode — corner brackets in background layers */
    .glass-card {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        background:
            linear-gradient(#ff2d2d, #ff2d2d) 0 0 / 20px 2.5px no-repeat,
            linear-gradient(#ff2d2d, #ff2d2d) 0 0 / 2.5px 20px no-repeat,
            linear-gradient(#ff2d2d, #ff2d2d) 100% 100% / 20px 2.5px no-repeat,
            linear-gradient(#ff2d2d, #ff2d2d) 100% 100% / 2.5px 20px no-repeat,
            rgba(18, 26, 20, 0.96) !important;
        border: 1px solid rgba(255, 255, 255, 0.06) !important;
        box-shadow: 0 2px 16px rgba(0, 0, 0, 0.28);
    }
    /* Light mode — left + right lime borders (no corner brackets on white) */
    html.light .glass-card {
        background: rgba(255, 255, 255, 0.97) !important;
        border-top: 1px solid rgba(0, 0, 0, 0.06) !important;
        border-bottom: 1px solid rgba(0, 0, 0, 0.06) !important;
        border-left: 2px solid #ff2d2d !important;
        border-right: 2px solid #ff2d2d !important;
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08) !important;
    }
    /* Dark mode explicit */
    html.dark .glass-card {
        background:
            linear-gradient(#ff2d2d, #ff2d2d) 0 0 / 20px 2.5px no-repeat,
            linear-gradient(#ff2d2d, #ff2d2d) 0 0 / 2.5px 20px no-repeat,
            linear-gradient(#ff2d2d, #ff2d2d) 100% 100% / 20px 2.5px no-repeat,
            linear-gradient(#ff2d2d, #ff2d2d) 100% 100% / 2.5px 20px no-repeat,
            rgba(14, 20, 16, 0.98) !important;
        border: 1px solid rgba(255, 255, 255, 0.06) !important;
        box-shadow: 0 2px 16px rgba(0, 0, 0, 0.30);
    }
    /* No lift-transform on touch devices */
    .glass-card:hover {
        transform: none;
    }
    /* Dark mode: allow corner bracket grow on hover */
    html.dark .glass-card:hover {
        background-size: 20px 2.5px, 2.5px 20px, 20px 2.5px, 2.5px 20px, auto;
    }
}
