/*
 * espumachan: pixel art foam theme (the default theme)
 *
 * Colours come from the DawnBringer 32 palette, as in the reference art:
 *   #222034 ink      #3F3F74 indigo   #306082 teal     #5B6EE1 royal
 *   #639BFF sky      #5FCDE4 cyan     #CBDBFC foam     #FFFFFF white
 *   #76428A purple   #99E550 lime     #D95763 red      #D77BBA pink
 *   #FBF236 yellow   #000000 outline
 * One pixel of the artwork is 3px on screen (outlines, highlights, shadows).
 * Pictures and fonts live in espumachan/. Headings use Pixelify Sans, under
 * the SIL Open Font License 1.1 (espumachan/OFL.txt).
 */

@font-face {
    font-family: "Pixelify Sans";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("espumachan/pixelify-sans-latin-400-normal.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
                   U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: "Pixelify Sans";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("espumachan/pixelify-sans-latin-ext-400-normal.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
                   U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: "Pixelify Sans";
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url("espumachan/pixelify-sans-latin-700-normal.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
                   U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: "Pixelify Sans";
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url("espumachan/pixelify-sans-latin-ext-700-normal.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
                   U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/*
 * Page
 */

/* A simulated foam (tools/make_foam.py): films meet three at a time at 120
   degrees and bulge into the bigger bubbles, as in real foam. */
html {
    background: #1B1A33 url("espumachan/foam-dark.png") 0 0 / 768px 768px repeat;
    image-rendering: pixelated;
}

body {
    color: #CBDBFC;
    image-rendering: auto; /* only the artwork is pixelated, not posted images */
}

b {
    color: #FFFFFF;
}

a, a:visited {
    color: #639BFF;
}

a:hover {
    color: #5FCDE4;
}

::selection {
    background-color: #639BFF;
    color: #000000;
}

:focus-visible {
    outline: 3px solid #FBF236;
    outline-offset: 1px;
}

nav, .header, .subheader, .announcement, .barheader, th, .new-post, .page-switcher,
form input[type=submit], form input[type=file]::file-selector-button {
    font-family: "Pixelify Sans", monospace;
}

/*
 * Navigation bar
 */

nav {
    background-color: #222034;
    border-bottom: 3px solid #000000;
    color: #CBDBFC;
    font-size: 16px;
}

nav a, nav a:visited {
    color: #CBDBFC;
}

nav a[accesskey] {
    color: #FFFFFF;
}

nav a[title] {
    color: #639BFF;
}

nav a:hover {
    color: #5FCDE4;
    text-decoration: none;
}

/* On narrow screens the floating notice would wrap to a second line and
   cover the page header; keep it inline (the bar expands when touched). */
@media (max-width: 700px) {
    .logged-in-notification {
        float: none;
        margin-right: 0;
        margin-left: 1ch;
    }
}

/*
 * Headers: white pixel letters with a black outline, like the logo
 */

.header {
    padding: 4px 0 10px 0;
    color: #FFFFFF;
    font-weight: 700;
    font-size: 40px;
    line-height: 1.15;
    letter-spacing: 1px;
    text-shadow: 3px 0 #000000, -3px 0 #000000, 0 3px #000000, 0 -3px #000000,
                 3px 3px #000000, -3px 3px #000000, 3px -3px #000000, -3px -3px #000000,
                 0 6px #000000, 3px 6px #000000, -3px 6px #000000;
}

.subheader {
    color: #CBDBFC;
    font-size: 16px;
    text-shadow: 2px 2px #000000;
}

.announcement {
    color: #FBF236;
    font-size: 16px;
    text-shadow: 2px 2px #000000;
}

/*
 * Panels: dark bubbles with a black pixel outline, rounded by one pixel at
 * the corners, and a white shine in the top left corner
 */

.container, .post, .catalog-thread, #postform {
    border-color: #222034;
    background-color: #222034;
    box-shadow: 0 -3px #000000, 0 3px #000000, -3px 0 #000000, 3px 0 #000000,
                inset 3px 3px #2D2C57;
}

.container, .post, .catalog-thread {
    position: relative;
}

.container::before, .post::before, .catalog-thread::before {
    position: absolute;
    top: 3px;
    left: 6px;
    width: 3px;
    height: 3px;
    background-color: #FFFFFF;
    box-shadow: -3px 3px #FFFFFF;
    content: "";
    pointer-events: none;
}

.thread {
    box-shadow: none;
}

.thread::before {
    display: none;
}

.post-container:target .post {
    background-color: #3F3F74 !important;
    box-shadow: 0 -3px #000000, 0 3px #000000, -3px 0 #000000, 3px 0 #000000,
                inset 3px 3px #4C4C8C;
}

.post {
    margin-top: calc(1.3ch + 3px);
}

.catalog-thread {
    margin-bottom: calc(1.3ch + 2px);
    scrollbar-color: #5B6EE1 #222034;
}

.barheader {
    margin-right: -11px;
    margin-left: -11px;
    padding: 3px 11px;
    background-color: #5B6EE1;
    color: #FFFFFF;
    font-weight: 700;
    font-size: 16px;
    text-shadow: 2px 2px #222034;
    box-shadow: 0 -3px #000000, 0 3px #000000;
}

ul > li::before {
    color: #639BFF;
    font-weight: bold;
    content: "o";
}

/*
 * Tables and rules
 */

th {
    background-color: #3F3F74;
    color: #FFFFFF;
    font-weight: 700;
}

tr:nth-child(odd) {
    background-color: #2A2950;
}

hr {
    border-bottom: 3px solid #000000;
}

/*
 * Forms: pale foam fields, sky blue bubble buttons
 */

form label {
    background-color: #306082;
    color: #FFFFFF;
}

form input[type=text],
form input[type=password],
form input[type=number],
form select,
form textarea {
    border: 3px solid #000000;
    padding: 2px 4px;
    background-color: #CBDBFC;
    color: #222034;
}

form input::placeholder,
form textarea::placeholder {
    color: #306082;
    opacity: 1;
}

form input[type=submit],
form input[type=file]::file-selector-button {
    border: 3px solid #000000;
    padding: 2px 10px;
    background-color: #639BFF;
    color: #000000;
    font-weight: 700;
    font-size: 16px;
    box-shadow: inset -3px -3px #5B6EE1, inset 3px 3px #CBDBFC;
    cursor: pointer;
}

form input[type=submit]:hover,
form input[type=file]::file-selector-button:hover {
    background-color: #5FCDE4;
}

form input[type=submit]:active,
form input[type=file]::file-selector-button:active {
    box-shadow: inset 3px 3px #5B6EE1;
}

form input[type=checkbox], form input[type=radio] {
    accent-color: #639BFF;
}

/*
 * Posts
 */

.new-post {
    color: #FFFFFF;
    font-weight: 700;
    font-size: 24px;
    text-shadow: 2px 0 #000000, -2px 0 #000000, 0 2px #000000, 0 -2px #000000, 0 4px #000000;
}

.new-post:hover, .new-post:visited {
    color: #FFFFFF;
}

.page-switcher {
    font-size: 16px;
}

.post-thumbnail {
    box-shadow: 0 0 0 3px #000000;
}

.catalog-thread-subject, .post-subject {
    color: #FBF236;
}

.post-name {
    color: #99E550;
}

.post-capcode {
    color: #D95763;
}

.post-number a {
    color: #CBDBFC;
}

.post-number a:hover {
    color: #FBF236;
}

.post-comment a, .catalog-thread-comment a {
    color: #5FCDE4;
}

.greentext {
    color: #99E550;
}

.pinktext {
    color: #D77BBA;
}

.redtext {
    color: #D95763;
}

.spoiler {
    background-color: #000000;
    color: #000000;
}

.spoiler:hover {
    color: #FFFFFF;
}

code, .code {
    background-color: #3F3F74;
    color: #FFFFFF;
}

code {
    border: 3px solid #000000;
}

.code {
    box-shadow: inset 0 0 0 1px #000000;
}

/*
 * Front page and access gate: the bubble logo above the site name. The gate
 * also sits on bright foam, like the "es pu ma" picture.
 */

.home-page .header::before,
.gate-page .header::before {
    display: block;
    margin: 0 auto 8px auto;
    width: 128px;
    height: 128px;
    background: url("espumachan/logo.png") 0 0 / 128px 128px no-repeat;
    image-rendering: pixelated;
    filter: drop-shadow(0 6px 0 #000000);
    content: "";
}

.gate-page::before {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: -2;
    background: #5B6EE1 url("espumachan/foam-vivid.png") 0 0 / 768px 768px repeat;
    image-rendering: pixelated;
    content: "";
    pointer-events: none;
}
