:root {
  --black: #000;
  --dark: #242424;
  --gray: #a8aaa8;
  --light-gray: #d7d7d3;
  --white: #fff;
  --mono: "Pixel Operator", "basis33", monospace;
  --line: 2px solid var(--black);
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; }

body {
  overflow: hidden;
  background: var(--black);
  color: var(--black);
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 400;
  font-synthesis: none;
}

button, a { color: inherit; font: inherit; }
button { border-radius: 0; }
h1, h2, h3, h4, h5, h6 { font-weight: 700; }

.machine-shell {
  width: 100%;
  height: 100%;
  padding: 24px;
  display: grid;
  place-items: center;
  background: var(--black);
}

.screen {
  position: relative;
  width: min(960px, 100%);
  height: min(660px, calc(100vh - 48px));
  min-height: 520px;
  overflow: hidden;
  border: 0;
  border-radius: 11px;
  background: var(--gray);
  box-shadow: none;
}

.screen::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1000;
  pointer-events: none;
  opacity: .11;
  background: repeating-linear-gradient(0deg, transparent 0 2px, #000 3px);
}

.menubar {
  position: relative;
  z-index: 900;
  height: 40px;
  padding: 0 7px;
  display: flex;
  align-items: stretch;
  border-bottom: var(--line);
  background: var(--white);
  font-size: 22px;
  font-weight: 700;
}

.brand-button,
.menu-trigger,
.menu-contact {
  padding: 0 10px;
  border: 0;
  background: transparent;
  font-weight: 700;
  cursor: pointer;
}

.brand-button { width: 31px; padding: 0 4px; display: grid; place-items: center; }
.brand-mark {
  width: 21px;
  height: 21px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--black);
  color: var(--white);
  font-size: 11px;
}

.menu-wrap { position: relative; display: flex; }
.menu-trigger:hover,
.menu-wrap.open .menu-trigger,
.menu-contact:hover { background: var(--black); color: var(--white); }
.menu-contact { text-decoration: none; }

.dropdown {
  position: absolute;
  top: 38px;
  left: 0;
  width: max-content;
  min-width: 190px;
  display: none;
  padding: 4px;
  border: var(--line);
  background: var(--white);
  box-shadow: 3px 3px 0 var(--black);
}
.menu-wrap.open .dropdown { display: grid; }
.dropdown button,
.dropdown a {
  width: 100%;
  padding: 5px 7px;
  border: 0;
  background: transparent;
  color: var(--black);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.dropdown button:hover,
.dropdown a:hover { background: var(--black); color: var(--white); }
.dropdown kbd { float: right; margin-left: 24px; color: #777; }

.desktop {
  position: relative;
  width: 100%;
  height: calc(100% - 40px);
  overflow: hidden;
  background-color: var(--gray);
  background-image: radial-gradient(rgba(0, 0, 0, .11) .55px, transparent .55px);
  background-size: 3px 3px;
}

.icon-grid,
.folder-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(105px, 1fr));
  align-content: start;
  justify-items: center;
  gap: 25px 6px;
}

.icon-grid {
  width: 100%;
  height: 100%;
  padding: 29px 25px;
  overflow-y: auto;
}

.desktop-icon {
  width: 130px;
  min-width: 0;
  min-height: 106px;
  padding: 3px;
  border: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 5px;
  background: transparent;
  cursor: pointer;
}
.desktop-icon:focus-visible { outline: 2px dotted var(--black); outline-offset: 2px; }
.desktop-icon:hover .icon-label,
.desktop-icon:focus-visible .icon-label { background: var(--black); color: var(--white); }

.reference-icon {
  width: 92px;
  height: 75px;
  display: grid;
  place-items: center;
}
.reference-icon img {
  width: 92px;
  height: 75px;
  object-fit: contain;
  image-rendering: pixelated;
  filter: grayscale(1) contrast(1.08);
  user-select: none;
  -webkit-user-drag: none;
}
.reference-icon.application-icon img { width: 74px; height: 74px; }

.icon-grid > .desktop-icon .reference-icon,
.icon-grid > .desktop-icon .reference-icon img,
.icon-grid > .desktop-icon .reference-icon.application-icon img {
  width: 70px;
  height: 70px;
}

.icon-grid > .desktop-icon .icon-label { font-size: 22px; }

.icon-label {
  display: -webkit-box;
  max-width: 128px;
  padding: 2px 4px;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  background: var(--white);
  font-size: 22px;
  line-height: 1.15;
  text-align: center;
  overflow-wrap: anywhere;
}

.os-window {
  position: absolute;
  inset: 0;
  z-index: 20;
  width: 100%;
  height: 100%;
  display: block;
  border: 4px double var(--black);
  background: var(--white);
  box-shadow: none;
  visibility: hidden;
  pointer-events: none;
  transform: scale(0);
  transform-origin: center center;
  transition:
    transform 250ms linear,
    visibility 0s linear 250ms;
  will-change: transform;
  backface-visibility: hidden;
}
.os-window.is-open {
  visibility: visible;
  pointer-events: auto;
  transform: scale(1);
  transition:
    transform 250ms linear,
    visibility 0s linear 0s;
}
.os-window.is-active { z-index: 100; }

.window-bar {
  height: 31px;
  display: grid;
  grid-template-columns: 41px 1fr 41px;
  align-items: center;
  border-bottom: var(--line);
  background: repeating-linear-gradient(to bottom, var(--white) 0 2px, var(--black) 2px 4px);
}
.window-bar > span {
  justify-self: center;
  max-width: 92%;
  padding: 2px 11px;
  overflow: hidden;
  background: var(--white);
  font-size: 22px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.window-bar > i { width: 100%; height: 24px; background: var(--white); }
.window-close {
  position: relative;
  width: 19px;
  height: 19px;
  margin-left: 8px;
  border: var(--line);
  background: var(--white);
  cursor: pointer;
}
.window-close::before,
.window-close::after {
  content: "";
  position: absolute;
  left: 2px;
  top: 7px;
  width: 11px;
  border-top: 2px solid var(--black);
  transform: rotate(45deg);
}
.window-close::after { transform: rotate(-45deg); }
.window-content { height: calc(100% - 31px); overflow: auto; background: var(--white); }

.folder-info { display: none; }
.folder-window .window-content { height: calc(100% - 31px); }
.folder-grid {
  padding: 31px 25px;
  background: var(--white);
}

.document-view { padding: clamp(28px, 6vw, 64px); }
.document-meta {
  padding-bottom: 9px;
  display: flex;
  justify-content: space-between;
  border-bottom: 1px dotted var(--black);
  font-size: 22px;
  font-weight: 400;
}
.document-view h2 {
  margin: 35px 0 20px;
  font-family: var(--mono);
  font-size: clamp(34px, 6vw, 62px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0;
  text-transform: uppercase;
}
.document-lead {
  max-width: 700px;
  margin: 0 0 28px;
  padding-left: 14px;
  border-left: 5px solid var(--black);
  font-size: 22px;
  font-weight: 400;
  line-height: 1.5;
}
.prose {
  max-width: 760px;
  font-size: 15px;
  line-height: 1.65;
  white-space: pre-line;
  user-select: text;
}
.skill-strip { margin-top: 38px; display: flex; flex-wrap: wrap; gap: 6px; }
.skill-strip span { padding: 5px 8px; border: 1px solid var(--black); background: var(--white); font-size: 11px; font-weight: 400; }

.media-thumb {
  position: relative;
  width: 86px;
  height: 76px;
  padding: 4px;
  border: var(--line);
  background: var(--white);
}
.media-thumb img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1); }
.media-thumb i { position: absolute; right: 2px; bottom: 2px; padding: 1px 3px; background: var(--black); color: var(--white); font-size: 9px; font-style: normal; }
.video-thumb { display: grid; place-items: center; background: var(--white); color: var(--black); }
.play-symbol { font-size: 25px; }

.contact-content { padding: clamp(32px, 7vw, 75px); color: var(--black); background: var(--white); }
.contact-prompt { font-size: 12px; font-weight: 400; }
.contact-content h2 { margin: 24px 0 40px; font: 900 clamp(38px, 7vw, 72px)/.95 Arial Black, Impact, sans-serif; letter-spacing: -.05em; text-transform: uppercase; }
.contact-content h2 { font-family: var(--mono); font-weight: 700; letter-spacing: 0; }
.contact-links { max-width: 720px; display: grid; border-top: var(--line); }
.contact-links a { padding: 13px 5px; display: grid; grid-template-columns: 90px 1fr; border-bottom: 1px solid var(--black); color: var(--black); text-decoration: none; }
.contact-links a:hover { background: var(--black); color: var(--white); padding-left: 10px; }
.contact-links span { font-size: 11px; }

.media-window { background: var(--black); }
.media-viewer { height: calc(100% - 72px); display: block; overflow-x: hidden; overflow-y: auto; background: var(--black); }
.media-viewer img { display: block; width: 100%; height: auto; max-width: 100%; margin: 0; }
.media-viewer video { display: block; width: 100%; height: 100%; object-fit: contain; }
.media-caption { height: 41px; margin: 0; padding: 11px; overflow: hidden; border-top: 1px solid var(--white); background: var(--black); color: var(--white); font-size: 12px; text-align: center; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 800px) {
  .machine-shell { padding: 0; }
  .screen { width: 100%; height: 100%; min-height: 0; border: 0; border-radius: 0; box-shadow: none; }
  .icon-grid, .folder-grid { grid-template-columns: repeat(4, minmax(92px, 1fr)); }
}

@media (max-width: 560px) {
  .menubar { height: 40px; padding: 0 3px; font-size: 22px; }
  .brand-button { width: 28px; }
  .menu-trigger, .menu-contact { padding: 0 7px; }
  .menu-wrap:nth-of-type(3) { display: none; }
  .dropdown { top: 38px; }
  .desktop { height: calc(100% - 40px); }
  .icon-grid, .folder-grid { grid-template-columns: repeat(3, minmax(82px, 1fr)); gap: 20px 2px; padding: 24px 5px; }
  .desktop-icon { width: 105px; }
  .reference-icon, .reference-icon img { width: 78px; height: 64px; }
  .icon-label { max-width: 104px; font-size: 11px; }
  .document-view { padding: 25px 18px 55px; }
  .document-view h2 { font-size: 36px; }
  .document-meta { gap: 15px; }
  .contact-content h2 { font-size: 40px; }
}

@media print {
  body, .machine-shell { overflow: visible; background: var(--white); }
  .screen { width: 100%; height: auto; min-height: 100vh; border: 0; }
  .menubar, .icon-grid { display: none; }
  .os-window { position: static; display: none !important; border: 0; }
  .os-window.is-active { display: block !important; }
}

@media (prefers-reduced-motion: reduce) {
  .os-window,
  .os-window.is-open { transition-duration: 1ms; }
}
