:root {
    color-scheme: dark;
}

::selection {
    color: white;
    background: rgba(232, 196, 104, 0.5);
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: #08090c;
    background-image:
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(232, 196, 104, 0.08), transparent),
        radial-gradient(ellipse 60% 40% at 80% 100%, rgba(61, 220, 151, 0.03), transparent);
    background-attachment: fixed;
}

.grain::after {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: 0.025;
    z-index: 9999;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.gradient-text {
    background: linear-gradient(180deg, #ffffff 0%, #b8bfd0 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.gold-text {
    background: linear-gradient(135deg, #f5d98a 0%, #e8c468 50%, #c9a03d 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.card-glow {
    position: relative;
    transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1),
        border-color 0.4s ease,
        box-shadow 0.4s ease;
    will-change: transform;
}

.card-glow:hover {
    transform: translateY(-4px);
    border-color: rgba(232, 196, 104, 0.3);
    box-shadow:
        0 28px 56px -16px rgba(0, 0, 0, 0.9),
        0 0 0 1px rgba(232, 196, 104, 0.1),
        inset 0 1px 0 0 rgba(255, 255, 255, 0.04);
}

.card-glow::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.06) 0%, transparent 40%, transparent 60%, rgba(232, 196, 104, 0.06) 100%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

.recommended-bar {
    background: linear-gradient(90deg, transparent, #e8c468, transparent);
}

.btn-gold {
    background: linear-gradient(180deg, #f5d98a 0%, #e8c468 100%);
    color: #08090c;
    box-shadow: 0 1px 0 0 rgba(255, 255, 255, 0.4) inset, 0 4px 16px -4px rgba(232, 196, 104, 0.4);
    transition: all 0.2s ease;
}

.btn-gold:hover {
    background: linear-gradient(180deg, #fae29c 0%, #f0d078 100%);
    box-shadow: 0 1px 0 0 rgba(255, 255, 255, 0.5) inset, 0 6px 20px -4px rgba(232, 196, 104, 0.55);
    transform: translateY(-2px);
}

.btn-gold:active {
    transform: translateY(0);
    box-shadow: 0 1px 0 0 rgba(255, 255, 255, 0.3) inset, 0 2px 8px -2px rgba(232, 196, 104, 0.4);
}

.btn-ghost {
    transition: all 0.2s ease;
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.btn-ghost:active {
    transform: translateY(0);
}

.copy-btn {
    transition: all 0.2s ease;
}

.copy-btn:hover {
    background: rgba(232, 196, 104, 0.08);
    border-color: rgba(232, 196, 104, 0.3);
    color: #e8c468;
}

.copy-btn.copied {
    background: rgba(61, 220, 151, 0.1);
    border-color: rgba(61, 220, 151, 0.4);
    color: #3ddc97;
}

@keyframes fade-up {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.fade-up {
    animation: fade-up 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.delay-1 {
    animation-delay: 0.1s;
}

.delay-2 {
    animation-delay: 0.2s;
}

.delay-3 {
    animation-delay: 0.3s;
}

.delay-4 {
    animation-delay: 0.4s;
}

.method-pill {
    background: rgba(61, 220, 151, 0.08);
    border: 1px solid rgba(61, 220, 151, 0.2);
    color: #3ddc97;
}

.divider-line {
    background: linear-gradient(90deg, transparent, #232834 20%, #232834 80%, transparent);
}

/* ---------------------------------------------------------------------------
   Docs page
--------------------------------------------------------------------------- */

.doc-h2 {
    font-size: 1.5rem;
    line-height: 1.3;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: #fff;
    padding-bottom: 0.75rem;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid #232834;
}

.doc-h3 {
    font-size: 1.05rem;
    font-weight: 600;
    color: #fff;
    margin-top: 2rem;
    margin-bottom: 0.85rem;
}

.doc-p {
    color: #8b93a7;
    line-height: 1.75;
}

.doc-link {
    color: #f5d98a;
    text-decoration: none;
    border-bottom: 1px solid rgba(232, 196, 104, 0.3);
    transition: border-color 0.2s ease, color 0.2s ease;
}

.doc-link:hover {
    color: #e8c468;
    border-bottom-color: rgba(232, 196, 104, 0.8);
}

.code-inline {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.82em;
    padding: 0.15em 0.42em;
    border-radius: 0.35rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid #232834;
    color: #f5d98a;
    white-space: nowrap;
}

.type {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    padding: 0.2em 0.5em;
    border-radius: 0.35rem;
    background: rgba(139, 147, 167, 0.1);
    border: 1px solid #232834;
    color: #8b93a7;
    white-space: nowrap;
}

/* Code blocks */
.code-block {
    border: 1px solid #232834;
    border-radius: 0.75rem;
    overflow: hidden;
    background: #0c0e13;
    margin-bottom: 1.5rem;
}

.code-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 0.9rem;
    background: #101218;
    border-bottom: 1px solid #232834;
}

.code-block pre {
    margin: 0;
    padding: 1.1rem 1.25rem;
    overflow-x: auto;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    line-height: 1.7;
    color: #c7cddb;
    tab-size: 2;
}

.code-block pre code {
    font-family: inherit;
}

.copy-code {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.9rem;
    height: 1.9rem;
    border-radius: 0.5rem;
    border: 1px solid #232834;
    background: #171a22;
    color: #8b93a7;
    cursor: pointer;
    transition: all 0.2s ease;
}

.copy-code:hover {
    color: #e8c468;
    background: rgba(232, 196, 104, 0.08);
    border-color: rgba(232, 196, 104, 0.3);
}

.copy-code.copied {
    color: #3ddc97;
    background: rgba(61, 220, 151, 0.1);
    border-color: rgba(61, 220, 151, 0.4);
}

.copy-url-btn {
    transition: all 0.2s ease;
}

.copy-url-btn:hover {
    background: rgba(232, 196, 104, 0.08);
    border-color: rgba(232, 196, 104, 0.3);
    color: #e8c468;
}

.copy-url-btn.copied {
    background: rgba(61, 220, 151, 0.1);
    border-color: rgba(61, 220, 151, 0.4);
    color: #3ddc97;
}

/* Tables */
.doc-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
    text-align: left;
}

.doc-table thead th {
    background: #101218;
    color: #8b93a7;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #232834;
    white-space: nowrap;
}

.doc-table tbody td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(35, 40, 52, 0.6);
    color: #c7cddb;
    vertical-align: top;
    line-height: 1.6;
}

.doc-table tbody tr:last-child td {
    border-bottom: none;
}

.doc-table tbody tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

/* Tags, statuses, callouts */
.tag {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.25rem 0.6rem;
    border-radius: 0.4rem;
    white-space: nowrap;
}

.tag-gold {
    background: rgba(232, 196, 104, 0.1);
    border: 1px solid rgba(232, 196, 104, 0.25);
    color: #f5d98a;
}

.tag-muted {
    background: rgba(139, 147, 167, 0.1);
    border: 1px solid #232834;
    color: #8b93a7;
}

.tag-coral {
    background: rgba(255, 107, 107, 0.1);
    border: 1px solid rgba(255, 107, 107, 0.25);
    color: #ff6b6b;
}

.status {
    display: inline-block;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.2rem 0.55rem;
    border-radius: 0.4rem;
}

.status-ok {
    background: rgba(61, 220, 151, 0.1);
    border: 1px solid rgba(61, 220, 151, 0.25);
    color: #3ddc97;
}

.status-err {
    background: rgba(255, 107, 107, 0.1);
    border: 1px solid rgba(255, 107, 107, 0.25);
    color: #ff6b6b;
}

.callout {
    display: flex;
    gap: 0.85rem;
    align-items: flex-start;
    padding: 1rem 1.15rem;
    border-radius: 0.75rem;
    border: 1px solid #232834;
    background: #101218;
    font-size: 0.875rem;
    line-height: 1.7;
    color: #8b93a7;
}

.callout > i {
    font-size: 1.25rem;
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.callout-gold {
    border-color: rgba(232, 196, 104, 0.2);
    background: rgba(232, 196, 104, 0.04);
}

.callout-gold > i {
    color: #e8c468;
}

.callout-coral {
    border-color: rgba(255, 107, 107, 0.2);
    background: rgba(255, 107, 107, 0.04);
}

.callout-coral > i {
    color: #ff6b6b;
}

/* Notes */
.note-card {
    padding: 1.15rem 1.25rem;
    border-radius: 0.75rem;
    border: 1px solid #232834;
    background: #101218;
}

.note-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 0.5rem;
}

.note-title > i {
    color: #e8c468;
    font-size: 1.1rem;
}

.note-card p {
    font-size: 0.875rem;
    line-height: 1.75;
    color: #8b93a7;
}

/* Sidebar table of contents */
.toc-link {
    display: block;
    padding: 0.42rem 0 0.42rem 1rem;
    font-size: 0.82rem;
    color: #8b93a7;
    text-decoration: none;
    border-left: 2px solid transparent;
    margin-left: -1px;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.toc-link:hover {
    color: #fff;
}

.toc-link.active {
    color: #e8c468;
    border-left-color: #e8c468;
    font-weight: 500;
}

/* Scrollbar polish */
::-webkit-scrollbar {
    height: 6px;
    width: 8px;
}

::-webkit-scrollbar-thumb {
    background: #2E3440;
    border-radius: 4px;
}

::-webkit-scrollbar-track {
    background: #161A22;
}