/* ===========================================================
   Agent Skills Explorer — Windows 98 desktop theme (hand-rolled)
   Vanilla CSS, no framework. Tuned to read well on a livestream.
   =========================================================== */

:root {
  --gray:      #c0c0c0;
  --gray-dk:   #808080;
  --gray-dkr:  #404040;
  --white:     #ffffff;
  --navy:      #000080;
  --navy-lt:   #1084d0;
  --teal:      #1d8d8d;
  --teal-dk:   #0a6b6b;
  --text:      #000000;
  --hl:        #000080;
  --face-font: "Segoe UI", Tahoma, "MS Sans Serif", Geneva, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

/* Clippy must never intercept clicks on UI controls (it floats above the
   window). It's driven entirely by code, so it doesn't need pointer events. */
.clippy, .clippy-balloon { pointer-events: none !important; z-index: 4000 !important; }

html, body {
  margin: 0; height: 100%; overflow: hidden;
  font-family: var(--face-font);
  font-size: 13px;
  color: var(--text);
  user-select: none;
  -webkit-font-smoothing: none;
}

/* ---------- Desktop ---------- */
.desktop {
  position: fixed; inset: 0;
  background:
    url("wallpaper1.jpg") center / cover no-repeat,
    radial-gradient(120% 120% at 50% 0%, #2aa3a3 0%, var(--teal) 45%, var(--teal-dk) 100%);
  overflow: hidden;
}

/* ---------- Desktop icons ---------- */
.icons {
  position: absolute; top: 14px; left: 14px;
  display: flex; flex-direction: column; gap: 22px;
}
.icon {
  width: 84px; background: transparent; border: 1px solid transparent;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 6px 4px; cursor: pointer; color: #fff;
}
.icon:focus { outline: none; }
.icon.selected { background: rgba(0,0,128,0.45); border: 1px dotted #cfe2ff; }
.icon-glyph { font-size: 34px; line-height: 1; filter: drop-shadow(1px 1px 0 rgba(0,0,0,.5)); }
.icon-label {
  font-size: 12px; text-align: center; line-height: 1.15;
  text-shadow: 1px 1px 0 rgba(0,0,0,.7);
}
.icon.selected .icon-label { background: var(--navy); }

/* ---------- Double-click hint ---------- */
.hint {
  position: absolute; top: 30px; left: 110px;
  color: #fff; font-size: 13px; background: rgba(0,0,0,.35);
  padding: 6px 10px; border-radius: 3px; pointer-events: none;
  transition: opacity .6s ease; text-shadow: 1px 1px 0 rgba(0,0,0,.6);
}
.hint.gone { opacity: 0; }
.hint-arrow { display: inline-block; animation: bob 1s ease-in-out infinite; }
@keyframes bob { 0%,100%{ transform: translateY(0);} 50%{ transform: translateY(-4px);} }

/* ===========================================================
   Window chrome (the classic bevel)
   =========================================================== */
.window {
  position: absolute; top: 8%; left: 50%; transform: translateX(-50%);
  width: min(860px, 92vw); max-height: 84vh;
  background: var(--gray);
  border: 2px solid; border-color: #dfdfdf #000 #000 #dfdfdf;
  box-shadow: 1px 1px 0 #808080, 4px 4px 14px rgba(0,0,0,.45);
  display: flex; flex-direction: column;
}
.window::before { /* inner highlight bevel */
  content: ""; position: absolute; inset: 0;
  border: 1px solid; border-color: #fff #404040 #404040 #fff; pointer-events: none;
}
.window-sm { width: min(420px, 88vw); top: 22%; left: 22%; transform: none; }
.window.maximized {
  top: 0 !important; left: 0 !important; transform: none !important;
  width: 100vw; height: calc(100vh - 30px); max-height: none;
}

.title-bar {
  display: flex; align-items: center; gap: 6px;
  background: linear-gradient(90deg, var(--navy), var(--navy-lt));
  color: #fff; font-weight: 700; padding: 3px 4px 3px 6px;
  cursor: grab; user-select: none;
}
.title-bar.inactive { background: linear-gradient(90deg, #7f7f7f, #b5b5b5); }
.title-bar-icon { font-size: 14px; }
.title-bar-text { flex: 1; font-size: 13px; letter-spacing: .2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.title-bar-controls { display: flex; gap: 2px; }
.tb-btn {
  width: 18px; height: 16px; font-size: 11px; line-height: 1; font-weight: 700;
  background: var(--gray); color: #000; cursor: pointer;
  border: 1px solid; border-color: #fff #000 #000 #fff;
  display: flex; align-items: center; justify-content: center; padding: 0;
}
.tb-btn:active { border-color: #000 #fff #fff #000; }
.tb-close { font-weight: 700; }

.window-chrome { display: flex; flex-direction: column; min-height: 0; flex: 1; }

/* ---------- Progress rail ---------- */
.rail {
  display: flex; gap: 4px; padding: 6px 10px 0; background: var(--gray);
}
.rail .pip {
  flex: 1; height: 6px; background: #9a9a9a;
  border: 1px solid; border-color: #707070 #fff #fff #707070;
}
.rail .pip.done { background: var(--navy-lt); }
.rail .pip.active { background: #ffd23f; }

/* ---------- Window body ---------- */
.window-body {
  background: var(--gray); padding: 14px 16px; overflow: auto;
  flex: 1; min-height: 0;
}
.notepad { background: #fff; }
.notepad pre { margin: 0; font-family: "Lucida Console", Consolas, monospace; font-size: 12.5px; line-height: 1.5; }

/* ---------- Footer ---------- */
.window-footer {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; background: var(--gray);
  border-top: 1px solid #fff; box-shadow: inset 0 1px 0 #808080;
}
.footer-right { margin-left: auto; display: flex; gap: 8px; }
.step-readout { font-size: 12px; color: #303030; }

/* ---------- Buttons ---------- */
.btn {
  min-width: 78px; padding: 5px 12px; font-family: inherit; font-size: 13px;
  background: var(--gray); cursor: pointer;
  border: 2px solid; border-color: #fff #000 #000 #fff;
  box-shadow: inset 1px 1px 0 #dfdfdf, inset -1px -1px 0 #808080;
}
.btn:active { border-color: #000 #fff #fff #000; box-shadow: inset -1px -1px 0 #dfdfdf, inset 1px 1px 0 #808080; }
.btn:disabled { color: #808080; text-shadow: 1px 1px 0 #fff; cursor: default; }
.btn-primary { font-weight: 700; }
.btn-ghost { min-width: 0; }

/* ===========================================================
   Scene content
   =========================================================== */
.scene { animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px);} to { opacity:1; transform:none;} }

.scene h1 { font-size: 20px; margin: 0 0 4px; }
.scene .kicker { font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--navy); font-weight: 700; }
.scene p { font-size: 14px; line-height: 1.5; margin: 8px 0; max-width: 60ch; }
.scene .lead { font-size: 15px; }

/* inset panel (sunken) */
.panel {
  background: #fff; padding: 12px 14px; margin: 10px 0;
  border: 2px solid; border-color: #808080 #fff #fff #808080;
}
.panel.code { font-family: "Lucida Console", Consolas, monospace; font-size: 12.5px; line-height: 1.55; white-space: pre-wrap; }
.panel .fm { color: #7a3e9d; }
.panel .key { color: #0a6b6b; font-weight: 700; }
.panel .cm { color: #707070; }

/* two-column compare */
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 10px 0; }
.compare .col { background: #fff; border: 2px solid; border-color: #808080 #fff #fff #808080; padding: 10px 12px; }
.compare .col h3 { margin: 0 0 6px; font-size: 13px; }
.compare .bad h3 { color: #a00; }
.compare .good h3 { color: #060; }
.compare ul { margin: 0; padding-left: 18px; }
.compare li { font-size: 13px; line-height: 1.5; }

/* pipeline of phases */
.pipeline { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 12px 0; }
.pipeline .step { background: var(--navy); color: #fff; padding: 5px 10px; font-weight: 700; font-size: 12px; }
.pipeline .arrow { color: var(--navy); font-weight: 700; }

/* ---------- Phase explorer ---------- */
.explorer-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 10px 0; }
.phase-tile {
  text-align: left; cursor: pointer; padding: 10px; color: #fff;
  border: 2px solid; border-color: #fff #000 #000 #fff; background: #555;
}
.phase-tile:active { border-color: #000 #fff #fff #000; }
.phase-tile .pt-name { font-weight: 700; font-size: 14px; }
.phase-tile .pt-count { font-size: 11px; opacity: .9; }
.phase-tile .pt-blurb { font-size: 11.5px; line-height: 1.35; margin-top: 4px; opacity: .95; }
.phase-tile.open { outline: 2px dotted #fff; outline-offset: -5px; }

.skill-list {
  background: #fff; border: 2px solid; border-color: #808080 #fff #fff #808080;
  padding: 10px 12px; margin: 8px 0 2px; min-height: 56px;
}
.skill-list .sl-head { font-weight: 700; margin-bottom: 6px; }
.skill-row { padding: 5px 6px; border-bottom: 1px dotted #cfcfcf; cursor: pointer; }
.skill-row:last-child { border-bottom: none; }
.skill-row:hover { background: #eef3ff; }
.skill-row .sr-name { font-family: "Lucida Console", Consolas, monospace; font-weight: 700; color: var(--navy); font-size: 12.5px; }
.skill-row .sr-desc { font-size: 12.5px; color: #333; }
.skill-empty { color: #777; font-size: 12.5px; }

/* anatomy list */
.anatomy { list-style: none; margin: 8px 0; padding: 0; }
.anatomy li { background: #fff; border: 2px solid; border-color: #808080 #fff #fff #808080; padding: 7px 10px; margin-bottom: 6px; font-size: 13px; }
.anatomy li b { color: var(--navy); }
.anatomy li.star { background: #fffbe6; }
.anatomy li.star::before { content: "★ "; color: #c79100; }

/* command rail */
.cmd-rail { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.cmd { font-family: "Lucida Console", Consolas, monospace; background: #000; color: #38d957; padding: 4px 9px; font-size: 12.5px; border: 1px solid #38d957; }
.tools { font-size: 12.5px; color: #333; }

.recap { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; margin: 8px 0; }
.recap div { font-size: 13px; }
.repo-link { display: inline-block; margin-top: 8px; font-family: "Lucida Console", monospace; background: var(--navy); color: #fff; padding: 6px 10px; text-decoration: none; }
.repo-link:active { border: 1px inset #fff; }

/* ===========================================================
   Taskbar + start menu
   =========================================================== */
.taskbar {
  position: fixed; bottom: 0; left: 0; right: 0; height: 30px; z-index: 5000;
  background: var(--gray); display: flex; align-items: center; gap: 4px; padding: 2px 4px;
  border-top: 2px solid #fff;
}
.start-btn {
  display: flex; align-items: center; gap: 5px; font-weight: 700; font-size: 13px;
  padding: 3px 9px 3px 6px; cursor: pointer; background: var(--gray);
  border: 2px solid; border-color: #fff #000 #000 #fff;
}
.start-btn.active, .start-btn:active { border-color: #000 #fff #fff #000; }
.start-flag { color: var(--navy); font-size: 15px; font-weight: 900; }

.task-buttons { display: flex; gap: 4px; flex: 1; overflow: hidden; }
.task-btn {
  min-width: 150px; max-width: 200px; text-align: left; padding: 3px 8px; font-size: 12px;
  background: var(--gray); cursor: pointer; display: flex; align-items: center; gap: 6px;
  border: 2px solid; border-color: #fff #000 #000 #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.task-btn.active { border-color: #000 #fff #fff #000; background: #d9d9d9; font-weight: 700; }

.tray {
  display: flex; align-items: center; gap: 8px; padding: 2px 8px; height: 24px;
  border: 1px solid; border-color: #808080 #fff #fff #808080;
}
.tray-clippy { font-size: 14px; filter: grayscale(1) opacity(.5); }
.tray-clippy.on { filter: none; }
.tray-clock { font-size: 12px; min-width: 46px; text-align: center; }

.start-menu {
  position: fixed; bottom: 30px; left: 4px; width: 250px; z-index: 6000;
  background: var(--gray); display: flex;
  border: 2px solid; border-color: #fff #000 #000 #fff;
  box-shadow: 3px 3px 10px rgba(0,0,0,.4);
}
.start-rail {
  width: 30px; background: linear-gradient(var(--navy), var(--navy-lt));
  display: flex; align-items: flex-end; justify-content: center; padding-bottom: 10px;
}
.start-rail span { writing-mode: vertical-rl; transform: rotate(180deg); color: #fff; font-weight: 800; letter-spacing: 2px; font-size: 14px; }
.start-items { flex: 1; padding: 4px; }
.start-item {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left;
  padding: 7px 8px; background: transparent; border: none; cursor: pointer; font-size: 13px;
  color: #000; text-decoration: none;
}
.start-item:hover { background: var(--navy); color: #fff; }
.start-sep { height: 2px; margin: 4px 2px; border-top: 1px solid #808080; border-bottom: 1px solid #fff; }

/* ---------- Fallback assistant (if Clippy CDN fails) ---------- */
.fallback-clippy { position: fixed; right: 18px; bottom: 56px; z-index: 5500; width: 180px; text-align: center; }
.fallback-avatar { font-size: 56px; filter: drop-shadow(2px 2px 0 rgba(0,0,0,.4)); animation: bob 1.6s ease-in-out infinite; }
.fallback-bubble {
  background: #ffffe1; border: 1px solid #000; border-radius: 8px; padding: 8px 10px;
  font-size: 13px; line-height: 1.4; margin-bottom: 8px; box-shadow: 2px 2px 4px rgba(0,0,0,.3);
  position: relative;
}
.fallback-bubble::after {
  content: ""; position: absolute; bottom: -8px; right: 40px;
  border: 8px solid transparent; border-top-color: #ffffe1; border-bottom: 0;
}

@media (max-width: 640px) {
  .explorer-grid { grid-template-columns: 1fr; }
  .compare, .recap { grid-template-columns: 1fr; }
}
