/* =========================================================================
   FlowState Alpha - Institutional UI Styles
   ========================================================================= */

   :root {
    /* Logo-aligned deep navy base */
    --color-bg: #040812;
    --color-bg-card: rgba(12, 20, 34, 0.5);
    --color-border: rgba(145, 167, 211, 0.2);
    
    /* Brand accents from logo */
    --color-accent-green: #4D7CFF;
    --color-accent-blue: #7FB0FF;
    --color-accent-gold: #F3C65A;
    --color-accent-mint: #8FD6B5;
    
    /* Pure clean typography */
    --font-primary: 'Inter', system-ui, -apple-system, sans-serif;
    
    /* Fluid scale constraints */
    --space-sm: clamp(1rem, 2vw, 1.5rem);
    --space-md: clamp(2rem, 5vw, 4rem);
    --space-lg: clamp(4rem, 10vw, 8rem);
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
}

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

body {
    background-color: var(--color-bg);
    color: #e2e8f0;
    font-family: var(--font-primary);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

html {
    scroll-padding-top: 7rem;
}

section[id] {
    scroll-margin-top: 7rem;
}

/* =========================================================================
   BACKGROUND EFFECTS (Subdued)
   ========================================================================= */
.bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -2;
    mask-image: linear-gradient(to bottom, black 20%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, black 20%, transparent 100%);
    pointer-events: none;
}

.bg-glow {
    position: fixed;
    top: -20%;
    left: 50%;
    transform: translateX(-50%);
    width: 80vw;
    height: 60vh;
    background: radial-gradient(circle, rgba(77, 124, 255, 0.18) 0%, rgba(243, 198, 90, 0.08) 38%, transparent 66%);
    z-index: -1;
    pointer-events: none;
}

.noise-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: none;
    opacity: 0.15;
}

body.performance-mode .noise-overlay {
    display: none;
}

body.performance-mode .glass-card::before,
body.performance-mode .glass-card::after {
    display: none;
}

body.performance-mode .bg-glow {
    opacity: 0.45;
}

/* =========================================================================
   COMPONENTS
   ========================================================================= */
/* Glassmorphism Panel Base */
.glass-panel, .glass-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.01) 100%);
    backdrop-filter: blur(20px) saturate(150%);
    -webkit-backdrop-filter: blur(20px) saturate(150%);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    position: relative;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.glass-card::before,
.glass-card::after {
    content: '';
    position: absolute;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.5s ease;
    border-radius: inherit;
}

/* Background spotlight glow */
.glass-card::before {
    inset: 0;
    background: radial-gradient(600px circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(77, 124, 255, 0.14), transparent 40%);
    z-index: 0;
}

/* Bright border glow */
.glass-card::after {
    inset: 0;
    padding: 1px;
    background: radial-gradient(300px circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(127, 176, 255, 0.52), transparent 40%);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    -webkit-mask-composite: xor;
    z-index: 2;
}

.glass-card:hover::before,
.glass-card:hover::after {
    opacity: 1;
    transition: opacity 0.2s ease;
}

.hover-lift {
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}
.hover-lift:hover {
    transform: translateY(-4px);
    border-color: rgba(77, 124, 255, 0.36);
    box-shadow: 0 10px 40px -10px rgba(0,0,0,0.5);
}

/* Typography Utility */
.accent-text {
    color: var(--color-accent-gold);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.8rem 1.8rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    text-decoration: none;
    transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, filter 0.3s ease;
    font-size: 1rem;
    cursor: pointer;
}

.btn-text {
    display: inline-block;
    pointer-events: none;
}

.btn-primary {
    background: linear-gradient(135deg, #4D7CFF 0%, #7FB0FF 48%, #F3C65A 100%);
    color: #071122;
    box-shadow: 0 7px 24px -8px rgba(77, 124, 255, 0.6);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #5A88FF 0%, #9DC5FF 48%, #FFD575 100%);
    filter: brightness(1.1);
    box-shadow: 0 8px 26px -8px rgba(77, 124, 255, 0.72);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

.btn-outline {
    background: transparent;
    color: #fff;
    border: 1px solid rgba(127, 176, 255, 0.42);
}
.btn-outline:hover {
    border-color: rgba(243, 198, 90, 0.7);
    background: rgba(127,176,255,0.08);
}

.badge {
    display: inline-block;
    padding: 0.4rem 0.8rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--color-border);
    border-radius: 100px;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #bfd2f6;
    margin-bottom: 1.5rem;
}

.inline-error-banner {
    position: fixed;
    top: 6.15rem;
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
    width: min(90%, 620px);
    padding: 0.72rem 1rem;
    border-radius: 10px;
    border: 1px solid rgba(248, 113, 113, 0.45);
    background: rgba(127, 29, 29, 0.9);
    color: #fee2e2;
    box-shadow: 0 10px 30px rgba(2, 6, 23, 0.5);
    z-index: 220;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease, transform 0.22s ease;
    font-size: 0.92rem;
    line-height: 1.35;
}

.inline-error-banner.is-visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* =========================================================================
   NAVIGATION
   ========================================================================= */
.nav {
    position: fixed;
    top: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 1200px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    z-index: 100;
    border-radius: 100px;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.72rem;
    color: #f1f6ff;
    text-decoration: none;
}

.nav-logo-mark {
    width: 38px;
    height: 38px;
    display: block;
    filter: drop-shadow(0 4px 14px rgba(77, 124, 255, 0.28));
    flex-shrink: 0;
}

.nav-logo-text {
    font-family: var(--font-primary);
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: 0.01em;
}

.logo-icon {
    color: var(--color-accent-gold);
    font-size: 1rem;
}

/* =========================================================================
   LAYOUT UTILS
   ========================================================================= */
section {
    padding: var(--space-lg) var(--space-md);
    max-width: 1200px;
    margin: 0 auto;
}

.section-header {
    text-align: center;
    margin-bottom: var(--space-md);
}

.section-header h2 {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.section-header p {
    color: #94a3b8;
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* =========================================================================
   HERO
   ========================================================================= */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4rem;
    padding-top: calc(var(--space-lg) + 5rem);
}

.hero-content {
    flex: 1;
    max-width: 600px;
}

.hero-brand-logo {
    width: clamp(140px, 18vw, 210px);
    height: auto;
    margin: 0 0 1rem;
    display: block;
    filter: drop-shadow(0 10px 28px rgba(26, 53, 116, 0.55));
}

.hero-title {
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.03em;
    margin-bottom: 1.5rem;
    color: #fff;
}

.hero-subtitle {
    font-size: clamp(1rem, 1.5vw, 1.15rem);
    color: #94a3b8;
    margin-bottom: 2.5rem;
    max-width: 500px;
    line-height: 1.7;
}

.hero-cta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Platform Mockup Visual */
.hero-visual {
    flex: 1;
    display: flex;
    justify-content: flex-end;
    perspective: 1200px;
}

.canvas-container {
    width: 100%;
    max-width: 500px;
    height: 350px;
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 26px 55px -20px rgba(0, 0, 0, 0.72), inset 0 0 0 1px rgba(59, 130, 246, 0.12);
    background: linear-gradient(165deg, rgba(8, 12, 20, 0.96) 0%, rgba(5, 8, 13, 0.95) 58%, rgba(8, 14, 20, 0.96) 100%);
    border: 1px solid rgba(148, 163, 184, 0.22);
    position: relative;
    z-index: 10;
}

.canvas-container::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    background: linear-gradient(180deg, rgba(77, 124, 255, 0.14) 0%, transparent 30%),
                linear-gradient(90deg, rgba(243, 198, 90, 0.08) 0%, transparent 45%);
}

.canvas-container::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 2;
    background: linear-gradient(0deg, rgba(5, 9, 14, 0.38) 0%, transparent 25%);
}

#hero-canvas {
    width: 100%;
    height: 100%;
    display: block;
    position: relative;
    z-index: 0;
    background: linear-gradient(180deg, rgba(5, 9, 15, 0.86) 0%, rgba(5, 9, 14, 0.98) 100%);
}

/* =========================================================================
   PHILOSOPHY GRID
   ========================================================================= */
.philosophy-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem;
    align-items: stretch;
}

.ph-card {
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.icon-svg {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    background: rgba(255,255,255,0.03);
    border-radius: 12px;
    margin-bottom: 0.5rem;
}

.ph-card.highlighted .icon-svg {
    color: var(--color-accent-gold);
    background: rgba(243, 198, 90, 0.14);
}

.ph-card h3 {
    font-size: 1.25rem;
    color: #fff;
}

.ph-card p {
    color: #94a3b8;
    font-size: 0.95rem;
}

.ph-card.highlighted {
    grid-column: 1 / -1;
    background: linear-gradient(145deg, rgba(20, 24, 36, 0.72) 0%, rgba(77, 124, 255, 0.09) 56%, rgba(243, 198, 90, 0.08) 100%);
    border-color: rgba(127, 176, 255, 0.34);
}

/* =========================================================================
   SOCIAL PROOF / DISCORD MOCKUPS
   ========================================================================= */
.proof-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 700px;
    margin: 0 auto;
}

.proof-grid.marquee-wrapper {
    max-width: 100%;
    overflow: hidden;
    position: relative;
    padding: 1rem 0;
    flex-direction: row;
    display: block; /* Override default flex column */
}

.marquee-content {
    display: flex;
    gap: 1.5rem;
    width: max-content;
}

.discord-message {
    width: 100%;
    max-width: 100%;
    padding: 1.5rem;
    display: flex !important;
    gap: 1rem;
    flex-direction: row !important;
    align-items: flex-start !important;
    flex-shrink: 0;
}

.proof-grid.marquee-wrapper .discord-message {
    width: 350px; /* Fixed width only for desktop marquee cards */
    max-width: none;
}

.msg-avatar {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px;
    border-radius: 50% !important;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
    overflow: hidden;
}

.msg-content {
    flex: 1;
}

.msg-header {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}
.msg-header .username {
    color: #fff;
    font-weight: 600;
    font-size: 0.95rem;
}
.msg-header .timestamp {
    color: #64748b;
    font-size: 0.75rem;
}
.msg-text {
    color: #cbd5e1;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* =========================================================================
   5 SYSTEM PATHWAY
   ========================================================================= */
.system-features {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    position: relative;
}

.feature-row {
    display: flex;
    align-items: center;
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    gap: 2rem;
}
.feature-row.reverse {
    flex-direction: row-reverse;
}

.feature-content, .feature-text {
    flex: 1;
}

.feature-content h3, .feature-text h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #fff;
}
.feature-content p, .feature-text p {
    color: #94a3b8;
}

/* =========================================================================
   PRICING
   ========================================================================= */
.pricing-header-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-md);
    gap: 2rem;
    flex-wrap: wrap;
    position: relative;
}

.pricing-3d-visual {
    width: 200px;
    height: 200px;
    position: relative;
    z-index: 10;
}

#pricing-canvas {
    width: 100%;
    height: 100%;
    display: block;
    cursor: grab;
}

#pricing-canvas:active {
    cursor: grabbing;
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    align-items: stretch;
}

.tier-card {
    padding: 3rem 2rem;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.tier-card.popular {
    border-color: rgba(127, 176, 255, 0.5);
    transform: scale(1.02);
    background: linear-gradient(180deg, rgba(20, 24, 36, 0.86) 0%, rgba(77, 124, 255, 0.1) 58%, rgba(243, 198, 90, 0.08) 100%);
    box-shadow: 0 20px 40px -10px rgba(0,0,0,0.5);
}

.popular-badge {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    background: rgba(243, 198, 90, 0.16);
    color: var(--color-accent-gold);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.25rem 0.75rem;
    border-radius: 100px;
    text-transform: uppercase;
}

.tier-card h3 {
    font-size: 1.25rem;
    color: #fff;
    margin-bottom: 0.5rem;
}

.price {
    font-size: 2.5rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.price span {
    font-size: 1rem;
    color: #64748b;
    font-weight: 400;
}

.tier-desc {
    color: #94a3b8;
    font-size: 0.9rem;
    margin-bottom: 2rem;
    min-height: 40px;
}

.tier-features {
    list-style: none;
    margin-bottom: 2.5rem;
    flex: 1;
}

.tier-features li {
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    color: #cbd5e1;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tier-features li::before {
    content: '✓';
    color: var(--color-accent-gold);
    font-weight: bold;
}

.tier-card .btn {
    width: 100%;
}

/* =========================================================================
   FOOTER
   ========================================================================= */
.footer {
    border-top: 1px solid var(--color-border);
    padding: var(--space-md) var(--space-md) 2rem;
    background: #050505;
}

.footer-grid {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 2rem;
    margin-bottom: 3rem;
}

.footer-brand p {
    color: #64748b;
    margin-top: 1rem;
    font-size: 0.95rem;
}

.footer-logo {
    width: min(220px, 65%);
    height: auto;
    display: block;
    margin-top: 1rem;
    filter: drop-shadow(0 10px 24px rgba(14, 31, 73, 0.6));
}

.footer-links h4 {
    color: #fff;
    margin-bottom: 1.25rem;
}

.footer-links a {
    display: block;
    color: #64748b;
    text-decoration: none;
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: #fff;
}

.footer-disclaimer {
    max-width: 1200px;
    margin: 0 auto;
    padding-top: 2rem;
    border-top: 1px solid var(--color-border);
    color: #64748b;
    font-size: 0.8rem;
    line-height: 1.6;
}

.footer-disclaimer strong {
    color: #94a3b8;
}

/* =========================================================================
   RESPONSIVE & ANIMATIONS
   ========================================================================= */
@media (max-width: 900px) {
    .noise-overlay {
        display: none;
    }

    .glass-card::before,
    .glass-card::after {
        display: none;
    }

    .hover-lift:hover {
        transform: none;
        box-shadow: none;
        border-color: rgba(255, 255, 255, 0.05);
    }

    .hero {
        flex-direction: column;
        text-align: center;
        padding-top: 8rem;
    }
    .hero-content {
        max-width: 100%;
    }
    .hero-brand-logo {
        margin: 0 auto 1rem;
    }
    .hero-subtitle {
        margin: 0 auto 2.5rem;
    }
    .hero-cta {
        justify-content: center;
    }
    .hero-visual {
        justify-content: center;
        width: 100%;
    }

    .philosophy-grid,
    .pricing-grid {
        grid-template-columns: 1fr;
    }

    .proof-grid.marquee-wrapper {
        overflow: visible;
        padding: 0;
    }

    .marquee-content {
        width: 100%;
        flex-direction: column;
        transform: none !important;
        gap: 1rem;
    }

    .proof-grid.marquee-wrapper .discord-message {
        width: 100%;
        max-width: 100%;
    }

    .proof-grid.marquee-wrapper .discord-message:nth-child(n+4) {
        display: none !important;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    .noise-overlay {
        display: none;
    }

    .hover-lift,
    .btn,
    .glass-card::before,
    .glass-card::after {
        transition: none !important;
    }
}

@media (max-width: 600px) {
    :root {
        --space-md: 1rem;
        --space-lg: 3.5rem;
    }

    html {
        scroll-padding-top: 6.5rem;
    }

    section[id] {
        scroll-margin-top: 6.5rem;
    }

    .nav {
        width: calc(100% - 1rem);
        padding: 0.75rem 1rem;
        border-radius: 12px;
        top: 0.5rem;
    }

    .nav-logo-mark {
        width: 32px;
        height: 32px;
    }

    .nav-logo-text {
        font-size: 1rem;
    }

    .nav-actions .btn {
        padding: 0.5rem 0.9rem !important;
        font-size: 0.95rem !important;
    }

    .feature-row {
        flex-direction: column !important;
        align-items: flex-start;
        padding: 1.25rem;
    }
}

/* Typography split animations using SplitType */
.word, .char, .line {
    overflow: hidden;
    display: inline-block;
    vertical-align: top;
}

.char {
    padding-bottom: 0.1em;
    margin-bottom: -0.1em;
}
