/* The Private account toggle of a social app: one card on white, the switch row, the preview of the profile as
   others see it and the follow requests that come in below. GSAP moves the knob, the tiles and the veil; the CSS
   only places them (a GSAP element never has a transform in the CSS). */
:root {
  --fondo: #ffffff;          /* the page */
  --carta: #ffffff;          /* the card */
  --bordo: rgba(17, 17, 19, 0.07);
  --riga: #f5f5f7;           /* the grey of the switch row */
  --binario: #e3e3e8;        /* the track when off */
  --testo: #16161a;
  --testo-2: #6e6e78;
  --testo-3: #a3a3ad;
  --accento: #5b4cf5;        /* the track when on, the lock, the badge */
  --accento-chiaro: #ecebff;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  background: var(--fondo);
  color: var(--testo);
  font-family: "Mona Sans Variable", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}

.stage {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: clamp(8px, 3vmin, 36px);
}

.card {
  position: relative;
  width: min(372px, 100%);
  padding: clamp(12px, 3vmin, 18px);
  background: var(--carta);
  border-radius: 22px;
  box-shadow:
    0 0 0 1px var(--bordo),
    0 1px 2px rgba(17, 17, 19, 0.04),
    0 8px 18px -10px rgba(17, 17, 19, 0.12),
    0 30px 60px -32px rgba(40, 30, 120, 0.28);
}
/* a hair of light along the top edge */
.card::before {
  content: "";
  position: absolute;
  left: 22px;
  right: 22px;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 1), transparent);
  pointer-events: none;
}

/* the top line */
.top { display: flex; align-items: center; gap: 6px; height: 24px; }
.top__back { width: 18px; height: 18px; fill: none; stroke: var(--testo-2); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.top__title { font-size: 15px; font-weight: 660; letter-spacing: -0.015em; }
.brand { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; }
.brand__mark { width: 18px; height: 18px; }
.brand__mark rect { fill: var(--testo); }
.brand__mark circle { fill: none; stroke: #fff; stroke-width: 1.5; }
.brand__name { font-size: 12px; font-weight: 560; color: var(--testo-2); font-stretch: 96%; }

/* the switch row */
.row {
  display: flex;
  align-items: center;
  gap: 11px;
  height: 56px;
  margin-top: clamp(8px, 2.4vmin, 14px);
  padding: 0 10px 0 10px;
  background: var(--riga);
  border-radius: 15px;
}
.row__ic {
  flex: none;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--carta);
  box-shadow: 0 0 0 1px var(--bordo), 0 1px 2px rgba(0, 0, 0, 0.04);
}
.row__ic svg { width: 19px; height: 19px; overflow: visible; fill: none; stroke: var(--testo); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.row__text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.row__name { font-size: 14px; font-weight: 620; letter-spacing: -0.01em; }
.row__hint { display: block; height: 15px; overflow: hidden; font-size: 12px; color: var(--testo-2); }
.row__hint span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.sw {
  flex: none;
  position: relative;
  width: 52px;
  height: 30px;
  border: 0;
  border-radius: 15px;
  background: var(--binario);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  outline: none;
  isolation: isolate;
}
.sw:focus-visible { box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.08), 0 0 0 3px var(--accento-chiaro), 0 0 0 4px var(--accento); }
.sw__glow {
  position: absolute;
  inset: -6px;
  border-radius: 21px;
  background: radial-gradient(closest-side, rgba(91, 76, 245, 0.35), transparent);
  opacity: 0;
  z-index: -1;
  pointer-events: none;
}
.sw__knob {
  position: absolute;
  left: 3px;
  top: 3px;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff, #f4f4f7);
  box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.16), 0 3px 8px rgba(0, 0, 0, 0.12);
}
.sw__lock { width: 14px; height: 14px; overflow: visible; }
.sw__shackle { fill: none; stroke: var(--testo-3); stroke-width: 1.5; stroke-linecap: round; }
.sw__body { fill: var(--testo-3); }

/* the preview */
.preview {
  margin-top: clamp(8px, 2.4vmin, 14px);
  padding: clamp(10px, 2.6vmin, 14px);
  border-radius: 16px;
  box-shadow: 0 0 0 1px var(--bordo);
  background: linear-gradient(180deg, #fcfcfd, #ffffff 40%);
}
.preview__label { display: block; font-size: 11px; font-weight: 560; letter-spacing: 0.01em; color: var(--testo-3); }
.prof { display: flex; align-items: center; gap: 10px; margin-top: clamp(6px, 2vmin, 10px); }
.avatar {
  flex: none;
  width: 38px;
  height: 38px;
  padding: 2px;
  border-radius: 50%;
  background: conic-gradient(from 210deg, #ffb08a, #e2765a, #5b4cf5, #8c90f0, #ffb08a);
}
.avatar__in {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 2px solid #fff;
  background: linear-gradient(160deg, #2a2a33, #111114);
  color: #fff;
  font-size: 12px;
  font-weight: 660;
  letter-spacing: 0.02em;
}
.prof__text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.prof__name { font-size: 13.5px; font-weight: 640; letter-spacing: -0.01em; }
.prof__meta { font-size: 11px; color: var(--testo-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.follow {
  flex: none;
  height: 26px;
  min-width: 66px;
  padding: 0 11px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 13px;
  background: var(--testo);
  color: #fff;
  font-size: 11.5px;
  font-weight: 600;
}
.follow span { display: block; white-space: nowrap; }

.grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
  margin-top: clamp(8px, 2.2vmin, 12px);
  border-radius: 10px;
  overflow: hidden;
}
.tile { position: relative; aspect-ratio: 1; border-radius: 6px; overflow: hidden; background: #eee; will-change: transform; }
.tile svg { will-change: filter, transform; }
.tile svg { display: block; width: 100%; height: 100%; }

.veil {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  text-align: center;
  padding: 6px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.72));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.6);
  border-radius: 10px;
  opacity: 0;
  visibility: hidden;
}
.veil__badge {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  margin-bottom: 4px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 1px var(--bordo), 0 4px 12px -4px rgba(40, 30, 120, 0.35);
}
.veil__badge svg { width: 19px; height: 19px; overflow: visible; fill: none; stroke: var(--accento); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.veil__title { font-size: 12.5px; font-weight: 660; letter-spacing: -0.01em; }
.veil__sub { font-size: 11px; color: var(--testo-2); }

/* the follow requests */
.req { height: 0; overflow: hidden; }
.req__in {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 46px;
  margin-top: clamp(8px, 2.2vmin, 12px);
  padding: 0 10px;
  border-radius: 14px;
  background: var(--accento-chiaro);
}
.req__faces { display: inline-flex; }
.face {
  width: 26px;
  height: 26px;
  margin-left: -6px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 2px solid var(--accento-chiaro);
  background: var(--f);
  color: #fff;
  font-size: 9px;
  letter-spacing: 0.01em;
  font-weight: 700;
}
.face:first-child { margin-left: 0; }
.req__text { flex: 1; font-size: 13px; font-weight: 580; color: #2c2378; }
.req__count {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  margin-right: 3px;
  padding: 0 5px;
  border-radius: 10px;
  background: var(--accento);
  color: #fff;
  font-size: 11px;
  font-weight: 680;
}
.req__go { width: 16px; height: 16px; fill: none; stroke: #2c2378; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* the drawn pointer of the autopilot */
.ghost {
  position: fixed;
  left: 0;
  top: 0;
  width: 22px;
  height: 22px;
  pointer-events: none;
  fill: #111113;
  stroke: #fff;
  stroke-width: 1.4;
  stroke-linejoin: round;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.25));
  opacity: 0;
  z-index: 5;
}

@media (hover: hover) {
  .sw:hover .sw__knob { box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.18), 0 5px 12px rgba(0, 0, 0, 0.16); }
}

@media (max-height: 460px) {
  .preview__label { display: none; }
  .top { display: none; }
  .row { margin-top: 0; }
}
.face { position: relative; }
.face:nth-child(1) { z-index: 3; }
.face:nth-child(2) { z-index: 2; }
.face:nth-child(3) { z-index: 1; }
