/* Display chrome in the corrected 1600 × 948.25 virtual plane.
   No inverse scaleY: the projection itself must preserve square pixels.
   Menubar uses a consistent 1.25× desktop UI density (24 / 13 pt base). */
#screen {
  --mac-menu-density: 1.25;
  --mac-menu-icon-scale: .85;
}

#screen .menubar {
  height: calc(24px * var(--mac-menu-density));
  padding: 0 calc(15px * var(--mac-menu-density));
  gap: calc(18px * var(--mac-menu-density));
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", sans-serif;
  font-size: calc(13px * var(--mac-menu-density));
  font-weight: 400;
  font-style: normal;
  font-stretch: normal;
  font-kerning: normal;
  line-height: 1;
  letter-spacing: 0;
  white-space: nowrap;
  color: rgba(255, 255, 255, .98);
  text-shadow: 0 1px 1px rgba(0, 0, 0, .12);
  background: rgba(29, 32, 37, .16);
  -webkit-backdrop-filter: blur(24px) saturate(135%);
  backdrop-filter: blur(24px) saturate(135%);
}

#screen .menubar > span:not(.right) {
  flex: 0 0 auto;
}

#screen .menubar .apple {
  width: calc(15px * var(--mac-menu-density) * var(--mac-menu-icon-scale));
  height: calc(18px * var(--mac-menu-density) * var(--mac-menu-icon-scale));
  flex: 0 0 auto;
  margin-right: calc(-1px * var(--mac-menu-density));
  fill: currentColor;
}

#screen .menubar .app {
  font-weight: 600;
}

#screen .menubar .right {
  min-width: 0;
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: calc(17px * var(--mac-menu-density) * var(--mac-menu-icon-scale));
}

#screen .menubar .ico {
  display: block;
  width: calc(16px * var(--mac-menu-density) * var(--mac-menu-icon-scale));
  height: calc(16px * var(--mac-menu-density) * var(--mac-menu-icon-scale));
  flex: 0 0 auto;
  overflow: visible;
  fill: currentColor;
}

#screen .menubar .ico.wifi {
  width: calc(18px * var(--mac-menu-density) * var(--mac-menu-icon-scale));
  height: calc(14px * var(--mac-menu-density) * var(--mac-menu-icon-scale));
}

#screen .menubar .ico.spotlight {
  width: calc(15px * var(--mac-menu-density) * var(--mac-menu-icon-scale));
  height: calc(15px * var(--mac-menu-density) * var(--mac-menu-icon-scale));
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
}

#screen .menubar .ico.control-center {
  width: calc(17px * var(--mac-menu-density) * var(--mac-menu-icon-scale));
  height: calc(16px * var(--mac-menu-density) * var(--mac-menu-icon-scale));
}

#screen .menubar .ico.bat {
  width: calc(25px * var(--mac-menu-density) * var(--mac-menu-icon-scale));
  height: calc(12.5px * var(--mac-menu-density) * var(--mac-menu-icon-scale));
}

#screen .menubar .clock {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}

#screen .dock {
  bottom: 12px;
  align-items: center;
  gap: 4px;
  padding: 5px 8px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, .32);
  background: rgba(230, 233, 238, .30);
  -webkit-backdrop-filter: blur(26px) saturate(150%);
  backdrop-filter: blur(26px) saturate(150%);
  box-shadow: 0 7px 20px rgba(0, 0, 0, .22), inset 0 1px 0 rgba(255, 255, 255, .22);
}

#screen .dock .di:not(.sep) {
  width: 72px;
  height: 72px;
  aspect-ratio: 1;
  flex: 0 0 72px;
}

#screen .dock .di img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

#screen .dock .di.sep {
  align-self: center;
  width: 1px;
  height: 44px;
  margin: 0 7px;
  background: rgba(39, 43, 50, .24);
}

/* Native SF Symbol exports. Use their intrinsic ratio, including Apple's optical
   side bearings, with Ryan's 15% reduction from the previous quarter-size exports. */
#screen .menubar img.ico { object-fit: contain; height: auto; user-select: none; }
#screen .menubar img.ico.wifi { width: calc(29px * var(--mac-menu-icon-scale)); height: auto; }
#screen .menubar img.ico.spotlight { width: calc(22px * var(--mac-menu-icon-scale)); height: auto; }
#screen .menubar img.ico.control-center { width: calc(26px * var(--mac-menu-icon-scale)); height: auto; }


/* The screen is a fixed 1600px virtual desktop. Keep the four Mac projects in
   one row, leaving the menu and dock exposed. */
#screen .tiles {
  top: 44px;
  bottom: 120px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-flow: row;
  grid-auto-columns: auto;
  grid-auto-rows: max-content;
  align-content: safe center;
  align-items: stretch;
  justify-content: center;
  gap: 24px;
  padding: 20px 32px;
  overflow: hidden;
  overscroll-behavior: contain;
  scrollbar-gutter: stable both-edges;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, .65) rgba(0, 0, 0, .12);
  scroll-padding-block: 20px;
}

#screen.show-tiles .tiles {
  overflow-y: auto;
}

#screen .tile {
  min-width: 0;
  scroll-margin-block: 20px;
}

#screen .tile:focus-visible {
  outline: 3px solid #0071e3;
  outline-offset: 5px;
}

#screen .tile .th {
  aspect-ratio: 16 / 9;
}

#screen .tile .project-tile-content {
  min-width: 0;
  padding: 24px 26px;
}

#screen .tile .k,
#screen .tile h3,
#screen .tile p {
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
}

#screen .tile .k {
  font-size: 17px;
  line-height: 1.35;
}

#screen .tile h3 {
  min-height: 0;
  margin: 8px 0 0;
  font-size: 30px;
  line-height: 1.15;
  text-wrap: balance;
}

#screen .tile p {
  margin: 10px 0 0;
  font-size: 20px;
  line-height: 1.4;
  text-wrap: pretty;
}
