/* ===== BASE ===== */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  height: 100vh;
  background-color: #046863; /* dustier, less saturated teal — reads more "old phosphor" than "bright app" */
  background-image:
    repeating-linear-gradient(45deg, rgba(255,255,255,0.03) 0px, rgba(255,255,255,0.03) 2px, transparent 2px, transparent 8px);
  font-family: "MS Sans Serif", "Tahoma", "Verdana", sans-serif;
  overflow-x: hidden;
  min-height: 100vh;
  position: relative;
}

/* ===== CRT OVERLAY: scanlines ===== */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0,0,0,0) 0px,
    rgba(0,0,0,0) 1px,
    rgba(0,0,0,0.12) 2px,
    rgba(0,0,0,0) 3px
  );
  z-index: 9999;
  mix-blend-mode: multiply;
}

/* ===== CRT OVERLAY: vignette + very slow brightness flicker ===== */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
  box-shadow: inset 0 0 140px 40px rgba(0,0,0,0.55);
  background: rgba(20,25,20,0.04);
  animation: crt-flicker 7s infinite ease-in-out;
}

@keyframes crt-flicker {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.85; }
}

/* ===== DESKTOP ICON GRID ===== */
.desktop {
  display: flex;
  flex-wrap: wrap;
  flex-direction: column;
  gap: 22px;
  padding: 24px;
  height: calc(100vh - 40px);
  align-content: flex-start;
}

.icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 80px;
  text-decoration: none;
  color: white;
  text-align: center;
  cursor: pointer;
}

.icon-img {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}

.pixel-icon {
  width: 30px;
  height: 30px;
  color: #14146b;
  shape-rendering: crispEdges;
}

.pixel-icon-inline {
  width: 16px;
  height: 16px;
  color: #14146b;
  vertical-align: -3px;
  margin-right: 5px;
  shape-rendering: crispEdges;
}

.icon span {
  font-size: 12px;
  background: rgba(0,0,0,0.4);
  padding: 1px 4px;
  line-height: 1.3;
}

.icon:hover .icon-img {
  filter: brightness(1.3);
  transform: scale(1.06);
}

/* ===== WINDOW CHROME (Win95 style) ===== */
.window {
  position: absolute;
  background: #c0c0c0;
  border: 2px solid #fff;
  border-right-color: #404040;
  border-bottom-color: #404040;
  box-shadow: 2px 2px 0 rgba(0,0,0,0.5);
  width: 340px;
  font-size: 13px;
}

.welcome-window {
  top: 40px;
  right: 40px;
}

.updates-window {
    top: 160px;
  right: 20px;
}

/* section pages use a centered, larger window instead of a floating one */
.page-window {
  position: static;
  width: min(600px, 90%);
  margin: 60px auto;
}

.page-window h1 {
  margin-top: 4px;
  font-size: 20px;
}

.guestbook-page .page-window {
  width: min(700px, 94%);
}

.back-link {
  display: inline-block;
  color: #000080;
  text-decoration: none;
  font-size: 12px;
  margin-bottom: 6px;
}

.back-link:hover {
  text-decoration: underline;
}

.titlebar {
  background: linear-gradient(to right, #000080, #1084d0);
  color: white;
  padding: 3px 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: bold;
  font-size: 12px;
  cursor: move;
  user-select: none;
}

.window.maximized {
  position: absolute !important;
  inset: 8px !important;
  width: auto !important;
  height: auto !important;
  overflow: auto;
  z-index: 200;
}

.win-buttons {
  display: flex;
  gap: 3px;
}

.win-buttons .btn {
  background: #c0c0c0;
  border: 1px outset #fff;
  width: 16px;
  height: 14px;
  font-size: 10px;
  line-height: 14px;
  text-align: center;
  color: black;
  cursor: pointer;
}

.win-buttons .btn:active {
  border-style: inset;
}

.window-body {
  padding: 10px;
  background: #c0c0c0;
  color: black;
  line-height: 1.4;
}

.window-body p {
  margin: 0 0 8px 0;
}

/* ===== TASKBAR ===== */
.taskbar {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 40px;
  background: #c0c0c0;
  border-top: 2px solid #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px;
  font-size: 13px;
}

.start-btn {
  background: #c0c0c0;
  border: 2px outset #fff;
  padding: 4px 10px;
  font-weight: bold;
  cursor: pointer;
  color: black;
  text-decoration: none;
  display: inline-block;
}

.start-btn:active {
  border-style: inset;
}

.taskbar-windows {
  display: flex;
  gap: 6px;
  flex: 1;
  margin: 0 10px;
  overflow-x: auto;
}

.taskbar-chip {
  background: #c0c0c0;
  border: 2px outset #fff;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}

.taskbar-chip:active {
  border-style: inset;
}

.taskbar-clock {
  background: #c0c0c0;
  border: 2px inset #fff;
  padding: 4px 10px;
}

/* ===== guestbook link-out button ===== */
.guestbook-portal {
  text-align: center;
  margin: 24px 0 8px;
}

.guestbook-link {
  display: inline-flex;
  align-items: center;
  background: #c0c0c0;
  border: 2px outset #fff;
  padding: 10px 18px;
  color: #000;
  text-decoration: none;
  font-weight: bold;
  font-size: 13px;
}

.guestbook-link:active {
  border-style: inset;
}

.guestbook-link:hover {
  filter: brightness(1.06);
}

/* ===== guestbook embed ===== */
.guestbook-embed {
  background: transparent;
  margin: 16px 0 6px;
}

.guestbook-embed iframe {
  display: block;
  border: none;
  background: transparent;
  overflow: hidden;
}

.guestbook-fallback {
  font-size: 11px;
  color: #444;
  text-align: center;
  margin: 0 0 6px;
}

.guestbook-fallback a {
  color: #000080;
}

/* ===== RESPONSIVE (basic mobile fallback) ===== */
@media (max-width: 600px) {
  .desktop {
    flex-direction: row;
    justify-content: center;
    height: auto;
  }
  .window {
    position: static;
    width: 90%;
    margin: 20px auto;
  }
}