/* The notification stack that fans open on the lock screen. The lock screen is a panel of its own on a black page:
   a wallpaper of soft radial lights (no photo, no blur filter), a fine grain, the big clock and the stack. Every
   notification is a slot (moved up and down by GSAP) holding the archive action and the note itself (moved sideways
   by GSAP); the frosted glass is faked with layered gradients and grain, so nothing needs backdrop-filter. */
:root {
  --page: #000000;          /* the page around the lock screen */
  --wall-1: #141431;        /* the deep blue of the wallpaper */
  --wall-2: #5b3d8f;        /* its violet light */
  --wall-3: #ff9a5a;        /* its warm light, the accent */
  --wall-4: #2c6f8f;        /* its teal light */
  --glass: rgba(36, 31, 62, 0.8);   /* the tint of the frosted glass */
  --ink: #f6f3ff;           /* the words */
  --muted: rgba(236, 232, 255, 0.62); /* the small words */
  --accent: #ffb27a;        /* the warm accent: the light on the glass, the badge */
}

* {
  box-sizing: border-box;
}

html {
  touch-action: manipulation;
}

html,
body {
  margin: 0;
  overflow-x: clip;
}

body {
  min-height: 100svh;
  background: var(--page);
  color: var(--ink);
  font-family: 'Mona Sans Variable', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.stage {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 2vh 12px;
  overflow: hidden;
}

.lock {
  position: relative;
  width: min(372px, 92vw);
  height: min(560px, 95vh);
  border-radius: clamp(24px, 6vh, 38px);
  overflow: hidden;
  isolation: isolate;
  background: var(--wall-1);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    0 2px 4px rgba(0, 0, 0, 0.6),
    0 40px 80px -40px rgba(91, 61, 143, 0.55);
  opacity: 0;
  user-select: none;
  -webkit-user-select: none;
}

/* the wallpaper: four soft lights that drift very slowly */
.lock__wall {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(120% 70% at 50% 110%, rgba(255, 154, 90, 0.18), transparent 60%),
    linear-gradient(180deg, #10102a 0%, var(--wall-1) 45%, #1d1638 100%);
}

.lock__blob {
  position: absolute;
  border-radius: 50%;
  will-change: transform;
}

.lock__blob--a {
  width: 120%;
  height: 70%;
  left: -40%;
  top: -12%;
  background: radial-gradient(closest-side, rgba(91, 61, 143, 0.85), rgba(91, 61, 143, 0.3) 55%, transparent);
}

.lock__blob--b {
  width: 110%;
  height: 70%;
  right: -45%;
  top: 30%;
  background: radial-gradient(closest-side, rgba(255, 154, 90, 0.62), rgba(255, 120, 90, 0.2) 55%, transparent);
}

.lock__blob--c {
  width: 100%;
  height: 60%;
  left: -35%;
  bottom: -18%;
  background: radial-gradient(closest-side, rgba(44, 111, 143, 0.7), rgba(44, 111, 143, 0.2) 55%, transparent);
}

.lock__blob--d {
  width: 60%;
  height: 34%;
  right: -6%;
  top: -6%;
  background: radial-gradient(closest-side, rgba(255, 196, 160, 0.3), transparent);
}

.lock__grain {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.16;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 1.2 -0.1'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

.lock__ui {
  position: absolute;
  inset: 0;
  z-index: 2;
}

.lock__home {
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: clamp(6px, 1.6vh, 9px);
  width: 34%;
  height: 4px;
  margin-left: -17%;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.72);
}

/* the clock */
.clock {
  position: absolute;
  left: 0;
  right: 0;
  top: clamp(14px, 4.2vh, 30px);
  text-align: center;
  transform-origin: 50% 0;
  will-change: transform;
}

.clock__lock {
  display: block;
  width: 12px;
  height: 14px;
  margin: 0 auto clamp(3px, 1vh, 8px);
  fill: none;
  stroke: rgba(255, 255, 255, 0.82);
  stroke-width: 1.6;
}

.clock__date {
  margin: 0;
  font-size: clamp(12px, 3.4vh, 16px);
  font-weight: 560;
  font-variation-settings: 'wdth' 104;
  letter-spacing: 0.01em;
  color: rgba(255, 255, 255, 0.86);
}

.clock__time {
  margin: 0;
  font-size: clamp(52px, 17vh, 92px);
  line-height: 0.98;
  font-weight: 640;
  font-variation-settings: 'wdth' 112;
  letter-spacing: -0.02em;
  background: linear-gradient(180deg, #ffffff 30%, #e9dcff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: none;
}

/* the row that appears with the open stack */
.bar {
  position: absolute;
  left: var(--side, 14px);
  right: var(--side, 14px);
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  opacity: 0;
  pointer-events: none;
}

.bar.is-on {
  pointer-events: auto;
}

.bar__title {
  font-size: clamp(14px, 3.6vh, 17px);
  font-weight: 650;
  font-variation-settings: 'wdth' 106;
  color: var(--ink);
  white-space: nowrap;
}

.bar__less {
  appearance: none;
  border: 0;
  padding: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  border-radius: 999px;
  -webkit-tap-highlight-color: transparent;
}

.bar__less-face {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 26px;
  padding: 0 10px 0 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  font-variation-settings: 'wdth' 102;
  color: var(--ink);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.1));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 6px 14px -8px rgba(0, 0, 0, 0.6);
}

.bar__less svg {
  width: 11px;
  height: 11px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.bar__less:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (hover: hover) {
  .bar__less:hover .bar__less-face {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0.15));
  }
}

/* the stack */
.stack {
  list-style: none;
  margin: 0;
  padding: 0;
}

.slot {
  position: absolute;
  left: var(--side, 14px);
  right: var(--side, 14px);
  top: 0;
  height: var(--nh, 66px);
  transform-origin: 50% 100%;
  will-change: transform, opacity;
  opacity: 0;
}

.slot__action {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: min(74px, 22%);
  border-radius: 18px;
  font-size: 10.5px;
  font-weight: 600;
  font-variation-settings: 'wdth' 100;
  color: #2a1606;
  background: linear-gradient(180deg, #ffc89e, var(--wall-3));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), inset 0 0 0 1px rgba(255, 255, 255, 0.25), 0 10px 22px -10px rgba(255, 140, 70, 0.6);
  opacity: 0;
  transform-origin: 100% 50%;
}

.slot__action svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.note {
  position: absolute;
  inset: 0;
  border-radius: 18px;
  outline: none;
  touch-action: pan-y;
  cursor: default;
  will-change: transform;
}

.note:focus-visible .note__glass {
  box-shadow: inset 0 0 0 2px var(--accent);
}

/* the shadow is a layer of its own: GSAP fades it in, the shadow itself is never recomputed */
.note__shadow {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow:
    0 1px 2px rgba(6, 4, 20, 0.3),
    0 10px 22px -8px rgba(6, 4, 20, 0.55),
    0 26px 44px -22px rgba(6, 4, 20, 0.7);
  opacity: 0.4;
}

/* the frosted glass: a tint, a light from above, a grain and a 1px edge brighter on top */
.note__glass {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.05) 60%, rgba(255, 255, 255, 0.07)),
    var(--glass);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.26),
    inset 0 -1px 0 rgba(0, 0, 0, 0.12);
}

.note__glass::after {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.22;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.1' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 1.3 -0.15'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* the light the glass takes when the stack opens */
.note__lit {
  position: absolute;
  inset: 0;
  opacity: 0;
  background:
    radial-gradient(90% 140% at 12% -20%, rgba(255, 210, 180, 0.32), transparent 60%),
    radial-gradient(60% 120% at 100% 120%, rgba(160, 140, 255, 0.16), transparent 60%);
}

.note__sheen {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.note__band {
  position: absolute;
  top: -30%;
  bottom: -30%;
  left: 0;
  width: 38%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.16) 45%, rgba(255, 236, 220, 0.22) 50%, transparent 70%);
  transform: translateX(-130%) skewX(-14deg);
  will-change: transform;
}

.note__body {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 14px 0 11px;
}

.note__icon {
  flex: none;
  display: grid;
  place-items: center;
  width: clamp(32px, 8.4vh, 38px);
  height: clamp(32px, 8.4vh, 38px);
  border-radius: 9px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), inset 0 0 0 1px rgba(255, 255, 255, 0.12), 0 4px 10px -4px rgba(0, 0, 0, 0.5);
}

.note__icon svg {
  width: 64%;
  height: 64%;
  fill: none;
  stroke: #ffffff;
  stroke-width: 1.7;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.note__icon--msg {
  background: linear-gradient(180deg, #7ce59a, #24b35a);
}

.note__icon--msg svg {
  fill: #ffffff;
  stroke: none;
}

.note__icon--cal {
  background: linear-gradient(180deg, #ff8f86, #e8483f);
}

.note__icon--cal .fill {
  fill: #ffffff;
  stroke: none;
}

.note__icon--box {
  background: linear-gradient(180deg, #ffc785, #f08a2c);
}

.note__icon--bank {
  background: linear-gradient(180deg, #8f8bff, #4b43d6);
}

.note__icon--sky {
  background: linear-gradient(180deg, #7fd0ff, #2f86d8);
}

.note__text {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.note__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.note__top strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: clamp(13px, 3.3vh, 14.5px);
  font-weight: 640;
  font-variation-settings: 'wdth' 102;
  letter-spacing: 0.005em;
}

.note__top time {
  flex: none;
  font-size: 11.5px;
  color: var(--muted);
}

.note__line {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: clamp(12px, 3.1vh, 13.5px);
  color: rgba(246, 243, 255, 0.84);
}

/* the badge on the edge of the closed stack, with the number on a roll */
.more {
  position: absolute;
  top: 0;
  right: calc(var(--side, 14px) + 14px);
  z-index: 20;
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 8px 0 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 650;
  font-variation-settings: 'wdth' 104;
  color: #2a1606;
  background: linear-gradient(180deg, #ffd2b0, var(--accent));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 0 0 1px rgba(20, 14, 40, 0.5), 0 6px 14px -6px rgba(255, 150, 80, 0.7);
  opacity: 0;
  will-change: transform;
}

.more__win {
  display: inline-block;
  height: 14px;
  line-height: 14px;
  overflow: hidden;
}

.more__roll {
  display: flex;
  flex-direction: column;
  will-change: transform;
}

.more__roll span {
  height: 14px;
}

.stack__toggle {
  position: absolute;
  left: var(--side, 14px);
  right: var(--side, 14px);
  top: 0;
  height: 0;
  z-index: 30;
  appearance: none;
  border: 0;
  padding: 0;
  background: none;
  border-radius: 18px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.stack__toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.stack__toggle[aria-expanded='true'] {
  visibility: hidden;
}
