/* The tutorial's Finder window and ClamVault panel, drawn after macOS Tahoe. */

:root {
  --f-text: #1d1d1f;
  --f-muted: #86868b;
  --f-icon: #6e6e73;
  --f-content: #ffffff;
  --f-side: #f1f1f3;
  --f-line: rgba(0, 0, 0, 0.09);
  --f-capsule: #ffffff;
  --f-capsule-ring: rgba(0, 0, 0, 0.1);
  --f-capsule-shadow: 0 1px 4px rgba(0, 0, 0, 0.07);
  --f-capsule-on: rgba(0, 0, 0, 0.07);
  --f-row-on: rgba(0, 0, 0, 0.07);
  --f-icon-sel: rgba(0, 0, 0, 0.08);
  --f-accent: #0a7aff;
  --f-label-sel: #0064e1;
  --f-menu: rgba(244, 244, 246, 0.98);
  --f-menu-ring: rgba(0, 0, 0, 0.14);
  --f-sheet: #f5f5f7;
  --f-box: rgba(255, 255, 255, 0.85);
  --f-box-ring: rgba(0, 0, 0, 0.07);
  --f-button: rgba(0, 0, 0, 0.06);
  --f-field: #ffffff;
  --f-track: rgba(0, 0, 0, 0.09);
  --f-bar: #8e8e93;
  --f-light-off: rgba(0, 0, 0, 0.12);
  --f-window-shadow: 0 50px 100px -30px rgba(0, 0, 0, 0.35), 0 0 0 0.5px rgba(0, 0, 0, 0.16);
  --f-float-shadow: 0 24px 60px -12px rgba(0, 0, 0, 0.32), 0 0 0 0.5px var(--f-menu-ring);
}

@media (prefers-color-scheme: dark) {
  :root {
    --f-text: #ececee;
    --f-muted: #98989d;
    --f-icon: #98989d;
    --f-content: #1f2022;
    --f-side: #2b2c2e;
    --f-line: rgba(255, 255, 255, 0.07);
    --f-capsule: #2e2f31;
    --f-capsule-ring: rgba(255, 255, 255, 0.09);
    --f-capsule-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
    --f-capsule-on: rgba(255, 255, 255, 0.12);
    --f-row-on: rgba(255, 255, 255, 0.09);
    --f-icon-sel: rgba(255, 255, 255, 0.12);
    --f-accent: #0a84ff;
    --f-label-sel: #0a6bd9;
    --f-menu: rgba(40, 40, 43, 0.98);
    --f-menu-ring: rgba(255, 255, 255, 0.14);
    --f-sheet: #29292c;
    --f-box: rgba(255, 255, 255, 0.06);
    --f-box-ring: rgba(255, 255, 255, 0.08);
    --f-button: rgba(255, 255, 255, 0.1);
    --f-field: rgba(255, 255, 255, 0.06);
    --f-track: rgba(255, 255, 255, 0.12);
    --f-bar: #98989d;
    --f-light-off: rgba(255, 255, 255, 0.16);
    --f-window-shadow: 0 50px 100px -30px rgba(0, 0, 0, 0.9), 0 0 0 0.5px rgba(255, 255, 255, 0.16);
  }
}

.stage svg { display: block; }

/* Window */

.fw {
  position: absolute;
  left: 40px;
  top: 30px;
  width: 900px;
  height: 560px;
  border-radius: 26px;
  background: var(--f-content);
  box-shadow: var(--f-window-shadow);
  overflow: hidden;
}

.lights {
  position: absolute;
  top: 19px;
  left: 19px;
  display: flex;
  gap: 9px;
}

.lights i {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--f-light-off);
}

.lights.on i:nth-child(1) { background: #ff5f57; }
.lights.on i:nth-child(2) { background: #febc2e; }
.lights.on i:nth-child(3) { background: #28c840; }
.lights .close { background: #ff5f57; }

/* Sidebar */

.fs {
  position: absolute;
  inset: 0 auto 0 0;
  width: 160px;
  padding-top: 52px;
  background: var(--f-side);
  border-right: 0.5px solid var(--f-line);
}

.fs-h {
  margin: 14px 0 4px 16px;
  font-size: 11px;
  font-weight: 600;
  color: var(--f-muted);
}

.fs-row {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 30px;
  margin: 0 8px;
  padding: 0 8px;
  border-radius: 9px;
  font-size: 13px;
}

.fs-row svg {
  width: 18px;
  height: 18px;
  flex: none;
  color: var(--f-icon);
}

.fs-row.on { background: var(--f-row-on); }

/* Toolbar */

.ft {
  position: absolute;
  left: 160px;
  right: 0;
  top: 0;
  height: 52px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 8px;
}

.cap {
  height: 36px;
  display: flex;
  align-items: center;
  border-radius: 18px;
  background: var(--f-capsule);
  box-shadow: inset 0 0 0 0.5px var(--f-capsule-ring), var(--f-capsule-shadow);
  color: var(--f-icon);
}

.cap > span {
  height: 36px;
  min-width: 36px;
  padding: 0 9px;
  display: grid;
  place-items: center;
}

.cap svg { width: 18px; height: 18px; }

.cap .on {
  height: 30px;
  min-width: 34px;
  margin: 0 3px;
  padding: 0 6px;
  border-radius: 15px;
  background: var(--f-capsule-on);
}

.cap .div {
  min-width: 0;
  width: 0.5px;
  height: 18px;
  padding: 0;
  background: var(--f-line);
}

.cap.round { width: 36px; justify-content: center; }

.ft-title {
  margin: 0 auto 0 6px;
  font-size: 15px;
  font-weight: 700;
}

.dim { opacity: 0.35; }

/* Icon view */

.fc {
  position: absolute;
  left: 160px;
  right: 0;
  top: 52px;
  bottom: 0;
}

.grid {
  display: none;
  grid-template-columns: repeat(6, 112px);
  padding: 18px 0 0 9px;
  row-gap: 14px;
}

.grid.on { display: grid; }

.it {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.it-ic {
  position: relative;
  width: 72px;
  height: 64px;
  display: grid;
  place-items: center;
  border-radius: 8px;
}

.it-ic > svg { width: 62px; height: 50px; }
.it-ic > svg.file { width: 44px; height: 56px; }

.it-nm {
  max-width: 108px;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 13px;
  line-height: 17px;
  text-align: center;
  white-space: nowrap;
}

.it.sel .it-ic { background: var(--f-icon-sel); }
.it.sel .it-nm { background: var(--f-label-sel); color: #fff; }

.badge {
  position: absolute;
  right: 2px;
  bottom: 3px;
  width: 24px;
  height: 24px;
  transform: scale(0);
  transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.badge svg { width: 24px; height: 24px; }

.it.locked .badge { transform: scale(1); }

/* Control-click menu */

.menu {
  position: absolute;
  z-index: 5;
  width: 236px;
  padding: 5px;
  border-radius: 13px;
  background: var(--f-menu);
  box-shadow: var(--f-float-shadow);
  font-size: 13px;
  opacity: 0;
  transform: scale(0.98);
  transition: opacity 0.15s ease, transform 0.15s ease;
  pointer-events: none;
}

.menu.on { opacity: 1; transform: none; }

.mi {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 22px;
  padding: 0 8px;
  border-radius: 7px;
  white-space: nowrap;
}

.mi svg {
  width: 15px;
  height: 15px;
  flex: none;
  color: var(--f-icon);
}

.mi .pad { width: 15px; flex: none; }

.mi .more { margin-left: auto; color: var(--f-muted); }

.mi.hi { background: var(--f-accent); color: #fff; }
.mi.hi svg { color: #fff; }

.ms {
  height: 0.5px;
  margin: 4px 8px;
  background: var(--f-line);
}

.tags {
  display: flex;
  gap: 9px;
  height: 24px;
  align-items: center;
  padding: 0 9px;
}

.tags i {
  width: 13px;
  height: 13px;
  border-radius: 50%;
}

/* ClamVault panel: a glass window with only its close button live */

.cv {
  position: absolute;
  z-index: 6;
  left: 50%;
  top: 50%;
  width: 420px;
  padding: 44px 20px 20px;
  border-radius: 24px;
  background: var(--f-sheet);
  box-shadow: var(--f-float-shadow);
  opacity: 0;
  transform: translate(-50%, -48%) scale(0.97);
  transition: opacity 0.25s ease, transform 0.35s cubic-bezier(0.2, 0.9, 0.3, 1);
  pointer-events: none;
}

.cv.on { opacity: 1; transform: translate(-50%, -50%); }

.cv .lights { top: 16px; left: 16px; gap: 8px; }
.cv .lights i { width: 12px; height: 12px; }

.pg { display: none; }
.pg.on { display: flex; flex-direction: column; gap: 14px; }

.pg h5 {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  line-height: 22px;
}

.box {
  padding: 12px;
  border-radius: 12px;
  background: var(--f-box);
  box-shadow: inset 0 0 0 0.5px var(--f-box-ring);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sec { display: flex; flex-direction: column; gap: 7px; }

.sec-h { margin: 0; font-size: 13px; font-weight: 600; }

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

.row svg { width: 34px; height: 28px; flex: none; }

.row b { display: block; font-size: 13px; font-weight: 500; }
.row small { display: block; font-size: 11.5px; color: var(--f-muted); }

.radio {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
}

.radio i {
  position: relative;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--f-field);
  box-shadow: inset 0 0 0 0.5px var(--f-capsule-ring), 0 0.5px 1.5px rgba(0, 0, 0, 0.15);
}

.radio.on i { background: var(--f-accent); box-shadow: none; }

.radio.on i::after {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  background: #fff;
}

.help {
  margin: 3px 0 0 23px;
  font-size: 11.5px;
  line-height: 14px;
  color: var(--f-muted);
}

.field {
  width: 100%;
  border: 0;
  outline: 0;
  margin: 0;
  color: var(--f-text);
  font-family: inherit;
  height: 28px;
  padding: 0 9px;
  border-radius: 8px;
  background: var(--f-field);
  box-shadow: inset 0 0 0 0.5px var(--f-capsule-ring);
  display: flex;
  align-items: center;
  font-size: 15px;
  letter-spacing: 2px;
  transition: box-shadow 0.2s ease;
}

.field.focus {
  box-shadow: inset 0 0 0 0.5px var(--f-capsule-ring), 0 0 0 3.5px color-mix(in srgb, var(--f-accent) 45%, transparent);
}

.bar {
  height: 6px;
  border-radius: 3px;
  background: var(--f-track);
  overflow: hidden;
}

.bar i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: 3px;
  background: var(--f-bar);
}

.step {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
}

.step span:last-child { color: var(--f-muted); }

.note { margin: 0; font-size: 11.5px; color: var(--f-muted); }

.acts {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.acts .grow { flex: 1; }

.btn {
  height: 28px;
  min-width: 72px;
  padding: 0 14px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 500;
  background: var(--f-button);
  transition: transform 0.12s ease, filter 0.12s ease;
}

.btn.primary { background: var(--f-accent); color: #fff; }
.btn.press { transform: scale(0.95); filter: brightness(0.9); }

/* Finder's alert */

.alert {
  position: absolute;
  z-index: 7;
  left: 50%;
  top: 50%;
  width: 262px;
  padding: 20px;
  border-radius: 24px;
  background: var(--f-sheet);
  box-shadow: var(--f-float-shadow);
  opacity: 0;
  transform: translate(-50%, -48%) scale(0.95);
  transition: opacity 0.2s ease, transform 0.3s cubic-bezier(0.2, 0.9, 0.3, 1);
  pointer-events: none;
}

.alert.on { opacity: 1; transform: translate(-50%, -50%); }

.alert svg { width: 54px; height: 44px; margin-bottom: 12px; }

.alert p {
  margin: 0 0 18px;
  font-size: 13px;
  font-weight: 600;
  line-height: 17px;
}

.alert .btn { width: 100%; }

/* Trying it: the visitor's own pointer drives the window */

.menu.on, .cv.on, .alert.on { pointer-events: auto; }

.stage.live { cursor: default; }
.stage.live .pointer { display: none; }
.stage.live .menu .mi:hover { background: var(--f-accent); color: #fff; }
.stage.live .menu .mi:hover svg { color: #fff; }
.stage.live .btn:active { transform: scale(0.95); filter: brightness(0.9); }

.field.wrong { animation: wrong 0.4s ease; }

@keyframes wrong {
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

/* Pointer */

.pointer {
  position: absolute;
  z-index: 9;
  left: 0;
  top: 0;
  width: 24px;
  height: 30px;
  transform: translate(780px, 540px);
  transition: transform 0.9s cubic-bezier(0.45, 0, 0.2, 1);
  will-change: transform;
}

.pointer svg {
  width: 100%;
  height: 100%;
  transform-origin: 6px 4px;
  transition: transform 0.1s ease;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.3));
}

.pointer.press svg { transform: scale(0.86); }

@media (prefers-reduced-motion: reduce) {
  .pointer { display: none; }
}
