/* ppuzzl.dev -- developer documentation
   Palette:
     #ffffff  Doc White (primary background)
     #0f172a  Code Dark (code blocks, hero)
     #1a1a1a  Text Black (primary text)
     #3b82f6  API Blue (links, POST badge)
     #22c55e  GET Green (GET badge, prompt)
     #f5f5f5  Sidebar Light
     #e2e8f0  Border Light
     #64748b  Meta Slate (secondary text)
   Typography:
     Inter (display + body), JetBrains Mono (code)
*/

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

html { scroll-behavior: smooth; }

body {
    font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
    font-size: 16px;
    line-height: 1.7;
    color: #1a1a1a;
    background: #ffffff;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

code, pre, .mono {
    font-family: "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;
}

a { color: #3b82f6; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Sidebar ---------- */

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 240px;
    height: 100vh;
    background: #f5f5f5;
    border-right: 1px solid #e2e8f0;
    padding: 24px 20px;
    overflow-y: auto;
    z-index: 10;
}

.sidebar-brand {
    display: flex;
    align-items: baseline;
    gap: 8px;
    font-family: "JetBrains Mono", monospace;
    font-size: 0.95rem;
    font-weight: 600;
    color: #1a1a1a;
}

.brand-prompt { color: #22c55e; }
.brand-name { color: #0f172a; }

.sidebar-version {
    margin-top: 4px;
    font-family: "JetBrains Mono", monospace;
    font-size: 0.7rem;
    color: #64748b;
    letter-spacing: 0.05em;
}

.sidebar-nav {
    margin-top: 28px;
}

.nav-section {
    margin-bottom: 22px;
}

.nav-section-title {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
    margin-bottom: 8px;
    padding-left: 10px;
}

.nav-list {
    list-style: none;
}

.nav-item {
    margin: 0;
}

.nav-link {
    display: block;
    padding: 6px 10px;
    font-size: 0.875rem;
    color: #1a1a1a;
    border-left: 2px solid transparent;
    transition: color 120ms ease, border-color 120ms ease, background 120ms ease;
}

.nav-link:hover {
    color: #3b82f6;
    text-decoration: none;
    background: rgba(59, 130, 246, 0.06);
}

.nav-link.active {
    color: #3b82f6;
    font-weight: 500;
    border-left-color: #3b82f6;
    background: rgba(59, 130, 246, 0.06);
}

.nav-link-sub {
    padding-left: 24px;
    font-size: 0.825rem;
    color: #64748b;
}

.nav-link-sub:hover { color: #3b82f6; }

.sidebar-footer {
    margin-top: 28px;
    padding-top: 16px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    color: #64748b;
    font-family: "JetBrains Mono", monospace;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18);
    animation: pulse 2.4s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18); }
    50% { box-shadow: 0 0 0 6px rgba(34, 197, 94, 0.05); }
}

/* ---------- Main column ---------- */

.main {
    margin-left: 264px;
    max-width: 880px;
    padding: 40px 40px 80px 24px;
}

/* ---------- Hero ---------- */

.hero {
    margin-bottom: 56px;
}

.hero-window {
    background: #0f172a;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 20px 40px -20px rgba(15, 23, 42, 0.35),
                0 1px 0 rgba(255, 255, 255, 0.04) inset;
}

.hero-titlebar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: #1a1a1a;
    border-bottom: 1px solid rgba(226, 232, 240, 0.06);
    font-family: "JetBrains Mono", monospace;
    font-size: 0.75rem;
    color: #64748b;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.dot-red    { background: #ff5f56; }
.dot-yellow { background: #ffbd2e; }
.dot-green  { background: #27c93f; }

.hero-titlebar-title {
    margin-left: 14px;
}

.hero-body {
    padding: 28px 28px 32px;
    color: #e2e8f0;
}

.hero-title {
    font-family: "JetBrains Mono", monospace;
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 18px;
    letter-spacing: -0.01em;
}

.hero-line {
    font-family: "JetBrains Mono", monospace;
    font-size: 0.95rem;
    line-height: 1.6;
    color: #e2e8f0;
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 10px;
}

.hero-prompt {
    color: #22c55e;
    font-weight: 600;
}

.hero-cmd {
    color: #ffffff;
}

.hero-cursor {
    display: inline-block;
    color: #22c55e;
    transform: translateY(2px);
    animation: blink 1s step-end infinite;
    font-size: 1rem;
}

@keyframes blink {
    50% { opacity: 0; }
}

.hero-output {
    margin-top: 14px;
    font-family: "JetBrains Mono", monospace;
    font-size: 0.85rem;
    line-height: 1.7;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transition: opacity 320ms ease;
}

.hero-output.visible { opacity: 1; }

.out-line { display: block; }
.out-meta { color: #64748b; }
.out-success { color: #22c55e; }

.hero-tagline {
    margin-top: 24px;
    font-size: 1.05rem;
    color: #1a1a1a;
    max-width: 620px;
    line-height: 1.65;
}

/* ---------- Doc sections ---------- */

.doc-section {
    margin-bottom: 56px;
    scroll-margin-top: 24px;
}

.section-eyebrow {
    font-family: "JetBrains Mono", monospace;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #64748b;
    margin-bottom: 8px;
}

.section-title {
    font-family: "Inter", sans-serif;
    font-size: 1.75rem;
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 14px;
    letter-spacing: -0.01em;
}

.section-lede {
    font-size: 1.05rem;
    color: #1a1a1a;
    margin-bottom: 14px;
}

.section-body {
    font-size: 1rem;
    color: #1a1a1a;
    margin-bottom: 18px;
    max-width: 720px;
}

.section-body code,
.section-lede code,
.changelog code {
    background: #f5f5f5;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    padding: 1px 6px;
    font-size: 0.85em;
    color: #0f172a;
}

/* ---------- Code blocks ---------- */

.code-block {
    background: #0f172a;
    color: #e2e8f0;
    border-radius: 8px;
    margin: 18px 0 22px;
    overflow: hidden;
    position: relative;
}

.code-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px;
    border-bottom: 1px solid rgba(226, 232, 240, 0.06);
    font-family: "JetBrains Mono", monospace;
    font-size: 0.72rem;
    color: #64748b;
    text-transform: lowercase;
    letter-spacing: 0.04em;
}

.copy-btn {
    background: transparent;
    border: 1px solid rgba(226, 232, 240, 0.18);
    color: #e2e8f0;
    font-family: "JetBrains Mono", monospace;
    font-size: 0.7rem;
    padding: 2px 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
}

.copy-btn:hover {
    background: rgba(59, 130, 246, 0.18);
    border-color: #3b82f6;
    color: #ffffff;
}

.copy-btn.copied {
    background: rgba(34, 197, 94, 0.2);
    border-color: #22c55e;
    color: #22c55e;
}

.code-body {
    padding: 16px 18px;
    font-family: "JetBrains Mono", monospace;
    font-size: 0.85rem;
    line-height: 1.6;
    overflow-x: auto;
    white-space: pre;
    color: #e2e8f0;
}

.code-body code { color: inherit; background: none; border: none; padding: 0; }

/* Syntax tokens */
.tk-comment { color: #64748b; font-style: italic; }
.tk-keyword { color: #c084fc; }
.tk-string  { color: #86efac; }
.tk-number  { color: #fb923c; }
.tk-fn      { color: #60a5fa; }
.tk-prop    { color: #f472b6; }
.tk-prompt  { color: #22c55e; }
.tk-output  { color: #94a3b8; }

/* ---------- Tables ---------- */

.meta-table,
.param-table,
.endpoint-table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    margin: 18px 0 22px;
    font-size: 0.9rem;
}

.meta-table td,
.param-table td,
.param-table th,
.endpoint-table td,
.endpoint-table th {
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
    vertical-align: middle;
}

.param-table th,
.endpoint-table th {
    background: #f5f5f5;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #64748b;
}

.meta-table tr:last-child td,
.param-table tr:last-child td,
.endpoint-table tr:last-child td {
    border-bottom: none;
}

.meta-key {
    width: 160px;
    font-family: "JetBrains Mono", monospace;
    font-size: 0.8rem;
    color: #64748b;
}

.meta-val code,
.param-table code,
.endpoint-table code {
    background: #f5f5f5;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    padding: 1px 6px;
    font-size: 0.85em;
    color: #0f172a;
}

.inline-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    margin-right: 8px;
    vertical-align: middle;
}

/* ---------- Method badges ---------- */

.badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 4px;
    font-family: "JetBrains Mono", monospace;
    font-size: 0.7rem;
    font-weight: 600;
    color: #ffffff;
    letter-spacing: 0.04em;
    min-width: 56px;
    text-align: center;
}

.badge-get  { background: #22c55e; }
.badge-post { background: #3b82f6; }
.badge-put  { background: #f59e0b; }
.badge-del  { background: #ef4444; }

/* ---------- Callout ---------- */

.callout {
    display: flex;
    gap: 14px;
    padding: 14px 16px;
    background: rgba(59, 130, 246, 0.06);
    border: 1px solid rgba(59, 130, 246, 0.25);
    border-left: 3px solid #3b82f6;
    border-radius: 6px;
    margin: 18px 0 22px;
    max-width: 720px;
}

.callout-tag {
    font-family: "JetBrains Mono", monospace;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #3b82f6;
    font-weight: 600;
    padding-top: 2px;
    flex: 0 0 auto;
}

.callout-body {
    font-size: 0.95rem;
    color: #1a1a1a;
    line-height: 1.6;
}

/* ---------- Changelog ---------- */

.changelog {
    list-style: none;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
}

.changelog-item {
    display: grid;
    grid-template-columns: 90px 110px 1fr;
    gap: 16px;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #e2e8f0;
    font-size: 0.92rem;
}

.changelog-item:last-child { border-bottom: none; }

.changelog-version {
    font-family: "JetBrains Mono", monospace;
    font-weight: 600;
    color: #3b82f6;
    font-size: 0.85rem;
}

.changelog-date {
    font-family: "JetBrains Mono", monospace;
    color: #64748b;
    font-size: 0.8rem;
}

.changelog-text { color: #1a1a1a; }

/* ---------- Footer ---------- */

.docs-footer {
    margin-top: 64px;
    padding-top: 24px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    font-family: "JetBrains Mono", monospace;
    font-size: 0.78rem;
    color: #64748b;
}

.footer-left { display: flex; align-items: center; gap: 8px; }
.footer-prompt { color: #22c55e; font-weight: 600; }
.footer-text { color: #64748b; }
.footer-version { color: #1a1a1a; }

.footer-right {
    display: flex;
    gap: 18px;
}

.footer-link {
    color: #64748b;
    text-transform: lowercase;
}

.footer-link:hover { color: #3b82f6; text-decoration: none; }

/* ---------- Scroll-to-top button ---------- */

.scroll-top {
    position: fixed;
    right: 24px;
    bottom: 24px;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: #0f172a;
    color: #e2e8f0;
    border: 1px solid rgba(226, 232, 240, 0.12);
    font-family: "JetBrains Mono", monospace;
    font-size: 0.9rem;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: opacity 200ms ease, transform 200ms ease;
    z-index: 20;
}

.scroll-top.visible {
    opacity: 1;
    pointer-events: auto;
}

.scroll-top:hover {
    background: #3b82f6;
    transform: translateY(-2px);
}

/* ---------- Responsive ---------- */

@media (max-width: 960px) {
    .sidebar {
        position: static;
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid #e2e8f0;
        padding: 18px 20px;
    }
    .main {
        margin-left: 0;
        padding: 32px 20px 64px;
        max-width: 100%;
    }
    .changelog-item {
        grid-template-columns: 80px 100px 1fr;
        font-size: 0.86rem;
    }
}

@media (max-width: 640px) {
    .changelog-item {
        grid-template-columns: 1fr;
        gap: 4px;
    }
    .docs-footer { flex-direction: column; align-items: flex-start; }
}
