:root {
    --primary-grad: linear-gradient(135deg, #ec4899, #8b5cf6);
    --bg: #0a0a0a;
    --card-bg: rgba(17, 17, 17, 0.7);
    --card-border: rgba(255, 255, 255, 0.08);
    --text-main: #f1f5f9;
    --text-dim: #94a3b8;
    --accent: #ec4899;
    --nav-bg: rgba(10, 10, 10, 0.8);
    --shadow-glow: 0 0 20px rgba(139, 92, 246, 0.15);
}

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

html { scroll-behavior: smooth; }

body {
    background-color: var(--bg);
    color: var(--text-main);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Noise Texture */
.noise::before {
    content: "";
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: url('https://grainy-gradients.vercel.app/noise.svg');
    opacity: 0.03;
    pointer-events: none;
    z-index: 9999;
}

/* Background Orbs */
.orb {
    position: fixed;
    width: 60vw;
    height: 60vw;
    border-radius: 50%;
    filter: blur(120px);
    z-index: -1;
    opacity: 0.1;
    pointer-events: none;
    animation: orbFloat 25s ease-in-out infinite;
}

.orb-1 {
    top: -20%;
    left: -10%;
    background: #ec4899;
    animation-delay: 0s;
}

.orb-2 {
    bottom: -10%;
    right: -5%;
    background: #8b5cf6;
    animation-delay: -5s;
}

@keyframes orbFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(5%, 10%) scale(1.1); }
    66% { transform: translate(-5%, 5%) scale(0.95); }
}

.wrap {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 24px;
    position: relative;
    z-index: 1;
}

/* Navigation */
.nav {
    height: 72px;
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    background: var(--nav-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--card-border);
    z-index: 1000;
    transition: background 0.3s;
}

.navin {
    display: flex;
    justify-content: space-between;
    width: 100%;
    align-items: center;
}

.brand {
    text-decoration: none;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.brand b {
    background: var(--primary-grad);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.links {
    display: flex;
    gap: 12px;
    align-items: center;
}

.btn {
    padding: 10px 24px;
    border-radius: 12px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border: 1px solid var(--card-border);
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.03);
}

.btn.primary {
    background: var(--primary-grad);
    border: none;
    color: #fff;
    box-shadow: 0 4px 15px rgba(236, 72, 153, 0.2);
}

.btn:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn.primary:hover {
    box-shadow: 0 8px 25px rgba(236, 72, 153, 0.4);
    opacity: 0.9;
}

/* Mobile Toggle */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
}

/* Hero Section */
.hero {
    padding: 100px 0 60px;
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 60px;
    align-items: center;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(236, 72, 153, 0.08);
    color: #ec4899;
    padding: 6px 16px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    margin-bottom: 24px;
    border: 1px solid rgba(236, 72, 153, 0.15);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pulse {
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    position: relative;
}

.pulse::after {
    content: "";
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    background: inherit;
    opacity: 0.4;
    animation: pulseAnim 2s infinite;
}

@keyframes pulseAnim {
    0% { transform: scale(1); opacity: 0.4; }
    100% { transform: scale(2.5); opacity: 0; }
}

h1 {
    font-size: 4.5rem;
    line-height: 1.1;
    font-weight: 800;
    margin-bottom: 24px;
    letter-spacing: -2px;
}

.grad {
    background: var(--primary-grad);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.lead {
    font-size: 1.2rem;
    color: var(--text-dim);
    max-width: 560px;
    margin-bottom: 40px;
}

.stats {
    display: flex;
    gap: 40px;
    margin-top: 50px;
}

.stat {
    display: flex;
    flex-direction: column;
}

.stat b {
    font-size: 2.5rem;
    color: #fff;
    font-weight: 800;
    line-height: 1;
}

.stat span {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-dim);
    font-weight: 600;
    letter-spacing: 1px;
    margin-top: 8px;
}

/* Hero Card */
.heroCard {
    position: relative;
}

.code-window {
    width: 100%;
    background: rgba(17, 17, 17, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1.5rem;
    box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.6);
    overflow: hidden;
    animation: float 6s ease-in-out infinite;
}

.code-header {
    background: rgba(255, 255, 255, 0.05);
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.code-dots {
    display: flex;
    gap: 8px;
}

.dot { width: 12px; height: 12px; border-radius: 50%; }
.dot-red { background: #ff5f56; }
.dot-yellow { background: #ffbd2e; }
.dot-green { background: #27c93f; }

.code-filename {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: var(--text-dim);
    opacity: 0.7;
}

.code-body {
    padding: 24px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    line-height: 1.7;
    overflow-x: auto;
    white-space: pre; /* Fix line wrapping */
    tab-size: 4;
    color: #abb2bf; /* Default text color */
}

/* Syntax Highlighting */
.sh-cmt { color: #6a737d; font-style: italic; } /* Comment */
.sh-key { color: #c678dd; } /* Keyword */
.sh-str { color: #98c379; } /* String */
.sh-fun { color: #61afef; } /* Function/Method */
.sh-var { color: #e06c75; } /* Variable/Parameter */
.sh-obj { color: #d19a66; } /* Object Property */
.sh-num { color: #d19a66; } /* Number */

.copy-btn {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: #fff;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.2s;
}

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

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(1deg); }
}

/* Sections */
.section { padding: 100px 0; }

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 50px;
    flex-wrap: wrap;
    gap: 20px;
}

.topbar h2 {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -1px;
}

.search-container {
    position: relative;
    width: 400px;
    max-width: 100%;
}

.search {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border);
    padding: 16px 24px 16px 50px;
    border-radius: 16px;
    color: #fff;
    width: 100%;
    outline: none;
    transition: all 0.3s;
    font-size: 0.95rem;
}

.search:focus {
    border-color: #8b5cf6;
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 0 30px rgba(139, 92, 246, 0.1);
}

.search-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-dim);
}

/* Grid */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
}

.api-card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--card-border);
    padding: 32px;
    border-radius: 24px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.api-card::before {
    content: "";
    position: absolute;
    top: 0; left: 0; width: 100%; height: 4px;
    background: var(--primary-grad);
    opacity: 0;
    transition: opacity 0.3s;
}

.api-card:hover {
    transform: translateY(-10px) scale(1.02);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 30px 60px -15px rgba(0, 0, 0, 0.5);
}

.api-card:hover::before { opacity: 1; }

.api-card-top {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
}

.method-badge {
    font-size: 0.7rem;
    font-weight: 800;
    background: rgba(255,255,255,0.08);
    color: #fff;
    padding: 6px 14px;
    border-radius: 99px;
    text-transform: uppercase;
}

.cat-tag {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-dim);
    display: flex;
    align-items: center;
    gap: 6px;
}

.api-card h3 {
    font-size: 1.3rem;
    font-weight: 800;
    margin-bottom: 12px;
}

.endpoint-box {
    background: #000;
    padding: 12px 16px;
    border-radius: 12px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    color: #10b981;
    margin-bottom: 20px;
    border: 1px solid rgba(16, 185, 129, 0.1);
    position: relative;
    cursor: pointer;
    transition: all 0.2s;
}

.endpoint-box:hover { background: #050505; border-color: #10b981; }

.endpoint-box span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.api-card p {
    color: var(--text-dim);
    font-size: 0.95rem;
    margin-bottom: 24px;
    line-height: 1.6;
    height: 3.2rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.api-actions {
    display: flex;
    gap: 12px;
    margin-top: auto;
}

.btn-pill {
    flex: 1;
    padding: 10px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    transition: all 0.2s;
    border: 1px solid var(--card-border);
    color: #fff;
}

.btn-test {
    background: var(--primary-grad);
    border: none;
}

.btn-docs {
    background: rgba(255,255,255,0.05);
}

.btn-pill:hover { transform: translateY(-2px); opacity: 0.9; }

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(90deg, #111 25%, #1a1a1a 50%, #111 75%);
    background-size: 200% 100%;
    animation: skeletonLoading 1.5s infinite;
    border-radius: 24px;
    height: 380px;
}

@keyframes skeletonLoading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Footer */
.footer {
    padding: 100px 0 60px;
    text-align: center;
    border-top: 1px solid var(--card-border);
    color: var(--text-dim);
}

.footer-logo {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 20px;
    color: #fff;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin: 30px 0;
}

.footer-links a {
    color: var(--text-dim);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s;
}

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

/* Scroll Top */
.scroll-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--primary-grad);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    z-index: 999;
    box-shadow: 0 10px 30px rgba(236, 72, 153, 0.3);
}

.scroll-top.show { opacity: 1; visibility: visible; }

/* Responsive */
@media (max-width: 1024px) {
    h1 { font-size: 3.5rem; }
    .hero { gap: 40px; }
}

@media (max-width: 968px) {
    .hero { grid-template-columns: 1fr; text-align: center; padding-top: 60px; }
    .heroCard { display: none; }
    .lead { margin: 0 auto 40px; }
    .stats { justify-content: center; }
    .topbar { flex-direction: column; align-items: flex-start; }
    .search-container { width: 100%; }
}

@media (max-width: 768px) {
    .nav { height: 64px; }
    .links { display: none; }
    .menu-toggle { display: block; }
    h1 { font-size: 2.8rem; }
    .stats { gap: 20px; flex-wrap: wrap; }
    .stat b { font-size: 2rem; }
    .section { padding: 60px 0; }
    .grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    h1 { font-size: 2.2rem; }
    .btn { padding: 10px 18px; font-size: 0.8rem; }
}
