:root {
  --os-text: rgba(248, 251, 255, 0.96);
  --os-dim: rgba(223, 233, 250, 0.8);
  --os-shadow: 0 26px 56px rgba(5, 9, 20, 0.44);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  font-family: "SF Pro Display", "SF Pro Text", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  color: var(--os-text);
}

body.os-page {
  position: relative;
  background:
    radial-gradient(130% 78% at 12% 10%, rgba(164, 205, 255, 0.48), transparent 50%),
    radial-gradient(88% 66% at 90% 84%, rgba(103, 182, 255, 0.3), transparent 58%),
    linear-gradient(152deg, #0d1529 0%, #183058 35%, #0f203f 65%, #091326 100%);
}

body.os-page::before,
body.os-page::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  filter: blur(54px);
  opacity: 0.8;
  pointer-events: none;
  z-index: 0;
}

body.os-page::before {
  width: 34vw;
  height: 34vw;
  min-width: 320px;
  min-height: 320px;
  top: -14vw;
  left: -8vw;
  background: radial-gradient(circle, rgba(195, 232, 255, 0.7), rgba(155, 212, 255, 0.28) 55%, transparent 75%);
  animation: osDriftA 20s ease-in-out infinite alternate;
}

body.os-page::after {
  width: 30vw;
  height: 30vw;
  min-width: 280px;
  min-height: 280px;
  right: -6vw;
  bottom: -10vw;
  background: radial-gradient(circle, rgba(95, 186, 255, 0.52), rgba(126, 188, 255, 0.16) 58%, transparent 78%);
  animation: osDriftB 22s ease-in-out infinite alternate;
}

body.os-theme-midnight {
  background:
    radial-gradient(130% 76% at 10% 10%, rgba(103, 149, 236, 0.36), transparent 52%),
    radial-gradient(85% 65% at 88% 84%, rgba(90, 132, 220, 0.24), transparent 58%),
    linear-gradient(150deg, #060b16 0%, #0f1a31 38%, #0a1428 65%, #071024 100%);
}

body.os-theme-frost {
  background:
    radial-gradient(130% 76% at 10% 10%, rgba(246, 252, 255, 0.36), transparent 52%),
    radial-gradient(85% 65% at 88% 84%, rgba(201, 224, 255, 0.3), transparent 60%),
    linear-gradient(152deg, #50637e 0%, #516f92 40%, #3a5674 68%, #2f4a66 100%);
}

@keyframes osDriftA {
  0% { transform: translate(0, 0); }
  100% { transform: translate(4vw, 3vh); }
}

@keyframes osDriftB {
  0% { transform: translate(0, 0); }
  100% { transform: translate(-4vw, -3vh); }
}

.os-root {
  position: relative;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.os-boot,
.os-setup {
  position: absolute;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  background:
    radial-gradient(120% 75% at 14% 12%, rgba(176, 220, 255, 0.33), transparent 52%),
    radial-gradient(90% 68% at 84% 84%, rgba(136, 197, 255, 0.26), transparent 58%),
    linear-gradient(146deg, #0a1326 0%, #10213f 54%, #0a1326 100%);
}

.os-boot.hidden,
.os-setup.hidden {
  display: none;
}

.os-boot-wrap {
  width: min(420px, 90vw);
  display: grid;
  justify-items: center;
  gap: 18px;
}

.os-boot-logo {
  width: 116px;
  height: 116px;
  border-radius: 32px;
  border: 1px solid rgba(255, 255, 255, 0.52);
  background:
    linear-gradient(165deg, rgba(255, 255, 255, 0.86), rgba(203, 229, 255, 0.42)),
    radial-gradient(circle at 24% 14%, rgba(255, 255, 255, 0.94), transparent 58%);
  color: rgba(8, 17, 35, 0.9);
  display: grid;
  place-items: center;
  box-shadow: var(--os-shadow);
  overflow: hidden;
}

.os-boot-logo img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  image-rendering: -webkit-optimize-contrast;
}

.os-boot-title {
  font-size: 24px;
  letter-spacing: 0.02em;
  font-weight: 500;
}

.os-boot-progress {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  background: rgba(255, 255, 255, 0.13);
  overflow: hidden;
}

.os-boot-bar {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #b9d5ff, #f2f8ff);
  box-shadow: 0 0 19px rgba(233, 245, 255, 0.74);
  animation: osBootFill 5s linear forwards;
}

.os-boot-note {
  font-size: 12px;
  text-transform: lowercase;
  letter-spacing: 0.08em;
  color: var(--os-dim);
}

@keyframes osBootFill {
  from { width: 0%; }
  to { width: 100%; }
}

.os-setup-card {
  width: min(760px, 92vw);
  border-radius: 26px;
  border: 1px solid rgba(255, 255, 255, 0.37);
  background:
    linear-gradient(172deg, rgba(255, 255, 255, 0.36), rgba(255, 255, 255, 0.11)),
    rgba(16, 24, 42, 0.55);
  backdrop-filter: blur(26px) saturate(1.22);
  box-shadow: var(--os-shadow);
  overflow: hidden;
}

.os-setup-head {
  padding: 18px 24px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.22);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.os-setup-head h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 500;
}

.os-setup-step {
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--os-dim);
  text-transform: lowercase;
}

.os-setup-body {
  padding: 22px 24px 18px;
  min-height: 300px;
  display: grid;
  gap: 14px;
  align-content: start;
}

.os-setup-pane {
  display: none;
  gap: 12px;
}

.os-setup-pane.active {
  display: grid;
}

.os-setup-pane h2 {
  margin: 0;
  font-size: 30px;
  font-weight: 500;
}

.os-setup-pane p {
  margin: 0;
  color: var(--os-dim);
  line-height: 1.6;
  font-size: 14px;
}

.os-option-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.os-option {
  border: 1px solid rgba(255, 255, 255, 0.33);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.13);
  color: var(--os-text);
  min-height: 88px;
  text-align: left;
  padding: 10px;
  cursor: pointer;
}

.os-option.active,
.os-option:hover {
  border-color: rgba(255, 255, 255, 0.64);
  background: rgba(255, 255, 255, 0.25);
}

.os-option strong {
  display: block;
  font-size: 13px;
  margin-bottom: 6px;
}

.os-option span {
  font-size: 11px;
  color: rgba(237, 244, 255, 0.88);
}

.os-setup-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.os-input {
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.15);
  color: var(--os-text);
  padding: 10px 12px;
  font-size: 14px;
  outline: none;
}

.os-input::placeholder {
  color: rgba(236, 245, 255, 0.76);
}

.os-setup-actions {
  padding: 0 24px 20px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.os-btn {
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.36);
  background: rgba(255, 255, 255, 0.16);
  color: var(--os-text);
  font-size: 12px;
  letter-spacing: 0.07em;
  text-transform: lowercase;
  padding: 10px 16px;
  cursor: pointer;
}

.os-btn.primary {
  background: linear-gradient(180deg, rgba(228, 240, 255, 0.95), rgba(183, 212, 255, 0.92));
  color: #101c32;
  border-color: rgba(235, 244, 255, 0.95);
  font-weight: 600;
}

.os-btn:disabled {
  opacity: 0.52;
  cursor: not-allowed;
}

.os-desktop {
  position: absolute;
  inset: 0;
  display: none;
}

.os-desktop.active {
  display: block;
}

.os-menubar {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  height: 39px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  background:
    linear-gradient(177deg, rgba(255, 255, 255, 0.52), rgba(255, 255, 255, 0.17)),
    rgba(20, 26, 42, 0.2);
  backdrop-filter: blur(20px) saturate(1.2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  box-shadow: 0 12px 28px rgba(6, 10, 22, 0.35);
  z-index: 20;
}

.os-menu-group {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.os-brand {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: lowercase;
  font-weight: 600;
}

.os-menu-link {
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.33);
  background: rgba(10, 16, 31, 0.24);
  color: var(--os-text);
  text-decoration: none;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: lowercase;
  padding: 6px 10px;
}

.os-main {
  position: absolute;
  inset: 58px 12px 86px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.03)),
    rgba(8, 13, 25, 0.33);
  overflow: hidden;
  box-shadow: var(--os-shadow);
}

.os-main::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 32px 32px;
  opacity: 0.2;
  pointer-events: none;
}

.os-window {
  position: absolute;
  left: 14px;
  right: 14px;
  top: 14px;
  bottom: 14px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.29);
  background: rgba(12, 19, 34, 0.45);
  backdrop-filter: blur(22px) saturate(1.14);
  overflow: hidden;
  display: grid;
  grid-template-rows: 42px 1fr;
}

.os-window-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.17), rgba(255, 255, 255, 0.04));
}

.os-traffic {
  display: flex;
  gap: 6px;
}

.os-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.26);
}

.os-dot.red { background: #ff5f56; }
.os-dot.yellow { background: #ffbd2e; }
.os-dot.green { background: #27c93f; }

.os-window-title {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: lowercase;
  color: rgba(246, 250, 255, 0.94);
}

.os-window-tools {
  display: flex;
  gap: 6px;
}

.os-tool {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.16);
  color: var(--os-text);
  display: grid;
  place-items: center;
  font-size: 14px;
  text-decoration: none;
  cursor: pointer;
}

.os-frame {
  width: 100%;
  height: 100%;
  border: 0;
  background: rgba(7, 11, 20, 0.86);
}

.os-dock {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  max-width: min(96vw, 980px);
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 11px 13px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.41);
  background:
    linear-gradient(178deg, rgba(255, 255, 255, 0.46), rgba(255, 255, 255, 0.13)),
    rgba(16, 23, 38, 0.26);
  backdrop-filter: blur(26px) saturate(1.24);
  box-shadow: var(--os-shadow);
  overflow-x: auto;
  scrollbar-width: none;
  z-index: 25;
}

.os-dock::-webkit-scrollbar {
  display: none;
}

.os-dock-item {
  position: relative;
  width: 53px;
  height: 53px;
  border-radius: 15px;
  border: 1px solid rgba(255, 255, 255, 0.44);
  color: rgba(246, 251, 255, 0.98);
  text-decoration: none;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  transition: transform 0.1s linear;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.os-dock-item:nth-child(1) { background: linear-gradient(170deg, #4f9bff, #366ce3); }
.os-dock-item:nth-child(2) { background: linear-gradient(170deg, #41c8ff, #2777f0); }
.os-dock-item:nth-child(3) { background: linear-gradient(170deg, #72ce6d, #3aa74f); }
.os-dock-item:nth-child(4) { background: linear-gradient(170deg, #77b5ff, #4c78f4); }
.os-dock-item:nth-child(5) { background: linear-gradient(170deg, #ff7d6f, #e95447); }
.os-dock-item:nth-child(6) { background: linear-gradient(170deg, #ba7cff, #8553f3); }
.os-dock-item:nth-child(7) { background: linear-gradient(170deg, #808ca4, #5f6d8b); }
.os-dock-item:nth-child(8) { background: linear-gradient(170deg, #95a8c3, #6b85a7); }

.os-dock-item .material-icons {
  font-size: 26px;
  text-shadow: 0 2px 6px rgba(2, 8, 18, 0.45);
}

.os-dock-item.active {
  border-color: rgba(255, 255, 255, 0.9);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.42),
    0 10px 22px rgba(5, 10, 22, 0.35);
}

.os-dock-item.active::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -9px;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: rgba(245, 250, 255, 0.95);
  transform: translateX(-50%);
}

.os-launchpad {
  position: absolute;
  inset: 0;
  display: none;
  place-items: center;
  z-index: 35;
  background: rgba(6, 10, 18, 0.72);
  backdrop-filter: blur(16px);
}

.os-launchpad.active {
  display: grid;
}

.os-launchpad-panel {
  width: min(760px, 92vw);
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  background:
    linear-gradient(170deg, rgba(255, 255, 255, 0.25), rgba(255, 255, 255, 0.08)),
    rgba(16, 23, 38, 0.57);
  backdrop-filter: blur(24px);
  box-shadow: var(--os-shadow);
  padding: 16px;
}

.os-launchpad-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.os-launchpad-top h3 {
  margin: 0;
  font-size: 13px;
  letter-spacing: 0.09em;
  text-transform: lowercase;
  font-weight: 500;
}

.os-launchpad-close {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  background: rgba(255, 255, 255, 0.16);
  color: var(--os-text);
  display: grid;
  place-items: center;
  cursor: pointer;
}

.os-launchpad-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.os-launchpad-app {
  border-radius: 13px;
  border: 1px solid rgba(255, 255, 255, 0.31);
  background: rgba(255, 255, 255, 0.14);
  text-decoration: none;
  color: var(--os-text);
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 12px 8px;
}

.os-launchpad-app .material-icons {
  font-size: 24px;
}

.os-launchpad-app span:last-child {
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: lowercase;
}

.os-launchpad-app.active {
  border-color: rgba(255, 255, 255, 0.76);
  background: rgba(255, 255, 255, 0.26);
}

@media (max-width: 920px) {
  .os-option-grid,
  .os-setup-row,
  .os-launchpad-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .os-main {
    inset: 56px 8px 84px;
  }

  .os-menu-link.hide-mobile {
    display: none;
  }
}
