@import url('https://fonts.googleapis.com/css2?family=Anonymous+Pro:ital,wght@0,400;0,700;1,400;1,700&family=Azeret+Mono:ital,wght@0,100..900;1,100..900&family=Courier+Prime:ital,wght@0,400;0,700;1,400;1,700&family=DM+Mono:ital,wght@0,300;0,400;0,500;1,300;1,400;1,500&family=Josefin+Sans:ital,wght@0,100..700;1,100..700&family=Roboto+Mono:ital,wght@0,100..700;1,100..700&family=Source+Code+Pro:ital,wght@0,200..900;1,200..900&display=swap');

html {
    box-sizing: border-box;
    font-size: 16pt;
    height: 100%;
    scrollbar-width: thin;
    scrollbar-color: #777 #222;
}

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

[data-theme='light'] {
    --color-bg: #fff;
    --color-fg: #010004;
}

[data-theme='dark'] {
    --color-bg: #010004;
    --color-fg: #fff;
}

body {
    margin: 0;
    line-height: 1;
    -webkit-text-size-adjust: none;
    background-color: var(--color-bg);
    color: var(--color-fg);
    font-family: 'Source Code Pro', sans-serif;
    font-weight: 400;
    font-size: 1rem;
    line-height: 1.65;
    height: 100%;
    opacity: 0;
    transition: 2s opacity;
    animation: fadeIn 2.3s forwards;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

body.fade-out {
    opacity: 0;
    transition: none;
}

body.is-preload *,
body.is-preload *:before,
body.is-preload *:after {
    animation: none !important;
    transition: none !important;
}

.home-cover {
    position: fixed;
    inset: 0;
    z-index: 1000;
    border: 0;
    padding: 0;
    margin: 0;
    width: 100%;
    height: 100vh;
    background: #010004 url("img/cover.jpg") no-repeat center;
    background-size: auto 100%;
    cursor: pointer;
    transition: opacity 1.1s ease;
}

.home-cover.is-fading {
    opacity: 0;
    pointer-events: none;
}

#story-content {
    opacity: 0;
    transition: opacity 0.8s ease;
}

#story-content.is-visible {
    opacity: 1;
    margin-top: min(20vh, 6rem);
}

#story-content.is-visible:has(#wrapper.error-page) {
    margin-top: 0;
}

#story-content.is-visible #wrapper > h2.major:first-of-type {
    margin-top: 0.35rem;
}

a {
    transition: color 0.2s ease-in-out, background-color 0.2s ease-in-out, border-bottom-color 0.2s ease-in-out;
    text-decoration: none;
    color: var(--color-fg);
    border-bottom: 0.1rem dashed;
}

a:hover {
    border-bottom-color: transparent;
    opacity: 1;
    transition: 0.5s ease-in-out;
}

i {
    font-style: italic;
    font-weight: 700;
    font-size: 1.1rem;
}

em {
    font-style: italic;
    font-size: 1.2rem;
    font-weight: 800;
}

b {
    font-weight: 600;
    font-style: italic;
}

p {
    text-align: center;
}

mark {
    font-style: italic;
    font-weight: 600;
    font-size: 1.1rem;
    line-height: 1.5rem;
    background-color: var(--color-fg);
    color: var(--color-bg);
    opacity: 0.8;
    padding: 0;
    box-shadow: 0.4rem 0 0 var(--color-fg), -0.4rem 0 0 var(--color-fg);
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
}

.pcss {
    margin: 0 0 2rem 0;
    font-size: 1rem;
    line-height: 1.4rem;
    white-space: pre;
    max-width: min(92vw, 74ch);
}

h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--color-fg);
    font-weight: 600;
    line-height: 1.5;
    margin: 0 0 1rem 0;
    text-transform: lowercase;
    letter-spacing: 0.2rem;
}

h1 {
    font-size: 2.7rem;
    line-height: 1.3;
    letter-spacing: 1.2rem;
}

h2 {
    font-size: 1.5rem;
    line-height: 1.4;
    letter-spacing: 0.3rem;
}

h1.major,
h2.major,
h3.major,
h4.major,
h5.major,
h6.major {
    width: max-content;
    padding-bottom: 0.5rem;
    margin: 4rem 0 1.5rem 0;
}

h2.major {
    letter-spacing: 0.1rem;
    font-style: italic;
    opacity: 0.7;
}

#wrapper.error-page {
    justify-content: center;
    padding-top: min(5vh, 2rem);
    padding-bottom: 3rem;
    box-sizing: border-box;
}

#wrapper.error-page .error-title {
    margin: 0 0 1.15rem 0;
    width: 100%;
    max-width: 100%;
    text-align: center;
    font-size: clamp(2.4rem, 10vw, 4.25rem);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: 0.32rem;
    text-transform: uppercase;
    font-style: normal;
    opacity: 0.38;
    color: var(--color-fg);
}

#wrapper.error-page .error-subtitle {
    margin: 0;
    max-width: min(40ch, 92vw);
    text-align: center;
    font-size: clamp(0.95rem, 2.8vw, 1.2rem);
    font-weight: 600;
    font-style: normal;
    line-height: 1.55;
    letter-spacing: 0.06rem;
    text-transform: none;
    opacity: 0.9;
    color: var(--color-fg);
}

#wrapper.error-page .error-host {
    margin: 2.75rem 0 0 0;
    padding: 0 0.5rem;
    font-size: 0.65rem;
    letter-spacing: 0.22rem;
    text-transform: uppercase;
    opacity: 0.34;
    color: var(--color-fg);
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
}

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

.icon-bar {
    position: fixed;
    top: 1%;
    right: 1%;
    z-index: 500;
    transition: all 0.3s ease;
    overflow: hidden;
    height: 340px;
    opacity: 0.5;
    font-size: 1.3rem;
}

.icon-bar a {
    display: block;
    text-align: center;
    padding: 16px;
    margin: 2px;
    cursor: crosshair;
    border: none;
    text-transform: none;
}

.icon-bar:hover {
    opacity: 1;
}

.icon-bar #home-link {
    font-size: 2rem;
}

.icon-bar #top-toggle {
    display: none;
    font-size: 1.7rem;
}

.icon-bar--left {
    top: 1.5%;
    left: 1.5%;
    right: auto;
    height: auto;
}

.icon-bar--left .icon-bar__svg :where(path, rect, circle) {
    stroke-width: 1.9;
}

.icon-bar__svg {
    display: block;
    width: 1.35rem;
    height: 1.35rem;
    margin: 0 auto;
}

.icon-bar__svg--stroke {
    overflow: visible;
}

#wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    position: relative;
    min-height: 100vh;
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
    padding: 3rem 1rem;
    z-index: 3;
}

#wrapper:before {
    content: '';
    display: block;
}

#footer {
    width: 100%;
    max-width: 100%;
    margin-top: 2rem;
    text-align: center;
}

@media screen and (max-width: 1680px) {
    html {
        font-size: 12pt;
    }

    #wrapper {
        padding: 3rem 2rem;
    }
}

@media screen and (max-width: 736px) {
    html {
        font-size: 11pt;
    }

    h1 {
        font-size: 1.75rem;
        line-height: 1.4;
    }

    h2 {
        font-size: 1.25em;
        line-height: 1.5;
    }

    .icon-bar {
        top: 10%;
        right: 0;
    }

    .icon-bar--left {
        top: 1.5%;
        left: 1.5%;
        right: auto;
    }

    #wrapper {
        padding: 2rem 1rem;
    }

    .pcss {
        white-space: pre-wrap;
        overflow-wrap: anywhere;
        word-break: break-word;
        font-size: 0.98rem;
        line-height: 1.52;
    }

    h2.major {
        margin-top: 2.6rem;
        margin-bottom: 1rem;
    }
}

@media screen and (max-width: 480px) {
    html {
        font-size: 10pt;
    }

    html,
    body {
        min-width: 320px;
    }

    #wrapper {
        padding: 1rem;
    }

    .pcss {
        font-size: 0.95rem;
        line-height: 1.48;
    }
}
