@font-face {
  font-family: "iA Writer Quattro";
  src: url("/fonts/iAWriterQuattroS-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "iA Writer Quattro";
  src: url("/fonts/iAWriterQuattroS-Italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "iA Writer Quattro";
  src: url("/fonts/iAWriterQuattroS-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "iA Writer Mono";
  src: url("/fonts/iAWriterMonoS-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  font: 15px/1.5 "iA Writer Quattro", ui-monospace, "SF Mono", Menlo, monospace;
  background: #fff;
  color: #000;
}

/* Faint dot grid — a nod to the dithered desktop. */
#desktop {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-image: radial-gradient(#d8d8d8 1px, transparent 1px);
  background-size: 8px 8px;
}

.obj {
  position: absolute;
  max-width: min(24rem, 85vw);
  padding: 0.8rem 1rem;
  background: #fff;
  border: 1px solid #000;
  border-radius: 0;
  box-shadow: 3px 3px 0 #000;
  transform: translate(-50%, -50%);
  transition: opacity 0.4s ease;
  overflow-wrap: anywhere;
}

.obj.entering { opacity: 0; }

.obj .meta {
  margin-top: 0.6rem;
  padding-top: 0.4rem;
  border-top: 1px solid #000;
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #666;
  font-family: "iA Writer Mono", ui-monospace, Menlo, monospace;
}

.obj a { color: #000; }

.obj[data-type="link"] a::after { content: " ↗"; }

.obj[data-type="comment"] { font-size: 0.85rem; }

.obj[data-type="app"] { border-style: dashed; box-shadow: none; }

footer {
  position: fixed;
  bottom: 0.6rem;
  left: 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #000;
  font-family: "iA Writer Mono", ui-monospace, Menlo, monospace;
}

/* Hollow when offline, solid when live. */
#dot {
  width: 0.5rem;
  height: 0.5rem;
  border: 1px solid #000;
  background: #fff;
}

#dot.live { background: #000; }

#info {
  all: unset;
  cursor: pointer;
  width: 1.1rem;
  height: 1.1rem;
  line-height: 1.05rem;
  text-align: center;
  border: 1px solid #000;
  font-size: 0.7rem;
  font-family: inherit;
  color: #000;
  background: #fff;
}

#info:hover, #info[aria-expanded="true"] { background: #000; color: #fff; }

#about {
  position: fixed;
  bottom: 2.5rem;
  left: 0.8rem;
  max-width: 18rem;
  padding: 0.7rem 0.9rem;
  background: #fff;
  border: 1px solid #000;
  box-shadow: 3px 3px 0 #000;
  font-size: 0.78rem;
  color: #000;
}

#about a { color: #000; }

/* Top-right: what is this website. */
#how {
  all: unset;
  position: fixed;
  top: 0.8rem;
  right: 0.8rem;
  cursor: pointer;
  width: 1.4rem;
  height: 1.4rem;
  line-height: 1.35rem;
  text-align: center;
  border: 1px solid #000;
  background: #fff;
  box-shadow: 3px 3px 0 #000;
  font-size: 0.85rem;
  font-family: "iA Writer Mono", ui-monospace, Menlo, monospace;
  color: #000;
}

#how:hover, #how[aria-expanded="true"] { background: #000; color: #fff; }

#manual {
  position: fixed;
  top: 3.2rem;
  right: 0.8rem;
  max-width: 21rem;
  padding: 0.9rem 1.1rem;
  background: #fff;
  border: 1px solid #000;
  box-shadow: 3px 3px 0 #000;
  font-size: 0.85rem;
}

#manual p { margin: 0 0 0.7rem; }
#manual p:last-child { margin: 0; }

#manual .fine {
  padding-top: 0.5rem;
  border-top: 1px solid #000;
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #666;
  font-family: "iA Writer Mono", ui-monospace, Menlo, monospace;
}

/* The time scrubber: drag left to fold the desk back to any moment. */
#timebar {
  position: fixed;
  bottom: 0.6rem;
  right: 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 0.7rem;
  background: #fff;
  border: 1px solid #000;
  box-shadow: 3px 3px 0 #000;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-family: "iA Writer Mono", ui-monospace, Menlo, monospace;
}

#timebar.past { background: #000; color: #fff; }

#timeline {
  -webkit-appearance: none;
  appearance: none;
  width: 11rem;
  height: 0.8rem;
  margin: 0;
  outline-offset: 4px;
  /* the track: a 1px line drawn through the middle */
  background: linear-gradient(#000, #000) center / 100% 1px no-repeat;
}

#timebar.past #timeline {
  background: linear-gradient(#fff, #fff) center / 100% 1px no-repeat;
}

#timeline::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 0.65rem;
  height: 0.65rem;
  background: #000;
  border: 1px solid #000;
  border-radius: 0;
  cursor: ew-resize;
}

#timebar.past #timeline::-webkit-slider-thumb {
  background: #fff;
  border-color: #fff;
}

#timeline::-moz-range-thumb {
  width: 0.65rem;
  height: 0.65rem;
  background: #000;
  border: 1px solid #000;
  border-radius: 0;
  cursor: ew-resize;
}

#timebar.past #timeline::-moz-range-thumb {
  background: #fff;
  border-color: #fff;
}

#when { cursor: pointer; min-width: 6.5rem; text-align: right; }

/* Small screens: the desk becomes a readable column in chronological order
   (DOM order is insertion order, oldest first). */
@media (max-width: 600px) {
  html, body { height: auto; }
  #desktop {
    height: auto;
    min-height: 100vh;
    overflow: visible;
    padding: 1.2rem 1rem 3.5rem;
  }
  .obj {
    position: static;
    transform: none;
    max-width: none;
    margin: 0 0 1rem;
  }
  #timebar {
    bottom: 2.6rem;
    right: 0.8rem;
  }
  #timeline { width: 7rem; }
}
