/********** FONTS **********/

/* These fonts are sourced from https://int10h.org/oldschool-pc-fonts/ by VileR, subject to CC BY-SA 4.0 */

@font-face {
    font-family: "vga";
    src: url("/fonts/WebPlus_IBM_VGA_9x16.woff") format("woff");
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: "ms";
    src:url(/fonts/ms_sans_serif.woff) format("woff");
    font-weight: normal; 
    font-style: normal;
}

@font-face {
    font-family: "ms";
    src:url(/fonts/ms_sans_serif_bold.woff) format("woff");
    font-weight: 700; 
    font-style: normal;
}

@font-face {
    font-family: "dosv";
    src: url("/fonts/Web437_DOS-V_TWN16.woff") format("woff");
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: "ank16";
    src: url("/fonts/Web437_DOS-V_re_ANK16.woff") format("woff");
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: "ank24";
    src: url("/fonts/Web437_DOS-V_re_ANK24.woff") format("woff");
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: "model3x";
    src: url("/fonts/Web437_IBM_Model3x_Alt4.woff") format("woff");
    font-weight: normal;
    font-style: normal;
}

/********** GENERAL **********/

:root {
    --bg-main: #4b5844;
    --bg-alt: #3e4637;
    --highlight: #7a8b71;
    --accent: #978730;
    --text: #ffffff;

    --border-size: 6px; /* This is for border properties           */
    --border-slice: 6;  /* and this is for border-image properties */

    --term-black: #000000;
    --term-red: #a80000;
    --term-green: #00a800;
    --term-yellow: #a85400;
    --term-blue: #0000a8;
    --term-magenta: #a800a8;
    --term-cyan: #00a8a8;
    --term-white: #c0c7c8;
}

* {
    box-sizing: border-box;
    image-rendering: -moz-crisp-edges; 
    image-rendering: crisp-edges;
    image-rendering: pixelated;
    -webkit-font-smoothing: none;
    font-smooth: never;
    font-weight: normal;
    font-style: normal;
}

body {
    margin: 0;
    width: 100%; 
    font-family: "model3x";

    padding: 0 0 50px 0;

    background-image: url('/images/bg/3.png'); /* fallback */
    background-repeat: repeat !important;
    background-size: auto !important;
    background-attachment: fixed;

    font-size: 16px;
    text-rendering: optimizeSpeed;
}

h1 {
    margin: 48px 0 16px 0;

    padding: 0;

    font-size: 24px;
    line-height: 1;
    font-family: "ank24";
}

h1:first-of-type {
    margin-top: 16px; /* less top margin for first h1 */
}

p {
    line-height: 1;
    margin: 0 0 16px 0;
    max-width: 65ch; /* Make line length shorter for better readability. */
}

ul {
    list-style-type: " ► ";
    padding: 0 0 0 32px;
    margin: 0;
}

li {
    margin: 0 0 32px 0;
}

/********** WELCOME **********/

.cell-console > pre,
.cell-console > code {
    font-family: "vga", monospace;
    font-size: 16px;
    margin: 0;
    line-height: 1;
    white-space: pre-wrap;
    word-wrap: break-word;

    background-color: var(--term-black);
    color: var(--term-white);
}
.cell-console > pre .black { color: var(--term-black); }
.cell-console > pre .red { color: var(--term-red); }
.cell-console > pre .green { color: var(--term-green); }
.cell-console > pre .yellow { color: var(--term-yellow); }
.cell-console > pre .blue { color: var(--term-blue); }
.cell-console > pre .magenta { color: var(--term-magenta); }
.cell-console > pre .cyan { color: var(--term-cyan); }
.cell-console > pre .white { color: var(--term-white); }

@keyframes blink {
    0%, 49% { opacity: 1;}
    50%, 100% { opacity: 0;}
}

.blink-char {
    animation: blink 1s infinite;
}

.art-long { display: none; }
.art-short { display: block; }

@media (min-width: 1280px) {
    .art-long { display: block; }
    .art-short { display: none; }
}

/********** WINDOW **********/

.window {
    display: grid;
    grid-template-columns: 1fr;
    
    border: var(--border-size) solid;
    border-image: url('/images/ui/win-border.png') var(--border-slice) round;
    
    margin-top: 50px;
    margin-bottom: 50px;
    margin-left: var(--snap-margin-left, auto);
    margin-right: auto;

    width: var(--snap-width, 80%);
    min-width: 300px;
    
    background-color: var(--bg-main);
    color: var(--text);
    padding: 0;
    
    gap: 0; 
}

.window > div {
    border: var(--border-size) solid;
    border-image: url('/images/ui/cell-border.png') var(--border-slice) round;
    
    padding: 4px;
    line-height: 1;
    background-color: var(--bg-alt);
    
    background-clip: padding-box;

    /* prevent contents from overflowing */
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
    max-width: 100%;
    overflow: hidden;
}

/***** WINDOW TYPES *****/

.window.win-sidebar { grid-template-columns: 1fr; }

@media (min-width: 768px) {
    .window.win-sidebar {
        grid-template-columns: var(--snap-quarter-width, 25%) 1fr;
    }
}

/***** WINDOW TITLE *****/

.window > .title {
    display: flex;
    grid-column: 1 / -1;

    padding: 2px 4px 2px 4px;
    align-items: center;

    border: none;
    
    line-height: 1;
    
    font-family: "dosv";
    font-size: 32px;
    background-color: var(--accent);
}

.title > img {
    height: 32px;
    width: 32px;
    margin-right: 8px;
}

.winctls {
    margin-left: auto;
    display: flex;
}

.winctls .win-btn:last-child {
    margin-left: 4px;
}

.win-btn {
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;

    width: 32px;
    height: 28px;
    border: none;

    padding-top: 4px;
    padding-left: 6px;

    background-image: url('/images/ui/win-btn.png');
}

.win-btn:active:not(:disabled) {
    padding-top: 6px;
    padding-left: 8px;

    background-image: url('/images/ui/win-btn_pressed.png');
}

/***** CELL TYPES *****/

.window > .cell-console {
    background-color: var(--term-black);
    font-family: "vga";
    font-size: 16px;
}

.window > .cell-notepad {
    background-color: #ffffff;

    color: #000000;
    font-family: "dosv";
}

.cell-notepad > pre {
    margin: 0;

    color: #000000;
    font-family: "dosv";

    line-height: 1;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.window > .cell-flat {
    grid-column: 1 / -1;
    border-image-source: none !important;
    border-width: 0 var(--border-size);
    border-style: solid;
    border-color: transparent;

    padding: 6px 4px 2px 4px;

    background-color: var(--bg-main);

    font-family: "model3x";
}

/********** TASKBAR **********/


#taskbar, 
#taskbar > a {
    border: var(--border-size) solid;
    border-image: url('/images/ui/win-border.png') var(--border-slice) round;
}

#taskbar{
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;

    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;

    z-index: 9999;

    padding: 0;

    background-color: var(--bg-main);
    color: var(--text);
    font-size: 16px;
    font-family: "model3x";
}

#taskbar > a {
    display: flex;
    align-items: center;

    padding: 0;

    background-color: var(--bg-main);
    color: var(--text);
    text-decoration: none;
}

#taskbar > a > img {
    margin-right: 4px;
}

/********** OPTION SELECTOR **********/

.js-enabled .option-content {
    display: none;
}

.js-enabled .option-content.active {
    display: block;
}

.option-group {
    display: flex;
    flex-direction: column;
}

.option-btn {
    display: flex;

    padding: 4px 2px 4px 2px;
    align-items: center;

    border: none;

    line-height: 1;

    background: transparent;
    font-family: "model3x";
    font-size: 16px;
    color: var(--text);
}


.option-btn > img {
    margin-right: 4px;
}

.option-btn.active {
    background-color: var(--accent);
}
