/* ==========================================================================
   Design System & Tokens
   ========================================================================== */
:root {
    --bg-dark: #07090e;
    --bg-card: rgba(18, 24, 38, 0.75);
    --border-card: rgba(255, 255, 255, 0.1);
    --border-highlight: rgba(139, 92, 246, 0.4);

    --primary: #7c3aed;
    --primary-light: #c084fc;
    --secondary: #22d3ee;
    --accent: #f43f5e;
    --gold: #fbbf24;

    --text-main: #ffffff;
    --text-muted: #e5e7eb;
    --text-dim: #9ca3af;

    --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-code: 'Fira Code', monospace;

    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-full: 9999px;

    --shadow-glow: 0 0 40px rgba(139, 92, 246, 0.25);
    --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.5);

    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
}

/* Canvas Background */
#canvas-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

/* Utility Containers */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.gradient-text {
    background: linear-gradient(135deg, #c084fc 0%, #22d3ee 50%, #f43f5e 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.glass-panel {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
}

/* Header Navbar */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(7, 9, 14, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-card);
    padding: 1rem 0;
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--text-main);
}

.nav-links {
    display: flex;
    gap: 1.5rem;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: var(--transition);
}

.nav-links a:hover {
    color: var(--primary-light);
}

.nav-highlight {
    color: var(--secondary) !important;
    font-weight: 600 !important;
}

/* Hero Section */
.hero-section {
    padding: 5rem 0 3rem;
    text-align: center;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 1rem;
    background: rgba(139, 92, 246, 0.15);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary-light);
    margin-bottom: 1.5rem;
}

.badge-accent {
    background: rgba(34, 211, 238, 0.15);
    border-color: rgba(34, 211, 238, 0.3);
    color: var(--secondary);
}

.badge-pulse {
    width: 8px;
    height: 8px;
    background: var(--primary-light);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--primary-light);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.95); opacity: 0.8; }
    50% { transform: scale(1.3); opacity: 1; }
    100% { transform: scale(0.95); opacity: 0.8; }
}

.hero-title {
    font-family: var(--font-heading);
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.02em;
    margin-bottom: 1.25rem;
}

.hero-subtitle {
    max-width: 700px;
    margin: 0 auto 3rem;
    font-size: 1.15rem;
    color: var(--text-muted);
    font-weight: 400;
}

/* Tier Switcher Component */
.tier-switcher {
    max-width: 800px;
    margin: 0 auto;
}

.tier-tabs {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.tier-tab {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-card);
    color: var(--text-muted);
    padding: 0.6rem 1.25rem;
    border-radius: var(--radius-full);
    font-family: var(--font-heading);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.tier-tab:hover {
    background: rgba(139, 92, 246, 0.2);
    color: var(--text-main);
}

.tier-tab.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary-light);
    box-shadow: var(--shadow-glow);
}

.tier-card {
    padding: 2.5rem;
    text-align: left;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.tier-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--secondary), var(--accent));
}

.tier-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.tier-badge {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.tier-count {
    font-size: 0.85rem;
    color: var(--text-dim);
    background: rgba(255, 255, 255, 0.05);
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-sm);
}

.tier-body {
    margin-bottom: 2rem;
}

.message-display {
    font-family: var(--font-heading);
    font-size: clamp(1.3rem, 3vw, 1.8rem);
    font-weight: 600;
    line-height: 1.4;
    color: var(--text-main);
    border-left: 3px solid var(--primary-light);
    padding-left: 1.25rem;
}

.tier-footer {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-sm);
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    border: none;
    transition: var(--transition);
}

.btn-sm {
    padding: 0.4rem 0.9rem;
    font-size: 0.85rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), #6d28d9);
    color: #fff;
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(124, 58, 237, 0.6);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-main);
    border: 1px solid var(--border-card);
}

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

/* Sections */
.section {
    padding: 4rem 0;
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-title {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.section-subtitle {
    color: var(--text-muted);
    font-size: 1.05rem;
    max-width: 650px;
    margin: 0 auto;
}

/* Tournament Division Filters */
.division-filters {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.filter-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-card);
    color: var(--text-muted);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.filter-btn.active, .filter-btn:hover {
    background: rgba(139, 92, 246, 0.2);
    color: #fff;
    border-color: var(--primary-light);
}

/* Perspectives Grid */
.perspectives-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.25rem;
}

.perspective-card {
    padding: 1.25rem;
    transition: var(--transition);
}

.perspective-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-highlight);
    box-shadow: var(--shadow-glow);
}

.perspective-num {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--secondary);
    text-transform: uppercase;
    margin-bottom: 0.25rem;
}

.perspective-title {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

.perspective-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.4;
}

/* AI & Agent Integration Portal */
.ai-section {
    background: rgba(11, 16, 26, 0.6);
    border-top: 1px solid var(--border-card);
    border-bottom: 1px solid var(--border-card);
}

.ai-card {
    max-width: 850px;
    margin: 0 auto 3rem;
    overflow: hidden;
}

.snippet-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: rgba(0, 0, 0, 0.4);
    border-bottom: 1px solid var(--border-card);
    flex-wrap: wrap;
    gap: 0.75rem;
}

.snippet-tabs {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.snippet-tab {
    background: transparent;
    border: none;
    color: var(--text-dim);
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius-sm);
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.snippet-tab:hover {
    color: var(--text-main);
}

.snippet-tab.active {
    background: rgba(34, 211, 238, 0.15);
    color: var(--secondary);
}

.snippet-body {
    padding: 1.5rem;
    background: rgba(4, 7, 12, 0.9);
    overflow-x: auto;
}

.code-block {
    font-family: var(--font-code);
    font-size: 0.88rem;
    color: #38bdf8;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}

.snippet-footer {
    padding: 1.25rem 1.5rem;
    background: rgba(0, 0, 0, 0.3);
    border-top: 1px solid var(--border-card);
}

.ai-benefit {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.benefit-icon {
    font-size: 1.2rem;
}

/* Machine Endpoints Grid */
.endpoints-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
    max-width: 900px;
    margin: 0 auto;
}

.endpoint-card {
    display: flex;
    gap: 1rem;
    padding: 1.5rem;
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

.endpoint-card:hover {
    transform: translateY(-4px);
    border-color: var(--secondary);
    box-shadow: 0 0 25px rgba(34, 211, 238, 0.2);
}

.endpoint-icon {
    font-size: 1.8rem;
}

.endpoint-info h3 {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.25rem;
}

.endpoint-info p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.endpoint-url {
    font-family: var(--font-code);
    font-size: 0.75rem;
    color: var(--secondary);
    background: rgba(34, 211, 238, 0.1);
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-sm);
}

/* Essay Section */
.essay-card {
    padding: 3rem;
}

.essay-header {
    border-bottom: 1px solid var(--border-card);
    padding-bottom: 1.5rem;
    margin-bottom: 2rem;
}

.essay-header h2 {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-main);
}

.essay-meta {
    font-size: 0.9rem;
    color: var(--secondary);
    font-weight: 600;
}

.essay-content p {
    font-size: 1.05rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

.essay-content .lead-para {
    font-size: 1.2rem;
    color: var(--text-main);
    font-weight: 400;
}

.essay-content h3 {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary-light);
    margin: 2rem 0 1rem;
}

.essay-content strong {
    color: var(--text-main);
}

/* Footer */
.footer {
    border-top: 1px solid var(--border-card);
    padding: 2.5rem 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.footer-link {
    color: var(--primary-light);
    text-decoration: underline;
}

.footer-sub {
    font-size: 0.8rem;
    color: var(--text-dim);
    margin-top: 0.4rem;
}

/* Responsive Breakpoints */
@media (max-width: 768px) {
    .hero-section {
        padding: 3rem 0 2rem;
    }
    .tier-card {
        padding: 1.5rem;
    }
    .essay-card {
        padding: 1.5rem;
    }
    .nav-links {
        display: none;
    }
}
