/* ==========================================================================
   GameDay Analytics — Homepage
   Dark "board" theme: ink background, hairline grid, signal-orange accent.
   Standalone: only pages/home.php loads this file (style.css still serves
   /changelog, /login, /my-notes).
   ========================================================================== */

:root {
    --ink: #0a0b0d;
    --ink-2: #111316;
    --ink-3: #181b1f;
    --line: rgba(255, 255, 255, 0.07);
    --line-2: rgba(255, 255, 255, 0.12);
    --text: #f2f3f5;
    --text-2: #9aa0a8;
    --text-3: #636973;

    --accent: #ff5a36;
    --accent-2: #ff8a4c;
    --live: #3ddc84;
    --beta: #f5b544;

    --mlb: #ff5a36;
    --nfl: #22c55e;
    --nba: #f59e0b;
    --wnba: #fb7185;
    --nhl: #60a5fa;
    --cfb: #a78bfa;

    --font: 'Geist', ui-sans-serif, system-ui, sans-serif;
    --mono: 'Geist Mono', ui-monospace, 'Menlo', monospace;
    --serif: 'Instrument Serif', Georgia, serif;

    --radius: 14px;
    --ease: cubic-bezier(0.2, 0.7, 0.2, 1);

    /* Tokens the shared footer reads */
    --dark: var(--ink);
    --dark-secondary: var(--ink-3);
    --dark-border: var(--line-2);
    --dark-text: var(--text);
    --dark-text-secondary: var(--text-2);
    --dark-text-muted: var(--text-3);
}

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

html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

body.home {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--ink);
    color: var(--text);
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.6;
    overflow-x: hidden;
}

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

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 24px; }

::selection { background: var(--accent); color: #fff; }

/* Atmosphere
   ========================================================================== */
.bg-grid {
    position: absolute;
    inset: 0 0 auto 0;
    height: 900px;
    background-image:
        linear-gradient(var(--line) 1px, transparent 1px),
        linear-gradient(90deg, var(--line) 1px, transparent 1px);
    background-size: 64px 64px;
    mask-image: radial-gradient(ellipse 80% 70% at 50% 0%, #000 30%, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 0%, #000 30%, transparent 75%);
    pointer-events: none;
    z-index: 0;
}

.bg-glow {
    position: absolute;
    top: -260px;
    left: 50%;
    width: 1100px;
    height: 700px;
    transform: translateX(-30%);
    background:
        radial-gradient(closest-side, rgba(255, 90, 54, 0.22), transparent 70%),
        radial-gradient(closest-side at 80% 60%, rgba(96, 165, 250, 0.10), transparent 70%);
    filter: blur(20px);
    pointer-events: none;
    z-index: 0;
}

main, .site-header, footer { position: relative; z-index: 1; }

/* Header
   ========================================================================== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(10, 11, 13, 0.7);
    backdrop-filter: saturate(160%) blur(14px);
    -webkit-backdrop-filter: saturate(160%) blur(14px);
    border-bottom: 1px solid var(--line);
}

.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }

.logo { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

.logo-mark {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 9px;
    color: #fff;
    background: linear-gradient(135deg, var(--accent), #c2321a);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12) inset, 0 6px 20px -6px rgba(255, 90, 54, 0.7);
}

.logo-text { font-weight: 700; font-size: 1.02rem; letter-spacing: -0.02em; }
.logo-text span { color: var(--text-2); font-weight: 500; margin-left: 2px; }

.site-nav { display: flex; align-items: center; gap: 4px; }

.nav-link {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-2);
    padding: 8px 12px;
    border-radius: 8px;
    transition: color 0.15s, background 0.15s;
}
.nav-link:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }

.nav-admin {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    padding: 7px 14px;
    border-radius: 999px;
    border: 1px solid var(--line-2);
    background: rgba(255, 255, 255, 0.04);
    transition: border-color 0.15s, background 0.15s;
}
.nav-admin:hover { border-color: var(--accent); background: rgba(255, 90, 54, 0.1); }

/* Hero
   ========================================================================== */
.hero { padding: 112px 0 72px; }

.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--mono);
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-2);
    padding: 6px 14px 6px 12px;
    border: 1px solid var(--line-2);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.03);
}

.pulse {
    position: relative;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--live);
    flex-shrink: 0;
}
.pulse::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: var(--live);
    animation: ping 2s var(--ease) infinite;
}
@keyframes ping { 0% { transform: scale(1); opacity: 0.7; } 100% { transform: scale(3); opacity: 0; } }

.hero-title {
    margin-top: 28px;
    font-size: clamp(2.75rem, 7.5vw, 6rem);
    font-weight: 700;
    line-height: 0.98;
    letter-spacing: -0.045em;
    background: linear-gradient(180deg, #fff 40%, #b9bec6);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.hero-title em {
    font-family: var(--serif);
    font-style: italic;
    font-weight: 400;
    letter-spacing: -0.02em;
    padding-right: 0.08em;
    background: linear-gradient(100deg, var(--accent), var(--accent-2));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero-subtitle {
    margin-top: 28px;
    max-width: 600px;
    font-size: 1.125rem;
    color: var(--text-2);
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 46px;
    padding: 0 22px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: transform 0.15s var(--ease), box-shadow 0.2s, background 0.2s, border-color 0.2s;
}
.btn svg { transition: transform 0.2s var(--ease); }
.btn:hover svg { transform: translateX(3px); }

.btn-primary {
    color: #fff;
    background: linear-gradient(135deg, var(--accent), #e2401d);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.15) inset, 0 10px 30px -10px rgba(255, 90, 54, 0.8);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.2) inset, 0 14px 36px -10px rgba(255, 90, 54, 0.95); }

.btn-ghost { color: var(--text); border: 1px solid var(--line-2); background: rgba(255, 255, 255, 0.03); }
.btn-ghost:hover { border-color: rgba(255, 255, 255, 0.3); background: rgba(255, 255, 255, 0.06); }

.stat-strip {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    margin-top: 80px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.01));
    overflow: hidden;
}
.stat { padding: 22px 24px; border-left: 1px solid var(--line); }
.stat:first-child { border-left: 0; }
.stat dt {
    font-family: var(--mono);
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-3);
}
.stat dd {
    margin-top: 6px;
    font-family: var(--mono);
    font-size: 1.6rem;
    font-weight: 500;
    letter-spacing: -0.03em;
    color: var(--text);
    font-variant-numeric: tabular-nums;
}

/* Sections
   ========================================================================== */
.leagues, .features { padding: 72px 0; }
.features { padding-bottom: 120px; }

.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 24px; margin-bottom: 32px; flex-wrap: wrap-reverse; }
.section-kicker { font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); }
.section-title { font-size: clamp(1.9rem, 4vw, 2.75rem); font-weight: 700; letter-spacing: -0.035em; line-height: 1.1; order: -1; }

/* League cards
   ========================================================================== */
.league-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }

.league-card {
    --c: var(--accent);
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 250px;
    padding: 24px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: linear-gradient(180deg, var(--ink-3), var(--ink-2));
    overflow: hidden;
    isolation: isolate;
    transition: transform 0.25s var(--ease), border-color 0.25s, box-shadow 0.25s;
}
.league-card::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background: radial-gradient(500px circle at 100% 0%, color-mix(in srgb, var(--c) 22%, transparent), transparent 55%);
    opacity: 0.55;
    transition: opacity 0.3s;
}
.league-card::after {
    content: '';
    position: absolute;
    left: 24px;
    right: 24px;
    top: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--c), transparent);
    opacity: 0.7;
}
.league-card:hover {
    transform: translateY(-3px);
    border-color: color-mix(in srgb, var(--c) 45%, transparent);
    box-shadow: 0 20px 50px -24px color-mix(in srgb, var(--c) 60%, transparent);
}
.league-card:hover::before { opacity: 1; }

.league-card--feature { grid-column: span 2; min-height: 300px; padding: 32px; }

.league-card--mlb  { --c: var(--mlb); }
.league-card--nfl  { --c: var(--nfl); }
.league-card--nba  { --c: var(--nba); }
.league-card--wnba { --c: var(--wnba); }
.league-card--nhl  { --c: var(--nhl); }
.league-card--cfb  { --c: var(--cfb); }

.league-ghost {
    position: absolute;
    right: -0.04em;
    bottom: -0.22em;
    z-index: -1;
    font-size: 7rem;
    font-weight: 800;
    letter-spacing: -0.06em;
    line-height: 1;
    color: transparent;
    -webkit-text-stroke: 1px rgba(255, 255, 255, 0.06);
    transition: -webkit-text-stroke-color 0.3s, transform 0.4s var(--ease);
    user-select: none;
}
.league-card--feature .league-ghost { font-size: 11rem; }
.league-card:hover .league-ghost { -webkit-text-stroke-color: color-mix(in srgb, var(--c) 35%, transparent); transform: translateX(-6px); }

.league-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

.league-abbr { font-family: var(--mono); font-size: 0.85rem; font-weight: 600; letter-spacing: 0.06em; color: var(--c); }

.chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-family: var(--mono);
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 999px;
}
.chip--live { color: var(--live); background: rgba(61, 220, 132, 0.1); border: 1px solid rgba(61, 220, 132, 0.25); }
.chip--live .pulse { width: 6px; height: 6px; }
.chip--beta { color: var(--beta); background: rgba(245, 181, 68, 0.08); border: 1px solid rgba(245, 181, 68, 0.25); }

.league-name { margin-top: 20px; font-size: 1.3rem; font-weight: 650; letter-spacing: -0.025em; line-height: 1.2; }
.league-card--feature .league-name { font-size: 1.85rem; }

.league-desc { margin-top: 10px; font-size: 0.9rem; line-height: 1.55; color: var(--text-2); max-width: 46ch; }

.league-cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: auto;
    padding-top: 22px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text);
}
.league-cta svg { color: var(--c); transition: transform 0.2s var(--ease); }
.league-card:hover .league-cta svg { transform: translateX(4px); }

/* Features
   ========================================================================== */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    border-top: 1px solid var(--line-2);
}
.feature { padding: 28px 28px 8px 0; }
.feature + .feature { padding-left: 28px; border-left: 1px solid var(--line); }
.feature-num { font-family: var(--mono); font-size: 0.75rem; color: var(--accent); }
.feature h3 { margin-top: 18px; font-size: 1.08rem; font-weight: 600; letter-spacing: -0.02em; }
.feature p { margin-top: 10px; font-size: 0.9rem; color: var(--text-2); }

/* Footer overrides (shared include renders its own styles)
   ========================================================================== */
body.home .gf2 { background: var(--ink-2); border-top-color: var(--line); }
body.home .gf2-col a.gf2-link:hover,
body.home .gf2-dev a { color: var(--accent); }
body.home .gf2-col h4 { font-family: var(--mono); letter-spacing: 0.1em; color: var(--text-2); }
body.home .gf2-stat { font-family: var(--mono); }

/* Motion
   ========================================================================== */
.reveal { opacity: 0; transform: translateY(14px); animation: rise 0.8s var(--ease) forwards; animation-delay: calc(var(--d, 0) * 90ms + 60ms); }
@keyframes rise { to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
    .reveal { opacity: 1; transform: none; animation: none; }
    .pulse::after { animation: none; }
    .league-card, .league-ghost, .btn, .btn svg { transition: none; }
}

/* Responsive
   ========================================================================== */
@media (max-width: 960px) {
    .league-grid { grid-template-columns: repeat(2, 1fr); }
    .feature-grid { grid-template-columns: repeat(2, 1fr); }
    .feature:nth-child(3) { padding-left: 0; border-left: 0; }
    .stat-strip { grid-template-columns: repeat(2, 1fr); }
    .stat:nth-child(3) { border-left: 0; }
    .stat:nth-child(n+3) { border-top: 1px solid var(--line); }
}

@media (max-width: 640px) {
    .container { padding: 0 16px; }
    .header-inner { height: 58px; }
    .logo-text span { display: none; }
    .nav-link { padding: 6px 8px; font-size: 0.8rem; }
    .nav-link[href="#leagues"] { display: none; }
    .nav-admin { margin-left: 4px; padding: 6px 11px; font-size: 0.8rem; }
    .hero { padding: 72px 0 48px; }
    .hero-subtitle { font-size: 1rem; }
    .stat-strip { margin-top: 56px; }
    .stat { padding: 16px; }
    .stat dd { font-size: 1.25rem; }
    .league-grid { grid-template-columns: 1fr; }
    .league-card--feature { grid-column: auto; min-height: 260px; padding: 24px; }
    .league-card--feature .league-name { font-size: 1.5rem; }
    .league-card--feature .league-ghost { font-size: 8rem; }
    .feature-grid { grid-template-columns: 1fr; }
    .feature, .feature + .feature { padding: 24px 0 4px; border-left: 0; }
    .feature + .feature { border-top: 1px solid var(--line); }
}
