@font-face {
    font-family: "saitama";
    src: url("webfonts/Saitamaar-Regular.woff2");
}

:root {
    --cursor-default: url("windows98cur/Cursor79.cur"), default;
    --cursor-text: url("windows98cur/Cursor80.cur"), text;
    --cursor-pointer: url("windows98cur/Cursor107.cur"), pointer;
    --cursor-busy: url("windows98cur/Cursor83.cur"), wait;
    --cursor-help: url("windows98cur/Cursor103.cur"), help;
    --cursor-unavailable: url("windows98cur/Cursor99.cur"), not-allowed;
    --selection-background: #0b40ff;
    --selection-color: #fff35c;
}

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

::-moz-selection {
    background: var(--selection-background);
    color: var(--selection-color);
}

html,
body {
    --page-background: #000000;
    --panel-background: transparent;
    --text-color: #ffffff;
    --muted-color: rgba(255, 255, 255, 0.68);
    --border-color: #ffffff;
    --rule-color: rgba(255, 255, 255, 0.25);
    --toggle-hover-background: #0b40ff;
    --toggle-hover-color: #fff35c;
    margin: 0;
    padding: 1.25rem;
    color: var(--text-color);
    background: var(--page-background);
    font-family: "saitama", sans-serif;
    cursor: var(--cursor-default);
}

body.light-mode {
    --page-background: #ffffff;
    --panel-background: transparent;
    --text-color: #000000;
    --muted-color: rgba(0, 0, 0, 0.7);
    --border-color: #000000;
    --rule-color: rgba(0, 0, 0, 0.22);
    --toggle-hover-background: #0b40ff;
    --toggle-hover-color: #fff35c;
}

button,
input,
textarea,
select {
    font: inherit;
}

input:not([type]),
input[type="email"],
input[type="number"],
input[type="password"],
input[type="search"],
input[type="tel"],
input[type="text"],
input[type="url"],
textarea {
    cursor: var(--cursor-text);
}

a {
    color: inherit;
    text-underline-offset: 0.18em;
    cursor: var(--cursor-pointer);
}

p,
dl,
dt,
dd {
    margin: 0;
}

summary {
    cursor: var(--cursor-pointer);
    list-style: none;
}

summary::-webkit-details-marker {
    display: none;
}

.home-page {
    min-height: 100vh;
    padding: 0;
}

.site-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0;
    align-items: start;
    margin-bottom: 0;
}

.site-brand {
    display: block;
}

.site-title {
    margin: 0;
    font-size: clamp(3rem, 10vw, 5.5rem);
    line-height: 0.9;
}

.site-utility {
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    gap: 0.75rem;
}

.mode-toggle,
#toggleButton {
    border: 0;
    background: transparent;
    color: inherit;
    padding: 0;
    cursor: var(--cursor-pointer);
    text-decoration: underline;
    text-underline-offset: 0.18em;
}

button,
select,
label[for],
input[type="button"],
input[type="checkbox"],
input[type="color"],
input[type="file"],
input[type="image"],
input[type="radio"],
input[type="range"],
input[type="reset"],
input[type="submit"] {
    cursor: var(--cursor-pointer);
}

button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
    cursor: var(--cursor-unavailable);
}

.site-clock {
    min-width: 9rem;
    padding: 0;
    text-align: right;
}

.time-row {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.ime-indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1rem;
    font-size: 0.95em;
    line-height: 1;
}

.portal-grid {
    display: grid;
    grid-template-columns: minmax(15rem, 20rem) minmax(0, 1.35fr) minmax(16rem, 22rem);
    gap: 0;
    align-items: start;
}

.portal-column {
    display: grid;
    gap: 0;
    border-top: 1px solid var(--border-color);
    border-left: 1px dotted var(--rule-color);
}

.portal-column:first-child {
    border-left: 0;
}

.portal-panel {
    display: flex;
    flex-direction: column;
    background: var(--panel-background);
    border-bottom: 1px solid var(--border-color);
}

.panel-heading {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.1rem 0.25rem;
    border-bottom: 1px solid var(--border-color);
    background: transparent;
    color: inherit;
    letter-spacing: 0;
}

.panel-heading::before {
    content: "-";
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 0.75rem;
    height: 0.75rem;
    line-height: 1;
    flex: 0 0 0.75rem;
    transform: rotate(90deg);
    transform-origin: center;
}

.portal-panel[open] > .panel-heading::before {
    content: "+";
    transform: rotate(45deg);
}

.panel-body {
    display: grid;
    gap: 0.45rem;
    padding: 0.2rem 0.25rem 0.45rem;
}

.gallery-subsections {
    display: grid;
    gap: 0;
}

.portal-links {
    display: grid;
    gap: 0.1rem;
}

.portal-links a {
    padding-bottom: 0.2rem;
    border-bottom: 1px dotted var(--rule-color);
    text-decoration: none;
}

.portal-stats {
    display: grid;
    gap: 0.2rem;
}

.portal-stats div {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.4rem;
    align-items: end;
    padding-bottom: 0.2rem;
    border-bottom: 1px dotted var(--rule-color);
}

.portal-stats dd {
    font-size: 1rem;
}

.diary-list,
.music-list,
.gallery-notes,
#entries {
    display: grid;
    gap: 0.35rem;
}

.diary-card,
.music-card,
.gallery-note {
    display: grid;
    gap: 0.2rem;
    padding-bottom: 0.35rem;
    border-bottom: 1px dotted var(--rule-color);
}

.diary-card:last-child,
.music-card:last-child,
.gallery-note:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.entry-title,
.music-title {
    margin: 0;
    font-size: 1rem;
    line-height: 1.1;
}

.entry-snippet,
.gallery-note p {
    line-height: 1.35;
    white-space: pre-wrap;
}

.entry-meta,
.music-meta,
.archive-entry-date,
.portal-stats dt {
    color: var(--muted-color);
}

.entry-image,
.post-image {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    border: 1px solid var(--border-color);
    background: transparent;
}

.post-audio-player {
    display: grid;
    gap: 0.45rem;
    width: 100%;
    padding: 0.55rem 0.65rem 0.65rem;
    border: 2px solid var(--border-color);
    background: transparent;
    box-sizing: border-box;
}

.post-audio-time {
    font-size: 0.84rem;
    line-height: 1.1;
    letter-spacing: 0.02em;
    text-transform: lowercase;
}

.post-audio-controls {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.6rem;
    align-items: center;
}

.post-audio-toggle {
    min-width: 4.6rem;
    padding: 0.32rem 0.55rem;
    border: 2px solid var(--border-color);
    border-radius: 0;
    background: transparent;
    color: inherit;
    line-height: 1;
    text-transform: lowercase;
}

.post-audio-toggle:hover,
.post-audio-toggle:focus-visible {
    background: var(--toggle-hover-background);
    color: var(--toggle-hover-color);
    outline: 0;
}

.post-audio-time {
    min-width: 0;
    text-align: right;
}

.post-audio-progress {
    --progress-value: 0%;
    width: 100%;
    height: 1rem;
    margin: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    -webkit-appearance: none;
    appearance: none;
}

.post-audio-progress:focus-visible {
    outline: 0;
}

.post-audio-progress::-webkit-slider-runnable-track {
    height: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 0;
    background: linear-gradient(
        to right,
        var(--text-color) 0,
        var(--text-color) var(--progress-value),
        transparent var(--progress-value),
        transparent 100%
    );
}

.post-audio-progress::-webkit-slider-thumb {
    width: 0.7rem;
    height: 1.45rem;
    margin-top: -0.28rem;
    border: 2px solid var(--border-color);
    border-radius: 0;
    background: var(--page-background);
    -webkit-appearance: none;
    appearance: none;
}

.post-audio-progress::-moz-range-track {
    height: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 0;
    background: transparent;
}

.post-audio-progress::-moz-range-progress {
    height: 1rem;
    border: 2px solid var(--border-color);
    border-right: 0;
    border-radius: 0;
    background: var(--text-color);
    box-sizing: border-box;
}

.post-audio-progress::-moz-range-thumb {
    width: 0.7rem;
    height: 1.45rem;
    border: 2px solid var(--border-color);
    border-radius: 0;
    background: var(--page-background);
    box-sizing: border-box;
}

.post-audio-media {
    display: none;
}

.archive-tree {
    display: grid;
    gap: 0.25rem;
}

.archive-year,
.archive-month {
    padding-bottom: 0.2rem;
    border-bottom: 1px dotted var(--rule-color);
}

.archive-year > .archive-month {
    margin-left: 1rem;
}

.archive-year:last-child,
.archive-month:last-child {
    border-bottom: 0;
}

.archive-year-summary,
.archive-month-summary,
.month-summary {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.15rem 0;
}

.archive-year-summary::before,
.archive-month-summary::before,
.month-summary::before {
    content: "+";
    display: inline-block;
    min-width: 0.75rem;
}

details[open] > .archive-year-summary::before,
details[open] > .archive-month-summary::before,
details[open] > .month-summary::before {
    content: "-";
}

.panel-heading:hover,
.archive-year-summary:hover,
.archive-month-summary:hover,
.month-summary:hover {
    background: var(--toggle-hover-background);
    color: var(--toggle-hover-color);
}

.archive-entry-list {
    display: grid;
    gap: 0.15rem;
    padding: 0.2rem 0 0.2rem 0.8rem;
}

.archive-entry {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.65rem;
    align-items: baseline;
}

.archive-entry-title {
    line-height: 1.3;
}

#time {
    margin-bottom: 1rem;
}

.post {
    margin: 0.75rem 0 1.25rem 1.5rem;
}

.post-collapsible {
    border-bottom: 1px dotted var(--rule-color);
}

.post-collapsible:last-child {
    margin-bottom: 0;
}

.post-summary {
    display: grid;
    grid-template-columns: 0.75rem minmax(0, 1fr);
    column-gap: 0.35rem;
    row-gap: 0.18rem;
    padding: 0 0 0.5rem;
    cursor: pointer;
    list-style: none;
}

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

.post-summary::before {
    content: "+";
    grid-column: 1;
    grid-row: 1;
    align-self: start;
    width: 0.75rem;
}

details[open] > .post-summary::before {
    content: "-";
}

.post-summary:focus-visible {
    outline: 0;
}

.post-summary:hover .post-summary-title,
.post-summary:focus-visible .post-summary-title {
    background: var(--toggle-hover-background);
    color: var(--toggle-hover-color);
}

.post-title {
    margin: 0 0 0.25rem;
    font-size: 1rem;
}

.post-summary .post-title {
    grid-column: 2;
    margin-bottom: 0;
}

.post-summary-title {
    display: inline-block;
    width: fit-content;
    padding: 0 0.18rem;
}

.post-meta {
    margin: 0 0 0.5rem;
    color: var(--muted-color);
}

.post-summary .post-meta {
    grid-column: 2;
    margin-bottom: 0;
}

.post-preview {
    grid-column: 2;
    margin: 0;
    color: var(--muted-color);
    line-height: 1.35;
}

details[open] > .post-summary > .post-preview {
    display: none;
}

.post-body {
    white-space: pre-wrap;
    line-height: 1.55;
}

.post-collapsible > .post-body {
    padding: 0 0 0.75rem;
}

@media (max-width: 980px) {
    .portal-grid {
        grid-template-columns: 1fr;
    }

    .site-header {
        grid-template-columns: 1fr;
    }

    .site-utility {
        justify-content: space-between;
    }

    .portal-column {
        border-left: 0;
    }
}

@media (max-width: 620px) {
    .site-title {
        font-size: clamp(2.5rem, 18vw, 4rem);
    }

    .post-audio-controls {
        grid-template-columns: 1fr;
    }

    .post-audio-time {
        text-align: left;
    }
}
