:root {
  --white: var(--ri-ivory-50);
  --paper: var(--ri-surface-light);
  --black: var(--ri-noir-950);
  --ink: var(--ri-text-on-light);
  --smoke: var(--ri-text-muted-light);
  --line: var(--ri-border-light);
  --champagne: var(--ri-champagne-500);
  --sans: var(--ri-font-ui);
  --serif: var(--ri-font-display);
  --ease: var(--ri-ease-luxury);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  background: var(--white);
}

body {
  color: var(--ink);
  font-family: var(--ri-font-ui);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

button {
  color: inherit;
  font: inherit;
  -webkit-tap-highlight-color: transparent;
}

.desktop {
  position: relative;
  width: 100%;
  height: 100svh;
  overflow: hidden;
  background: var(--white);
  user-select: none;
}

.desktop-icon {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 150px;
  padding: 9px 6px 8px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  cursor: default;
  touch-action: none;
  transform: translate(-50%, -50%);
}

.desktop-icon:focus-visible {
  outline: 3px solid var(--ri-signal-blue);
  outline-offset: 3px;
}

.desktop-icon.is-selected {
  background: rgba(28, 102, 218, .08);
}

.desktop-icon.is-dragging {
  cursor: grabbing;
  opacity: .88;
  transform: scale(1.025);
}

.desktop-icon__art {
  position: relative;
  display: block;
  width: 92px;
  height: 92px;
  overflow: hidden;
  border-radius: 22px;
  background:
    linear-gradient(145deg, #f9f9f8 0%, #e3e2df 48%, #c9c7c2 100%);
  box-shadow:
    0 18px 32px rgba(0, 0, 0, .14),
    0 4px 9px rgba(0, 0, 0, .10),
    0 1px 0 rgba(255, 255, 255, .95) inset;
}

.desktop-icon__art::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(145deg, rgba(255, 255, 255, .52), transparent 42%);
  pointer-events: none;
}

.desktop-icon__arrow {
  position: absolute;
  z-index: 2;
  top: 20px;
  left: 44px;
  width: 4px;
  height: 37px;
  border-radius: 3px;
  background: #171717;
}

.desktop-icon__arrow::after {
  content: "";
  position: absolute;
  left: -9px;
  bottom: -1px;
  width: 18px;
  height: 18px;
  border-right: 4px solid #171717;
  border-bottom: 4px solid #171717;
  border-radius: 2px;
  transform: rotate(45deg);
}

.desktop-icon__drive {
  position: absolute;
  z-index: 1;
  left: 23px;
  bottom: 17px;
  width: 46px;
  height: 16px;
  border-radius: 5px 5px 7px 7px;
  background: #171717;
  box-shadow: 0 2px 3px rgba(0, 0, 0, .22);
}

.desktop-icon__drive::after {
  content: "";
  position: absolute;
  right: 7px;
  top: 6px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #b7aa92;
}

.desktop-icon__label {
  max-width: 140px;
  margin-top: 11px;
  padding: 3px 7px 4px;
  border-radius: 5px;
  color: #161616;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.25;
  text-align: center;
  white-space: normal;
}

.desktop-icon.is-selected .desktop-icon__label {
  color: #fff;
  background: var(--ri-signal-blue);
}

.install-hint {
  position: absolute;
  z-index: 3;
  top: 50%;
  left: calc(50% + 110px);
  display: flex;
  align-items: center;
  gap: 14px;
  visibility: hidden;
  margin: -8px 0 0;
  opacity: 0;
  transform: translateX(-8px);
  transition: opacity .7s ease, transform .8s var(--ease), visibility .7s;
  pointer-events: none;
}

.install-hint.is-visible {
  visibility: visible;
  opacity: 1;
  transform: none;
}

.install-hint i {
  position: relative;
  display: block;
  width: 48px;
  height: 1px;
  background: #b9b6b0;
}

.install-hint i::before {
  content: "";
  position: absolute;
  left: -2px;
  top: -4px;
  width: 8px;
  height: 8px;
  border-left: 1px solid #99958e;
  border-bottom: 1px solid #99958e;
  transform: rotate(45deg);
}

.install-hint p {
  margin: 0;
  color: #6d6962;
  font-family: var(--serif);
  font-size: 15px;
  font-style: italic;
  white-space: nowrap;
}

.installer {
  position: fixed;
  z-index: 20;
  inset: 0;
  display: grid;
  place-items: center;
  visibility: hidden;
  opacity: 0;
  transition: visibility .45s, opacity .45s ease;
}

.installer__backdrop {
  position: absolute;
  inset: 0;
  opacity: 0;
  background: rgba(248, 248, 247, .72);
  backdrop-filter: blur(20px) saturate(.75);
  -webkit-backdrop-filter: blur(20px) saturate(.75);
  transition: opacity .6s ease;
}

.is-installing .installer {
  visibility: visible;
  opacity: 1;
}

.is-installing .installer__backdrop {
  opacity: 1;
}

.is-minimized .installer {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.installer__window {
  position: relative;
  display: grid;
  grid-template-columns: 35% 65%;
  width: min(900px, calc(100vw - 72px));
  height: min(580px, calc(100svh - 72px));
  min-height: 500px;
  overflow: hidden;
  border: 1px solid rgba(20, 20, 20, .12);
  border-radius: var(--ri-radius-window);
  background: var(--paper);
  box-shadow:
    0 48px 120px rgba(0, 0, 0, .20),
    0 12px 32px rgba(0, 0, 0, .09),
    0 1px 0 rgba(255, 255, 255, .85) inset;
  opacity: 0;
  transform: translateY(38px) scale(.72);
  filter: blur(10px);
}

.is-installing:not(.is-minimized) .installer__window {
  animation: installer-open 1.05s var(--ease) both;
}

.installer__window.is-window-dragging {
  animation: none !important;
  opacity: 1;
  transform: none;
  filter: none;
  transition: none;
}

.is-maximized .installer__window {
  width: calc(100vw - 24px);
  height: calc(100svh - 24px);
  max-width: none;
  max-height: none;
  border-radius: 16px;
  transition: width .55s var(--ease), height .55s var(--ease), border-radius .55s var(--ease);
}

.installer__visual {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 24px 27px 28px;
  overflow: hidden;
  color: #f1eee7;
  background:
    radial-gradient(circle at 23% 13%, #3a3937 0, #171717 29%, #070707 73%);
  cursor: grab;
  touch-action: none;
}

.installer__visual:active {
  cursor: grabbing;
}

.installer__visual::after {
  content: "";
  position: absolute;
  top: 13%;
  right: -72%;
  width: 140%;
  aspect-ratio: 1;
  border: 1px solid rgba(185, 180, 170, .15);
  border-radius: 50%;
}

.installer__controls {
  display: flex;
  position: relative;
  z-index: 3;
  gap: 9px;
  width: fit-content;
}

.window-control {
  position: relative;
  display: grid;
  place-items: center;
  width: 13px;
  height: 13px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
}

.window-control--close {
  background: #d66b5d;
}

.window-control--minimize {
  background: #d5a94d;
}

.window-control--maximize {
  background: #65a65d;
}

.window-control i,
.window-control i::before {
  position: absolute;
  display: block;
  opacity: 0;
  content: "";
  transition: opacity .15s ease;
}

.installer__controls:hover .window-control i,
.installer__controls:focus-within .window-control i,
.installer__controls:hover .window-control i::before,
.installer__controls:focus-within .window-control i::before {
  opacity: .72;
}

.window-control--close i,
.window-control--close i::before {
  width: 7px;
  height: 1px;
  background: #5f1d15;
}

.window-control--close i {
  transform: rotate(45deg);
}

.window-control--close i::before {
  transform: rotate(90deg);
}

.window-control--minimize i {
  width: 7px;
  height: 1px;
  background: #66490b;
}

.window-control--maximize i {
  width: 6px;
  height: 6px;
  border: 1px solid #1e571b;
}

.window-control:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

.installer__identity {
  position: relative;
  z-index: 2;
}

.installer__identity p {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(58px, 6vw, 82px);
  letter-spacing: -.09em;
  line-height: .9;
}

.installer__identity p span {
  color: var(--champagne);
}

.installer__rule {
  width: 58px;
  height: 1px;
  margin: 25px 0 18px;
  background: var(--champagne);
}

.installer__identity > span,
.installer__serial {
  color: rgba(241, 238, 231, .58);
  font-size: 12px;
  letter-spacing: .16em;
}

.installer__serial {
  position: relative;
  z-index: 2;
  margin: 0;
}

.installer__content {
  display: flex;
  flex-direction: column;
  padding: clamp(42px, 5vw, 66px);
}

.installer__eyebrow {
  margin: 0;
  color: var(--champagne);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: var(--ri-tracking-label);
}

.installer__copy {
  margin-top: auto;
}

.installer__copy h1 {
  margin: 0;
  color: var(--ink);
  font-family: var(--serif);
  font-size: clamp(48px, 5vw, 68px);
  font-weight: 400;
  letter-spacing: -.045em;
  line-height: .98;
}

.installer__description {
  max-width: 460px;
  margin: 27px 0 0;
  color: var(--smoke);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
}

.installation {
  margin-top: auto;
}

.installation__status {
  display: flex;
  justify-content: space-between;
  gap: 22px;
}

.installation__status p {
  margin: 0;
  color: #393733;
  font-size: 14px;
  line-height: 1.45;
}

.installation__status p:last-child {
  color: var(--smoke);
  font-variant-numeric: tabular-nums;
}

.installation__track {
  height: 3px;
  margin-top: 15px;
  overflow: hidden;
  background: #dedbd5;
}

.installation__track i {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--ri-noir-800), var(--ri-champagne-500));
  transition: width .25s linear;
}

.installation__detail {
  min-height: 20px;
  margin: 13px 0 0;
  color: #827e77;
  font-size: 13px;
  line-height: 1.5;
}

.installer__enter {
  align-items: center;
  align-self: flex-end;
  justify-content: space-between;
  width: 190px;
  margin-top: 24px;
  padding: 12px 0;
  border: 0;
  border-bottom: 1px solid var(--ink);
  background: transparent;
  font-size: 12px;
  letter-spacing: .11em;
  text-transform: uppercase;
  cursor: pointer;
}

.installer__enter:not([hidden]) {
  display: flex;
  animation: enter-action .7s var(--ease) both;
}

.installer__enter i {
  font-size: 19px;
  font-style: normal;
  transition: transform .3s var(--ease);
}

.installer__enter:hover i,
.installer__enter:focus-visible i {
  transform: translateX(5px);
}

.installer__enter:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 4px;
}

.noscript {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  margin: 0;
  padding: 30px;
  background: #fff;
  font: 18px/1.5 var(--serif);
  text-align: center;
}

@keyframes installer-open {
  0% {
    opacity: 0;
    transform: translateY(38px) scale(.72);
    filter: blur(10px);
  }
  62% {
    opacity: 1;
    transform: translateY(-3px) scale(1.012);
    filter: blur(0);
  }
  100% {
    opacity: 1;
    transform: none;
    filter: none;
  }
}

@keyframes enter-action {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

@media (max-width: 700px) {
  .desktop-icon {
    top: 50%;
    left: 50%;
    width: 142px;
  }

  .desktop-icon__art {
    width: 84px;
    height: 84px;
    border-radius: 20px;
  }

  .desktop-icon__arrow {
    top: 18px;
    left: 40px;
    height: 33px;
  }

  .desktop-icon__drive {
    left: 21px;
    bottom: 15px;
    width: 42px;
  }

  .desktop-icon__label {
    font-size: 15px;
  }

  .install-hint {
    top: calc(50% + 104px);
    left: 50%;
    flex-direction: column;
    gap: 11px;
    margin: 0;
    transform: translate(-50%, -7px);
  }

  .install-hint.is-visible {
    transform: translate(-50%, 0);
  }

  .install-hint i {
    width: 1px;
    height: 27px;
  }

  .install-hint i::before {
    left: -4px;
    top: -1px;
    transform: rotate(135deg);
  }

  .install-hint p {
    font-size: 15px;
  }

  .installer {
    display: block;
  }

  .installer__backdrop {
    background: #fff;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .installer__window,
  .is-maximized .installer__window {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(220px, 35svh) 1fr;
    width: 100%;
    height: 100svh;
    min-height: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    transform: translateY(28px);
  }

  .installer__visual {
    padding:
      calc(19px + env(safe-area-inset-top))
      22px
      24px;
    cursor: default;
  }

  .installer__visual::after {
    top: -45%;
    right: -35%;
    width: 100%;
  }

  .window-control {
    width: 14px;
    height: 14px;
  }

  .window-control--minimize,
  .window-control--maximize {
    display: none;
  }

  .installer__identity p {
    font-size: clamp(56px, 18vw, 76px);
  }

  .installer__rule {
    margin: 19px 0 13px;
  }

  .installer__identity > span,
  .installer__serial {
    font-size: 12px;
  }

  .installer__content {
    min-height: 0;
    padding: clamp(30px, 5.5vh, 48px) 25px calc(25px + env(safe-area-inset-bottom));
  }

  .installer__copy {
    margin-top: clamp(24px, 4vh, 42px);
  }

  .installer__copy h1 {
    font-size: clamp(44px, 12vw, 56px);
  }

  .installer__description {
    margin-top: 18px;
    font-size: 17px;
  }

  .installation {
    margin-top: auto;
    padding-top: 25px;
  }

  .installation__status p {
    font-size: 13px;
  }

  .installation__detail {
    font-size: 12px;
  }
}

@media (max-height: 690px) and (max-width: 700px) {
  .installer__window,
  .is-maximized .installer__window {
    grid-template-rows: 185px 1fr;
  }

  .installer__identity p {
    font-size: 48px;
  }

  .installer__rule,
  .installer__identity > span {
    display: none;
  }

  .installer__content {
    padding-top: 23px;
  }

  .installer__copy {
    margin-top: 18px;
  }

  .installer__copy h1 {
    font-size: 38px;
  }

  .installer__description {
    margin-top: 12px;
    font-size: 15px;
  }

  .installation {
    padding-top: 15px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
