/*
 * BurghList — the homepage desktop.
 *
 * Windows 95 by way of an AOL trial CD. This is a deliberate single-world
 * design: there is no dark variant, because a dark-mode Windows 95 never
 * existed and faking one would read as a bug rather than a choice.
 *
 * The list icons are drawn from each list's own theme swatch, so the desktop
 * doubles as the sample board — you can see what a list looks like before you
 * open it.
 */

.desktop {
  /* Windows 95 was 8-bit and proud. Nothing here adapts to a colour scheme. */
  color-scheme: light;

  --desktop-bg:    #008080;
  --chrome:        #C0C0C0;
  --chrome-light:  #DFDFDF;
  --chrome-white:  #FFFFFF;
  --chrome-shade:  #808080;
  --chrome-dark:   #0A0A0A;
  --title-a:       #000080;
  --title-b:       #1084D0;
  --title-fg:      #FFFFFF;
  --title-off-a:   #808080;
  --title-off-b:   #B5B5B5;
  --field:         #FFFFFF;
  --field-fg:      #000000;
  --select:        #000080;
  --link:          #0000EE;
  --aim-panel:     #FFFFCC;

  --bevel-out:
    inset -1px -1px 0 0 var(--chrome-dark),
    inset  1px  1px 0 0 var(--chrome-white),
    inset -2px -2px 0 0 var(--chrome-shade),
    inset  2px  2px 0 0 var(--chrome-light);
  --bevel-in:
    inset -1px -1px 0 0 var(--chrome-white),
    inset  1px  1px 0 0 var(--chrome-dark),
    inset -2px -2px 0 0 var(--chrome-light),
    inset  2px  2px 0 0 var(--chrome-shade);
  --bevel-thin-in:
    inset -1px -1px 0 0 var(--chrome-white),
    inset  1px  1px 0 0 var(--chrome-shade);

  --font-win: "MS Sans Serif", "Microsoft Sans Serif", Tahoma, Geneva,
              Verdana, sans-serif;

  min-height: 100dvh;
  background: var(--desktop-bg);
  font-family: var(--font-win);
  font-size: 13px;
  line-height: 1.45;
  color: #000;
  padding: 1.5rem 1.5rem calc(44px + 1.5rem);
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 1.5rem;
}

.desktop *:focus-visible {
  outline: 1px dotted #000;
  outline-offset: 2px;
}

/* ─── window chrome ─────────────────────────────────────────────────── */

.win {
  background: var(--chrome);
  box-shadow: var(--bevel-out);
  padding: 3px;
  min-width: 0;
}

.win--main { flex: 1 1 620px; max-width: 900px; }
.win--aim  { flex: 0 1 300px; }

.win__titlebar {
  background: linear-gradient(90deg, var(--title-a), var(--title-b));
  color: var(--title-fg);
  display: flex;
  align-items: center;
  gap: .4rem;
  padding: 3px 3px 3px 4px;
  font-weight: 700;
  font-size: 12px;
  user-select: none;
}

.win__title {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.win__icon {
  width: 16px;
  height: 16px;
  flex: none;
  display: grid;
  place-items: center;
  font-size: 10px;
  background: var(--chrome);
  color: #000;
  box-shadow: var(--bevel-thin-in);
}

.win__controls { display: flex; gap: 2px; }

.win__control {
  width: 17px;
  height: 15px;
  background: var(--chrome);
  box-shadow: var(--bevel-out);
  border: 0;
  padding: 0;
  display: grid;
  place-items: center;
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
  color: #000;
  font-family: var(--font-win);
}
/* Decorative: these are the window frame, not controls that do anything.
   Marked aria-hidden in the markup and not focusable. */
.win__control[aria-hidden="true"] { cursor: default; }

.win__menubar {
  display: flex;
  gap: .2rem;
  padding: 2px 1px;
  font-size: 12px;
}
.win__menubar a {
  padding: 2px 7px;
  text-decoration: none;
  color: #000;
}
.win__menubar a:hover { background: var(--select); color: #fff; }
.win__menubar a u { text-decoration: underline; }

.win__body {
  background: var(--field);
  color: var(--field-fg);
  box-shadow: var(--bevel-in);
  padding: 1rem;
}

.win__statusbar {
  display: flex;
  gap: 3px;
  margin-top: 3px;
  font-size: 11px;
}
.win__statusbar span {
  box-shadow: var(--bevel-thin-in);
  padding: 2px 6px;
}
.win__statusbar span:first-child { flex: 1; }

/* ─── the welcome banner ────────────────────────────────────────────── */

.welcome {
  margin-bottom: 1rem;
  padding-bottom: .9rem;
  border-bottom: 1px solid var(--chrome);
}
.welcome__title {
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: .35rem;
}
.welcome__title em {
  font-style: normal;
  color: var(--select);
}
.welcome__lede { font-size: 12px; max-width: 62ch; }

.marquee {
  margin-top: .8rem;
  overflow: hidden;
  box-shadow: var(--bevel-thin-in);
  padding: 3px 0;
  background: #000;
  color: #0F0;
  font-family: "Courier New", Courier, monospace;
  font-size: 11px;
}
.marquee span {
  display: inline-block;
  white-space: nowrap;
  padding-left: 100%;
  animation: marquee 22s linear infinite;
}
@keyframes marquee {
  to { transform: translateX(-100%); }
}

/* ─── the icon grid ─────────────────────────────────────────────────── */

.icon-grid {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(124px, 1fr));
  gap: .5rem;
}

.icon-item__link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .45rem;
  padding: .6rem .35rem;
  text-decoration: none;
  color: #000;
  text-align: center;
  height: 100%;
}
.icon-item__link:hover .icon-item__label,
.icon-item__link:focus-visible .icon-item__label {
  background: var(--select);
  color: #fff;
}
.icon-item__link:hover .doc { filter: brightness(1.06); }

/*
 * The document icon is built from the list's own theme swatch, so each list
 * on the desktop wears its real colours. --swatch-1..5 arrive inline.
 */
.doc {
  width: 46px;
  height: 54px;
  flex: none;
  position: relative;
  background: var(--swatch-1, #fff);
  border: 1px solid #000;
  box-shadow: 2px 2px 0 rgba(0, 0, 0, .35);
  overflow: hidden;
}
/* the folded corner */
.doc::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 13px;
  height: 13px;
  background: linear-gradient(225deg, var(--chrome) 50%, transparent 50%);
  border-left: 1px solid #000;
  border-bottom: 1px solid #000;
}
.doc__lines {
  position: absolute;
  inset: auto 5px 6px 5px;
  display: grid;
  gap: 3px;
}
.doc__lines span {
  height: 4px;
  display: block;
}

.icon-item__label {
  font-size: 11.5px;
  line-height: 1.25;
  padding: 1px 3px;
  max-width: 15ch;
}

.icon-item__meta {
  font-size: 10.5px;
  color: #444;
}
.icon-item__link:hover .icon-item__meta { color: #444; }

/* ─── AIM window ────────────────────────────────────────────────────── */

.aim__screenname {
  font-weight: 700;
  font-size: 13px;
  margin-bottom: .1rem;
}
.aim__status {
  font-size: 11px;
  color: #444;
  margin-bottom: .7rem;
}
.aim__away {
  background: var(--aim-panel);
  box-shadow: var(--bevel-thin-in);
  padding: .7rem .8rem;
  font-size: 12px;
  line-height: 1.5;
}
.aim__away p + p { margin-top: .6rem; }
.aim__away a { color: var(--link); }
.aim__buddies {
  list-style: none;
  padding: 0;
  margin-top: .8rem;
  font-size: 12px;
}
.aim__buddies li {
  display: flex;
  justify-content: space-between;
  gap: .5rem;
  padding: 2px 4px;
}
.aim__buddies li + li { border-top: 1px dotted #CCC; }
.aim__buddies .away { color: #888; font-style: italic; }

/* ─── taskbar ───────────────────────────────────────────────────────── */

.taskbar {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 50;
  height: 36px;
  background: var(--chrome);
  box-shadow: inset 0 1px 0 0 var(--chrome-white), 0 -1px 0 0 var(--chrome-shade);
  display: flex;
  align-items: center;
  gap: .4rem;
  padding: 3px .4rem;
  font-family: var(--font-win);
  font-size: 12px;
}

.start { position: relative; flex: none; }

.start__button {
  display: flex;
  align-items: center;
  gap: .35rem;
  padding: 3px 9px 3px 5px;
  font-weight: 700;
  font-size: 12px;
  background: var(--chrome);
  box-shadow: var(--bevel-out);
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.start__button::-webkit-details-marker { display: none; }
.start[open] .start__button { box-shadow: var(--bevel-in); }

.start__flag {
  width: 15px;
  height: 15px;
  flex: none;
  background:
    linear-gradient(135deg, #FF3B30 0 50%, #34C759 50% 100%) 0 0 / 100% 50% no-repeat,
    linear-gradient(135deg, #007AFF 0 50%, #FFCC00 50% 100%) 0 100% / 100% 50% no-repeat;
  transform: skewX(-6deg);
}

.start__menu {
  position: absolute;
  bottom: calc(100% + 4px);
  left: 0;
  min-width: 200px;
  background: var(--chrome);
  box-shadow: var(--bevel-out);
  padding: 3px;
  display: flex;
}
/* The blue spine down the left of every Start menu ever shipped. */
.start__menu::before {
  content: "BurghList";
  flex: none;
  width: 24px;
  background: linear-gradient(0deg, var(--title-a), #4A4A82);
  color: #fff;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: .08em;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  display: grid;
  place-items: center;
  padding: .5rem 0;
}
.start__menu ul {
  list-style: none;
  padding: 0 0 0 3px;
  flex: 1;
}
.start__menu a {
  display: block;
  padding: 5px 1.5rem 5px .6rem;
  text-decoration: none;
  color: #000;
}
.start__menu a:hover { background: var(--select); color: #fff; }
.start__menu li.sep {
  height: 1px;
  margin: 3px 2px;
  background: var(--chrome-shade);
  box-shadow: 0 1px 0 0 var(--chrome-white);
}

.taskbar__windows { display: flex; gap: .25rem; flex: 1; min-width: 0; }
.taskbar__windows a {
  display: block;
  max-width: 170px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 3px .55rem;
  text-decoration: none;
  color: #000;
  background: var(--chrome);
  box-shadow: var(--bevel-out);
  font-size: 11.5px;
}

.tray {
  flex: none;
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: 3px .6rem;
  box-shadow: var(--bevel-thin-in);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}

/* ─── empty state ───────────────────────────────────────────────────── */

.desktop .empty-state {
  padding: 2rem 1rem;
  font-size: 12px;
}

@media (max-width: 720px) {
  .desktop { padding: .75rem .75rem calc(44px + .75rem); gap: .75rem; }
  .win--main, .win--aim { flex: 1 1 100%; max-width: none; }
  .taskbar__windows { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .marquee span { animation: none; padding-left: 0; }
}
