/* A 1996 page built into a 1970s console TV: Mans In My House's wood panelling with chrome
   trim, a brushed control strip with Apple IIe keycaps, a phosphor readout; cream paper inside,
   serif text, blue links that go purple. A checkerboard seen through two lenses behind it,
   both games' casts in the margins. Plain fonts. */

/* the paper's colours: parchment by day, a dim lamp-lit page by night (the DARK key, or the
   system's setting until someone presses it) */
:root {
  --ink: #1c1912; --paper: #d9cfb4; --paper2: #cdc2a4; --paper-edge: #c6bb9c;
  --link: #12309a; --visited: #57277f; --hover: #a3120c; --date: #7a1408;
  --dim: #5a5444; --tag: #4f4a3c; --rule: #a89e80; --field: #ebe3cc; --stripe: #d1c6a9;
  --code: #c9bd9c; --head: #5a3a1a;
}
:root[data-theme="dark"] {
  --ink: #e4dac2; --paper: #24201a; --paper2: #1d1a15; --paper-edge: #2f2a22;
  --link: #9fb6ff; --visited: #c6a3f2; --hover: #ff9b86; --date: #f0a07c;
  --dim: #a89e86; --tag: #b2a78e; --rule: #4d4537; --field: #2c2820; --stripe: #2a261f;
  --code: #352f25; --head: #8a6a3a;
}

html { background: #0d0f20; }
body { margin: 0; color: var(--ink); min-height: 100vh;
       background: #0d0f20 url(/img/bg.webp) center / cover fixed;
       font: 17px/1.55 Georgia, "Times New Roman", Times, serif; }
a { color: var(--link); } a:visited { color: var(--visited); } a:hover { color: var(--hover); }
img { max-width: 100%; }

.page { position: relative; z-index: 1; max-width: 892px; margin: 24px auto 40px; padding: 16px;
        background: #3a2414 url(/img/tex/wood_panel.png) 0 0 / 128px; image-rendering: pixelated;
        border: 4px solid; border-color: #f2f2f2 #6f6f6f #5a5a5a #e0e0e0;
        box-shadow: inset 0 0 0 2px #1a0e06, inset 0 0 24px #000a, 10px 10px 0 #0009; }
.page > * { image-rendering: auto; }
header .logo img { display: block; width: 100%; border: 3px solid; border-color: #1a0e06 #c9a36a #c9a36a #1a0e06; }

/* ---- the control strip: brushed chrome with Apple IIe keycaps */
.buttons { display: flex; flex-wrap: wrap; gap: 8px; padding: 9px 10px; margin: 8px 0;
           background: #9aa0a8 url(/img/tex/car_chrome.png) 0 0 / 64px; image-rendering: pixelated;
           border: 2px solid; border-color: #1a0e06 #e8e8e8 #e8e8e8 #1a0e06;
           box-shadow: inset 0 2px 6px #0007; }
.buttons a, .chips button, .chips .chip {
  font: bold 14px/1 Arial, Helvetica, sans-serif; color: #3b2a14; text-decoration: none;
  image-rendering: auto; display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  background: linear-gradient(#efe6cc, #d6caa6 70%, #c4b68e); padding: 7px 13px 8px;
  border: 2px solid; border-color: #fbf5e2 #8c7e5a #6e6142 #f1e8cc;
  box-shadow: 0 3px 0 #5a4d31, 0 4px 3px #0006; position: relative; top: -2px; }
.buttons a:hover, .chips button:hover { background: linear-gradient(#f7f0da, #dfd4b2 70%, #cdbf98); }
.buttons a:active, .buttons a.on, .chips button.on { top: 1px; box-shadow: 0 0 0 #5a4d31, 0 1px 2px #0006;
  background: linear-gradient(#d3c7a2, #e2d8b8); }
.buttons a:visited { color: #3b2a14; }
.buttons .ico { width: auto; height: 18px; margin: -4px 0; image-rendering: pixelated; }
.theme { margin-left: auto; }
.plate { align-self: center; padding: 4px 10px; text-decoration: none; font: italic 900 15px/1 Georgia, serif;
         letter-spacing: 0.12em; color: #2a2a2a !important; text-shadow: 0 1px 0 #fff;
         background: linear-gradient(180deg, #fafafa, #a9adb3 48%, #6b7077 52%, #d9dce0);
         border: 1px solid #3a3a3a; box-shadow: inset 0 1px 0 #fff, 0 1px 2px #0008; }
@media (max-width: 640px) { .plate { display: none; } }
:root[data-theme="dark"] .prose img, :root[data-theme="dark"] .frame { filter: brightness(.92); }

/* ---- paper */
.paper { background: var(--paper); padding: 16px 26px 24px; border: 3px solid;
         border-color: #1a0e06 #c9a36a #c9a36a #1a0e06; box-shadow: inset 2px 2px 0 var(--paper-edge); }
.foot { margin-top: 10px; padding-top: 6px; background: var(--paper2); }
h1 { font: bold 30px/1.2 Georgia, serif; margin: 6px 0 8px; display: flex; align-items: center; gap: 10px; }
h2 { font: bold 22px/1.2 Georgia, serif; margin: 26px 0 10px; padding-bottom: 10px;
     display: flex; align-items: flex-end; gap: 8px;
     background: url(/img/tex/seventies_wallpaper.png) 0 100% / 32px 6px repeat-x;
     image-rendering: pixelated; border-bottom: 1px solid var(--head); }
.ico { height: 30px; width: auto; image-rendering: pixelated; }
h2 .ico { height: 34px; margin-bottom: -2px; }
.tiny { font-size: 14px; } .dim { color: var(--dim); }
.mono, .when { font: 14px/1.7 "Courier New", Courier, monospace; }
.when { font-weight: bold; color: var(--date); white-space: nowrap; }
.tags { font: 13px "Courier New", monospace; color: var(--tag); }
.tags a { color: var(--tag); }

.intro { display: flex; gap: 18px; align-items: center; }
.intro img { width: 96px; height: 96px; border: 4px ridge #d8d8d8; cursor: pointer; flex: none; }
.intro h1 { margin-top: 0; }

table.new { border-collapse: collapse; }
.new td { padding: 4px 12px 4px 0; vertical-align: top; }
table.projects { width: 100%; border-collapse: separate; border-spacing: 0 12px; }
.projects td { vertical-align: top; padding: 0 12px 0 0; }
.projects .pic { width: 170px; }
.projects tr[hidden] { display: none; }
.name { font-weight: bold; font-size: 19px; }

/* pictures in chrome frames */
.frame { display: inline-block; padding: 4px; vertical-align: top;
         background: linear-gradient(135deg, #fff, #8d8d8d 45%, #f4f4f4 55%, #6d6d6d);
         box-shadow: 2px 2px 0 #0006; }
.frame img { display: block; width: 160px; image-rendering: pixelated; }
.frame.big img { width: 100%; max-width: 560px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
input[type=search] { font: 16px Georgia, serif; padding: 6px 8px; width: 100%; max-width: 380px;
                     border: 3px inset var(--rule); background: var(--field); color: var(--ink); }
.scroll { overflow-x: auto; }
table.repos { width: 100%; border-collapse: collapse; font-size: 15px; }
.repos th { text-align: left; background: #e2d8b8; border: 2px solid; border-color: #fbf5e2 #8c7e5a #6e6142 #f1e8cc;
            font: bold 13px Arial, sans-serif; padding: 5px 8px; }
.repos td { padding: 5px 8px; border-bottom: 1px solid var(--rule); vertical-align: top; }
.repos tr:nth-child(even) td { background: var(--stripe); }
.repos tr[hidden] { display: none; }

/* posts */
.prose img { display: block; margin: 18px 0; padding: 4px; image-rendering: pixelated;
             background: linear-gradient(135deg, #fff, #8d8d8d 45%, #f4f4f4 55%, #6d6d6d);
             box-shadow: 2px 2px 0 #0006; }
.prose h2 { font-size: 24px; }
.prose code { font: 0.9em "Courier New", monospace; background: var(--code); padding: 1px 4px; }
.prose pre { background: #0c0f0c; color: #8dff9d; padding: 12px 14px; overflow-x: auto;
             border: 3px inset #9a9a9a; }
.prose pre code { background: none; padding: 0; }
.prose blockquote { margin: 16px 0; padding: 2px 16px; border-left: 4px solid var(--date); color: var(--dim); }

/* 88x31 buttons */
.badges { display: flex; gap: 6px; flex-wrap: wrap; margin: 12px 0 8px; }
.badge { width: 88px; height: 31px; display: grid; place-items: center; text-decoration: none;
         font: bold 11px/1 Verdana, sans-serif; color: #fff !important; border: 2px outset #ccc;
         background: linear-gradient(#5a6fd8, #1b2470); text-shadow: 1px 1px 0 #000; }
.badge.y { background: linear-gradient(#ff5b5b, #8c0000); }
.badge.g { background: linear-gradient(#ffd25a, #8c6200); }
.badge.c { background: linear-gradient(#fff, #9a9a9a); color: #000 !important; text-shadow: none; }

/* ---- the TV wall */
.wall { position: relative; width: 100%; overflow: hidden; background: #000; border: 3px solid;
         border-color: #1a0e06 #c9a36a #c9a36a #1a0e06; }
.wall .room { display: block; width: 100%; height: 100%; image-rendering: pixelated; }
.wall .scr { position: absolute; left: 0; top: 0; width: 192px; height: 144px;
             transform-origin: 0 0; display: none; }
.wall.ready .scr { display: block; }
.wall .scr img, .wall .scr video { display: block; width: 100%; height: 100%; object-fit: cover;
                                   image-rendering: pixelated; filter: saturate(1.1) contrast(1.05); }
.wall .scr::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    repeating-linear-gradient(0deg, #0000 0 2px, #0006 2px 4px),
    radial-gradient(120% 90% at 30% 20%, #ffffff30, #0000 45%),
    radial-gradient(ellipse at center, #0000 55%, #000a 100%); }
.wall .scr:hover img, .wall .scr:focus-visible img { filter: brightness(1.35) saturate(1.3); }
.wall .scr:hover, .wall .scr:focus-visible { outline: 8px solid #7dffb0; outline-offset: 0; }
.status { margin-top: 6px; padding: 4px 10px; background: #071109; color: #4fd07a;
          font: bold 13px/1.4 "Courier New", monospace; white-space: nowrap; overflow: hidden;
          text-overflow: ellipsis; text-shadow: 0 0 6px #4fd07a99;
          border: 3px solid; border-color: #1a0e06 #c9a36a #c9a36a #1a0e06;
          background-image: repeating-linear-gradient(0deg, #0000 0 2px, #0004 2px 3px); }
.status.on { color: #9dffb9; text-shadow: 0 0 8px #7dffb0; }

/* ---- the cast in the margins */
.stickers { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
.sticker { position: absolute; width: auto; height: auto; max-height: 104px; max-width: 150px;
           image-rendering: pixelated;
           transform: rotate(var(--t)); filter: drop-shadow(3px 4px 0 #000a);
           animation: bob 2.4s steps(2, jump-none) infinite alternate; }
.sticker.l { right: calc(50% + 470px); }
.sticker.r { left: calc(50% + 470px); }
@keyframes bob { from { translate: 0 0; } to { translate: 0 -6px; } }
@media (max-width: 1180px) { .stickers { display: none; } }
@media (prefers-reduced-motion: reduce) { .sticker { animation: none; } }

@media (max-width: 640px) {
  body { font-size: 16px; }
  .page { margin: 0; border-width: 2px; box-shadow: none; padding: 6px; }
  .paper { padding: 12px 14px 18px; }
  h1 { font-size: 25px; }
  .projects .pic { width: 100px; } .frame img { width: 92px; }
  .intro img { width: 72px; height: 72px; }
  .status { font-size: 11px; }
  .repos td:nth-child(3), .repos th:nth-child(3) { display: none; }
}
