/* category button redesign: modern, soft, and interactive */
.category-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 220px;
    height: 96px;
    margin: 0;
    background: rgba(29, 38, 59, 0.92);
    color: #fff;
    text-decoration: none;
    border: 1px solid rgba(238, 232, 223, 0.2);
    border-radius: 14px;
    box-shadow: 0 8px 22px rgba(14, 22, 38, 0.28);
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: none;
    transition: transform 0.18s ease, box-shadow 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.category-button:hover, .category-button:focus {
    background: rgba(42, 54, 80, 0.96);
    color: #fff;
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(14, 22, 38, 0.35);
    border-color: rgba(238, 232, 223, 0.36);
    outline: none;
}

.category-button span {
    display: inline-block;
    font-size: 1.02em;
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0.05em;
    user-select: none;
}

.home-main {
    width: min(980px, 92vw);
    margin: 0 auto;
    min-height: calc(100vh - 170px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 36px 0;
}

.categories {
    width: min(760px, 100%);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
    justify-items: center;
}

.footer-center {
    text-align: center;
}

.social-blocks {
    width: min(900px, 96vw);
    margin: 0 auto 1rem;
    display: grid;
    grid-template-columns: repeat(5, minmax(130px, 1fr));
    gap: 10px;
    justify-items: center;
}

.social-block {
    width: 100%;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: rgba(29, 38, 59, 0.92);
    color: #fff;
    border: 1px solid rgba(238, 232, 223, 0.2);
    border-radius: 10px;
    text-decoration: none;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Ubuntu', Arial, sans-serif;
    font-size: 0.92rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    box-shadow: 0 8px 22px rgba(14, 22, 38, 0.28);
    transition: transform 0.18s ease, box-shadow 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.social-block svg {
    flex: 0 0 auto;
}

.social-block:hover,
.social-block:focus {
    background: rgba(42, 54, 80, 0.96);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(14, 22, 38, 0.35);
    border-color: rgba(238, 232, 223, 0.36);
    outline: none;
}

.social-block::after {
    display: none;
}

/* hide any fmhy-guard warning badges injected as grid siblings */
.social-blocks > span {
    display: none !important;
}

.back-link {
    text-align: center;
    margin-top: 2em;
}

.back-link a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 170px;
    height: 52px;
    padding: 0 22px;
    background: rgba(29, 38, 59, 0.92);
    color: #fff;
    border: 1px solid rgba(238, 232, 223, 0.2);
    border-radius: 12px;
    text-decoration: none;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Ubuntu', Arial, sans-serif;
    font-size: 0.98rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    box-shadow: 0 8px 22px rgba(14, 22, 38, 0.28);
    transition: transform 0.18s ease, box-shadow 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.back-link a:hover,
.back-link a:focus {
    background: rgba(42, 54, 80, 0.96);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(14, 22, 38, 0.35);
    border-color: rgba(238, 232, 223, 0.36);
    outline: none;
}

.back-link a::after {
    display: none;
}

.page-nav {
    text-align: center;
    margin-top: 1.2em;
}

.page-nav a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 44px;
    margin: 0 6px;
    background: rgba(29, 38, 59, 0.92);
    color: #fff;
    border: 1px solid rgba(238, 232, 223, 0.2);
    border-radius: 10px;
    text-decoration: none;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Ubuntu', Arial, sans-serif;
    font-weight: 600;
    box-shadow: 0 8px 22px rgba(14, 22, 38, 0.28);
    transition: transform 0.18s ease, box-shadow 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.page-nav a:hover,
.page-nav a:focus {
    background: rgba(42, 54, 80, 0.96);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(14, 22, 38, 0.35);
    border-color: rgba(238, 232, 223, 0.36);
    outline: none;
}

.page-nav a.page-current {
    background: rgba(42, 54, 80, 0.96);
    border-color: rgba(238, 232, 223, 0.36);
}

.page-nav a::after {
    display: none;
}

@import url('https://fonts.googleapis.com/css2?family=Ubuntu:wght@400;500;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Ubuntu+Mono:wght@400;500;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Rubik+80s+Fade&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Aleo:ital,wght@0,100..900;1,100..900&family=Arapey:ital@0;1&family=Asap+Condensed:ital,wght@0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Assistant:wght@200..800&family=Barlow:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Bitter:ital,wght@0,100..900;1,100..900&family=Mulish:ital,wght@0,200..1000;1,200..1000&family=Nunito:ital,wght@0,200..1000;1,200..1000&family=Open+Sans:ital,wght@0,300..800;1,300..800&family=Oswald:wght@200..700&family=Rubik:ital,wght@0,300..900;1,300..900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Merriweather:ital,wght@0,300..900;1,300..900&family=Alegreya:ital,wght@0,400..900;1,400..900&family=Montserrat:ital,wght@0,100..900;1,100..900&family=Anek+Devanagari:wght@100..800&display=swap');

/* Base theme variables */
:root {
    --background: #384261;
    --header-bg: #222A44;
    --text: #EEE8DF;
    --text-muted: rgba(238, 232, 223, 0.7);
    --text-bright: #EEE8DF;
    --gradient-start: rgba(44, 54, 90, 0.6);
    --gradient-end: rgba(34, 42, 68, 0.9);
    --card-bg: rgba(28, 34, 56, 0.9);
    --card-hover: rgba(36, 44, 74, 0.95);
    --border: rgba(120, 132, 170, 0.8);
    --hover-border: rgba(158, 172, 210, 0.9);
    --input-bg: rgba(255, 192, 203, 0.12);
    --input-border: rgba(255, 192, 203, 0.4);
    --input-focus-border: rgba(255, 192, 203, 0.7);
    --input-placeholder: rgba(255, 192, 203, 0.6);
    --button-bg: rgba(255, 192, 203, 0.25);
    --button-hover: rgba(255, 192, 203, 0.35);
    --button-primary-bg: #ff8fab;
    --button-primary-hover: #ff6b97;
    --button-primary-text: #000000;
    --button-warning-bg: rgba(255, 100, 100, 0.15);
    --button-warning-hover-bg: rgba(255, 100, 100, 0.25);
    --button-warning-border: rgba(255, 100, 100, 0.6);
    --button-warning-text: var(--text-bright);
    --button-secondary-bg: rgba(255, 192, 203, 0.18);
    --button-secondary-hover: rgba(255, 192, 203, 0.28);
    --button-secondary-border: rgba(255, 192, 203, 0.45);
    --highlight-bg: rgba(255, 192, 203, 0.4);
    --highlight-text: #ffffff;
    --scrollbar-bg: #1B2136;
    --scrollbar-thumb: #1f253b;
    --scrollbar-thumb-hover: #2a334f;
    --link-color: #4FD1C5;
    --link-hover: #81E6D9;
    --status-green: rgba(100, 255, 150, 0.9);
    --status-yellow: rgba(250, 250, 160, 0.9);
    --status-red: rgba(255, 100, 100, 0.9);
    --header-glow-from: rgba(255, 105, 180, 0.8);
    --header-glow-to: rgba(255, 20, 147, 0.95);
    --card-internal-border: rgba(255, 192, 203, 0.3);
}

/* Reset and base styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: var(--scrollbar-bg);
    border-radius: 6px;
}

::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 6px;
    border: 3px solid var(--background);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--scrollbar-thumb-hover);
}

/* Selection highlight */
::selection {
    background: var(--highlight-bg);
    color: var(--highlight-text);
}

body {
    background-color: var(--background);
    color: var(--text);
    font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 2;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-bg);
    overflow-x: hidden;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-bright);
    font-family: 'Bitter', 'Ubuntu', serif;
    font-weight: 600;

    letter-spacing: -0.02em;
}

@keyframes glint {
    0%, 100% {
        text-shadow: none;
    }
    80% {
        text-shadow: none;
    }
    85% {
        text-shadow: 0 0 10px rgba(255, 255, 255, 0.8),
                     0 0 20px var(--text);
    }
    90% {
        text-shadow: none;
    }
}

/* Links */
a {
    color: var(--link-color);
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    font-family: 'Ubuntu Mono', monospace;
}

a:hover {
    color: var(--link-hover);
}

a:hover::after {
    opacity: 1;
}

a::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 1px;
    bottom: -2px;
    left: 0;
    background-color: var(--link-hover);
    opacity: 0;
    transition: opacity 0.45s ease;
}

.category-button span {
    position: relative;
}

.category-button span::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 1px;
    bottom: -2px;
    left: 0;
    background-color: white;
    opacity: 0;
    transition: opacity 0.45s ease;
}

.category-button:hover span::after {
    opacity: 1;
}

.category-button:hover::after {
    transform: scaleX(0);
}

/* Header */
.header {
    background-color: var(--header-bg);
    color: var(--text-bright);
    padding: 1em 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0;
}

.header-content {
    display: flex;
    justify-content: center;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5em;
    position: relative;
}

.header-title-section {
    display: flex;
    align-items: baseline;
    gap: 0.5em;
}

.site-title {
    font-family: 'Asap Condensed', 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 1.6rem;
    color: var(--text);
    margin: 0;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-weight: 600;
    position: relative;
}

.site-title::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 1px;
    bottom: -2px;
    left: 0;
    background-color: white;
    opacity: 0;
    transition: opacity 0.45s ease;
}

.site-title:hover::after {
    opacity: 1;
}

.site-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin: 0;
}

.header-nav {
    display: none;
}

.nav-link {
    color: var(--text);
    text-decoration: none;
    padding: 0.5em 1em;
    border-radius: 6px;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--text);
    opacity: 0;
    transition: opacity 0.45s ease;
}

.nav-link:hover::after {
    opacity: 1;
}

.nav-link.active {
    color: var(--text-bright);
}

.nav-link.active::after {
    opacity: 1;
    background-color: var(--text-bright);
}

/* Main content */
main {
    flex: 1;
    max-width: 980px;
    margin: 0 auto;
    padding: 3rem 1.5rem 2rem;
    width: 100%;
    box-sizing: border-box;
    min-height: calc(100vh - 200px);
}

main:not(.home-main) > h1:first-child {
    text-align: center;
    margin-bottom: 1.5rem;
}

main:not(.home-main) > :not(.back-link):not(.page-nav) {
    width: min(820px, 100%);
    margin-left: auto;
    margin-right: auto;
}

main:not(.home-main) p {
    margin-bottom: 1rem;
}

main:not(.home-main) ul {
    margin: 0 auto 1.25rem;
    padding-left: 1.3rem;
}

main:not(.home-main) li {
    margin-bottom: 0.45rem;
}

main a {
    word-break: break-word;
}

main:not(.home-main) li a::after {
    display: none;
}

main:not(.home-main) li a:hover,
main:not(.home-main) li a:focus-visible {
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
}

footer {
    width: 100%;
    padding: 0 1.5rem;
    box-sizing: border-box;
}

footer p {
    text-align: center;
}

/* Breadcrumb */
.breadcrumb {
    margin-bottom: 2rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.breadcrumb a {
    color: var(--link-color);
    text-decoration: none;
}

.breadcrumb a:hover {
    color: var(--link-hover);
    text-shadow: 0 0 5px var(--link-hover);
}

/* Markdown content */
.markdown-content h1,
.markdown-content h2,
.markdown-content h3,
.markdown-content h4,
.markdown-content h5,
.markdown-content h6 {
    color: var(--text-bright);
    font-family: 'Alegreya', 'Bitter', serif;
    font-weight: 600;
    letter-spacing: -0.025em;
    position: relative;
}

.markdown-content h1:hover .header-anchor,
.markdown-content h2:hover .header-anchor,
.markdown-content h3:hover .header-anchor,
.markdown-content h4:hover .header-anchor,
.markdown-content h5:hover .header-anchor,
.markdown-content h6:hover .header-anchor {
    opacity: 1;
}

.header-anchor {
    position: absolute;
    left: -2rem;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0;
    transition: opacity 0.2s ease;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.8em;
    font-weight: normal;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    background: transparent;
    border: none;
    font-family: 'Ubuntu Mono', monospace;
}

.header-anchor:hover {
    color: var(--link-hover);
    background-color: var(--card-bg);
}

.header-anchor.copied {
    color: var(--status-green);
}

.markdown-content h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-top: 5rem;
    margin-bottom: 2rem;
    scroll-margin-top: 2rem;
}

.markdown-content h1:first-child {
    margin-top: 0;
}

.markdown-content h2 {
    font-size: 2.5rem;
    font-weight: 600;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.5rem;
    margin-top: 5rem;
    margin-bottom: 2rem;
    scroll-margin-top: 2rem;
}

.markdown-content h2:first-child {
    margin-top: 0;
}

.markdown-content h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-top: 4rem;
    margin-bottom: 1.5rem;
}

.markdown-content h3:first-child {
    margin-top: 0;
}

.markdown-content h4 {
    font-size: 1.25rem;
    font-weight: 500;
    margin-top: 3.5rem;
    margin-bottom: 1.5rem;
}

.markdown-content h4:first-child {
    margin-top: 0;
}

.markdown-content h5 {
    font-size: 1.125rem;
    font-weight: 500;
    margin-top: 3rem;
    margin-bottom: 1.5rem;
}

.markdown-content h5:first-child {
    margin-top: 0;
}

.markdown-content h6 {
    font-size: 1rem;
    font-weight: 500;
    margin-top: 3rem;
    margin-bottom: 1.5rem;
}

.markdown-content h6:first-child {
    margin-top: 0;
}

.markdown-content p {
    margin: 2rem 0;
    line-height: 2.1;
    color: var(--text);
    font-size: 1rem;
    max-width: 70ch;
}

.markdown-content {
    max-width: 100%;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.markdown-content ul,
.markdown-content ol {
    margin: 1.5rem 0;
    padding-left: 1.5rem;
    color: var(--text);
}

.markdown-content li {
    margin: 1rem 0;
    line-height: 2;
    font-size: 1rem;
}

.markdown-content li::marker {
    color: var(--text-muted);
}

.markdown-content blockquote {
    border-left: 4px solid var(--border);
    margin: 1.5rem 0;
    padding: 1rem 1.5rem;
    background-color: var(--card-bg);
    color: var(--text-muted);
    font-style: italic;
}

.markdown-content hr,
.markdown-content .separator,
.markdown-content .divider {
    border: none;
    height: 1px;
    background-color: var(--border);
    margin: 5rem 0;
    opacity: 0.6;
    width: 100%;
    display: block;
}

/* Additional line separator styles for common patterns */
.markdown-content > div[style*="border"],
.markdown-content > div[style*="line"],
.markdown-content > div[style*="separator"] {
    margin: 5rem 0 !important;
}

/* Style any horizontal line-like elements */
.markdown-content > *:has(+ h1),
.markdown-content > *:has(+ h2),
.markdown-content > *:has(+ h3) {
    margin-bottom: 5rem;
}

.markdown-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    background-color: var(--card-bg);
    border-radius: 8px;
    overflow: hidden;
}

.markdown-content th,
.markdown-content td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.markdown-content th {
    background-color: var(--button-bg);
    color: var(--text-bright);
    font-weight: 700;
}

/* Code blocks */
.code-block {
    position: relative;
    margin: 1.5rem 0;
}

pre {
    background-color: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    overflow-x: auto;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--text-bright);
    max-width: 100%;
    box-sizing: border-box;
    margin: 2rem 0;
}

code {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    background-color: var(--card-bg);
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-size: 0.875rem;
    color: var(--text-bright);
    border: 1px solid var(--border);
}

pre code {
    background: none;
    padding: 0;
    border-radius: 0;
}

.copy-button {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background-color: var(--button-bg);
    color: var(--text-bright);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Ubuntu Mono', monospace;
    opacity: 0.7;
}

.copy-button:hover {
    background-color: var(--button-hover);
    border-color: var(--hover-border);
    opacity: 1;
    transform: translateY(-1px);
}

.copy-button.copied {
    background-color: var(--status-green);
    color: var(--background);
    border-color: var(--status-green);
}

/* Footer */
footer {
    background-color: var(--card-bg);
    color: var(--text-muted);
    text-align: center;
    padding: 2rem 1rem;
    border-top: 1px solid var(--border);
    margin-top: auto;
}

footer a {
    color: #ffffff;
    text-decoration: none;
}

footer a::after {
    background-color: #ff0000;
    transform: none;
    opacity: 0;
    transition: opacity 0.45s ease;
}

footer a:hover::after,
footer a:focus-visible::after {
    opacity: 1;
}

footer a:hover {
    color: #ffffff;
    text-shadow: none;
    opacity: 0.9;
}

/* Error container */
.error-container {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--status-red);
}

.error-container h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--status-red);
}

.error-container p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    color: var(--text-muted);
}

.error-container a {
    color: var(--link-color);
    text-decoration: none;
    font-weight: 700;
}

.error-container a:hover {
    color: var(--link-hover);
    text-shadow: 0 0 5px var(--link-hover);
}

/* Medium screens */
@media (max-width: 1024px) {
    main {
        padding: 3rem 2rem;
        max-width: 100%;
    }
    
    .markdown-content p {
        max-width: none;
    }
}

/* Responsive design */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
        padding: 0 1.5rem;
    }
    
    .header-nav {
        gap: 1rem;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .site-title {
        font-size: 1.4rem;
        letter-spacing: 0.06em;
    }

    .site-subtitle {
        font-size: 0.8rem;
    }
    
    main {
        padding: 3rem 1.5rem;
        max-width: 100%;
    }
    
    .markdown-content h1 {
        font-size: 2.5rem;
        margin: 0 0 1.5rem 0;
    }
    
    .markdown-content h2 {
        font-size: 2rem;
        margin: 2.5rem 0 1.25rem 0;
    }
    
    .markdown-content h3 {
        font-size: 1.25rem;
        margin: 2rem 0 1rem 0;
    }
    
    .markdown-content h4 {
        font-size: 1.125rem;
        margin: 1.75rem 0 0.75rem 0;
    }
    
    .markdown-content h5,
    .markdown-content h6 {
        font-size: 1rem;
        margin: 1.5rem 0 0.5rem 0;
    }
    
    .markdown-content p {
        margin: 1.25rem 0;
        font-size: 1rem;
        line-height: 1.7;
        max-width: none;
    }
    
    pre {
        padding: 1rem;
        font-size: 0.8rem;
        border-radius: 8px;
        margin: 1.5rem 0;
    }
    
    code {
        font-size: 0.8rem;
        padding: 0.2rem 0.4rem;
    }
    
    .copy-button {
        top: 0.5rem;
        right: 0.5rem;
        padding: 0.4rem 0.6rem;
        font-size: 0.75rem;
    }
    
    .breadcrumb {
        margin-bottom: 1.5rem;
        font-size: 0.875rem;
    }
    
    .markdown-content ul,
    .markdown-content ol {
        margin: 1.25rem 0;
        padding-left: 1.25rem;
    }
    
    .markdown-content li {
        margin: 0.5rem 0;
        font-size: 0.95rem;
    }
    
    .markdown-content blockquote {
        margin: 1.5rem 0;
        padding: 1rem;
        border-radius: 8px;
    }
    
    .header-anchor {
        left: -1.5rem;
        font-size: 0.75em;
    }

    .social-blocks {
        grid-template-columns: repeat(2, minmax(140px, 1fr));
    }

    .category-button {
        width: 100%;
        height: 72px;
    }

    .categories {
        justify-items: stretch;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 1rem 0;
    }
    
    .header-content {
        padding: 0 1rem;
    }
    
    .site-title {
        font-size: 1.25rem;
        letter-spacing: 0.02em;
    }
    
    .nav-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }
    
    main {
        padding: 2rem 1rem;
    }
    
    .markdown-content h1 {
        font-size: 2.25rem;
        margin: 0 0 1.25rem 0;
    }
    
    .markdown-content h2 {
        font-size: 1.875rem;
        margin: 2rem 0 1rem 0;
    }
    
    .markdown-content h3 {
        font-size: 1.125rem;
        margin: 1.75rem 0 0.75rem 0;
    }
    
    .markdown-content h4,
    .markdown-content h5,
    .markdown-content h6 {
        font-size: 1rem;
        margin: 1.5rem 0 0.5rem 0;
    }
    
    .markdown-content p {
        font-size: 0.9rem;
        line-height: 1.6;
        margin: 1rem 0;
    }
    
    pre {
        font-size: 0.75rem;
        padding: 0.75rem;
        margin: 1.25rem 0;
    }
    
    code {
        font-size: 0.75rem;
        padding: 0.15rem 0.3rem;
    }
    
    .markdown-content ul,
    .markdown-content ol {
        padding-left: 1rem;
        margin: 1rem 0;
    }
    
    .markdown-content li {
        margin: 0.4rem 0;
        font-size: 0.9rem;
    }
    
    .markdown-content blockquote {
        padding: 0.75rem;
        margin: 1.25rem 0;
    }
    
    footer {
        padding: 1.5rem 1rem;
    }
    
    .header-anchor {
        left: -1.25rem;
        font-size: 0.7em;
    }

    .social-blocks {
        grid-template-columns: repeat(2, 1fr);
    }

    .category-button {
        height: 60px;
        font-size: 0.9rem;
    }
}

/* ===== Lang Toggle ===== */
.lang-toggle {
    position: absolute;
    right: calc(1.5em + 50px);
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: 1px solid rgba(238, 232, 223, 0.25);
    border-radius: 8px;
    color: var(--text);
    cursor: pointer;
    padding: 0 10px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    font-family: inherit;
    line-height: 1;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.lang-toggle:hover {
    background: rgba(238, 232, 223, 0.1);
    border-color: rgba(238, 232, 223, 0.5);
}

/* ===== Theme Toggle ===== */
.theme-toggle {
    position: absolute;
    right: 1.5em;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: 1px solid rgba(238, 232, 223, 0.25);
    border-radius: 8px;
    color: var(--text);
    cursor: pointer;
    padding: 0 10px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, border-color 0.2s ease;
    line-height: 1;
}

.theme-toggle:hover {
    background: rgba(238, 232, 223, 0.1);
    border-color: rgba(238, 232, 223, 0.5);
}

/* ===== Search ===== */
.search-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    width: min(820px, 100%);
    margin-left: auto;
    margin-right: auto;
}

.search-input {
    flex: 1;
    min-width: 180px;
    max-width: 380px;
    padding: 9px 14px;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 10px;
    color: var(--text);
    font-family: 'Ubuntu', sans-serif;
    font-size: 0.95rem;
    transition: border-color 0.2s ease, background 0.2s ease;
    outline: none;
}

.search-input::placeholder {
    color: var(--input-placeholder);
}

.search-input:focus {
    border-color: var(--input-focus-border);
}

.search-counter {
    color: var(--text-muted);
    font-size: 0.85rem;
    white-space: nowrap;
    font-family: 'Ubuntu Mono', monospace;
}

.no-results {
    color: var(--text-muted);
    font-style: italic;
    list-style: none;
    padding: 0.25rem 0;
}

/* ===== NEW badge ===== */
.badge-new {
    display: inline-block;
    background: var(--button-primary-bg);
    color: var(--button-primary-text);
    font-size: 0.62rem;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 4px;
    margin-left: 6px;
    letter-spacing: 0.06em;
    vertical-align: middle;
    font-family: 'Ubuntu Mono', monospace;
    line-height: 1.6;
}

/* ===== Last Updated ===== */
.last-updated {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.4rem;
    font-family: 'Ubuntu Mono', monospace;
}

/* ===== Light Theme ===== */
html[data-theme="light"] {
    --background: #f0f0f5;
    --header-bg: #ffffff;
    --text: #1d1d1f;
    --text-muted: rgba(29, 29, 31, 0.55);
    --text-bright: #1d1d1f;
    --card-bg: rgba(255, 255, 255, 0.9);
    --card-hover: rgba(245, 245, 250, 0.98);
    --border: rgba(60, 70, 110, 0.18);
    --hover-border: rgba(60, 70, 110, 0.35);
    --input-bg: rgba(220, 80, 120, 0.07);
    --input-border: rgba(220, 80, 120, 0.25);
    --input-focus-border: rgba(220, 80, 120, 0.55);
    --input-placeholder: rgba(180, 60, 100, 0.45);
    --button-bg: rgba(220, 80, 120, 0.1);
    --button-hover: rgba(220, 80, 120, 0.18);
    --button-primary-bg: #e8527a;
    --button-primary-hover: #d63d68;
    --button-primary-text: #ffffff;
    --highlight-bg: rgba(220, 80, 120, 0.15);
    --highlight-text: #1d1d1f;
    --scrollbar-bg: #e0e0e8;
    --scrollbar-thumb: #c0c0cc;
    --scrollbar-thumb-hover: #a0a0b0;
    --link-color: #0071e3;
    --link-hover: #0058b8;
    --status-green: rgba(20, 140, 60, 0.9);
    --status-yellow: rgba(160, 120, 0, 0.9);
    --status-red: rgba(190, 40, 40, 0.9);
    --card-internal-border: rgba(220, 80, 120, 0.18);
}

html[data-theme="light"] .category-button,
html[data-theme="light"] .social-block,
html[data-theme="light"] .back-link a,
html[data-theme="light"] .page-nav a {
    background: rgba(255, 255, 255, 0.92);
    color: #1d1d1f;
    border-color: rgba(60, 70, 110, 0.2);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

html[data-theme="light"] .category-button:hover,
html[data-theme="light"] .social-block:hover,
html[data-theme="light"] .back-link a:hover,
html[data-theme="light"] .page-nav a:hover {
    background: rgba(240, 240, 248, 0.98);
    border-color: rgba(60, 70, 110, 0.38);
    color: #1d1d1f;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
}

html[data-theme="light"] .page-nav a.page-current {
    background: rgba(230, 230, 240, 0.98);
    border-color: rgba(60, 70, 110, 0.38);
}

html[data-theme="light"] .category-button span::after {
    background-color: #1d1d1f;
}

html[data-theme="light"] footer {
    background-color: #e8e8f0;
    border-top-color: rgba(60, 70, 110, 0.15);
    color: rgba(29, 29, 31, 0.6);
}

html[data-theme="light"] footer a {
    color: #1d1d1f;
}

html[data-theme="light"] .theme-toggle {
    border-color: rgba(60, 70, 110, 0.22);
}

html[data-theme="light"] .theme-toggle:hover {
    background: rgba(60, 70, 110, 0.07);
    border-color: rgba(60, 70, 110, 0.38);
}

html[data-theme="light"] .lang-toggle {
    border-color: rgba(60, 70, 110, 0.22);
}

html[data-theme="light"] .lang-toggle:hover {
    background: rgba(60, 70, 110, 0.07);
    border-color: rgba(60, 70, 110, 0.38);
}

html[data-theme="light"] pre,
html[data-theme="light"] code {
    background-color: rgba(240, 240, 248, 0.9);
    border-color: rgba(60, 70, 110, 0.18);
    color: #1d1d1f;
}

@media (max-width: 480px) {
    .theme-toggle {
        right: 1rem;
    }
    .lang-toggle {
        right: calc(1rem + 50px);
    }
}

/* ===== OLED Theme ===== */
html[data-theme="oled"] {
    --background: #000000;
    --header-bg: #000000;
    --text: #f0ece3;
    --text-muted: rgba(240, 236, 227, 0.6);
    --text-bright: #ffffff;
    --card-bg: rgba(14, 14, 14, 0.97);
    --card-hover: rgba(20, 20, 20, 0.99);
    --border: rgba(100, 112, 155, 0.55);
    --hover-border: rgba(145, 158, 200, 0.8);
    --input-bg: rgba(255, 192, 203, 0.08);
    --input-border: rgba(255, 192, 203, 0.3);
    --input-focus-border: rgba(255, 192, 203, 0.6);
    --input-placeholder: rgba(255, 192, 203, 0.45);
    --button-bg: rgba(255, 192, 203, 0.12);
    --button-hover: rgba(255, 192, 203, 0.2);
    --button-primary-bg: #ff8fab;
    --button-primary-hover: #ff6b97;
    --button-primary-text: #000000;
    --highlight-bg: rgba(255, 192, 203, 0.3);
    --highlight-text: #ffffff;
    --scrollbar-bg: #000000;
    --scrollbar-thumb: #181818;
    --scrollbar-thumb-hover: #242424;
    --link-color: #5ad4c8;
    --link-hover: #8ee8de;
    --status-green: rgba(80, 220, 120, 0.9);
    --status-yellow: rgba(240, 240, 130, 0.9);
    --status-red: rgba(255, 90, 90, 0.9);
    --card-internal-border: rgba(255, 192, 203, 0.2);
}

html[data-theme="oled"] .category-button,
html[data-theme="oled"] .social-block,
html[data-theme="oled"] .back-link a,
html[data-theme="oled"] .page-nav a {
    background: rgba(10, 10, 10, 0.97);
    border-color: rgba(100, 112, 155, 0.35);
    box-shadow: none;
}

html[data-theme="oled"] .category-button:hover,
html[data-theme="oled"] .social-block:hover,
html[data-theme="oled"] .back-link a:hover,
html[data-theme="oled"] .page-nav a:hover {
    background: rgba(18, 18, 18, 0.99);
    border-color: rgba(145, 158, 200, 0.6);
    box-shadow: none;
}

html[data-theme="oled"] .page-nav a.page-current {
    background: rgba(18, 18, 18, 0.99);
    border-color: rgba(145, 158, 200, 0.6);
}

html[data-theme="oled"] footer {
    background-color: #000000;
    border-top-color: rgba(100, 112, 155, 0.3);
}

html[data-theme="oled"] pre,
html[data-theme="oled"] code {
    background-color: rgba(10, 10, 10, 0.97);
}


/* ===== Xatab Quote ===== */

.xatab-quote {
    position: relative;
    width: min(680px, 92vw);
    margin: 0 auto 18px;
    padding: 30px 38px 28px 48px;
    background: rgba(29, 38, 59, 0.92);
    border: 1px solid rgba(238, 232, 223, 0.2);
    border-radius: 16px;
    box-shadow: 0 8px 22px rgba(14, 22, 38, 0.28);
    text-align: left;
    overflow: hidden;
}

.footer-disclaimer-row {
    position: relative;
}

.xatab-popover {
    position: absolute;
    left: 0;
    bottom: calc(100% + 10px);
    z-index: 50;
}

.xatab-popover-panel {
    width: min(680px, 92vw);
    margin: 0;
}

/* accent line on the left */
.xatab-quote::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: linear-gradient(180deg,
        rgba(120, 132, 170, 0.85) 0%,
        rgba(120, 132, 170, 0.35) 60%,
        rgba(120, 132, 170, 0.05) 100%);
    border-radius: 3px 0 0 3px;
}

/* large decorative quotation mark */
.xatab-quote::after {
    content: '\201C';
    position: absolute;
    top: 6px;
    right: 26px;
    font-family: 'Alegreya', Georgia, serif;
    font-size: 7.5rem;
    font-style: italic;
    line-height: 1;
    color: rgba(238, 232, 223, 0.05);
    pointer-events: none;
    user-select: none;
}

/* intro line */
.xatab-quote blockquote:first-of-type {
    margin: 0 0 10px 0;
    padding: 0;
    border: none;
    background: none;
    font-family: 'Mulish', 'Open Sans', sans-serif;
    font-size: 0.80rem;
    font-style: normal;
    font-weight: 400;
    color: rgba(238, 232, 223, 0.45);
    line-height: 1.65;
    letter-spacing: 0.01em;
    text-wrap: balance;
    position: relative;
    z-index: 1;
}

.xatab-quote blockquote:first-of-type strong {
    color: rgba(238, 232, 223, 0.82);
    font-weight: 600;
    font-style: normal;
    letter-spacing: 0.02em;
}

/* actual quote */
.xatab-quote .xatab-quote-extra blockquote {
    margin: 0;
    padding: 0;
    border: none;
    background: none;
    font-family: 'Alegreya', 'Bitter', Georgia, serif;
    font-size: 1.13rem;
    font-style: italic;
    font-weight: 500;
    color: rgba(238, 232, 223, 0.95);
    line-height: 1.88;
    letter-spacing: 0.008em;
    text-wrap: balance;
    position: relative;
    z-index: 1;
}

.xatab-quote .xatab-quote-extra {
    margin-top: 6px;
}

.xatab-toggle {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 14px auto 0;
    min-width: 172px;
    height: 38px;
    padding: 0 16px;
    background: rgba(42, 54, 80, 0.96);
    color: rgba(238, 232, 223, 0.94);
    border: 1px solid rgba(238, 232, 223, 0.24);
    border-radius: 10px;
    font-family: 'Ubuntu', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    cursor: pointer;
    transition: transform 0.18s ease, background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.xatab-toggle-compact {
    background: none;
    border: 1px solid rgba(238, 232, 223, 0.25);
    border-radius: 8px;
    color: var(--text);
    width: 34px;
    min-width: 34px;
    height: 30px;
    padding: 0;
    margin: 0 auto;
}

.footer-xatab-toggle {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    margin: 0;
    z-index: 70;
    pointer-events: auto;
    transition: none;
}

.footer-xatab-toggle:hover,
.footer-xatab-toggle:focus {
    transform: translateY(-50%);
}

.xatab-toggle:hover,
.xatab-toggle:focus {
    background: rgba(52, 66, 98, 0.98);
    border-color: rgba(238, 232, 223, 0.42);
    color: #fff;
    transform: translateY(-1px);
    outline: none;
}

.xatab-toggle-compact:hover,
.xatab-toggle-compact:focus {
    background: rgba(238, 232, 223, 0.1);
    border-color: rgba(238, 232, 223, 0.5);
}

.footer-xatab-toggle.xatab-toggle:hover,
.footer-xatab-toggle.xatab-toggle:focus,
.footer-xatab-toggle.xatab-toggle-compact:hover,
.footer-xatab-toggle.xatab-toggle-compact:focus {
    transform: translateY(-50%) !important;
    transition: none !important;
}

.xatab-quote figcaption {
    position: relative;
    z-index: 1;
    margin-top: 10px;
    font-family: 'Ubuntu Mono', monospace;
    font-size: 0.72rem;
    font-weight: 600;
    color: rgba(238, 232, 223, 0.38);
    letter-spacing: 0.09em;
    text-transform: uppercase;
    text-align: right;
}

.xatab-quote .xatab-link {
    color: inherit;
    text-decoration: underline;
    text-decoration-color: rgba(238, 232, 223, 0.32);
    text-underline-offset: 3px;
    font-weight: 700;
    transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

.xatab-quote .xatab-link:hover,
.xatab-quote .xatab-link:focus {
    color: rgba(238, 232, 223, 0.88);
    text-decoration-color: rgba(238, 232, 223, 0.75);
    outline: none;
}

/* -- light theme -- */
html[data-theme="light"] .xatab-quote {
    background: rgba(255, 255, 255, 0.92);
    border-color: rgba(60, 70, 110, 0.2);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

html[data-theme="light"] .xatab-quote::before {
    background: linear-gradient(180deg,
        rgba(60, 70, 110, 0.55) 0%,
        rgba(60, 70, 110, 0.2) 60%,
        rgba(60, 70, 110, 0.03) 100%);
}

html[data-theme="light"] .xatab-quote::after {
    color: rgba(29, 29, 31, 0.05);
}

html[data-theme="light"] .xatab-quote blockquote:first-of-type {
    color: rgba(29, 29, 31, 0.42);
}

html[data-theme="light"] .xatab-quote blockquote:first-of-type strong {
    color: rgba(29, 29, 31, 0.75);
}

html[data-theme="light"] .xatab-quote .xatab-quote-extra blockquote {
    color: rgba(29, 29, 31, 0.88);
}

html[data-theme="light"] .xatab-quote figcaption {
    color: rgba(29, 29, 31, 0.35);
}

html[data-theme="light"] .xatab-quote .xatab-link {
    text-decoration-color: rgba(29, 29, 31, 0.28);
}

html[data-theme="light"] .xatab-quote .xatab-link:hover,
html[data-theme="light"] .xatab-quote .xatab-link:focus {
    color: rgba(29, 29, 31, 0.78);
    text-decoration-color: rgba(29, 29, 31, 0.58);
}

html[data-theme="light"] .xatab-toggle {
    background: rgba(255, 255, 255, 0.96);
    color: rgba(29, 29, 31, 0.76);
    border-color: rgba(60, 70, 110, 0.26);
}

html[data-theme="light"] .xatab-toggle-compact {
    background: none;
    border-color: rgba(29, 29, 31, 0.22);
    color: rgba(29, 29, 31, 0.85);
}

html[data-theme="light"] .xatab-toggle-compact:hover,
html[data-theme="light"] .xatab-toggle-compact:focus {
    background: rgba(29, 29, 31, 0.06);
    border-color: rgba(29, 29, 31, 0.45);
}

html[data-theme="light"] .xatab-toggle:hover,
html[data-theme="light"] .xatab-toggle:focus {
    background: rgba(248, 248, 252, 1);
    color: rgba(29, 29, 31, 0.9);
    border-color: rgba(60, 70, 110, 0.42);
}

/* -- oled theme -- */
html[data-theme="oled"] .xatab-quote {
    background: rgba(10, 10, 10, 0.97);
    border-color: rgba(100, 112, 155, 0.35);
    box-shadow: none;
}

html[data-theme="oled"] .xatab-quote::before {
    background: linear-gradient(180deg,
        rgba(145, 158, 200, 0.65) 0%,
        rgba(145, 158, 200, 0.25) 60%,
        rgba(145, 158, 200, 0.04) 100%);
}

html[data-theme="oled"] .xatab-quote::after {
    color: rgba(240, 236, 227, 0.04);
}

html[data-theme="oled"] .xatab-quote blockquote:first-of-type {
    color: rgba(240, 236, 227, 0.38);
}

html[data-theme="oled"] .xatab-quote blockquote:first-of-type strong {
    color: rgba(240, 236, 227, 0.72);
}

html[data-theme="oled"] .xatab-quote .xatab-quote-extra blockquote {
    color: rgba(240, 236, 227, 0.92);
}

html[data-theme="oled"] .xatab-quote figcaption {
    color: rgba(240, 236, 227, 0.30);
}

html[data-theme="oled"] .xatab-quote .xatab-link {
    text-decoration-color: rgba(240, 236, 227, 0.22);
}

html[data-theme="oled"] .xatab-quote .xatab-link:hover,
html[data-theme="oled"] .xatab-quote .xatab-link:focus {
    color: rgba(240, 236, 227, 0.82);
    text-decoration-color: rgba(240, 236, 227, 0.5);
}

html[data-theme="oled"] .xatab-toggle {
    background: rgba(18, 18, 18, 0.99);
    color: rgba(240, 236, 227, 0.86);
    border-color: rgba(145, 158, 200, 0.34);
}

html[data-theme="oled"] .xatab-toggle-compact {
    background: none;
    border-color: rgba(145, 158, 200, 0.34);
    color: rgba(240, 236, 227, 0.86);
}

html[data-theme="oled"] .xatab-toggle-compact:hover,
html[data-theme="oled"] .xatab-toggle-compact:focus {
    background: rgba(240, 236, 227, 0.06);
    border-color: rgba(145, 158, 200, 0.58);
}

html[data-theme="oled"] .xatab-toggle:hover,
html[data-theme="oled"] .xatab-toggle:focus {
    background: rgba(24, 24, 24, 0.99);
    border-color: rgba(145, 158, 200, 0.58);
    color: rgba(240, 236, 227, 0.95);
}

/* -- responsive -- */
@media (max-width: 600px) {
    .xatab-quote {
        width: min(640px, 96vw);
        padding: 24px 24px 22px 34px;
        border-radius: 14px;
    }

    .xatab-quote::after {
        font-size: 5rem;
        right: 14px;
        top: 4px;
    }

    .xatab-quote blockquote:first-of-type {
        font-size: 0.76rem;
        margin-bottom: 8px;
    }

    .xatab-quote .xatab-quote-extra blockquote {
        font-size: 1rem;
    }

    .xatab-toggle {
        width: 100%;
        margin-top: 12px;
    }

    .xatab-toggle-compact {
        width: 34px;
        margin-top: 0;
    }

    .xatab-popover {
        left: 0;
    }
}

.merriweather-font {
    font-family: "Merriweather", serif;
    font-optical-sizing: auto;
    font-weight: var(--font-weight, 400);
    font-style: normal;
    font-variation-settings: "wdth" 100;
}

.alegreya-font {
    font-family: "Alegreya", serif;
    font-optical-sizing: auto;
    font-weight: var(--font-weight, 400);
    font-style: normal;
}

.montserrat-font {
    font-family: "Montserrat", sans-serif;
    font-optical-sizing: auto;
    font-weight: var(--font-weight, 400);
    font-style: normal;
}

.bitter-font {
    font-family: "Bitter", serif;
    font-optical-sizing: auto;
    font-weight: var(--font-weight, 400);
    font-style: normal;
}

.oswald-font {
    font-family: "Oswald", sans-serif;
    font-optical-sizing: auto;
    font-weight: var(--font-weight, 400);
    font-style: normal;
}

.open-sans-font {
    font-family: "Open Sans", sans-serif;
    font-optical-sizing: auto;
    font-weight: var(--font-weight, 400);
    font-style: normal;
    font-variation-settings: "wdth" 100;
}

.assistant-font {
    font-family: "Assistant", sans-serif;
    font-optical-sizing: auto;
    font-weight: var(--font-weight, 400);
    font-style: normal;
}

.nunito-font {
    font-family: "Nunito", sans-serif;
    font-optical-sizing: auto;
    font-weight: var(--font-weight, 400);
    font-style: normal;
}

.mulish-font {
    font-family: "Mulish", sans-serif;
    font-optical-sizing: auto;
    font-weight: var(--font-weight, 400);
    font-style: normal;
}

.aleo-font {
    font-family: "Aleo", serif;
    font-optical-sizing: auto;
    font-weight: var(--font-weight, 400);
    font-style: normal;
}

.anek-devanagari-font {
    font-family: "Anek Devanagari", sans-serif;
    font-optical-sizing: auto;
    font-weight: var(--font-weight, 400);
    font-style: normal;
    font-variation-settings: "wdth" 100;
}

.barlow-thin { font-family: "Barlow", sans-serif; font-weight: 100; font-style: normal; }
.barlow-extralight { font-family: "Barlow", sans-serif; font-weight: 200; font-style: normal; }
.barlow-light { font-family: "Barlow", sans-serif; font-weight: 300; font-style: normal; }
.barlow-regular { font-family: "Barlow", sans-serif; font-weight: 400; font-style: normal; }
.barlow-medium { font-family: "Barlow", sans-serif; font-weight: 500; font-style: normal; }
.barlow-semibold { font-family: "Barlow", sans-serif; font-weight: 600; font-style: normal; }
.barlow-bold { font-family: "Barlow", sans-serif; font-weight: 700; font-style: normal; }
.barlow-extrabold { font-family: "Barlow", sans-serif; font-weight: 800; font-style: normal; }
.barlow-black { font-family: "Barlow", sans-serif; font-weight: 900; font-style: normal; }
.barlow-thin-italic { font-family: "Barlow", sans-serif; font-weight: 100; font-style: italic; }
.barlow-extralight-italic { font-family: "Barlow", sans-serif; font-weight: 200; font-style: italic; }
.barlow-light-italic { font-family: "Barlow", sans-serif; font-weight: 300; font-style: italic; }
.barlow-regular-italic { font-family: "Barlow", sans-serif; font-weight: 400; font-style: italic; }
.barlow-medium-italic { font-family: "Barlow", sans-serif; font-weight: 500; font-style: italic; }
.barlow-semibold-italic { font-family: "Barlow", sans-serif; font-weight: 600; font-style: italic; }
.barlow-bold-italic { font-family: "Barlow", sans-serif; font-weight: 700; font-style: italic; }
.barlow-extrabold-italic { font-family: "Barlow", sans-serif; font-weight: 800; font-style: italic; }
.barlow-black-italic { font-family: "Barlow", sans-serif; font-weight: 900; font-style: italic; }

.asap-condensed-extralight { font-family: "Asap Condensed", sans-serif; font-weight: 200; font-style: normal; }
.asap-condensed-light { font-family: "Asap Condensed", sans-serif; font-weight: 300; font-style: normal; }
.asap-condensed-regular { font-family: "Asap Condensed", sans-serif; font-weight: 400; font-style: normal; }
.asap-condensed-medium { font-family: "Asap Condensed", sans-serif; font-weight: 500; font-style: normal; }
.asap-condensed-semibold { font-family: "Asap Condensed", sans-serif; font-weight: 600; font-style: normal; }
.asap-condensed-bold { font-family: "Asap Condensed", sans-serif; font-weight: 700; font-style: normal; }
.asap-condensed-extrabold { font-family: "Asap Condensed", sans-serif; font-weight: 800; font-style: normal; }
.asap-condensed-black { font-family: "Asap Condensed", sans-serif; font-weight: 900; font-style: normal; }
.asap-condensed-extralight-italic { font-family: "Asap Condensed", sans-serif; font-weight: 200; font-style: italic; }
.asap-condensed-light-italic { font-family: "Asap Condensed", sans-serif; font-weight: 300; font-style: italic; }
.asap-condensed-regular-italic { font-family: "Asap Condensed", sans-serif; font-weight: 400; font-style: italic; }
.asap-condensed-medium-italic { font-family: "Asap Condensed", sans-serif; font-weight: 500; font-style: italic; }
.asap-condensed-semibold-italic { font-family: "Asap Condensed", sans-serif; font-weight: 600; font-style: italic; }
.asap-condensed-bold-italic { font-family: "Asap Condensed", sans-serif; font-weight: 700; font-style: italic; }
.asap-condensed-extrabold-italic { font-family: "Asap Condensed", sans-serif; font-weight: 800; font-style: italic; }
.asap-condensed-black-italic { font-family: "Asap Condensed", sans-serif; font-weight: 900; font-style: italic; }

.arapey-regular { font-family: "Arapey", serif; font-weight: 400; font-style: normal; }
.arapey-regular-italic { font-family: "Arapey", serif; font-weight: 400; font-style: italic; }

/* ===== Page transitions ===== */
@keyframes pageFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

body {
    animation: pageFadeIn 0.22s ease forwards;
}

body.page-exit {
    animation: none;
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity 0.18s ease, transform 0.18s ease;
    pointer-events: none;
}

/* ===== Back to top ===== */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 1.5rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--card-bg);
    color: var(--text);
    border: 1px solid var(--border);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transform: translateY(12px);
    transition: opacity 0.25s, transform 0.25s, background-color 0.2s, border-color 0.2s;
    z-index: 999;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

.back-to-top.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.back-to-top:hover {
    background: var(--card-hover);
    border-color: var(--hover-border);
}

.back-to-top:focus-visible {
    outline: 2px solid var(--link-color);
    outline-offset: 2px;
}

/* ===== Sort button ===== */
.sort-btn {
    background: transparent;
    border: 1px solid rgba(238, 232, 223, 0.18);
    color: var(--text-muted);
    border-radius: 6px;
    padding: 3px 10px;
    font-size: 0.82rem;
    cursor: pointer;
    font-family: 'Ubuntu Mono', monospace;
    letter-spacing: 0.03em;
    transition: border-color 0.15s, color 0.15s;
    white-space: nowrap;
    flex-shrink: 0;
}

.sort-btn:hover {
    border-color: var(--link-color);
    color: var(--link-color);
}

.sort-btn.active {
    border-color: var(--link-color);
    color: var(--link-color);
}

html[data-theme="light"] .sort-btn {
    border-color: rgba(29, 29, 31, 0.18);
}

/* Sort button inside page h1 */
main:not(.home-main) > h1 {
    position: relative;
}

main:not(.home-main) > h1 .sort-btn {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.78rem;
    font-weight: normal;
}

/* ===== Two-column layout (macos.html) ===== */
.two-col-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 3rem;
    align-items: start;
    width: min(820px, 100%) !important;
}

.col h2 {
    margin-top: 0;
    margin-bottom: 0.5rem;
}

.col-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.col-header h2 {
    margin: 0;
}

.col-header .sort-btn {
    margin-bottom: 0;
}

.col ul {
    margin: 0 0 1rem !important;
    padding-left: 1.3rem;
}

.col .sort-btn {
    display: block;
    margin-bottom: 0.6rem;
}

@media (max-width: 600px) {
    .two-col-layout {
        grid-template-columns: 1fr;
        gap: 0;
    }
}

/* ===== Header Search (two-col pages) ===== */
.header-search {
    position: absolute;
    right: calc(1.5em + 106px);
    top: 50%;
    transform: translateY(-50%);
}

.header-search-input {
    width: 160px;
    padding: 5px 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(238, 232, 223, 0.25);
    border-radius: 8px;
    color: var(--text);
    font-family: 'Ubuntu', sans-serif;
    font-size: 0.85rem;
    transition: border-color 0.2s ease, width 0.2s ease;
    outline: none;
}

.header-search-input::placeholder {
    color: var(--text-muted);
}

.header-search-input:focus {
    border-color: rgba(238, 232, 223, 0.5);
    width: 210px;
}

html[data-theme="light"] .header-search-input {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(60, 70, 110, 0.22);
}

html[data-theme="light"] .header-search-input:focus {
    border-color: rgba(60, 70, 110, 0.45);
}

@media (max-width: 768px) {
    .header-search {
        display: none;
    }
}

/* ===== FMHY Guard Loading Indicator ===== */
@keyframes guard-spin {
    to { transform: rotate(360deg); }
}

@keyframes guard-fadein {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes guard-fadeout {
    from { opacity: 1; transform: translateY(0); }
    to   { opacity: 0; transform: translateY(8px); }
}

.guard-status {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 13px;
    background: rgba(29, 38, 59, 0.92);
    color: var(--text, #eee8df);
    border: 1px solid rgba(238, 232, 223, 0.18);
    border-radius: 10px;
    font-size: 0.82rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    box-shadow: 0 4px 18px rgba(0,0,0,0.28);
    animation: guard-fadein 0.22s ease forwards;
    pointer-events: none;
    user-select: none;
    white-space: nowrap;
}

.guard-status.guard-status--hiding {
    animation: guard-fadeout 0.28s ease forwards;
}

.guard-status__spinner {
    width: 13px;
    height: 13px;
    border: 2px solid rgba(238, 232, 223, 0.25);
    border-top-color: var(--text, #eee8df);
    border-radius: 50%;
    animation: guard-spin 0.7s linear infinite;
    flex-shrink: 0;
}

html[data-theme="light"] .guard-status {
    background: rgba(240, 242, 250, 0.96);
    color: #2b3050;
    border-color: rgba(60, 70, 110, 0.18);
    box-shadow: 0 4px 18px rgba(60, 70, 110, 0.14);
}

html[data-theme="light"] .guard-status__spinner {
    border-color: rgba(60, 70, 110, 0.2);
    border-top-color: #2b3050;
}

html[data-theme="oled"] .guard-status {
    background: rgba(0, 0, 0, 0.92);
    border-color: rgba(255, 255, 255, 0.12);
}
