:root {
  --ink: #fff;
  --muted: #9a9a9f;
  --shell: #111111;
  --top: #121212;
  --panel: #1a1a1c;
  --soft: #232326;
  --accent: #5b5bf0;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

html { background: #000; }
html, body { margin: 0; min-height: 100%; color: var(--ink); }
body { min-height: 100dvh; overflow-x: hidden; }

.backdrop {
  position: fixed;
  inset: -10vmax;
  width: calc(100% + 20vmax);
  height: calc(100% + 20vmax);
  object-fit: cover;
  /* the picture is small and pre-blurred, so no runtime blur filter is needed */
  z-index: -1;
  background: linear-gradient(160deg, #3a2a2a, #14141a);
}

.shell {
  width: 100%;
  max-width: 440px;
  min-height: 100dvh;
  margin: 0 auto;
  background: var(--shell);
  padding-bottom: 20px;
  overflow: clip;
}

@media (min-width: 560px) {
  .shell { margin: 28px auto; min-height: calc(100dvh - 56px); border-radius: 28px; box-shadow: 0 10px 60px rgba(0, 0, 0, .5); }
}

/* small name bar, slides in once the big name has scrolled away */
.top {
  position: fixed;
  top: 0;
  left: 50%;
  z-index: 5;
  width: 100%;
  max-width: 440px;
  height: 41px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 11px;
  background: var(--top);
  transform: translate(-50%, -100%);
  transition: transform .2s ease;
}
.top.on { transform: translate(-50%, 0); }

.avatar { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; background: var(--soft); }
.name, .js-name { user-select: none; -webkit-user-select: none; touch-action: manipulation; }
.name { font-size: 13px; font-weight: 600; }
.star { font-size: 12px; margin-left: -2px; }
.verified { width: 15px; height: 15px; margin-left: -1px; }

/* Motion. Only transform, opacity, translate and scale are animated, so it all
   runs on the GPU compositor at the display's refresh rate. It is deliberately
   not switched off by prefers-reduced-motion: the owner's machines have that on. */
@keyframes rise { from { opacity: 0; translate: 0 34px; } to { opacity: 1; translate: 0 0; } }
@keyframes pop { from { opacity: 0; scale: .4; } to { opacity: 1; scale: 1; } }
@keyframes settle { from { scale: 1.14; } to { scale: 1; } }
@keyframes drift { from { transform: scale(1) translate3d(0, 0, 0); } to { transform: scale(1.06) translate3d(0, -1.2%, 0); } }
@keyframes float { 0%, 100% { transform: translate3d(0, 0, 0); } 50% { transform: translate3d(0, -7px, 0); } }
@keyframes bob { 0%, 100% { transform: translate3d(0, 0, 0); } 50% { transform: translate3d(0, -3px, 0); } }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.14); } }
@keyframes sheen { 0%, 55% { translate: -130% 0; } 100% { translate: 130% 0; } }

.off, .off::before { animation-play-state: paused; }

.hero { position: relative; aspect-ratio: .93; overflow: hidden; background: linear-gradient(150deg, #4a3a44, #1c1c24); }
.hero > picture { display: block; }
.hero > picture > img {
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform-origin: 50% 30%;
  will-change: transform;
  animation: settle 1.5s cubic-bezier(.2, .7, .2, 1) backwards, drift 18s ease-in-out 1.5s infinite alternate;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(17, 17, 17, 0) 42%, rgba(17, 17, 17, .78) 68%, var(--shell) 96%);
}
.hero-text {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  padding: 0 16px 12px;
  text-align: center;
}
.hero-name { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-size: 28px; font-weight: 700; letter-spacing: -.01em; animation: rise .9s cubic-bezier(.2, .7, .2, 1) .25s backwards; }
.hero-name .star { font-size: 24px; margin-left: 0; }
.hero-name .verified { width: 26px; height: 26px; margin-left: 0; animation: pulse 3.4s ease-in-out 1.6s infinite; }
.handle { margin: 2px 0 14px; font-size: 13px; color: #b5b5ba; animation: rise .9s cubic-bezier(.2, .7, .2, 1) .38s backwards; }
.socials { display: flex; justify-content: center; gap: 14px; }
.social {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  box-shadow: 0 8px 18px -6px rgba(0, 0, 0, .7);
  will-change: transform;
  transition: scale .25s cubic-bezier(.2, .7, .2, 1);
  animation: pop .7s cubic-bezier(.34, 1.56, .64, 1) backwards, bob 4.4s ease-in-out infinite;
}
.social:nth-child(1) { animation-delay: .55s, 0s; }
.social:nth-child(2) { animation-delay: .68s, -1.4s; }
.social:nth-child(3) { animation-delay: .81s, -2.8s; }
.social:nth-child(4) { animation-delay: .94s, -4.2s; }
.social:hover { scale: 1.12; }
.social:active { scale: .94; }
.social svg { width: 29px; height: 29px; }
.all { margin: 16px 0 0; font-size: 12px; font-weight: 600; letter-spacing: .02em; animation: rise .9s cubic-bezier(.2, .7, .2, 1) .95s backwards; }

.bg-instagram { background: #fff; }
.bg-snapchat { background: #fffc00; }
.bg-tiktok { background: #000; }
.bg-lock { background: linear-gradient(160deg, #4aa3ff, #2f6df0); }
.bg-lock svg { width: 25px; height: 25px; }

.tiles { padding: 6px 14px 0; display: grid; gap: 16px; }

.tile {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: 20px;
  color: #fff;
  text-decoration: none;
  background: linear-gradient(150deg, #4a3a44, #1c1c24);
  isolation: isolate;
  box-shadow: 0 22px 44px -18px rgba(0, 0, 0, .85), 0 0 0 1px rgba(255, 255, 255, .06);
  will-change: transform;
  backface-visibility: hidden;
  transition: scale .3s cubic-bezier(.2, .7, .2, 1);
  animation: rise .95s cubic-bezier(.2, .7, .2, 1) backwards, float 6.5s ease-in-out infinite;
}
.tile:nth-child(1) { animation-delay: 1s, 0s; }
.tile:nth-child(2) { animation-delay: 1.14s, -1.6s; }
.tile:nth-child(3) { animation-delay: 1.28s, -3.2s; }
.tile:nth-child(4) { animation-delay: 1.42s, -4.8s; }
.tile:hover { scale: 1.025; }
.tile:active { scale: .975; }

/* light sweep across each card */
.tile::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(105deg, transparent 38%, rgba(255, 255, 255, .17) 50%, transparent 62%);
  animation: sheen 7s ease-in-out infinite;
}
.tile:nth-child(2)::before { animation-delay: 1.2s; }
.tile:nth-child(3)::before { animation-delay: 2.4s; }
.tile:nth-child(4)::before { animation-delay: 3.6s; }

/* vertical crop focus for photos, set per tile in config.js (position) */
.pos-25 { object-position: 50% 25%; }
.pos-30 { object-position: 50% 30%; }
.pos-32 { object-position: 50% 32%; }
.pos-50 { object-position: 50% 50%; }

.tile-large { aspect-ratio: 1.36; }
.tile-card { aspect-ratio: 1.22; }

.tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.tile::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(to top, rgba(0, 0, 0, .6), rgba(0, 0, 0, 0) 46%);
}

.tile .label {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 14px;
  text-align: center;
  font-size: 18px;
  font-weight: 650;
  text-shadow: 0 1px 8px rgba(0, 0, 0, .6);
}

.glyph-emoji { background: #fff; font-size: 23px; line-height: 1; font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }
.hint { font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }
.glyph {
  position: absolute;
  top: 12px;
  left: 12px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  box-shadow: 0 6px 14px -4px rgba(0, 0, 0, .6);
}
.glyph svg { width: 25px; height: 25px; }

.gallery { display: flex; gap: 8px; overflow-x: auto; padding: 14px 11px 4px; scroll-snap-type: x proximity; scrollbar-width: none; }
.gallery::-webkit-scrollbar { display: none; }
.gallery img { flex: 0 0 auto; width: 108px; height: 106px; object-fit: cover; border-radius: 12px; scroll-snap-align: start; background: var(--soft); }

.foot { display: flex; justify-content: center; gap: 6px; padding: 34px 0 10px; font-size: 10px; color: #6b6b70; }
.foot a { color: #6b6b70; text-decoration: underline; }

/* sheets */
.sheet {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(0, 0, 0, .66);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.sheet-full { align-items: center; background: rgba(8, 8, 10, .96); }
.sheet-body {
  width: 100%;
  max-width: 440px;
  padding: 26px 22px calc(26px + env(safe-area-inset-bottom));
  background: var(--panel);
  border-radius: 24px 24px 0 0;
  text-align: center;
}
.sheet-full .sheet-body { background: transparent; }
.sheet h2 { margin: 0 0 8px; font-size: 20px; font-weight: 650; }
.sheet p { margin: 0 0 20px; color: var(--muted); font-size: 14px; line-height: 1.45; }
.sheet .hint { margin: 16px 0 0; font-size: 12px; }

.btn {
  display: block;
  width: 100%;
  padding: 14px;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
.btn + .btn { margin-top: 8px; }
.btn-solid { background: #fff; color: #111; }
.btn-quiet { background: transparent; color: var(--muted); }
.btn:disabled { opacity: .5; }

/* control panel */
.panel {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  justify-content: center;
  background: rgba(0, 0, 0, .72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  overflow-y: auto;
}
.panel-card {
  width: 100%;
  max-width: 440px;
  min-height: 100dvh;
  padding: 18px 16px calc(28px + env(safe-area-inset-bottom));
  background: #0f0f11;
}
@media (min-width: 560px) {
  .panel-card { min-height: 0; margin: 4vh 0; border-radius: 26px; }
}

.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.panel-head h2 { margin: 0; font-size: 18px; font-weight: 650; }
.close { border: 0; background: var(--soft); color: #fff; width: 30px; height: 30px; border-radius: 50%; font-size: 16px; cursor: pointer; }

.login { display: grid; gap: 10px; }
.login input {
  width: 100%;
  padding: 13px 14px;
  border: 0;
  border-radius: 14px;
  background: var(--soft);
  color: #fff;
  font: inherit;
  font-size: 16px;
  outline: none;
}
.login input:focus { box-shadow: 0 0 0 2px #ffffff40; }
.login .err { min-height: 18px; margin: 0; font-size: 13px; color: #ff8a8a; }
.login-lede { margin: 0 0 14px; color: var(--muted); font-size: 14px; }

.range { display: flex; gap: 4px; padding: 4px; background: var(--soft); border-radius: 999px; margin-bottom: 18px; }
.range button { flex: 1; padding: 8px 0; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.range button[aria-pressed="true"] { background: #fff; color: #111; }

.totals { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 20px; }
.total { padding: 14px 4px; text-align: center; background: var(--panel); border-radius: 18px; }
.total b { display: block; font-size: 28px; font-weight: 700; letter-spacing: -.02em; }
.total span { font-size: 12px; color: var(--muted); }

.block { margin-bottom: 20px; }
.block h3 { margin: 0 0 8px 2px; font-size: 14px; font-weight: 650; }
.bars { display: grid; gap: 6px; }
.bar { position: relative; display: flex; justify-content: space-between; gap: 12px; padding: 11px 14px; border-radius: 14px; background: var(--panel); font-size: 14px; overflow: hidden; isolation: isolate; }
.bar i { position: absolute; inset: 0 auto 0 0; background: #ffffff14; z-index: -1; }
.bar em { font-style: normal; color: var(--muted); }
.empty { padding: 14px; border-radius: 14px; background: var(--panel); color: var(--muted); font-size: 13px; }

.spark { display: flex; align-items: flex-end; gap: 3px; height: 72px; padding: 10px 12px; border-radius: 14px; background: var(--panel); }
.spark span { flex: 1; min-height: 2px; background: #ffffffc0; border-radius: 2px; }

.areas { display: grid; gap: 6px; margin-bottom: 10px; }
.area { display: grid; gap: 3px; padding: 12px 14px; border-radius: 14px; background: var(--panel); }
.area b { font-size: 14px; font-weight: 650; }
.area span { font-size: 12.5px; line-height: 1.45; color: var(--muted); }
.note { margin: 0 0 6px 2px; font-size: 12px; color: var(--muted); }
.signout { display: block; margin: 8px auto 0; border: 0; background: none; color: var(--muted); font: inherit; font-size: 13px; text-decoration: underline; cursor: pointer; }

/* legal pages */
.doc { max-width: 560px; margin: 0 auto; padding: 32px 20px 60px; background: var(--shell); min-height: 100dvh; line-height: 1.6; font-size: 15px; }
.doc h1 { font-size: 22px; }
.doc a { color: #cfcfff; }
