:root {
    --bg-color: #2b2d31;        /* Neutral medium slate gray background */
    --card-bg: #313338;         /* Slightly lighter gray for cards */
    --accent-color: #5865f2;    /* Vibrant accent */
    --accent-hover: #4752c4;
    --text-main: #f2f3f5;       /* High-contrast readable text */
    --text-muted: #949ba4;      /* Muted gray text */
    --border-color: #3f4147;    /* Subtle matching border */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
}

/* Container */
.container {
    max-width: 1150px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(43, 45, 49, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    height: 70px;
    display: flex;
    align-items: center;
    transition: background 0.3s ease, border-color 0.3s ease;
}

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

/* Navbar Logo Branding */
.logo-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
}

.nav-icon {
    width: 32px;
    height: 32px;
    object-fit: contain;
    image-rendering: pixelated;
}

.nav-logo-img {
    height: 26px;
    width: auto;
    object-fit: contain;
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-links a {
    position: relative;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    padding: 0.2rem 0;
    transition: color 0.3s ease;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--accent-color);
    transition: width 0.3s ease, left 0.3s ease;
    border-radius: 2px;
}

.nav-links a:hover, 
.nav-links a.active {
    color: var(--text-main);
}

.nav-links a:hover::after, 
.nav-links a.active::after {
    width: 100%;
    left: 0;
}

.hamburger {
    display: none;
    cursor: pointer;
    font-size: 1.5rem;
    color: var(--text-main);
}

/* Hero Section */
.hero {
    position: relative;
    padding: 10rem 0 6rem;
    text-align: center;
    overflow: hidden;
}

.hero-glow {
    position: absolute;
    top: 20%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 400px;
    height: 400px;
    background: var(--accent-color);
    filter: blur(140px);
    opacity: 0.15;
    z-index: -1;
}

.badge {
    background: rgba(88, 101, 242, 0.15);
    color: var(--accent-color);
    padding: 0.4rem 1rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid rgba(88, 101, 242, 0.3);
}

/* Custom Hero Graphic Banner */
.hero-logo-container {
    margin: 1.5rem auto 1rem;
}

.hero-logo {
    max-width: 100%;
    width: 550px;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.3));
}

.hero p {
    color: var(--text-muted);
    font-size: 1.15rem;
    max-width: 600px;
    margin: 0 auto 2.5rem;
}

.hero-btns {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s, transform 0.1s;
}

.btn-primary {
    background-color: var(--accent-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--accent-hover);
}

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

.btn-secondary:hover {
    background-color: #383a40;
}

/* Features Section */
.features {
    padding: 5rem 0;
    text-align: center;
}

.features h2 {
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
}

.section-subtitle {
    color: var(--text-muted);
    margin-bottom: 3rem;
}

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

.feature-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, border-color 0.2s;
}

.feature-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent-color);
}

.icon-box {
    font-size: 1.5rem;
    color: var(--accent-color);
    margin-bottom: 1.2rem;
}

.feature-card h3 {
    margin-bottom: 0.75rem;
    font-size: 1.25rem;
}

.feature-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Footer */
footer {
    border-top: 1px solid var(--border-color);
    padding: 2rem 0;
    margin-top: 4rem;
    color: var(--text-muted);
    background-color: #232428;
}

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

.social-links {
    display: flex;
    gap: 1.5rem;
    font-size: 1.2rem;
}

.social-links a {
    color: var(--text-muted);
    transition: color 0.2s;
}

.social-links a:hover {
    color: var(--text-main);
}

/* RankForge documentation layout additions. */
.docs-shell {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 2.5rem;
    max-width: 1150px;
    margin: 70px auto 0;
    padding: 2.5rem 2rem 4rem;
}

.docs-sidebar {
    position: sticky;
    top: 94px;
    align-self: start;
    max-height: calc(100vh - 116px);
    overflow-y: auto;
    padding: 1.25rem;
    background: rgba(49, 51, 56, 0.72);
    border: 1px solid var(--border-color);
    border-radius: 12px;
}

.docs-sidebar h2 {
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin: 1.25rem 0 0.6rem;
}

.docs-sidebar h2:first-child {
    margin-top: 0;
}

.docs-sidebar ul {
    list-style: none;
    display: grid;
    gap: 0.25rem;
}

.docs-sidebar a {
    display: block;
    color: var(--text-muted);
    font-size: 0.9rem;
    padding: 0.4rem 0.55rem;
    border-radius: 6px;
    text-decoration: none;
    transition: color 0.2s, background 0.2s;
}

.docs-sidebar a:hover,
.docs-sidebar a.active {
    color: var(--text-main);
    background: rgba(88, 101, 242, 0.14);
}

.docs-main {
    min-width: 0;
}

.docs-hero {
    padding: 1rem 0 2.5rem;
}

.docs-hero h1 {
    font-size: clamp(2.2rem, 5vw, 3.2rem);
    line-height: 1.15;
    margin: 1.25rem 0 0.8rem;
}

.docs-hero p {
    max-width: 720px;
    color: var(--text-muted);
    font-size: 1.1rem;
}

.docs-search {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    max-width: 520px;
    margin-top: 1.5rem;
    padding: 0.75rem 1rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-muted);
}

.docs-search input {
    width: 100%;
    border: 0;
    outline: 0;
    color: var(--text-main);
    background: transparent;
    font: inherit;
}

.docs-search:focus-within {
    border-color: var(--accent-color);
}

.docs-section {
    scroll-margin-top: 92px;
    margin-top: 3.5rem;
}

.docs-section:first-of-type {
    margin-top: 0;
}

.docs-section h2 {
    font-size: 1.8rem;
    margin-bottom: 0.75rem;
}

.docs-section h3 {
    font-size: 1.15rem;
    margin: 2rem 0 0.6rem;
}

.docs-section p,
.docs-section li {
    color: var(--text-muted);
}

.docs-section p {
    max-width: 780px;
    margin-bottom: 1rem;
}

.docs-section ul,
.docs-section ol {
    padding-left: 1.25rem;
    margin: 0.6rem 0 1.4rem;
}

.docs-section li + li {
    margin-top: 0.45rem;
}

.docs-section strong {
    color: var(--text-main);
}

.docs-section a:not(.btn) {
    color: var(--accent-color);
}

.docs-prose {
    min-width: 0;
}

.docs-prose h1,
.docs-prose h2,
.docs-prose h3,
.docs-prose h4,
.docs-prose h5,
.docs-prose h6 {
    scroll-margin-top: 92px;
}

.docs-prose h1 {
    font-size: 2.25rem;
    margin: 2rem 0 0.75rem;
}

.docs-prose h2 {
    font-size: 1.8rem;
    margin: 2.25rem 0 0.75rem;
}

.docs-prose h3 {
    font-size: 1.2rem;
    margin: 1.75rem 0 0.6rem;
}

.docs-prose h4,
.docs-prose h5,
.docs-prose h6 {
    font-size: 1rem;
    margin: 1.25rem 0 0.5rem;
}

.docs-prose p,
.docs-prose li {
    color: var(--text-muted);
}

.docs-prose p {
    margin-bottom: 1rem;
}

.docs-prose ul,
.docs-prose ol {
    padding-left: 1.4rem;
    margin: 0.6rem 0 1.3rem;
}

.docs-prose li + li {
    margin-top: 0.4rem;
}

.docs-prose a {
    color: var(--accent-color);
}

.docs-prose hr {
    border: 0;
    border-top: 1px solid var(--border-color);
    margin: 2rem 0;
}

.docs-prose blockquote {
    margin: 1rem 0;
    padding-left: 1rem;
    border-left: 3px solid var(--accent-color);
    color: var(--text-muted);
}

.docs-prose img.docs-badge {
    max-width: 100%;
    vertical-align: middle;
}

.docs-details {
    margin: 1rem 0 1.5rem;
    padding: 0.9rem 1rem;
    background: rgba(49, 51, 56, 0.55);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.docs-details summary {
    color: var(--text-main);
    cursor: pointer;
}

.docs-details[open] summary {
    margin-bottom: 1rem;
}

.docs-section code,
.docs-callout code {
    color: #c9cdfd;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.9em;
}

.docs-code {
    overflow-x: auto;
    margin: 1rem 0 1.5rem;
    padding: 1.2rem;
    color: var(--text-main);
    background: #232428;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font: 0.86rem/1.65 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.docs-callout {
    margin: 1.2rem 0;
    padding: 1rem 1.15rem;
    background: rgba(88, 101, 242, 0.1);
    border-left: 3px solid var(--accent-color);
    border-radius: 0 8px 8px 0;
}

.docs-callout p {
    margin: 0;
}

.docs-callout.warning {
    background: rgba(237, 169, 50, 0.09);
    border-left-color: #e5a83b;
}

.docs-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin-top: 1.25rem;
}

.docs-card {
    padding: 1.25rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
}

.docs-card h3 {
    margin: 0 0 0.45rem;
    font-size: 1.05rem;
}

.docs-card p {
    margin: 0;
    font-size: 0.93rem;
}

.docs-table-wrap {
    overflow-x: auto;
    margin: 1rem 0 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.docs-table {
    width: 100%;
    min-width: 560px;
    border-collapse: collapse;
    background: var(--card-bg);
    text-align: left;
}

.docs-table th,
.docs-table td {
    padding: 0.8rem 0.9rem;
    border-bottom: 1px solid var(--border-color);
    vertical-align: top;
}

.docs-table th {
    color: var(--text-main);
    font-size: 0.84rem;
    letter-spacing: 0.02em;
}

.docs-table td {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.docs-table tr:last-child td {
    border-bottom: 0;
}

.docs-filtered {
    display: none;
}

.docs-footer {
    margin-top: 1rem;
}

/* Responsive Design & Media Queries */
@media (max-width: 900px) {
    .docs-shell {
        grid-template-columns: 1fr;
    }

    .docs-sidebar {
        position: static;
        max-height: none;
    }

    .docs-sidebar ul {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 70px;
        left: 0;
        width: 100%;
        background-color: var(--card-bg);
        padding: 1.5rem 2rem;
        border-bottom: 1px solid var(--border-color);
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
        gap: 1.2rem;
    }

    .nav-links.active {
        display: flex;
    }

    .hamburger {
        display: block;
    }

    .hero {
        padding: 8rem 0 4rem;
    }

    .hero-logo {
        width: 100%;
        max-width: 320px;
    }

    .hero-btns {
        flex-direction: column;
        width: 100%;
        padding: 0 1rem;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    .footer-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}

@media (max-width: 600px) {
    .docs-shell {
        padding: 1.5rem 1rem 3rem;
    }

    .docs-sidebar ul,
    .docs-grid {
        grid-template-columns: 1fr;
    }

    .docs-hero h1 {
        font-size: 2.2rem;
    }
}
