/* 512mb.net "hardhat" mockup, fourth pass: flat, hardly any boxes, a tiled
   concrete background, hazard bars between divider lines. one stylesheet, javascript is optional (site.js only remembers your light switch and menu), no web fonts.
   colours live in the two blocks below, everything else only uses the names. */

:root {
    --page:      #c0c0c0;   /* the grey of the placeholder page. the tile in img/ lies on top */
    --tile:      url(/img/tile-light.png);
    --face:      #adadad;   /* buttons, keys */
    --line:      #555555;   /* dividers and borders */
    --well:      #e6e6e6;   /* table cells, notices, form fields */
    --text:      #111111;
    --dim:       #444444;
    --link:      #0000cc;
    --visited:   #551a8b;
    --active:    #d00000;
    --bar:       #222222;   /* sign plates: table heads */
    --bar-text:  #f5c400;
    --mark:      #f5d84a;   /* highlighter */
    --ok:        #0f5f0f;
    --bad:       #a01010;
    --stripe-a:  #f5c400;
    --stripe-b:  #1a1a1a;
    --deco-dark: none; --deco-light: underline;   /* which word of Dark/Light is underlined */
    color-scheme: light;
}

/* the same names, night shift. three ways in:
   1. site.js remembered what you picked (data-theme on <html>)
   2. your system asks for dark
   3. no script: the Dark/Light checkbox flips whatever the system said,
      for the page you are on */
:root[data-theme=dark] {
    --page: #1b1b1b; --tile: url(/img/tile-dark.png); --face: #2b2b2b; --line: #5c5c5c;
    --well: #222222; --text: #dcdcdc; --dim: #9a9a9a;
    --link: #66ccff; --visited: #cc99ff; --active: #ff6666;
    --bar: #f5c400; --bar-text: #111111; --mark: #5a4a00;
    --ok: #66dd66; --bad: #ff7070; --stripe-b: #111111;
        --deco-dark: underline; --deco-light: none;
    color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme]):not(:has(#lightswitch:checked)) {
        --page: #1b1b1b; --tile: url(/img/tile-dark.png); --face: #2b2b2b; --line: #5c5c5c;
        --well: #222222; --text: #dcdcdc; --dim: #9a9a9a;
        --link: #66ccff; --visited: #cc99ff; --active: #ff6666;
        --bar: #f5c400; --bar-text: #111111; --mark: #5a4a00;
        --ok: #66dd66; --bad: #ff7070; --stripe-b: #111111;
        --deco-dark: underline; --deco-light: none;
        color-scheme: dark;
    }
}
@media (prefers-color-scheme: light) {
    :root:not([data-theme]):has(#lightswitch:checked) {
        --page: #1b1b1b; --tile: url(/img/tile-dark.png); --face: #2b2b2b; --line: #5c5c5c;
        --well: #222222; --text: #dcdcdc; --dim: #9a9a9a;
        --link: #66ccff; --visited: #cc99ff; --active: #ff6666;
        --bar: #f5c400; --bar-text: #111111; --mark: #5a4a00;
        --ok: #66dd66; --bad: #ff7070; --stripe-b: #111111;
        --deco-dark: underline; --deco-light: none;
        color-scheme: dark;
    }
}

/* the link icon: a square with an arrow leaving through its corner */
:root {
    --icon-link: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 11 11'%3E%3Cpath d='M4.5 1.5H1.5v8h8V6.5' fill='none' stroke='%23000' stroke-width='1.2'/%3E%3Cpath d='M6 1h4v4M10 1 5 6' fill='none' stroke='%23000' stroke-width='1.2'/%3E%3C/svg%3E");
}

* { box-sizing: border-box; }

html { background: var(--page) var(--tile); }

body {
    margin: 0 auto;
    padding: 8px;
    max-width: 980px;
    color: var(--text);
    font-family: "Times New Roman", Times, serif;
    font-size: 17px;
    line-height: 1.4;
}

a         { color: var(--link); }
a:visited { color: var(--visited); }
a:active  { color: var(--active); }

/* --- no boxes around things. the page is one surface; only tables, code,
   notices and form fields get a line, because those are boxes by nature. --- */

.raised, .well { background: none; border: 0; }

/* the hazard bar runs between two divider lines, the same line that
   separates the sidebar from the page. */
.stripes {
    height: 24px;
    padding: 4px 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    background: repeating-linear-gradient(-45deg,
        var(--stripe-a) 0 12px, var(--stripe-b) 12px 24px) content-box;
}

/* --- top bar --- */

.topbar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 2px 10px;
    flex-wrap: wrap;
}

.logo {
    display: block;
    width: 64px;
    padding: 4px 0 3px;
    text-align: center;
    text-decoration: none;
    font-family: "Courier New", Courier, monospace;
    font-weight: bold;
    line-height: 1;
    background: var(--stripe-b);
    color: var(--stripe-a);
}
.logo:visited { color: var(--stripe-a); }
.logo big   { display: block; font-size: 26px; }
.logo small { display: block; font-size: 12px; letter-spacing: 4px; padding-left: 4px; }

.sitename { flex: 1 1 200px; }
.sitename b { display: block; font-size: 36px; line-height: 1; font-style: italic; }
.sitename i { font-size: 17px; }

/* the light switch: plain words in the corner, no button around them */
.switch {
    font-family: "Times New Roman", Times, serif;
    font-size: 16px;
    color: var(--text);
    cursor: pointer;
    padding: 6px 2px;
}
.menubtn:hover, .closebtn:hover { text-decoration: underline; }
/* Dark/Light: the one that is on is underlined. a click anywhere on it flips. */
.switch.theme::before { content: none; }
.t-dark  { text-decoration: var(--deco-dark);  text-decoration-thickness: 2px; text-underline-offset: 3px; }
.t-light { text-decoration: var(--deco-light); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.switch.theme span { padding: 0 2px; }
.switch::before {
    content: ""; display: inline-block; width: 9px; height: 9px; margin-right: 6px;
    border: 1px solid var(--line); background: var(--stripe-a);
}
#lightswitch, #menuswitch { position: absolute; opacity: 0; }
#menuswitch:focus-visible ~ * .menubtn { outline: 2px dotted var(--text); }
.corner { display: flex; gap: 18px; align-items: center; }
.menubtn, .closebtn, .shade { display: none; }
#lightswitch:focus-visible ~ * .switch { outline: 2px dotted var(--text); }

button, input[type=submit], input[type=reset] {
    font-family: Verdana, Geneva, sans-serif;
    font-size: 13px;
    color: var(--text);
    background: var(--face);
    padding: 4px 10px;
    border: 1px solid var(--line);
    cursor: pointer;
}
button:hover, input[type=submit]:hover, input[type=reset]:hover { background: var(--stripe-a); color: #111; }
button:active { background: var(--bar); color: var(--bar-text); }

/* --- layout: sidebar left, reading on the right --- */

.layout {
    display: grid;
    grid-template-columns: 190px minmax(0, 1fr);
    gap: 22px;
    margin: 16px 0;
    align-items: start;
}
.main { padding: 4px 0 4px 22px; min-height: 420px; border-left: 1px solid var(--line); }

.nav, .extras, .box {
    font-family: "Times New Roman", Times, serif;
    font-size: 16px;
    line-height: 1.3;
}

.box { margin-bottom: 10px; }
.box h2 {
    margin: 0;
    padding: 0 0 2px;
    font-family: "Times New Roman", Times, serif;
    font-size: 14px;
    color: var(--text);
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 3px solid var(--stripe-a);
    box-shadow: 0 1px 0 var(--line);
}
.box .in { padding: 6px 0 4px; }
.box p { margin: 6px 0 0; }
.box ul { list-style: none; margin: 0; padding: 0; }
.box li { padding: 1px 0; }

/* menu entries: the text colour, not link blue. every entry has a little
   square in front, the page you are on has the yellow one. */
.box li a, .box summary { color: var(--text); text-decoration: none; }
/* a long entry wraps under its own text, not under its square */
.box li a, .box summary { display: block; padding-left: 18px; text-indent: -18px; }
.box li a:visited { color: var(--text); }
.box li a:hover, .box summary:hover { text-decoration: underline; }
.box li a::before, .box summary::before {
    content: ""; display: inline-block; width: 9px; height: 9px; margin-right: 7px;
    border: 1px solid var(--line); background: transparent;
}
.box li a:hover::before { background: var(--line); }
.box li.here > a { font-weight: bold; }
.box li.here > a::before { background: var(--stripe-a); }

/* entries that leave this site wear a link icon, not a square */
.box li a[href^="http"]::before {
    width: 11px; height: 11px; border: 0;
    background: var(--text);
    -webkit-mask: var(--icon-link) center / contain no-repeat;
            mask: var(--icon-link) center / contain no-repeat;
}
.box li a[href^="http"]:hover::before { background: var(--text); }

/* a menu entry with entries under it folds. its square carries a plus,
   or a minus while it is open. this is <details>, no script. */
.box summary { list-style: none; cursor: pointer; }
.box summary::-webkit-details-marker { display: none; }
.box summary::before {
    background:
        linear-gradient(var(--text), var(--text)) center / 5px 1px no-repeat,
        linear-gradient(var(--text), var(--text)) center / 1px 5px no-repeat;
}
.box details[open] > summary::before {
    background: linear-gradient(var(--text), var(--text)) center / 5px 1px no-repeat;
}
.box details ul { margin: 2px 0 2px 4px; padding-left: 12px; border-left: 1px solid var(--line); }

/* small tables without lines, for lining things up */
table.plain { border-collapse: collapse; width: 100%; }
table.plain td { padding: 1px 0; }
table.plain td:last-child { text-align: right; }

.counter {
    display: inline-block;
    margin-top: 6px;
    padding: 2px 6px;
    background: #000;
    color: #3f3;
    font-family: "Courier New", Courier, monospace;
    font-weight: bold;
    font-size: 18px;
    letter-spacing: 3px;
    border: 2px solid;
    border-color: var(--line);
}

/* the little 88x31 badges, drawn in css so there is nothing to download */
.badges { display: flex; flex-wrap: wrap; gap: 4px; }
.badge {
    width: 88px; height: 31px;
    display: flex; align-items: center; justify-content: center;
    text-align: center;
    font-family: Verdana, Geneva, sans-serif;
    font-size: 9px; font-weight: bold; line-height: 1.1;
    border: 1px solid #000;
}
.badge.b1 { background: #000080; color: #fff; }
.badge.b2 { background: #f5c400; color: #111; }
.badge.b3 { background: #111; color: #3f3; font-family: "Courier New", monospace; font-size: 10px; }
.badge.b4 { background: #a00000; color: #fff; }

/* --- reading --- */

.main h1 { font-size: 32px; margin: 0 0 6px; line-height: 1.1; }
.main h2 { font-size: 24px; margin: 22px 0 6px; }
.main h3 { font-size: 19px; margin: 18px 0 4px; }
.main p  { margin: 8px 0; }
.main hr {
    border: 0; height: 6px; margin: 16px 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}
.center { text-align: center; }
.small  { font-size: 14px; color: var(--dim); }
mark    { background: var(--mark); color: inherit; }

code, kbd, pre, samp { font-family: "Courier New", Courier, monospace; font-size: 15px; }
pre {
    padding: 8px 10px;
    overflow-x: auto;
    background: #000; color: #3f3;
    border: 2px solid;
    border-color: var(--line);
}
kbd {
    padding: 0 4px;
    background: var(--face);
    border: 2px solid;
    border-color: var(--line);
}
blockquote {
    margin: 10px 0; padding: 4px 12px;
    border-left: 6px solid var(--dim);
    font-style: italic;
}

/* tables with borders, like tables used to be */
.scroll { overflow-x: auto; }
.main table:not(.plain), table.grid {
    border-collapse: collapse;
    width: 100%;
    margin: 8px 0;
}
.main table:not(.plain) th, .main table:not(.plain) td, table.grid th, table.grid td {
    padding: 5px 10px;
    text-align: left; vertical-align: top;
    border: 1px solid var(--line);
    background: var(--well);
}
.main table:not(.plain) th, table.grid th { background: var(--bar); color: var(--bar-text); font-family: Verdana, Geneva, sans-serif; font-size: 13px; }
table.grid.wide { width: 100%; }
.up   { color: var(--ok);  font-weight: bold; }
.down { color: var(--bad); font-weight: bold; }

/* notices. the warning wears the stripes. */
.notice { margin: 12px 0; padding: 8px 12px; border: 1px solid var(--line); border-left: 6px solid var(--line); background: var(--well); }
.notice.warn {
    border: 10px solid transparent;
    border-image: repeating-linear-gradient(-45deg, var(--stripe-a) 0 10px, var(--stripe-b) 10px 20px) 10;
}
.notice.bad { border-left-color: var(--bad); }
.notice b:first-child { font-family: Verdana, Geneva, sans-serif; font-size: 13px; text-transform: uppercase; }

.construction { display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; margin: 10px 0; }
.construction img { image-rendering: pixelated; max-width: 100%; height: auto; }

/* the ticker. stands still if you asked your system for less motion. */
.ticker { overflow: hidden; white-space: nowrap; background: #000; color: var(--stripe-a);
          font-family: "Courier New", Courier, monospace; font-size: 15px; padding: 3px 0; }
.ticker span { display: inline-block; padding-left: 100%; animation: ticker 22s linear infinite; }
@keyframes ticker { to { transform: translateX(-100%); } }
@media (prefers-reduced-motion: reduce) { .ticker span { animation: none; padding-left: 8px; } }

/* the storage gauge */
.gauge { height: 22px; padding: 2px; border: 1px solid var(--line); background: var(--well); }
.gauge i { display: block; height: 100%;
    background: repeating-linear-gradient(90deg, var(--bar) 0 10px, transparent 10px 12px); }

/* forms */
input[type=text], input[type=email], input[type=password], select, textarea {
    font-family: "Courier New", Courier, monospace; font-size: 15px;
    padding: 3px 5px; max-width: 100%;
    color: var(--text); background: var(--well);
    border: 2px solid;
    border-color: var(--line);
}
fieldset { border: 2px solid var(--line); margin: 10px 0; padding: 8px 12px; }
legend { font-family: Verdana, Geneva, sans-serif; font-size: 13px; font-weight: bold; padding: 0 4px; }
label { display: inline-block; margin: 3px 0; }

/* --- footer --- */

.footer { padding: 10px 2px; text-align: center; font-family: "Times New Roman", Times, serif; font-size: 15px; }
.footer p { margin: 3px 0; }

/* --- small screens: navigation first, then the page, then the toys --- */

/* --- small screens: the sidebar becomes a drawer. "Menu" slides it in
   from the left, tapping beside it or "Close menu" sends it back. it is
   a checkbox and a label, so it works without the script too. --- */

@media (max-width: 700px) {
    body { padding: 8px 10px; }
    .layout { display: block; margin: 12px 0; }
    .main { padding: 0; min-height: 0; border-left: 0; }
    .sitename b { font-size: 30px; }
    .corner { width: 100%; justify-content: space-between; }
    .menubtn { display: inline-block; }

    .side {
        position: fixed; z-index: 20;
        top: 0; bottom: 0; left: 0;
        width: min(84vw, 310px);
        padding: 12px 14px 20px;
        overflow-y: auto;
        background: var(--page) var(--tile);
        border-right: 2px solid var(--stripe-b);
        visibility: hidden;
        transform: translateX(-105%);
        transition: transform .18s ease-out, visibility .18s;
    }
    :root:has(#menuswitch:checked) .side { visibility: visible; transform: none; }
    :root:has(#menuswitch:checked) .shade {
        display: block; position: fixed; z-index: 10; inset: 0; background: #000a;
    }
    .closebtn { display: block; margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }

    /* in the drawer the menu is a list with rows big enough for a thumb */
    .nav, .extras, .box { font-size: 17px; }
    .box h2 { font-size: 14px; }
    .box { margin-bottom: 14px; }
    .nav .box li { padding: 0; border-bottom: 1px dotted var(--line); }
    .nav .box li li:last-child { border-bottom: 0; }
    .nav .box li a, .nav .box summary { display: block; padding: 9px 0; }
    .nav .box details ul { margin: 0 0 0 4px; border-top: 1px dotted var(--line); }
    .nav .box .in { padding: 0 0 4px; }
}
@media (prefers-reduced-motion: reduce) { .side { transition: none; } }
