/* heininger.xyz — the System 6 landing page.
   A classic-Mac desktop rendered in pure black and white: 1px hairlines,
   hard 2-3px drop shadows, Chicago pixel type for chrome and headings,
   Geneva for body copy. No design-system tokens here — this page is its
   own visual world. */

@font-face {
  font-family: Chicago;
  font-display: swap;
  src: url("../fonts/ChicagoFLF.woff2") format("woff2"),
       url("../fonts/ChicagoFLF.woff") format("woff");
}

@font-face {
  font-family: Chicago_12;
  font-display: swap;
  src: url("../fonts/ChiKareGo2.woff2") format("woff2"),
       url("../fonts/ChiKareGo2.woff") format("woff");
}

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

body { margin: 0; background: #fff; }

a { color: #000; }
a:hover { color: #000; }

:focus { outline: none; }
:focus-visible { outline: 2px solid #000; outline-offset: 2px; }

/* — the screen — */

/* The rounded corners of a classic Mac display: solid black squares with a
   quarter-disc masked out, so the desktop looks like it sits behind a CRT
   bezel. Fixed, so they stay at the screen's corners while the page scrolls. */
.screen-corner {
  position: fixed;
  width: 14px;
  height: 14px;
  background: #000;
  pointer-events: none;
  z-index: 20;
}

.screen-corner--tl {
  top: 0;
  left: 0;
  -webkit-mask-image: radial-gradient(circle at 100% 100%, transparent 0 14px, #000 14px);
  mask-image: radial-gradient(circle at 100% 100%, transparent 0 14px, #000 14px);
}

.screen-corner--tr {
  top: 0;
  right: 0;
  -webkit-mask-image: radial-gradient(circle at 0 100%, transparent 0 14px, #000 14px);
  mask-image: radial-gradient(circle at 0 100%, transparent 0 14px, #000 14px);
}

.screen-corner--bl {
  bottom: 0;
  left: 0;
  -webkit-mask-image: radial-gradient(circle at 100% 0, transparent 0 14px, #000 14px);
  mask-image: radial-gradient(circle at 100% 0, transparent 0 14px, #000 14px);
}

.screen-corner--br {
  bottom: 0;
  right: 0;
  -webkit-mask-image: radial-gradient(circle at 0 0, transparent 0 14px, #000 14px);
  mask-image: radial-gradient(circle at 0 0, transparent 0 14px, #000 14px);
}

/* — the desktop — */

.desk {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 60px 24px 32px;
  /* The classic 50% dither: a 2x2 checker painted at 4px. */
  background-color: #fff;
  background-image: conic-gradient(#000 25%, #fff 0 50%, #000 0 75%, #fff 0);
  background-size: 4px 4px;
  font-family: Geneva, Verdana, Tahoma, sans-serif;
  color: #000;
}

/* — the Trash — */

/* Bottom right of the desktop, the way it always was — and a link, now, to
   the restaurant at the end of the universe. Sits behind the window. */
.trash {
  position: fixed;
  right: 22px;
  bottom: 20px;
  z-index: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: #000;
}

.trash-can {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.trash-handle {
  width: 18px;
  height: 4px;
  background: #fff;
  border: 2px solid #000;
  border-bottom: 0;
}

.trash-lid {
  width: 44px;
  height: 6px;
  background: #fff;
  border: 2px solid #000;
}

.trash-body {
  width: 38px;
  height: 44px;
  padding: 5px 0 4px;
  background: #fff;
  border: 2px solid #000;
  border-top: 0;
  display: flex;
  justify-content: center;
  gap: 6px;
}

/* the moulded ribs down the bin */
.trash-body span {
  width: 2px;
  background: #000;
}

.trash-label {
  font-family: Chicago_12, Chicago, monospace;
  font-size: 17px;
  line-height: 1;
  padding: 3px 5px;
  background: #fff;
}

/* — menu bar — */

.menubar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 5;
  /* min-height, not height: the bar grows for the switch rather than
     clipping it. */
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 5px 16px;
  background: #fff;
  border-bottom: 1px solid #000;
  font-family: Chicago_12, Chicago, monospace;
  font-size: 22px;
  line-height: 1;
}

.menubar-logo {
  display: inline-block;
  flex: none;
  width: 16px;
  height: 16px;
  background: #000;
  clip-path: polygon(50% 0, 100% 28%, 100% 100%, 0 100%, 0 28%);
}

/* The era switch, styled as a menu-bar item: the current era is "selected"
   the System 6 way — inverted. It is pushed to the far end, with the host
   name trailing it. */
.menubar-era {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: none;
  margin-left: auto;
}

.menubar-era a,
.menubar-era span {
  display: inline-block;
  line-height: 1;
}

/* The link carries a 1px border, so its padding runs 1px tighter than the
   filled segment's — the two end up the same height. */
.menubar-era a {
  padding: 5px 11px;
  color: #000;
  text-decoration: none;
  border: 1px solid #000;
}

.menubar-era a:hover {
  background: #000;
  color: #fff;
}

.menubar-era span {
  padding: 6px 12px;
  background: #000;
  color: #fff;
}

.menubar-host {
  flex: none;
  font-style: italic;
}

/* The dot in heininger.xyz, drawn as a stoplight: three discs stacked on the
   same slant as the italic. The one splash of colour on a monochrome page. */
.brand-dots {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  height: 16px;
  margin: 0 9px 0 6px;
  vertical-align: middle;
  transform: skewX(-12deg);
}

.brand-dots span {
  width: 4px;
  height: 4px;
  flex: none;
  border-radius: 50%;
}

.brand-dots span:nth-child(1) { background: #e01b1b; }
.brand-dots span:nth-child(2) { background: #1db821; }
.brand-dots span:nth-child(3) { background: #1636e0; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* — the window — */

.window {
  width: 100%;
  max-width: 1180px;
  background: #fff;
  border: 1px solid #000;
  border-left-width: 2px;
  box-shadow: 3px 3px 0 #000;
  /* above the Trash, which sits on the desktop at z-index 0 */
  position: relative;
  z-index: 1;
}

.titlebar {
  display: flex;
  align-items: center;
  height: 38px;
  border-top: 1px solid #000;
  border-bottom: 2px solid #000;
  /* The stripes advertise a drag handle, so behave like one. touch-action
     keeps a touch drag from scrolling the page instead. */
  cursor: move;
  touch-action: none;
  /* The dragging stripes, masked out behind the close box and the title, and
     inset 2px so they stop short of the frame. */
  background: repeating-linear-gradient(to bottom, #000 0 2px, transparent 2px 4px)
              left 2px top 6px / calc(100% - 4px) 22px no-repeat;
}

.titlebar-gap { flex: none; width: 9px; }

.titlebar-close {
  flex: none;
  display: flex;
  align-items: center;
  align-self: stretch;
  padding: 0 10px;
  background: #fff;
}

.titlebar-close span {
  display: block;
  width: 22px;
  height: 22px;
  background: #fff;
  border: 2px solid #000;
}

.window[data-dragging] { user-select: none; }

.titlebar-title {
  flex: 1;
  display: flex;
  justify-content: center;
  align-self: stretch;
  overflow: hidden;
  white-space: nowrap;
}

.titlebar-title span {
  display: flex;
  align-items: center;
  padding: 0 12px;
  background: #fff;
  font-family: Chicago_12, Chicago, monospace;
  /* Chicago has no bold cut, so 700 only bought a smeared synthetic one. */
  font-weight: 400;
  font-size: 22px;
  line-height: 1;
}

/* No pad on the right: the stripes run to the border rather than stopping
   short at an empty notch. Deliberate divergence from the design file. */

/* — masthead — */

.masthead {
  padding: 26px 24px 18px;
  border-bottom: 1px solid #000;
}

.masthead h1 {
  margin: 0;
  font-family: Chicago_12, Chicago, monospace;
  font-weight: 700;
  font-size: 34px;
  line-height: 1.1;
  letter-spacing: 0;
}

.tagline {
  margin: 12px 0 0;
  font-size: 15px;
}

.caret {
  display: inline-block;
  width: 8px;
  height: 15px;
  margin-left: 6px;
  vertical-align: -2px;
  background: #000;
  animation: caret-blink 1.1s steps(1) infinite;
}

@keyframes caret-blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .caret { animation: none; }
}

/* — panes — */

.split {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
}

.pane {
  padding: 20px 24px 22px;
  display: flex;
  flex-direction: column;
}

.pane-about {
  gap: 18px;
  border-right: 1px solid #000;
}

.pane-projects { gap: 0; }

.pane-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  font-family: Chicago_12, Chicago, monospace;
  font-weight: 400;
  font-size: 22px;
  border-bottom: 1px solid #000;
  padding-bottom: 6px;
}

.pane-heading h2 { margin: 0; font: inherit; letter-spacing: inherit; }

/* — about — */

.bio {
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 15.5px;
  line-height: 1.6;
}

.bio p { margin: 0; }

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 12px 0;
  border-top: 1px solid #000;
  border-bottom: 1px solid #000;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-value {
  font-family: Chicago_12, Chicago, monospace;
  font-size: 20px;
}

.stat-label {
  font-size: 12px;
  line-height: 1.4;
  text-transform: uppercase;
}

/* — the push button — */

.button {
  align-self: flex-start;
  font-family: Chicago_12, Chicago, monospace;
  font-size: 18px;
  text-decoration: none;
  color: #000;
  background: #fff;
  border: 2px solid #000;
  border-radius: 7px;
  padding: 9px 20px;
  box-shadow: 2px 2px 0 #000;
}

.button:hover {
  background: #000;
  color: #fff;
}

/* Pressed: the button falls into its own shadow. */
.button:active {
  box-shadow: none;
  transform: translate(2px, 2px);
}

/* — project rows — */

.project {
  display: grid;
  grid-template-columns: 26px 1fr max-content;
  align-items: start;
  column-gap: 12px;
  row-gap: 4px;
  padding: 16px 4px;
  border-bottom: 1px dotted #000;
}

.project:last-child { border-bottom: 0; }

a.project {
  text-decoration: none;
  color: #000;
}

/* Selected, the Finder way: the whole row inverts. Every hairline inside
   is drawn in currentColor, so the icon and badge invert with it. */
a.project:hover {
  background: #000;
  color: #fff;
}

.project-icon {
  grid-row: 1 / span 3;
  width: 22px;
  height: 18px;
  margin-top: 2px;
  border: 1px solid currentColor;
  /* the folder's tab line */
  box-shadow: inset 0 4px 0 -3px currentColor;
}

/* Not shipped yet — an empty, dashed placeholder. */
.project-icon--draft {
  border: 1px dashed currentColor;
  box-shadow: none;
}

.project-name {
  margin: 0;
  font-family: Chicago_12, Chicago, monospace;
  font-weight: 400;
  font-size: 22px;
  line-height: 1.2;
}

.project-status {
  font-family: Chicago_12, Chicago, monospace;
  font-size: 14px;
  border: 1px solid currentColor;
  padding: 2px 6px;
  white-space: nowrap;
}

.project-summary {
  grid-column: 2 / span 2;
  margin: 0;
  font-size: 15px;
}

.project-note {
  grid-column: 2 / span 2;
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
}

/* — status bar — */

.statusbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  padding: 9px 12px;
  border-top: 1px solid #000;
  font-family: Chicago_12, Chicago, monospace;
  font-size: 17px;
}

.statusbar a {
  color: #000;
  text-decoration: underline;
}

.statusbar-year { margin-left: auto; }

/* — narrow — */

@media (max-width: 900px) {
  .desk { padding: 62px 12px 24px; }

  /* No room to float it: the Trash drops below the window, still right-aligned. */
  .trash {
    position: static;
    align-self: flex-end;
    margin-top: 24px;
  }

  .split { grid-template-columns: 1fr; }

  .pane-about {
    border-right: 0;
    border-bottom: 1px solid #000;
  }
}

/* Narrow enough that the menu bar would overflow: the pretend menus go. The
   apple, the era switch and the host name stay — and with the menus gone the
   switch tucks up beside the apple, leaving the host name at the far end. */
@media (max-width: 640px) {
  .menubar-menu { display: none; }

  .menubar {
    gap: 12px;
    font-size: 14px;
  }

  .menubar-era { margin-left: 0; }

  .menubar-host {
    margin-left: auto;
    font-size: 22px;
  }
}
