:root {
  --desktop: #008080;
  --chrome: #c0c0c0;
  --navy: #000080;
  --ink: #000;
  --paper: #fff;
}

body {
  padding: 20px;
  background:
    radial-gradient(circle at 24px 24px, rgb(255 255 255 / 10%) 0 1px, transparent 2px) 0 0 / 48px 48px,
    var(--desktop);
  color: var(--ink);
  font: 16px/1.5 Tahoma, "MS Sans Serif", Arial, sans-serif;
}

.site-shell {
  width: min(900px, 100%);
  margin: 0 auto;
  padding: 3px;
  background: var(--chrome);
  border-color: #fff #000 #000 #fff;
  border-style: solid;
  border-width: 2px;
  box-shadow: 2px 2px 0 rgb(0 0 0 / 35%);
}

.site-header {
  position: relative;
  min-height: 48px;
  padding: 7px 205px 7px 42px;
  background: var(--navy);
  color: #fff;
}

.site-header::before {
  content: "M";
  position: absolute;
  top: 8px;
  left: 8px;
  display: grid;
  width: 29px;
  height: 29px;
  place-items: center;
  background: #fff;
  color: var(--navy);
  font-weight: 900;
  box-shadow: inset -2px -2px #808080;
}

.site-title {
  margin: 0;
  color: #fff;
  font-family: "Comic Sans MS", "Segoe Print", cursive;
  font-size: clamp(1.55rem, 4vw, 2.25rem);
  line-height: 1.05;
}

.site-description {
  margin: 6px 0 0;
  font-size: 0.9rem;
}

.appearance-trigger {
  position: absolute;
  top: 7px;
  right: 7px;
  padding: 6px 12px;
  border-color: #fff #000 #000 #fff;
  border-style: solid;
  border-width: 2px;
  border-radius: 0;
  background: var(--chrome);
  color: #000;
  cursor: pointer;
  box-shadow: 1px 1px 0 #000;
}

.appearance-trigger:active,
.project-open:active,
.appearance-options button:active {
  border-color: #000 #fff #fff #000;
  transform: translate(1px, 1px);
}

.site-main {
  padding: 10px;
  background: var(--chrome);
}

.intro,
.previous-work,
.projects,
.contact,
.demo-card {
  margin: 0 0 12px;
  background: var(--paper);
  border-color: #808080 #fff #fff #808080;
  border-style: solid;
  border-width: 2px;
}

.intro,
.contact,
.demo-card {
  padding: 18px;
}

.intro::before {
  content: "Welcome.txt";
  display: block;
  margin: -18px -18px 16px;
  padding: 5px 8px;
  background: #0000a8;
  color: #fff;
  font-weight: 700;
}

.section-header,
.dialog-header,
.appearance-header {
  display: flex;
  min-height: 34px;
  align-items: center;
  justify-content: space-between;
  padding: 5px 7px;
  background: #0000a8;
  color: #fff;
}

.section-title,
.dialog-header h2,
.appearance-header h2 {
  margin: 0;
  color: inherit;
  font-size: 1rem;
  line-height: 1.3;
}

.section-content {
  padding: 18px;
}

p {
  margin: 0 0 13px;
}

a {
  color: #0000ee;
  text-decoration: underline;
}

a:visited {
  color: #551a8b;
}

.project-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 20px;
}

.project-open {
  display: grid;
  width: 100%;
  min-height: 125px;
  place-items: center;
  align-content: center;
  gap: 12px;
  padding: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: #000;
  cursor: pointer;
}

.project-open:hover,
.project-open:focus-visible {
  border: 1px dotted var(--navy);
  background: #dceaff;
}

.project-icon {
  position: relative;
  width: 44px;
  height: 38px;
  border: 2px solid #000;
  background: #fff;
  box-shadow: inset -3px -3px #808080;
}

.project-icon::before {
  content: "";
  position: absolute;
  inset: 6px;
  border: 2px solid #000;
  background: var(--navy);
}

.project--railway-terminus .project-icon::before {
  background: linear-gradient(#7ec8cf 0 45%, #222 46% 57%, #c62828 58% 75%, #777 76%);
}

.project--lafayette-deal .project-icon::before {
  background: repeating-linear-gradient(45deg, #a62020 0 5px, #fff 5px 10px);
}

.project-name {
  font-weight: 700;
}

.project-count {
  margin: 0 5px 5px;
  padding: 3px 7px;
  border-color: #808080 #fff #fff #808080;
  border-style: solid;
  border-width: 2px;
  font-size: 0.8rem;
}

.contact .section-title {
  margin: -18px -18px 16px;
  padding: 5px 8px;
  background: #0000a8;
  color: #fff;
}

.project-dialog,
.appearance-dialog {
  width: min(680px, calc(100vw - 24px));
  padding: 3px;
  border-color: #fff #000 #000 #fff;
  border-style: solid;
  border-width: 2px;
  border-radius: 0;
  background: var(--chrome);
  color: #000;
  box-shadow: 2px 2px 0 #000;
}

.dialog-header button,
.appearance-close {
  display: grid;
  width: 30px;
  min-height: 28px;
  padding: 0;
  place-items: center;
  border-color: #fff #000 #000 #fff;
  border-style: solid;
  border-width: 2px;
  border-radius: 0;
  background: var(--chrome);
  color: #000;
  font-weight: 900;
}

.dialog-content,
.appearance-content {
  padding: 16px;
  background: #fff;
  border-color: #808080 #fff #fff #808080;
  border-style: solid;
  border-width: 2px;
}

.dialog-content img {
  max-height: 360px;
  margin: 0 auto 16px;
  border: 1px solid #000;
  object-fit: contain;
}

.appearance-help {
  margin-bottom: 12px;
}

.appearance-options {
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.appearance-options button {
  padding: 8px;
  border-color: #fff #000 #000 #fff;
  border-style: solid;
  border-width: 2px;
  border-radius: 0;
  background: var(--chrome);
  color: #000;
  text-align: left;
}

.appearance-options button[aria-current="true"] {
  background: var(--navy);
  color: #fff;
  outline: 1px dotted #fff;
  outline-offset: -5px;
}

.site-nav {
  margin-bottom: 5px;
}

.home-link {
  color: #fff;
}

.site-main > h2,
.site-main > h3,
.site-main > h4,
.site-main > ul,
.site-main > ol,
.site-main > p,
.site-main > div {
  margin-right: 8px;
  margin-left: 8px;
}

code {
  padding: 1px 3px;
  background: #fff;
  border: 1px inset #fff;
  font-family: "Courier New", monospace;
}

@media (max-width: 620px) {
  body {
    padding: 6px;
  }

  .site-header {
    padding: 8px 8px 60px 42px;
  }

  .appearance-trigger {
    top: auto;
    right: 8px;
    bottom: 8px;
    left: 8px;
    width: calc(100% - 16px);
  }

  .project-list,
  .appearance-options {
    grid-template-columns: 1fr;
  }

  .project-open {
    grid-template-columns: 54px 1fr;
    min-height: 72px;
    justify-items: start;
    text-align: left;
  }

  .intro,
  .contact,
  .demo-card,
  .section-content {
    padding: 14px;
  }

  .intro::before,
  .contact .section-title {
    margin: -14px -14px 14px;
  }
}

/* Document workspace */
.site-header {
  min-height: 48px;
  padding: 7px 132px 7px 10px;
}

.site-header::before {
  content: none;
}

.site-title {
  font-family: "Caveat", "Segoe Print", "Bradley Hand", cursive;
  font-size: clamp(1.9rem, 4vw, 2.55rem);
  font-weight: 700;
}

.appearance-trigger {
  top: 5px;
  right: 5px;
  min-height: 38px;
  margin: 0;
  padding: 4px 8px;
  box-shadow: none;
  font-size: 0.68rem;
}

.intro,
.previous-work {
  position: relative;
  padding: 0;
  border-width: 1px;
  box-shadow: 2px 2px 0 #777;
}

.intro::before {
  content: "Welcome.txt — Notepad";
  margin: 0;
  padding: 4px 7px;
  background: var(--navy);
}

.intro p,
.section-content p {
  margin-right: 16px;
  margin-left: 16px;
}

.intro p:first-of-type,
.section-content::before {
  display: block;
  padding-top: 42px;
}

.intro p:first-of-type::before,
.section-content::before {
  content: "File   Edit   Search   Help";
  position: absolute;
  top: 31px;
  right: 1px;
  left: 1px;
  height: 31px;
  padding: 5px 8px;
  border-bottom: 1px solid #777;
  background: var(--chrome);
  color: #000;
  font-size: 0.78rem;
  font-weight: 400;
}

.intro p:last-child {
  padding-bottom: 12px;
}

.previous-work .section-header {
  background: #0000a8;
}

.previous-work .section-title::after {
  content: " — WordPad";
}

.section-content {
  position: relative;
  padding: 42px 0 10px;
}

.section-content::before {
  content: "File   Edit   View   Insert   Format   Help";
  top: 0;
}

.project-icon {
  width: 32px;
  height: 32px;
  border: 0;
  background: transparent;
  box-shadow: none;
  image-rendering: pixelated;
  transform: scale(1.5);
  transform-origin: center;
}

.project-icon::before,
.project-icon::after {
  content: "";
  position: absolute;
}

.project--browser-tools .project-icon {
  border: 2px solid #fff;
  outline: 2px solid #000;
  background: #000080;
  box-shadow: inset 0 0 0 2px #808080;
}

.project--browser-tools .project-icon::before {
  content: ">_";
  top: 7px;
  left: 4px;
  border: 0;
  background: transparent;
  color: #00ff00;
  font: 700 10px/1 "Courier New", monospace;
}

.project--browser-tools .project-icon::after {
  right: 4px;
  bottom: 5px;
  left: 4px;
  height: 3px;
  background: #00ff00;
}

.project--railway-terminus .project-icon::before {
  top: 1px;
  left: 2px;
  width: 24px;
  height: 20px;
  border: 3px solid #222;
  background: #b7d4d8;
  box-shadow: inset 0 0 0 2px #fff;
}

.project--railway-terminus .project-icon::after {
  bottom: 6px;
  left: 4px;
  width: 23px;
  height: 14px;
  background:
    radial-gradient(circle at 5px 12px, #111 0 3px, transparent 3.5px),
    radial-gradient(circle at 18px 12px, #111 0 3px, transparent 3.5px),
    linear-gradient(#111 0 0) 2px 7px / 19px 5px no-repeat,
    linear-gradient(#e3342f 0 0) 3px 7px / 12px 3px no-repeat,
    linear-gradient(#111 0 0) 14px 2px / 6px 10px no-repeat,
    linear-gradient(#d0d0d0 0 0) 15px 4px / 3px 3px no-repeat,
    linear-gradient(#111 0 0) 4px 2px / 4px 7px no-repeat,
    linear-gradient(#111 0 0) 3px 0 / 6px 3px no-repeat;
}

.project--lafayette-deal .project-icon::before,
.project--lafayette-deal .project-icon::after {
  width: 15px;
  height: 23px;
  border: 1px solid #000;
  background: linear-gradient(#bf3429 0 8px, #f8f6ec 8px);
  box-shadow: 1px 1px 0 #555, inset 0 -4px #f8f6ec;
}

.project--lafayette-deal .project-icon::before {
  top: 5px;
  left: 1px;
  transform: rotate(-18deg);
}

.project--lafayette-deal .project-icon::after {
  top: 4px;
  right: 1px;
  background: #f9c6ad;
  box-shadow: -8px 3px 0 0 #19552c, -7px 2px 0 1px #000, 1px 1px 0 #555;
  transform: rotate(18deg);
}

@media (max-width: 620px) {
  .site-header {
    padding: 7px 112px 7px 8px;
  }

  .site-title {
    font-size: 1.72rem;
  }

  .appearance-trigger {
    top: 5px;
    right: 5px;
    bottom: auto;
    left: auto;
    width: auto;
    max-width: 102px;
    font-size: 0.62rem;
    line-height: 1.15;
  }

  .intro,
  .contact,
  .demo-card {
    padding: 0;
  }

  .intro::before {
    margin: 0;
  }

  .intro p,
  .section-content p {
    margin-right: 12px;
    margin-left: 12px;
  }

  .contact {
    padding: 14px;
  }

  .contact .section-title {
    margin: -14px -14px 14px;
  }
}
