* {
  box-sizing: border-box;
}

:root {
  --panel-bg: rgba(230, 230, 230, 0.92);
  --win-bg: #24262e;
  --win-bar: #2f323d;
  --win-border: rgba(255, 255, 255, 0.10);
  --accent: #f39c12;
  --accent-blue: #4a9eff;
  --text: #eaeaf0;
  --text-dim: #a7a9b5;
  --radius: 12px;
  --mono: 'JetBrains Mono', 'Fira Code', Menlo, monospace;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: var(--mono);
  color: var(--text);
  overflow: hidden;
  background: #1b1d26;
}

button {
  font-family: inherit;
}

.desktop {
  position: relative;
  height: 100vh;
  overflow: hidden;
  background: radial-gradient(1200px 700px at 75% 20%, #3d2b52 0%, transparent 60%),
    radial-gradient(900px 600px at 15% 85%, #123 0%, transparent 65%),
    linear-gradient(160deg, #2a2140 0%, #171a2b 55%, #10131f 100%);
}

.desktop::after {
  content: 'Linux ';
  position: absolute;
  right: 6%;
  bottom: 12%;
  font-size: 190px;
  opacity: 0.07;
  pointer-events: none;
  user-select: none;
}

/* ---------- Верхняя панель ---------- */
.panel {
  position: absolute;
  inset: 0 0 auto 0;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  background: var(--panel-bg);
  backdrop-filter: blur(8px);
  font-size: 13px;
  z-index: 900;
}

.panel__btn {
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  padding: 4px 12px;
  border-radius: 6px;
  cursor: pointer;
}

.panel__btn:hover {
  background: rgba(255, 255, 255, 0.12);
}

.panel__btn--active {
  font-weight: 600;
}

.panel__tray {
  display: flex;
  gap: 12px;
  align-items: center;
  color: var(--text-dim);
}

.panel__icon {
  font-size: 12px;
}

/* ---------- Иконки рабочего стола ---------- */
.desk-icons {
  position: absolute;
  top: 54px;
  left: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 10;
}

.desk-icon {
  width: 88px;
  padding: 10px 4px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.desk-icon:hover {
  background: rgba(74, 158, 255, 0.18);
  border-color: rgba(74, 158, 255, 0.45);
}

.desk-icon__img {
  font-size: 34px;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.5));
}

.desk-icon__label {
  font-size: 12px;
  text-align: center;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
}

/* ---------- Окна ---------- */
.window {
  position: absolute;
  top: var(--y, 80px);
  left: var(--x, 60px);
  width: var(--w, 460px);
  max-width: calc(100vw - 24px);
  max-height: calc(100vh - 110px);
  display: none;
  flex-direction: column;
  background: var(--win-bg);
  border: 1px solid var(--win-border);
  border-radius: var(--radius);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.55);
  overflow: hidden;
  z-index: 100;
}

.window.is-open {
  display: flex;
}

.window.is-focused {
  border-color: rgba(255, 255, 255, 0.22);
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.7);
}

.window.is-max {
  top: 40px !important;
  left: 8px !important;
  width: calc(100vw - 16px) !important;
  height: calc(100vh - 118px) !important;
  max-height: none;
}

.window.is-min {
  display: none;
}

.window__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px 8px 14px;
  background: var(--win-bar);
  border-bottom: 1px solid rgba(0, 0, 0, 0.35);
  cursor: grab;
  user-select: none;
}

.window__bar:active {
  cursor: grabbing;
}

.window__title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.window__controls {
  display: flex;
  gap: 6px;
}

.window__controls button {
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.10);
  color: var(--text);
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
}

.window__controls button:hover {
  background: rgba(255, 255, 255, 0.24);
}

.window__controls button[data-act='close']:hover {
  background: #e04b3a;
}

.window__body {
  padding: 18px;
  overflow: auto;
  font-size: 14px;
  line-height: 1.55;
}

.window__body--flush {
  padding: 0;
}

/* ---------- Обо мне ---------- */
.about {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 12px;
}

.about__avatar {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  font-size: 34px;
  background: linear-gradient(145deg, var(--accent), #c0392b);
  border-radius: 14px;
}

.about__name {
  margin: 0;
  font-size: 22px;
}

.about__role {
  margin: 4px 0 0;
  color: var(--accent);
  font-size: 13px;
}

.about__bio {
  color: var(--text-dim);
  margin: 0 0 14px;
}

.about__facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 0;
}

.about__facts div {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 8px;
  padding: 8px 10px;
}

.about__facts dt {
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.about__facts dd {
  margin: 3px 0 0;
  font-size: 13px;
}

/* ---------- Файлы / контакты ---------- */
.files {
  list-style: none;
  margin: 0;
  padding: 6px;
}

.files__row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 8px;
  font-size: 13.5px;
}

.files__row:hover {
  background: rgba(74, 158, 255, 0.16);
}

.files__row em {
  color: var(--text-dim);
  font-style: normal;
  font-size: 12.5px;
}

.contacts {
  list-style: none;
  margin: 0 0 14px;
  padding: 0;
}

.contacts li {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.09);
  font-size: 14px;
}

.contacts a {
  color: var(--accent-blue);
  text-decoration: none;
}

.contacts a:hover {
  text-decoration: underline;
}

.btn {
  width: 100%;
  padding: 10px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #1a1205;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
}

.btn:hover {
  filter: brightness(1.1);
}

/* ---------- Терминал ---------- */
.window--term {
  background: #14161c;
}

.term {
  height: 320px;
  display: flex;
  flex-direction: column;
  padding: 12px 14px;
  background: #0d0f14;
  font-size: 13px;
  line-height: 1.5;
  overflow: hidden;
}

.term:focus {
  outline: none;
}

.term__out {
  flex: 1;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.term__line--dim {
  color: #7d8194;
}

.term__line--accent {
  color: #58d66b;
}

.term__line--warn {
  color: var(--accent);
}

.term__line--err {
  color: #ff6b5e;
}

.term__row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}

.term__prompt {
  color: #58d66b;
  white-space: nowrap;
}

.term__input {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  outline: none;
}

/* ---------- Док ---------- */
.dock {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(20, 21, 28, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 18px;
  backdrop-filter: blur(10px);
  z-index: 800;
}

.dock__app {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  font-size: 22px;
  cursor: pointer;
  transition: transform 0.15s, background 0.15s;
  position: relative;
}

.dock__app:hover {
  background: rgba(255, 255, 255, 0.18);
  transform: translateY(-5px);
}

.dock__app.is-running::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 3px;
  width: 5px;
  height: 5px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: var(--accent);
}

.dock__sep {
  width: 1px;
  height: 30px;
  background: rgba(255, 255, 255, 0.16);
}

/* ---------- Обзор ---------- */
.overview {
  position: absolute;
  inset: 34px 0 0 0;
  background: rgba(10, 11, 16, 0.93);
  backdrop-filter: blur(14px);
  z-index: 950;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 26px;
  padding: 44px 20px;
}

.overview[hidden] {
  display: none;
}

.overview__search input {
  width: min(420px, 80vw);
  padding: 11px 18px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  text-align: center;
  outline: none;
}

.overview__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, 120px);
  gap: 22px;
  justify-content: center;
  max-width: 640px;
}

.overview__grid button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 16px 8px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
}

.overview__grid button:hover {
  background: rgba(255, 255, 255, 0.10);
  border-color: rgba(255, 255, 255, 0.16);
}

.overview__grid button span {
  font-size: 44px;
}

.overview__close {
  padding: 10px 22px;
  border: 0;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.12);
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
}

.overview__close:hover {
  background: rgba(255, 255, 255, 0.22);
}

/* ---------- Тост ---------- */
.toast {
  position: absolute;
  bottom: 84px;
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 18px;
  background: rgba(20, 21, 28, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  font-size: 13px;
  z-index: 980;
  animation: toast-in 0.25s ease;
}

.toast[hidden] {
  display: none;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translate(-50%, 8px);
  }
}

/* ---------- Мобильные ---------- */
@media (max-width: 720px) {
  .desk-icons {
    flex-direction: row;
    flex-wrap: wrap;
    right: 12px;
  }

  .window {
    --x: 12px !important;
    width: calc(100vw - 24px) !important;
  }

  .about__facts {
    grid-template-columns: 1fr;
  }

  .desktop::after {
    font-size: 110px;
  }
}
