/*  Mobile-first, one desktop breakpoint (960px). Not check.php-compliant. */
@font-face {
    font-family: "iA Writer Quattro";
    src: url(fonts/iAWriterQuattroS-Regular.woff2);
    font-display: swap;
}

@font-face {
    font-family: "iA Writer Quattro";
    src: url(fonts/iAWriterQuattroS-Italic.woff2);
    font-style: italic;
    font-display: swap;
}

:root {
    color-scheme: light;
    --canvas: #fbfbfa;
    --ink: #111;
    --link: #0000ee;
}

* {
    box-sizing: border-box;
}

html {
    background: var(--canvas);
}

body {
    margin: 0;
    background: var(--canvas);
    color: var(--ink);
    font: 16px/1.6 "iA Writer Quattro", system-ui, sans-serif;
}

body.menu-open {
    overflow: hidden;
}

#inhalt {
    hyphens: auto;
    hyphenate-limit-chars: 12 5 5;
    hyphenate-limit-last: always;
    hyphenate-limit-lines: 1;
    -webkit-hyphenate-limit-lines: 1;
    hyphenate-limit-last: always;
    hyphenate-limit-zone: 8%
}

.shell {
    width: calc(100% - 40px);
    margin-inline: auto;
}

a {
    color: var(--link);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: .18em;
}

a:hover {
    text-decoration: none;
}

a:focus-visible,
button:focus-visible,
summary:focus-visible {
    outline: 1px solid var(--ink);
    outline-offset: 2px;
}

a>span[aria-hidden="true"] {
    white-space: nowrap;
}

::selection {
    background: var(--link);
    color: var(--canvas);
}

.skip {
    position: absolute;
    top: 8px;
    left: 16px;
    z-index: 5;
    padding: 8px 12px;
    background: var(--ink);
    color: var(--canvas);
    transform: translateY(-150%);
}

.skip::before {
    content: "[ ";
}

.skip::after {
    content: " ]";
}

.skip:focus {
    transform: none;
}

/* white only: the theme toggle stays hidden, site.js is a no-op here */
.theme-control {
    display: none;
}

h1,
h2,
h3 {
    font-size: 16px;
    line-height: 1.6;
    font-weight: 400;
}

h1 {
    max-width: 30ch;
    margin: 0 0 24px;
}

h1.lede {
    max-width: 50ch;
}

h2 {
    margin: 0;
}

h3 {
    margin-block: 32px 8px;
}

strong {
    font-weight: 400;
}

.site-name {
    display: inline-block;
    color: var(--ink);
    font-size: 30px;
    line-height: 1.15;
    text-decoration: none;
}

/* small text, everywhere */
.masthead p,
.section-heading>span,
.menu-group-label,
.meta,
.index-note,
.caption,
.index-row p,
.event-row p,
.row-side,
.status,
.work-media span,
.film-trailer::before {
    font-size: 13px;
    font-variant-numeric: tabular-nums;
}

/* --- gameFAQs headers: uppercase, framed by hash rules one step
   short of the prose measure (46 of 50ch, 32 on narrow screens) so
   they never clip — there is deliberately no overflow:hidden here --- */
h1:not(.lede),
.prose h1,
.prose h2 {
    text-transform: uppercase;
}

h1:not(.lede) {
    max-width: none;
}

h1:not(.lede)::before,
.prose h1::before,
.prose h2::before {
    content: "###################################";
    display: block;
    padding-bottom: .35em;
}

h1:not(.lede)::after,
.prose h1::after,
.prose h2::after {
    content: "###################################";
    display: block;
    padding-top: .35em;
}

/* very narrow phones: 35 hashes would wrap, so keep 32 below 380px */
@media (max-width: 379px) {

    h1:not(.lede)::before,
    .prose h1::before,
    .prose h2::before,
    h1:not(.lede)::after,
    .prose h1::after,
    .prose h2::after {
        content: "################################";
    }
}

/* from 540px the hash rules use the near-full 46-of-50ch measure */
@media (min-width: 540px) {

    h1:not(.lede)::before,
    .prose h1::before,
    .prose h2::before,
    h1:not(.lede)::after,
    .prose h1::after,
    .prose h2::after {
        content: "#################################################";
    }
}

.prose h1 {
    margin-bottom: 24px;
}

.prose h2 {
    margin-block: 40px 8px;
}

.prose h3::before {
    content: "-- ";
}

.prose h3::after {
    content: " --";
}

/* --- list/table headings stay plain --- */
.section-heading {
    display: flex;
    align-items: baseline;
    gap: 12px;
    max-width: 100%;
    margin: 56px 0 16px;
}

.section-heading i {
    display: none;
}

.section-heading h2 {
    text-transform: uppercase;
}

.year-heading {
    margin-top: 3em;
}

.work-card h2 {
    margin: 12px 0 4px;
}

/* --- gameFAQs garnish --- */
.back {
    display: inline-block;
    margin-top: 56px;
}

.back::before {
    content: "[ ";
}

.back::after {
    content: " ]";
}

.error::before {
    content: "!!! ";
}

.index-note::before {
    content: "~ ";
}

.film-trailer {
    margin: 40px 0;
}

.film-trailer::before {
    content: "[ trailer ]";
    display: block;
    margin-bottom: 8px;
    text-align: center;
}

.prose li::marker {
    content: "- ";
}

/* --- structure: spacing only, no boxes --- */
.masthead {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    padding-block: 48px 24px;
}

.masthead p {
    margin: 4px 0 0;
}

.intro {
    max-width: 50ch;
    margin-bottom: 56px;
}

.prose {
    max-width: 50ch;
}

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

.prose li {
    margin-bottom: 8px;
}

.prose blockquote {
    margin: 24px 0;
    font-style: italic;
}

.prose img {
    max-width: 100%;
    height: auto;
}

.prose code {
    font-size: 13px;
}

main {
    padding-block: 16px 24px;
}

.frame {
    margin-block: 24px;
}

.index {
    margin: 0;
    padding: 0;
    list-style: none;
    max-width: 100%;
}

.index-row,
.event-row {
    display: grid;
    grid-template-columns: 5rem minmax(0, 1fr) minmax(9rem, 20rem);
    gap: 16px;
    align-items: baseline;
    min-height: 44px;
    padding: 12px 0;
}

.meta {
    margin-top: .5em;
}

.index-row p,
.event-row p {
    margin: 2px 0 0;
}

.row-title {
    display: inline-block;
    overflow-wrap: anywhere;
}

.release-title::before {
    content: "⭑ "
}

.release-title::after {
    content: " ⭑"
    
}

.row-links a+a {
    margin-left: 12px;
}

.link-entry,
.event-date {
    min-width: 0;
}

.work-grid {
    column-count: 2;
    column-gap: 36px;
}

.work-card {
    break-inside: avoid;
    margin-bottom: 48px;
}

.work-grid.is-flow {
    position: relative;
    column-count: initial;
    column-gap: normal;
}

.work-grid.is-flow .work-card {
    position: absolute;
    width: calc(50% - 18px);
    margin-bottom: 0;
}

/* end-of-item mark, so one artwork ends and the next begins */
.work-card::after {
    content: "· ✦ ·";
    display: block;
    margin-top: 48px;
    text-align: center;
}

.work-card:last-child::after {
    content: none;
}

.work-card p:last-child {
    margin-bottom: 0;
}

.work-media,
.photo-placeholder {
    display: grid;
    place-items: center;
    aspect-ratio: 4/3;
    color: var(--canvas);
    background: var(--ink);
}

.work-media {
    text-decoration: none;
}

.work-media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: var(--canvas);
}

.work-media span {
    padding: 16px;
}

.artwork-figure {
    margin: 40px 0;
}

.artwork-figure img {
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
}

.film-trailer iframe {
    display: block;
    width: 100%;
    aspect-ratio: 16/9;
    border: 0;
}

.media-missing {
    padding: 16px 0;
}

.footer {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 24px;
    padding-block: 48px 64px;
    font-size: 13px;
}

.footer::before {
    content: "✦ ✦ ✦";
    flex-basis: 100%;
    text-align: center;
}

.footer::after {
    content: "~ best viewed with iA Writer Quattro ~";
    flex-basis: 100%;
    text-align: center;
}

.footer p {
    margin: 0;
}

/* --- menu --- */
.menu-sentinel {
    height: 1px;
}

.menu-anchor {
    min-height: 60px;
}

.menu {
    position: relative;
    z-index: 2;
}

.menu>summary {
    display: block;
    width: 100%;
    max-width: 50ch;
    min-height: 44px;
    margin-block-start: 8px;
    padding: 14px 0;
    color: var(--link);
    text-align: center;
    cursor: pointer;
    list-style: none;
}

.menu[open]>summary {
    display: none;
}

.menu>summary::-webkit-details-marker {
    display: none;
}

.menu>summary::marker {
    content: "";
}

.menu>summary::before {
    content: "∘⁘∘°∘⁘ ";
}

.menu>summary::after {
    content: " ⁘∘°∘⁘∘";
}

.menu-layer {
    padding-block: 8px;
}

.menu-surface {
    padding-block: 8px;
}

.menu-list,
.menu-list ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.menu-list::before,
.menu-list::after {
    content: "∘°∘°∘°∘°∘°∘°∘°∘°∘°∘°∘°∘°";
    display: block;
    overflow: hidden;
    white-space: nowrap;
    padding-block: 6px;
    font-size: 13px;
    line-height: 1.2;
}

.menu-list a,
.menu-group-label {
    display: block;
    min-height: 44px;
    padding: 10px 0;
}

.menu-list a.current {
    color: var(--ink);
    text-decoration: none;
}

.menu-group ul a {
    padding-left: 16px;
}

.menu-group-label::before {
    content: "« ";
}

.menu-group-label::after {
    content: " »";
}

/* --- mobile menu mechanics (matches site.js threshold) --- */
@media (max-width: 959px) {

    .masthead {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
        padding-block: 40px 16px;
    }

    .index-row,
    .event-row {
        display: block;
        padding-block: 16px;
    }

    .index-row time,
    .index-row>.index-year,
    .event-date {
        display: block;
        margin-bottom: 4px;
    }

    .event-date time {
        display: inline;
    }

    .row-side,
    .status {
        display: block;
        margin-top: 4px;
        text-align: left !important;
    }

    .work-grid {
        column-count: 1;
    }

    .work-grid.is-flow {
        position: static;
        height: auto !important;
    }

    .work-grid.is-flow .work-card {
        position: static;
        width: auto;
        top: auto !important;
        left: auto !important;
    }

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

    .menu-anchor.is-sticky .menu {
        position: fixed;
        top: 0;
        right: 0;
        left: 0;
        z-index: 4;
        padding: 8px 20px;
        background: var(--canvas);
    }

    .menu.is-enhanced[open]>.menu-layer {
        position: fixed;
        inset: 0;
        z-index: 5;
        display: block;
        overflow: auto;
        padding: 40px 20px;
        background: var(--canvas);
    }

    .menu.is-enhanced[open] .menu-surface {
        max-width: 80rem;
        margin-inline: auto;
        padding: 0;
    }

    .menu.is-enhanced:not([open])>.menu-layer {
        display: none;
    }

    .menu.is-enhanced[open] .menu-group ul a {
        padding-left: 16px;
    }
}

/* --- desktop --- */
@media (min-width: 960px) {

    .shell {
        width: min(72rem, calc(100% - 96px));
    }

    .layout {
        display: grid;
        grid-template-columns: 12rem minmax(0, 1fr);
        gap: 64px;
    }

    .menu-anchor {
        min-height: 44px;
    }

    .menu {
        position: sticky;
        top: 24px;
    }

    .menu>summary {
        display: none;
    }

    .menu-layer {
        display: block !important;
    }

    .menu-surface {
        padding: 0;
    }

    .menu-group {
        margin-top: 24px;
    }

    main {
        padding-block-start: 0;
    }

    .index,
    .event-row,
    .section-heading {
        max-width: 68rem;
    }
}