:root {
    --ink: #050505;
    --paper: #f7f7f7;
    --panel: #ffffff;
    --line: #000000;
    --shadow: #2b2b2b;
    --desktop-pattern:
        linear-gradient(45deg, rgba(0, 0, 0, 0.14) 25%, transparent 25%),
        linear-gradient(-45deg, rgba(0, 0, 0, 0.14) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, rgba(0, 0, 0, 0.14) 75%),
        linear-gradient(-45deg, transparent 75%, rgba(0, 0, 0, 0.14) 75%);
    --cursor-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='22' viewBox='0 0 18 22'%3E%3Cpath d='M1 1L1 18L5 14L8 21L11 20L8 13L14 13Z' fill='white' stroke='black' stroke-width='2'/%3E%3C/svg%3E") 1 1, default;
    --cursor-watch: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='22' viewBox='0 0 18 22'%3E%3Crect x='6' y='1' width='6' height='3' fill='white' stroke='black' stroke-width='2'/%3E%3Crect x='6' y='18' width='6' height='3' fill='white' stroke='black' stroke-width='2'/%3E%3Ccircle cx='9' cy='11' r='6' fill='white' stroke='black' stroke-width='2'/%3E%3Cpath d='M9 11L9 7M9 11L12 13' stroke='black' stroke-width='2' stroke-linecap='square'/%3E%3C/svg%3E") 9 11, wait;
    font-family: Geneva, Tahoma, "Trebuchet MS", sans-serif;
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

html,
body {
    margin: 0;
    min-height: 100%;
    background: #000000;
    color: var(--ink);
}

body {
    overflow: hidden;
    cursor: var(--cursor-arrow);
}

button,
a {
    font: inherit;
    cursor: var(--cursor-arrow);
}

.site-shell {
    position: relative;
    width: 100vw;
    height: 100vh;
    padding: 8px;
    background: #000000;
}

.menu-bar {
    position: relative;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 12px;
    height: 28px;
    padding: 0 10px;
    background: var(--panel);
    border: 2px solid var(--line);
    border-bottom-width: 1px;
    border-radius: 8px 8px 0 0;
}

.menu-cluster {
    display: flex;
    align-items: center;
    gap: 1px;
}

.menu-root {
    position: relative;
}

.menu-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 20px;
    padding: 0 7px;
    border: 1px solid transparent;
    background: transparent;
    font-size: 15px;
    font-weight: 700;
}

.menu-root.is-open .menu-button,
.menu-button:hover,
.menu-button:focus-visible {
    color: var(--panel);
    background: var(--ink);
    border-color: var(--line);
    outline: none;
}

.menu-logo {
    width: 18px;
    height: 18px;
    padding: 0;
}

.menu-logo img {
    display: block;
    width: 18px;
    height: 18px;
}

.menu-root.is-open .menu-logo img {
    filter: invert(1);
}

.menu-dropdown {
    position: absolute;
    top: calc(100% - 1px);
    left: -6px;
    z-index: 40;
    display: grid;
    min-width: 172px;
    padding: 6px 0;
    border: 2px solid var(--line);
    background: var(--panel);
    box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.22);
}

.menu-dropdown-item {
    display: flex;
    align-items: center;
    min-height: 24px;
    padding: 1px 14px;
    border: 0;
    background: transparent;
    text-align: left;
    font-size: 14px;
    white-space: nowrap;
}

.menu-dropdown-item:hover,
.menu-dropdown-item:focus-visible {
    color: var(--panel);
    background: var(--ink);
    outline: none;
}

.menu-dropdown-separator {
    margin: 6px 0;
    border-top: 1px solid var(--line);
}

.menu-clock {
    margin-left: auto;
    min-width: 96px;
    text-align: right;
    font-size: 12px;
    font-weight: 700;
}

.desktop {
    position: relative;
    height: calc(100vh - 44px);
    border: 2px solid var(--line);
    border-top-width: 0;
    border-radius: 0 0 10px 10px;
    overflow: hidden;
    background-color: #d9d9d9;
    background-image: var(--desktop-pattern);
    background-size: 4px 4px;
    background-position: 0 0, 0 2px, 2px -2px, -2px 0;
}

.desktop::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.08), transparent 120px);
    pointer-events: none;
}

.desktop-shortcuts {
    position: absolute;
    top: 18px;
    right: 14px;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 86px;
}

.desktop-icon,
.window-icon,
.social-link {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    text-decoration: none;
}

.icon-label {
    display: inline-block;
    max-width: 100%;
    padding: 1px 4px;
    text-align: center;
    font-size: 12px;
    line-height: 1.15;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid transparent;
}

.desktop-icon:hover .icon-label,
.window-icon:hover .icon-label,
.social-link:hover .icon-label,
.desktop-icon:focus-visible .icon-label,
.window-icon:focus-visible .icon-label,
.social-link:focus-visible .icon-label {
    color: var(--panel);
    background: var(--ink);
    border-color: var(--line);
}

.icon-art {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 36px;
}

.icon-img-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
}

.icon-img-wrap svg {
    display: block;
    width: 48px;
    height: 48px;
    shape-rendering: crispEdges;
}

.icon-folder {
    width: 34px;
    height: 24px;
    margin-top: 9px;
    background: var(--paper);
    border: 2px solid var(--line);
}

.icon-folder::before {
    content: "";
    position: absolute;
    top: -8px;
    left: 2px;
    width: 14px;
    height: 8px;
    background: var(--paper);
    border: 2px solid var(--line);
    border-bottom: 0;
}

.icon-note {
    width: 30px;
    height: 34px;
    background: var(--paper);
    border: 2px solid var(--line);
}

.icon-note::before {
    content: "";
    position: absolute;
    top: -2px;
    right: -2px;
    width: 10px;
    height: 10px;
    background: linear-gradient(135deg, #dadada 0 50%, var(--panel) 50% 100%);
    border-left: 2px solid var(--line);
    border-bottom: 2px solid var(--line);
}

.icon-note::after {
    content: "";
    position: absolute;
    left: 4px;
    right: 4px;
    top: 9px;
    height: 18px;
    background: repeating-linear-gradient(to bottom, transparent 0 2px, var(--line) 2px 3px, transparent 3px 6px);
}

.icon-photo {
    background: var(--paper);
    border: 2px solid var(--line);
}

.icon-photo::before {
    content: "";
    position: absolute;
    inset: 6px;
    border: 2px solid var(--line);
    background:
        linear-gradient(to top right, transparent 49%, var(--line) 49% 53%, transparent 53% 100%),
        linear-gradient(to top left, transparent 42%, var(--line) 42% 46%, transparent 46% 100%);
}

.icon-photo::after {
    content: "";
    position: absolute;
    left: 10px;
    top: 10px;
    width: 6px;
    height: 6px;
    background: var(--line);
    border-radius: 50%;
}

.icon-social {
    background:
        radial-gradient(circle at 8px 26px, var(--paper) 0 4px, var(--line) 4px 6px, transparent 6px),
        radial-gradient(circle at 28px 10px, var(--paper) 0 4px, var(--line) 4px 6px, transparent 6px),
        radial-gradient(circle at 28px 28px, var(--paper) 0 4px, var(--line) 4px 6px, transparent 6px);
}

.icon-social::before,
.icon-social::after {
    content: "";
    position: absolute;
    left: 10px;
    width: 18px;
    height: 2px;
    background: var(--line);
    transform-origin: left center;
}

.icon-social::before {
    top: 25px;
    transform: rotate(-28deg);
}

.icon-social::after {
    top: 11px;
    transform: rotate(28deg);
}

.icon-trash {
    width: 30px;
    height: 34px;
}

.icon-trash::before,
.icon-trash::after {
    content: "";
    position: absolute;
    border: 2px solid var(--line);
    background: var(--panel);
}

.icon-trash::before {
    top: 8px;
    left: 7px;
    right: 7px;
    bottom: 4px;
}

.icon-trash::after {
    top: 2px;
    left: 8px;
    right: 8px;
    height: 5px;
}

.window-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.system-window {
    position: absolute;
    display: flex;
    flex-direction: column;
    min-width: 260px;
    min-height: 140px;
    max-width: calc(100vw - 28px);
    max-height: calc(100vh - 76px);
    background: var(--panel);
    border: 2px solid var(--line);
    box-shadow: 3px 3px 0 var(--shadow);
    pointer-events: auto;
}

.window-header {
    display: grid;
    grid-template-columns: 16px 1fr 16px;
    align-items: center;
    gap: 10px;
    padding: 4px 8px;
    border-bottom: 2px solid var(--line);
    background: repeating-linear-gradient(to bottom, var(--line) 0 1px, var(--panel) 1px 2px);
}

.window-close,
.window-grow {
    width: 12px;
    height: 12px;
    padding: 0;
    border: 2px solid var(--line);
    background: var(--panel);
}

.window-title {
    justify-self: center;
    padding: 0 12px;
    font-size: 13px;
    font-weight: 700;
    background: var(--panel);
    border: 2px solid var(--line);
    white-space: nowrap;
}

.window-body {
    padding: 14px 14px 24px;
    overflow: auto;
    background: var(--panel);
}

.window-resize {
    position: absolute;
    right: 2px;
    bottom: 2px;
    width: 15px;
    height: 15px;
    padding: 0;
    border: 0;
    background:
        linear-gradient(135deg, transparent 0 45%, var(--line) 45% 52%, transparent 52% 100%),
        linear-gradient(135deg, transparent 0 62%, var(--line) 62% 68%, transparent 68% 100%),
        linear-gradient(135deg, transparent 0 79%, var(--line) 79% 85%, transparent 85% 100%);
}

.about-panel {
    display: grid;
    gap: 14px;
}

.about-header {
    display: grid;
    grid-template-columns: 48px 1fr;
    gap: 12px;
    align-items: center;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
}

.about-icon {
    display: block;
    width: 44px;
    height: 44px;
    border: 2px solid var(--line);
    background: var(--panel);
}

.about-header-copy h1 {
    margin: 0 0 4px;
    font-size: 20px;
}

.about-header-copy p {
    margin: 0;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.window-copy {
    font-size: 13px;
    line-height: 1.5;
}

.window-copy p:first-child,
.window-copy ul:first-child,
.window-copy ol:first-child {
    margin-top: 0;
}

.window-icon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(88px, 1fr));
    gap: 18px 14px;
}

.favorites-list {
    display: grid;
    gap: 12px;
}

.favorites-list h2 {
    margin: 0 0 6px;
    font-size: 14px;
}

.favorites-list ul,
.blog-meta {
    margin: 0;
    font-size: 13px;
}

.favorites-list ul {
    padding-left: 18px;
}

.favorites-list li + li {
    margin-top: 3px;
}

.blog-meta {
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
}

.window-copy h1,
.window-copy h2,
.window-copy h3,
.window-copy h4,
.window-copy h5,
.window-copy h6 {
    margin: 18px 0 10px;
    line-height: 1.2;
}

.window-copy h1 {
    font-size: 20px;
}

.window-copy h2 {
    font-size: 16px;
}

.window-copy h3 {
    font-size: 14px;
}

.window-copy p,
.window-copy ul,
.window-copy ol,
.window-copy blockquote,
.window-copy pre,
.window-copy hr {
    margin: 0 0 12px;
}

.window-copy ul,
.window-copy ol {
    padding-left: 20px;
}

.window-copy li + li {
    margin-top: 4px;
}

.window-copy blockquote {
    padding-left: 10px;
    border-left: 3px solid var(--line);
}

.window-copy pre {
    padding: 10px;
    overflow-x: auto;
    border: 2px solid var(--line);
    background: #efefef;
}

.window-copy hr {
    border: 0;
    border-top: 1px solid var(--line);
}

.window-copy code {
    font-family: "Courier New", Courier, monospace;
    font-size: 0.95em;
}

.window-copy :not(pre) > code {
    padding: 1px 4px;
    background: #ededed;
    border: 1px solid #c8c8c8;
}

.window-copy a {
    color: inherit;
    text-decoration: underline;
}

.post-image {
    display: block;
    margin: 8px 0 12px;
}

.post-image img,
.photo-preview img {
    display: block;
    width: 100%;
    max-width: 100%;
    border: 2px solid var(--line);
}

.photo-preview figcaption {
    margin-top: 8px;
    font-size: 12px;
}

.social-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(88px, 1fr));
    gap: 18px 10px;
}

.load-error,
.no-script-message {
    position: fixed;
    left: 12px;
    bottom: 12px;
    z-index: 40;
    max-width: 360px;
    padding: 10px 12px;
    border: 2px solid var(--line);
    background: var(--panel);
    font-size: 12px;
    line-height: 1.4;
}

@media (max-width: 720px) {
    body {
        overflow: auto;
    }

    .site-shell {
        height: auto;
        min-height: 100vh;
    }

    .menu-bar {
        gap: 8px;
    }

    .menu-cluster {
        flex-wrap: wrap;
    }

    .menu-button {
        font-size: 13px;
        padding: 0 6px;
    }

    .menu-dropdown {
        left: 0;
        min-width: 148px;
    }

    .desktop {
        min-height: calc(100vh - 44px);
        height: auto;
    }

    .desktop-shortcuts {
        position: relative;
        top: 0;
        right: 0;
        width: auto;
        padding: 16px;
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        align-items: start;
        justify-items: center;
    }

    .trash-icon {
        display: none;
    }

    .system-window {
        width: min(96vw, 520px) !important;
        left: 2vw !important;
        top: 58px !important;
        right: auto !important;
        max-height: 70vh;
    }
}

body.is-loading,
body.is-loading * {
    cursor: var(--cursor-watch) !important;
}
