/* Layout on top of 98.css. The Win98 chrome itself lives in vendor/98/98.css. */

:root {
  --desktop:  #008080;   /* the teal */
  --taskbar-h: 30px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  padding: 1.5rem .75rem calc(var(--taskbar-h) + 1.5rem);
  background: var(--desktop);
}

.desktop {
  max-width: 44rem;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* ---- windows ---- */

.window-body h1 {
  margin: 0;
  font-size: 1.6rem;
  line-height: 1.2;
}

/* sunken picture well, the way Win98 framed an image */
.portrait {
  float: right;
  margin: 0 0 .75rem 1rem;
  padding: 3px;
  background: silver;
  box-shadow: inset -1px -1px #fff, inset 1px 1px grey,
              inset -2px -2px #dfdfdf, inset 2px 2px #0a0a0a;
}

/* the shadow is on the wrapper, not the img: inset shadows paint over
   the content box of a replaced element in some browsers */
.portrait img {
  display: block;
  width: 116px;
  height: 116px;
}

/* 98.css puts the 11px pixel font on .window, which cascades onto body
   copy and makes paragraphs hard to read. Prose gets a real text face;
   all the chrome (title bars, status bars, taskbar, menu, tree nodes,
   the h1) keeps the pixel font.

   Verdana is the deliberate pick: Matthew Carter drew it in 1996 for
   on-screen legibility and it shipped with Windows 98, so it is both
   the most readable option and period-correct. */
.window-body p,
.tree-view p {
  font-family: Verdana, Tahoma, Geneva, "DejaVu Sans", sans-serif;
  font-size: 12.5px;
  line-height: 1.6;
  color: #1a1a1a;
  -webkit-font-smoothing: antialiased;   /* .window sets this to none */
  -moz-osx-font-smoothing: grayscale;
}

.window-body .tagline {
  margin: .2rem 0 1.1rem;
  font-style: italic;
  color: #333;
}

.window-body p {
  margin: 0 0 .8rem;
}

.window-body p:last-child { margin-bottom: 0; }

/* ---- projects tree ---- */

.tree-view .lang {
  font-size: .85em;
  color: #333;
}

.tree-view .lang::before { content: "("; }
.tree-view .lang::after  { content: ")"; }

/* Verdana has a much larger x-height than the 11px pixel font, so a
   description set at prose size visually outweighs the project name it
   belongs to. Smaller here, and bold the name, to keep the hierarchy. */
.tree-view p {
  margin: .2rem 0 .7rem;
  font-size: 11.5px;
  line-height: 1.55;
}

.tree-view li > a {
  font-weight: 700;
}

.tree-view ul li:last-child > p { margin-bottom: 0; }

/* ---- colophon ---- */

.colophon {
  margin: 0;
  text-align: center;
  font-size: .8rem;
  color: #cfe3e3;
  text-shadow: 1px 1px 0 rgba(0, 0, 0, .35);
}

.colophon a { color: #fff; }

/* ---- taskbar ---- */

/* 98.css only puts the pixel font on .window/.title-bar/button/etc, so
   this custom chrome would otherwise fall back to body's Arial 12px. */
.taskbar,
.start-menu {
  font-family: "Pixelated MS Sans Serif", Arial;
  font-size: 11px;
  -webkit-font-smoothing: none;
}

.taskbar {
  position: fixed;
  inset: auto 0 0 0;
  height: var(--taskbar-h);
  display: flex;
  align-items: center;
  gap: .35rem;
  padding: 2px 3px;
  background: silver;
  box-shadow: inset 0 1px #fff, inset 0 2px #dfdfdf;
  box-sizing: border-box;
}

.start-btn {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  min-width: 0;
  height: 22px;
  padding: 0 6px;
  font-weight: bold;
}

/* held down while the menu is open, like the real Start button */
.start-btn.is-open {
  box-shadow: inset -1px -1px #fff, inset 1px 1px #0a0a0a,
              inset -2px -2px #dfdfdf, inset 2px 2px grey;
  text-shadow: 1px 1px #222;
}

/* ---- start menu ---- */

.start-menu {
  position: fixed;
  left: 3px;
  bottom: var(--taskbar-h);
  z-index: 10;
  display: flex;
  min-width: 200px;
  background: silver;
  box-shadow: inset -1px -1px #0a0a0a, inset 1px 1px #fff,
              inset -2px -2px grey,   inset 2px 2px #dfdfdf;
}

/* .start-menu sets display:flex, which would beat the UA [hidden] rule */
.start-menu[hidden] { display: none; }

.start-menu-bar {
  flex: none;
  width: 22px;
  margin: 3px;
  background: linear-gradient(#00007b, #0a0a0a);
}

.start-menu-bar span {
  display: block;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  padding: 6px 4px;
  color: #c0c0c0;
  font-weight: bold;
  font-size: .95rem;
  letter-spacing: .02em;
  white-space: nowrap;
}

.start-menu-items {
  flex: 1 1 auto;
  list-style: none;
  margin: 3px 3px 3px 0;
  padding: 0;
}

.start-menu-items a {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: 5px 24px 5px 6px;
  color: #0a0a0a;
  text-decoration: none;
  white-space: nowrap;
}

.start-menu-items a:hover,
.start-menu-items a:focus {
  background: #00007b;
  color: #fff;
  outline: none;
}

.mi-icon {
  width: 1.1em;
  flex: none;
  text-align: center;
  font-size: .95em;
}

.start-menu-items .sep {
  height: 2px;
  margin: 3px 2px;
  box-shadow: inset 0 1px grey, inset 0 -1px #fff;
}

/* the four-pane flag, drawn rather than shipped as an image */
.start-flag {
  width: 14px;
  height: 14px;
  flex: none;
  background:
    linear-gradient(#f00 0 0)     0    0   / 6px 6px no-repeat,
    linear-gradient(#0a0 0 0)     8px  0   / 6px 6px no-repeat,
    linear-gradient(#00f 0 0)     0    8px / 6px 6px no-repeat,
    linear-gradient(#ff0 0 0)     8px  8px / 6px 6px no-repeat;
}

.taskbar-divider {
  width: 2px;
  height: 20px;
  flex: none;
  box-shadow: inset 1px 0 grey, inset -1px 0 #fff;
}

.taskbar-window {
  flex: 1 1 auto;
  min-width: 0;
  height: 22px;
  display: flex;
  align-items: center;
  padding: 0 8px;
  max-width: 14rem;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  box-shadow: inset -1px -1px #fff, inset 1px 1px #0a0a0a,
              inset -2px -2px #dfdfdf, inset 2px 2px grey;
}

.tray {
  margin-left: auto;
  flex: none;
  height: 22px;
  display: flex;
  align-items: center;
  padding: 0 8px;
  box-shadow: inset 1px 1px grey, inset -1px -1px #fff;
}

/* ---- small screens ---- */

@media (max-width: 30rem) {
  body { padding-left: .5rem; padding-right: .5rem; }
  .taskbar-window { display: none; }

  .start-menu { max-width: calc(100vw - 6px); }

  .portrait { margin-left: .75rem; }
  .portrait img { width: 88px; height: 88px; }
}
