/* ============================================
   FUNWAY INTERACTIVE - SHARED STYLES
   Command Center Intelligence Aesthetic
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
    --bg-deep: #0c1018;
    --bg-primary: #1a2332;
    --bg-elevated: #0f1721;
    --bg-card: rgba(255, 255, 255, 0.04);
    --bg-card-hover: rgba(255, 255, 255, 0.07);

    --accent-cyan: #00d4ff;
    --accent-cyan-dim: rgba(0, 212, 255, 0.15);
    --accent-cyan-glow: rgba(0, 212, 255, 0.35);
    --accent-purple: #7c3aed;
    --accent-purple-dim: rgba(124, 58, 237, 0.15);
    --accent-purple-glow: rgba(124, 58, 237, 0.35);
    --accent-gold: #fbbf24;
    --accent-green: #10b981;
    --accent-red: #ef4444;

    --text-primary: #ffffff;
    --text-secondary: #e0e7ff;
    --text-muted: rgba(224, 231, 255, 0.6);
    --text-faint: rgba(224, 231, 255, 0.4);

    --border-subtle: rgba(0, 212, 255, 0.12);
    --border-card: rgba(0, 212, 255, 0.2);
    --border-card-hover: rgba(0, 212, 255, 0.45);
    --border-purple: rgba(124, 58, 237, 0.3);

    --gradient-main: linear-gradient(135deg, #00d4ff 0%, #7c3aed 100%);
    --gradient-hero: linear-gradient(135deg, #1a2332 0%, #2d1b4e 50%, #1a2332 100%);
    --gradient-section-alt: linear-gradient(180deg, #0f1721 0%, #1a2332 100%);

    --radius-sm: 0.5rem;
    --radius-md: 1rem;
    --radius-lg: 1.5rem;
    --radius-full: 9999px;

    --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.25);
    --shadow-card-hover: 0 8px 40px rgba(0, 212, 255, 0.12);
    --shadow-glow-cyan: 0 0 30px rgba(0, 212, 255, 0.25);
    --shadow-glow-purple: 0 0 30px rgba(124, 58, 237, 0.25);

    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-spring: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);

    --max-width: 72rem;
    --section-padding: 5rem 2rem;
    --section-padding-sm: 3rem 1.25rem;
}

/* --- Base Reset & Typography --- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

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

body {
    background: var(--bg-primary);
    color: var(--text-primary);
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-weight: 400;
    line-height: 1.6;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Sora', 'Inter', sans-serif;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
    margin: 0;
}

p {
    margin: 0;
}

a {
    transition: color var(--transition-fast), opacity var(--transition-fast);
}

img {
    max-width: 100%;
    height: auto;
}

/* --- Noise Texture Overlay --- */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: none;
    opacity: 0.025;
    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.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='1'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 256px 256px;
}

/* --- Gradient Text --- */
.gradient-text {
    background: var(--gradient-main);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* --- Glass Card --- */
.glass-card {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-md);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: var(--shadow-card);
    transition:
        transform var(--transition-smooth),
        border-color var(--transition-smooth),
        box-shadow var(--transition-smooth),
        background var(--transition-smooth);
}

.glass-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-card-hover);
    box-shadow: var(--shadow-card-hover);
    transform: translateY(-3px);
}

/* Cards that shouldn't lift (tables, large content blocks) */
.glass-card--static {
    transition: border-color var(--transition-smooth), box-shadow var(--transition-smooth);
}

.glass-card--static:hover {
    transform: none;
}

/* --- Pulse Glow Animation --- */
.pulse-glow {
    animation: pulse-glow 2.5s ease-in-out infinite alternate;
}

@keyframes pulse-glow {
    from { box-shadow: 0 0 20px rgba(0, 212, 255, 0.3), 0 0 60px rgba(0, 212, 255, 0.1); }
    to { box-shadow: 0 0 25px rgba(124, 58, 237, 0.4), 0 0 80px rgba(124, 58, 237, 0.15); }
}

/* --- Floating Animation --- */
.floating {
    animation: floating 4s ease-in-out infinite;
}

@keyframes floating {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-12px); }
}

/* --- Scroll Reveal --- */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered children */
.reveal-stagger > .reveal:nth-child(1) { transition-delay: 0s; }
.reveal-stagger > .reveal:nth-child(2) { transition-delay: 0.08s; }
.reveal-stagger > .reveal:nth-child(3) { transition-delay: 0.16s; }
.reveal-stagger > .reveal:nth-child(4) { transition-delay: 0.24s; }
.reveal-stagger > .reveal:nth-child(5) { transition-delay: 0.32s; }
.reveal-stagger > .reveal:nth-child(6) { transition-delay: 0.40s; }
.reveal-stagger > .reveal:nth-child(7) { transition-delay: 0.48s; }
.reveal-stagger > .reveal:nth-child(8) { transition-delay: 0.56s; }

/* --- Fade-in-up (for hero, initial load) --- */
.fade-in-up {
    animation: fadeInUp 0.9s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
    transform: translateY(30px);
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Progress Bar --- */
.progress-bar {
    animation: progressFill 2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    width: 0%;
}

@keyframes progressFill {
    to { width: var(--width); }
}

/* --- Pulse Scale --- */
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.04); }
}

/* --- Hero Animated Gradient Background --- */
.hero-bg {
    position: relative;
    overflow: hidden;
}

.hero-bg::before {
    content: '';
    position: absolute;
    inset: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(ellipse at 30% 50%, rgba(0, 212, 255, 0.08) 0%, transparent 50%),
                radial-gradient(ellipse at 70% 50%, rgba(124, 58, 237, 0.08) 0%, transparent 50%),
                radial-gradient(ellipse at 50% 100%, rgba(0, 212, 255, 0.05) 0%, transparent 40%);
    animation: heroShift 12s ease-in-out infinite alternate;
    z-index: 0;
    pointer-events: none;
}

@keyframes heroShift {
    0% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(-3%, 2%) rotate(1deg); }
    66% { transform: translate(2%, -1%) rotate(-0.5deg); }
    100% { transform: translate(-1%, -2%) rotate(0.5deg); }
}

.hero-bg > * {
    position: relative;
    z-index: 1;
}

/* --- Navigation --- */
.site-nav {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(26, 35, 50, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 1000;
    padding: 0 2rem;
    border-bottom: 1px solid var(--border-subtle);
    transition: background var(--transition-smooth), box-shadow var(--transition-smooth);
}

.site-nav.scrolled {
    background: rgba(15, 23, 33, 0.97);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
    border-bottom-color: rgba(0, 212, 255, 0.15);
}

.site-nav__inner {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 4rem;
}

.site-nav__logo {
    font-family: 'Sora', sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    text-decoration: none;
    letter-spacing: -0.03em;
}

/* Nav Links */
.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    position: relative;
    padding: 0.25rem 0;
    transition: color var(--transition-fast);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-main);
    border-radius: 1px;
    transition: width var(--transition-smooth);
}

.nav-link:hover {
    color: var(--accent-cyan);
}

.nav-link:hover::after {
    width: 100%;
}

.nav-link--active {
    color: var(--accent-cyan);
}

.nav-link--active::after {
    width: 100%;
}

/* Desktop Menu */
#desktop-menu {
    display: flex;
    gap: 2rem;
    align-items: center;
}

/* CTA Button in Nav */
.nav-cta {
    padding: 0.5rem 1.5rem;
    border-radius: var(--radius-sm);
    background: var(--gradient-main);
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: transform var(--transition-fast), box-shadow var(--transition-smooth);
    box-shadow: 0 2px 12px rgba(0, 212, 255, 0.2);
}

.nav-cta:hover {
    transform: scale(1.04);
    box-shadow: 0 4px 20px rgba(0, 212, 255, 0.35);
}

/* Mobile Burger */
#mobile-menu-button {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 1001;
}

#mobile-menu-button div {
    width: 22px;
    height: 2px;
    background: var(--accent-cyan);
    border-radius: 2px;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center;
}

#mobile-menu-button.active div:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

#mobile-menu-button.active div:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

#mobile-menu-button.active div:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile Menu Dropdown */
#mobile-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(15, 23, 33, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-subtle);
    padding: 1.5rem 2rem;
    transform-origin: top;
    animation: menuSlideDown 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes menuSlideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#mobile-menu a {
    display: block;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    transition: color var(--transition-fast), padding-left var(--transition-fast);
}

#mobile-menu a:hover {
    color: var(--accent-cyan);
    padding-left: 0.5rem;
}

#mobile-menu .nav-cta {
    display: block;
    text-align: center;
    margin-top: 1rem;
    padding: 1rem 2rem;
    border-bottom: none;
}

/* --- Buttons --- */
.btn-primary {
    display: inline-block;
    padding: 1rem 2.25rem;
    border-radius: var(--radius-sm);
    background: var(--gradient-main);
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.05rem;
    border: none;
    cursor: pointer;
    transition: transform var(--transition-fast), box-shadow var(--transition-smooth);
    box-shadow: 0 4px 20px rgba(0, 212, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, transparent 50%);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.btn-primary:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 32px rgba(0, 212, 255, 0.35);
}

.btn-primary:hover::before {
    opacity: 1;
}

.btn-primary:active {
    transform: translateY(0) scale(0.99);
}

.btn-outline {
    display: inline-block;
    padding: 1rem 2.25rem;
    border-radius: var(--radius-sm);
    border: 2px solid var(--accent-cyan);
    color: var(--accent-cyan);
    text-decoration: none;
    font-weight: 600;
    background: transparent;
    cursor: pointer;
    transition: all var(--transition-smooth);
}

.btn-outline:hover {
    background: rgba(0, 212, 255, 0.1);
    border-color: var(--accent-cyan);
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.15);
    transform: translateY(-2px);
}

.btn-outline:active {
    transform: translateY(0);
}

/* --- Badge / Tag --- */
.badge {
    display: inline-block;
    padding: 0.5rem 1.25rem;
    border-radius: var(--radius-full);
    border: 1px solid var(--accent-cyan);
    color: var(--accent-cyan);
    background: var(--accent-cyan-dim);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

/* --- Section Containers --- */
.section {
    padding: var(--section-padding);
}

.section__inner {
    max-width: var(--max-width);
    margin: 0 auto;
}

.section__title {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    text-align: center;
    margin-bottom: 1rem;
}

.section__subtitle {
    font-size: 1.1rem;
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 3.5rem;
    max-width: 56rem;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.7;
}

/* --- Comparison Tables --- */
.comparison-table {
    width: 100%;
    border-collapse: collapse;
}

.comparison-table thead tr {
    background: rgba(0, 212, 255, 0.08);
}

.comparison-table th {
    padding: 1.25rem 1.5rem;
    font-weight: 600;
    font-size: 1rem;
    font-family: 'Sora', sans-serif;
}

.comparison-table td {
    padding: 1.25rem 1.5rem;
    transition: background var(--transition-fast);
}

.comparison-table tbody tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.comparison-table tbody tr:hover {
    background: rgba(0, 212, 255, 0.03);
}

/* --- Checkmark / Cross Styling --- */
.check-yes {
    color: var(--accent-cyan);
    font-size: 1.6rem;
    font-weight: 800;
}

.check-no {
    opacity: 0.3;
    font-size: 1.6rem;
    font-weight: 800;
}

/* --- Callout Box --- */
.callout {
    background: rgba(0, 212, 255, 0.06);
    padding: 1.5rem;
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--accent-cyan);
}

.callout--purple {
    background: rgba(124, 58, 237, 0.06);
    border-left-color: var(--accent-purple);
}

/* --- Footer --- */
.site-footer {
    background: var(--bg-deep);
    border-top: 1px solid var(--border-subtle);
    padding: 3rem 2rem;
}

.site-footer__inner {
    max-width: var(--max-width);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 2rem;
    align-items: center;
}

.site-footer__brand {
    font-family: 'Sora', sans-serif;
    font-weight: 700;
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.site-footer__copy {
    font-size: 0.8rem;
    color: var(--text-faint);
    line-height: 1.6;
}

.site-footer__links {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.site-footer__links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color var(--transition-fast);
}

.site-footer__links a:hover {
    color: var(--accent-cyan);
}

/* --- Scroll-to-Top Button --- */
.scroll-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--gradient-main);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    z-index: 999;
    opacity: 0;
    transform: translateY(20px) scale(0.8);
    pointer-events: none;
    transition: all var(--transition-smooth);
    box-shadow: 0 4px 20px rgba(0, 212, 255, 0.25);
}

.scroll-top.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.scroll-top:hover {
    transform: translateY(-3px) scale(1.08);
    box-shadow: 0 8px 30px rgba(0, 212, 255, 0.4);
}

.scroll-top svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* --- Responsive --- */

/* Tablet and below */
@media (max-width: 768px) {
    :root {
        --section-padding: 3.5rem 1.25rem;
    }

    /* Nav */
    #desktop-menu {
        display: none !important;
    }

    #mobile-menu-button {
        display: flex !important;
    }

    .site-nav {
        padding: 0 1rem;
    }

    /* All inline-styled 2-column grids collapse to 1 column */
    [style*="grid-template-columns: 1fr 1fr"],
    [style*="grid-template-columns: 2fr 1fr"] {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }

    /* Named layout grids */
    .hero-grid {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
    }

    .dashboard-compact {
        max-width: 100% !important;
        margin-top: 1rem !important;
    }

    .audit-feature-grid,
    .problem-solution-grid {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
    }

    .audit-stats-grid {
        grid-template-columns: 1fr 1fr !important;
    }

    .desktop-table {
        display: none !important;
    }

    .mobile-cards {
        display: block !important;
    }

    .responsive-grid {
        grid-template-columns: 1fr !important;
    }

    .mobile-hidden {
        display: none !important;
    }

    /* Audit steps */
    .audit-step {
        flex-direction: column !important;
        gap: 1rem !important;
    }

    .audit-step-number {
        min-width: auto !important;
        font-size: 2rem !important;
    }

    /* Inline flex containers wrap */
    [style*="display: flex"][style*="gap: 1rem"],
    [style*="display: flex"][style*="gap: 2rem"],
    [style*="display: flex"][style*="gap: 3rem"] {
        flex-wrap: wrap !important;
    }

    /* Tables: horizontal scroll */
    table {
        min-width: 0 !important;
    }

    /* Section headings scale */
    [style*="font-size: 3rem"] {
        font-size: clamp(1.75rem, 6vw, 2.5rem) !important;
    }

    [style*="font-size: 2.5rem"] {
        font-size: clamp(1.5rem, 5.5vw, 2rem) !important;
    }

    /* Reduce section padding */
    section[style*="padding: 5rem 2rem"] {
        padding: 3rem 1.25rem !important;
    }

    section[style*="padding: 8rem 2rem"] {
        padding: 6rem 1.25rem 3rem !important;
    }

    /* Glass cards reduce padding on mobile */
    .glass-card[style*="padding: 3rem"],
    .glass-card[style*="padding: 2.5rem"] {
        padding: 1.5rem !important;
    }

    /* Progress bar labels */
    [style*="width: 180px"] {
        width: 120px !important;
        font-size: 0.8rem !important;
    }

    /* Footer */
    .site-footer__inner {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .site-footer__links {
        justify-content: center;
    }

    /* Footer multi-column grid */
    .site-footer [style*="grid-template-columns: repeat(auto-fit"] {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
    }

    /* Scroll-to-top */
    .scroll-top {
        bottom: 1.25rem;
        right: 1.25rem;
        width: 40px;
        height: 40px;
    }
}

/* Small phones */
@media (max-width: 480px) {
    .section__title {
        font-size: clamp(1.5rem, 7vw, 2rem);
    }

    .btn-primary,
    .btn-outline {
        padding: 0.85rem 1.75rem;
        font-size: 0.95rem;
    }

    /* Even smaller headings on very small screens */
    [style*="font-size: 3rem"] {
        font-size: 1.5rem !important;
    }

    [style*="font-size: 2.5rem"] {
        font-size: 1.35rem !important;
    }

    [style*="font-size: 1.75rem"] {
        font-size: 1.25rem !important;
    }

    /* Full-width buttons */
    [style*="display: flex"][style*="gap: 1rem"] > a {
        flex: 1 1 100% !important;
        text-align: center !important;
    }

    /* Stat cards auto-fit min smaller */
    [style*="minmax(220px"],
    [style*="minmax(200px"],
    [style*="minmax(180px"] {
        grid-template-columns: 1fr 1fr !important;
    }

    /* Pricing cards stack */
    [style*="minmax(350px"] {
        grid-template-columns: 1fr !important;
    }

    /* Nav padding */
    .site-nav {
        padding: 0 0.75rem;
    }

    /* Card padding */
    .glass-card {
        padding: 1.25rem;
    }
}

/* Large screens: contain max widths */
@media (min-width: 1280px) {
    .hero-bg > div {
        max-width: var(--max-width);
        margin-left: auto;
        margin-right: auto;
    }
}

/* --- Utility Classes --- */
.text-cyan { color: var(--accent-cyan); }
.text-purple { color: var(--accent-purple); }
.text-gold { color: var(--accent-gold); }
.text-green { color: var(--accent-green); }
.text-muted { color: var(--text-muted); }
.text-faint { color: var(--text-faint); }
.text-center { text-align: center; }
.text-left { text-align: left; }
.font-heading { font-family: 'Sora', sans-serif; }

.opacity-80 { opacity: 0.8; }
.opacity-60 { opacity: 0.6; }
.opacity-50 { opacity: 0.5; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.mb-6 { margin-bottom: 3rem; }
.mb-8 { margin-bottom: 4rem; }
