/* Window: one desktop, held to Windows 98 with the Standard scheme.
   Every value here is written by hand. The bevel is the 98.css recipe
   (jdan), retyped, with the outer dark edge at #000000 because that is the
   3D dark shadow the 98 scheme actually used.
   Type: Pixelify Sans stands in for the bold system face in title bars and
   the one large name. Text is Tahoma, then Verdana, as the system had it.
   Sizes follow the "Large Fonts" setting of the day: 8pt at 120 dpi is 13px.
   Motion: none. The era had none, so nothing here animates. */

:root {
  --desk: #008080;    /* desktop, no wallpaper */
  --face: #c0c0c0;    /* button face */
  --title: #000080;   /* active title bar, drawn solid as 98 did in 16 colors */
  --shadow: #808080;  /* button shadow */
  --hi: #ffffff;      /* button highlight */
  --light: #dfdfdf;   /* 3D light, part of the bevel recipe */
  --dark: #000000;    /* 3D dark shadow and text */

  --bevel-window: inset -1px -1px var(--dark), inset 1px 1px var(--light),
                  inset -2px -2px var(--shadow), inset 2px 2px var(--hi);
  --bevel-button: inset -1px -1px var(--dark), inset 1px 1px var(--hi),
                  inset -2px -2px var(--shadow), inset 2px 2px var(--light);
  --bevel-pressed: inset -1px -1px var(--hi), inset 1px 1px var(--dark),
                   inset -2px -2px var(--light), inset 2px 2px var(--shadow);
  --bevel-field: inset -1px -1px var(--hi), inset 1px 1px var(--shadow),
                 inset -2px -2px var(--light), inset 2px 2px var(--dark);
  --bevel-thin-in: inset -1px -1px var(--hi), inset 1px 1px var(--shadow);

  --text: Tahoma, Verdana, sans-serif;
  --pixel: "Pixelify Sans", Tahoma, Verdana, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { background: var(--desk); }

body {
  margin: 0;
  background: var(--desk);
  color: var(--dark);
  font: 13px/1.4 var(--text);
  -webkit-text-size-adjust: 100%;
}

img { display: block; image-rendering: pixelated; }

::selection { background: var(--title); color: var(--hi); }

a { color: var(--title); }

a:focus-visible { outline: 1px dotted var(--dark); outline-offset: 1px; }

u { text-decoration-thickness: 1px; text-underline-offset: 2px; }

/* ---------- the strip outside the fiction ---------- */

.meta {
  display: flex;
  gap: 20px;
  height: 33px;
  padding: 8px 16px;
  color: var(--hi);
  font-size: 12px;
  line-height: 17px;
}

.meta a { color: var(--hi); }
.meta a:focus-visible { outline: 2px solid var(--hi); outline-offset: 2px; }

/* ---------- desktop ---------- */

.desktop {
  position: relative;
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  grid-template-rows: 1fr auto auto;
  min-height: calc(100vh - 33px);
  min-height: calc(100svh - 33px); /* the strip above is 33px, so the taskbar lands on the first screen's floor */
  padding-left: 8px;
}

/* where an evaluation build printed its build number */
.watermark {
  grid-column: 2;
  grid-row: 2;
  justify-self: end;
  margin: 0;
  padding: 0 12px 10px;
  color: var(--hi);
  font-size: 12px;
  text-align: right;
}

.start-target { position: absolute; top: 0; left: 0; scroll-margin-top: 200px; }

.icons { grid-column: 1; grid-row: 1; padding-top: 8px; }

.icons ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-auto-rows: 76px;
}

.icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 80px;
  padding-top: 4px;
  color: var(--hi);
  text-decoration: none;
  text-align: center;
}

.glyph { position: relative; display: block; width: 32px; height: 32px; }

.label { padding: 0 2px; line-height: 1.25; }

.icon:focus-visible { outline: none; }
.icon:focus-visible .label {
  background: var(--title);
  outline: 1px dotted var(--hi);
}

/* a selected icon: navy label, and the icon itself stippled navy through a mask */
.glyph::after {
  content: "";
  position: absolute;
  inset: 0;
  display: none;
  background: url(selected.png) 0 0 / 2px 2px;
  image-rendering: pixelated;
  -webkit-mask: var(--m) 0 0 / 32px 32px no-repeat;
  mask: var(--m) 0 0 / 32px 32px no-repeat;
}
.i-card { --m: url(icon-card.png); }
.i-about { --m: url(icon-page.png); }
.i-projects, .i-writing { --m: url(icon-folder.png); }
.i-bin { --m: url(icon-bin.png); }

.desktop:has(#about:target) .i-about .label,
.desktop:has(#projects:target) .i-projects .label,
.desktop:has(#writing:target) .i-writing .label,
.desktop:has(#bin:target) .i-bin .label { background: var(--title); }

.desktop:has(#about:target) .i-about .glyph::after,
.desktop:has(#projects:target) .i-projects .glyph::after,
.desktop:has(#writing:target) .i-writing .glyph::after,
.desktop:has(#bin:target) .i-bin .glyph::after { display: block; }

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

.windows {
  grid-column: 2;
  grid-row: 1;
  display: grid;
  grid-template-areas: "w";
  align-items: start;
  justify-items: start;
  padding: 16px 24px 56px 24px;
}

.windows > .window { grid-area: w; }

.window {
  background: var(--face);
  box-shadow: var(--bevel-window);
  padding: 3px;
  scroll-margin-top: 240px;
}

.card { width: min(568px, 100%); margin-top: 8px; z-index: 1; }

.app {
  display: none;
  width: min(600px, calc(100% - 48px));
  margin: 128px 0 0 clamp(48px, calc(100% - 600px), 400px);
  z-index: 2;
}

.app:target { display: block; }

.titlebar {
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 20px;
  padding: 2px 2px 2px 3px;
  background: var(--title);
  color: var(--hi);
}

.titlebar > img { flex: none; }

/* the card goes inactive while another window is in front, as 98 drew it.
   WCAG 1.4.3 exempts inactive components; the same name stays at full
   contrast on the taskbar button. */
@media (min-width: 760px) {
  .desktop:has(.app:target) .card .titlebar { background: var(--shadow); color: var(--face); }
}

.title {
  flex: 1;
  min-width: 0;
  margin: 0;
  font: 700 14px/16px var(--pixel);
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.controls { display: flex; flex: none; }

.ctl {
  position: relative;
  display: block;
  width: 16px;
  height: 14px;
  background: var(--face);
  box-shadow: var(--bevel-button);
}

.ctl-close { margin-left: 2px; }
.ctl-close::before {
  content: "";
  position: absolute;
  left: 4px; top: 3px;
  width: 8px; height: 7px;
  background: url(close.png) 0 0 / 8px 7px no-repeat;
  image-rendering: pixelated;
}
.ctl-min::before {
  content: "";
  position: absolute;
  left: 4px; top: 9px;
  width: 6px; height: 2px;
  background: var(--dark);
}
/* maximize is greyed out, as on a window that cannot be resized */
.ctl-max::before {
  content: "";
  position: absolute;
  left: 3px; top: 2px;
  width: 9px; height: 9px;
  border: 1px solid var(--shadow);
  border-top-width: 2px;
  box-shadow: 1px 1px 0 var(--hi);
}

.ctl:active { box-shadow: var(--bevel-pressed); }
.ctl:focus-visible { outline: 1px dotted var(--hi); outline-offset: 1px; }

/* ---------- property sheet (the card) ---------- */

.tabs { display: flex; padding: 6px 6px 0; }

.tab {
  position: relative;
  z-index: 1;
  margin-bottom: -2px;
  padding: 3px 10px 4px;
  background: var(--face);
  box-shadow: inset 1px 1px var(--hi), inset 2px 2px var(--light),
              inset -1px 0 var(--dark), inset -2px 0 var(--shadow);
}

.sheet {
  margin: 0 6px;
  padding: 14px 12px 12px;
  box-shadow: var(--bevel-button);
}

.ident {
  display: grid;
  grid-template-columns: 192px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.portrait {
  width: 192px;
  height: 240px;
  box-shadow: var(--bevel-field);
  padding: 2px;
  background: var(--face);
}

.who h1 {
  margin: 0 0 4px;
  font: 700 44px/1 var(--pixel);
}

.who p { margin: 0; font-size: 14px; line-height: 1.45; }

.etched {
  height: 0;
  margin: 12px 0;
  border: 0;
  border-top: 1px solid var(--shadow);
  border-bottom: 1px solid var(--hi);
}

.props {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 8px 12px;
  margin: 0;
}
.props dt, .props dd { margin: 0; }
.props dd { overflow-wrap: anywhere; }

.who .hint { font-size: 13px; }

.buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  padding: 10px 6px 6px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 75px;
  min-height: 23px;
  padding: 3px 12px;
  background: var(--face);
  box-shadow: var(--bevel-button);
  color: var(--dark);
  text-decoration: none;
}

/* the default button carries an extra black ring */
.btn-default {
  box-shadow: inset 0 0 0 1px var(--dark), inset -2px -2px var(--dark),
              inset 2px 2px var(--hi), inset -3px -3px var(--shadow),
              inset 3px 3px var(--light);
}

.btn:active { box-shadow: var(--bevel-pressed); }
.btn-default:active { box-shadow: inset 0 0 0 1px var(--dark), inset 0 0 0 2px var(--shadow); }
/* a focused button takes the default ring and the dotted rectangle, as in 98 */
.btn:focus-visible {
  box-shadow: inset 0 0 0 1px var(--dark), inset -2px -2px var(--dark),
              inset 2px 2px var(--hi), inset -3px -3px var(--shadow),
              inset 3px 3px var(--light);
  outline: 1px dotted var(--dark);
  outline-offset: -5px;
}

/* ---------- about dialog ---------- */

.dialog-body {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 16px;
  padding: 16px 16px 4px;
}

.dialog-text p { margin: 0; font-size: 14px; line-height: 1.5; }

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

.menubar { display: flex; flex-wrap: wrap; padding: 2px 0; }
.menubar span { padding: 1px 7px; }

.address {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 4px 4px;
  box-shadow: inset 0 1px var(--shadow), inset 0 2px var(--hi);
}

.address-field {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 4px;
  background: var(--hi);
  box-shadow: var(--bevel-field);
  white-space: nowrap;
  overflow: hidden;
}

.list {
  margin-top: 2px;
  padding: 2px;
  background: var(--hi);
  box-shadow: var(--bevel-field);
  min-height: 200px;
}

.list table { width: 100%; border-spacing: 0; }

.list th {
  padding: 2px 6px;
  background: var(--face);
  box-shadow: var(--bevel-button);
  font-weight: 400;
  text-align: left;
  white-space: nowrap;
}

.list td { padding: 3px 6px; vertical-align: top; }
.list td:first-child { white-space: nowrap; }
.list td img { display: inline-block; vertical-align: -3px; margin-right: 5px; }
.list .col-type { white-space: nowrap; }

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

.taskbar {
  grid-column: 1 / -1;
  grid-row: 3;
  position: sticky;
  bottom: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 4px;
  height: 30px;
  margin-left: -8px;
  padding: 4px 2px 2px;
  background: var(--face);
  box-shadow: inset 0 1px var(--light), inset 0 2px var(--hi);
}

.startbtn {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: none;
  height: 22px;
  padding: 0 6px 0 4px;
  background: var(--face);
  box-shadow: var(--bevel-button);
  color: var(--dark);
  font-weight: 700;
  text-decoration: none;
}
.startbtn:focus-visible { outline: 1px dotted var(--dark); outline-offset: -4px; }

.start-close { display: none; }
.start-target:target ~ .taskbar .start-open { display: none; }
.start-target:target ~ .taskbar .start-close { display: flex; box-shadow: var(--bevel-pressed); }

.startmenu {
  position: absolute;
  left: 2px;
  bottom: 27px;
  display: none;
  grid-template-columns: 22px auto;
  padding: 3px;
  background: var(--face);
  box-shadow: var(--bevel-window);
}

.start-target:target ~ .taskbar .startmenu { display: grid; }

.banner {
  display: flex;
  align-items: flex-end;
  padding: 6px 0;
  background: var(--title);
  color: var(--hi);
  font: 700 17px/22px var(--pixel);
  justify-content: flex-start;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}

.startmenu ul { list-style: none; margin: 0; padding: 0; }

.startmenu a {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 36px;
  padding: 0 28px 0 6px;
  color: var(--dark);
  text-decoration: none;
  white-space: nowrap;
}

.startmenu a:hover,
.startmenu a:focus-visible { background: var(--title); color: var(--hi); outline: none; }

.startmenu .sep {
  height: 0;
  margin: 2px 2px;
  border-top: 1px solid var(--shadow);
  border-bottom: 1px solid var(--hi);
}

.bar-edge {
  flex: none;
  width: 2px;
  height: 22px;
  box-shadow: inset 1px 0 var(--shadow), inset -1px 0 var(--hi);
}

.tasks {
  flex: 1;
  min-width: 0;
  display: flex;
  gap: 3px;
}

.task {
  flex: 0 1 160px;
  min-width: 0;
  display: none;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 6px 0 4px;
  background: var(--face);
  box-shadow: var(--bevel-button);
  color: var(--dark);
  text-decoration: none;
}
.task span { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.task img { flex: none; }
.task:focus-visible { outline: 1px dotted var(--dark); outline-offset: -4px; }

.t-card { display: flex; }
.desktop:has(#about:target) .t-about,
.desktop:has(#projects:target) .t-projects,
.desktop:has(#writing:target) .t-writing,
.desktop:has(#bin:target) .t-bin { display: flex; }

/* the active window's button is pushed in and stippled */
.task.t-card,
.desktop:has(#about:target) .t-about,
.desktop:has(#projects:target) .t-projects,
.desktop:has(#writing:target) .t-writing,
.desktop:has(#bin:target) .t-bin {
  box-shadow: var(--bevel-pressed);
  background: var(--hi) url(pressed.png) 0 0 / 2px 2px;
  font-weight: 700;
}
.desktop:has(.app:target) .task.t-card {
  box-shadow: var(--bevel-button);
  background: var(--face);
  font-weight: 400;
}

.tray {
  flex: none;
  display: flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  box-shadow: var(--bevel-thin-in);
}
.tray a:focus-visible { outline: 1px dotted var(--dark); outline-offset: 1px; }

/* ---------- plain version: no windows, black on white ---------- */

.plain {
  background: var(--hi);
  color: var(--dark);
  padding: 48px 16px 40px 120px; /* text lines up with the card's left edge */
}

.plain-inner { max-width: 32em; font-size: 15px; }

.plain h2 { margin: 0 0 12px; font: 700 26px/1.2 var(--text); }
.plain h3 { margin: 28px 0 8px; font: 700 17px/1.3 var(--text); }
.plain p { margin: 0 0 12px; font-size: 15px; line-height: 1.6; }
.plain a:focus-visible { outline: 2px solid var(--title); outline-offset: 2px; }

.plain-list { margin: 0; font-size: 15px; line-height: 1.5; }
.plain-list dt { font-weight: 700; margin-top: 10px; }
.plain-list dd { margin: 0; }
.plain .back { margin-top: 28px; }

.foot {
  padding: 12px 16px 16px 120px;
  background: var(--hi);
  border-top: 1px solid var(--shadow);
  font-size: 13px;
}
.foot p { margin: 0; }

/* ---------- middle widths: the window cascades closer ---------- */

@media (max-width: 1000px) {
  .app { margin-top: 160px; }
}

/* ---------- phones: icons in a row, windows stacked ---------- */

@media (max-width: 759px) {
  .desktop {
    display: flex;
    flex-direction: column;
    padding-left: 0;
  }

  .icons { padding: 8px 16px 0; }

  .icons ul {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    grid-auto-rows: auto;
    gap: 4px;
  }

  .icon { width: auto; font-size: 12px; padding-bottom: 4px; }

  .windows {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 12px 16px 24px;
  }

  .window { width: 100%; scroll-margin-top: 12px; }
  .card { margin-top: 0; }
  .app { margin: 0; width: 100%; }

  .ident { grid-template-columns: 96px minmax(0, 1fr); gap: 12px; }
  .portrait { width: 96px; height: 120px; padding: 0; box-shadow: none; outline: 1px solid var(--shadow); }
  .who h1 { font-size: 36px; }

  .card .buttons { display: grid; grid-template-columns: 1fr 1fr; }

  .dialog-body { gap: 12px; padding: 12px 10px 4px; }

  .list .col-type { display: none; }

  .taskbar { margin-left: 0; }
  .watermark { padding: 0 16px 10px; text-align: left; justify-self: start; }
  .plain, .foot { padding-left: 16px; }
}

/* narrow phones: portrait beside the name, everything else full width */
@media (max-width: 520px) {
  .who { display: contents; }
  .ident { row-gap: 0; }
  .portrait { grid-row: 1; grid-column: 1; }
  .who h1 { grid-row: 1; grid-column: 2; align-self: end; margin: 0; }
  .who > :not(h1) { grid-column: 1 / -1; }
  .who .role { margin-top: 12px; }
  .icon { font-size: 11px; }
}
