:root {
    --desktop-teal: #4f9f9b;
    --window-gray: #c0c0c0;
    --window-light: #ffffff;
    --window-shadow: #404040;
    --window-dark: #111111;
    --paper: #fbfaf2;
    --paper-soft: #f0eee2;
    --ink: #202020;
    --muted: #5b5b55;
    --link: #2f24b8;
    --visited: #6c2d91;
    --title-blue: #000080;
    --title-blue-light: #0a66c2;
    --font-heading: Georgia, "Times New Roman", "Songti SC", serif;
    --font-body: "Times New Roman", "Songti SC", SimSun, serif;
    --font-system: Tahoma, Verdana, "Microsoft YaHei", sans-serif;
}

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

html {
    height: 100%;
    overflow: hidden;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    height: 100%;
    min-width: 280px;
    overflow: hidden;
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.48;
    letter-spacing: 0;
    -webkit-font-smoothing: antialiased;
}

body.menu-open {
    overflow: hidden;
}

button,
input {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

a {
    color: var(--link);
    text-decoration: underline;
}

a:visited {
    color: var(--visited);
}

button:focus-visible,
a:focus-visible,
summary:focus-visible {
    outline: 2px dotted #000;
    outline-offset: 2px;
}

::selection {
    color: #fff;
    background: #000080;
}

[hidden] {
    display: none !important;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.retro-desktop {
    position: fixed;
    inset: 0;
    overflow: hidden;
    background-color: var(--desktop-teal);
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px),
        radial-gradient(circle at 70% 15%, rgba(211, 255, 242, 0.28), transparent 38%),
        radial-gradient(circle at 18% 74%, rgba(0, 63, 83, 0.2), transparent 42%);
    background-size: 8px 8px, 8px 8px, 100% 100%, 100% 100%;
}

.retro-desktop::after {
    position: fixed;
    inset: 0;
    z-index: 50;
    pointer-events: none;
    content: "";
    opacity: 0.16;
    background: repeating-linear-gradient(0deg, transparent 0 3px, rgba(12, 24, 24, 0.12) 3px 4px);
    mix-blend-mode: multiply;
}

.top-anchor {
    position: absolute;
    top: 0;
    left: 0;
    width: 1px;
    height: 1px;
    pointer-events: none;
}

.desktop-shortcuts {
    position: absolute;
    top: 34px;
    left: 8px;
    z-index: 2;
    display: grid;
    gap: 20px;
    width: 76px;
}

.desktop-shortcut {
    display: grid;
    justify-items: center;
    gap: 5px;
    width: 76px;
    padding: 2px;
    border: 0;
    color: #fff;
    background: transparent;
    font: 12px/1.15 var(--font-system);
    text-align: center;
    text-decoration: none;
    text-shadow: 1px 1px #003f50;
    cursor: default;
}

.desktop-shortcut:visited {
    color: #fff;
}

.desktop-shortcut:hover,
.desktop-shortcut:focus-visible {
    color: #fff;
    background: rgba(0, 0, 128, 0.48);
    outline: 1px dotted #fff;
}

.shortcut-icon {
    position: relative;
    display: block;
    width: 34px;
    height: 32px;
    filter: drop-shadow(1px 1px 0 rgba(0, 0, 0, 0.55));
}

.shortcut-icon--computer::before {
    position: absolute;
    inset: 2px 2px 8px;
    content: "";
    border: 3px outset #dedede;
    background: #144b83;
    box-shadow: inset 0 0 0 3px #6fc2c7;
}

.shortcut-icon--computer::after {
    position: absolute;
    right: 7px;
    bottom: 2px;
    left: 7px;
    height: 6px;
    content: "";
    border: 2px outset #c0c0c0;
    background: #d8d8d8;
}

.shortcut-icon--folder::before {
    position: absolute;
    top: 9px;
    right: 1px;
    bottom: 2px;
    left: 1px;
    content: "";
    border: 2px outset #fff0a6;
    background: #efc94b;
}

.shortcut-icon--folder::after {
    position: absolute;
    top: 4px;
    left: 3px;
    width: 17px;
    height: 8px;
    content: "";
    border: 2px outset #fff0a6;
    background: #efc94b;
}

.shortcut-icon--network::before {
    position: absolute;
    inset: 2px;
    content: "";
    border: 2px outset #e8e8e8;
    border-radius: 50%;
    background:
        linear-gradient(90deg, transparent 45%, #e8f5ff 45% 55%, transparent 55%),
        linear-gradient(#1d68ad 48%, #4ab2b0 48%);
}

.shortcut-icon--network::after {
    position: absolute;
    top: 9px;
    left: 7px;
    width: 20px;
    height: 12px;
    content: "";
    border-top: 2px solid #fff;
    border-bottom: 2px solid #fff;
    border-radius: 50%;
}

.shortcut-icon--mail::before {
    position: absolute;
    inset: 6px 1px 3px;
    content: "";
    border: 3px outset #efefef;
    background: #f8f8f8;
}

.shortcut-icon--mail::after {
    position: absolute;
    top: 9px;
    left: 6px;
    width: 23px;
    height: 16px;
    content: "";
    border-right: 2px solid #244b8e;
    border-bottom: 2px solid #244b8e;
    transform: rotate(45deg);
}

.shortcut-icon--gomoku {
    border: 2px outset #f1f1f1;
    background: #c0c0c0;
}

.shortcut-icon--gomoku::before {
    position: absolute;
    inset: 4px;
    content: "";
    border: 1px solid #404040;
    background:
        repeating-linear-gradient(0deg, transparent 0 5px, #707070 5px 6px),
        repeating-linear-gradient(90deg, transparent 0 5px, #707070 5px 6px),
        #d5d5d5;
}

.shortcut-icon--gomoku::after {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 7px;
    height: 7px;
    content: "";
    border: 1px solid #000;
    border-radius: 50%;
    background: #111;
    box-shadow: 11px 11px 0 -1px #fff, 11px 11px 0 0 #555;
}

.app-window {
    position: absolute;
    top: 36px;
    right: 22px;
    bottom: 44px;
    left: 88px;
    z-index: 5;
    display: flex;
    min-width: 0;
    min-height: 0;
    flex-direction: column;
    border: 2px outset #f0f0f0;
    background: var(--window-gray);
    box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.65);
}

.app-window.is-maximized {
    top: 0;
    right: 0;
    bottom: 36px;
    left: 0;
    border-width: 1px;
    box-shadow: none;
}

.app-window.is-minimized,
.app-window.is-closed {
    display: none;
}

.app-window.is-dragging,
.app-window.is-resizing {
    outline: 2px dotted #fff;
    box-shadow: 0 0 0 1px #000, 3px 3px 0 rgba(0, 0, 0, 0.65);
    user-select: none;
}

.window-titlebar {
    display: flex;
    flex: 0 0 27px;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-width: 0;
    padding: 3px 3px 3px 5px;
    color: #fff;
    background: linear-gradient(90deg, var(--title-blue), var(--title-blue-light));
    cursor: move;
    font: 700 13px/1 var(--font-system);
    touch-action: none;
    user-select: none;
}

.app-window:not(.is-active) > .window-titlebar {
    color: #e5e5e5;
    background: #7f7f7f;
}

.window-title {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 5px;
}

.window-title > span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.window-app-icon {
    display: inline-grid;
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    place-items: center;
    border: 1px outset #fff;
    color: #fff;
    background: #3d397d;
    font: 700 11px/1 Georgia, serif;
}

.window-controls {
    display: flex;
    flex: 0 0 auto;
    gap: 2px;
    cursor: default;
}

.window-controls button {
    position: relative;
    display: grid;
    width: 22px;
    height: 20px;
    padding: 0;
    place-items: center;
    border: 2px outset #efefef;
    color: #000;
    background: #c0c0c0;
    font: 700 15px/1 Arial, sans-serif;
    cursor: default;
}

.window-controls button:active {
    border-style: inset;
}

.window-controls button:first-child span {
    transform: translateY(-3px);
}

.window-menubar {
    display: flex;
    flex: 0 0 25px;
    align-items: center;
    gap: 20px;
    padding: 0 9px;
    border-bottom: 1px solid #808080;
    color: #111;
    background: #c0c0c0;
    font: 13px/1 var(--font-system);
}

.window-menubar span::first-letter {
    text-decoration: underline;
}

.address-toolbar {
    display: flex;
    flex: 0 0 31px;
    align-items: center;
    gap: 6px;
    padding: 3px 5px;
    border-top: 1px solid #fff;
    border-bottom: 1px solid #7b7b7b;
    background: #c0c0c0;
    font: 12px/1 var(--font-system);
}

.address-label {
    flex: 0 0 auto;
}

.address-field {
    display: flex;
    min-width: 0;
    height: 23px;
    flex: 1;
    align-items: center;
    gap: 5px;
    padding: 1px 5px;
    overflow: hidden;
    border: 2px inset #fff;
    background: #fff;
    white-space: nowrap;
}

.address-field > span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
}

.address-page-icon {
    position: relative;
    width: 14px;
    height: 16px;
    flex: 0 0 14px;
    border: 1px solid #777;
    background: #fff;
}

.address-page-icon::after {
    position: absolute;
    right: 2px;
    bottom: 2px;
    width: 6px;
    height: 6px;
    content: "";
    background: #2b58c2;
}

.address-toolbar > a {
    display: inline-flex;
    height: 23px;
    align-items: center;
    padding: 0 8px;
    border: 2px outset #fff;
    color: #111;
    background: #c0c0c0;
    text-decoration: none;
}

.address-toolbar > a:active {
    border-style: inset;
}

.window-scroll {
    position: relative;
    min-height: 0;
    flex: 1;
    overflow: auto;
    border: 2px inset #efefef;
    background-color: var(--paper);
    background-image:
        linear-gradient(rgba(34, 34, 34, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(34, 34, 34, 0.018) 1px, transparent 1px);
    background-size: 5px 5px;
    scrollbar-color: #8d8d8d #d6d6d6;
}

.window-statusbar,
.gomoku-statusbar {
    display: grid;
    min-height: 22px;
    flex: 0 0 22px;
    gap: 3px;
    padding: 2px;
    background: #c0c0c0;
    font: 11px/16px var(--font-system);
}

.window-statusbar {
    grid-template-columns: 1fr 160px;
}

.gomoku-statusbar {
    grid-template-columns: minmax(0, 1fr) 160px;
}

.window-statusbar span,
.gomoku-statusbar > span {
    min-width: 0;
    padding: 0 5px;
    overflow: hidden;
    border: 1px inset #efefef;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.window-resize-handle {
    position: absolute;
    right: 2px;
    bottom: 2px;
    z-index: 20;
    width: 17px;
    height: 17px;
    padding: 0;
    border: 0;
    background:
        linear-gradient(135deg, transparent 0 48%, #fff 49% 55%, transparent 56%) 0 0 / 6px 6px,
        linear-gradient(135deg, transparent 0 48%, #555 49% 55%, transparent 56%) 2px 2px / 6px 6px;
    cursor: nwse-resize;
    touch-action: none;
}

.app-window.is-maximized .window-resize-handle {
    display: none;
}

.gomoku-window {
    top: 48px;
    right: auto;
    bottom: auto;
    left: max(96px, calc(50% - 280px));
    z-index: 12;
    width: min(560px, calc(100% - 118px));
    height: min(660px, calc(100% - 100px));
    min-width: 420px;
    min-height: 500px;
}

.gomoku-window.is-maximized {
    width: auto;
    height: auto;
}

.window-app-icon--gomoku {
    color: #111;
    background: #e5d36c;
    font-family: SimSun, serif;
}

.gomoku-menubar {
    position: relative;
    z-index: 30;
    display: flex;
    min-height: 25px;
    flex: 0 0 25px;
    align-items: center;
    gap: 2px;
    padding: 1px 4px;
    border-bottom: 1px solid #808080;
    background: #c0c0c0;
    font: 12px/1 var(--font-system);
}

.gomoku-menu {
    position: relative;
}

.gomoku-menu > button {
    min-height: 21px;
    padding: 2px 7px;
    border: 1px solid transparent;
    color: #111;
    background: transparent;
    font: inherit;
    cursor: default;
}

.gomoku-menu > button:hover,
.gomoku-menu > button:focus-visible,
.gomoku-menu > button[aria-expanded="true"] {
    border: 1px outset #fff;
    outline: 0;
}

.gomoku-menu-popup {
    position: absolute;
    top: 22px;
    left: 0;
    z-index: 40;
    width: 190px;
    padding: 3px;
    border: 2px outset #fff;
    background: #c0c0c0;
    box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.5);
}

.gomoku-menu-popup--help {
    width: 150px;
}

.gomoku-menu-popup button {
    display: flex;
    width: 100%;
    min-height: 27px;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 4px 18px;
    border: 0;
    color: #111;
    background: transparent;
    font: 12px/1.2 var(--font-system);
    text-align: left;
    cursor: default;
}

.gomoku-menu-popup button:hover,
.gomoku-menu-popup button:focus-visible {
    color: #fff;
    background: #000080;
    outline: 0;
}

.gomoku-menu-popup kbd {
    font: 11px/1 var(--font-system);
}

.gomoku-menu-separator {
    height: 2px;
    margin: 3px 2px;
    border-top: 1px solid #808080;
    border-bottom: 1px solid #fff;
}

.gomoku-launcher {
    position: absolute;
    top: 52px;
    right: 4px;
    bottom: 4px;
    left: 4px;
    z-index: 60;
    display: block;
    padding: 18px 20px;
    overflow: hidden;
    border: 2px inset #8d9b91;
    color: #b9dec6;
    background:
        repeating-linear-gradient(0deg, transparent 0 3px, rgba(115, 195, 143, 0.06) 3px 4px),
        #030705;
    font: 14px/1.55 "Courier New", monospace;
    opacity: 1;
    transition: opacity 180ms linear;
}

.gomoku-launcher.is-complete {
    opacity: 0;
}

.gomoku-launch-log {
    display: inline;
    margin: 0;
    color: inherit;
    font: inherit;
    white-space: pre-wrap;
}

.gomoku-launch-cursor {
    display: inline-block;
    width: 8px;
    height: 14px;
    margin-left: 2px;
    background: #b9dec6;
    animation: gomoku-terminal-cursor 650ms step-end infinite;
    vertical-align: -2px;
}

.gomoku-window.is-launching .gomoku-menubar {
    pointer-events: none;
}

.gomoku-window.is-launching .gomoku-game-area {
    visibility: hidden;
}

@keyframes gomoku-terminal-cursor {
    0%,
    45% {
        opacity: 1;
    }

    46%,
    100% {
        opacity: 0;
    }
}

.gomoku-game-area {
    display: flex;
    min-height: 0;
    flex: 1;
    flex-direction: column;
    gap: 8px;
    padding: 9px;
    overflow: hidden;
    border: 2px inset #efefef;
    background: #c0c0c0;
    font: 12px/1.2 var(--font-system);
}

.gomoku-score-panel {
    display: grid;
    min-height: 56px;
    flex: 0 0 56px;
    grid-template-columns: 1fr 54px 1fr;
    align-items: center;
    gap: 14px;
    padding: 5px 8px;
    border: 3px inset #efefef;
    background: #c0c0c0;
}

.gomoku-counter-block {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 7px;
}

.gomoku-counter-block--turn {
    justify-content: flex-end;
}

.gomoku-counter {
    display: grid;
    min-width: 62px;
    min-height: 34px;
    place-items: center;
    padding: 2px 5px;
    border: 2px inset #808080;
    color: #ff2f2f;
    background: #090909;
    font: 700 24px/1 "Courier New", monospace;
    text-shadow: 0 0 3px #b60000;
}

.gomoku-face {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    justify-self: center;
    padding: 0;
    border: 3px outset #fff;
    color: #111;
    background: #c0c0c0;
    font: 700 24px/1 Arial, sans-serif;
    cursor: default;
}

.gomoku-face:active {
    border-style: inset;
}

.gomoku-face.is-thinking span {
    display: inline-block;
    transform: rotate(90deg);
}

.gomoku-board-frame {
    display: grid;
    min-width: 0;
    min-height: 0;
    flex: 1;
    place-items: center;
    padding: 6px;
    overflow: hidden;
    border: 3px inset #efefef;
    background: #9f9f9f;
}

.gomoku-board {
    display: block;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    aspect-ratio: 1;
    cursor: crosshair;
    touch-action: manipulation;
}

.gomoku-board:focus-visible {
    outline: 2px dotted #000080;
    outline-offset: -4px;
}

.gomoku-board.is-locked {
    cursor: default;
}

.gomoku-legend {
    display: flex;
    align-items: center;
    gap: 4px;
}

.gomoku-stone {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 1px solid #333;
    border-radius: 50%;
}

.gomoku-stone--black {
    background: #111;
}

.gomoku-stone--white {
    background: #fff;
}

.gomoku-dialog {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 80;
    width: min(370px, calc(100% - 40px));
    border: 2px outset #fff;
    background: #c0c0c0;
    box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.55);
    transform: translate(-50%, -50%);
    font: 12px/1.45 var(--font-system);
}

.gomoku-dialog .window-titlebar {
    cursor: default;
}

.gomoku-dialog-body {
    display: grid;
    min-height: 110px;
    grid-template-columns: 48px minmax(0, 1fr);
    align-items: center;
    gap: 14px;
    padding: 18px;
}

.gomoku-dialog-body p {
    margin: 0;
    white-space: pre-line;
}

.gomoku-dialog-icon {
    display: grid;
    width: 46px;
    height: 46px;
    place-items: center;
    border: 3px outset #fff;
    color: #111;
    background: #e5d36c;
    font: 700 25px/1 SimSun, serif;
}

.gomoku-dialog-actions {
    display: flex;
    justify-content: center;
    padding: 0 18px 16px;
}

.gomoku-dialog-actions button {
    min-width: 82px;
    padding: 5px 12px;
    border: 2px outset #fff;
    color: #111;
    background: #c0c0c0;
    font: 12px/1 var(--font-system);
}

.gomoku-dialog-actions button:active {
    border-style: inset;
}

.page-shell {
    display: grid;
    width: 100%;
    min-height: 100%;
    grid-template-columns: 210px minmax(0, 1fr);
    align-items: start;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 8;
    display: flex;
    min-height: calc(100vh - 145px);
    flex-direction: column;
    align-self: start;
    padding: 30px 24px 24px;
    border-right: 1px solid #777;
    background: #eeeccf;
}

.brand {
    display: grid;
    order: 0;
    align-self: start;
    gap: 10px;
    margin-bottom: 14px;
    color: #242424;
    font: 700 25px/1.02 var(--font-heading);
    text-decoration: none;
}

.brand:visited {
    color: #242424;
}

.brand-avatar {
    display: block;
    width: 66px;
    height: 66px;
    border: 3px double #2b2b2b;
    border-radius: 0;
    object-fit: cover;
    filter: saturate(0.78) contrast(1.08);
}

.desktop-nav {
    display: grid;
    order: 2;
    gap: 15px;
}

.desktop-nav a {
    color: var(--visited);
    font: 700 17px/1.15 var(--font-heading);
    text-decoration: underline;
    text-transform: uppercase;
}

.desktop-nav a:hover {
    color: #0000ee;
    background: #ffffcc;
}

.header-actions {
    position: static;
    order: 1;
    display: flex;
    align-self: start;
    align-items: center;
    gap: 6px;
    margin: 0 0 28px;
    padding: 0;
}

.lang-toggle,
.menu-toggle {
    min-height: 28px;
    border: 2px outset #fff;
    color: #111;
    background: #c0c0c0;
    font: 700 12px/1 var(--font-system);
    cursor: default;
}

.lang-toggle {
    min-width: 54px;
    padding: 0 10px;
}

.lang-toggle:active,
.menu-toggle:active {
    border-style: inset;
}

.menu-toggle {
    display: none;
    width: 34px;
    padding: 6px;
}

.menu-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    margin: 3px 0;
    background: #111;
}

.mobile-menu {
    display: none;
}

main {
    min-width: 0;
    background: rgba(251, 250, 242, 0.96);
}

.section {
    width: 100%;
    padding: 34px 36px;
    border-bottom: 1px solid #6d6d68;
}

.reveal,
.reveal.visible {
    opacity: 1;
    transform: none;
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(250px, 0.85fr);
    gap: 34px;
    align-items: start;
    padding-top: 42px;
}

.hero-name,
.section-heading > p,
.education-line > div:first-child > p,
.contact-copy > p {
    margin: 0 0 8px;
    color: var(--visited);
    font: 700 13px/1.2 var(--font-system);
    text-transform: uppercase;
}

.hero h1 {
    margin: 0 0 22px;
    color: #242424;
    font: 700 52px/0.95 var(--font-heading);
}

.hero h1 span {
    display: block;
}

.hero-summary {
    max-width: 720px;
    margin: 0 0 18px;
    font-size: 17px;
}

.hero-tags,
.stack-strip,
.tags,
.skill-items,
.education-honors {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.hero-tags span,
.stack-strip span,
.tags span,
.skill-items span,
.education-honors span {
    display: inline-block;
    padding: 2px 7px;
    border: 1px solid #777;
    border-top-color: #fff;
    border-left-color: #fff;
    color: #222;
    background: #d8d8d8;
    font: 11px/1.35 var(--font-system);
}

.hero-brief {
    display: grid;
    margin: 22px 0;
    border-top: 2px solid #333;
    border-bottom: 2px solid #333;
}

.hero-brief > div {
    display: grid;
    grid-template-columns: 105px minmax(0, 1fr);
    gap: 12px;
    padding: 7px 4px;
    border-bottom: 1px dotted #777;
}

.hero-brief > div:last-child {
    border-bottom: 0;
}

.hero-brief span {
    color: var(--muted);
    font: 12px/1.4 var(--font-system);
}

.hero-brief strong {
    font-weight: 700;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
}

.primary-action,
.secondary-action,
.project-link {
    color: #0000ee;
    font-weight: 700;
    text-decoration: underline;
}

.primary-action::before {
    content: "[ ";
}

.primary-action::after {
    content: " ]";
}

.hero-visual {
    position: relative;
    padding: 6px;
    border: 2px inset #fff;
    background: #c0c0c0;
}

.hero-image {
    display: block;
    width: 100%;
    height: auto;
    max-height: 360px;
    border: 1px solid #333;
    object-fit: cover;
    filter: saturate(0.72) contrast(1.04) sepia(0.08);
}

.signal-panel {
    display: grid;
    gap: 2px;
    padding: 8px 7px 3px;
    font-family: var(--font-system);
}

.signal-panel span,
.signal-panel small {
    color: #555;
    font-size: 11px;
}

.signal-panel strong {
    font-size: 13px;
}

.metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    padding: 0;
    border-top: 2px solid #333;
    border-bottom: 2px solid #333;
}

.metric {
    min-width: 0;
    padding: 16px 15px;
    border-right: 1px solid #777;
    background: #f6f4e9;
}

.metric:last-child {
    border-right: 0;
}

.metric > span {
    display: block;
    color: #202020;
    font: 700 25px/1 var(--font-heading);
}

.metric p {
    margin: 5px 0 0;
    color: #555;
    font: 11px/1.35 var(--font-system);
}

.section-heading {
    margin-bottom: 24px;
    border-bottom: 2px solid #333;
}

.section-heading h2,
.education-line h2,
.contact-copy h2 {
    margin: 0 0 8px;
    color: #242424;
    font: 700 31px/1.05 var(--font-heading);
}

.method-layout {
    display: grid;
    grid-template-columns: minmax(230px, 0.7fr) minmax(0, 1.3fr);
    gap: 24px;
}

.method-copy {
    align-self: start;
    padding: 14px;
    border: 1px solid #777;
    background: #ffffdf;
}

.method-copy > p {
    margin: 0 0 16px;
}

.method-proof {
    display: grid;
    gap: 3px;
    padding-top: 10px;
    border-top: 1px dashed #666;
}

.method-proof span {
    color: #555;
    font: 11px/1.2 var(--font-system);
    text-transform: uppercase;
}

.method-steps {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border-top: 1px solid #777;
    border-left: 1px solid #777;
}

.method-step {
    min-width: 0;
    padding: 13px;
    border-right: 1px solid #777;
    border-bottom: 1px solid #777;
    background: #fff;
}

.method-step > span,
.skill-card > span {
    color: #666;
    font: 11px/1 var(--font-system);
}

.method-step h3,
.skill-card h3 {
    margin: 4px 0 2px;
    font: 700 20px/1.1 var(--font-heading);
}

.method-step strong {
    color: var(--visited);
}

.method-step p,
.skill-card p {
    margin: 7px 0 0;
    color: #444;
    font-size: 14px;
}

.experience-row {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr);
    border: 1px solid #777;
    background: #fff;
}

.row-meta {
    display: grid;
    align-content: start;
    gap: 8px;
    padding: 16px;
    border-right: 1px solid #777;
    background: #e9e7d9;
    font-family: var(--font-system);
}

.row-meta span {
    font-size: 12px;
}

.row-meta strong {
    font-size: 13px;
}

.row-main {
    min-width: 0;
    padding: 16px;
}

.row-main h3,
.project-body h3,
.publication-card h3 {
    margin: 0 0 5px;
    color: #222;
    font: 700 23px/1.12 var(--font-heading);
}

.row-main > p,
.project-body > p,
.publication-card > p {
    margin: 8px 0 12px;
}

.detail-drawer,
.project-details {
    margin-top: 14px;
}

.detail-drawer summary,
.project-details summary {
    display: inline-block;
    min-height: 27px;
    padding: 4px 10px;
    border: 2px outset #fff;
    color: #111;
    background: #c0c0c0;
    font: 700 12px/1.3 var(--font-system);
    list-style: none;
    cursor: default;
}

.detail-drawer summary::-webkit-details-marker,
.project-details summary::-webkit-details-marker {
    display: none;
}

.detail-drawer summary::before,
.project-details summary::before {
    margin-right: 6px;
    content: "+";
}

.detail-drawer[open] summary,
.project-details[open] summary {
    border-style: inset;
}

.detail-drawer[open] summary::before,
.project-details[open] summary::before {
    content: "-";
}

.feature-list,
.detail-list {
    margin: 12px 0 0;
    padding-left: 20px;
}

.feature-list li,
.detail-list li {
    margin-bottom: 7px;
}

.system-map {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-top: 16px;
    border-top: 1px solid #555;
    border-left: 1px solid #555;
}

.system-map > div {
    display: grid;
    gap: 4px;
    padding: 12px;
    border-right: 1px solid #555;
    border-bottom: 1px solid #555;
    background: #e6e4d8;
}

.system-map span {
    color: #555;
    font: 11px/1 var(--font-system);
}

.project-list {
    display: grid;
    gap: 22px;
}

.project-card {
    display: grid;
    grid-template-columns: minmax(260px, 0.82fr) minmax(0, 1.18fr);
    min-width: 0;
    overflow: hidden;
    border: 1px solid #4f4f4f;
    background: #fff;
}

.project-media {
    min-width: 0;
    margin: 0;
    border-right: 1px solid #555;
    background: #d8d8d8;
}

.project-media img {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 260px;
    object-fit: cover;
    filter: saturate(0.72) contrast(1.04) sepia(0.08);
}

.project-body {
    min-width: 0;
    padding: 18px;
}

.project-index {
    margin-bottom: 6px;
    color: #555;
    font: 11px/1.2 var(--font-system);
}

.project-role {
    display: block;
    color: var(--visited);
}

.result-line {
    padding-top: 10px;
    border-top: 1px dotted #777;
    font-weight: 700;
}

.project-link {
    display: inline-block;
    margin-top: 3px;
}

.publication-grid,
.skill-grid,
.award-columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.publication-card,
.skill-card,
.award-columns > div {
    min-width: 0;
    padding: 15px;
    border: 1px solid #777;
    background: #fff;
}

.publication-meta {
    display: grid;
    gap: 3px;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px dashed #777;
    font: 11px/1.35 var(--font-system);
}

.publication-meta span {
    color: #555;
}

.publication-meta strong {
    color: var(--visited);
}

.publication-proof {
    padding-top: 8px;
    border-top: 1px dotted #777;
    font-weight: 700;
}

.skill-card {
    background: #f7f6ee;
}

.skill-items {
    margin-top: 12px;
}

.award-columns > div {
    padding: 17px;
}

.award-columns h3 {
    margin: 0 0 10px;
    padding-bottom: 5px;
    border-bottom: 2px solid #333;
    font: 700 22px/1.1 var(--font-heading);
}

.award-columns ul {
    margin: 0;
    padding-left: 20px;
}

.award-columns li {
    margin-bottom: 7px;
}

.education-line {
    display: grid;
    grid-template-columns: minmax(190px, 0.65fr) minmax(0, 1.35fr);
    gap: 24px;
}

.education-content > p {
    margin: 0 0 14px;
}

.contact {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(220px, 0.75fr);
    gap: 24px;
    background: #ffffdf;
}

.contact-links {
    display: grid;
    align-content: start;
    border-top: 1px solid #555;
}

.contact-links a {
    padding: 8px 4px;
    overflow-wrap: anywhere;
    border-bottom: 1px solid #777;
    font-weight: 700;
}

.site-footer {
    display: flex;
    grid-column: 2;
    align-items: center;
    justify-content: space-between;
    padding-top: 18px;
    padding-bottom: 18px;
    color: #444;
    background: #ece9d8;
    font: 11px/1.2 var(--font-system);
}

.start-menu {
    position: absolute;
    bottom: 35px;
    left: 2px;
    z-index: 30;
    display: grid;
    width: 286px;
    height: clamp(220px, 44vh, 330px);
    grid-template-columns: 34px 1fr;
    border: 2px outset #fff;
    background: #c0c0c0;
    box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.55);
}

.start-menu-rail {
    padding: 7px 5px;
    color: #fff;
    background: #000080;
    font: 700 15px/1 var(--font-system);
    letter-spacing: 0;
    text-orientation: mixed;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
}

.start-menu-items {
    display: flex;
    flex-direction: column;
    padding: 4px;
}

.start-menu-items button,
.start-menu-items a {
    display: grid;
    min-height: 42px;
    grid-template-columns: 28px 1fr;
    align-items: center;
    gap: 8px;
    padding: 5px 8px;
    border: 0;
    color: #111;
    background: transparent;
    font: 12px/1.2 var(--font-system);
    text-align: left;
    text-decoration: none;
    cursor: default;
}

.start-menu-items button:hover,
.start-menu-items a:hover,
.start-menu-items button:focus-visible,
.start-menu-items a:focus-visible {
    color: #fff;
    background: #000080;
    outline: 0;
}

.start-menu-separator {
    height: 2px;
    margin: 3px 4px;
    margin-top: auto;
    border-top: 1px solid #808080;
    border-bottom: 1px solid #fff;
}

.start-icon {
    position: relative;
    display: block;
    width: 23px;
    height: 23px;
    border: 2px outset #fff;
    background: #efc94b;
}

.start-icon--home {
    background: #4a8cca;
}

.start-icon--projects {
    background: #efc94b;
}

.start-icon--gomoku {
    background:
        radial-gradient(circle at 7px 7px, #111 0 3px, transparent 4px),
        radial-gradient(circle at 16px 16px, #fff 0 3px, #555 4px, transparent 5px),
        repeating-linear-gradient(0deg, transparent 0 5px, #707070 5px 6px),
        repeating-linear-gradient(90deg, transparent 0 5px, #707070 5px 6px),
        #d5d5d5;
}

.start-icon--github {
    border-radius: 50%;
    background: #333;
}

.start-icon--language {
    background: #6b4aa5;
}

.start-icon--shutdown {
    background: #b9c5c7;
}

.start-icon--shutdown::before {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 13px;
    height: 10px;
    content: "";
    border: 2px inset #fff;
    background: #183a47;
}

.start-icon--shutdown::after {
    position: absolute;
    bottom: 3px;
    left: 7px;
    width: 8px;
    height: 2px;
    content: "";
    border-bottom: 2px solid #333;
    background: #ddd;
}

.desktop-taskbar {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 25;
    display: flex;
    height: 36px;
    align-items: center;
    gap: 4px;
    padding: 3px;
    border-top: 2px outset #fff;
    background: #c0c0c0;
    font: 12px/1 var(--font-system);
}

.shutdown-screen {
    position: absolute;
    inset: 0;
    z-index: 100;
    padding: clamp(28px, 5vw, 72px);
    overflow: hidden;
    color: #f4f4f4;
    background: #000;
    font: 16px/1.45 "Courier New", monospace;
}

.shutdown-screen::after {
    position: absolute;
    inset: 0;
    pointer-events: none;
    content: "";
    opacity: 0.08;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.04), transparent 38%);
}

.shutdown-bios {
    position: relative;
    z-index: 1;
    display: grid;
    width: min(980px, 100%);
    min-height: 100%;
    margin: 0 auto;
    grid-template-rows: auto 1fr auto;
}

.shutdown-bios-header,
.shutdown-bios-footer {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 28px;
}

.shutdown-wordmark p,
.shutdown-release p,
.shutdown-bios-footer p {
    margin: 0;
}

.shutdown-wordmark {
    font-size: 1.15em;
    font-weight: 700;
    line-height: 1.12;
}

.shutdown-release {
    color: #b7b7b7;
    font-size: 0.78em;
    line-height: 1.35;
    text-align: right;
}

.shutdown-bios-body {
    display: flex;
    justify-content: center;
    flex-direction: column;
    min-height: 260px;
    padding: clamp(36px, 8vh, 110px) 0;
}

.shutdown-kicker {
    margin: 0 0 12px;
    color: #b7b7b7;
    font-size: 0.82em;
    letter-spacing: 0.08em;
}

.shutdown-title {
    margin: 0 0 28px;
    color: #fff;
    font: 700 clamp(26px, 4vw, 52px)/1.04 var(--font-system);
}

.shutdown-log {
    min-height: 120px;
    margin: 0;
    color: #dedede;
    font: 0.96em/1.72 "Courier New", monospace;
    white-space: pre-wrap;
}

.shutdown-bios-footer {
    align-items: center;
    padding-top: 22px;
    border-top: 1px solid #5b5b5b;
    color: #b7b7b7;
    font-size: 0.82em;
}

.shutdown-bios-footer p {
    max-width: 560px;
}

.shutdown-restart {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    padding: 0 18px;
    border: 3px solid #f4f4f4;
    color: #f4f4f4;
    background: #000;
    font: 700 0.9rem/1 "Courier New", monospace;
    cursor: pointer;
}

.shutdown-restart:hover,
.shutdown-restart:focus-visible {
    color: #000;
    background: #f4f4f4;
    outline: 0;
}

.shutdown-restart:active {
    transform: translate(2px, 2px);
}

.start-button,
.task-window-button {
    display: flex;
    height: 29px;
    align-items: center;
    gap: 5px;
    padding: 2px 8px;
    overflow: hidden;
    border: 2px outset #fff;
    color: #111;
    background: #c0c0c0;
    white-space: nowrap;
    cursor: default;
}

.start-button:active,
.start-button[aria-expanded="true"],
.task-window-button.is-active {
    border-style: inset;
    background: #d4d4d4;
}

body.direct-portfolio .app-window:not(.is-maximized) {
    top: 72px;
}

@media (min-width: 901px) {
    body.direct-portfolio .gomoku-window:not(.is-maximized) {
        height: min(660px, calc(100% - 124px));
    }

    body.direct-portfolio:has(.app-window.is-maximized) .scene-link {
        top: 4px;
        right: 96px;
    }
}

.start-mark {
    display: block;
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    background: center / 18px 18px no-repeat url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAAsTAAALEwEAmpwYAAABTUlEQVQ4jaWS4Y7jIBCDPw/QJpu+/4ueqna7Ad+PSVLttied7pCQSWAY21i2+Z8Rf3NIai71ZEkuunzvaPuPM0ozFU/EE0kMFid7yW+LWY6iETKSg8VyNRVDzgiUNJu846ziUa9Ma3DTvGnNc3U17VagAlS0m6gms8JE8GAG3RiYkXV8DHEn0OaA6rZhLW8lpN6a9CsOxeHFLiNYrBGy+pBLWH3osxSfPaNyTerrkp3KA0ZnOECdyTuDvasW3yMNG6HspsQmH+urkwWSQ2Gk9f0r5KYJO/QrXa94+GyvOl4oPpxZKvFpgIjuU2C3M9g0Q+FCsEAX4gFcXoMkrSZswl4Yh2GEPRHWac6OCtuZC8AKhfvoeolvk6NHmlbX/Bczfnwd39EDoG6RJHG7ORRH2n76AzVNLM3PIKkZddQm/HVPeWO8MPvGMuJ5wb+O313iKFEd0WMgAAAAAElFTkSuQmCC");
    image-rendering: pixelated;
    pointer-events: none;
    user-select: none;
}

.task-window-button {
    width: min(310px, 40vw);
    text-align: left;
}

.gomoku-task-button {
    width: min(220px, 25vw);
}

.task-window-button > span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
}

.taskbar-spacer {
    min-width: 0;
    flex: 1;
}

.taskbar-tray {
    display: flex;
    height: 28px;
    align-items: center;
    gap: 8px;
    padding: 0 9px;
    border: 2px inset #efefef;
    background: #c8c8c8;
    white-space: nowrap;
}

.tray-network {
    position: relative;
    width: 15px;
    height: 12px;
    border: 1px solid #333;
    background: #63a8be;
}

.tray-network::after {
    position: absolute;
    right: -4px;
    bottom: -4px;
    width: 7px;
    height: 6px;
    content: "";
    border: 1px solid #333;
    background: #e1e1e1;
}

@media (max-width: 1040px) {
    .app-window {
        right: 12px;
        left: 80px;
    }

    .page-shell {
        grid-template-columns: 180px minmax(0, 1fr);
    }

    .site-header {
        padding-right: 18px;
        padding-left: 18px;
    }

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

    .hero-visual {
        max-width: 620px;
    }

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

    .project-media {
        border-right: 0;
        border-bottom: 1px solid #555;
    }

    .project-media img {
        min-height: 0;
        aspect-ratio: 16 / 8;
    }
}

@media (max-height: 620px) and (min-width: 901px) {
    .gomoku-window {
        top: 8px;
        height: calc(100% - 52px);
        min-height: 0;
    }
}

@media (max-width: 900px) {
    body.direct-portfolio .app-window:not(.is-maximized) {
        top: 88px;
    }

    .desktop-shortcuts {
        display: none;
    }

    .app-window,
    .app-window.is-maximized {
        top: 4px;
        right: 4px;
        bottom: 39px;
        left: 4px;
        border-width: 2px;
        box-shadow: none;
    }

    .gomoku-window,
    .gomoku-window.is-maximized {
        width: auto;
        height: auto;
        min-width: 0;
        min-height: 0;
    }

    .window-titlebar {
        cursor: default;
    }

    .window-resize-handle {
        display: none;
    }

    .window-menubar {
        display: none;
    }

    .address-label,
    .address-toolbar > a {
        display: none;
    }

    .window-statusbar {
        grid-template-columns: 1fr 110px;
    }

    .gomoku-statusbar {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .page-shell {
        display: block;
    }

    .site-header {
        position: sticky;
        top: 0;
        display: grid;
        min-height: 58px;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        padding: 8px 10px;
        border-right: 0;
        border-bottom: 2px solid #555;
        background: #eeeccf;
    }

    .brand {
        display: flex;
        min-width: 0;
        align-items: center;
        gap: 8px;
        margin: 0;
        overflow: hidden;
        font-size: 17px;
        white-space: nowrap;
    }

    .brand-avatar {
        width: 38px;
        height: 38px;
        flex: 0 0 38px;
        border-width: 2px;
    }

    .desktop-nav {
        display: none;
    }

    .header-actions {
        position: static;
        margin: 0;
        padding: 0;
    }

    .menu-toggle {
        display: block;
    }

    .mobile-menu {
        position: sticky;
        top: 56px;
        z-index: 7;
        padding: 6px;
        border-bottom: 2px solid #555;
        background: #c0c0c0;
        box-shadow: 0 2px 0 rgba(0, 0, 0, 0.25);
    }

    .mobile-menu.active {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 4px;
    }

    .mobile-menu a {
        min-width: 0;
        padding: 8px;
        border: 2px outset #fff;
        color: #111;
        background: #d6d6d6;
        font: 700 12px/1.2 var(--font-system);
        text-align: center;
        text-decoration: none;
    }

    .section {
        padding: 28px 18px;
    }

    .hero {
        grid-template-columns: 1fr;
        gap: 24px;
        padding-top: 30px;
    }

    .hero h1 {
        font-size: 44px;
    }

    .hero-brief > div {
        grid-template-columns: 92px minmax(0, 1fr);
    }

    .metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .metric:nth-child(2) {
        border-right: 0;
    }

    .metric:nth-child(-n + 2) {
        border-bottom: 1px solid #777;
    }

    .method-layout,
    .education-line,
    .contact {
        grid-template-columns: 1fr;
    }

    .experience-row {
        grid-template-columns: 1fr;
    }

    .row-meta {
        border-right: 0;
        border-bottom: 1px solid #777;
    }

    .publication-grid,
    .skill-grid,
    .award-columns {
        grid-template-columns: 1fr;
    }

    .site-footer {
        grid-column: auto;
    }

    .start-menu {
        right: 4px;
        width: auto;
        max-width: 310px;
    }

    .shutdown-screen {
        padding: 28px 24px;
        font-size: 13px;
    }

    .shutdown-bios-header,
    .shutdown-bios-footer {
        align-items: flex-start;
        flex-direction: column;
        gap: 16px;
    }

    .shutdown-release {
        text-align: left;
    }

    .shutdown-bios-body {
        min-height: 220px;
        padding: 48px 0;
    }

    .shutdown-title {
        font-size: clamp(24px, 9vw, 38px);
    }

    .gomoku-game-area {
        padding: 7px;
    }
}

@media (max-width: 560px) {
    body {
        font-size: 15px;
    }

    .window-titlebar {
        flex-basis: 25px;
        font-size: 11px;
    }

    .window-app-icon {
        width: 16px;
        height: 16px;
        flex-basis: 16px;
        font-size: 9px;
    }

    .window-controls button {
        width: 21px;
        height: 19px;
    }

    .address-toolbar {
        flex-basis: 29px;
        height: 29px;
    }

    .window-statusbar {
        display: none;
    }

    .section {
        padding: 24px 14px;
    }

    .hero h1 {
        font-size: 37px;
    }

    .hero-summary {
        font-size: 15px;
    }

    .hero-brief > div {
        grid-template-columns: 1fr;
        gap: 2px;
    }

    .hero-actions {
        gap: 12px;
    }

    .section-heading h2,
    .education-line h2,
    .contact-copy h2 {
        font-size: 27px;
    }

    .method-steps,
    .system-map {
        grid-template-columns: 1fr;
    }

    .project-media img {
        aspect-ratio: 4 / 3;
    }

    .task-window-button {
        width: auto;
        min-width: 0;
        flex: 1;
    }

    .gomoku-task-button {
        width: auto;
    }

    .gomoku-score-panel {
        grid-template-columns: 1fr 46px 1fr;
        gap: 8px;
        padding-right: 5px;
        padding-left: 5px;
    }

    .gomoku-counter-block {
        display: grid;
        gap: 2px;
    }

    .gomoku-counter-block--turn {
        justify-items: end;
    }

    .gomoku-counter {
        min-width: 52px;
        font-size: 20px;
    }

    .gomoku-face {
        width: 38px;
        height: 38px;
        font-size: 21px;
    }

    .gomoku-launcher {
        padding: 14px;
        font-size: 12px;
    }

    .gomoku-statusbar {
        grid-template-columns: minmax(0, 1fr);
    }

    .gomoku-legend {
        display: none;
    }

    .taskbar-tray {
        padding: 0 6px;
    }

    .tray-network {
        display: none;
    }

    .start-button {
        padding-right: 6px;
        padding-left: 6px;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .gomoku-launcher {
        transition: none;
    }

    .gomoku-launch-cursor {
        animation: none;
    }
}
