/* «Проекты пользователей»: a desktop with project windows (drag, resize, close) and a dock. */
.pc-desktop, .pc-desktop * { box-sizing: border-box; }

/* The desktop fills one screen. Window widths use --u, the smaller of 1vw and the height share of a 16:10 screen,
   so the curated layout keeps its proportions on wide and on short displays alike. */
.pc-desktop {
  --window-radius: 14px;
  --bar: 34px;
  position: relative;
  height: 100vh;
  height: 100svh;
  min-height: 560px;
  --u: min(1vw, 1.6svh);
  /* The same white as the rest of the landing; only a faint dot grid says «desktop». */
  background:
    radial-gradient(circle at 1px 1px, rgba(20, 20, 20, .075) 1px, transparent 0) 0 0 / 22px 22px,
    var(--paper);
  overflow: hidden;
  touch-action: pan-y;
}


.pc-windows { position: absolute; inset: 0; }

.pc-window {
  position: absolute;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border: 1px solid rgba(20, 20, 20, .12);
  border-radius: var(--window-radius);
  box-shadow: 0 1px 2px rgba(20, 20, 20, .06), 0 14px 34px rgba(20, 20, 20, .10);
  transition: box-shadow .2s ease, transform .2s ease, opacity .2s ease;
}
.pc-window.is-active {
  box-shadow: 0 1px 2px rgba(20, 20, 20, .08), 0 28px 70px rgba(20, 20, 20, .20);
}
.pc-window.is-dragging { transition: none; cursor: grabbing; }
.pc-window.is-dragging .pc-screen { cursor: grabbing; }
.pc-window.is-closed { opacity: 0; transform: scale(.94); pointer-events: none; visibility: hidden; transition: opacity .15s ease, transform .15s ease, visibility 0s .15s; }
.pc-window.is-resizing { transition: none; user-select: none; }
.pc-window.is-opening { animation: pc-open .32s cubic-bezier(.2, .9, .3, 1.2) both; }
@keyframes pc-open { from { opacity: 0; transform: scale(.9) translateY(12px); } }

/* A window with an explicit height (resized): the picture fills whatever space is left. */
.pc-window.is-sized .pc-screen { aspect-ratio: auto; flex: 1 1 auto; min-height: 0; }
.pc-window.is-sized .pc-note-body { overflow: auto; }

.pc-resize { position: absolute; z-index: 2; touch-action: none; }
.pc-resize-e { top: var(--bar); right: -4px; bottom: 12px; width: 10px; cursor: ew-resize; }
.pc-resize-s { left: 12px; right: 12px; bottom: -4px; height: 10px; cursor: ns-resize; }
.pc-resize-se { right: -4px; bottom: -4px; width: 18px; height: 18px; cursor: nwse-resize; }

.pc-window.is-pinged { animation: pc-ping .5s ease; }
@keyframes pc-ping { 40% { transform: scale(1.025); } }

/* The window itself does not clip, so the resize handles can reach past its rounded corner. */
.pc-titlebar {
  border-radius: calc(var(--window-radius) - 1px) calc(var(--window-radius) - 1px) 0 0;
  height: var(--bar);
  font-size: clamp(12px, .95vw, 14px);
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px 0 12px;
  border-bottom: 1px solid var(--line);
  background: #fbfbfa;
  cursor: grab;
  user-select: none;
  white-space: nowrap;
}
/* macOS traffic lights. Only the red one closes the window; yellow and green are there for the look. */
.pc-dots { display: inline-flex; gap: 8px; margin-right: 6px; }
.pc-dots button, .pc-dots i {
  position: relative;
  width: 12px;
  height: 12px;
  padding: 0;
  border-radius: 50%;
  box-shadow: inset 0 0 0 .5px rgba(0, 0, 0, .18);
}
.pc-dots button { border: 0; background: #ff5f57; cursor: pointer; color: transparent; font: 700 10px/1 Inter, sans-serif; }
.pc-light-min { background: #febc2e; }
.pc-light-max { background: #28c840; }
.pc-dots button::before { content: "×"; position: absolute; inset: 0; display: grid; place-items: center; font-size: 11px; }
.pc-dots:hover button { color: #7a0d06; }
.pc-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 0 1 auto; }
.pc-chip {
  flex: none;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--muted);
  font-size: 11px;
}
.pc-open {
  margin-left: auto;
  flex: none;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  color: var(--ink);
  text-decoration: none;
}
.pc-open:hover { background: var(--soft); }

.pc-screen { display: block; aspect-ratio: 16 / 10; overflow: hidden; background: #0b0b0b; border-radius: 0 0 calc(var(--window-radius) - 1px) calc(var(--window-radius) - 1px); }

.pc-screen img { width: 100%; height: 100%; object-fit: cover; object-position: top center; display: block; }

.pc-note { background: #fffdf5; }
.pc-note .pc-titlebar { background: #fbf8ec; }
.pc-note-body { padding: clamp(16px, 1.6vw, 26px); }
.pc-note-body h2 {
  margin: 0;
  font-size: clamp(24px, 2.5vw, 42px);
  font-weight: 580;
  letter-spacing: -.035em;
  line-height: 1;
}
.pc-note-body p { margin: 12px 0 0; color: #6f6f6b; font-size: clamp(13px, 1.05vw, 16px); line-height: 1.45; }

/* Easter egg: everything closed. Cody leans in from the bottom and offers to build something. */
.pc-empty {
  position: absolute;
  left: 50%;
  bottom: 96px;
  transform: translateX(-50%);
  display: flex;
  align-items: flex-end;
  gap: 18px;
  z-index: 900;
  animation: pc-empty-in .5s cubic-bezier(.2, .9, .3, 1.15) both;
}
.pc-empty[hidden] { display: none; }
@keyframes pc-empty-in { from { opacity: 0; transform: translate(-50%, 60px); } }
.pc-empty img { width: clamp(170px, 17vw, 250px); filter: drop-shadow(0 12px 24px rgba(20, 20, 20, .12)); height: auto; animation: pc-wave 2.4s ease-in-out infinite; transform-origin: 50% 100%; }
@keyframes pc-wave { 50% { transform: rotate(-3deg) translateY(-4px); } }
.pc-empty-bubble {
  position: relative;
  max-width: 360px;
  margin-bottom: clamp(90px, 9vw, 140px);
  padding: 18px 20px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px 18px 18px 4px;
  box-shadow: 0 18px 44px rgba(20, 20, 20, .12);
}
.pc-empty-bubble p { margin: 0; font-size: 15px; line-height: 1.45; color: #5f5f5b; }
.pc-empty-bubble .pc-empty-title { margin-bottom: 6px; font-size: 19px; font-weight: 600; letter-spacing: -.01em; color: var(--ink); }
.pc-empty-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.pc-empty-actions a, .pc-empty-actions button {
  padding: 10px 14px;
  border-radius: 999px;
  font: 600 14px/1 Inter, sans-serif;
  text-decoration: none;
  cursor: pointer;
}
.pc-empty-primary { background: var(--ink); color: #fff; }
.pc-empty-actions button { border: 1px solid var(--line); background: var(--paper); color: var(--ink); }

/* On the desktop the window title says enough; the caption is for the phone stack. */
.pc-caption { display: none; }

.pc-dock {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  padding: 8px;
  border-radius: 20px;
  background: rgba(255, 255, 255, .72);
  backdrop-filter: blur(14px);
  border: 1px solid var(--line);
  box-shadow: 0 10px 30px rgba(20, 20, 20, .10);
  z-index: 1001;
}
.pc-dock button {
  position: relative;
  width: clamp(44px, 3.6vw, 58px);
  height: clamp(44px, 3.6vw, 58px);
  padding: 0;
  border: 0;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  background: var(--soft);
  transition: transform .18s ease;
}
.pc-dock button img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pc-dock button { overflow: visible; }
.pc-dock button img, .pc-dock-note span { border-radius: 12px; }
.pc-dock button::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -6px;
  width: 4px;
  height: 4px;
  margin-left: -2px;
  border-radius: 50%;
  background: var(--ink);
  opacity: 0;
}
.pc-dock button.is-open::after { opacity: .7; }
.pc-dock-note span {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  background: #fffdf5;
  border: 1px solid #ece6cf;
  font-weight: 600;
  font-size: 17px;
  color: var(--ink);
}
.pc-dock-sep { width: 1px; align-self: stretch; margin: 4px 2px; background: var(--line); }
.pc-dock button:hover { transform: translateY(-6px) scale(1.12); }
.pc-dock button:not(.is-open) img, .pc-dock button:not(.is-open) span { opacity: .55; }

/* Phones: an ordinary section, no desktop. README becomes the heading, each window a plain card: the screenshot,
   the name with its type, a caption; the whole card opens the project. The heading is centred like the other section
   headings; type and margins follow the product blocks below (.technical), so the two read as one page. */
@media (max-width: 760px) {
  .pc-desktop { height: auto; min-height: 0; padding: 32px 16px 0; background: var(--paper); overflow: visible; touch-action: auto; }
  .pc-windows { position: static; display: grid; gap: 48px; }
  .pc-window { position: relative !important; left: auto !important; top: auto !important; width: auto !important; height: auto !important; background: none; border: 0; border-radius: 0; box-shadow: none; }
  .pc-window.is-active { box-shadow: none; }
  .pc-window.is-closed { opacity: 1; transform: none; pointer-events: auto; visibility: visible; }
  .pc-dots, .pc-resize, .pc-dock, .pc-empty { display: none; }

  .pc-note .pc-titlebar { display: none; }
  .pc-note-body { padding: 0; text-align: center; }
  .pc-note-body h2 { font-size: var(--heading-section); font-weight: 520; line-height: 1.02; letter-spacing: -.035em; }
  .pc-note-body p { max-width: 340px; margin: 16px auto 0; color: var(--text); font-size: 16px; line-height: 1.55; text-wrap: balance; }

  .pc-screen { order: -1; border-radius: 16px; box-shadow: 0 0 0 1px rgba(20, 20, 20, .08); }
  .pc-titlebar { height: auto; margin-top: 18px; padding: 0; flex-wrap: wrap; gap: 6px 10px; border: 0; border-radius: 0; background: none; cursor: default; white-space: normal; }
  .pc-title { font-size: 30px; font-weight: 520; line-height: 1.05; letter-spacing: -.045em; overflow: visible; }
  .pc-chip { font-size: 12px; }
  /* The ↗ link stretches over the whole card. */
  .pc-open { position: static; width: auto; height: auto; font-size: 0; }
  .pc-open::after { content: ""; position: absolute; inset: 0; }
  .pc-caption { display: block; margin: 12px 0 0; padding: 0; color: var(--text); font-size: 16px; line-height: 1.55; }
}

@media (prefers-reduced-motion: reduce) {
  .pc-window, .pc-screen img, .pc-dock button { transition: none; }
  .pc-window.is-pinged { animation: none; }
}
