body {
    font-family: "Hiragino Sans GB", "PingFang SC", "STHeiti", "Heiti SC", "Noto Sans CJK SC", "Microsoft YaHei", Arial, sans-serif;
    font-weight: 400;
    background: #18221f;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -2;
    background-image: linear-gradient(90deg, rgba(18, 29, 25, 0.78), rgba(247, 244, 237, 0.52)), url("assets/cover.jpg");
    background-position: center;
    background-size: cover;
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background: radial-gradient(circle at 50% 28%, rgba(239, 230, 211, 0.22), transparent 34%),
                linear-gradient(180deg, rgba(18, 29, 25, 0.15), rgba(18, 29, 25, 0.46));
    pointer-events: none;
}

@media screen and (prefers-reduced-motion: no-preference) {
    body.switched {
        transition: color 0.6s, background-color 0.6s;
    }
}

h1,
h2 {
    text-align: center;
    font-family: Georgia, "Hiragino Sans GB", "PingFang SC", "STHeiti", "Heiti SC", serif;
    margin: 0;
    padding: 0;
}

h1 {
    font-size: 30pt;
    margin-bottom: 10px;
}

h2 {
    font-size: 14pt;
    font-style: italic;
    font-family: "Hiragino Sans GB", "PingFang SC", "STHeiti", "Heiti SC", Arial, sans-serif;
    font-weight: 400;
    color: #BBB;
}

.header {
    padding-top: 3em;
    padding-bottom: 3em;
}

/*
  Built-in class:
    # author: Name
*/
.byline {
    font-style: italic;
}

.written-in-ink {
    z-index: 3;
    font-size: 9pt;
    font-family: "Hiragino Sans GB", "PingFang SC", "STHeiti", "Heiti SC", Arial, sans-serif;
    text-align: center;
    font-weight: 700;
    position: fixed;
    display: block;
    width: 100%;
    background: rgba(247, 244, 237, 0.86);
    margin: 0;
    padding-top: 6px;
    padding-bottom: 6px;
    height: 14px;
    top: 0;
}

@media screen and (prefers-reduced-motion: no-preference) {
    .written-in-ink {
        transition: color 0.6s, background 0.6s;
    }
}

/* 
  Enables <iframe> support work on itch.io when using mobile iOS
*/
.outerContainer {
    position: absolute;
    display: block;
    margin: 0;
    padding: 0;
    -webkit-overflow-scrolling: touch;
    overflow: scroll;
    overflow-x: hidden;
    height: 100%;
    width: 100%;
    top: 0;
    left: 0;
    margin-top: 24px;
    background-color: transparent;
    background-size: cover;
    background-repeat: no-repeat;
}

@media screen and (max-width: 980px) {
    .outerContainer {
        margin-top: 44px;
        background-size: cover;
        background-repeat: no-repeat;
    }
}

.container {
    display: block;
    max-width: 640px;
    margin: 0 auto;
    min-height: 100vh;
    padding: 24px 34px;
    padding-top: min(18vh, 7em);
    padding-bottom: 72vh;
    background: rgba(251, 250, 247, 0.94);
    box-shadow: 0 0 0 1px rgba(44, 68, 59, 0.08), 0 24px 80px rgba(20, 28, 24, 0.20);
    backdrop-filter: blur(1.5px);
}

@media screen and (prefers-reduced-motion: no-preference) {
    .switched .container {
        transition: background-color 0.6s;
    }
}

p {
    font-size: 13.5pt;
    color: #2f312b;
    line-height: 1.85em;
    font-weight: 400;
    margin: 0 0 1.05em 0;
}

a {
    font-weight: 700;
    color: #315f55;
    font-family: inherit;
    text-decoration: none;
}

.unclickable {
    font-weight: 700;
    color: #4f3411;
    font-family: inherit;
    text-decoration: none;
    cursor: not-allowed;
}

a:hover {
    color: #8a5a1d;
}

@media screen and (prefers-reduced-motion: no-preference) {
    a {
        transition: color 0.6s;
    }

    a:hover {
        transition: color 0.1s;
    }
}

strong {
    color: black;
    font-weight: bold;
}

img {
    display: block;
    margin: 0 auto;
    max-width: 100%;
}

.container .hide {
    opacity: 0.0;
}

.container .invisible {
    display: none;
}

.container>* {
    opacity: 1.0;
}

@media screen and (prefers-reduced-motion: no-preference) {
    .container>* {
        transition: opacity 1.0s;
    }
}

/*
  Class applied to all choices
  (Will always appear inside <p> element by default.)
*/
.choice {
    text-align: center;
    line-height: 1.7em;
    margin-top: 1.2em;
}

/* 
  Class applied to first choice
*/
:not(.choice)+.choice {
    padding-top: 1em;
}

/*
  Class applied to choice links
*/
.choice a, .choice span {
    font-size: 15pt;
    display: inline-block;
    min-width: min(18em, 82%);
    padding: 0.7em 1em;
    border: 1px solid rgba(49, 95, 85, 0.28);
    background: rgba(236, 231, 217, 0.72);
    box-shadow: 0 8px 24px rgba(48, 58, 52, 0.08);
}

.choice a:hover {
    border-color: rgba(138, 90, 29, 0.45);
    background: rgba(246, 239, 220, 0.94);
}

/* 
  Built-in class:
    The End # CLASS: end
*/
.end {
    text-align: center;
    font-weight: bold;
    color: black;
    padding-top: 20px;
    padding-bottom: 20px;
}

#controls {
    z-index: 4;
    font-size: 9pt;
    text-align: center;
    padding-bottom: 6px;
    background: rgba(247, 244, 237, 0.86);
    position: fixed;
    right: 14px;
    top: 4px;
    user-select: none;
}

.cover-screen {
    position: fixed;
    inset: 0;
    z-index: 20;
    display: grid;
    grid-template-columns: minmax(260px, 38vw) 1fr;
    align-items: center;
    gap: 5vw;
    padding: 8vh 8vw;
    background: linear-gradient(90deg, rgba(246, 241, 226, 0.94), rgba(246, 241, 226, 0.58)),
                url("assets/cover.jpg") center/cover;
    color: #223c36;
}

.cover-screen.dismissed {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.cover-mark {
    width: min(34vw, 360px);
    aspect-ratio: 1;
    justify-self: end;
    background: url("assets/cover.jpg") center/cover;
    box-shadow: 0 22px 70px rgba(24, 34, 31, 0.28);
}

.cover-copy {
    align-self: center;
    max-width: 26em;
}

.cover-kicker {
    margin-bottom: 0.4em;
    color: #6d5c3e;
    font-size: 10pt;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: uppercase;
}

.cover-copy h1 {
    text-align: left;
    color: #203b34;
    font-size: clamp(42px, 8vw, 92px);
    line-height: 1;
    margin-bottom: 0.08em;
}

.cover-subtitle {
    color: #315f55;
    font-family: Georgia, 'Times New Roman', Times, serif;
    font-size: clamp(22px, 3.5vw, 40px);
    margin-bottom: 1.4em;
}

#begin-reading {
    appearance: none;
    border: 1px solid rgba(35, 61, 54, 0.28);
    background: #203b34;
    color: #f6efe0;
    padding: 0.8em 2.4em;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 10px 28px rgba(32, 59, 52, 0.24);
}

#begin-reading:hover {
    background: #315f55;
}

@media screen and (prefers-reduced-motion: no-preference) {
    .cover-screen {
        transition: opacity 0.6s ease, visibility 0.6s ease;
    }

    .choice a,
    #begin-reading {
        transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
    }
}

@media screen and (max-width: 760px) {
    .container {
        padding-left: 22px;
        padding-right: 22px;
        padding-bottom: 76vh;
    }

    .cover-screen {
        grid-template-columns: 1fr;
        align-content: center;
        gap: 3vh;
        padding: 6vh 9vw;
    }

    .cover-mark {
        width: min(74vw, 310px);
        justify-self: start;
    }
}

@media screen and (prefers-reduced-motion: no-preference) {
    #controls {
        transition: color 0.6s, background 0.6s;
    }
}

#controls [disabled] {
    color: #ccc;
}

#controls>*:not(:last-child):after {
    content: " | ";
}

@media screen and (max-width: 980px) {
    #controls {
        z-index: 2;
        padding-top: 24px;
        top: 0;
        left: 0;
        right: 0;
    }
}

/* 
  Dark Theme (Added in Inky 0.10.0)
    # theme: dark
*/

body.dark {
    background: #12100d;
    color: #e2d8c8;
}

.dark h2 {
    color: #666;
}

.dark .container {
    background: rgba(24, 21, 17, 0.94);
}

.dark p {
    color: #eadfce;
}

.dark .written-in-ink {
    background: #12100d;
}

.dark a {
    color: #cc8f1a;
}
.dark .unclickable{
    color: #c4af87;
    cursor:not-allowed;
}

.dark a:hover {
    color: #f2e8d8;
}

@media screen and (prefers-reduced-motion: no-preference) {
    .dark a {
        transition: color 0.6s;
    }
}

.dark strong {
    color: #f2e8d8;
}

.dark #controls [disabled] {
    color: #444;
}

.dark .end {
    color: #f2e8d8;
}

.dark #controls {
    background: #12100d;
}
