:root {
  --desktop-height: calc(100dvh - (var(--taskbar-height) * var(--mobile-factor)));
  --taskbar-height: 28px;
  --mobile-factor: 1;

  --border-bevel: inset -1px -1px #0a0a0a,inset 1px 1px #dfdfdf,inset -2px -2px grey,inset 2px 2px #fff;
  --border-bevel-highlight: inset -1px -1px #0a0a0a,inset 1px 1px #fff,inset -2px -2px grey,inset 2px 2px #fff;
  --border-bevel-pressed: inset -1px -1px #fff,inset 1px 1px #0a0a0a,inset -2px -2px #dfdfdf,inset 2px 2px grey;
}

html {
  background: #020024;
  min-height: 100%;
  background: linear-gradient(170deg, rgba(2, 0, 36, 1) 0%, rgba(9, 9, 121, 1) 40%, rgba(6, 131, 209, 1) 100%);
  font-family: Arial, Helvetica, sans-serif;
  overflow: hidden;
}

/* Atoms */
button, a.btn{
  display: inline-block;
  background-color: silver;
  box-shadow: var(--border-bevel);
  padding: 3px 12px;
  text-decoration: none;
  font-size: 0.9rem;
  border: none;

  &:active {
    box-shadow: var(--border-bevel-pressed);
    background-color: lightgray;
  }

  &:focus {
    outline: dotted 1px black;
    outline-offset: -4px;
  }

  &.no-btn {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    box-shadow: none;
  }
}

.scrollable {
  height: 100%;
  min-height: 0;
  overflow-y: auto;
}

/* Components */
#startMenu {
  position: fixed;
  width: 13rem;
  inset: unset;
  bottom: calc(var(--taskbar-height) + 2px);
  left: 2px;
  box-shadow: var(--border-bevel);
  border: none;
  padding: 3px;
  flex-direction: row;
  align-items: start;
  background-color: lightgray;
  z-index: 9999999;
  height: fit-content;
  align-items: stretch;

  &:popover-open { display: flex; }

  div {
    width: 3rem;
    display: flex;
    background: linear-gradient(170deg, rgb(26 26 175) 0%, rgb(3 3 75) 70%);
    padding: 30px 2px 6px;
    margin-right: 3px;
    p {
      writing-mode: vertical-lr;
      text-align: start;
      transform: rotate(180deg);
      font-weight: 700;
      color: white;
    }
  }

  nav {
    a {
      display: inline-flex;
      padding: 8px 16px 8px 8px;
      width: 100%;
      text-decoration: none;

      &:hover { background: rgb(26 26 175); color: white; }

      align-items: center;
      justify-content: start;
      gap: 12px;

      img { width: 32px; height: 32px; }
    }
  }
}

div.prose {
  margin-inline: 0.25rem 1rem;
  p { margin-block: 0.25lh 0.5lh; }
  ul {  margin-bottom: 0.5lh; }
}

div#taskbar {
  position: fixed;
  height: var(--taskbar-height);
  bottom: 0;
  width: 100%;
  background: lightgray;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1px;
  z-index: 9999999;

  .taskbar-left {
    display: flex;
    align-items: center;
    justify-content: start;

    button{
      display: flex;
      align-items: center;
      justify-content: center;
      padding-left: 8px;
      gap: 4px;
      border: none;
      img { width: 16px; height: 16px; }
    }
  }

  #taskbar-activities {
    display: flex;
    gap: 4px;
  }

  .taskbar-right {
    box-shadow: var(--border-bevel-pressed);
    padding: 2px 10px;
    font-size: 0.85rem;
    display: flex;
    gap: 1rem;
  }

  .taskbar-spacer {
    width: 3px;
    height: 20px;
    margin-inline: 10px 8px;
    box-shadow: var(--border-bevel-highlight);
    background-color: white;
  }

  img {
    height: 20px;
  }
}

div.window {
  /* Windows should declare a starting width through the usage of inline styles, 
  the base class provides fallbacks to prevent from aesthetic issues. */
  min-width: 200px;
  width: 30rem;
  max-width: 95dvw;

  /* Window heights are universal for all windows. */
  height: fit-content;
  max-height: calc(var(--desktop-height) - 2rem);
  
  position: absolute;
  resize: both;
  overflow: hidden;
  transform-origin: center bottom;
  transition: transform 200ms, opacity 90ms 110ms;

  display: flex;
  flex-direction: column;

  background: lightgray;
  padding: 3px;
  box-shadow: var(--border-bevel);

  &.widget {
    resize: none;
    top: auto;
    left: auto;
    bottom: 2.4rem;
    right: 0.5rem;
    min-height: 0;
    border: none;
    display: none;
    z-index: 999999;
  }

  &.minimized { 
    transition: transform 200ms ease-in, opacity 90ms;
    transform: scale(0); 
    opacity: 0 
  }
  
  &.maximized {
    width: 100dvw;
    height: var(--desktop-height);
    max-width: 100dvw;
    max-height: var(--desktop-height);
  }

  .window-bar {
    margin-block: 1px 0;
    margin-inline: 1px;
    padding-block: 2px;
    padding-inline: 8px 4px;
    font-size: 0.85rem;
    background-color: rgb(26 26 175);
    color: white;
    font-weight: 700;
    width: calc(100% - 4px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: grab;

    p { pointer-events: none; }

    button {
      padding: 0;
      width: 20px;
      height: 18px;

      &::after{
        content: '';
        display: block;
        position: relative;
        width: 8px;
        height: 2px;
        top: 4px;
        left: 6px;
        background-color: #333;
      }
    }
  }

  .window-view {
    margin-block: 0 2px;
    margin-inline: 1px;
    padding: 4px;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    height: 100%;
    container-type: inline-size;
    container-name: window-width;
    &:has(.view-dual-panel) {
      overflow: hidden;
    }
  }

  &.grabbing {
    user-select: none;
    -webkit-user-select: none;
    opacity: 0.85;

    * { cursor: grabbing !important; }
  }
}