/* Discover Canopy LLC — Windows 98 desktop shell. Layout & overrides on top of 98.css. */

:root {
  --taskbar-height: 40px;
  --desktop-bg: #008080;
  --icon-width: 84px;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  font-family: 'Pixelated MS Sans Serif', Arial, sans-serif;
}

#app-root {
  position: relative;
  width: 100vw;
  height: 100dvh;
  overflow: hidden;
  background: var(--desktop-bg);
}

#desktop {
  position: absolute;
  inset: 0;
  bottom: var(--taskbar-height);
  overflow: hidden;
}

#desktop-icons {
  position: absolute;
  inset: 0;
  bottom: var(--taskbar-height);
  pointer-events: none;
}

#desktop-icons > * {
  pointer-events: auto;
}

#taskbar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--taskbar-height);
}

.window {
  position: absolute;
  display: flex;
  flex-direction: column;
  min-width: 240px;
  min-height: 160px;
}

.window .title-bar {
  cursor: default;
  touch-action: none;
  flex: 0 0 auto;
}

.window .window-body {
  flex: 1 1 auto;
  /* min-height:0 overrides the flex-item default of refusing to shrink
     below content size — without it, overflow:auto never engages and tall
     content just spills out past the window's bottom edge instead of
     scrolling inside it. */
  min-height: 0;
  overflow: auto;
  margin: 0;
}

/* Menu bar (File/Edit/View/Help...) and its dropdowns, shared visual
   language with the desktop right-click context menu below. */
.menu-bar {
  display: flex;
  flex: 0 0 auto;
  background: silver;
  padding: 1px 2px;
  position: relative;
}

.menu-bar-button {
  background: transparent !important;
  box-shadow: none !important;
  border: none;
  min-width: 0 !important;
  min-height: 0 !important;
  padding: 2px 8px !important;
  font-size: 11px;
}

.menu-bar-button[aria-expanded="true"],
.menu-bar-button:hover {
  background: navy !important;
  color: #fff;
}

.menu-dropdown,
.context-menu {
  position: absolute;
  background: silver;
  box-shadow: inset -1px -1px #0a0a0a, inset 1px 1px #fff, inset -2px -2px grey, inset 2px 2px #dfdfdf;
  padding: 2px;
  min-width: 180px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
}

.menu-dropdown {
  top: 100%;
  left: 0;
}

.menu-item,
.context-menu-item {
  background: transparent !important;
  box-shadow: none !important;
  border: none;
  min-width: 0 !important;
  min-height: 0 !important;
  text-align: left;
  padding: 4px 10px !important;
  font-size: 11px;
  color: #000;
}

.menu-item:disabled,
.context-menu-item:disabled {
  color: grey;
  text-shadow: 1px 1px 0 #fff;
}

.menu-item:not(:disabled):hover,
.context-menu-item:not(:disabled):hover {
  background: navy !important;
  color: #fff;
}

.menu-separator,
.context-menu-separator {
  height: 1px;
  margin: 3px 2px;
  box-shadow: inset 0 -1px #fff, inset 0 1px grey;
}

.context-menu-item--checked {
  padding-left: 4px !important;
}

.context-menu-item--checked::before {
  content: '\2713';
  display: inline-block;
  width: 16px;
  text-align: center;
}

.window.is-maximized {
  left: 0 !important;
  top: 0 !important;
  width: 100% !important;
  height: 100% !important;
}

/* Resize handles — 8 invisible strips/corners around the window edge.
   Without these, dragging near an edge falls through to the browser's
   default text-selection drag instead of resizing anything. */
.resize-handle {
  position: absolute;
  touch-action: none;
  z-index: 1;
}

.resize-n, .resize-s { left: 6px; right: 6px; height: 6px; cursor: ns-resize; }
.resize-n { top: -3px; }
.resize-s { bottom: -3px; }

.resize-e, .resize-w { top: 6px; bottom: 6px; width: 6px; cursor: ew-resize; }
.resize-e { right: -3px; }
.resize-w { left: -3px; }

.resize-ne, .resize-nw, .resize-se, .resize-sw { width: 10px; height: 10px; }
.resize-ne { top: -3px; right: -3px; cursor: nesw-resize; }
.resize-nw { top: -3px; left: -3px; cursor: nwse-resize; }
.resize-se { bottom: -3px; right: -3px; cursor: nwse-resize; }
.resize-sw { bottom: -3px; left: -3px; cursor: nesw-resize; }

.window.is-maximized .resize-handle {
  display: none;
}

/* Applied to <body> for the duration of any window drag/resize so the
   browser's native text-selection highlight doesn't fire mid-drag. */
body.is-interacting {
  user-select: none;
}

/* Taskbar */
#taskbar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px;
  background: silver;
  box-shadow: inset 0 1px #fff;
}

.start-button {
  display: flex !important;
  align-items: center;
  gap: 5px;
  font-weight: bold;
  font-size: 12px;
  padding: 0 6px 0 4px !important;
  min-width: 0 !important;
  min-height: 28px !important;
}

.start-button[aria-pressed="true"] {
  box-shadow: inset -1px -1px #fff, inset 1px 1px #0a0a0a, inset -2px -2px #dfdfdf, inset 2px 2px grey !important;
}

.start-icon {
  width: 16px;
  height: 16px;
}

.taskbar-separator {
  width: 0;
  height: 24px;
  border-left: 1px solid grey;
  border-right: 1px solid #fff;
  margin: 0 2px;
}

.taskbar-buttons {
  display: flex;
  gap: 3px;
  flex: 1 1 auto;
  overflow-x: auto;
  min-width: 0;
  height: 100%;
  align-items: center;
}

.taskbar-button {
  display: flex !important;
  align-items: center;
  gap: 4px;
  max-width: 160px;
  min-height: 24px !important;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  text-align: left;
}

.taskbar-button img {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.taskbar-button[aria-pressed="true"] {
  box-shadow: inset -1px -1px #fff, inset 1px 1px #0a0a0a, inset -2px -2px #dfdfdf, inset 2px 2px grey !important;
}

.taskbar-tray {
  margin-left: auto;
  padding: 2px 10px;
  font-size: 11px;
  display: flex;
  align-items: center;
  height: 22px;
}

/* Start menu */
.start-menu {
  position: absolute;
  left: 3px;
  bottom: calc(var(--taskbar-height) + 1px);
  display: flex;
  width: 220px;
  background: silver;
  box-shadow: inset -1px -1px #0a0a0a, inset 1px 1px #fff, inset -2px -2px grey, inset 2px 2px #dfdfdf;
  padding: 3px;
  z-index: 10000;
}

.start-menu[hidden] {
  display: none;
}

.start-menu-banner {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  background: linear-gradient(180deg, navy, #1084d0);
  color: #fff;
  font-weight: bold;
  font-size: 20px;
  padding: 8px 4px;
  flex: 0 0 auto;
  letter-spacing: 1px;
}

.start-menu-items {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  padding: 2px;
}

.start-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px;
  background: transparent;
  border: none;
  text-align: left;
  font-size: 12px;
  width: 100%;
}

.start-menu-item:hover,
.start-menu-item:focus {
  background: navy;
  color: #fff;
  outline: none;
}

.start-menu-item img {
  width: 20px;
  height: 20px;
}

.start-menu-item-glyph {
  width: 20px;
  text-align: center;
  font-size: 15px;
}

.start-menu-separator {
  height: 1px;
  /* Roughly the height of 3 app-list rows (~28px each), so Log Off/Shut
     Down read as a clearly separate trailing group, not a cramped tack-on. */
  margin: 84px 2px 8px;
  box-shadow: inset 0 -1px #fff, inset 0 1px grey;
}

#desktop-icons {
  z-index: 1;
}

.desktop-icon {
  position: absolute;
  width: var(--icon-width);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: transparent !important;
  box-shadow: none !important;
  border: 1px solid transparent;
  color: #fff;
  text-align: center;
  padding: 4px;
  min-width: 0 !important;
  min-height: 0 !important;
  touch-action: none;
  user-select: none;
  cursor: default;
}

.desktop-icon:focus,
.desktop-icon:hover {
  outline: 1px dotted #fff;
  outline-offset: -1px;
}

.desktop-icon img {
  width: 32px;
  height: 32px;
  pointer-events: none;
}

.desktop-icon span {
  font-size: 12px;
  word-break: break-word;
  text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.6);
  pointer-events: none;
}

.desktop-icon:focus span,
.desktop-icon.is-selected span {
  background: navy;
  text-shadow: none;
}

.window-back-button {
  display: none;
}

@media (max-width: 768px) {
  .window {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: calc(100dvh - var(--taskbar-height));
    min-width: 0;
    min-height: 0;
  }

  .window-back-button {
    display: inline-block;
    order: -1;
  }

  body.has-open-app #desktop-icons {
    display: none;
  }
}

/* Portfolio app */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  padding: 8px;
}

.portfolio-card {
  margin: 0;
}

.portfolio-image-wrapper {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border: 1px solid #808080;
}

.portfolio-image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.portfolio-card figcaption {
  font-size: 12px;
  text-align: center;
  padding-top: 4px;
}

/* App Showcase app */
.showcase-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 8px;
}

.showcase-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.showcase-icon {
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
}

.showcase-details h3 {
  margin: 0 0 4px;
}

.showcase-links {
  display: flex;
  gap: 8px;
}

/* About app */
.about-notepad {
  font-family: 'Courier New', monospace;
  white-space: pre-wrap;
  padding: 8px;
  margin: 0;
}

/* Contact app */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 8px;
}

.contact-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.contact-honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.contact-status {
  min-height: 1em;
  margin: 0;
}

.contact-status--error {
  color: #a00;
  font-weight: bold;
}

/* Tech Stack app */
.techstack-properties {
  padding: 8px;
}

.techstack-section h3 {
  margin-bottom: 2px;
}

/* Calculator app — Standard and Scientific layouts mirroring the real
   Windows 98 Calculator (View menu switches mode; see MenuBar wiring). */
.calculator-app {
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  height: 100%;
  font-size: 11px;
}

.calculator-screen {
  border: 2px inset #808080;
  background: #fff;
  text-align: right;
  font-size: 18px;
  padding: 4px 6px;
  font-family: 'Courier New', monospace;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calculator-radio-row,
.calculator-tool-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.calculator-radio-group {
  display: flex;
  gap: 8px;
  align-items: center;
}

.calculator-radio-group label,
.calculator-tool-left label {
  display: flex;
  align-items: center;
  gap: 3px;
}

.calculator-tool-row {
  gap: 6px;
}

.calculator-tool-left {
  display: flex;
  align-items: center;
  gap: 6px;
}

.calculator-blank-field {
  display: inline-block;
  width: 28px;
  height: 16px;
  background: #fff;
  box-shadow: inset -1px -1px #fff, inset 1px 1px grey, inset -2px -2px #dfdfdf, inset 2px 2px #0a0a0a;
}

.calculator-tool-right {
  display: flex;
  gap: 4px;
}

.calculator-tool-right button {
  min-width: 0 !important;
  min-height: 0 !important;
  padding: 3px 8px !important;
  font-size: 11px;
}

.calculator-grid {
  display: grid;
  gap: 3px;
  flex: 1 1 auto;
}

.calculator-grid button {
  min-width: 0 !important;
  min-height: 0 !important;
  padding: 2px !important;
  font-size: 11px;
}

.calculator-key-blank {
  visibility: hidden;
}

.calculator-key-red:not(:disabled) {
  color: red !important;
  text-shadow: none !important;
}

.calculator-key-purple:not(:disabled) {
  color: #a000a0 !important;
  text-shadow: none !important;
}

.calculator-key-blue:not(:disabled) {
  color: #0000c0 !important;
  text-shadow: none !important;
}

/* Notepad (desktop text files) */
.notepad-textarea {
  width: 100%;
  height: 100%;
  border: none;
  resize: none;
  padding: 6px;
  font-family: 'Courier New', monospace;
  font-size: 13px;
}

/* Display Properties */
.display-props {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.display-props-preview {
  height: 90px;
  border: 2px inset #808080;
}

.display-props-swatches {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}

.display-props-swatch {
  height: 28px;
  min-width: 0 !important;
  min-height: 0 !important;
  padding: 0 !important;
  border: 1px solid #000 !important;
  box-shadow: none !important;
}

.display-props-custom {
  display: flex;
  align-items: center;
  gap: 8px;
}

.display-props-buttons,
.confirm-dialog-buttons,
.task-manager-buttons {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* Task Manager */
.task-manager {
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100%;
}

.task-manager-list {
  flex: 1 1 auto;
  overflow: auto;
  border: 2px inset #808080;
  background: #fff;
  display: flex;
  flex-direction: column;
}

.task-manager-row {
  text-align: left;
  padding: 4px 6px !important;
  min-width: 0 !important;
  min-height: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  border: none;
}

.task-manager-row[aria-selected="true"] {
  background: navy !important;
  color: #fff;
}

.task-manager-empty {
  padding: 8px;
  color: #555;
  font-style: italic;
  margin: 0;
}

/* Item Properties */
.item-properties {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.item-properties-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.item-properties-header img {
  width: 32px;
  height: 32px;
}

.item-properties-table {
  border-collapse: collapse;
}

.item-properties-table th {
  text-align: left;
  padding: 3px 8px 3px 0;
  font-weight: normal;
  color: #444;
}

.item-properties-table td {
  padding: 3px 0;
}

.item-properties button {
  align-self: flex-end;
}

/* Confirm dialog */
.confirm-dialog {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  height: 100%;
  justify-content: space-between;
}

/* Power screens (shutdown / login) — full-viewport overlays outside the
   normal window system; real Win98 shutdown/logon screens have no chrome
   and sit above everything, including the taskbar. */
.power-screen {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Pixelated MS Sans Serif', Arial, sans-serif;
}

.power-screen--shutdown {
  background: #000;
  color: #fff;
}

.power-screen-message {
  font-size: 20px;
}

.power-screen--login {
  background: var(--desktop-bg);
}

.power-screen-login-box {
  background: silver;
  box-shadow: inset -1px -1px #0a0a0a, inset 1px 1px #fff, inset -2px -2px grey, inset 2px 2px #dfdfdf;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 280px;
}

.power-screen-login-title {
  font-weight: bold;
  font-size: 16px;
  text-align: center;
}

.power-screen-login-box label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
}

.power-screen-login-buttons {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 8px;
}

/* Boot splash — shown once on page load, before the login screen. */
.power-screen--boot {
  background: radial-gradient(circle at center, #000030 0%, #000010 70%, #000 100%);
  color: #fff;
  flex-direction: column;
  gap: 18px;
}

.boot-logo {
  width: 96px;
  height: 96px;
  image-rendering: pixelated;
  filter: drop-shadow(0 0 12px rgba(0, 255, 255, 0.5));
}

.boot-title {
  font-size: 22px;
  font-weight: bold;
  letter-spacing: 1px;
  background: linear-gradient(90deg, #ff00aa, #00e5ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.boot-loading-bar {
  width: 220px;
  height: 18px;
  border: 2px solid #fff;
  padding: 2px;
  box-sizing: content-box;
  overflow: hidden;
}

.boot-loading-bar::before {
  content: '';
  display: block;
  height: 100%;
  width: 200%;
  background: repeating-linear-gradient(
    90deg,
    #ff00aa 0 16px,
    #00e5ff 16px 32px
  );
  animation: boot-bar-scroll 1.1s linear infinite;
}

@keyframes boot-bar-scroll {
  from { transform: translateX(-32px); }
  to { transform: translateX(0); }
}

.boot-subtitle {
  font-size: 12px;
  color: #ccc;
  letter-spacing: 0.5px;
}
