/* Basic reset */

:root {
  --w95-bg: #c0c0c0;
  --w95-light: #ffffff;
  --w95-mid: #dfdfdf;
  --w95-dark: #808080;
  --w95-black: #000000;
  --w95-title: #000080;
}


* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow-x: hidden;
  overflow-y: auto;
  margin: 0;
  padding: 0;
  min-height: 100%;
}

/* Desktop */

.desktop {
  position: relative;
  display: flex;
  min-height: 100vh;
  width:100%;
  background: #22C1C3;
  background: linear-gradient(0deg, rgba(34, 193, 195, 1) 0%, rgba(253, 187, 45, 1) 100%);  color: #1a1a1a;
  flex-direction: row;
}

.desktop::after {
  content: "";
  position: absolute;
  inset: 0;

  background-image:
    repeating-linear-gradient(
      0deg,
      rgba(0, 0, 0, 0.06),
      rgba(0, 0, 0, 0.06) 1px,
      transparent 3px,
      transparent 4px
    );

  opacity: 1;
  pointer-events: none;
  z-index: 0;
}



/* Icon Dock */
.icon-dock {
  width: 120px;
  padding: 16px 4px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  z-index: 2;
}

.icon-column--right {
  width: 120px;
  margin-left: auto;
  padding: 16px 4px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  position: relative;
  z-index: 2;
}

/* Icons */
.icon {
  width: 100%;   
    display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  cursor: pointer;
  user-select: none;
  padding: 8px;
}

.icon-image {
  font-size: 28px;
  width: 56px; 
  height: 56px; 
  image-rendering: crisp-edges;
}

.icon-label {
  font-size: 14px;
  text-align: center;
  line-height: 1.2;
  color: #000;

  max-width: 110px;

  white-space: normal;
  word-break: break-word;

  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.icon:hover {
  background: rgba(0, 0, 128, 0.15);
}

.icon:active {
  background: rgba(0, 0, 128, 0.25);
}

.icon.is-selected {
  background: rgba(0, 0, 128, 0.35);
  outline: 1px dotted #000;
  outline-offset: -2px;
}

.icon.is-selected .icon-label {
  color: #fff;
}

.icon:focus-visible {
  outline: 2px dotted #000;
  outline-offset: 2px;
}


/* Window area */
.window-stage {
  position: relative;
  flex: 1;      
}


/* Tagline */
.tagline {
  position: fixed;
  top: 40px;
  left: 150px;
  right: 120px;
  color: rgb(0, 0, 0);
  padding: 12px;
  font-size: 20px;

  z-index: 2;
}


.tagline.is-hidden {
  display: none;
}


/* Window */
.window {
  position: fixed;
  top: 56px;
  left: 140px;
  right: 120px;
  bottom: 40px; 
  
  max-width: 880px; 
  max-height: calc(100vh - 80px);

  display: flex;
  flex-direction: column;

  box-shadow: 
    inset -1px -1px 0 var(--w95-black), 
    inset 1px 1px 0 var(--w95-light);

  background: var(--w95-bg);
  border: 2px solid var(--w95-dark);

  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(8px);

  z-index: 10;
}


/* Title bar */
.window-titlebar {
  display: flex;
  flex: 0 0 auto;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(
    to right,
    var(--w95-title),
    #0000a0
  );

  color: white; 
  padding: 0px 6px;
  border-bottom: 2px solid #8a8a8a;
  font-size: 13px;
  font-weight: bold;
}

/* Title text */
.window-title {
  font-weight: 600;
  user-select: none;
}

/* Close button */
.window-close {
  background: #c05050;
  border: 1px solid #7a2f2f;
  color: white;
  width: 30px;
  height: 30px;
  line-height: 18px;
  font-size: 20px;
  cursor: pointer;
}

.window-close:hover {
  background: #a83f3f;
}

.window-close-hitarea {
  width: 48px;
  height: 48px;

  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}


/* Window content */
.window-content {
  flex: 1; 
  min-height: 0;
  padding: 16px;
  overflow-y: auto;
  overflow-x: hidden;
  background: #ffffff;
  font-size: 14px;
  line-height: 1.5;
  color: #000;
  
}

.window-content h2 {
  margin-bottom: 12px;
}

.window-content p {
  margin-bottom: 12px;
  line-height: 1.5;
}

.window.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;

  transform: translateY(0);

  transition:
    opacity 140ms ease,
    transform 180ms ease,
    visibility 100ms;
}

/* Avatar area */

.avatar {
  position: fixed;
  right: 24px;
  bottom: 0px;

  display: flex;
  flex-direction: row-reverse;
  align-items: flex-end;
  gap: 12px;

  pointer-events: none;
  z-index: 1;
}

.avatar-image {
  width: 300px; 
  height: auto;
}

.avatar-bubble {
  max-width: 220px;
  padding: 12px 14px;
  margin-bottom: 160px;
  margin-left: 10px;

  background: #ffffff;
  color: #000;
  font-size: 14px;
  line-height: 1.4;

  border: 2px solid #000;
  border-radius: 8px;

  position: relative;

  box-shadow: 2px 2px 0 #000;

  z-index: 1;
}

.avatar-bubble::after {
  content: "";
  position: absolute;
  right: -10px;
  bottom: 16px;

  width: 0;
  height: 0;

  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-left: 10px solid #ffffff;
  z-index: 1;
}

.avatar-bubble::before {
  content: "";
  position: absolute;
  right: -12px;
  bottom: 16px;

  width: 0;
  height: 0;

  border-top: 9px solid transparent;
  border-bottom: 9px solid transparent;
  border-left: 12px solid #000;
  z-index: 1;
}

/* images */
.case-image {
  width: 100%;
  height: auto;

  display: block;
  margin: 16px 0;

  border: 2px solid #000;
  background: #fff;
}

.case-image--medium {
  max-width: 640px;

}

.case-image--small {
  max-width: 420px;
  display: block;
  margin: 16px auto;
  text-align: center;
  right: 16px; 
  top: 16px; 
  left: 16px;
}

.image-row {
  display: flex;
  gap: 8px;
  margin: 16px 0;
}

.image-row > img {
  flex: 1 1 0;
  width: 0;
  height: auto;
  display: block;
  border: 2px solid #000;
}

ul {
  padding-left: 16px;
}

.window-content p {
  margin-bottom: 12px;
}

.window-content h2 {
  margin-top: 24px;
  margin-bottom: 2px;
}

.window-content h3 {
  margin-top: 20px;
  margin-bottom: 8px;
}


@media (max-width: 720px) {

  /* ---------- Desktop layout → vertical ---------- */

  .desktop {
    flex-direction: column;
    height: 100dvh;
  }

  /* ---------- Bottom icon bar ---------- */

  .icon-dock {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;

    width: 100%;
    flex-direction: row;
    justify-content: space-around;

    padding: 8px 6px;

    background: var(--w95-bg);
    border-top: 2px solid var(--w95-dark);

    z-index: 40;
  }

  .icon {
    width: auto;
    padding: 6px 8px;
  }

  .icon-image {
    width: 36px;
    height: 36px;
  }

  .icon-label {
    font-size: 12px;
    max-width: 64px;
  }

  /* ---------- Tagline ---------- */

  .tagline {
    position: fixed;
    top: 64px;
    left: 12px;
    right: 100px;

    font-size: 20px;
    padding: 8px 10px;

    z-index: 30;
  }

  /* ---------- Window ---------- */

  .window {
    position: fixed;

    top: 24px;
    left: 8px;
    right: 8px;
    bottom: 24px; 

    height: calc(100dvh - 56px - 64px); /* tagline + dock */

    max-width: none;
    max-height: none;

    border-radius: 8px;
  }

  .image-row {
    flex-direction: column;
  }

}
