@import url('https://fonts.googleapis.com/css2?family=Abhaya+Libre:wght@400;500;600;700;800&display=swap');

@font-face {
  font-family: "Catt Handwriting";
  src: url("assets/fonts/catt-handwriting.woff2") format("woff2"),
       url("assets/fonts/catt-handwriting.woff") format("woff"),
       url("assets/fonts/catt-handwriting.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

body {
    /* COLORS */
    --white: #FAF8F7;
    --black: #030202;
    --gray-darker: #616060;
    --gray-dark: #7A7979;
    --gray: #949392;
    --gray-light: #C7C5C5;
    --gray-lighter: #E0DFDE;
    --brand: #FA2A00;
    --brand-dark: #C72100;
    --brand-darker: #941900;
    --brand-light: #FA927D;
    --brand-lighter: #FAD0C8;

    /* STYLES */
    margin: 0;
    font-family: "Abhaya Libre", serif;
    font-weight: lighter;
    overflow: hidden;
    color: var(--black);
    background-color: var(--white);
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background: url(assets/images/texture-halftone.png) repeat;
    background-size: 150px;
    z-index: -1;
}

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

h1, h2, h3, h4, h5, h6 {
    font-family: "Catt Handwriting", sans-serif;
}

h1, h2 {
    margin: 0;
    padding: 0;
}

h1 {
    font-size: 4em;
    margin-bottom: 10px;
}

h2 {
    font-size: 1.75em;
    color: var(--gray-dark);
}

.header {
    padding-bottom: 1.5em;
}

ul {
    margin-top: .5em;
}

noscript ul {
    font-size: 2em;
    color: var(--gray-darker);
}

noscript li {
    margin-bottom: .75em;
}

noscript h2 {
    font-size: 3em;
    margin-top: 1em;
    margin-bottom: .5em;
}

/*
  Built-in class:
    # author: Name
*/
.byline {
    margin-top: .5em;
}

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

.container {
    display: block;
    max-width: 1080px;
    margin: 1em auto;
    padding: 3em 4em;
    background-color: var(--white);
    border-radius: 24px;
    box-sizing: border-box;
}

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

p {
    font-size: 2em;
    color: var(--gray-darker);
    line-height: 1.5em;
    font-weight: lighter;
}

.content-warning {
    display: block;
    background-color: var(--brand-lighter);
    border-radius: 12px;
    color: var(--black);
    line-height: 1.25em;
    position: relative;
    isolation: isolate;
}

.content-warning::before {
    content: "";
    position: absolute;
    inset: 0;
    background: url(assets/images/texture-halftone.png) repeat;
    background-size: 150px;
    z-index: -1;
    filter: invert(1);
    border-radius: 12px;
}

.content-warning em {
    display: block;
    font-family: "Catt Handwriting", sans-serif;
    font-size: .75em;
    margin-bottom: .25em;
    background-color: var(--brand-lighter);
    padding: 1rem 1.5rem;
    border-radius: 12px 12px 0 0;
}

.content-warning i {
    display: block;
    padding: 1.5rem;
    font-weight: 600;
    font-style: normal;
}

a {
    font-weight: 700;
    color: var(--brand-dark);
    text-decoration: none;
}

.unclickable {
    font-weight: 700;
    color: var(--brand-lighter);
    text-decoration: none;
    cursor: not-allowed;
}

a:hover {
    color: var(--brand);
}

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

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

strong {
    font-weight: bold;
}

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

.container .invisible {
    display: none;
}

.container>* {
    opacity: 1.0;
}

.container .pending {
  opacity: 0;
  pointer-events: none;   /* invisible choices can't be clicked mid-fade */
}

@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 {
    font-family: "Catt Handwriting", sans-serif;
    font-size: 2em;
    display: inline-block;
    line-height: 1.7em;
    margin: .75em 2em .5em 0;
}

.choice a {
    display: inline-block;
    position: relative;
    padding-left: 1.5em;
}

.choice a::before {
  content: "";
  display: inline-block;
  width: 1.2em;
  height: 1.2em;
  position: absolute;
  left: 0;
  top: 0.2em;
  background: url(assets/images/option-animation.gif) no-repeat center / contain;
}

@media (prefers-reduced-motion: reduce) {
    .choice a::before {
        background-image: url(assets/images/option-static.png);
    }
}

.quote {
    color: var(--black);
    font-family: "Catt Handwriting", sans-serif;
    font-size: .75em;
    line-height: 1.75em;
    display: block;
    padding: 0 0 .5em 1em;
    border-left: 2px solid var(--gray-lighter);
}

.quote-credit {
    display: block;
    font-family: "Catt Handwriting", sans-serif;
    font-size: .5em;
    line-height: 1.5em;
    padding-left: 1em;
    border-left: 2px solid var(--gray-lighter);
}

.quote-credit::before {
    content: "– ";
}

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

.hide {
    display: none !important;
}

input[type="text"] {
    padding: 0 0 .25em;
    font-family: "Abhaya Libre", serif;
    font-size: 1.5em;
    background:none;
    border-width: 0 0 3px 0;
    border-style: solid;
    border-color: var(--black);
    color: var(--black);
    width: 100%;
}

input[type="text"]:hover {
    border-color: var(--gray-darker);
    border-style: dashed;
}

input[type="text"]::placeholder {
    color: var(--gray);
}

input[type="text"]:hover::placeholder {
    color: var(--gray-light);
}

input[type="text"]:focus::placeholder {
    color: var(--gray-lighter);
}

#controls {
    z-index: 4;
    font-size: 9pt;
    margin-bottom: 2em;
    user-select: none;
}

#controls a {
    cursor: pointer;
    display: inline-block;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background-repeat: no-repeat;
    background-size: 24px;
    background-position: center;
    margin-right: .5em;
    opacity: .75;
    position: relative;
}

#controls a#theme-switch::before {
    background: url(assets/images/control-contrast.png);
    background-repeat: no-repeat;
    background-size: 24px;
    background-position: center;
    content: "";
    position: absolute;
    width: 100%;
    height: 100%;
    z-index: -1;
}

#controls a#rewind {
    background-image: url(assets/images/control-home.png);
}

#controls a#back {
    background-image: url(assets/images/control-rewind.png);
}

#controls a:hover {
    background-color: var(--gray-light);
    background-size: 28px;
}

#controls a#theme-switch:hover::before {
    transform: rotate(180deg);
}

#controls a:active {
    background-color: var(--gray);
}

.dark #controls a {
    filter: invert(1);
}

/* MEDIA QUERIES */

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

    #controls a {
        transition: background-color 0.6s, background-size 0.6s;
    }

    #controls a::before {
        transition: transform 0.6s;
    }
}

#controls [disabled] {
    color: var(--gray-light);
}

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

body.dark {
    background-color: var(--black);
    color: var(--white);
}

body.dark::before {
    filter: invert(1);
}

.dark .container {
    background-color: var(--black);
}

.dark h2 {
    color: var(--gray-light);
}

.dark p {
    color: var(--gray);
}

.dark a {
    color: var(--brand);
}

.dark .unclickable{
    color: var(--gray-darker);
    cursor:not-allowed;
}

.dark a:hover {
    color: var(--brand-light);
}

.dark .content-warning {
    color: var(--white);
    background-color: var(--brand-darker);
}

.dark .content-warning::before {
  filter: invert(0);
}

.dark .content-warning em {
    background-color: var(--brand-darker);
}

.dark input[type="text"] {
    border-color: var(--gray-lighter);
    color: var(--gray-lighter);
}

.dark input[type="text"]:hover {
    border-color: var(--white);
}

.dark input[type="text"]::placeholder {
    color: var(--gray-dark);
}

.dark input[type="text"]:hover::placeholder {
    color: var(--gray);
}

.dark input[type="text"]:focus::placeholder {
    color: var(--gray-darker);
}

.dark .quote {
  color: var(--white);
  border-left-color: var(--gray-darker);
}

.dark .quote-credit {
  border-left-color: var(--gray-darker);
}

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

.dark #controls [disabled] {
    color: var(--gray-darker);
}

.dark img {
    filter: invert(1);
}

.dark .choice a::before {
  filter: invert(1);
}

*:focus-visible {
    outline: 4px solid var(--brand);
    outline-offset: 8px;
}

input:focus, input:focus-visible, input:focus:hover, input:focus-visible:hover {
    outline: none;
    border-bottom-color: var(--brand);
    border-style: solid;
}

a:focus-visible {
    border-radius: 4px;
}

.dark *:focus-visible {
    outline-color: var(--brand-lighter);
}

.dark input:focus, .dark input:focus-visible, .dark input:focus:hover, .dark input:focus-visible:hover {
    border-color: var(--brand-light);
}

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

    h2 { 
        line-height: 1.35em;
    }

    .dark p {
        color: var(--gray-light);
    }
}

@media screen and (max-width: 540px) {
    .container {
        padding: 24px;
    }

    h1 {
        font-size: 2.5em;
        margin-bottom: .5em;
    }

    h2 { 
        font-size: 1.25em;
    }

    p {
        font-size: 1.5em;
    }

    #controls a {
        width: 40px;
        height: 40px;
        background-size: 32px;
    }

    #controls a:hover {
        background-size: 36px;
    }

    #controls a#theme-switch::before {
        background-size: 32px;
    }

    .choice {
        font-size: 1.5em;
        display: block;
        margin-right: 0;
    }

    noscript ul { font-size: 1.5em; }
    noscript h2 { font-size: 2em; }
}

@media screen and (min-width: 1420px) {
    .container {
        margin-left: auto;
        margin-right: auto;
        column-count: 2;
        column-gap: 3rem;
        font-size: .75em;
        max-width: 1280px;
    }

    /* header and controls stay full-width above the columns */
    #controls,
    .header {
        column-span: all;
    }

    .header {
        padding-bottom: 2em;
        font-size: 1.65em;
    }

    .container p {
        margin-top:0;
    }

    /* don't split a paragraph or image across columns */
    .container p,
    .container img {
        break-inside: avoid;
    }

    .choice {
        display: block;
        margin-right: 0;
    }
}