:root {
  color-scheme: light dark;
  --bg: #f3f4f6;
  --surface: #ffffff;
  --text: #14161a;
  --muted: #6b7178;
  --faint: #9aa0a8;
  --line: rgba(18, 20, 24, .08);
  --field: #f1f3f5;
  --btn: #14161a;
  --btn-text: #ffffff;
  --cta-shadow: 0 12px 26px -14px rgba(20, 22, 26, .55);
  --ok: #12a150;
  --focus: #3b82f6;
  --shadow: 0 1px 2px rgba(18, 20, 24, .04), 0 12px 30px -18px rgba(18, 20, 24, .28);
  --radius: 20px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0c0e;
    --surface: #141619;
    --text: #eceef1;
    --muted: #9aa0a8;
    --faint: #6b7178;
    --line: rgba(255, 255, 255, .09);
    --field: #1c1f24;
    --btn: #eceef1;
    --btn-text: #141619;
    --cta-shadow: 0 12px 30px -14px rgba(0, 0, 0, .7);
    --ok: #2ec26e;
    --focus: #5b9dff;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 16px 36px -20px rgba(0, 0, 0, .75);
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  padding: 40px 20px calc(40px + env(safe-area-inset-bottom));
  display: flex;
  justify-content: center;
  background: var(--bg);
  color: var(--text);
  font-family: "Noto Sans Georgian", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

main {
  width: 100%;
  max-width: 430px;
  margin: auto; /* not align-items:center — a long list must not overflow off-screen */
  animation: rise .5s cubic-bezier(.2, .7, .2, 1) both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

/* header ------------------------------------------------ */
.eyebrow {
  margin: 0 0 8px;
  font-size: .72rem;
  font-weight: 500;
  letter-spacing: .12em;
  color: var(--faint);
}

.name {
  margin: 0 0 26px;
  font-size: 1.7rem;
  font-weight: 600;
  letter-spacing: -.01em;
}

.namebtn {
  display: inline-flex;
  align-items: center;
  gap: .45ch;
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.namebtn .ico { width: 17px; height: 17px; color: var(--faint); transition: color .18s; }
.namebtn:hover .ico,
.namebtn:focus-visible .ico { color: var(--muted); }
.namebtn.copied .ico { color: var(--ok); }

/* accounts card ----------------------------------------- */
.card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.acct {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.acct-btn {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto;
  column-gap: 12px;
  row-gap: 3px;
  align-items: center;
  padding: 15px 18px;
  background: none;
  border: 0;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: background .15s;
}
.acct-btn:hover { background: rgba(124, 132, 145, .08); }
.acct-btn:active { background: rgba(124, 132, 145, .14); }

.acct-head {
  grid-column: 1;
  grid-row: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .82rem;
  font-weight: 600;
  color: var(--muted);
}

.dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.dot.tbc     { background: #00a3e0; }
.dot.bog     { background: #ff6a13; }
.dot.hash    { background: #7b61ff; }
.dot.liberty { background: #e4002b; }

.iban {
  grid-column: 1;
  grid-row: 2;
  font-family: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  font-size: .98rem;
  letter-spacing: .02em;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
  word-break: break-word;
}

.ico {
  grid-column: 2;
  grid-row: 1 / 3;
  align-self: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.acct-btn .ico {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--field);
  color: var(--muted);
  transition: background .18s, color .18s;
}
.acct-btn:hover .ico { color: var(--text); }

.ico svg { width: 17px; height: 17px; }
.i-check { display: none; }
.copied .i-copy { display: none; }
.copied .i-check { display: block; }
.acct-btn.copied .ico { background: var(--ok); color: #fff; }

/* TBC app deep-link ------------------------------------- */
.applink {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin: -1px 18px 14px;
  font-size: .8rem;
  color: var(--muted);
  text-decoration: none;
  transition: color .15s;
}
.applink:hover { color: var(--text); }
.applink .arw { width: 13px; height: 13px; }

/* card-to-card CTA -------------------------------------- */
.cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: 16px;
  padding: 16px 20px;
  background: var(--btn);
  color: var(--btn-text);
  border-radius: 15px;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  box-shadow: var(--cta-shadow);
  transition: transform .12s, opacity .15s;
}
.cta:hover { opacity: .93; }
.cta:active { transform: translateY(1px); }
.cta .arw { width: 16px; height: 16px; }

/* misc -------------------------------------------------- */
.copy:focus-visible,
.cta:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: 8px;
}
.acct-btn:focus-visible { outline-offset: -2px; border-radius: 0; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* note from the bot ------------------------------------- */
.note {
  display: block;
  margin: 0 0 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
  color: inherit;
  text-decoration: none;
  transition: background .15s;
}
a.note:hover { background: rgba(124, 132, 145, .06); }

.shot {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  background: var(--field);
}
.shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.more {
  position: absolute;
  right: 10px;
  bottom: 10px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(10, 11, 13, .62);
  color: #fff;
  font-size: .74rem;
  font-weight: 600;
  backdrop-filter: blur(6px);
}

/* one photo keeps its shape; an album tiles, so four of them are not four screens */
.shots { display: grid; gap: 3px; }
.shots.many { grid-template-columns: 1fr 1fr; }

.shot-full {
  width: 100%;
  height: auto;
  display: block;
  background: var(--field);
}

.shots.many .shot-full {
  aspect-ratio: 1;
  object-fit: cover;
}
.shots.many .shot-full:last-child:nth-child(odd) {
  grid-column: span 2;
  aspect-ratio: 16 / 10;
}

.note-text {
  margin: 0;
  padding: 14px 17px;
  font-size: .95rem;
  overflow-wrap: anywhere;
}
.shot + .note-text, .shots + .note-text { padding-top: 13px; }

.note-foot { display: block; padding: 0 17px 13px; }
.shot + .note-foot { padding-top: 12px; }

.ago {
  font-size: .74rem;
  font-weight: 500;
  color: var(--faint);
}

.lnk { color: inherit; text-decoration-color: var(--faint); }
.lnk .arw { width: 11px; height: 11px; vertical-align: -1px; }

/* home list --------------------------------------------- */
.people {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.person {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 15px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  color: inherit;
  text-decoration: none;
  transition: background .15s;
}
.person:hover { background: rgba(124, 132, 145, .08); }
.person:active { background: rgba(124, 132, 145, .14); }

.p-thumb {
  width: 46px;
  height: 46px;
  flex: none;
  border-radius: 12px;
  object-fit: cover;
  background: var(--field);
}

.p-body { flex: 1; min-width: 0; }

.p-name {
  display: block;
  font-size: .96rem;
  font-weight: 600;
  letter-spacing: -.01em;
}

.p-note {
  margin-left: 7px;
  font-size: .76rem;
  font-weight: 500;
  color: var(--faint);
}

.p-line {
  display: block;
  margin-top: 2px;
  font-size: .82rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.p-line.quiet { color: var(--faint); }

.person .ago { flex: none; padding-top: 2px; }

/* back to the list -------------------------------------- */
.foot {
  display: inline-block;
  margin-top: 22px;
  font-size: .8rem;
  color: var(--faint);
  text-decoration: none;
  transition: color .15s;
}
.foot:hover { color: var(--muted); }

.person:focus-visible,
.note:focus-visible,
.foot:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.note-text.clamp {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* the note, once it arrives ----------------------------- */
#note .note {
  margin: 16px 0 0;
  animation: settle .25s cubic-bezier(.2, .7, .2, 1) both;
}

@keyframes settle {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

/* photo viewer ------------------------------------------ */
.zoomable { cursor: zoom-in; }
.locked, .locked body { overflow: hidden; }

.viewer {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(8, 9, 11, .94);
  backdrop-filter: blur(10px);
  -webkit-tap-highlight-color: transparent;
  animation: veil .18s ease-out both;
}

@keyframes veil {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.viewer-stage {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  touch-action: none; /* the gestures below are ours, not the browser's */
}

.viewer-img {
  display: block;
  max-width: 100vw;
  max-height: 100dvh;
  cursor: zoom-in;
  user-select: none;
  -webkit-user-drag: none;
  will-change: transform;
}
.viewer-img.zoomed { cursor: grab; }

.viewer-btn {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .13);
  color: #fff;
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: background .15s;
}
.viewer-btn:hover { background: rgba(255, 255, 255, .22); }
.viewer-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.viewer-btn svg { width: 22px; height: 22px; }
.viewer-btn[hidden] { display: none; }

.viewer-close { top: calc(14px + env(safe-area-inset-top)); right: 14px; }
.viewer-prev { left: 12px; top: 50%; transform: translateY(-50%); }
.viewer-next { right: 12px; top: 50%; transform: translateY(-50%) rotate(180deg); }

.viewer-count {
  position: absolute;
  left: 50%;
  bottom: calc(18px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  padding: 5px 13px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .13);
  color: #fff;
  font-size: .78rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  backdrop-filter: blur(6px);
}
.viewer-count[hidden] { display: none; }
