/*
  Palette lifted from the Jekyll "Hacker" theme (pages-themes/hacker),
  then pushed fully monochrome-green (classic phosphor-terminal look):
  every text color below is a shade of green, varied by lightness for
  hierarchy instead of by hue.
*/

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:ital,wght@0,400;0,700;1,400&display=swap');

:root {
    --green-dim: #4f7942;
    --green: #8fd14f;
    --green-rgb: 143, 209, 79;

    --green-dim-dark: #1f6b1f;
    --green-dark: #33cc33;
    --green-dark-rgb: 51, 204, 51;
}

body {
    font-family: "JetBrains Mono", Monaco, Consolas, "Lucida Console", monospace;
    font-weight: normal;
    font-size: 16px;
    line-height: 1.5;
    color: var(--green);
    background: #151515 url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAhQAAAIUAQMAAAB4tCemAAAABlBMVEUaGhobGxsh/u4NAAAEd0lEQVR4Xu3cPbKrMAwFYFOlZQdZqlkqS6BMFb2gHx/pZl6pVMcFk9yLvzQejZBlxjEeInKOTUTkPT5jk+N5f3qKyHH/YZ73df1N6tdjty9T4v7xfI0xlTwfN/T6kOPxvqH4JK9w7R/tBg0axzDwY+jKtUlqqHnPVBfk82Uz4pZ2gwYNDcd2yWtY1lqP9b8iNpa+jmNvN2jQQHDVMRUSRGIl7X4lNViLHBYt1P2hQYPGPBF/hxm+zG3S0k6f7j94dRs0aHjURQKBRy5RDctclHToSFnEbwwaNKBh6SOByBFbxMODrOrB3m7QoDHPXAaoaYOF43sEme6TFbG7DRo0Im14eLlAMNMSiLF5McGXvqCi4GNvN2jQkNMMLO53CtEDM59SAjOyjX6DBg08fEUNVqdvehdwn+5a/dV2gwYN1FalQD4TLgKzz0Si223QoJEnoVvgVYsJ9YFMvFwQta12gwaNqLeKFO0NA8WsPFNkRed+gwaNv3tV9zBfAdUkLtg6QBq89xs0aHj8Xb2B/mgWuMh/uloEOW63QYMG2v0QhGt6ixJCWfWrcLC3GzRoRO66rf0rNAiWZKHUwPw+g9oNGjRy7oowm7MDH+bmYB29gf0GDRoehGu5ChsGgk+3mxZ8bIBd7QYNGpm2LoDaIKjjURNdUWMF63aDBg0fcf+UeCqb0LD+PSbHD+pPX90GDRr3pDDQw6ozfVJEYnyNOO1z93aDBo3DpteGKnEI21noIbQLxjy7DRo0POBiEg6u4nQKsgM0ueAIYbtBg4ZWVJHFImPwgcoXKgp+X+x9Xd0GDRr5bD8gb2iJPiyD0BZobkCj3aBBA41/er9/ten6CYXYWoONX5Cr26BBA09bKByogS7Bep4KRS986jdo0EANVjUb2RhY4ch7BSlHv0GDBnr9UeVatw7UYG0mjgiEceztBg0ac61mpLz5kitfvv7tb7i0GzRoIG3QT/kxLCJxXeFIecNtN2jQQEegfB2wds0GcgdUGfSytxs0aES3Ss1xzcWhlnpspbZjj26DBg0deHmar+G8f7DV/djagnXj/QYNGticqlUuERylwj4rBipfV7tBg4YI3kyVX1ihBqqsquG38rPY3m7QoHE803OXhBaTUAiob6vKsbvfoEFjnisTgF/aApUsK9xGJBVXu0GDBo78QZt+wWsp10X/EYYovrcbNGjgZJWokY+olBLWKC0DU5BKtBs0aIipHoRrzUpd/Dd+ywz0sLYbNGhMVLRKlUu1wNGEjdenrgRi7zZo0DBLkCzEKymyJjGQ/CIh7jdo0KgvmazlAmzAWohW7V03wH5k0KDhRQKlaysAOlgQhPHa6ojY/QYNGmgFOGKFq5+TBQRmhb5OCnYbNGikcCw6QquTPLPFOQGcD+w3aNAQVFTxFnV0WvlXJBXhYteg26BBo/Tz53rrKrXipf7LrYWDebUbNGgMHKZOrf9IFrBDYLhezMU5rV6DBo3s59x1tbSqq1rKhSXHiKvdoEHj601/5fkMuwZ1wyBwjdP/ACfy2vdF7+1uAAAAAElFTkSuQmCC") 0 0;
    overflow: hidden;
}

@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: "JetBrains Mono", Monaco, Consolas, "Lucida Console", monospace;
    margin: 0;
    padding: 0;
}

h1 {
    font-size: 32px;
    font-weight: bold;
    letter-spacing: -1px;
    margin-bottom: 10px;
    color: var(--green);
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2),
                 0 0 5px rgba(var(--green-rgb), 0.4),
                 0 0 10px rgba(var(--green-rgb), 0.25);
}

h1:before {
    content: "./ ";
    color: var(--green-dim);
}

h2 {
    font-size: 16px;
    font-style: italic;
    font-family: "JetBrains Mono", Monaco, Consolas, "Lucida Console", monospace;
    font-weight: normal;
    color: var(--green-dim);
}

.header {
    padding-top: 3em;
    padding-bottom: 2em;
    margin-bottom: 1em;
    border-bottom: 1px dashed rgba(var(--green-rgb), 0.35);
}

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

.written-in-ink {
    z-index: 3;
    font-size: 12px;
    font-family: "JetBrains Mono", Monaco, Consolas, "Lucida Console", monospace;
    text-align: center;
    font-weight: bold;
    position: fixed;
    display: block;
    width: 100%;
    background: #151515;
    border-bottom: 1px dashed rgba(var(--green-rgb), 0.35);
    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-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;
    padding: 20px;
    padding-top: 4em;
    background: #151515;
}

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

p {
    font-size: 16px;
    color: var(--green);
    line-height: 1.6;
    font-weight: normal;
    overflow-wrap: break-word;
}

a {
    font-weight: bold;
    color: var(--green);
    font-family: "JetBrains Mono", Monaco, Consolas, "Lucida Console", monospace;
    text-decoration: none;
    text-shadow: 0 0 5px rgba(var(--green-rgb), 0.5);
}

.unclickable {
    font-weight: bold;
    color: var(--green-dim);
    font-family: "JetBrains Mono", Monaco, Consolas, "Lucida Console", monospace;
    text-decoration: none;
    cursor: not-allowed;
}

a:hover {
    color: var(--green);
    text-shadow: 0 0 5px rgba(var(--green-rgb), 0.6), 0 0 10px rgba(var(--green-rgb), 0.3);
}

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

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

strong {
    color: var(--green);
    font-weight: bold;
}

img {
    display: block;
    margin: 0 auto;
    max-width: 100%;
    border: 1px solid rgba(var(--green-rgb), 0.2);
}

.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;
}

.choice:before {
    content: "> ";
    color: var(--green-dim);
}

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

/*
  Class applied to choice links
*/
.choice a, .choice span {
    font-size: 18px;
}

/*
  Built-in class:
    The End # CLASS: end
*/
.end {
    text-align: center;
    font-weight: bold;
    color: var(--green);
    text-shadow: 0 0 5px rgba(var(--green-rgb), 0.4);
    padding-top: 20px;
    padding-bottom: 20px;
}

#controls {
    z-index: 4;
    font-size: 12px;
    font-family: "JetBrains Mono", Monaco, Consolas, "Lucida Console", monospace;
    text-align: center;
    padding-bottom: 6px;
    position: fixed;
    right: 14px;
    top: 4px;
    user-select: none;
    background: #151515;
}

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

#controls [disabled] {
    color: var(--green-dim);
}

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

@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

  A step past the base "Hacker" look: pure black terminal, no background
  texture, brighter neon-green accents in place of the dim conifer green.
  Still monochrome green throughout, just a hotter/purer hue.
*/

body.dark {
    background: #000;
    color: var(--green-dark);
}

.dark h1 {
    color: var(--green-dark);
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2),
                 0 0 6px rgba(var(--green-dark-rgb), 0.5),
                 0 0 12px rgba(var(--green-dark-rgb), 0.3);
}

.dark h1:before {
    color: var(--green-dim-dark);
}

.dark h2 {
    color: var(--green-dim-dark);
}

.dark .header {
    border-bottom-color: rgba(var(--green-dark-rgb), 0.35);
}

.dark .container {
    background: #000;
}

.dark .written-in-ink {
    background: #000;
    border-bottom-color: rgba(var(--green-dark-rgb), 0.35);
}

.dark a {
    color: var(--green-dark);
    text-shadow: 0 0 5px rgba(var(--green-dark-rgb), 0.5);
}

.dark a:hover {
    color: var(--green-dark);
    text-shadow: 0 0 6px rgba(var(--green-dark-rgb), 0.6), 0 0 12px rgba(var(--green-dark-rgb), 0.3);
}

.dark .unclickable{
    color: var(--green-dim-dark);
    cursor:not-allowed;
}

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

.dark strong {
    color: var(--green-dark);
}

.dark img {
    border-color: rgba(var(--green-dark-rgb), 0.25);
}

.dark .choice:before {
    color: var(--green-dim-dark);
}

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

.dark #controls>*:not(:last-child):after {
    color: var(--green-dim-dark);
}

.dark .end {
    color: var(--green-dark);
    text-shadow: 0 0 6px rgba(var(--green-dark-rgb), 0.4);
}

.dark #controls {
    background: #000;
}

/*
  CRT effect: scanlines + vignette overlaying the whole viewport.
  Fixed + pointer-events:none so it never blocks clicks on choices/controls;
  z-index sits above everything (including the fixed header bar).
*/

body::before,
body::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
}

body::before {
    z-index: 9998;
    background: repeating-linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0) 0px,
        rgba(0, 0, 0, 0) 1px,
        rgba(0, 0, 0, 0.25) 2px,
        rgba(0, 0, 0, 0.25) 3px
    );
    mix-blend-mode: multiply;
}

body::after {
    z-index: 9999;
    background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0) 55%, rgba(0, 0, 0, 0.6) 100%);
}

@media screen and (prefers-reduced-motion: no-preference) {
    body::before {
        animation: crt-flicker 0.15s infinite;
    }
}

@keyframes crt-flicker {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.96; }
}
