:root {
    --desktop: #000000;
    --win-blue-left: #00007b;
    --win-blue-right: #0884ce;
    --win-black: #000000;
    --win-dark: #7b7b7b;
    --win-mid: #bdbdbd;
    --win-white: #ffffff;
    --win-panel: #d4d0c8;
    --win-text: #000000;
    --win-link: #1034a6;
    --win-shadow: rgba(0, 0, 0, 0.28);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body.projects-page {
    position: relative;
    margin: 0;
    min-height: 100vh;
    background: var(--desktop);
    color: var(--win-text);
    font-family: "MS Sans Serif", Tahoma, Geneva, sans-serif;
}

body.projects-page::before,
body.projects-page::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
}

body.projects-page::before {
    background: url("../media/bliss.jpg") center center / cover no-repeat;
    opacity: 0;
    z-index: -2;
}

body.projects-page::after {
    background: var(--desktop);
    z-index: -1;
    transform: translateY(0);
}

body.projects-page.desktop-ready::before {
    opacity: 1;
}

body.projects-page.desktop-ready::after {
    animation: wipe-down-irregular var(--desktop-wipe-duration, 4.8s) steps(var(--desktop-wipe-steps, 18), end) forwards;
}

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

a:hover {
    color: #0a246a;
}

.page-wrap {
    width: min(1380px, calc(100% - 28px));
    margin: 20px auto;
    position: relative;
}

.site-shell,
.terminal-shell,
.module,
.status-box,
.webring-box,
.counter-box,
.project-card {
    background: var(--win-mid);
    border-top: 2px solid var(--win-white);
    border-left: 2px solid var(--win-white);
    border-right: 2px solid var(--win-black);
    border-bottom: 2px solid var(--win-black);
    box-shadow:
        inset 1px 1px 0 #dfdfdf,
        inset -1px -1px 0 var(--win-dark);
}

.site-shell {
    overflow: hidden;
}

.win-icon {
    width: 16px;
    height: 16px;
    image-rendering: pixelated;
    flex: 0 0 auto;
}

.window-titlebar,
.terminal-bar,
.module-head,
.status-box .mini-heading,
.webring-box .mini-heading,
.counter-box .mini-heading {
    display: flex;
    align-items: center;
    min-height: 24px;
    padding: 4px 6px;
    background: linear-gradient(90deg, var(--win-blue-left), var(--win-blue-right));
    color: var(--win-white);
    font-size: 11px;
    font-weight: 700;
}

.window-title-left {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    line-height: 1;
}

.window-controls-win {
    margin-left: auto;
    display: flex;
    gap: 2px;
}

.win-btn {
    appearance: none;
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: var(--win-mid);
    color: var(--win-black);
    border-radius: 0;
    border-top: 1px solid var(--win-white);
    border-left: 1px solid var(--win-white);
    border-right: 1px solid var(--win-black);
    border-bottom: 1px solid var(--win-black);
    box-shadow:
        inset 1px 1px 0 #dfdfdf,
        inset -1px -1px 0 var(--win-dark);
    font: 11px/1 "MS Sans Serif", Tahoma, Geneva, sans-serif;
    cursor: default;
    user-select: none;
}

.module .win-btn {
    cursor: pointer;
}

.header-content {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 20px;
    padding: 14px 16px;
}

.header-brand {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr);
    align-items: center;
    gap: 14px;
}

.header-icon {
    width: 32px;
    height: 32px;
}

.kicker {
    margin: 0 0 6px;
    color: #ffffff;
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.site-header-clean h1 {
    margin: 0;
    font-size: clamp(2rem, 4vw, 2.9rem);
    line-height: 1;
    font-weight: 700;
}

.top-nav-clean {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap;
}

.top-nav-clean a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 94px;
    padding: 10px 16px;
    color: var(--win-text);
    text-decoration: none;
    font-size: 11px;
    font-weight: 700;
    background: var(--win-mid);
    border-top: 2px solid var(--win-white);
    border-left: 2px solid var(--win-white);
    border-right: 2px solid var(--win-black);
    border-bottom: 2px solid var(--win-black);
    box-shadow:
        inset 1px 1px 0 #dfdfdf,
        inset -1px -1px 0 var(--win-dark);
}

.top-nav-clean a:hover,
.top-nav-clean a:focus-visible,
.win-btn:hover,
.win-btn:focus-visible {
    background: #d7d7d7;
    outline: 1px dotted var(--win-black);
    outline-offset: -4px;
}

.top-nav-clean a:active,
.top-nav-clean a.is-pressed,
.win-btn:active,
.win-btn.is-pressed {
    background: #b7b7b7;
    border-top: 1px solid var(--win-dark);
    border-left: 1px solid var(--win-dark);
    border-right: 1px solid var(--win-white);
    border-bottom: 1px solid var(--win-white);
    box-shadow:
        inset 1px 1px 0 #8f8f8f,
        inset -1px -1px 0 #f3f3f3;
    transform: translate(1px, 1px);
}

.terminal-shell {
    margin: 0;
}

.terminal-bar .window-title-left span {
    white-space: nowrap;
}

.terminal-body {
    padding: 14px 18px 18px;
    background: var(--win-black);
    color: var(--win-white);
    font-size: 11px;
    line-height: 1.55;
}

.terminal-body p {
    margin: 0 0 10px;
}

.prompt {
    margin-right: 10px;
    color: #ffffff;
}

.status-ok {
    display: inline-block;
    min-width: 54px;
    margin-right: 10px;
    color: #ffffff;
    font-weight: 700;
}

.terminal-note {
    max-width: 74ch;
}

.content-grid.content-grid-single {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 16px;
    padding: 0 16px 16px;
    align-items: start;
}

.main-column,
.left-column,
.side-column.side-column-returned {
    display: grid;
    gap: 16px;
}

.main-column {
    grid-template-columns: minmax(0, 1.12fr) minmax(280px, 0.88fr);
    align-items: start;
}

.side-column.side-column-returned {
    position: sticky;
    top: 16px;
}

.left-column.left-column-optional {
    width: 180px;
    position: absolute;
    top: 0;
    left: calc(50% - min(690px, calc((100% - 28px) / 2)) - 196px);
    z-index: 1;
}

.module,
.status-box,
.webring-box,
.counter-box {
    padding: 0;
}

.module > *:not(.module-head),
.status-box > *:not(.mini-heading),
.webring-box > *:not(.mini-heading),
.counter-box > *:not(.mini-heading) {
    margin-left: 16px;
    margin-right: 16px;
}

.module.is-minimized > *:not(.module-head) {
    display: none;
}

.module.is-minimized {
    min-height: 0;
}

.module-copy,
.card-copy p,
.widget-list,
.webring-list,
.status-box p,
.footer-note {
    font-size: 11px;
    line-height: 1.45;
}

.module-head {
    justify-content: space-between;
    gap: 12px;
    position: relative;
}

.module-head > div:first-child {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.module-head .window-controls-win {
    flex: 0 0 auto;
}

.module-head h2 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 11px;
    line-height: 1;
    color: var(--win-white);
}

.section-icon {
    margin-right: 0;
    vertical-align: middle;
}

.module-label,
.mini-heading {
    margin: 0;
    color: var(--win-white);
    font-size: 11px;
    font-weight: 700;
}

.module-label:last-child {
    white-space: nowrap;
}

.module-copy {
    margin-top: 14px;
    margin-bottom: 14px;
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 16px;
}

.project-card {
    display: grid;
    gap: 14px;
    padding: 14px;
}

.project-card.wide {
    grid-column: 1 / -1;
    grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
    align-items: start;
}

.project-card.wide:not(:has(.media-frame)) {
    grid-template-columns: 1fr;
}

.card-copy h3 {
    margin: 0 0 12px;
    font-size: 11px;
    text-align: left;
}

.card-copy h3 a {
    color: var(--win-link);
}

.card-copy {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 10px 12px;
}

.card-copy h3 {
    grid-column: 1;
    margin: 0;
}

.card-copy p {
    grid-column: 1 / -1;
    margin: 0;
    text-align: left;
}

.card-tags {
    grid-column: 2;
    grid-row: 1;
    display: inline-flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-self: start;
    gap: 6px;
    margin: 0;
}

.tag {
    display: inline-block;
    padding: 4px 8px;
    color: var(--win-text);
    background: var(--win-mid);
    border-top: 1px solid var(--win-white);
    border-left: 1px solid var(--win-white);
    border-right: 1px solid var(--win-black);
    border-bottom: 1px solid var(--win-black);
    box-shadow:
        inset 1px 1px 0 #dfdfdf,
        inset -1px -1px 0 var(--win-dark);
    font-size: 11px;
    text-transform: uppercase;
    text-decoration: none;
}

.media-frame {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    max-width: 100%;
    overflow: hidden;
    align-self: start;
    border-top: 2px solid var(--win-dark);
    border-left: 2px solid var(--win-dark);
    border-right: 2px solid var(--win-white);
    border-bottom: 2px solid var(--win-white);
    background: transparent;
    justify-self: center;
}

.media-frame img,
.media-frame video {
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: 320px;
    display: block;
    background: transparent;
}

.media-frame video {
    object-fit: contain;
    object-position: center;
}

#tools-software .media-frame img {
    opacity: 0;
    object-fit: contain;
    object-position: center;
    background: var(--win-black);
}

#tools-software .media-frame.has-image::after {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--win-black);
    pointer-events: none;
    transform: translateY(0);
}

#tools-software .media-frame.has-image.media-ready img {
    opacity: 1;
}

#tools-software .media-frame.has-image.media-ready::after {
    animation: wipe-down-irregular var(--wipe-duration, 2.2s) steps(var(--wipe-steps, 14), end) forwards;
}

.widget-list,
.webring-list {
    margin-top: 14px;
    margin-bottom: 16px;
    padding-left: 18px;
}

.widget-list li,
.webring-list li {
    margin-bottom: 10px;
}

.widget-list li {
    display: flex;
    align-items: center;
    gap: 8px;
}

.profile-box {
    display: grid;
    justify-items: center;
    gap: 10px;
    margin: 16px;
    text-align: center;
}

.profile-icon {
    width: 96px;
    height: 96px;
    display: block;
    padding: 4px;
    background: var(--win-mid);
    border: 1px solid var(--win-black);
    image-rendering: pixelated;
}

.profile-name {
    margin: 0;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.35;
}

.profile-role,
.profile-contact {
    margin: 0;
    font-size: 11px;
    line-height: 1.35;
}

.badge-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
    margin: 14px 16px 16px;
    justify-items: center;
}

.badge-grid img {
    display: block;
    width: 100%;
    max-width: 176px;
    height: auto;
    margin: 0 auto;
    image-rendering: pixelated;
}

.sound-badge {
    cursor: pointer;
}

.sound-badge:active {
    transform: translate(1px, 1px);
}

.peedy-box-body {
    margin: 16px;
    display: flex;
    justify-content: center;
}

.banish-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    color: var(--win-text);
    text-decoration: none;
    font: 11px "MS Sans Serif", Tahoma, Geneva, sans-serif;
    background: var(--win-mid);
    border-top: 2px solid var(--win-white);
    border-left: 2px solid var(--win-white);
    border-right: 2px solid var(--win-black);
    border-bottom: 2px solid var(--win-black);
    box-shadow:
        inset 1px 1px 0 #dfdfdf,
        inset -1px -1px 0 var(--win-dark);
    cursor: pointer;
}

.banish-button:hover,
.banish-button:focus-visible {
    background: #d7d7d7;
    outline: 1px dotted var(--win-black);
    outline-offset: -4px;
}

.banish-button:active {
    background: #b7b7b7;
    border-top: 1px solid var(--win-dark);
    border-left: 1px solid var(--win-dark);
    border-right: 1px solid var(--win-white);
    border-bottom: 1px solid var(--win-white);
    box-shadow:
        inset 1px 1px 0 #8f8f8f,
        inset -1px -1px 0 #f3f3f3;
    transform: translate(1px, 1px);
}

.nav-icon {
    width: 32px;
    height: 32px;
}

.status-box p {
    margin-bottom: 0;
}

.counter-box {
    text-align: center;
}

.counter-box img {
    margin: 16px auto;
    padding: 8px;
    background: var(--win-black);
    border-top: 2px solid var(--win-dark);
    border-left: 2px solid var(--win-dark);
    border-right: 2px solid var(--win-white);
    border-bottom: 2px solid var(--win-white);
}

.footer-note {
    margin: 0 16px 16px;
    padding: 8px 12px;
    background: var(--win-mid);
    border-top: 2px solid var(--win-white);
    border-left: 2px solid var(--win-white);
    border-right: 2px solid var(--win-black);
    border-bottom: 2px solid var(--win-black);
    box-shadow:
        inset 1px 1px 0 #dfdfdf,
        inset -1px -1px 0 var(--win-dark);
}

#tools-software,
#web-development,
#three-d,
#game-development,
#modding,
#misc {
    grid-column: 1 / -1;
}

#three-d .project-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

#game-development .project-grid,
#modding .project-grid,
#misc .project-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 1250px) {
    #three-d .project-grid,
    #game-development .project-grid,
    #modding .project-grid,
    #misc .project-grid {
        grid-template-columns: 1fr;
    }
}

@keyframes wipe-down {
    from { transform: translateY(0); }
    to { transform: translateY(102%); }
}

@keyframes wipe-down-irregular {
    0% { transform: translateY(0%); }
    8% { transform: translateY(4%); }
    14% { transform: translateY(4%); }
    22% { transform: translateY(16%); }
    28% { transform: translateY(18%); }
    36% { transform: translateY(18%); }
    48% { transform: translateY(38%); }
    55% { transform: translateY(41%); }
    63% { transform: translateY(41%); }
    74% { transform: translateY(67%); }
    81% { transform: translateY(67%); }
    89% { transform: translateY(86%); }
    100% { transform: translateY(102%); }
}

@media (max-width: 1749px) {
    .left-column.left-column-optional {
        display: none;
    }
}

@media (max-width: 1100px) {
    .content-grid.content-grid-single,
    .project-card.wide {
        grid-template-columns: 1fr;
    }

    .main-column {
        grid-template-columns: 1fr;
    }

    #tools-software,
    #web-development,
    #game-development,
    #misc,
    #three-d,
    #modding {
        grid-column: 1;
    }

    .side-column.side-column-returned {
        position: static;
    }
}

@media (max-width: 860px) {
    .page-wrap {
        width: min(100% - 12px, 1380px);
        margin: 8px auto;
    }

    .header-content {
        grid-template-columns: 1fr;
        align-items: start;
    }

    .top-nav-clean {
        flex-wrap: wrap;
    }

    .top-nav-clean a {
        flex: 1 1 120px;
        min-width: 0;
    }

    .project-grid {
        grid-template-columns: 1fr;
    }

    .module-head {
        padding-right: 6px;
    }
}
