* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
}

body {
  background: #149a90;
  color: #fff;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

.desktop {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  background: #149a90;
  overflow: hidden;
}

.icon-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 168px);
  gap: 28px 18px;
  width: max-content;
  z-index: 1;
}

.desk-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 168px;
  padding: 6px 4px 8px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: #fff;
  cursor: pointer;
}

.desk-icon img {
  width: 84px;
  height: 84px;
  display: block;
  pointer-events: none;
}

.desk-icon span {
  display: block;
  max-width: 8.4em;
  font-size: 15px;
  line-height: 1.2;
  text-align: center;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

.desk-icon:hover,
.desk-icon:focus-visible {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.35);
  outline: none;
}

.window {
  position: absolute;
  display: flex;
  flex-direction: column;
  width: min(560px, calc(100vw - 28px));
  height: min(480px, calc(100vh - 28px));
  background: #f6f3ec;
  color: #1b1b1b;
  border: 1px solid #123f3b;
  box-shadow: 6px 8px 0 rgba(8, 40, 38, 0.28);
  z-index: 2;
}

.window.wide {
  width: min(640px, calc(100vw - 28px));
  height: min(560px, calc(100vh - 28px));
}

.window.compact {
  width: min(420px, calc(100vw - 28px));
  height: auto;
  max-height: calc(100vh - 28px);
}

.window.paint {
  width: min(780px, calc(100vw - 28px));
  height: min(640px, calc(100vh - 28px));
  background: #c0c0c0;
}

.titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 32px;
  padding: 0 8px 0 12px;
  background: #0e6b63;
  color: #fff;
  cursor: grab;
  user-select: none;
  flex: 0 0 auto;
}

.titlebar:active {
  cursor: grabbing;
}

.titlebar h1 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.titlebar .close {
  width: 22px;
  height: 22px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: transparent;
  color: #fff;
  cursor: pointer;
  line-height: 1;
  padding: 0;
}

.titlebar .close:hover {
  background: #c0392b;
  border-color: #c0392b;
}

.window-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  background: #f6f3ec;
}

.window.paint .window-body {
  display: flex;
  padding: 0;
  overflow: hidden;
  background: #c0c0c0;
}

.prose {
  padding: 22px 24px 28px;
  font-size: 15px;
  line-height: 1.55;
}

.prose h2 {
  margin: 0 0 12px;
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.prose h3 {
  margin: 16px 0 6px;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.prose p {
  margin: 0 0 12px;
}

.prose .pull {
  font-size: 18px;
  font-style: italic;
}

.prose .signoff {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid #ddd6c8;
  font-size: 18px;
  font-style: italic;
}

.prose .meta {
  margin-top: 18px;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #5c675f;
}

.prose a {
  color: #0c5c56;
}

.project + .project {
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid #ddd6c8;
}

.project-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.project-head span {
  font-size: 13px;
  letter-spacing: 0.08em;
  color: #5c675f;
}

.tags,
.stack,
.socials {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
  padding: 0;
  list-style: none;
}

.tags li,
.stack li {
  padding: 4px 8px;
  border: 1px solid #cfc6b6;
  background: #fff;
  font-size: 12px;
  letter-spacing: 0.04em;
}

.socials {
  margin-top: 8px;
}

.socials a {
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 460px;
}

.contact-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #5c675f;
}

.contact-form input,
.contact-form textarea {
  border: none;
  border-bottom: 1px solid #c9c1b2;
  background: transparent;
  color: #1b1b1b;
  padding: 8px 0;
  font-size: 15px;
  letter-spacing: 0;
  text-transform: none;
}

.contact-form textarea {
  resize: vertical;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-bottom-color: #0e6b63;
}

.form-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.contact-form button {
  padding: 10px 18px;
  border: 1px solid #1b1b1b;
  border-radius: 999px;
  background: transparent;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 12px;
  cursor: pointer;
}

.contact-form button:hover {
  background: #1b1b1b;
  color: #fff;
}

.contact-form button:disabled {
  opacity: 0.5;
  cursor: default;
}

.form-status {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: none;
  color: #0e6b63;
}

.form-status.error {
  color: #a32020;
}

.studio-paint {
  display: flex;
  flex-direction: column;
  flex: 1;
  height: 100%;
  min-height: 0;
  background: #c0c0c0;
  color: #000;
  font-family: "MS Sans Serif", Tahoma, sans-serif;
  font-size: 11px;
  user-select: none;
}

.studio-paint .paint-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  background: #c0c0c0;
  border-bottom: 1px solid #808080;
  align-items: center;
}

.studio-paint .tool-group {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  background: #c0c0c0;
  border-top: 1px solid #dfdfdf;
  border-left: 1px solid #dfdfdf;
  border-right: 1px solid #808080;
  border-bottom: 1px solid #808080;
  margin: 2px;
}

.studio-paint .tool-btn {
  width: 24px;
  height: 24px;
  background: #c0c0c0;
  border-top: 1px solid #dfdfdf;
  border-left: 1px solid #dfdfdf;
  border-right: 1px solid #808080;
  border-bottom: 1px solid #808080;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 1px;
  padding: 0;
  color: #000;
}

.studio-paint .tool-btn:hover {
  background: #d4d0c8;
}

.studio-paint .tool-btn.active {
  border-top: 1px solid #808080;
  border-left: 1px solid #808080;
  border-right: 1px solid #dfdfdf;
  border-bottom: 1px solid #dfdfdf;
  background: #a0a0a0;
}

.studio-paint .tool-btn svg {
  width: 12px;
  height: 12px;
}

.studio-paint .brush-size-label {
  font-size: 11px;
  color: #000;
}

.studio-paint .brush-size-slider {
  width: 60px;
  height: 16px;
  background: #c0c0c0;
  border-top: 1px solid #808080;
  border-left: 1px solid #808080;
  border-right: 1px solid #dfdfdf;
  border-bottom: 1px solid #dfdfdf;
  outline: none;
  cursor: pointer;
}

.studio-paint #size-display {
  font-size: 12px;
  font-weight: bold;
  color: #333;
  min-width: 20px;
  text-align: center;
}

.studio-paint .color-palette {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1px;
}

.studio-paint .color-swatch {
  width: 16px;
  height: 16px;
  cursor: pointer;
  border-top: 1px solid #dfdfdf;
  border-left: 1px solid #dfdfdf;
  border-right: 1px solid #808080;
  border-bottom: 1px solid #808080;
  padding: 0;
}

.studio-paint .color-swatch.active {
  border-top: 1px solid #808080;
  border-left: 1px solid #808080;
  border-right: 1px solid #dfdfdf;
  border-bottom: 1px solid #dfdfdf;
}

.studio-paint .action-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  color: #333;
}

.studio-paint .action-btn:hover {
  background: #f0f0f0;
  border-color: #999;
}

.studio-paint .action-btn svg {
  width: 14px;
  height: 14px;
}

.studio-paint .paint-canvas-container {
  flex: 1;
  min-height: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  background: #f8f8f8;
  overflow: auto;
}

.studio-paint canvas {
  background: white;
  border: 2px solid #ccc;
  border-radius: 4px;
  cursor: crosshair;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  touch-action: none;
}

.studio-paint canvas.eraser-cursor {
  cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20'><rect width='16' height='12' x='2' y='4' fill='none' stroke='black' stroke-width='1' rx='2'/></svg>") 10 10, auto;
}

@media (max-width: 640px) {
  .icon-grid {
    grid-template-columns: repeat(3, minmax(0, 108px));
    width: max-content;
    max-width: calc(100vw - 16px);
    gap: 16px 8px;
  }

  .desk-icon {
    width: auto;
  }

  .desk-icon img {
    width: 64px;
    height: 64px;
  }

  .desk-icon span {
    max-width: 7.4em;
    font-size: 13px;
  }

  .window,
  .window.wide,
  .window.compact,
  .window.paint {
    left: 8px !important;
    top: 8px !important;
    width: calc(100vw - 16px);
    height: calc(100vh - 16px);
  }

  .studio-paint .paint-toolbar {
    flex-direction: column;
    align-items: stretch;
    max-height: 132px;
    overflow-y: auto;
  }

  .studio-paint .tool-group {
    flex-wrap: wrap;
    justify-content: center;
  }

  .studio-paint .tool-btn {
    width: 28px;
    height: 28px;
  }

  .studio-paint .color-swatch {
    width: 20px;
    height: 20px;
  }
}

.dino-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(5, 5, 5, 0.85);
  backdrop-filter: blur(8px);
}

.dino-overlay[hidden] {
  display: none;
}

.dino-panel {
  width: min(768px, 100%);
}

.dino-bar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 12px;
}

.dino-bar button {
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.35);
  font-family: "Courier New", monospace;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
}

.dino-bar button:hover {
  color: rgba(255, 255, 255, 0.75);
}

.dino-stage {
  position: relative;
  overflow: hidden;
  background: #f7f7f7;
}

.dino-stage canvas {
  display: block;
  width: 100%;
  height: auto;
  cursor: pointer;
  image-rendering: pixelated;
  touch-action: none;
}

.dino-over {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(247, 247, 247, 0.92);
  color: #535353;
  font-family: "Courier New", monospace;
}

.dino-over[hidden] {
  display: none;
}

.dino-over-title {
  margin: 0 0 4px;
  font-size: 18px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
}

.dino-over-score {
  margin: 0 0 24px;
  color: #2563eb;
  font-size: 40px;
  font-weight: 700;
}

.dino-save {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: min(280px, 100%);
  padding: 0 16px;
}

.dino-save[hidden],
#dino-again[hidden],
#dino-loading[hidden] {
  display: none;
}

.dino-save input {
  width: 100%;
  padding: 8px 0;
  border: 0;
  border-bottom: 2px solid #535353;
  background: transparent;
  color: #535353;
  font-family: "Courier New", monospace;
  font-size: 14px;
  letter-spacing: 0.14em;
  text-align: center;
}

.dino-save input:focus {
  outline: none;
}

.dino-save-actions {
  display: flex;
  gap: 12px;
  width: 100%;
}

.dino-save button,
#dino-again {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid #535353;
  background: #535353;
  color: #f7f7f7;
  font-family: "Courier New", monospace;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
}

#dino-skip {
  background: transparent;
  color: #535353;
}

.dino-save button:disabled {
  opacity: 0.4;
  cursor: default;
}

#dino-again {
  flex: none;
  padding: 8px 32px;
}

.dino-scores {
  margin-top: 16px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.6);
  font-family: "Courier New", monospace;
}

.dino-scores header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.4);
  font-size: 12px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
}

.dino-score-empty,
.dino-score-row {
  padding: 8px 16px;
}

.dino-score-empty {
  margin: 0;
  color: rgba(255, 255, 255, 0.2);
  font-size: 12px;
  text-align: center;
}

.dino-score-row {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 14px;
}

.dino-score-row.is-me {
  background: rgba(37, 99, 235, 0.12);
  color: #fff;
}

.dino-score-row span:first-child {
  width: 24px;
  color: rgba(255, 255, 255, 0.25);
  font-size: 12px;
  text-align: right;
}

.dino-score-row.is-me span:first-child,
.dino-score-row.is-me span:last-child {
  color: #2563eb;
}

.dino-score-row span:nth-child(2) {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dino-score-row span:last-child {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.dino-help {
  margin: 12px 0 0;
  color: rgba(255, 255, 255, 0.2);
  font-family: "Courier New", monospace;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-align: center;
  text-transform: uppercase;
}
