@font-face {
    font-family: VT323;
    src: url('./fonts/VT323-Regular.ttf') format('truetype');
    font-display: swap;
}

@font-face {
    font-family: Bitcount;
    src: url('./fonts/BitcountPropSingle_Roman-Bold.ttf') format('truetype');
    font-display: swap;
    font-weight: 700;
}

* { box-sizing: border-box; }

:root {
    color-scheme: dark;
    --page: #111;
    --surface: #171717;
    --text: #f7f7f7;
    --muted: #c9c9c9;
    --line: #747474;
    --accent: #fff;
    background: var(--page);
    color: var(--text);
    font: 1rem/1.45 system-ui, sans-serif;
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background:
        linear-gradient(#ffffff12 1px, transparent 1px) 0 0 / 32px 32px,
        linear-gradient(90deg, #ffffff12 1px, transparent 1px) 0 0 / 32px 32px,
        radial-gradient(ellipse at 50% 34%, #292929, var(--page) 68%);
}

h1, h2, h3, p { margin: 0; }
a { color: inherit; text-underline-offset: .16em; }
a:hover { text-decoration-thickness: 2px; }
:where(a, summary):focus-visible {
    outline: 2px dashed var(--accent);
    outline-offset: 5px;
}

.shell { width: min(1120px, calc(100% - 64px)); margin-inline: auto; }

.header, .footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 18px;
    padding-block: 18px;
    font: 1.375rem/1.2 VT323, monospace;
}

.header { border-bottom: 1px solid var(--line); }
.footer { border-top: 1px solid var(--line); color: var(--muted); }
.brand {
    display: grid;
    place-items: center;
    width: 56px;
    height: 56px;
    padding: 5px;
    border: 1px solid var(--accent);
    background: #dedede;
    box-shadow: 3px 3px #000;
}
.brand img { display: block; width: auto; height: 100%; min-height: 0; }
.header nav { display: flex; align-items: center; gap: clamp(14px, 3vw, 24px); }
.header nav a { text-decoration: none; }
.header nav a:hover, .header nav a[aria-current] { text-decoration: underline; }
.lang { border: 1px solid var(--line); padding: 4px 9px; }
main { flex: 1; }

.project-hub {
    display: grid;
    grid-template-columns: minmax(0, 480px);
    justify-content: center;
    gap: 30px;
    padding: clamp(34px, 7vh, 76px) 0 64px;
}
.project-hub h1,
.app-page h1 {
    font: 700 clamp(2.25rem, 8vw, 4.875rem)/1 Bitcount, monospace;
    letter-spacing: -.035em;
    overflow-wrap: anywhere;
}
.project-hub h1 {
    text-align: center;
    text-shadow: 3px 4px #545454;
}
.projects {
    display: grid;
    gap: 36px;
    list-style: none;
    margin: 0;
    padding: 0;
}
.project-slot {
    display: grid;
    justify-items: center;
    padding-bottom: 28px;
    position: relative;
    isolation: isolate;
}
.project-slot::after {
    position: absolute;
    z-index: -1;
    bottom: 0;
    width: min(54%, 260px);
    height: 14px;
    background: #000b;
    content: "";
    clip-path: polygon(0 33%, 12% 33%, 12% 0, 88% 0, 88% 33%, 100% 33%, 100% 66%, 88% 66%, 88% 100%, 12% 100%, 12% 66%, 0 66%);
}
.project-card {
    --text: #fff1dc;
    --muted: #c5b8de;
    --line: #504265;
    --accent: #ffc486;
    width: min(100%, 480px);
    align-self: start;
    color: var(--text);
    background: #171328;
    border: 2px solid var(--accent);
    box-shadow: 7px 7px #0d0b19;
    text-decoration: none;
    font: 1.375rem/1.25 VT323, monospace;
    animation: float-card 2.3s ease-in-out 2 alternate;
    transition: translate .22s ease-out, box-shadow .22s ease-out;
}
.project-card:hover,
.project-card:focus-visible { translate: 0 -6px; box-shadow: 8px 12px #0d0b19; }
.project-card:focus-visible { outline-color: #fff4ce; }
@keyframes float-card { to { transform: translateY(-9px); } }

.card-art {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    place-items: center;
    gap: 12px;
    min-height: 170px;
    padding: 20px;
    border-bottom: 2px solid var(--accent);
    background:
        repeating-linear-gradient(0deg, #47223219 0 2px, transparent 2px 7px),
        linear-gradient(#f7bd8c 0 48%, #efa273 48% 63%, #db795a 63% 76%, #aa4750 76% 90%, #743247 90%);
    overflow: hidden;
}
.card-art img {
    width: clamp(105px, 21vw, 142px);
    height: auto;
    border: 3px solid #211727;
    box-shadow: 5px 5px #663045, 0 0 0 3px #ffe1ab;
    image-rendering: pixelated;
}
.kana {
    color: #4c2540;
    font: 800 clamp(1.8125rem, 6vw, 3.625rem)/1 'Hiragino Kaku Gothic ProN', 'Yu Gothic', sans-serif;
    text-shadow: 2px 3px #ffe1aa;
}
.kana-left { rotate: -12deg; align-self: start; margin-top: 12px; }
.kana-right { rotate: 12deg; align-self: end; margin-bottom: 13px; }
.card-copy { padding: 21px 23px 19px; }
.card-copy h2 {
    color: var(--accent);
    font: 700 clamp(1.625rem, 7vw, 2.8125rem)/1 Bitcount, monospace;
    overflow-wrap: anywhere;
}
.card-copy p { margin-top: 7px; color: var(--muted); }
.card-action { display: block; margin-top: 15px; border-top: 1px solid var(--line); padding-top: 11px; }
.project-card:hover .card-action { text-decoration: underline; }

.app-page { max-width: 760px; margin-inline: auto; padding: clamp(30px, 6vh, 58px) 0 76px; }
.app-back { color: var(--muted); font: 1.375rem/1.2 VT323, monospace; }
.app-page h1 { margin-top: 22px; }
.app-tagline { color: var(--muted); margin-top: 10px; font: 1.625rem/1.2 VT323, monospace; }
.documents { margin-top: 32px; }
.documents h2 { margin: 0 0 12px; font: 1.875rem/1.1 VT323, monospace; }

details + details { margin-top: 10px; }
details {
    border: 1px solid var(--line);
    background: var(--surface);
    box-shadow: 4px 4px #0008;
}
details[open] { border-color: var(--accent); }
summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 50px;
    gap: 12px;
    padding: 10px 16px;
    cursor: pointer;
    list-style: none;
    font: 1.5rem/1.2 VT323, monospace;
}
summary::-webkit-details-marker { display: none; }
summary::after {
    content: "";
    width: 12px;
    height: 12px;
    flex: none;
    background: linear-gradient(currentColor, currentColor) center / 100% 2px no-repeat,
        linear-gradient(currentColor, currentColor) center / 2px 100% no-repeat;
}
details[open] summary,
summary:hover { background: #eaeaea; color: #111; }
details[open] summary::after { background-size: 100% 2px, 0 0; }

@supports (interpolate-size: allow-keywords) {
    @media (prefers-reduced-motion: no-preference) {
        details { interpolate-size: allow-keywords; }
        details::details-content {
            block-size: 0;
            overflow: clip;
            transition: block-size .24s ease, content-visibility .24s allow-discrete;
        }
        details[open]::details-content { block-size: auto; }
    }
}
.copy { padding: 10px clamp(15px, 4vw, 25px) 27px; line-height: 1.65; }
.copy h3 {
    font: 1.75rem/1.12 VT323, monospace;
    color: var(--accent);
    margin: 24px 0 8px;
}
.copy p, .copy ul, .copy ol { margin: 10px 0; }
.copy a { overflow-wrap: anywhere; }
.info-date { color: var(--muted); }
.contact {
    display: inline-block;
    border: 1px solid var(--line);
    margin-top: 12px;
    padding: 5px 11px;
    font: 1.375rem/1.2 VT323, monospace;
}
.contact:hover { border-color: var(--accent); }

.skip { position: absolute; top: -100px; left: 12px; background: var(--page); padding: 10px; }
.skip:focus { top: 10px; z-index: 2; }

@media (max-width: 620px) {
    .shell { width: calc(100% - 36px); }
    .header, .footer { padding-block: 14px; }
    .brand { width: 48px; height: 48px; }
    .project-hub {
        gap: 18px;
        padding-top: 26px;
    }
    .card-copy { padding: 17px 16px 16px; }
    .card-art { min-height: 140px; }
}

@media (prefers-reduced-motion: reduce) {
    .project-card { animation: none; transition: none; }
    .project-card:hover, .project-card:focus-visible { translate: none; }
}
