:root {
  /* Core colours for the Mac OS 9 / early desktop hybrid theme. */
  --desktop-blue: #8db4cc;
  --desktop-lavender: #b9b2d6;
  --desktop-mint: #a7cbb6;
  --system-light: #efeee8;
  --system-mid: #d6d3ca;
  --system-dark: #89867e;
  --system-shadow: #57544e;
  --accent-blue: #315fbe;
  --accent-blue-soft: #5f7fcf;
  --text-dark: #1c1c1c;
}

* {
  box-sizing: border-box;
}

body,
html {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  font-family: Chicago, Charcoal, Geneva, Tahoma, Arial, sans-serif;
  color: var(--text-dark);
}

/* Keep image buttons from triggering the browser's native drag ghost. */
img {
  -webkit-user-drag: none;
  user-select: none;
}

button {
  font: inherit;
}

/* Fixed top menu bar, inspired by classic Mac OS. */
.top-bar {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 30px;
  padding: 0 10px;
  background:
    repeating-linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.45) 0,
      rgba(255, 255, 255, 0.45) 1px,
      transparent 1px,
      transparent 3px
    ),
    linear-gradient(#fbfaf5, var(--system-mid));
  border-bottom: 1px solid var(--system-shadow);
  box-shadow: inset 0 1px 0 #fff, 0 2px 6px rgba(0, 0, 0, 0.22);
}

.menu-bar-left {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.system-mark {
  display: grid;
  width: 28px;
  height: 22px;
  padding: 0;
  place-items: center;
  color: #111;
  font-size: 10px;
  font-weight: 700;
  background: linear-gradient(#fff, #d8d5cc);
  border: 1px solid var(--system-shadow);
  border-radius: 3px;
  box-shadow: inset 1px 1px 0 #fff, inset -1px -1px 0 #a7a39a;
}

.menu-bar-left span,
.name,
.time {
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.menu-bar-left span,
.time {
  font-weight: 400;
}

.name {
  margin-right: 4px;
}

/* Soft patterned desktop background. */
.desktop {
  position: relative;
  height: calc(100vh - 30px);
  margin-top: 30px;
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 18%, rgba(255, 255, 255, 0.28), transparent 24%),
    linear-gradient(135deg, var(--desktop-lavender), var(--desktop-blue) 48%, var(--desktop-mint));
}

.desktop::before {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, 0.3) 1.3px, transparent 1.4px);
  background-position: 0 0;
  background-size: 16px 16px;
  opacity: 0.62;
}

@keyframes windowOpen {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.96);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes windowClose {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }

  to {
    opacity: 0;
    transform: translateY(8px) scale(0.96);
  }
}

/* Bottom launcher bar: the small Windows half of the hybrid. */
.taskbar {
  position: fixed;
  bottom: 0;
  left: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  height: 50px;
  padding: 5px 10px;
  overflow-x: auto;
  background:
    repeating-linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.34) 0,
      rgba(255, 255, 255, 0.34) 1px,
      transparent 1px,
      transparent 3px
    ),
    linear-gradient(#ecebe5, #c8c4ba);
  border-top: 1px solid #fff;
  box-shadow: inset 0 1px 0 #fff, 0 -2px 10px rgba(0, 0, 0, 0.24);
}

.start-button,
.icon,
.start-menu-item,
.desktop-icon {
  border: 0;
  cursor: pointer;
}

.start-button {
  min-width: 92px;
  height: 36px;
  padding: 0 14px;
  color: var(--text-dark);
  font-size: 13px;
  font-weight: 700;
  text-shadow: 1px 1px 0 #fff;
  background: linear-gradient(#fff, #d7d4cc);
  border: 1px solid var(--system-shadow);
  border-radius: 5px;
  box-shadow:
    inset 1px 1px 0 #fff,
    inset -1px -1px 0 #88847c,
    1px 1px 0 rgba(255, 255, 255, 0.45);
}

.start-button:active,
.icon:active,
.desktop-icon:active {
  transform: translateY(1px);
}

.icon {
  display: grid;
  grid-template-columns: 30px minmax(38px, 1fr);
  align-items: center;
  width: 94px;
  height: 36px;
  padding: 4px 7px;
  color: var(--text-dark);
  text-align: left;
  text-shadow: 1px 1px 0 #fff;
  background: linear-gradient(#f8f7f2, #d4d0c5);
  border: 1px solid var(--system-shadow);
  border-radius: 4px;
  box-shadow: inset 1px 1px 0 #fff, inset -1px -1px 0 #a7a39a;
}

.icon:hover,
.icon:focus-visible {
  background: linear-gradient(#fff, #dcd8ce);
  outline: none;
}

.icon img,
.start-menu-item img {
  width: 28px;
  height: 28px;
}

.icon span {
  min-width: 0;
  overflow: hidden;
  font-size: 12px;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.start-menu {
  position: fixed;
  bottom: 50px;
  left: 10px;
  z-index: 9500;
  display: none;
  width: 270px;
  padding: 0 0 8px;
  overflow: hidden;
  background: var(--system-light);
  border: 1px solid var(--system-shadow);
  border-radius: 5px 5px 0 0;
  box-shadow:
    inset 1px 1px 0 #fff,
    inset -1px -1px 0 #8d897f,
    5px 5px 18px rgba(0, 0, 0, 0.28);
}

.start-menu.is-open {
  display: block;
}

.start-menu-header {
  padding: 14px 16px;
  color: var(--text-dark);
  font-size: 16px;
  font-weight: 700;
  text-shadow: 1px 1px 0 #fff;
  background:
    repeating-linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.42) 0,
      rgba(255, 255, 255, 0.42) 1px,
      transparent 1px,
      transparent 3px
    ),
    linear-gradient(#e7e4dc, #c6c1b6);
  border-bottom: 1px solid #9f9a90;
}

.start-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: calc(100% - 12px);
  min-height: 44px;
  margin: 6px 6px 0;
  padding: 8px 10px;
  color: var(--text-dark);
  text-align: left;
  background: transparent;
  border-radius: 3px;
}

.start-menu-item:hover,
.start-menu-item:focus-visible {
  color: #fff;
  background: var(--accent-blue);
  outline: none;
}

.desktop-icons {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.desktop-icon {
  position: absolute;
  display: grid;
  justify-items: center;
  width: 78px;
  min-height: 76px;
  padding: 4px;
  color: #111;
  text-align: center;
  text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.7);
  background: transparent;
  opacity: 0.92;
  pointer-events: auto;
  transition: opacity 120ms ease;
  user-select: none;
}

.desktop-icon:hover,
.desktop-icon:focus-visible {
  color: #fff;
  text-shadow: none;
  background: rgba(49, 95, 190, 0.76);
  outline: 1px dotted rgba(255, 255, 255, 0.95);
}

.desktop-icon.is-dragging {
  opacity: 0.48;
}

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

.desktop-icon span {
  width: 100%;
  font-size: 12px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.desktop-icon-bin {
  top: 16px;
  right: 18px;
}

.desktop-icon-documents {
  top: 100px;
  right: 18px;
}

.desktop-icon-pictures {
  top: 184px;
  right: 18px;
}

.window {
  position: absolute;
  top: 72px;
  left: 86px;
  z-index: 10;
  display: none;
  width: min(1120px, calc(100vw - 96px));
  height: min(640px, calc(100vh - 136px));
  min-width: 300px;
  min-height: 240px;
  overflow: hidden;
  resize: none;
  background: var(--system-light);
  border: 1px solid var(--system-shadow);
  border-radius: 4px;
  box-shadow:
    inset 1px 1px 0 #fff,
    inset -1px -1px 0 #76736b,
    8px 10px 20px rgba(0, 0, 0, 0.28);
  transform-origin: top center;
}

.window.is-open {
  display: block;
  animation: windowOpen 180ms ease-out both;
}

.window.is-closing {
  display: block;
  pointer-events: none;
  animation: windowClose 140ms ease-in both;
}

#lookbook-window {
  top: 42px;
  left: max(48px, calc((100vw - 1220px) / 2));
  width: min(1220px, calc(100vw - 96px));
  height: min(700px, calc(100vh - 138px));
}

#Pixify-window {
  top: 70px;
  left: 82px;
}

#palette-window {
  top: 92px;
  left: 104px;
}

#furniture-window,
#videos-window {
  top: 86px;
  left: 118px;
}

#links-window,
#bio-window {
  width: min(640px, calc(100vw - 96px));
  height: 400px;
}

/* Platinum window chrome with Mac-style traffic light actions. */
.window-header {
  display: grid;
  grid-template-columns: 76px 1fr 76px;
  align-items: center;
  height: 30px;
  padding: 4px 7px;
  color: #111;
  user-select: none;
  cursor: move;
  background:
    repeating-linear-gradient(
      180deg,
      #f7f6f0 0,
      #f7f6f0 1px,
      #cbc6ba 1px,
      #cbc6ba 2px,
      #e8e5dc 2px,
      #e8e5dc 4px
    );
  border-bottom: 1px solid #9f9a90;
  box-shadow: inset 0 1px 0 #fff;
}

.window-header p {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  margin: 0;
  padding: 2px 10px;
  overflow: hidden;
  justify-self: center;
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  text-shadow: 1px 1px 0 #fff;
  white-space: nowrap;
  background: var(--system-light);
  border-left: 1px solid #beb8ad;
  border-right: 1px solid #beb8ad;
}

.window-controls {
  grid-column: 1;
  grid-row: 1;
  display: flex;
  gap: 4px;
  margin: 0;
}

.window-controls span {
  display: grid;
  width: 14px;
  height: 14px;
  place-items: center;
  color: #111;
  font-size: 0;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  user-select: none;
  border: 1px solid rgba(55, 53, 49, 0.46);
  border-radius: 50%;
  box-shadow:
    inset 1px 1px 0 rgba(255, 255, 255, 0.72),
    inset -1px -1px 0 rgba(0, 0, 0, 0.18);
}

.window-controls span::before {
  display: none;
}

.window-controls .close {
  order: 1;
  background: #ff5f57;
}

.window-controls .minimise {
  order: 2;
  background: #ffbd2e;
}

.window-controls .maximise {
  order: 3;
  background: #28c840;
}

.window-body {
  height: calc(100% - 30px);
  padding: 18px;
  overflow: auto;
  background: #fffef8;
  border: 5px solid var(--system-light);
  border-top: 0;
  box-shadow: inset 1px 1px 0 #a9a499;
}

.window-body.no-padding {
  padding: 0;
}

.window-resize-handle {
  position: absolute;
  right: 0;
  bottom: 0;
  z-index: 4;
  width: 18px;
  height: 18px;
  padding: 0;
  cursor: nwse-resize;
  background:
    linear-gradient(135deg, transparent 0 48%, #77736b 48% 54%, transparent 54%),
    linear-gradient(135deg, transparent 0 66%, #77736b 66% 72%, transparent 72%);
  border: 0;
}

.window.is-resizing {
  user-select: none;
}

.book-window-body {
  display: flex;
  align-items: stretch;
  justify-content: center;
  contain: layout paint;
  overflow: hidden;
  background: #cbc7bd;
}

#portfolio_book {
  width: 100%;
  height: 100%;
  contain: layout paint;
  min-height: 0;
  margin: 0 auto;
}

#portfolio_book .df-container {
  width: 100% !important;
  height: 100% !important;
}

#portfolio_book > * {
  margin-right: auto;
  margin-left: auto;
}

.fill-frame {
  width: 100%;
  height: 100%;
}

iframe {
  display: block;
  width: 100%;
  border: 0;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.gallery .image {
  margin: 0;
  padding: 10px;
  background: #fff;
  border: 1px solid #aaa599;
  box-shadow: inset 1px 1px 0 #fff, 2px 2px 0 rgba(0, 0, 0, 0.12);
}

.gallery img {
  display: block;
  width: 100%;
  border: 1px solid #b8b2a0;
}

.gallery p {
  margin: 9px 0 5px;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
}

.gallery ul,
.link-list {
  margin: 8px 0 0;
  padding-left: 22px;
}

.link-list li + li {
  margin-top: 10px;
}

.link-list a {
  color: var(--accent-blue);
  font-weight: 700;
}

@media (max-width: 900px) {
  .top-bar {
    height: 30px;
  }

  .name,
  .time {
    font-size: 12px;
  }

  .desktop {
    height: calc(100vh - 30px);
    margin-top: 30px;
  }

  .window,
  #lookbook-window,
  #links-window,
  #bio-window {
    top: 24px;
    left: 14px;
    width: calc(100vw - 28px);
    height: calc(100vh - 122px);
  }

  .icon {
    width: 76px;
    grid-template-columns: 26px minmax(30px, 1fr);
    padding: 4px;
  }

  .icon img {
    width: 24px;
    height: 24px;
  }

  .menu-bar-left {
    gap: 9px;
  }

  .menu-bar-left span {
    display: none;
  }
}

/* Phone layout: the launcher becomes an iOS 6-style app home screen. */
@media (max-width: 680px) {
  .top-bar {
    height: 28px;
  }

  .system-mark {
    width: 25px;
    height: 20px;
  }

  .desktop {
    height: calc(100vh - 28px);
    margin-top: 28px;
    background:
      radial-gradient(circle at 24% 12%, rgba(255, 255, 255, 0.42), transparent 26%),
      linear-gradient(155deg, #6c83c5 0%, #8ba7d7 45%, #7fc3b6 100%);
  }

  .desktop::before {
    background-image:
      radial-gradient(circle, rgba(255, 255, 255, 0.24) 1px, transparent 1px);
    background-size: 16px 16px;
    opacity: 0.58;
  }

  .desktop-icons {
    display: none;
  }

  .taskbar {
    position: absolute;
    inset: 0;
    z-index: 4;
    display: grid;
    grid-template-columns: repeat(3, minmax(74px, 1fr));
    gap: 20px 10px;
    align-content: start;
    height: auto;
    padding: 34px 18px 96px;
    overflow-y: auto;
    background: transparent;
    border: 0;
    box-shadow: none;
  }

  .start-button {
    display: none;
  }

  .start-menu {
    top: 34px;
    bottom: auto;
    left: 8px;
    width: calc(100vw - 16px);
  }

  .icon {
    display: grid;
    grid-template-columns: 1fr;
    justify-items: center;
    align-content: start;
    width: auto;
    height: 92px;
    padding: 0;
    color: #fff;
    text-align: center;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.72);
    background: transparent;
    border: 0;
    box-shadow: none;
  }

  .icon:hover,
  .icon:focus-visible {
    background: transparent;
  }

  .icon img {
    width: 58px;
    height: 58px;
    padding: 9px;
    background:
      linear-gradient(160deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.14) 45%, rgba(0, 0, 0, 0.16)),
      linear-gradient(#f7f7f7, #bfc7d1);
    border: 1px solid rgba(255, 255, 255, 0.62);
    border-radius: 14px;
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.82),
      0 3px 7px rgba(0, 0, 0, 0.34);
  }

  .icon span {
    width: 100%;
    margin-top: 7px;
    font-size: 12px;
    white-space: normal;
  }

  .window,
  #lookbook-window,
  #links-window,
  #bio-window {
    top: 8px;
    left: 8px;
    z-index: 20;
    width: calc(100% - 16px);
    height: calc(100% - 16px);
    min-width: 0;
    min-height: 0;
    resize: none;
    border-radius: 10px;
  }

  #Pixify-window,
  #palette-window,
  #furniture-window,
  #videos-window {
    top: 8px;
    left: 8px;
  }

  .window-header {
    grid-template-columns: 66px 1fr 66px;
    height: 32px;
  }

  .window-body {
    height: calc(100% - 32px);
    padding: 14px;
  }

  .window-body.no-padding {
    padding: 0;
  }

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

  #portfolio_book {
    height: 100%;
    min-height: 0;
  }
}

@media (max-width: 560px) {
  .top-bar {
    padding: 0 8px;
  }

  .time {
    max-width: 48vw;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .start-button {
    min-width: 84px;
    padding: 0 12px;
  }

  .start-menu {
    width: calc(100vw - 16px);
  }

  #portfolio_book {
    min-height: 0;
  }

  .desktop-icon {
    width: 68px;
  }

  .desktop-icon img {
    width: 42px;
    height: 42px;
  }

  .desktop-icon-bin,
  .desktop-icon-documents,
  .desktop-icon-pictures {
    right: 8px;
  }
}
