@font-face {
    font-family: 'Space Grotesk';
    src: url('./font.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Space Grotesk';
    src: url('./font2.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

:root {
    --background-color: #fff;
    --foreground-color: #000;
    --link-color: #336bad;
    --foreground-secondary-color: #666;
    --nav-current-background-color: #0f0f0f;
    --nav-current-foreground-color: #fff;
    --nav-item-background-color: #f2f2f2;
    --nav-item-foreground-color: #0f0f0f;
    --nav-item-hover-background-color: #e5e5e5;
    --icon-secondary-filter: invert(43%) sepia(22%) saturate(10%) hue-rotate(58deg) brightness(87%) contrast(93%);
    --icon-social-filter: invert(28%) sepia(47%) saturate(2131%) hue-rotate(197deg) brightness(95%) contrast(78%);
    --nav-icon-filter: invert(40%) sepia(0%) saturate(0%) hue-rotate(0deg) brightness(95%) contrast(90%);
    --border-color: #e2e2e2;
    --chevron-color: #333;
    --code-background-color: #f8f8f8;
    --kbd-color: #444444;
    --kbd-text-shadow: #fff;
    --kbd-border-color: #bbb;
    --kbd-background-color: #f7f7f7;
    --kbd-background-image: linear-gradient(top, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0));
    --kbd-background-repeat: repeat-x;
    --kbd-box-shadow: 0px 1px 0 #bbbbbb, 0 2px 1px #999999, 0 2px 0 #bbbbbb, inset 0 1px 1px #ffffff, inset 0 -1px 2px #cccccc;
    
    --site-title-font-size: 2.5em;
    --h1-font-size: 2em;
    --item-gap: 30px;
    --inner-gap: 20px;
    --title-line-height: 1.2;
    --content-max-width: 100%;
    --sidebar-width: 80px;
    --monospace: "Lucida Console", Consolas, "Courier", monospace;
}

:root[data-theme="dark"] {
    --background-color: #1c1c1e;
    --foreground-color: #fff;
    --link-color: #6699ff;
    --foreground-secondary-color: #adadaf;
    --nav-current-background-color: #0f0f0f;
    --nav-current-foreground-color: #f1f1f1;
    --nav-item-background-color: #272727;
    --nav-item-foreground-color: #f1f1f1;
    --nav-item-hover-background-color: #3f3f3f;
    --icon-secondary-filter: invert(87%) sepia(6%) saturate(58%) hue-rotate(202deg) brightness(80%) contrast(87%);
    --icon-social-filter: invert(64%) sepia(85%) saturate(4030%) hue-rotate(203deg) brightness(108%) contrast(102%);
    --nav-icon-filter: invert(100%) sepia(0%) saturate(0%) hue-rotate(0deg) brightness(95%) contrast(95%);
    --border-color: #2b2b2d;
    --chevron-color: #eee;
    --code-background-color: #2b2b2d;
    --kbd-color: #eeeeee;
    --kbd-text-shadow: #000000;
    --kbd-border-color: #000;
    --kbd-background-color: #4d4c4c;
    --kbd-background-image: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0) 80%, rgba(0, 0, 0, 0));
    --kbd-background-repeat: no-repeat;
    --kbd-box-shadow: 0px 1px 0 #000000, 0 2px 1px rgba(90, 90, 90, 0.5), inset 0 1px 1px #aaaaaa, inset 0 -1px 2px #272727;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) {
        --background-color: #1c1c1e;
        --foreground-color: #fff;
        --link-color: #6699ff;
        --foreground-secondary-color: #adadaf;
        --nav-current-background-color: #0f0f0f;
        --nav-current-foreground-color: #f1f1f1;
        --nav-item-background-color: #272727;
        --nav-item-foreground-color: #f1f1f1;
        --nav-item-hover-background-color: #3f3f3f;
        --icon-secondary-filter: invert(87%) sepia(6%) saturate(58%) hue-rotate(202deg) brightness(80%) contrast(87%);
        --icon-social-filter: invert(64%) sepia(85%) saturate(4030%) hue-rotate(203deg) brightness(108%) contrast(102%);
        --nav-icon-filter: invert(100%) sepia(0%) saturate(0%) hue-rotate(0deg) brightness(95%) contrast(95%);
        --border-color: #2b2b2d;
        --chevron-color: #eee;
        --code-background-color: #2b2b2d;
        --kbd-color: #eeeeee;
        --kbd-text-shadow: #000000;
        --kbd-border-color: #000;
        --kbd-background-color: #4d4c4c;
        --kbd-background-image: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0) 80%, rgba(0, 0, 0, 0));
        --kbd-background-repeat: no-repeat;
        --kbd-box-shadow: 0px 1px 0 #000000, 0 2px 1px rgba(90, 90, 90, 0.5), inset 0 1px 1px #aaaaaa, inset 0 -1px 2px #272727;
    }
}

html {
    padding: 0;
    margin: 0;
    background-color: var(--background-color);
}

body {
    background-color: var(--background-color);
    padding: 0;
    margin: 0;
    font-family: 'Space Grotesk', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, Noto Sans, sans-serif;
}

a:link,
a:visited,
a:active {
    color: var(--link-color);
    text-decoration: none;
    line-break: anywhere;
}

a:hover {
    text-decoration: underline;
    text-underline-offset: .2rem;
}

code {
    white-space: pre;
    white-space: pre-wrap;
    word-break: break-all;
    word-wrap: break-word;
    text-align: left;
}

code {
    background-color: var(--code-background-color);
    padding: 0 2px 0 2px;
    border-radius: 3px;
}

code,
pre,
samp,
tt {
    font-family: var(--monospace);
}

pre {
    border: 1px solid var(--border-color);
    background-color: var(--code-background-color);
    border-radius: 3px;
    padding: 10px;
    font-size: 0.9em;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02),
        0 2px 4px rgba(0, 0, 0, 0.02),
        0 4px 8px rgba(0, 0, 0, 0.02),
        0 8px 16px rgba(0, 0, 0, 0.02);
}

pre {
    display: block;
    break-inside: avoid;
    text-align: left;
}

h1 {
    color: var(--foreground-color);
    font-size: var(--h1-font-size);
    margin: 0 0 20px 0;
    line-height: var(--title-line-height);
}

h2 {
    margin-top: 40px;
    margin-bottom: 20px;
}

.chevron {
    font-size: 1.1em;
    color: var(--chevron-color);
    font-family: "Lucida Grande";
    font-weight: 500;
}

.content img {
    display: block;
    margin: 40px auto 40px auto;
    max-width: 100%;
}

hr {
    border: none;
    height: 2px;
    color: var(--border-color);
    background-color: var(--border-color);
    margin-top: 2rem;
    margin-bottom: 2rem;
}

.date {
    font-size: 0.8em;
    color: var(--foreground-secondary-color);
}


.main {
    padding: 20px;
    color: var(--foreground-color);
}

.content {
    margin: 20px 0;
    line-height: 1.75rem;
    font-size: 1em;
    color: var(--foreground-color);
}

/* START: table */

.content table {
    table-layout: auto;
    width: 100%;
    padding: 0;
    border-collapse: collapse;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02),
        0 2px 4px rgba(0, 0, 0, 0.02),
        0 4px 8px rgba(0, 0, 0, 0.02),
        0 8px 16px rgba(0, 0, 0, 0.02);
}

.content table tr {
    border-top: 1px solid var(--border-color);
    background-color: var(--background-color);
    margin: 0;
    padding: 0;
}

.content table tr:nth-child(2n) {
    background-color: var(--code-background-color);
}

.content table tr th {
    font-weight: bold;
    border: 1px solid var(--border-color);
    margin: 0;
    padding: 6px 12px;
    background-color: var(--code-background-color);
}

.content table tr td {
    border: 1px solid var(--border-color);
    margin: 0;
    padding: 6px 12px;
}

.content table tr th :first-child,
.content table tr td :first-child {
    margin-top: 0;
}

.content table tr th :last-child,
.content table tr td :last-child {
    margin-bottom: 0;
}

/* END: table */

.site-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--inner-gap);
    font-size: 1em;
    line-height: var(--title-line-height);
    color: var(--foreground-color);
}

.site-title {
    font-size: var(--site-title-font-size);
    line-height: var(--title-line-height);
    font-weight: 600;
    color: var(--foreground-color);
}

.site-about {
    font-size: 1.2em;
    line-height: var(--title-line-height);
    color: var(--foreground-color);
}

.site-about p:first-child {
    margin-top: 0px;
}

.site-about p:last-child {
    margin-bottom: 0px;
}

/* Blog tag filter */
.blog-tag-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
}

.blog-tag-btn {
    padding: 8px 14px;
    border: 1px solid var(--border-color);
    background: var(--nav-item-background-color);
    color: var(--foreground-color);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    font-family: inherit;
    transition: all 0.2s;
}

.blog-tag-btn:hover {
    background: var(--nav-item-hover-background-color);
    border-color: var(--link-color);
}

.blog-tag-btn.active {
    background: var(--nav-current-background-color);
    color: var(--nav-current-foreground-color);
    border-color: var(--nav-current-background-color);
}

/* Blog grid tiles */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 24px;
}

.blog-card {
    display: flex;
    flex-direction: column;
    border-radius: 12px;
    overflow: hidden;
    background: var(--nav-item-background-color);
    border: 1px solid var(--border-color);
    transition: all 0.2s;
}

.blog-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.blog-card-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.blog-card-link:hover {
    text-decoration: none;
}

.blog-card-image {
    width: 100%;
    aspect-ratio: 16/9;
    overflow: hidden;
    position: relative;
    background: var(--code-background-color);
}

.blog-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.blog-card-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    padding: 6px 10px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.blog-card-badge img {
    filter: invert(100%);
}

.blog-card-content {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.blog-card-date {
    font-size: 0.75rem;
    color: var(--foreground-secondary-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.blog-card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    line-height: 1.4;
    color: var(--foreground-color);
    word-break: keep-all;
    overflow-wrap: anywhere;
}

.blog-card-summary {
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--foreground-secondary-color);
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: auto;
    padding-top: 8px;
}

.blog-card-tag {
    font-size: 0.75rem;
    padding: 4px 8px;
    background: var(--code-background-color);
    border-radius: 4px;
    color: var(--foreground-secondary-color);
}

/* Legacy items (fallback) */
.items {
    max-width: var(--content-max-width);
    margin-left: auto;
    margin-right: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.item {
    display: flex;
    flex-direction: row;
    gap: 20px;
    margin-bottom: var(--item-gap);
    align-items: top;
}

.item-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.item-hero-image {}

.item-hero-image img {
    max-height: 60px;
    border-radius: 2px;
    aspect-ratio: 3/2;
    object-fit: cover;
    image-rendering: optimizeQuality;
    border: 0px;
}

.item-title {
    font-size: 1.25em;
    font-weight: 500;
    line-height: var(--title-line-height);
    text-align: left;
}

.item-info {
    display: flex;
    gap: 10px;
    align-items: center;
}

.item-date {
    font-size: 0.8em;
    color: var(--foreground-secondary-color);
    text-align: left;
    display: inline-block;
}

.item-video-icon,
.item-audio-icon {
    width: 1em;
    height: 1em;
    filter: var(--icon-secondary-filter);
}

.social-icon {
    width: 1em;
    height: 1em;
    vertical-align: bottom;
    filter: var(--icon-social-filter);
}

kbd {
    font-size: 12px;
    color: var(--kbd-color);
    font-family: "Lucida Grande", Lucida, Verdana, sans-serif;
    font-weight: normal;
    font-style: normal;
    text-align: center;
    line-height: 1em;
    text-shadow: 0 1px 0 var(--kbd-text-shadow);
    display: inline;
    padding: .3em .55em;
    border-radius: 6px;
    background-clip: padding-box;
    border: 1px solid var(--kbd-border-color);
    background-color: var(--kbd-background-color);
    background-image: var(--kbd-background-image);
    background-repeat: var(--kbd-background-repeat);
    box-shadow: var(--kbd-box-shadow);
}

.video-container {
    width: 100%;
    padding-top: 56.25%;
    height: 0px;
    position: relative;
    border-radius: 2px;
    margin-bottom: 20px;
    margin-left: auto;
    margin-right: auto;
}

.video {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    border-radius: 2px;
    z-index: 1;
}

.audio-container {
    margin-bottom: 20px;
    margin-left: auto;
    margin-right: auto;
    max-width: var(--content-max-width);
}

.audio {
    width: 100%;
}

.top {
    max-width: var(--content-max-width);
    margin-left: auto;
    margin-right: auto;
    align-items: center;
    display: flex;
    gap: var(--inner-gap);
    margin-bottom: 40px;
}

.kitze-enabled .top {
    display: none;
}

img.avatar {
    width: 72px;
    height: 72px;
    border-radius: 72px;
    filter: drop-shadow(0px 2px 5px rgba(0, 0, 0, 0.1));
    padding: 10px;
}

.pages-container {
    display: flex;
    align-items: center;
    margin-top: 20px;
    margin-bottom: 20px;
}

.pages-info {
    flex: 1;
    text-align: center;
    vertical-align: middle;
    color: var(--foreground-secondary-color);
    font-weight: 500;
    font-size: 12px;
}

.nav-container {
    text-align: left;
    max-width: var(--content-max-width);
    margin-left: auto;
    margin-right: auto;
}

.kitze-enabled .nav-container {
    display: none;
}
/* Kitze layout */
.layout {
    width: 100%;
    min-height: 100vh;
    display: grid;
    grid-template-columns: var(--sidebar-width) 400px 1fr;
    gap: 0;
}

.kitze-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 20px;
    z-index: 100;
    background: #f9fafb;
    border-right: 1px solid var(--border-color);
}

:root[data-theme="dark"] .kitze-sidebar {
    background: transparent;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) .kitze-sidebar {
        background: transparent;
    }
}

.kitze-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.kitze-nav-item {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s;
    cursor: pointer;
    color: var(--foreground-secondary-color);
    background: transparent;
    position: relative;
}

.kitze-nav-item:hover {
    background: var(--nav-item-hover-background-color);
    color: var(--foreground-color);
    text-decoration: none;
}

.kitze-nav-item.is-active {
    background: var(--foreground-color);
    color: var(--background-color);
}

/* Light theme: active icon should be white (invert the dark icon) */
.theme-light .kitze-nav-item.is-active .kitze-nav-icon {
    filter: brightness(0) invert(1);
}

/* Dark theme: active icon should be black (no invert, just darken) */
.theme-dark .kitze-nav-item.is-active .kitze-nav-icon {
    filter: brightness(0);
}

/* Auto theme: follow system preference */
@media (prefers-color-scheme: light) {
    .theme-auto .kitze-nav-item.is-active .kitze-nav-icon {
        filter: brightness(0) invert(1);
    }
}

@media (prefers-color-scheme: dark) {
    .theme-auto .kitze-nav-item.is-active .kitze-nav-icon {
        filter: brightness(0);
    }
}

.kitze-nav-icon {
    width: 20px;
    height: 20px;
    filter: var(--nav-icon-filter);
}

.kitze-nav-avatar {
    border-radius: 50%;
    filter: none;
}

.kitze-nav-label {
    display: none;
}

.kitze-nav-user {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: transparent;
    color: var(--foreground-secondary-color);
    position: relative;
}

.kitze-nav-separator {
    height: 1px;
    background: var(--border-color);
    margin: 8px 0;
}

.kitze-nav-theme {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    cursor: pointer;
    border: none;
    background: transparent;
    color: var(--foreground-secondary-color);
    transition: all 0.2s;
}

.kitze-nav-theme:hover {
    background: var(--nav-item-hover-background-color);
    color: var(--foreground-color);
}

/* Mobile top bar */
.mobile-bar {
    display: none;
    align-items: center;
    justify-content: flex-end;
    margin-bottom: 10px;
}

.kitze-menu {
    font-size: 1.25rem;
    padding: 6px 10px;
    border-radius: 10px;
    background: var(--nav-item-background-color);
    color: var(--nav-item-foreground-color);
    border: 1px solid var(--border-color);
}

/* Bottom sheet */
.kitze-overlay[hidden] { display: none; }
.kitze-overlay {
    position: fixed;
    inset: 0;
    backdrop-filter: blur(var(--overlay-blur));
    -webkit-backdrop-filter: blur(var(--overlay-blur));
    background: var(--overlay-bg);
    z-index: 1000;
}

.kitze-sheet[hidden] { display: none; }
.kitze-sheet {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    max-height: 80vh;
    background: var(--background-color);
    border-top-left-radius: var(--sheet-radius);
    border-top-right-radius: var(--sheet-radius);
    box-shadow: 0 -10px 30px rgba(0,0,0,.25);
    z-index: 1001;
    transform: translateY(100%);
    animation: kitze-slide-up .25s ease-out forwards;
    padding: 16px;
}

.kitze-sheet-handle {
    width: 64px;
    height: 6px;
    border-radius: 6px;
    background: var(--border-color);
    margin: 0 auto 12px auto;
}

@keyframes kitze-slide-up {
    from { transform: translateY(100%); }
    to { transform: translateY(0%); }
}

.kitze-sheet-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.kitze-sheet-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 14px 8px;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    background: var(--nav-item-background-color);
    color: var(--nav-item-foreground-color);
    text-decoration: none;
    position: relative;
}

.kitze-sheet-item:hover { background: var(--nav-item-hover-background-color); }

.kitze-sheet-icon { width: 28px; height: 28px; filter: var(--nav-icon-filter); }

.kitze-sheet-avatar {
    border-radius: 50%;
    filter: none;
}
.kitze-sheet-label { font-size: .95rem; text-align: center; }

.kitze-sheet-user {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 14px 8px;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    background: var(--nav-item-background-color);
    color: var(--nav-item-foreground-color);
}

.kitze-sheet-separator {
    width: 100%;
    height: 1px;
    background: var(--border-color);
    grid-column: 1 / -1;
}

.kitze-sheet-theme {
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 14px 8px;
    cursor: pointer;
    font-family: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--nav-item-foreground-color);
    position: relative;
}

.kitze-sheet-theme:hover {
    background: var(--nav-item-hover-background-color);
}

.kitze-sheet-theme::after {
    content: attr(title);
    position: absolute;
    left: 50%;
    top: 100%;
    transform: translateX(-50%) translateY(8px);
    background: var(--foreground-color);
    color: var(--background-color);
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 1000;
    margin-top: 8px;
}

.kitze-sheet-theme:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.kitze-sheet-item::after,
.kitze-sheet-user::after {
    content: attr(title);
    position: absolute;
    left: 50%;
    top: 100%;
    transform: translateX(-50%) translateY(8px);
    background: var(--foreground-color);
    color: var(--background-color);
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 1000;
    margin-top: 8px;
}

.kitze-sheet-item:hover::after,
.kitze-sheet-user:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.kitze-sheet-open { overflow: hidden; }

/* Sidebar tooltips */
.kitze-nav-item::after,
.kitze-nav-user::after,
.kitze-nav-theme::after {
    content: attr(title);
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%) translateX(8px);
    background: var(--foreground-color);
    color: var(--background-color);
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s, transform 0.2s;
    margin-left: 8px;
    z-index: 2000;
}

.kitze-nav-item:hover::after,
.kitze-nav-user:hover::after,
.kitze-nav-theme:hover::after {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

/* Midbar */
.kitze-midbar {
    position: sticky;
    top: 20px;
    height: fit-content;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    padding: 20px;
    z-index: 10;
    border-right: 1px solid var(--border-color);
}

.kitze-midbar-header {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.kitze-midbar-avatar {
    display: flex;
}

.kitze-midbar-avatar-img {
    width: 64px;
    height: 64px;
    border-radius: 50%;
}

.kitze-midbar-name {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

.kitze-midbar-about {
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--foreground-secondary-color);
}

.kitze-midbar-about p {
    margin: 0;
    max-width: 100%;
}

.kitze-midbar-social {
    display: flex;
    gap: 12px;
}

.kitze-midbar-social-link img {
    width: 18px;
    height: 18px;
    filter: var(--nav-icon-filter);
}

.kitze-midbar-stats {
    display: flex;
    gap: 20px;
    padding-top: 12px;
}

.kitze-midbar-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--nav-item-background-color);
    padding: 12px 16px;
    border-radius: 8px;
    flex: 1;
    text-decoration: none;
    transition: background 0.2s;
}

.kitze-midbar-stat:hover {
    background: var(--nav-item-hover-background-color);
    text-decoration: none;
}

.kitze-midbar-stat-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--foreground-color);
}

.kitze-midbar-stat-label {
    font-size: 0.75rem;
    color: var(--foreground-secondary-color);
    text-transform: capitalize;
}

.kitze-midbar-section {
    padding: 20px 0;
    border-bottom: 1px solid var(--border-color);
}

.kitze-midbar-title {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: var(--foreground-secondary-color);
    margin: 0 0 16px 0;
}

.kitze-midbar-upcoming-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.kitze-midbar-upcoming-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    background: var(--nav-item-background-color);
    border-radius: 8px;
    text-decoration: none;
    color: var(--foreground-color);
    transition: background 0.2s;
}

.kitze-midbar-upcoming-item:hover {
    background: var(--nav-item-hover-background-color);
    text-decoration: none;
}

.kitze-midbar-upcoming-date {
    font-size: 0.65rem;
    font-weight: 600;
    text-align: center;
    min-width: 42px;
}

.kitze-midbar-upcoming-info {
    flex: 1;
}

.kitze-midbar-upcoming-title {
    font-weight: 500;
    font-size: 0.9rem;
    margin-bottom: 2px;
}

.kitze-midbar-upcoming-location {
    font-size: 0.75rem;
    color: var(--foreground-secondary-color);
}

.kitze-midbar-projects-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.kitze-midbar-project-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border-radius: 6px;
    text-decoration: none;
    color: var(--foreground-color);
    transition: background 0.2s;
}

.kitze-midbar-project-item:hover {
    background: var(--nav-item-hover-background-color);
    text-decoration: none;
}

.kitze-midbar-project-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.kitze-midbar-project-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}

.kitze-midbar-project-title {
    font-size: 0.9rem;
    font-weight: 500;
}

.kitze-midbar-project-desc {
    font-size: 0.75rem;
    color: var(--foreground-secondary-color);
    line-height: 1.3;
}

.kitze-midbar-ctas {
    display: flex;
    gap: 12px;
    padding: 20px 0;
}

.kitze-midbar-cta {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.kitze-midbar-cta-primary {
    background: var(--nav-current-background-color);
    color: var(--nav-current-foreground-color);
}

.kitze-midbar-cta-primary:hover {
    opacity: 0.9;
    text-decoration: none;
}

.kitze-midbar-cta-secondary {
    background: var(--nav-item-background-color);
    color: var(--foreground-color);
    border: 1px solid var(--border-color);
}

.kitze-midbar-cta-secondary:hover {
    background: var(--nav-item-hover-background-color);
    text-decoration: none;
}

/* Video gallery */
.video-category-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
}

.video-cat-btn {
    padding: 8px 14px;
    border: 1px solid var(--border-color);
    background: var(--nav-item-background-color);
    color: var(--foreground-color);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    font-family: inherit;
    transition: all 0.2s;
}

.video-cat-btn:hover {
    background: var(--nav-item-hover-background-color);
    border-color: var(--link-color);
}

.video-cat-btn.active {
    background: var(--nav-current-background-color);
    color: var(--nav-current-foreground-color);
    border-color: var(--nav-current-background-color);
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 24px;
}

.video-card {
    display: block;
    border-radius: 12px;
    overflow: hidden;
    background: var(--nav-item-background-color);
    border: 1px solid var(--border-color);
    transition: all 0.2s;
    text-decoration: none;
    color: inherit;
}

.video-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    text-decoration: none;
}

.video-card-thumbnail {
    width: 100%;
    aspect-ratio: 16/9;
    position: relative;
    background: var(--code-background-color);
}

.video-card-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.video-card-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.2s;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
}

.video-card:hover .video-card-play {
    opacity: 1;
}

.video-card-content {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.video-card-title {
    font-size: 0.95rem;
    font-weight: 500;
    margin: 0;
    line-height: 1.4;
    color: var(--foreground-color);
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: keep-all;
    overflow-wrap: anywhere;
}

.video-card-date {
    font-size: 0.75rem;
    color: var(--foreground-secondary-color);
}

.video-card-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}

.video-card-cat {
    font-size: 0.7rem;
    padding: 3px 8px;
    background: var(--code-background-color);
    border-radius: 4px;
    color: var(--foreground-secondary-color);
}

.video-loading {
    text-align: center;
    padding: 40px;
    color: var(--foreground-secondary-color);
}

/* Project card view */
.project-section {
    margin-bottom: 48px;
}

.project-section-icon {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.project-section-icon svg {
    width: 24px;
    height: 24px;
    color: var(--foreground-secondary-color);
}

.project-section-icon h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

.project-grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.project-grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.project-card {
    display: block;
    padding: 20px;
    border-radius: 12px;
    border: 2px solid var(--border-color);
    background: var(--background-color);
    transition: all 0.2s;
    text-decoration: none;
    color: inherit;
}

.project-card:hover {
    border-color: var(--foreground-secondary-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    text-decoration: none;
}

.project-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 16px;
}

.project-card-icon {
    padding: 8px;
    border-radius: 8px;
    background: var(--nav-item-background-color);
    display: flex;
    align-items: center;
    justify-content: center;
}

.project-card-icon svg {
    width: 24px;
    height: 24px;
    color: var(--foreground-secondary-color);
}

.project-card-icon-sm {
    padding: 6px;
    border-radius: 6px;
}

.project-card-icon-sm svg {
    width: 18px;
    height: 18px;
}

.project-card-status {
    font-size: 0.65rem;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 12px;
    white-space: nowrap;
}

.project-status-shipped {
    background: rgba(16, 185, 129, 0.1);
    color: rgb(16, 185, 129);
}

:root[data-theme="dark"] .project-status-shipped {
    background: rgba(16, 185, 129, 0.2);
    color: rgb(167, 243, 208);
}

.project-status-beta {
    background: rgba(59, 130, 246, 0.1);
    color: rgb(59, 130, 246);
}

.project-status-soon {
    background: rgba(245, 158, 11, 0.1);
    color: rgb(245, 158, 11);
}

.project-status-progress {
    background: rgba(234, 179, 8, 0.1);
    color: rgb(234, 179, 8);
}

.project-status-paused {
    background: rgba(239, 68, 68, 0.1);
    color: rgb(239, 68, 68);
}

.project-status-deprecated {
    background: var(--nav-item-background-color);
    color: var(--foreground-secondary-color);
}

.project-card-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 4px;
}

.project-card-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
    color: var(--foreground-color);
}

.project-card-title-sm {
    font-size: 0.95rem;
    font-family: var(--monospace);
}

.project-card-arrow {
    width: 16px;
    height: 16px;
    color: var(--foreground-secondary-color);
    transition: transform 0.2s, color 0.2s;
}

.project-card:hover .project-card-arrow {
    color: var(--foreground-color);
    transform: translateX(2px);
}

.project-card-desc {
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--foreground-secondary-color);
    margin: 0;
}

.project-card-desc-sm {
    font-size: 0.75rem;
}

.project-subsection {
    margin-bottom: 32px;
}

.project-subsection-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0 0 4px 0;
    color: var(--foreground-color);
}

.project-subsection-desc {
    font-size: 0.875rem;
    color: var(--foreground-secondary-color);
    margin: 0 0 16px 0;
}

.project-cta-section {
    padding: 24px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.05) 0%, rgba(99, 102, 241, 0.05) 100%);
    border: 2px solid var(--border-color);
    text-align: center;
    margin-top: 48px;
}

.project-cta-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 0 12px 0;
    color: var(--foreground-color);
}

.project-cta-desc {
    font-size: 0.875rem;
    color: var(--foreground-secondary-color);
    margin: 0 0 16px 0;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.project-cta-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}

.project-cta-primary {
    padding: 10px 20px;
    font-size: 0.875rem;
    border-radius: 8px;
    background: var(--nav-current-background-color);
    color: var(--nav-current-foreground-color);
    font-weight: 600;
    transition: opacity 0.2s;
    text-decoration: none;
    display: inline-block;
}

.project-cta-primary:hover {
    opacity: 0.9;
    text-decoration: none;
}

.project-cta-secondary {
    padding: 10px 20px;
    font-size: 0.875rem;
    border-radius: 8px;
    background: var(--background-color);
    color: var(--foreground-color);
    border: 2px solid var(--border-color);
    font-weight: 600;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
}

.project-cta-secondary:hover {
    background: var(--nav-item-hover-background-color);
    text-decoration: none;
}

/* Responsive: collapse sidebar */
@media screen and (max-width: 1200px) {
    .layout { grid-template-columns: var(--sidebar-width) 1fr; }
    .kitze-midbar { display: none; }
}

@media screen and (max-width: 900px) {
    .layout { grid-template-columns: 1fr; }
    .kitze-sidebar { display: none !important; }
    .kitze-midbar { display: none; }
    .mobile-bar { display: flex; }
}

.nav {
    display: inline-flex;
    gap: 12px;
    padding: 2px;
    box-sizing: border-box;
    margin: 0px auto 40px auto;
    align-items: center;
    flex-wrap: wrap;
}

.nav-current:link,
.nav-current:visited {
    background-color: var(--nav-current-background-color);
    color: var(--nav-current-foreground-color);
    border-radius: 2em;
    font-size: 1em;
    line-height: 1;
    display: inline-block;
    padding: 5px 10px 5px 10px;
    transition: background-color 0.15s;
}

.nav-current:hover {
    text-decoration: none;
    background-color: var(--nav-current-background-color);
}

.nav-item:link,
.nav-item:visited {
    background-color: var(--nav-item-background-color);
    color: var(--nav-item-foreground-color);
    border-radius: 2em;
    font-size: 1em;
    line-height: 1;
    display: inline-block;
    padding: 5px 10px 5px 10px;
    transition: background-color 0.15s;
}

.nav-item:hover {
    background-color: var(--nav-item-hover-background-color);
    text-decoration: none;
}

p,
h1,
h2,
h3,
h4,
h5,
h6,
.date,
ul,
ol,
pre,
hr {
    max-width: var(--content-max-width);
    margin-left: auto;
    margin-right: auto;
}

ul {
    padding-inline-start: 1em;
}

ol {
    padding-inline-start: 1.25em;
}

.site-about p {
    max-width: 100%;
    margin-left: 0px;
    margin-right: 0px;
}

/* START: To Do Items */

ul:has(input[type="checkbox"]) {
    padding-inline-start: 0px;
}

li input[type="checkbox"] {
    display: none;
}

li:has(input[type="checkbox"]) {
    list-style-type: none;
    margin-left: 0px;
    pointer-events: none;
}

li:has(input[type="checkbox"]:not(:checked):disabled)::before {
    background-image: url("./circle.svg");
    background-repeat: no-repeat;
    content: '';
    display: inline-block;
    vertical-align: text-top;
    width: 1.25em;
    height: 1em;
    background-size: 1em 1em;
    filter: var(--icon-social-filter);
    pointer-events: all;
}

li:has(input[type="checkbox"]:checked:disabled)::before {
    background-image: url("./checkmark.circle.fill.svg");
    background-repeat: no-repeat;
    content: '';
    display: inline-block;
    vertical-align: text-top;
    width: 1.25em;
    height: 1em;
    background-size: 1em 1em;
    pointer-events: all;
}

/* END: To Do Items */

figure {
    margin-top: 20px;
    margin-bottom: 20px;
    margin-inline-start: 0px;
    margin-inline-end: 0px;
}

figure>img:first-child {
    margin: 40px 0px 20px 0px;
}

figcaption {
    font-size: 0.8em;
    color: var(--foreground-secondary-color);
    text-align: center;
}

blockquote {
    display: block;
    margin-block-start: 1em;
    margin-block-end: 1em;
    margin-inline-start: 40px;
    margin-inline-end: 40px;
}

blockquote {
    font-style: italic;
    border-left: 5px solid;
    margin-left: 2em;
    padding-left: 1em;
    border-color: var(--border-color);
    color: var(--foreground-secondary-color);
}

/* START: tag */

.tag-container {
    margin: 0px auto 40px auto;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1em;
    display: flex;
    flex-direction: column;
    gap: 0.5em;
}

.tag-caption {
    font-size: 0.8em;
    display: flex;
    gap: 0.5em;
    align-items: center;
}

.tag-title {
    font-size: 2em;
    font-weight: 500;
}

.tag-count {
    font-size: 0.8em;
    color: var(--foreground-secondary-color);
}

.tags-container {
    font-size: 0.8em;
    display: flex;
    flex-wrap: wrap;
    gap: 1em;
    color: var(--foreground-secondary-color);
    align-items: center;
}

.tags {
    flex: 1;
    display: flex;
    gap: 0.5em;
    flex-wrap: wrap;
}

.tag-cloud {
    column-count: 3;
    column-rule: 1px solid var(--border-color);
    column-gap: 20px;
    line-height: 2;
}

.tag-cloud-item {
    display: block;
    font-size: 1em;
}

.tag-cloud-item-count {
    display: inline-block;
    background-color: var(--border-color);
    font-size: 0.75em;
    color: var(--background-color);
    padding: 1px 4px 1px 4px;
    border-radius: 20px;
    line-height: 1;
    vertical-align: middle;
    margin-left: 0.5em;
}

.tag-item {
    display: inline-block;
    padding: 0.2em 0.5em 0.2em 0.5em;
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

.tag-item:hover {
    text-decoration: none;
    border-color: var(--link-color);
    box-shadow: 0px 1px 2px var(--border-color);
}

/* END: tag */

/* START: archive */

.archive-container {
    margin: 0px auto 40px auto;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1em;
    display: flex;
    flex-direction: column;
    gap: 0.5em;
}

.archive-title {
    font-size: 2em;
    font-weight: 500;
}

.archive-count {
    font-size: 0.8em;
    color: var(--foreground-secondary-color);
}

.archive-list {
    column-count: 3;
    column-rule: 1px solid var(--border-color);
    column-gap: 20px;
    line-height: 1.2;
}

.archive-list-item {
    display: block;
    font-size: 1em;
    display: flex;
    align-items: center;
    gap: 0.5em;
    margin-bottom: 10px;
}

.archive-list-header {
    display: block;
    font-size: 1.1em;
    font-weight: 500;
    margin-bottom: 10px;
    margin-top: 20px;
    color: var(--foreground-secondary-color);
}

.archive-list-header:first-child {
    margin-top: 0px;
}

.archive-list-item a {
    line-break: initial;
}

/* END: archive */

footer {
    font-size: 0.9em;
    color: var(--foreground-secondary-color);
    width: 100%;
}

.footer-inner {
    width: 100%;
    max-width: var(--content-max-width);
    margin-left: auto;
    margin-right: auto;
}

@media screen and (max-width: 768px) {
    :root {
        --item-gap: 15px;
        --inner-gap: 10px;
        --site-title-font-size: 2em;
        --h1-font-size: 1.75em;
    }

    .tag-cloud,
    .archive-list {
        column-count: 2;
    }
    
    .blog-grid,
    .video-grid {
        grid-template-columns: 1fr;
    }
    
    .project-grid-2,
    .project-grid-3 {
        grid-template-columns: 1fr;
    }
}

@media screen and (max-width: 420px) {
    .archive-list {
        column-count: 1;
    }

    .content table {
        table-layout: fixed;
    }

    .content table td {
        line-break: anywhere;
    }
}
