/* ========================================
   MOONLIT APIs - Page Styles
   ======================================== */

:root {
    --color-bg-primary: #06080f;
    --color-bg-secondary: #0a0e1a;
    --color-bg-card: rgba(14, 20, 38, 0.7);
    --color-bg-card-hover: rgba(20, 28, 52, 0.85);
    --color-surface: rgba(255, 255, 255, 0.03);
    --color-border: rgba(100, 180, 255, 0.08);
    --color-border-hover: rgba(100, 180, 255, 0.2);
    --color-accent-1: #38bdf8;
    --color-accent-2: #06b6d4;
    --color-accent-3: #818cf8;
    --color-accent-glow: rgba(56, 189, 248, 0.15);
    --color-text-primary: #f0f4ff;
    --color-text-secondary: rgba(200, 215, 240, 0.7);
    --color-text-muted: rgba(160, 180, 210, 0.5);
    --gradient-primary: linear-gradient(135deg, #38bdf8 0%, #06b6d4 50%, #818cf8 100%);
    --gradient-card: linear-gradient(160deg, rgba(56, 189, 248, 0.05) 0%, rgba(6, 182, 212, 0.02) 100%);
    --font-display: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --container-max: 1200px;
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    font-family: var(--font-body);
    background: var(--color-bg-primary);
    color: var(--color-text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

ul {
    list-style: none;
}

/* Particles */
#particles-canvas {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

/* Container */
.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 24px;
}

/* --- Navbar (reuse from main site) --- */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 16px 0;
    transition: var(--transition-smooth);
    background: rgba(6, 8, 15, 0.85);
    backdrop-filter: blur(20px) saturate(1.6);
    border-bottom: 1px solid var(--color-border);
}

.nav-container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    display: flex;
    align-items: center;
    z-index: 1001;
}

.logo-img {
    height: 40px;
    width: auto;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-link {
    padding: 8px 18px;
    font-family: var(--font-display);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 18px;
    right: 18px;
    height: 2px;
    background: var(--gradient-primary);
    border-radius: 1px;
    transform: scaleX(0);
    transition: var(--transition-fast);
}

.nav-link:hover,
.nav-link.active {
    color: var(--color-text-primary);
}

.nav-link.active::after,
.nav-link:hover::after {
    transform: scaleX(1);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 1001;
}

.nav-toggle span {
    width: 24px;
    height: 2px;
    background: var(--color-text-primary);
    border-radius: 2px;
    transition: var(--transition-fast);
}

/* --- Hero Banner --- */
.hero-banner {
    position: relative;
    min-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: linear-gradient(160deg, #050810 0%, #0a1628 30%, #0c1a35 60%, #06080f 100%);
}

.banner-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
}

.banner-bg-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.35;
}

.banner-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(6, 8, 15, 0.5) 0%, rgba(6, 8, 15, 0.7) 50%, rgba(6, 8, 15, 0.95) 100%);
    z-index: 1;
}

.banner-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(56, 189, 248, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(56, 189, 248, 0.03) 1px, transparent 1px);
    background-size: 40px 40px;
    animation: gridMove 20s linear infinite;
}

@keyframes gridMove {
    0% {
        transform: translate(0, 0);
    }

    100% {
        transform: translate(40px, 40px);
    }
}

.banner-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    animation: glowFloat 8s ease-in-out infinite;
}

.glow-1 {
    width: 400px;
    height: 400px;
    background: rgba(56, 189, 248, 0.08);
    top: 10%;
    left: 20%;
    animation-delay: 0s;
}

.glow-2 {
    width: 300px;
    height: 300px;
    background: rgba(129, 140, 248, 0.06);
    top: 40%;
    right: 15%;
    animation-delay: 3s;
}

.glow-3 {
    width: 250px;
    height: 250px;
    background: rgba(6, 182, 212, 0.05);
    bottom: 15%;
    left: 40%;
    animation-delay: 5s;
}

@keyframes glowFloat {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
        opacity: 0.6;
    }

    33% {
        transform: translate(20px, -15px) scale(1.1);
        opacity: 1;
    }

    66% {
        transform: translate(-10px, 10px) scale(0.95);
        opacity: 0.7;
    }
}

.floating-code {
    position: absolute;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: rgba(56, 189, 248, 0.15);
    white-space: nowrap;
    animation: floatCode 15s linear infinite;
    pointer-events: none;
}

.code-1 {
    top: 20%;
    left: 5%;
    animation-duration: 18s;
}

.code-2 {
    top: 45%;
    right: 8%;
    animation-duration: 22s;
    animation-delay: 3s;
}

.code-3 {
    top: 70%;
    left: 12%;
    animation-duration: 20s;
    animation-delay: 6s;
}

.code-4 {
    top: 30%;
    right: 20%;
    animation-duration: 16s;
    animation-delay: 9s;
}

.code-5 {
    top: 55%;
    left: 30%;
    animation-duration: 24s;
    animation-delay: 2s;
}

@keyframes floatCode {
    0% {
        transform: translateY(0) translateX(0);
        opacity: 0;
    }

    10% {
        opacity: 0.2;
    }

    50% {
        opacity: 0.15;
    }

    90% {
        opacity: 0.2;
    }

    100% {
        transform: translateY(-40px) translateX(30px);
        opacity: 0;
    }
}

.banner-content {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 700px;
    padding: 100px 24px 60px;
    animation: fadeInUp 1s ease-out;
}

.banner-logo-wrap {
    margin-bottom: 24px;
}

.banner-logo {
    width: 160px;
    height: auto;
    margin: 0 auto;
    border-radius: var(--radius-lg);
    filter: drop-shadow(0 0 30px rgba(56, 189, 248, 0.2));
}

.banner-badge {
    display: inline-block;
    padding: 6px 16px;
    background: rgba(56, 189, 248, 0.1);
    border: 1px solid rgba(56, 189, 248, 0.2);
    border-radius: 50px;
    font-family: var(--font-display);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--color-accent-1);
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-bottom: 20px;
}

.banner-title {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 6vw, 4.2rem);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 16px;
    letter-spacing: -1px;
}

.gradient-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.banner-subtitle {
    font-size: 1.05rem;
    color: var(--color-text-secondary);
    max-width: 560px;
    margin: 0 auto 28px;
    line-height: 1.7;
}

.banner-status {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    background: rgba(56, 189, 248, 0.06);
    border: 1px solid rgba(56, 189, 248, 0.12);
    border-radius: 50px;
    font-family: var(--font-display);
    font-size: 0.85rem;
    color: var(--color-accent-1);
    font-weight: 500;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-accent-1);
    animation: statusPulse 2s ease-in-out infinite;
}

@keyframes statusPulse {

    0%,
    100% {
        box-shadow: 0 0 4px rgba(56, 189, 248, 0.4);
        opacity: 0.7;
    }

    50% {
        box-shadow: 0 0 12px rgba(56, 189, 248, 0.8);
        opacity: 1;
    }
}

.banner-wave {
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    z-index: 1;
}

.banner-wave svg {
    width: 100%;
    height: auto;
    display: block;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Sections --- */
.section {
    padding: 100px 0;
    position: relative;
    z-index: 1;
}

.section-header {
    text-align: center;
    margin-bottom: 56px;
}

.section-tag {
    display: inline-block;
    padding: 4px 14px;
    background: rgba(56, 189, 248, 0.08);
    border: 1px solid rgba(56, 189, 248, 0.15);
    border-radius: 50px;
    font-family: var(--font-display);
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--color-accent-1);
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 16px;
}

.section-title {
    font-family: var(--font-display);
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    font-weight: 800;
    margin-bottom: 12px;
    letter-spacing: -0.5px;
}

.section-desc {
    font-size: 1rem;
    color: var(--color-text-secondary);
    max-width: 520px;
    margin: 0 auto;
    line-height: 1.7;
}

/* --- API Overview Cards --- */
.api-overview-section {
    background: var(--color-bg-primary);
}

.api-cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.api-overview-card {
    padding: 32px 24px;
    background: var(--gradient-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    transition: var(--transition-smooth);
    opacity: 0;
    transform: translateY(20px);
}

.api-overview-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.api-overview-card:hover {
    border-color: var(--color-border-hover);
    transform: translateY(-6px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.aoc-icon {
    width: 56px;
    height: 56px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(56, 189, 248, 0.06);
    border: 1px solid rgba(56, 189, 248, 0.1);
    border-radius: var(--radius-md);
    color: var(--color-accent-1);
}

.api-overview-card h3 {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.api-overview-card p {
    font-size: 0.88rem;
    color: var(--color-text-secondary);
    line-height: 1.6;
    margin-bottom: 16px;
}

.code-preview {
    padding: 10px 14px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
}

.code-preview code {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--color-accent-1);
}

.api-status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 50px;
    font-family: var(--font-display);
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.api-status-badge.in-dev {
    background: rgba(56, 189, 248, 0.1);
    border: 1px solid rgba(56, 189, 248, 0.2);
    color: var(--color-accent-1);
}

.api-status-badge.planned {
    background: rgba(129, 140, 248, 0.1);
    border: 1px solid rgba(129, 140, 248, 0.2);
    color: var(--color-accent-3);
}

/* --- Integration Section --- */
.integration-section {
    background: var(--color-bg-secondary);
}

.integration-flow {
    display: flex;
    align-items: center;
    gap: 0;
    margin-bottom: 64px;
}

.flow-card {
    flex: 1;
    padding: 28px;
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    transition: var(--transition-smooth);
    opacity: 0;
    transform: translateY(20px);
}

.flow-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.flow-card:hover {
    border-color: var(--color-border-hover);
    transform: translateY(-4px);
}

.flow-number {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 12px;
}

.flow-card h3 {
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.flow-card p {
    font-size: 0.85rem;
    color: var(--color-text-secondary);
    line-height: 1.6;
}

.flow-connector {
    flex-shrink: 0;
    padding: 0 12px;
    color: var(--color-accent-1);
    opacity: 0.4;
}

/* Architecture Diagram */
.architecture-diagram {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    max-width: 400px;
    margin: 0 auto;
}

.arch-layer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 28px 40px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    width: 100%;
    text-align: center;
    transition: var(--transition-smooth);
}

.arch-layer:hover {
    border-color: var(--color-border-hover);
    transform: scale(1.02);
}

.games-layer {
    background: linear-gradient(160deg, rgba(245, 158, 11, 0.06) 0%, rgba(245, 158, 11, 0.02) 100%);
    border-color: rgba(245, 158, 11, 0.15);
}

.api-layer {
    background: linear-gradient(160deg, rgba(56, 189, 248, 0.08) 0%, rgba(129, 140, 248, 0.04) 100%);
    border-color: rgba(56, 189, 248, 0.2);
}

.dev-layer {
    background: linear-gradient(160deg, rgba(129, 140, 248, 0.06) 0%, rgba(129, 140, 248, 0.02) 100%);
    border-color: rgba(129, 140, 248, 0.15);
}

.arch-logo {
    width: 48px;
    height: 48px;
    object-fit: contain;
    border-radius: var(--radius-sm);
}

.dev-icon-wrap {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-accent-3);
}

.arch-layer span {
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 600;
}

.arch-layer small {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

.arch-arrow {
    color: var(--color-text-muted);
    padding: 4px 0;
}

/* --- Team Section --- */
.team-section {
    background: var(--color-bg-primary);
}

.team-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    max-width: 700px;
    margin: 0 auto;
}

.team-card {
    padding: 36px 24px;
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    text-align: center;
    transition: var(--transition-smooth);
    opacity: 0;
    transform: translateY(20px);
}

.team-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.team-card:hover {
    border-color: var(--color-border-hover);
    transform: translateY(-4px);
}

.team-avatar {
    margin-bottom: 16px;
}

.avatar-circle {
    width: 72px;
    height: 72px;
    margin: 0 auto;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 700;
    color: #fff;
}

.ep-badge {
    background: linear-gradient(135deg, #38bdf8, #06b6d4);
    box-shadow: 0 0 24px rgba(56, 189, 248, 0.3);
}

.br-badge {
    background: linear-gradient(135deg, #818cf8, #6366f1);
    box-shadow: 0 0 24px rgba(129, 140, 248, 0.3);
}

.team-card h4 {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.team-role {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--color-accent-1);
    display: block;
    margin-bottom: 12px;
}

.team-card p {
    font-size: 0.85rem;
    color: var(--color-text-secondary);
    line-height: 1.5;
}

/* --- CTA Section --- */
.cta-section {
    background: var(--color-bg-secondary);
    padding: 80px 0;
}

.cta-card {
    text-align: center;
    padding: 56px 40px;
    background: linear-gradient(160deg, rgba(56, 189, 248, 0.06) 0%, rgba(129, 140, 248, 0.04) 100%);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
}

.cta-card h2 {
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 12px;
}

.cta-card p {
    font-size: 1rem;
    color: var(--color-text-secondary);
    max-width: 480px;
    margin: 0 auto 28px;
    line-height: 1.7;
}

.cta-actions {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    transition: var(--transition-smooth);
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: var(--gradient-primary);
    color: #fff;
    box-shadow: 0 4px 24px rgba(56, 189, 248, 0.25);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(56, 189, 248, 0.35);
}

.btn-outline {
    background: transparent;
    color: var(--color-text-primary);
    border: 1px solid var(--color-border-hover);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--color-accent-1);
    transform: translateY(-2px);
}

/* --- Footer --- */
.footer {
    position: relative;
    z-index: 1;
    padding: 24px 0;
    background: var(--color-bg-primary);
    border-top: 1px solid var(--color-border);
}

.footer-inner {
    text-align: center;
}

.footer-inner p {
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

/* --- Responsive --- */
@media (max-width: 1024px) {
    .integration-flow {
        flex-direction: column;
    }

    .flow-connector {
        transform: rotate(90deg);
        padding: 8px 0;
    }
}

@media (max-width: 768px) {
    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background: rgba(6, 8, 15, 0.95);
        backdrop-filter: blur(20px);
        flex-direction: column;
        justify-content: center;
        gap: 4px;
        padding: 24px;
        transition: var(--transition-smooth);
        border-left: 1px solid var(--color-border);
    }

    .nav-links.open {
        right: 0;
    }

    .nav-toggle {
        display: flex;
    }

    .nav-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

    .nav-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .nav-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -5px);
    }

    .api-cards-grid {
        grid-template-columns: 1fr;
    }

    .team-grid {
        grid-template-columns: 1fr;
    }

    .hero-banner {
        min-height: 80vh;
    }
}