/* ================== OLD WINDOWS DESKTOP THEME ================== */
/* Standalone stylesheet for index.html only. Does NOT touch home.css or handbook.css,
   so the Handbook funnel page is completely unaffected by anything in this file. */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Desktop */
  --desktop-a: #008080;

  /* Window chrome (95/98 gray face + bevels) */
  --face: #d4d0c8;
  --face-light: #ffffff;
  --face-shadow: #808080;
  --face-dark-shadow: #404040;
  --win-border: #0a0a0a;
  --win-text: #000000;

  /* XP-style titlebar gradient */
  --title-a: #2a63c9;
  --title-b: #08308a;
  --title-text: #ffffff;

  /* Signature accent button — same blue family as the titlebar, no green */
  --go-a: #6fb0ff;
  --go-b: #0a4fc9;
  --go-border: #073a96;

  --link: #0000ee;
  --link-visited: #551a8b;
}

[data-theme="dark"] {
  --desktop-a: #10222a;

  --face: #3a3d42;
  --face-light: #55595f;
  --face-shadow: #202225;
  --face-dark-shadow: #0e0f10;
  --win-border: #000000;
  --win-text: #f0f0f0;

  --title-a: #3a6bcf;
  --title-b: #142a6e;
  --title-text: #ffffff;

  --go-a: #5a94e0;
  --go-b: #14357a;
  --go-border: #0b2350;

  --link: #7fb0ff;
  --link-visited: #c9a6ff;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--desktop-a);
  color: var(--win-text);
  font-family: Tahoma, 'MS Sans Serif', Geneva, Verdana, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  padding: 2rem 1rem 4.5rem;
  transition: background 0.3s, color 0.3s;
}

a { color: var(--link); }
a:visited { color: var(--link-visited); }
a:hover { text-decoration: underline; }

img { max-width: 100%; }

/* ================== Shared bevel mixins (via utility classes) ================== */
.raised {
  border: 1px solid var(--win-border);
  box-shadow:
    inset 1px 1px 0 var(--face-light),
    inset -1px -1px 0 var(--face-dark-shadow),
    inset 2px 2px 0 var(--face-light),
    inset -2px -2px 0 var(--face-shadow);
}

.sunken {
  border: 1px solid var(--win-border);
  box-shadow:
    inset 1px 1px 0 var(--face-dark-shadow),
    inset -1px -1px 0 var(--face-light),
    inset 2px 2px 0 var(--face-shadow),
    inset -2px -2px 0 var(--face-light);
}

/* ================== "Windows" (window chrome) ================== */
.win {
  max-width: 900px;
  margin: 0 auto 1.75rem;
  background: var(--face);
  border: 1px solid var(--win-border);
  box-shadow:
    inset 1px 1px 0 var(--face-light),
    inset -1px -1px 0 var(--face-dark-shadow),
    3px 3px 8px rgba(0,0,0,0.35);
}

.win-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.35rem 0.5rem;
  background: linear-gradient(90deg, var(--title-a), var(--title-b));
  color: var(--title-text);
}

.win-titlebar .win-title {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 2px rgba(0,0,0,0.6);
}

/* Drag-grip dots — a visual hint that the titlebar is grabbable. Only shown where
   dragging is actually enabled (see the >=900px media query further down). */
.win-grip {
  display: none;
  width: 10px;
  height: 14px;
  flex-shrink: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,0.9) 1px, transparent 1.5px);
  background-size: 4px 4px;
}

@media (min-width: 900px) {
  .win-grip { display: block; }
}

.win-controls {
  display: flex;
  gap: 2px;
  pointer-events: none; /* decorative — not real window controls */
}

.win-controls span {
  width: 17px;
  height: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 900;
  line-height: 1;
  color: #000;
  background: var(--face);
  border: 1px solid var(--win-border);
  box-shadow:
    inset 1px 1px 0 var(--face-light),
    inset -1px -1px 0 var(--face-dark-shadow);
}

.win-menubar {
  display: flex;
  gap: 1rem;
  padding: 0.3rem 0.6rem;
  background: var(--face);
  border-bottom: 1px solid var(--face-shadow);
  font-size: 0.8rem;
}

.win-menubar span:first-letter {
  text-decoration: underline;
}

.win-body {
  padding: 1.5rem;
}

/* ================== Desktop icons ================== */
.desktop-icons {
  position: fixed;
  top: 1rem;
  left: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  z-index: 1;
}

.desktop-icon {
  all: unset;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 74px;
  text-align: center;
}

.desktop-icon .icon-glyph {
  font-size: 1.8rem;
  filter: drop-shadow(1px 1px 1px rgba(0,0,0,0.6));
}

.desktop-icon .icon-label {
  margin-top: 0.25rem;
  font-size: 0.7rem;
  color: #fff;
  text-shadow: 1px 1px 1px rgba(0,0,0,0.9);
}

.desktop-icon:hover .icon-label,
.desktop-icon:focus-visible .icon-label {
  background: #0a246a;
  outline: 1px dotted #fff;
}

@media (max-width: 900px) {
  .desktop-icons { display: none; }
}

/* ================== Header / Nav (exact match for the Library/blog pages' header) ================== */
header {
  max-width: 900px;
  margin: 0 auto 1.5rem;
  background: var(--face);
  border: 1px solid var(--win-border);
  box-shadow:
    inset 1px 1px 0 var(--face-light),
    inset -1px -1px 0 var(--face-dark-shadow);
  padding: 1rem 1.25rem;
  text-align: center;
  color: var(--win-text);
  font-family: system-ui, sans-serif;
  font-size: 1rem;
}

header h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

header hr {
  display: none;
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.site-nav a,
.site-nav #theme-toggle {
  all: unset;
  cursor: pointer;
  color: #000000;
  font-weight: 500;
  transition: color 0.3s, opacity 0.3s;
}

[data-theme="dark"] .site-nav a,
[data-theme="dark"] .site-nav #theme-toggle {
  color: #ffffff;
}

.site-nav a:hover,
.site-nav #theme-toggle:hover {
  opacity: 0.7;
}

/* ================== Hero content ================== */
.hero-title {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.hero-description {
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
  max-width: 640px;
}

/* Optional banner slot — point this at your own art/GIF when you have one:
   <div class="hero-banner sunken"><img src="assets/images/banner.gif" alt="Site banner"></div>
   Leave it out entirely and the hero still looks complete without it. */
.hero-banner {
  margin-bottom: 1.5rem;
  max-width: 640px;
  padding: 4px;
  background: #fff;
}

.hero-banner img { display: block; }

/* Embedded video — sunken bevel frame, like a media-player screen inset into the window */
.video-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #000;
}

.video-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Primary CTA — same raised/sunken bevel button as everything else, just in the accent color */
.go-btn,
.go-btn:visited {
  display: inline-block;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.9rem;
  color: #fff;
  padding: 0.55rem 1.4rem;
  background: var(--go-b);
  border: 1px solid var(--win-border);
  box-shadow:
    inset 1px 1px 0 var(--go-a),
    inset -1px -1px 0 var(--go-border),
    inset 2px 2px 0 rgba(255,255,255,0.25),
    inset -2px -2px 0 rgba(0,0,0,0.25);
  text-decoration: none;
}

.go-btn:hover {
  text-decoration: none;
  filter: brightness(1.05);
}

.go-btn:active {
  box-shadow:
    inset 1px 1px 0 var(--go-border),
    inset -1px -1px 0 var(--go-a),
    inset 2px 2px 0 rgba(0,0,0,0.25),
    inset -2px -2px 0 rgba(255,255,255,0.25);
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.5rem;
}

.web-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.3rem 0.6rem;
  background: var(--face);
  color: var(--win-text);
}

/* ================== Notepad-style text window (manifesto) ================== */
.notepad-body {
  background: #fff;
  color: #000;
  font-family: 'Courier New', monospace;
  font-size: 0.85rem;
  line-height: 1.7;
  padding: 1rem;
  white-space: pre-wrap;
}

[data-theme="dark"] .notepad-body {
  background: #17191c;
  color: #f0f0f0;
}

/* ================== Button wall — 88x31 buttons packed edge to edge ================== */
.button-wall {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
}

.button-88x31 {
  display: block;
  width: 88px;
  height: 31px;
  flex-shrink: 0;
  line-height: 0;
}

.button-88x31 img {
  display: block;
  width: 88px;
  height: 31px;
  object-fit: cover;
}

/* ================== Panel body content ================== */
.retro-list {
  list-style: none;
  background: #fff;
  color: #000;
  padding: 0.25rem;
  margin-bottom: 0.75rem;
}

[data-theme="dark"] .retro-list {
  background: #17191c;
  color: #f0f0f0;
}

.retro-list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.4rem 0.5rem;
}

.retro-list li:hover {
  background: #0a246a;
}

.retro-list li:hover a,
.retro-list li:hover .date {
  color: #fff !important;
}

.retro-list a {
  color: var(--link);
  font-weight: 600;
  font-size: 0.9rem;
}

.retro-list .date {
  font-family: 'Courier New', monospace;
  font-size: 0.8rem;
  color: #555;
  margin-left: 1rem;
  flex-shrink: 0;
}

[data-theme="dark"] .retro-list .date { color: #aaa; }

.win-body > p.browse-link {
  text-align: right;
}

.browse-link a {
  font-size: 0.85rem;
}

.support-text {
  margin-bottom: 1.25rem;
  font-size: 0.9rem;
}

.support-buttons {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
}

/* ================== Taskbar footer ================== */
.taskbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.4rem;
  background: var(--face);
  border-top: 1px solid var(--face-light);
  box-shadow: 0 -2px 6px rgba(0,0,0,0.3);
}

.start-btn {
  all: unset;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 700;
  font-size: 0.8rem;
  padding: 0.35rem 0.8rem;
  color: var(--win-text);
}

.start-btn .flag {
  font-size: 0.9rem;
}

.taskbar-windows {
  display: flex;
  flex: 1;
  gap: 0.35rem;
  overflow-x: auto;
}

.taskbar-win-btn {
  all: unset;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.75rem;
  padding: 0.3rem 0.6rem;
  color: var(--win-text);
  white-space: nowrap;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.start-btn,
.taskbar-win-btn {
  border: 1px solid var(--win-border);
  box-shadow:
    inset 1px 1px 0 var(--face-light),
    inset -1px -1px 0 var(--face-dark-shadow);
}

.start-btn:hover,
.taskbar-win-btn:hover {
  filter: brightness(1.05);
}

.start-btn:active,
.taskbar-win-btn:active {
  box-shadow:
    inset 1px 1px 0 var(--face-dark-shadow),
    inset -1px -1px 0 var(--face-light);
}

.tray {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}

.tray a {
  display: inline-flex;
  width: 22px;
  height: 22px;
}

.tray svg {
  width: 100%;
  height: 100%;
  fill: var(--win-text);
}

.tray-clock {
  font-family: 'Courier New', monospace;
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  background: var(--face);
}

/* ================== Draggable desktop (wide screens only) ================== */
/* Below this width the .win elements stay in normal document flow (stacked, scrollable,
   mobile-friendly). At/above it they become a real draggable desktop — dragged by js/drag-windows.js,
   which itself checks this same 900px breakpoint before attaching any drag behavior. */
@media (min-width: 900px) {
  main {
    position: relative;
    min-height: 1350px;
  }

  .win {
    position: absolute;
    margin: 0;
    max-width: none;
  }

  .win-titlebar {
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
  }

  .win-titlebar.dragging {
    cursor: grabbing;
  }

  #win-home       { top: 20px;  left: 100px; width: 440px; }
  #win-manifesto  { top: 20px;  left: 580px; width: 400px; }
  #win-posts      { top: 430px; left: 100px; width: 440px; }
  #win-media      { top: 270px; left: 580px; width: 400px; }
  #win-support    { top: 780px; left: 100px; width: 400px; }
  #win-buttons    { top: 1100px; left: 100px; width: 400px; }
  #win-neighbors  { top: 770px; left: 580px; width: 400px; }
}

/* On wide screens the 2-column stack above still goes further down than fits in
   one view. At >=1400px there's room to spread into 3 columns instead, so windows
   are reachable without scrolling as deep. Below 900px, everything is normal
   stacked document flow (forced single column) regardless of either block. */
@media (min-width: 1400px) {
  main {
    min-height: 1080px;
  }

  #win-home       { top: 20px;  left: 100px; width: 380px; }
  #win-manifesto  { top: 20px;  left: 500px; width: 380px; }
  #win-buttons    { top: 20px;  left: 900px; width: 360px; }
  #win-posts      { top: 450px; left: 100px; width: 380px; }
  #win-media      { top: 450px; left: 500px; width: 380px; }
  #win-support    { top: 450px; left: 900px; width: 360px; }
  #win-neighbors  { top: 860px; left: 100px; width: 380px; }
}

/* ================== Responsive ================== */
@media (max-width: 700px) {
  header, .win, .taskbar { margin-left: 0.5rem; margin-right: 0.5rem; }
  .win-body { padding: 1.25rem; }
  .hero-title { font-size: 1.3rem; }
  .support-buttons { flex-direction: column; }
  .taskbar { flex-wrap: wrap; }
}
